var requirejs, require, define;
(function(undef) {
    var main, req, makeMap, handlers, defined = {},
        waiting = {},
        config = {},
        defining = {},
        hasOwn = Object.prototype.hasOwnProperty,
        aps = [].slice,
        jsSuffixRegExp = /\.js$/;

    function hasProp(obj, prop) {
        return hasOwn.call(obj, prop)
    }

    function normalize(name, baseName) {
        var nameParts, nameSegment, mapValue, foundMap, lastIndex, foundI, foundStarMap, starI, i, j, part, baseParts = baseName && baseName.split("/"),
            map = config.map,
            starMap = map && map["*"] || {};
        if (name && name.charAt(0) === ".") {
            if (baseName) {
                baseParts = baseParts.slice(0, baseParts.length - 1);
                name = name.split("/");
                lastIndex = name.length - 1;
                if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
                    name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, "")
                }
                name = baseParts.concat(name);
                for (i = 0; i < name.length; i += 1) {
                    part = name[i];
                    if (part === ".") {
                        name.splice(i, 1);
                        i -= 1
                    } else if (part === "..") {
                        if (i === 1 && (name[2] === ".." || name[0] === "..")) {
                            break
                        } else if (i > 0) {
                            name.splice(i - 1, 2);
                            i -= 2
                        }
                    }
                }
                name = name.join("/")
            } else if (name.indexOf("./") === 0) {
                name = name.substring(2)
            }
        }
        if ((baseParts || starMap) && map) {
            nameParts = name.split("/");
            for (i = nameParts.length; i > 0; i -= 1) {
                nameSegment = nameParts.slice(0, i).join("/");
                if (baseParts) {
                    for (j = baseParts.length; j > 0; j -= 1) {
                        mapValue = map[baseParts.slice(0, j).join("/")];
                        if (mapValue) {
                            mapValue = mapValue[nameSegment];
                            if (mapValue) {
                                foundMap = mapValue;
                                foundI = i;
                                break
                            }
                        }
                    }
                }
                if (foundMap) {
                    break
                }
                if (!foundStarMap && starMap && starMap[nameSegment]) {
                    foundStarMap = starMap[nameSegment];
                    starI = i
                }
            }
            if (!foundMap && foundStarMap) {
                foundMap = foundStarMap;
                foundI = starI
            }
            if (foundMap) {
                nameParts.splice(0, foundI, foundMap);
                name = nameParts.join("/")
            }
        }
        return name
    }

    function makeRequire(relName, forceSync) {
        return function() {
            return req.apply(undef, aps.call(arguments, 0).concat([relName, forceSync]))
        }
    }

    function makeNormalize(relName) {
        return function(name) {
            return normalize(name, relName)
        }
    }

    function makeLoad(depName) {
        return function(value) {
            defined[depName] = value
        }
    }

    function callDep(name) {
        if (hasProp(waiting, name)) {
            var args = waiting[name];
            delete waiting[name];
            defining[name] = true;
            main.apply(undef, args)
        }
        if (!hasProp(defined, name) && !hasProp(defining, name)) {
            throw new Error("No " + name)
        }
        return defined[name]
    }

    function splitPrefix(name) {
        var prefix, index = name ? name.indexOf("!") : -1;
        if (index > -1) {
            prefix = name.substring(0, index);
            name = name.substring(index + 1, name.length)
        }
        return [prefix, name]
    }
    makeMap = function(name, relName) {
        var plugin, parts = splitPrefix(name),
            prefix = parts[0];
        name = parts[1];
        if (prefix) {
            prefix = normalize(prefix, relName);
            plugin = callDep(prefix)
        }
        if (prefix) {
            if (plugin && plugin.normalize) {
                name = plugin.normalize(name, makeNormalize(relName))
            } else {
                name = normalize(name, relName)
            }
        } else {
            name = normalize(name, relName);
            parts = splitPrefix(name);
            prefix = parts[0];
            name = parts[1];
            if (prefix) {
                plugin = callDep(prefix)
            }
        }
        return {
            f: prefix ? prefix + "!" + name : name,
            n: name,
            pr: prefix,
            p: plugin
        }
    };

    function makeConfig(name) {
        return function() {
            return config && config.config && config.config[name] || {}
        }
    }
    handlers = {
        require: function(name) {
            return makeRequire(name)
        },
        exports: function(name) {
            var e = defined[name];
            if (typeof e !== "undefined") {
                return e
            } else {
                return defined[name] = {}
            }
        },
        module: function(name) {
            return {
                id: name,
                uri: "",
                exports: defined[name],
                config: makeConfig(name)
            }
        }
    };
    main = function(name, deps, callback, relName) {
        var cjsModule, depName, ret, map, i, args = [],
            callbackType = typeof callback,
            usingExports;
        relName = relName || name;
        if (callbackType === "undefined" || callbackType === "function") {
            deps = !deps.length && callback.length ? ["require", "exports", "module"] : deps;
            for (i = 0; i < deps.length; i += 1) {
                map = makeMap(deps[i], relName);
                depName = map.f;
                if (depName === "require") {
                    args[i] = handlers.require(name)
                } else if (depName === "exports") {
                    args[i] = handlers.exports(name);
                    usingExports = true
                } else if (depName === "module") {
                    cjsModule = args[i] = handlers.module(name)
                } else if (hasProp(defined, depName) || hasProp(waiting, depName) || hasProp(defining, depName)) {
                    args[i] = callDep(depName)
                } else if (map.p) {
                    map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
                    args[i] = defined[depName]
                } else {
                    throw new Error(name + " missing " + depName)
                }
            }
            ret = callback ? callback.apply(defined[name], args) : undefined;
            if (name) {
                if (cjsModule && cjsModule.exports !== undef && cjsModule.exports !== defined[name]) {
                    defined[name] = cjsModule.exports
                } else if (ret !== undef || !usingExports) {
                    defined[name] = ret
                }
            }
        } else if (name) {
            defined[name] = callback
        }
    };
    requirejs = require = req = function(deps, callback, relName, forceSync, alt) {
        if (typeof deps === "string") {
            if (handlers[deps]) {
                return handlers[deps](callback)
            }
            return callDep(makeMap(deps, callback).f)
        } else if (!deps.splice) {
            config = deps;
            if (config.deps) {
                req(config.deps, config.callback)
            }
            if (!callback) {
                return
            }
            if (callback.splice) {
                deps = callback;
                callback = relName;
                relName = null
            } else {
                deps = undef
            }
        }
        callback = callback || function() {};
        if (typeof relName === "function") {
            relName = forceSync;
            forceSync = alt
        }
        if (forceSync) {
            main(undef, deps, callback, relName)
        } else {
            setTimeout(function() {
                main(undef, deps, callback, relName)
            }, 4)
        }
        return req
    };
    req.config = function(cfg) {
        return req(cfg)
    };
    requirejs._defined = defined;
    define = function(name, deps, callback) {
        if (!deps.splice) {
            callback = deps;
            deps = []
        }
        if (!hasProp(defined, name) && !hasProp(waiting, name)) {
            waiting[name] = [name, deps, callback]
        }
    };
    define.amd = {
        jQuery: true
    }
})();
define("util", ["exports", "module"], function(exports, module) {
    var formatRegExp = /%[sdj%]/g;
    exports.format = function(f) {
        if (typeof f !== "string") {
            var objects = [];
            for (var i = 0; i < arguments.length; i++) {
                objects.push(inspect(arguments[i]))
            }
            return objects.join(" ")
        }
        var i = 1;
        var args = arguments;
        var len = args.length;
        var str = String(f).replace(formatRegExp, function(x) {
            if (x === "%%") return "%";
            if (i >= len) return x;
            switch (x) {
                case "%s":
                    return String(args[i++]);
                case "%d":
                    return Number(args[i++]);
                case "%j":
                    return JSON.stringify(args[i++]);
                default:
                    return x
            }
        });
        for (var x = args[i]; i < len; x = args[++i]) {
            if (x === null || typeof x !== "object") {
                str += " " + x
            } else {
                str += " " + inspect(x)
            }
        }
        return str
    };

    function inspect(obj, opts) {
        var ctx = {
            seen: [],
            stylize: stylizeNoColor
        };
        if (arguments.length >= 3) ctx.depth = arguments[2];
        if (arguments.length >= 4) ctx.colors = arguments[3];
        if (typeof opts === "boolean") {
            ctx.showHidden = opts
        } else if (opts) {
            exports._extend(ctx, opts)
        }
        if (typeof ctx.showHidden === "undefined") ctx.showHidden = false;
        if (typeof ctx.depth === "undefined") ctx.depth = 2;
        if (typeof ctx.colors === "undefined") ctx.colors = false;
        if (typeof ctx.customInspect === "undefined") ctx.customInspect = true;
        if (ctx.colors) ctx.stylize = stylizeWithColor;
        return formatValue(ctx, obj, ctx.depth)
    }
    exports.inspect = inspect;
    inspect.colors = {
        bold: [1, 22],
        italic: [3, 23],
        underline: [4, 24],
        inverse: [7, 27],
        white: [37, 39],
        grey: [90, 39],
        black: [30, 39],
        blue: [34, 39],
        cyan: [36, 39],
        green: [32, 39],
        magenta: [35, 39],
        red: [31, 39],
        yellow: [33, 39]
    };
    inspect.styles = {
        special: "cyan",
        number: "yellow",
        "boolean": "yellow",
        undefined: "grey",
        "null": "bold",
        string: "green",
        date: "magenta",
        regexp: "red"
    };

    function stylizeWithColor(str, styleType) {
        var style = inspect.styles[styleType];
        if (style) {
            return "[" + inspect.colors[style][0] + "m" + str + "[" + inspect.colors[style][1] + "m"
        } else {
            return str
        }
    }

    function stylizeNoColor(str, styleType) {
        return str
    }

    function arrayToHash(array) {
        var hash = {};
        array.forEach(function(val, idx) {
            hash[val] = true
        });
        return hash
    }

    function formatValue(ctx, value, recurseTimes) {
        if (ctx.customInspect && value && typeof value.inspect === "function" && value.inspect !== exports.inspect && !(value.constructor && value.constructor.prototype === value)) {
            var ret = value.inspect(recurseTimes);
            if ("string" !== typeof ret) {
                ret = formatValue(ctx, ret, recurseTimes)
            }
            return ret
        }
        var primitive = formatPrimitive(ctx, value);
        if (primitive) {
            return primitive
        }
        var keys = Object.keys(value);
        var visibleKeys = arrayToHash(keys);
        if (ctx.showHidden) {
            keys = Object.getOwnPropertyNames(value)
        }
        if (keys.length === 0) {
            if (typeof value === "function") {
                var name = value.name ? ": " + value.name : "";
                return ctx.stylize("[Function" + name + "]", "special")
            }
            if (isRegExp(value)) {
                return ctx.stylize(RegExp.prototype.toString.call(value), "regexp")
            }
            if (isDate(value)) {
                return ctx.stylize(Date.prototype.toString.call(value), "date")
            }
            if (isError(value)) {
                return formatError(value)
            }
        }
        var base = "",
            array = false,
            braces = ["{", "}"];
        if (isArray(value)) {
            array = true;
            braces = ["[", "]"]
        }
        if (typeof value === "function") {
            var n = value.name ? ": " + value.name : "";
            base = " [Function" + n + "]"
        }
        if (isRegExp(value)) {
            base = " " + RegExp.prototype.toString.call(value)
        }
        if (isDate(value)) {
            base = " " + Date.prototype.toUTCString.call(value)
        }
        if (isError(value)) {
            base = " " + formatError(value)
        }
        if (keys.length === 0 && (!array || value.length == 0)) {
            return braces[0] + base + braces[1]
        }
        if (recurseTimes < 0) {
            if (isRegExp(value)) {
                return ctx.stylize(RegExp.prototype.toString.call(value), "regexp")
            } else {
                return ctx.stylize("[Object]", "special")
            }
        }
        ctx.seen.push(value);
        var output;
        if (array) {
            output = formatArray(ctx, value, recurseTimes, visibleKeys, keys)
        } else {
            output = keys.map(function(key) {
                return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array)
            })
        }
        ctx.seen.pop();
        return reduceToSingleString(output, base, braces)
    }

    function formatPrimitive(ctx, value) {
        switch (typeof value) {
            case "undefined":
                return ctx.stylize("undefined", "undefined");
            case "string":
                var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
                return ctx.stylize(simple, "string");
            case "number":
                return ctx.stylize("" + value, "number");
            case "boolean":
                return ctx.stylize("" + value, "boolean")
        }
        if (value === null) {
            return ctx.stylize("null", "null")
        }
    }

    function formatError(value) {
        return "[" + Error.prototype.toString.call(value) + "]"
    }

    function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
        var output = [];
        for (var i = 0, l = value.length; i < l; ++i) {
            if (hasOwnProperty(value, String(i))) {
                output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true))
            } else {
                output.push("")
            }
        }
        keys.forEach(function(key) {
            if (!key.match(/^\d+$/)) {
                output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true))
            }
        });
        return output
    }

    function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
        var name, str, desc;
        desc = Object.getOwnPropertyDescriptor(value, key);
        if (desc.get) {
            if (desc.set) {
                str = ctx.stylize("[Getter/Setter]", "special")
            } else {
                str = ctx.stylize("[Getter]", "special")
            }
        } else {
            if (desc.set) {
                str = ctx.stylize("[Setter]", "special")
            }
        }
        if (!hasOwnProperty(visibleKeys, key)) {
            name = "[" + key + "]"
        }
        if (!str) {
            if (ctx.seen.indexOf(desc.value) < 0) {
                if (recurseTimes === null) {
                    str = formatValue(ctx, desc.value, null)
                } else {
                    str = formatValue(ctx, desc.value, recurseTimes - 1)
                }
                if (str.indexOf("\n") > -1) {
                    if (array) {
                        str = str.split("\n").map(function(line) {
                            return "  " + line
                        }).join("\n").substr(2)
                    } else {
                        str = "\n" + str.split("\n").map(function(line) {
                            return "   " + line
                        }).join("\n")
                    }
                }
            } else {
                str = ctx.stylize("[Circular]", "special")
            }
        }
        if (typeof name === "undefined") {
            if (array && key.match(/^\d+$/)) {
                return str
            }
            name = JSON.stringify("" + key);
            if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
                name = name.substr(1, name.length - 2);
                name = ctx.stylize(name, "name")
            } else {
                name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
                name = ctx.stylize(name, "string")
            }
        }
        return name + ": " + str
    }

    function reduceToSingleString(output, base, braces) {
        var numLinesEst = 0;
        var length = output.reduce(function(prev, cur) {
            numLinesEst++;
            if (cur.indexOf("\n") >= 0) numLinesEst++;
            return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1
        }, 0);
        if (length > 60) {
            return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n  ") + " " + braces[1]
        }
        return braces[0] + base + " " + output.join(", ") + " " + braces[1]
    }

    function isArray(ar) {
        return Array.isArray(ar) || typeof ar === "object" && objectToString(ar) === "[object Array]"
    }
    exports.isArray = isArray;

    function isRegExp(re) {
        return typeof re === "object" && objectToString(re) === "[object RegExp]"
    }
    exports.isRegExp = isRegExp;

    function isDate(d) {
        return typeof d === "object" && objectToString(d) === "[object Date]"
    }
    exports.isDate = isDate;

    function isError(e) {
        return typeof e === "object" && objectToString(e) === "[object Error]"
    }
    exports.isError = isError;

    function objectToString(o) {
        return Object.prototype.toString.call(o)
    }

    function pad(n) {
        return n < 10 ? "0" + n.toString(10) : n.toString(10)
    }
    var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];

    function timestamp() {
        var d = new Date;
        var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(":");
        return [d.getDate(), months[d.getMonth()], time].join(" ")
    }
    exports.log = function() {
        console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments))
    };
    exports.inherits = function(ctor, superCtor) {
        ctor.super_ = superCtor;
        ctor.prototype = Object.create(superCtor.prototype, {
            constructor: {
                value: ctor,
                enumerable: false,
                writable: true,
                configurable: true
            }
        })
    };
    exports._extend = function(origin, add) {
        if (!add || typeof add !== "object") return origin;
        var keys = Object.keys(add);
        var i = keys.length;
        while (i--) {
            origin[keys[i]] = add[keys[i]]
        }
        return origin
    };

    function hasOwnProperty(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop)
    }
    return module.exports
});
! function(e, n, t) {
    function o(e) {
        var n = u.className,
            t = Modernizr._config.classPrefix || "";
        if (p && (n = n.baseVal), Modernizr._config.enableJSClass) {
            var o = new RegExp("(^|\\s)" + t + "no-js(\\s|$)");
            n = n.replace(o, "$1" + t + "js$2")
        }
        Modernizr._config.enableClasses && (n += " " + t + e.join(" " + t), p ? u.className.baseVal = n : u.className = n)
    }

    function s(e, n) {
        return typeof e === n
    }

    function a() {
        var e, n, t, o, a, i, r;
        for (var l in c) {
            if (e = [], n = c[l], n.name && (e.push(n.name.toLowerCase()), n.options && n.options.aliases && n.options.aliases.length))
                for (t = 0; t < n.options.aliases.length; t++) e.push(n.options.aliases[t].toLowerCase());
            for (o = s(n.fn, "function") ? n.fn() : n.fn, a = 0; a < e.length; a++) i = e[a], r = i.split("."), 1 === r.length ? Modernizr[r[0]] = o : (!Modernizr[r[0]] || Modernizr[r[0]] instanceof Boolean || (Modernizr[r[0]] = new Boolean(Modernizr[r[0]])), Modernizr[r[0]][r[1]] = o), f.push((o ? "" : "no-") + r.join("-"))
        }
    }

    function i() {
        return "function" != typeof n.createElement ? n.createElement(arguments[0]) : p ? n.createElementNS.call(n, "http://www.w3.org/2000/svg", arguments[0]) : n.createElement.apply(n, arguments)
    }

    function r() {
        var e = n.body;
        return e || (e = i(p ? "svg" : "body"), e.fake = !0), e
    }

    function l(e, t, o, s) {
        var a, l, f, c, d = "modernizr",
            p = i("div"),
            h = r();
        if (parseInt(o, 10))
            for (; o--;) f = i("div"), f.id = s ? s[o] : d + (o + 1), p.appendChild(f);
        return a = i("style"), a.type = "text/css", a.id = "s" + d, (h.fake ? h : p).appendChild(a), h.appendChild(p), a.styleSheet ? a.styleSheet.cssText = e : a.appendChild(n.createTextNode(e)), p.id = d, h.fake && (h.style.background = "", h.style.overflow = "hidden", c = u.style.overflow, u.style.overflow = "hidden", u.appendChild(h)), l = t(p, e), h.fake ? (h.parentNode.removeChild(h), u.style.overflow = c, u.offsetHeight) : p.parentNode.removeChild(p), !!l
    }
    var f = [],
        c = [],
        d = {
            _version: "3.1.0",
            _config: {
                classPrefix: "",
                enableClasses: !0,
                enableJSClass: !0,
                usePrefixes: !0
            },
            _q: [],
            on: function(e, n) {
                var t = this;
                setTimeout(function() {
                    n(t[e])
                }, 0)
            },
            addTest: function(e, n, t) {
                c.push({
                    name: e,
                    fn: n,
                    options: t
                })
            },
            addAsyncTest: function(e) {
                c.push({
                    name: null,
                    fn: e
                })
            }
        },
        Modernizr = function() {};
    Modernizr.prototype = d, Modernizr = new Modernizr;
    var u = n.documentElement,
        p = "svg" === u.nodeName.toLowerCase(),
        h = d._config.usePrefixes ? " -webkit- -moz- -o- -ms- ".split(" ") : [];
    d._prefixes = h;
    var m = d.testStyles = l;
    Modernizr.addTest("touchevents", function() {
        var t;
        if ("ontouchstart" in e || e.DocumentTouch && n instanceof DocumentTouch) t = !0;
        else {
            var o = ["@media (", h.join("touch-enabled),("), "heartz", ")", "{#modernizr{top:9px;position:absolute}}"].join("");
            m(o, function(e) {
                t = 9 === e.offsetTop
            })
        }
        return t
    }), a(), o(f), delete d.addTest, delete d.addAsyncTest;
    for (var v = 0; v < Modernizr._q.length; v++) Modernizr._q[v]();
    e.Modernizr = Modernizr
}(window, document);
(function(window, undefined) {
    var rootjQuery, readyList, core_strundefined = typeof undefined,
        location = window.location,
        document = window.document,
        docElem = document.documentElement,
        _jQuery = window.jQuery,
        _$ = window.$,
        class2type = {},
        core_deletedIds = [],
        core_version = "2.0.0",
        core_concat = core_deletedIds.concat,
        core_push = core_deletedIds.push,
        core_slice = core_deletedIds.slice,
        core_indexOf = core_deletedIds.indexOf,
        core_toString = class2type.toString,
        core_hasOwn = class2type.hasOwnProperty,
        core_trim = core_version.trim,
        jQuery = function(selector, context) {
            return new jQuery.fn.init(selector, context, rootjQuery)
        },
        core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
        core_rnotwhite = /\S+/g,
        rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
        rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
        rmsPrefix = /^-ms-/,
        rdashAlpha = /-([\da-z])/gi,
        fcamelCase = function(all, letter) {
            return letter.toUpperCase()
        },
        completed = function() {
            document.removeEventListener("DOMContentLoaded", completed, false);
            window.removeEventListener("load", completed, false);
            jQuery.ready()
        };
    jQuery.fn = jQuery.prototype = {
        jquery: core_version,
        constructor: jQuery,
        init: function(selector, context, rootjQuery) {
            var match, elem;
            if (!selector) {
                return this
            }
            if (typeof selector === "string") {
                if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
                    match = [null, selector, null]
                } else {
                    match = rquickExpr.exec(selector)
                }
                if (match && (match[1] || !context)) {
                    if (match[1]) {
                        context = context instanceof jQuery ? context[0] : context;
                        jQuery.merge(this, jQuery.parseHTML(match[1], context && context.nodeType ? context.ownerDocument || context : document, true));
                        if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
                            for (match in context) {
                                if (jQuery.isFunction(this[match])) {
                                    this[match](context[match])
                                } else {
                                    this.attr(match, context[match])
                                }
                            }
                        }
                        return this
                    } else {
                        elem = document.getElementById(match[2]);
                        if (elem && elem.parentNode) {
                            this.length = 1;
                            this[0] = elem
                        }
                        this.context = document;
                        this.selector = selector;
                        return this
                    }
                } else if (!context || context.jquery) {
                    return (context || rootjQuery).find(selector)
                } else {
                    return this.constructor(context).find(selector)
                }
            } else if (selector.nodeType) {
                this.context = this[0] = selector;
                this.length = 1;
                return this
            } else if (jQuery.isFunction(selector)) {
                return rootjQuery.ready(selector)
            }
            if (selector.selector !== undefined) {
                this.selector = selector.selector;
                this.context = selector.context
            }
            return jQuery.makeArray(selector, this)
        },
        selector: "",
        length: 0,
        toArray: function() {
            return core_slice.call(this)
        },
        get: function(num) {
            return num == null ? this.toArray() : num < 0 ? this[this.length + num] : this[num]
        },
        pushStack: function(elems) {
            var ret = jQuery.merge(this.constructor(), elems);
            ret.prevObject = this;
            ret.context = this.context;
            return ret
        },
        each: function(callback, args) {
            return jQuery.each(this, callback, args)
        },
        ready: function(fn) {
            jQuery.ready.promise().done(fn);
            return this
        },
        slice: function() {
            return this.pushStack(core_slice.apply(this, arguments))
        },
        first: function() {
            return this.eq(0)
        },
        last: function() {
            return this.eq(-1)
        },
        eq: function(i) {
            var len = this.length,
                j = +i + (i < 0 ? len : 0);
            return this.pushStack(j >= 0 && j < len ? [this[j]] : [])
        },
        map: function(callback) {
            return this.pushStack(jQuery.map(this, function(elem, i) {
                return callback.call(elem, i, elem)
            }))
        },
        end: function() {
            return this.prevObject || this.constructor(null)
        },
        push: core_push,
        sort: [].sort,
        splice: [].splice
    };
    jQuery.fn.init.prototype = jQuery.fn;
    jQuery.extend = jQuery.fn.extend = function() {
        var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {},
            i = 1,
            length = arguments.length,
            deep = false;
        if (typeof target === "boolean") {
            deep = target;
            target = arguments[1] || {};
            i = 2
        }
        if (typeof target !== "object" && !jQuery.isFunction(target)) {
            target = {}
        }
        if (length === i) {
            target = this;
            --i
        }
        for (; i < length; i++) {
            if ((options = arguments[i]) != null) {
                for (name in options) {
                    src = target[name];
                    copy = options[name];
                    if (target === copy) {
                        continue
                    }
                    if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)))) {
                        if (copyIsArray) {
                            copyIsArray = false;
                            clone = src && jQuery.isArray(src) ? src : []
                        } else {
                            clone = src && jQuery.isPlainObject(src) ? src : {}
                        }
                        target[name] = jQuery.extend(deep, clone, copy)
                    } else if (copy !== undefined) {
                        target[name] = copy
                    }
                }
            }
        }
        return target
    };
    jQuery.extend({
        expando: "jQuery" + (core_version + Math.random()).replace(/\D/g, ""),
        noConflict: function(deep) {
            if (window.$ === jQuery) {
                window.$ = _$
            }
            if (deep && window.jQuery === jQuery) {
                window.jQuery = _jQuery
            }
            return jQuery
        },
        isReady: false,
        readyWait: 1,
        holdReady: function(hold) {
            if (hold) {
                jQuery.readyWait++
            } else {
                jQuery.ready(true)
            }
        },
        ready: function(wait) {
            if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
                return
            }
            jQuery.isReady = true;
            if (wait !== true && --jQuery.readyWait > 0) {
                return
            }
            readyList.resolveWith(document, [jQuery]);
            if (jQuery.fn.trigger) {
                jQuery(document).trigger("ready").off("ready")
            }
        },
        isFunction: function(obj) {
            return jQuery.type(obj) === "function"
        },
        isArray: Array.isArray,
        isWindow: function(obj) {
            return obj != null && obj === obj.window
        },
        isNumeric: function(obj) {
            return !isNaN(parseFloat(obj)) && isFinite(obj)
        },
        type: function(obj) {
            if (obj == null) {
                return String(obj)
            }
            return typeof obj === "object" || typeof obj === "function" ? class2type[core_toString.call(obj)] || "object" : typeof obj
        },
        isPlainObject: function(obj) {
            if (jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow(obj)) {
                return false
            }
            try {
                if (obj.constructor && !core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf")) {
                    return false
                }
            } catch (e) {
                return false
            }
            return true
        },
        isEmptyObject: function(obj) {
            var name;
            for (name in obj) {
                return false
            }
            return true
        },
        error: function(msg) {
            throw new Error(msg)
        },
        parseHTML: function(data, context, keepScripts) {
            if (!data || typeof data !== "string") {
                return null
            }
            if (typeof context === "boolean") {
                keepScripts = context;
                context = false
            }
            context = context || document;
            var parsed = rsingleTag.exec(data),
                scripts = !keepScripts && [];
            if (parsed) {
                return [context.createElement(parsed[1])]
            }
            parsed = jQuery.buildFragment([data], context, scripts);
            if (scripts) {
                jQuery(scripts).remove()
            }
            return jQuery.merge([], parsed.childNodes)
        },
        parseJSON: JSON.parse,
        parseXML: function(data) {
            var xml, tmp;
            if (!data || typeof data !== "string") {
                return null
            }
            try {
                tmp = new DOMParser;
                xml = tmp.parseFromString(data, "text/xml")
            } catch (e) {
                xml = undefined
            }
            if (!xml || xml.getElementsByTagName("parsererror").length) {
                jQuery.error("Invalid XML: " + data)
            }
            return xml
        },
        noop: function() {},
        globalEval: function(code) {
            var script, indirect = eval;
            code = jQuery.trim(code);
            if (code) {
                if (code.indexOf("use strict") === 1) {
                    script = document.createElement("script");
                    script.text = code;
                    document.head.appendChild(script).parentNode.removeChild(script)
                } else {
                    indirect(code)
                }
            }
        },
        camelCase: function(string) {
            return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase)
        },
        nodeName: function(elem, name) {
            return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase()
        },
        each: function(obj, callback, args) {
            var value, i = 0,
                length = obj.length,
                isArray = isArraylike(obj);
            if (args) {
                if (isArray) {
                    for (; i < length; i++) {
                        value = callback.apply(obj[i], args);
                        if (value === false) {
                            break
                        }
                    }
                } else {
                    for (i in obj) {
                        value = callback.apply(obj[i], args);
                        if (value === false) {
                            break
                        }
                    }
                }
            } else {
                if (isArray) {
                    for (; i < length; i++) {
                        value = callback.call(obj[i], i, obj[i]);
                        if (value === false) {
                            break
                        }
                    }
                } else {
                    for (i in obj) {
                        value = callback.call(obj[i], i, obj[i]);
                        if (value === false) {
                            break
                        }
                    }
                }
            }
            return obj
        },
        trim: function(text) {
            return text == null ? "" : core_trim.call(text)
        },
        makeArray: function(arr, results) {
            var ret = results || [];
            if (arr != null) {
                if (isArraylike(Object(arr))) {
                    jQuery.merge(ret, typeof arr === "string" ? [arr] : arr)
                } else {
                    core_push.call(ret, arr)
                }
            }
            return ret
        },
        inArray: function(elem, arr, i) {
            return arr == null ? -1 : core_indexOf.call(arr, elem, i)
        },
        merge: function(first, second) {
            var l = second.length,
                i = first.length,
                j = 0;
            if (typeof l === "number") {
                for (; j < l; j++) {
                    first[i++] = second[j]
                }
            } else {
                while (second[j] !== undefined) {
                    first[i++] = second[j++]
                }
            }
            first.length = i;
            return first
        },
        grep: function(elems, callback, inv) {
            var retVal, ret = [],
                i = 0,
                length = elems.length;
            inv = !!inv;
            for (; i < length; i++) {
                retVal = !!callback(elems[i], i);
                if (inv !== retVal) {
                    ret.push(elems[i])
                }
            }
            return ret
        },
        map: function(elems, callback, arg) {
            var value, i = 0,
                length = elems.length,
                isArray = isArraylike(elems),
                ret = [];
            if (isArray) {
                for (; i < length; i++) {
                    value = callback(elems[i], i, arg);
                    if (value != null) {
                        ret[ret.length] = value
                    }
                }
            } else {
                for (i in elems) {
                    value = callback(elems[i], i, arg);
                    if (value != null) {
                        ret[ret.length] = value
                    }
                }
            }
            return core_concat.apply([], ret)
        },
        guid: 1,
        proxy: function(fn, context) {
            var tmp, args, proxy;
            if (typeof context === "string") {
                tmp = fn[context];
                context = fn;
                fn = tmp
            }
            if (!jQuery.isFunction(fn)) {
                return undefined
            }
            args = core_slice.call(arguments, 2);
            proxy = function() {
                return fn.apply(context || this, args.concat(core_slice.call(arguments)))
            };
            proxy.guid = fn.guid = fn.guid || jQuery.guid++;
            return proxy
        },
        access: function(elems, fn, key, value, chainable, emptyGet, raw) {
            var i = 0,
                length = elems.length,
                bulk = key == null;
            if (jQuery.type(key) === "object") {
                chainable = true;
                for (i in key) {
                    jQuery.access(elems, fn, i, key[i], true, emptyGet, raw)
                }
            } else if (value !== undefined) {
                chainable = true;
                if (!jQuery.isFunction(value)) {
                    raw = true
                }
                if (bulk) {
                    if (raw) {
                        fn.call(elems, value);
                        fn = null
                    } else {
                        bulk = fn;
                        fn = function(elem, key, value) {
                            return bulk.call(jQuery(elem), value)
                        }
                    }
                }
                if (fn) {
                    for (; i < length; i++) {
                        fn(elems[i], key, raw ? value : value.call(elems[i], i, fn(elems[i], key)))
                    }
                }
            }
            return chainable ? elems : bulk ? fn.call(elems) : length ? fn(elems[0], key) : emptyGet
        },
        now: Date.now,
        swap: function(elem, options, callback, args) {
            var ret, name, old = {};
            for (name in options) {
                old[name] = elem.style[name];
                elem.style[name] = options[name]
            }
            ret = callback.apply(elem, args || []);
            for (name in options) {
                elem.style[name] = old[name]
            }
            return ret
        }
    });
    jQuery.ready.promise = function(obj) {
        if (!readyList) {
            readyList = jQuery.Deferred();
            if (document.readyState === "complete") {
                setTimeout(jQuery.ready)
            } else {
                document.addEventListener("DOMContentLoaded", completed, false);
                window.addEventListener("load", completed, false)
            }
        }
        return readyList.promise(obj)
    };
    jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
        class2type["[object " + name + "]"] = name.toLowerCase()
    });

    function isArraylike(obj) {
        var length = obj.length,
            type = jQuery.type(obj);
        if (jQuery.isWindow(obj)) {
            return false
        }
        if (obj.nodeType === 1 && length) {
            return true
        }
        return type === "array" || type !== "function" && (length === 0 || typeof length === "number" && length > 0 && length - 1 in obj)
    }
    rootjQuery = jQuery(document);
    (function(window, undefined) {
        var i, cachedruns, Expr, getText, isXML, compile, outermostContext, sortInput, setDocument, document, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains, expando = "sizzle" + -new Date,
            preferredDoc = window.document,
            support = {},
            dirruns = 0,
            done = 0,
            classCache = createCache(),
            tokenCache = createCache(),
            compilerCache = createCache(),
            hasDuplicate = false,
            sortOrder = function() {
                return 0
            },
            strundefined = typeof undefined,
            MAX_NEGATIVE = 1 << 31,
            arr = [],
            pop = arr.pop,
            push_native = arr.push,
            push = arr.push,
            slice = arr.slice,
            indexOf = arr.indexOf || function(elem) {
                var i = 0,
                    len = this.length;
                for (; i < len; i++) {
                    if (this[i] === elem) {
                        return i
                    }
                }
                return -1
            },
            booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
            whitespace = "[\\x20\\t\\r\\n\\f]",
            characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
            identifier = characterEncoding.replace("w", "w#"),
            attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
            pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace(3, 8) + ")*)|.*)\\)|)",
            rtrim = new RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"),
            rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"),
            rcombinators = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"),
            rsibling = new RegExp(whitespace + "*[+~]"),
            rattributeQuotes = new RegExp("=" + whitespace + "*([^\\]'\"]*)" + whitespace + "*\\]", "g"),
            rpseudo = new RegExp(pseudos),
            ridentifier = new RegExp("^" + identifier + "$"),
            matchExpr = {
                ID: new RegExp("^#(" + characterEncoding + ")"),
                CLASS: new RegExp("^\\.(" + characterEncoding + ")"),
                TAG: new RegExp("^(" + characterEncoding.replace("w", "w*") + ")"),
                ATTR: new RegExp("^" + attributes),
                PSEUDO: new RegExp("^" + pseudos),
                CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i"),
                "boolean": new RegExp("^(?:" + booleans + ")$", "i"),
                needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
            },
            rnative = /^[^{]+\{\s*\[native \w/,
            rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
            rinputs = /^(?:input|select|textarea|button)$/i,
            rheader = /^h\d$/i,
            rescape = /'|\\/g,
            runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
            funescape = function(_, escaped) {
                var high = "0x" + escaped - 65536;
                return high !== high ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320)
            };
        try {
            push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes);
            arr[preferredDoc.childNodes.length].nodeType
        } catch (e) {
            push = {
                apply: arr.length ? function(target, els) {
                    push_native.apply(target, slice.call(els))
                } : function(target, els) {
                    var j = target.length,
                        i = 0;
                    while (target[j++] = els[i++]) {}
                    target.length = j - 1
                }
            }
        }

        function isNative(fn) {
            return rnative.test(fn + "")
        }

        function createCache() {
            var cache, keys = [];
            return cache = function(key, value) {
                if (keys.push(key += " ") > Expr.cacheLength) {
                    delete cache[keys.shift()]
                }
                return cache[key] = value
            }
        }

        function markFunction(fn) {
            fn[expando] = true;
            return fn
        }

        function assert(fn) {
            var div = document.createElement("div");
            try {
                return !!fn(div)
            } catch (e) {
                return false
            } finally {
                if (div.parentNode) {
                    div.parentNode.removeChild(div)
                }
                div = null
            }
        }

        function Sizzle(selector, context, results, seed) {
            var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector;
            if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
                setDocument(context)
            }
            context = context || document;
            results = results || [];
            if (!selector || typeof selector !== "string") {
                return results
            }
            if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
                return []
            }
            if (documentIsHTML && !seed) {
                if (match = rquickExpr.exec(selector)) {
                    if (m = match[1]) {
                        if (nodeType === 9) {
                            elem = context.getElementById(m);
                            if (elem && elem.parentNode) {
                                if (elem.id === m) {
                                    results.push(elem);
                                    return results
                                }
                            } else {
                                return results
                            }
                        } else {
                            if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains(context, elem) && elem.id === m) {
                                results.push(elem);
                                return results
                            }
                        }
                    } else if (match[2]) {
                        push.apply(results, context.getElementsByTagName(selector));
                        return results
                    } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) {
                        push.apply(results, context.getElementsByClassName(m));
                        return results
                    }
                }
                if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
                    nid = old = expando;
                    newContext = context;
                    newSelector = nodeType === 9 && selector;
                    if (nodeType === 1 && context.nodeName.toLowerCase() !== "object") {
                        groups = tokenize(selector);
                        if (old = context.getAttribute("id")) {
                            nid = old.replace(rescape, "\\$&")
                        } else {
                            context.setAttribute("id", nid)
                        }
                        nid = "[id='" + nid + "'] ";
                        i = groups.length;
                        while (i--) {
                            groups[i] = nid + toSelector(groups[i])
                        }
                        newContext = rsibling.test(selector) && context.parentNode || context;
                        newSelector = groups.join(",")
                    }
                    if (newSelector) {
                        try {
                            push.apply(results, newContext.querySelectorAll(newSelector));
                            return results
                        } catch (qsaError) {} finally {
                            if (!old) {
                                context.removeAttribute("id")
                            }
                        }
                    }
                }
            }
            return select(selector.replace(rtrim, "$1"), context, results, seed)
        }
        isXML = Sizzle.isXML = function(elem) {
            var documentElement = elem && (elem.ownerDocument || elem).documentElement;
            return documentElement ? documentElement.nodeName !== "HTML" : false
        };
        setDocument = Sizzle.setDocument = function(node) {
            var doc = node ? node.ownerDocument || node : preferredDoc;
            if (doc === document || doc.nodeType !== 9 || !doc.documentElement) {
                return document
            }
            document = doc;
            docElem = doc.documentElement;
            documentIsHTML = !isXML(doc);
            support.getElementsByTagName = assert(function(div) {
                div.appendChild(doc.createComment(""));
                return !div.getElementsByTagName("*").length
            });
            support.attributes = assert(function(div) {
                div.className = "i";
                return !div.getAttribute("className")
            });
            support.getElementsByClassName = assert(function(div) {
                div.innerHTML = "<div class='a'></div><div class='a i'></div>";
                div.firstChild.className = "i";
                return div.getElementsByClassName("i").length === 2
            });
            support.sortDetached = assert(function(div1) {
                return div1.compareDocumentPosition(document.createElement("div")) & 1
            });
            support.getById = assert(function(div) {
                docElem.appendChild(div).id = expando;
                return !doc.getElementsByName || !doc.getElementsByName(expando).length
            });
            if (support.getById) {
                Expr.find["ID"] = function(id, context) {
                    if (typeof context.getElementById !== strundefined && documentIsHTML) {
                        var m = context.getElementById(id);
                        return m && m.parentNode ? [m] : []
                    }
                };
                Expr.filter["ID"] = function(id) {
                    var attrId = id.replace(runescape, funescape);
                    return function(elem) {
                        return elem.getAttribute("id") === attrId
                    }
                }
            } else {
                Expr.find["ID"] = function(id, context) {
                    if (typeof context.getElementById !== strundefined && documentIsHTML) {
                        var m = context.getElementById(id);
                        return m ? m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? [m] : undefined : []
                    }
                };
                Expr.filter["ID"] = function(id) {
                    var attrId = id.replace(runescape, funescape);
                    return function(elem) {
                        var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
                        return node && node.value === attrId;
                    }
                }
            }
            Expr.find["TAG"] = support.getElementsByTagName ? function(tag, context) {
                if (typeof context.getElementsByTagName !== strundefined) {
                    return context.getElementsByTagName(tag)
                }
            } : function(tag, context) {
                var elem, tmp = [],
                    i = 0,
                    results = context.getElementsByTagName(tag);
                if (tag === "*") {
                    while (elem = results[i++]) {
                        if (elem.nodeType === 1) {
                            tmp.push(elem)
                        }
                    }
                    return tmp
                }
                return results
            };
            Expr.find["CLASS"] = support.getElementsByClassName && function(className, context) {
                if (typeof context.getElementsByClassName !== strundefined && documentIsHTML) {
                    return context.getElementsByClassName(className)
                }
            };
            rbuggyMatches = [];
            rbuggyQSA = [];
            if (support.qsa = isNative(doc.querySelectorAll)) {
                assert(function(div) {
                    div.innerHTML = "<select><option selected=''></option></select>";
                    if (!div.querySelectorAll("[selected]").length) {
                        rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")")
                    }
                    if (!div.querySelectorAll(":checked").length) {
                        rbuggyQSA.push(":checked")
                    }
                });
                assert(function(div) {
                    var input = document.createElement("input");
                    input.setAttribute("type", "hidden");
                    div.appendChild(input).setAttribute("t", "");
                    if (div.querySelectorAll("[t^='']").length) {
                        rbuggyQSA.push("[*^$]=" + whitespace + "*(?:''|\"\")")
                    }
                    if (!div.querySelectorAll(":enabled").length) {
                        rbuggyQSA.push(":enabled", ":disabled")
                    }
                    div.querySelectorAll("*,:x");
                    rbuggyQSA.push(",.*:")
                })
            }
            if (support.matchesSelector = isNative(matches = docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) {
                assert(function(div) {
                    support.disconnectedMatch = matches.call(div, "div");
                    matches.call(div, "[s!='']:x");
                    rbuggyMatches.push("!=", pseudos)
                })
            }
            rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
            rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|"));
            contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function(a, b) {
                var adown = a.nodeType === 9 ? a.documentElement : a,
                    bup = b && b.parentNode;
                return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16))
            } : function(a, b) {
                if (b) {
                    while (b = b.parentNode) {
                        if (b === a) {
                            return true
                        }
                    }
                }
                return false
            };
            sortOrder = docElem.compareDocumentPosition ? function(a, b) {
                if (a === b) {
                    hasDuplicate = true;
                    return 0
                }
                var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition(b);
                if (compare) {
                    if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
                        if (a === doc || contains(preferredDoc, a)) {
                            return -1
                        }
                        if (b === doc || contains(preferredDoc, b)) {
                            return 1
                        }
                        return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0
                    }
                    return compare & 4 ? -1 : 1
                }
                return a.compareDocumentPosition ? -1 : 1
            } : function(a, b) {
                var cur, i = 0,
                    aup = a.parentNode,
                    bup = b.parentNode,
                    ap = [a],
                    bp = [b];
                if (a === b) {
                    hasDuplicate = true;
                    return 0
                } else if (!aup || !bup) {
                    return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0
                } else if (aup === bup) {
                    return siblingCheck(a, b)
                }
                cur = a;
                while (cur = cur.parentNode) {
                    ap.unshift(cur)
                }
                cur = b;
                while (cur = cur.parentNode) {
                    bp.unshift(cur)
                }
                while (ap[i] === bp[i]) {
                    i++
                }
                return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0
            };
            return document
        };
        Sizzle.matches = function(expr, elements) {
            return Sizzle(expr, null, null, elements)
        };
        Sizzle.matchesSelector = function(elem, expr) {
            if ((elem.ownerDocument || elem) !== document) {
                setDocument(elem)
            }
            expr = expr.replace(rattributeQuotes, "='$1']");
            if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
                try {
                    var ret = matches.call(elem, expr);
                    if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) {
                        return ret
                    }
                } catch (e) {}
            }
            return Sizzle(expr, document, null, [elem]).length > 0
        };
        Sizzle.contains = function(context, elem) {
            if ((context.ownerDocument || context) !== document) {
                setDocument(context)
            }
            return contains(context, elem)
        };
        Sizzle.attr = function(elem, name) {
            if ((elem.ownerDocument || elem) !== document) {
                setDocument(elem)
            }
            var fn = Expr.attrHandle[name.toLowerCase()],
                val = fn && fn(elem, name, !documentIsHTML);
            return val === undefined ? support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null : val
        };
        Sizzle.error = function(msg) {
            throw new Error("Syntax error, unrecognized expression: " + msg)
        };
        Sizzle.uniqueSort = function(results) {
            var elem, duplicates = [],
                j = 0,
                i = 0;
            hasDuplicate = !support.detectDuplicates;
            sortInput = !support.sortStable && results.slice(0);
            results.sort(sortOrder);
            if (hasDuplicate) {
                while (elem = results[i++]) {
                    if (elem === results[i]) {
                        j = duplicates.push(i)
                    }
                }
                while (j--) {
                    results.splice(duplicates[j], 1)
                }
            }
            return results
        };

        function siblingCheck(a, b) {
            var cur = b && a,
                diff = cur && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE);
            if (diff) {
                return diff
            }
            if (cur) {
                while (cur = cur.nextSibling) {
                    if (cur === b) {
                        return -1
                    }
                }
            }
            return a ? 1 : -1
        }

        function boolHandler(elem, name, isXML) {
            var val;
            return isXML ? undefined : (val = elem.getAttributeNode(name)) && val.specified ? val.value : elem[name] === true ? name.toLowerCase() : null
        }

        function interpolationHandler(elem, name, isXML) {
            var val;
            return isXML ? undefined : val = elem.getAttribute(name, name.toLowerCase() === "type" ? 1 : 2)
        }

        function createInputPseudo(type) {
            return function(elem) {
                var name = elem.nodeName.toLowerCase();
                return name === "input" && elem.type === type
            }
        }

        function createButtonPseudo(type) {
            return function(elem) {
                var name = elem.nodeName.toLowerCase();
                return (name === "input" || name === "button") && elem.type === type
            }
        }

        function createPositionalPseudo(fn) {
            return markFunction(function(argument) {
                argument = +argument;
                return markFunction(function(seed, matches) {
                    var j, matchIndexes = fn([], seed.length, argument),
                        i = matchIndexes.length;
                    while (i--) {
                        if (seed[j = matchIndexes[i]]) {
                            seed[j] = !(matches[j] = seed[j])
                        }
                    }
                })
            })
        }
        getText = Sizzle.getText = function(elem) {
            var node, ret = "",
                i = 0,
                nodeType = elem.nodeType;
            if (!nodeType) {
                for (; node = elem[i]; i++) {
                    ret += getText(node)
                }
            } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) {
                if (typeof elem.textContent === "string") {
                    return elem.textContent
                } else {
                    for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
                        ret += getText(elem)
                    }
                }
            } else if (nodeType === 3 || nodeType === 4) {
                return elem.nodeValue
            }
            return ret
        };
        Expr = Sizzle.selectors = {
            cacheLength: 50,
            createPseudo: markFunction,
            match: matchExpr,
            attrHandle: {},
            find: {},
            relative: {
                ">": {
                    dir: "parentNode",
                    first: true
                },
                " ": {
                    dir: "parentNode"
                },
                "+": {
                    dir: "previousSibling",
                    first: true
                },
                "~": {
                    dir: "previousSibling"
                }
            },
            preFilter: {
                ATTR: function(match) {
                    match[1] = match[1].replace(runescape, funescape);
                    match[3] = (match[4] || match[5] || "").replace(runescape, funescape);
                    if (match[2] === "~=") {
                        match[3] = " " + match[3] + " "
                    }
                    return match.slice(0, 4)
                },
                CHILD: function(match) {
                    match[1] = match[1].toLowerCase();
                    if (match[1].slice(0, 3) === "nth") {
                        if (!match[3]) {
                            Sizzle.error(match[0])
                        }
                        match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
                        match[5] = +(match[7] + match[8] || match[3] === "odd")
                    } else if (match[3]) {
                        Sizzle.error(match[0])
                    }
                    return match
                },
                PSEUDO: function(match) {
                    var excess, unquoted = !match[5] && match[2];
                    if (matchExpr["CHILD"].test(match[0])) {
                        return null
                    }
                    if (match[4]) {
                        match[2] = match[4]
                    } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
                        match[0] = match[0].slice(0, excess);
                        match[2] = unquoted.slice(0, excess)
                    }
                    return match.slice(0, 3)
                }
            },
            filter: {
                TAG: function(nodeNameSelector) {
                    var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
                    return nodeNameSelector === "*" ? function() {
                        return true
                    } : function(elem) {
                        return elem.nodeName && elem.nodeName.toLowerCase() === nodeName
                    }
                },
                CLASS: function(className) {
                    var pattern = classCache[className + " "];
                    return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
                        return pattern.test(typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "")
                    })
                },
                ATTR: function(name, operator, check) {
                    return function(elem) {
                        var result = Sizzle.attr(elem, name);
                        if (result == null) {
                            return operator === "!="
                        }
                        if (!operator) {
                            return true
                        }
                        result += "";
                        return operator === "=" ? result === check : operator === "!=" ? result !== check : operator === "^=" ? check && result.indexOf(check) === 0 : operator === "*=" ? check && result.indexOf(check) > -1 : operator === "$=" ? check && result.slice(-check.length) === check : operator === "~=" ? (" " + result + " ").indexOf(check) > -1 : operator === "|=" ? result === check || result.slice(0, check.length + 1) === check + "-" : false
                    }
                },
                CHILD: function(type, what, argument, first, last) {
                    var simple = type.slice(0, 3) !== "nth",
                        forward = type.slice(-4) !== "last",
                        ofType = what === "of-type";
                    return first === 1 && last === 0 ? function(elem) {
                        return !!elem.parentNode
                    } : function(elem, context, xml) {
                        var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling",
                            parent = elem.parentNode,
                            name = ofType && elem.nodeName.toLowerCase(),
                            useCache = !xml && !ofType;
                        if (parent) {
                            if (simple) {
                                while (dir) {
                                    node = elem;
                                    while (node = node[dir]) {
                                        if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) {
                                            return false
                                        }
                                    }
                                    start = dir = type === "only" && !start && "nextSibling"
                                }
                                return true
                            }
                            start = [forward ? parent.firstChild : parent.lastChild];
                            if (forward && useCache) {
                                outerCache = parent[expando] || (parent[expando] = {});
                                cache = outerCache[type] || [];
                                nodeIndex = cache[0] === dirruns && cache[1];
                                diff = cache[0] === dirruns && cache[2];
                                node = nodeIndex && parent.childNodes[nodeIndex];
                                while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
                                    if (node.nodeType === 1 && ++diff && node === elem) {
                                        outerCache[type] = [dirruns, nodeIndex, diff];
                                        break
                                    }
                                }
                            } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) {
                                diff = cache[1]
                            } else {
                                while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) {
                                    if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) {
                                        if (useCache) {
                                            (node[expando] || (node[expando] = {}))[type] = [dirruns, diff]
                                        }
                                        if (node === elem) {
                                            break
                                        }
                                    }
                                }
                            }
                            diff -= last;
                            return diff === first || diff % first === 0 && diff / first >= 0
                        }
                    }
                },
                PSEUDO: function(pseudo, argument) {
                    var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error("unsupported pseudo: " + pseudo);
                    if (fn[expando]) {
                        return fn(argument)
                    }
                    if (fn.length > 1) {
                        args = [pseudo, pseudo, "", argument];
                        return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches) {
                            var idx, matched = fn(seed, argument),
                                i = matched.length;
                            while (i--) {
                                idx = indexOf.call(seed, matched[i]);
                                seed[idx] = !(matches[idx] = matched[i])
                            }
                        }) : function(elem) {
                            return fn(elem, 0, args)
                        }
                    }
                    return fn
                }
            },
            pseudos: {
                not: markFunction(function(selector) {
                    var input = [],
                        results = [],
                        matcher = compile(selector.replace(rtrim, "$1"));
                    return matcher[expando] ? markFunction(function(seed, matches, context, xml) {
                        var elem, unmatched = matcher(seed, null, xml, []),
                            i = seed.length;
                        while (i--) {
                            if (elem = unmatched[i]) {
                                seed[i] = !(matches[i] = elem)
                            }
                        }
                    }) : function(elem, context, xml) {
                        input[0] = elem;
                        matcher(input, null, xml, results);
                        return !results.pop()
                    }
                }),
                has: markFunction(function(selector) {
                    return function(elem) {
                        return Sizzle(selector, elem).length > 0
                    }
                }),
                contains: markFunction(function(text) {
                    return function(elem) {
                        return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1
                    }
                }),
                lang: markFunction(function(lang) {
                    if (!ridentifier.test(lang || "")) {
                        Sizzle.error("unsupported lang: " + lang)
                    }
                    lang = lang.replace(runescape, funescape).toLowerCase();
                    return function(elem) {
                        var elemLang;
                        do {
                            if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
                                elemLang = elemLang.toLowerCase();
                                return elemLang === lang || elemLang.indexOf(lang + "-") === 0
                            }
                        } while ((elem = elem.parentNode) && elem.nodeType === 1);
                        return false
                    }
                }),
                target: function(elem) {
                    var hash = window.location && window.location.hash;
                    return hash && hash.slice(1) === elem.id
                },
                root: function(elem) {
                    return elem === docElem
                },
                focus: function(elem) {
                    return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex)
                },
                enabled: function(elem) {
                    return elem.disabled === false
                },
                disabled: function(elem) {
                    return elem.disabled === true
                },
                checked: function(elem) {
                    var nodeName = elem.nodeName.toLowerCase();
                    return nodeName === "input" && !!elem.checked || nodeName === "option" && !!elem.selected
                },
                selected: function(elem) {
                    if (elem.parentNode) {
                        elem.parentNode.selectedIndex
                    }
                    return elem.selected === true
                },
                empty: function(elem) {
                    for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
                        if (elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4) {
                            return false
                        }
                    }
                    return true
                },
                parent: function(elem) {
                    return !Expr.pseudos["empty"](elem)
                },
                header: function(elem) {
                    return rheader.test(elem.nodeName)
                },
                input: function(elem) {
                    return rinputs.test(elem.nodeName)
                },
                button: function(elem) {
                    var name = elem.nodeName.toLowerCase();
                    return name === "input" && elem.type === "button" || name === "button"
                },
                text: function(elem) {
                    var attr;
                    return elem.nodeName.toLowerCase() === "input" && elem.type === "text" && ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type)
                },
                first: createPositionalPseudo(function() {
                    return [0]
                }),
                last: createPositionalPseudo(function(matchIndexes, length) {
                    return [length - 1]
                }),
                eq: createPositionalPseudo(function(matchIndexes, length, argument) {
                    return [argument < 0 ? argument + length : argument]
                }),
                even: createPositionalPseudo(function(matchIndexes, length) {
                    var i = 0;
                    for (; i < length; i += 2) {
                        matchIndexes.push(i)
                    }
                    return matchIndexes
                }),
                odd: createPositionalPseudo(function(matchIndexes, length) {
                    var i = 1;
                    for (; i < length; i += 2) {
                        matchIndexes.push(i)
                    }
                    return matchIndexes
                }),
                lt: createPositionalPseudo(function(matchIndexes, length, argument) {
                    var i = argument < 0 ? argument + length : argument;
                    for (; --i >= 0;) {
                        matchIndexes.push(i)
                    }
                    return matchIndexes
                }),
                gt: createPositionalPseudo(function(matchIndexes, length, argument) {
                    var i = argument < 0 ? argument + length : argument;
                    for (; ++i < length;) {
                        matchIndexes.push(i)
                    }
                    return matchIndexes
                })
            }
        };
        for (i in {
                radio: true,
                checkbox: true,
                file: true,
                password: true,
                image: true
            }) {
            Expr.pseudos[i] = createInputPseudo(i)
        }
        for (i in {
                submit: true,
                reset: true
            }) {
            Expr.pseudos[i] = createButtonPseudo(i)
        }

        function tokenize(selector, parseOnly) {
            var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
            if (cached) {
                return parseOnly ? 0 : cached.slice(0)
            }
            soFar = selector;
            groups = [];
            preFilters = Expr.preFilter;
            while (soFar) {
                if (!matched || (match = rcomma.exec(soFar))) {
                    if (match) {
                        soFar = soFar.slice(match[0].length) || soFar
                    }
                    groups.push(tokens = [])
                }
                matched = false;
                if (match = rcombinators.exec(soFar)) {
                    matched = match.shift();
                    tokens.push({
                        value: matched,
                        type: match[0].replace(rtrim, " ")
                    });
                    soFar = soFar.slice(matched.length)
                }
                for (type in Expr.filter) {
                    if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
                        matched = match.shift();
                        tokens.push({
                            value: matched,
                            type: type,
                            matches: match
                        });
                        soFar = soFar.slice(matched.length)
                    }
                }
                if (!matched) {
                    break
                }
            }
            return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0)
        }

        function toSelector(tokens) {
            var i = 0,
                len = tokens.length,
                selector = "";
            for (; i < len; i++) {
                selector += tokens[i].value
            }
            return selector
        }

        function addCombinator(matcher, combinator, base) {
            var dir = combinator.dir,
                checkNonElements = base && dir === "parentNode",
                doneName = done++;
            return combinator.first ? function(elem, context, xml) {
                while (elem = elem[dir]) {
                    if (elem.nodeType === 1 || checkNonElements) {
                        return matcher(elem, context, xml)
                    }
                }
            } : function(elem, context, xml) {
                var data, cache, outerCache, dirkey = dirruns + " " + doneName;
                if (xml) {
                    while (elem = elem[dir]) {
                        if (elem.nodeType === 1 || checkNonElements) {
                            if (matcher(elem, context, xml)) {
                                return true
                            }
                        }
                    }
                } else {
                    while (elem = elem[dir]) {
                        if (elem.nodeType === 1 || checkNonElements) {
                            outerCache = elem[expando] || (elem[expando] = {});
                            if ((cache = outerCache[dir]) && cache[0] === dirkey) {
                                if ((data = cache[1]) === true || data === cachedruns) {
                                    return data === true
                                }
                            } else {
                                cache = outerCache[dir] = [dirkey];
                                cache[1] = matcher(elem, context, xml) || cachedruns;
                                if (cache[1] === true) {
                                    return true
                                }
                            }
                        }
                    }
                }
            }
        }

        function elementMatcher(matchers) {
            return matchers.length > 1 ? function(elem, context, xml) {
                var i = matchers.length;
                while (i--) {
                    if (!matchers[i](elem, context, xml)) {
                        return false
                    }
                }
                return true
            } : matchers[0]
        }

        function condense(unmatched, map, filter, context, xml) {
            var elem, newUnmatched = [],
                i = 0,
                len = unmatched.length,
                mapped = map != null;
            for (; i < len; i++) {
                if (elem = unmatched[i]) {
                    if (!filter || filter(elem, context, xml)) {
                        newUnmatched.push(elem);
                        if (mapped) {
                            map.push(i)
                        }
                    }
                }
            }
            return newUnmatched
        }

        function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
            if (postFilter && !postFilter[expando]) {
                postFilter = setMatcher(postFilter)
            }
            if (postFinder && !postFinder[expando]) {
                postFinder = setMatcher(postFinder, postSelector)
            }
            return markFunction(function(seed, results, context, xml) {
                var temp, i, elem, preMap = [],
                    postMap = [],
                    preexisting = results.length,
                    elems = seed || multipleContexts(selector || "*", context.nodeType ? [context] : context, []),
                    matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems,
                    matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn;
                if (matcher) {
                    matcher(matcherIn, matcherOut, context, xml)
                }
                if (postFilter) {
                    temp = condense(matcherOut, postMap);
                    postFilter(temp, [], context, xml);
                    i = temp.length;
                    while (i--) {
                        if (elem = temp[i]) {
                            matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem)
                        }
                    }
                }
                if (seed) {
                    if (postFinder || preFilter) {
                        if (postFinder) {
                            temp = [];
                            i = matcherOut.length;
                            while (i--) {
                                if (elem = matcherOut[i]) {
                                    temp.push(matcherIn[i] = elem)
                                }
                            }
                            postFinder(null, matcherOut = [], temp, xml)
                        }
                        i = matcherOut.length;
                        while (i--) {
                            if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i]) > -1) {
                                seed[temp] = !(results[temp] = elem)
                            }
                        }
                    }
                } else {
                    matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut);
                    if (postFinder) {
                        postFinder(null, results, matcherOut, xml)
                    } else {
                        push.apply(results, matcherOut)
                    }
                }
            })
        }

        function matcherFromTokens(tokens) {
            var checkContext, matcher, j, len = tokens.length,
                leadingRelative = Expr.relative[tokens[0].type],
                implicitRelative = leadingRelative || Expr.relative[" "],
                i = leadingRelative ? 1 : 0,
                matchContext = addCombinator(function(elem) {
                    return elem === checkContext
                }, implicitRelative, true),
                matchAnyContext = addCombinator(function(elem) {
                    return indexOf.call(checkContext, elem) > -1
                }, implicitRelative, true),
                matchers = [function(elem, context, xml) {
                    return !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml))
                }];
            for (; i < len; i++) {
                if (matcher = Expr.relative[tokens[i].type]) {
                    matchers = [addCombinator(elementMatcher(matchers), matcher)]
                } else {
                    matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches);
                    if (matcher[expando]) {
                        j = ++i;
                        for (; j < len; j++) {
                            if (Expr.relative[tokens[j].type]) {
                                break
                            }
                        }
                        return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1)).replace(rtrim, "$1"), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens))
                    }
                    matchers.push(matcher)
                }
            }
            return elementMatcher(matchers)
        }

        function matcherFromGroupMatchers(elementMatchers, setMatchers) {
            var matcherCachedRuns = 0,
                bySet = setMatchers.length > 0,
                byElement = elementMatchers.length > 0,
                superMatcher = function(seed, context, xml, results, expandContext) {
                    var elem, j, matcher, setMatched = [],
                        matchedCount = 0,
                        i = "0",
                        unmatched = seed && [],
                        outermost = expandContext != null,
                        contextBackup = outermostContext,
                        elems = seed || byElement && Expr.find["TAG"]("*", expandContext && context.parentNode || context),
                        dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || .1;
                    if (outermost) {
                        outermostContext = context !== document && context;
                        cachedruns = matcherCachedRuns
                    }
                    for (;
                        (elem = elems[i]) != null; i++) {
                        if (byElement && elem) {
                            j = 0;
                            while (matcher = elementMatchers[j++]) {
                                if (matcher(elem, context, xml)) {
                                    results.push(elem);
                                    break
                                }
                            }
                            if (outermost) {
                                dirruns = dirrunsUnique;
                                cachedruns = ++matcherCachedRuns
                            }
                        }
                        if (bySet) {
                            if (elem = !matcher && elem) {
                                matchedCount--
                            }
                            if (seed) {
                                unmatched.push(elem)
                            }
                        }
                    }
                    matchedCount += i;
                    if (bySet && i !== matchedCount) {
                        j = 0;
                        while (matcher = setMatchers[j++]) {
                            matcher(unmatched, setMatched, context, xml)
                        }
                        if (seed) {
                            if (matchedCount > 0) {
                                while (i--) {
                                    if (!(unmatched[i] || setMatched[i])) {
                                        setMatched[i] = pop.call(results)
                                    }
                                }
                            }
                            setMatched = condense(setMatched)
                        }
                        push.apply(results, setMatched);
                        if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
                            Sizzle.uniqueSort(results)
                        }
                    }
                    if (outermost) {
                        dirruns = dirrunsUnique;
                        outermostContext = contextBackup
                    }
                    return unmatched
                };
            return bySet ? markFunction(superMatcher) : superMatcher
        }
        compile = Sizzle.compile = function(selector, group) {
            var i, setMatchers = [],
                elementMatchers = [],
                cached = compilerCache[selector + " "];
            if (!cached) {
                if (!group) {
                    group = tokenize(selector)
                }
                i = group.length;
                while (i--) {
                    cached = matcherFromTokens(group[i]);
                    if (cached[expando]) {
                        setMatchers.push(cached)
                    } else {
                        elementMatchers.push(cached)
                    }
                }
                cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers))
            }
            return cached
        };

        function multipleContexts(selector, contexts, results) {
            var i = 0,
                len = contexts.length;
            for (; i < len; i++) {
                Sizzle(selector, contexts[i], results)
            }
            return results
        }

        function select(selector, context, results, seed) {
            var i, tokens, token, type, find, match = tokenize(selector);
            if (!seed) {
                if (match.length === 1) {
                    tokens = match[0] = match[0].slice(0);
                    if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
                        context = (Expr.find["ID"](token.matches[0].replace(runescape, funescape), context) || [])[0];
                        if (!context) {
                            return results
                        }
                        selector = selector.slice(tokens.shift().value.length)
                    }
                    i = matchExpr["needsContext"].test(selector) ? 0 : tokens.length;
                    while (i--) {
                        token = tokens[i];
                        if (Expr.relative[type = token.type]) {
                            break
                        }
                        if (find = Expr.find[type]) {
                            if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && context.parentNode || context)) {
                                tokens.splice(i, 1);
                                selector = seed.length && toSelector(tokens);
                                if (!selector) {
                                    push.apply(results, seed);
                                    return results
                                }
                                break
                            }
                        }
                    }
                }
            }
            compile(selector, match)(seed, context, !documentIsHTML, results, rsibling.test(selector));
            return results
        }
        Expr.pseudos["nth"] = Expr.pseudos["eq"];

        function setFilters() {}
        setFilters.prototype = Expr.filters = Expr.pseudos;
        Expr.setFilters = new setFilters;
        support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
        setDocument();
        [0, 0].sort(sortOrder);
        support.detectDuplicates = hasDuplicate;
        assert(function(div) {
            div.innerHTML = "<a href='#'></a>";
            if (div.firstChild.getAttribute("href") !== "#") {
                var attrs = "type|href|height|width".split("|"),
                    i = attrs.length;
                while (i--) {
                    Expr.attrHandle[attrs[i]] = interpolationHandler
                }
            }
        });
        assert(function(div) {
            if (div.getAttribute("disabled") != null) {
                var attrs = booleans.split("|"),
                    i = attrs.length;
                while (i--) {
                    Expr.attrHandle[attrs[i]] = boolHandler
                }
            }
        });
        jQuery.find = Sizzle;
        jQuery.expr = Sizzle.selectors;
        jQuery.expr[":"] = jQuery.expr.pseudos;
        jQuery.unique = Sizzle.uniqueSort;
        jQuery.text = Sizzle.getText;
        jQuery.isXMLDoc = Sizzle.isXML;
        jQuery.contains = Sizzle.contains
    })(window);
    var optionsCache = {};

    function createOptions(options) {
        var object = optionsCache[options] = {};
        jQuery.each(options.match(core_rnotwhite) || [], function(_, flag) {
            object[flag] = true
        });
        return object
    }
    jQuery.Callbacks = function(options) {
        options = typeof options === "string" ? optionsCache[options] || createOptions(options) : jQuery.extend({}, options);
        var memory, fired, firing, firingStart, firingLength, firingIndex, list = [],
            stack = !options.once && [],
            fire = function(data) {
                memory = options.memory && data;
                fired = true;
                firingIndex = firingStart || 0;
                firingStart = 0;
                firingLength = list.length;
                firing = true;
                for (; list && firingIndex < firingLength; firingIndex++) {
                    if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {
                        memory = false;
                        break
                    }
                }
                firing = false;
                if (list) {
                    if (stack) {
                        if (stack.length) {
                            fire(stack.shift())
                        }
                    } else if (memory) {
                        list = []
                    } else {
                        self.disable()
                    }
                }
            },
            self = {
                add: function() {
                    if (list) {
                        var start = list.length;
                        (function add(args) {
                            jQuery.each(args, function(_, arg) {
                                var type = jQuery.type(arg);
                                if (type === "function") {
                                    if (!options.unique || !self.has(arg)) {
                                        list.push(arg)
                                    }
                                } else if (arg && arg.length && type !== "string") {
                                    add(arg)
                                }
                            })
                        })(arguments);
                        if (firing) {
                            firingLength = list.length
                        } else if (memory) {
                            firingStart = start;
                            fire(memory)
                        }
                    }
                    return this
                },
                remove: function() {
                    if (list) {
                        jQuery.each(arguments, function(_, arg) {
                            var index;
                            while ((index = jQuery.inArray(arg, list, index)) > -1) {
                                list.splice(index, 1);
                                if (firing) {
                                    if (index <= firingLength) {
                                        firingLength--
                                    }
                                    if (index <= firingIndex) {
                                        firingIndex--
                                    }
                                }
                            }
                        })
                    }
                    return this
                },
                has: function(fn) {
                    return fn ? jQuery.inArray(fn, list) > -1 : !!(list && list.length)
                },
                empty: function() {
                    list = [];
                    firingLength = 0;
                    return this
                },
                disable: function() {
                    list = stack = memory = undefined;
                    return this
                },
                disabled: function() {
                    return !list
                },
                lock: function() {
                    stack = undefined;
                    if (!memory) {
                        self.disable()
                    }
                    return this
                },
                locked: function() {
                    return !stack
                },
                fireWith: function(context, args) {
                    args = args || [];
                    args = [context, args.slice ? args.slice() : args];
                    if (list && (!fired || stack)) {
                        if (firing) {
                            stack.push(args)
                        } else {
                            fire(args)
                        }
                    }
                    return this
                },
                fire: function() {
                    self.fireWith(this, arguments);
                    return this
                },
                fired: function() {
                    return !!fired
                }
            };
        return self
    };
    jQuery.extend({
        Deferred: function(func) {
            var tuples = [
                    ["resolve", "done", jQuery.Callbacks("once memory"), "resolved"],
                    ["reject", "fail", jQuery.Callbacks("once memory"), "rejected"],
                    ["notify", "progress", jQuery.Callbacks("memory")]
                ],
                state = "pending",
                promise = {
                    state: function() {
                        return state
                    },
                    always: function() {
                        deferred.done(arguments).fail(arguments);
                        return this
                    },
                    then: function() {
                        var fns = arguments;
                        return jQuery.Deferred(function(newDefer) {
                            jQuery.each(tuples, function(i, tuple) {
                                var action = tuple[0],
                                    fn = jQuery.isFunction(fns[i]) && fns[i];
                                deferred[tuple[1]](function() {
                                    var returned = fn && fn.apply(this, arguments);
                                    if (returned && jQuery.isFunction(returned.promise)) {
                                        returned.promise().done(newDefer.resolve).fail(newDefer.reject).progress(newDefer.notify)
                                    } else {
                                        newDefer[action + "With"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments)
                                    }
                                })
                            });
                            fns = null
                        }).promise()
                    },
                    promise: function(obj) {
                        return obj != null ? jQuery.extend(obj, promise) : promise
                    }
                },
                deferred = {};
            promise.pipe = promise.then;
            jQuery.each(tuples, function(i, tuple) {
                var list = tuple[2],
                    stateString = tuple[3];
                promise[tuple[1]] = list.add;
                if (stateString) {
                    list.add(function() {
                        state = stateString
                    }, tuples[i ^ 1][2].disable, tuples[2][2].lock)
                }
                deferred[tuple[0]] = function() {
                    deferred[tuple[0] + "With"](this === deferred ? promise : this, arguments);
                    return this
                };
                deferred[tuple[0] + "With"] = list.fireWith
            });
            promise.promise(deferred);
            if (func) {
                func.call(deferred, deferred)
            }
            return deferred
        },
        when: function(subordinate) {
            var i = 0,
                resolveValues = core_slice.call(arguments),
                length = resolveValues.length,
                remaining = length !== 1 || subordinate && jQuery.isFunction(subordinate.promise) ? length : 0,
                deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
                updateFunc = function(i, contexts, values) {
                    return function(value) {
                        contexts[i] = this;
                        values[i] = arguments.length > 1 ? core_slice.call(arguments) : value;
                        if (values === progressValues) {
                            deferred.notifyWith(contexts, values)
                        } else if (!--remaining) {
                            deferred.resolveWith(contexts, values)
                        }
                    }
                },
                progressValues, progressContexts, resolveContexts;
            if (length > 1) {
                progressValues = new Array(length);
                progressContexts = new Array(length);
                resolveContexts = new Array(length);
                for (; i < length; i++) {
                    if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {
                        resolveValues[i].promise().done(updateFunc(i, resolveContexts, resolveValues)).fail(deferred.reject).progress(updateFunc(i, progressContexts, progressValues))
                    } else {
                        --remaining
                    }
                }
            }
            if (!remaining) {
                deferred.resolveWith(resolveContexts, resolveValues)
            }
            return deferred.promise()
        }
    });
    jQuery.support = function(support) {
        var input = document.createElement("input"),
            fragment = document.createDocumentFragment(),
            div = document.createElement("div"),
            select = document.createElement("select"),
            opt = select.appendChild(document.createElement("option"));
        if (!input.type) {
            return support
        }
        input.type = "checkbox";
        support.checkOn = input.value !== "";
        support.optSelected = opt.selected;
        support.reliableMarginRight = true;
        support.boxSizingReliable = true;
        support.pixelPosition = false;
        input.checked = true;
        support.noCloneChecked = input.cloneNode(true).checked;
        select.disabled = true;
        support.optDisabled = !opt.disabled;
        input = document.createElement("input");
        input.value = "t";
        input.type = "radio";
        support.radioValue = input.value === "t";
        input.setAttribute("checked", "t");
        input.setAttribute("name", "t");
        fragment.appendChild(input);
        support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
        support.focusinBubbles = "onfocusin" in window;
        div.style.backgroundClip = "content-box";
        div.cloneNode(true).style.backgroundClip = "";
        support.clearCloneStyle = div.style.backgroundClip === "content-box";
        jQuery(function() {
            var container, marginDiv, divReset = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",
                body = document.getElementsByTagName("body")[0];
            if (!body) {
                return
            }
            container = document.createElement("div");
            container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
            body.appendChild(container).appendChild(div);
            div.innerHTML = "";
            div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%";
            jQuery.swap(body, body.style.zoom != null ? {
                zoom: 1
            } : {}, function() {
                support.boxSizing = div.offsetWidth === 4
            });
            if (window.getComputedStyle) {
                support.pixelPosition = (window.getComputedStyle(div, null) || {}).top !== "1%";
                support.boxSizingReliable = (window.getComputedStyle(div, null) || {
                    width: "4px"
                }).width === "4px";
                marginDiv = div.appendChild(document.createElement("div"));
                marginDiv.style.cssText = div.style.cssText = divReset;
                marginDiv.style.marginRight = marginDiv.style.width = "0";
                div.style.width = "1px";
                support.reliableMarginRight = !parseFloat((window.getComputedStyle(marginDiv, null) || {}).marginRight)
            }
            body.removeChild(container)
        });
        return support
    }({});
    var data_user, data_priv, rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
        rmultiDash = /([A-Z])/g;

    function Data() {
        Object.defineProperty(this.cache = {}, 0, {
            get: function() {
                return {}
            }
        });
        this.expando = jQuery.expando + Math.random()
    }
    Data.uid = 1;
    Data.accepts = function(owner) {
        return owner.nodeType ? owner.nodeType === 1 || owner.nodeType === 9 : true
    };
    Data.prototype = {
        key: function(owner) {
            if (!Data.accepts(owner)) {
                return 0
            }
            var descriptor = {},
                unlock = owner[this.expando];
            if (!unlock) {
                unlock = Data.uid++;
                try {
                    descriptor[this.expando] = {
                        value: unlock
                    };
                    Object.defineProperties(owner, descriptor)
                } catch (e) {
                    descriptor[this.expando] = unlock;
                    jQuery.extend(owner, descriptor)
                }
            }
            if (!this.cache[unlock]) {
                this.cache[unlock] = {}
            }
            return unlock
        },
        set: function(owner, data, value) {
            var prop, unlock = this.key(owner),
                cache = this.cache[unlock];
            if (typeof data === "string") {
                cache[data] = value
            } else {
                if (jQuery.isEmptyObject(cache)) {
                    this.cache[unlock] = data
                } else {
                    for (prop in data) {
                        cache[prop] = data[prop]
                    }
                }
            }
        },
        get: function(owner, key) {
            var cache = this.cache[this.key(owner)];
            return key === undefined ? cache : cache[key]
        },
        access: function(owner, key, value) {
            if (key === undefined || key && typeof key === "string" && value === undefined) {
                return this.get(owner, key)
            }
            this.set(owner, key, value);
            return value !== undefined ? value : key
        },
        remove: function(owner, key) {
            var i, name, unlock = this.key(owner),
                cache = this.cache[unlock];
            if (key === undefined) {
                this.cache[unlock] = {}
            } else {
                if (jQuery.isArray(key)) {
                    name = key.concat(key.map(jQuery.camelCase))
                } else {
                    if (key in cache) {
                        name = [key]
                    } else {
                        name = jQuery.camelCase(key);
                        name = name in cache ? [name] : name.match(core_rnotwhite) || []
                    }
                }
                i = name.length;
                while (i--) {
                    delete cache[name[i]]
                }
            }
        },
        hasData: function(owner) {
            return !jQuery.isEmptyObject(this.cache[owner[this.expando]] || {})
        },
        discard: function(owner) {
            delete this.cache[this.key(owner)]
        }
    };
    data_user = new Data;
    data_priv = new Data;
    jQuery.extend({
        acceptData: Data.accepts,
        hasData: function(elem) {
            return data_user.hasData(elem) || data_priv.hasData(elem)
        },
        data: function(elem, name, data) {
            return data_user.access(elem, name, data)
        },
        removeData: function(elem, name) {
            data_user.remove(elem, name)
        },
        _data: function(elem, name, data) {
            return data_priv.access(elem, name, data)
        },
        _removeData: function(elem, name) {
            data_priv.remove(elem, name)
        }
    });
    jQuery.fn.extend({
        data: function(key, value) {
            var attrs, name, elem = this[0],
                i = 0,
                data = null;
            if (key === undefined) {
                if (this.length) {
                    data = data_user.get(elem);
                    if (elem.nodeType === 1 && !data_priv.get(elem, "hasDataAttrs")) {
                        attrs = elem.attributes;
                        for (; i < attrs.length; i++) {
                            name = attrs[i].name;
                            if (name.indexOf("data-") === 0) {
                                name = jQuery.camelCase(name.substring(5));
                                dataAttr(elem, name, data[name])
                            }
                        }
                        data_priv.set(elem, "hasDataAttrs", true)
                    }
                }
                return data
            }
            if (typeof key === "object") {
                return this.each(function() {
                    data_user.set(this, key)
                })
            }
            return jQuery.access(this, function(value) {
                var data, camelKey = jQuery.camelCase(key);
                if (elem && value === undefined) {
                    data = data_user.get(elem, key);
                    if (data !== undefined) {
                        return data
                    }
                    data = data_user.get(elem, camelKey);
                    if (data !== undefined) {
                        return data
                    }
                    data = dataAttr(elem, camelKey, undefined);
                    if (data !== undefined) {
                        return data
                    }
                    return
                }
                this.each(function() {
                    var data = data_user.get(this, camelKey);
                    data_user.set(this, camelKey, value);
                    if (key.indexOf("-") !== -1 && data !== undefined) {
                        data_user.set(this, key, value)
                    }
                })
            }, null, value, arguments.length > 1, null, true)
        },
        removeData: function(key) {
            return this.each(function() {
                data_user.remove(this, key)
            })
        }
    });

    function dataAttr(elem, key, data) {
        var name;
        if (data === undefined && elem.nodeType === 1) {
            name = "data-" + key.replace(rmultiDash, "-$1").toLowerCase();
            data = elem.getAttribute(name);
            if (typeof data === "string") {
                try {
                    data = data === "true" ? true : data === "false" ? false : data === "null" ? null : +data + "" === data ? +data : rbrace.test(data) ? JSON.parse(data) : data
                } catch (e) {}
                data_user.set(elem, key, data)
            } else {
                data = undefined
            }
        }
        return data
    }
    jQuery.extend({
        queue: function(elem, type, data) {
            var queue;
            if (elem) {
                type = (type || "fx") + "queue";
                queue = data_priv.get(elem, type);
                if (data) {
                    if (!queue || jQuery.isArray(data)) {
                        queue = data_priv.access(elem, type, jQuery.makeArray(data))
                    } else {
                        queue.push(data)
                    }
                }
                return queue || []
            }
        },
        dequeue: function(elem, type) {
            type = type || "fx";
            var queue = jQuery.queue(elem, type),
                startLength = queue.length,
                fn = queue.shift(),
                hooks = jQuery._queueHooks(elem, type),
                next = function() {
                    jQuery.dequeue(elem, type)
                };
            if (fn === "inprogress") {
                fn = queue.shift();
                startLength--
            }
            hooks.cur = fn;
            if (fn) {
                if (type === "fx") {
                    queue.unshift("inprogress")
                }
                delete hooks.stop;
                fn.call(elem, next, hooks)
            }
            if (!startLength && hooks) {
                hooks.empty.fire()
            }
        },
        _queueHooks: function(elem, type) {
            var key = type + "queueHooks";
            return data_priv.get(elem, key) || data_priv.access(elem, key, {
                empty: jQuery.Callbacks("once memory").add(function() {
                    data_priv.remove(elem, [type + "queue", key])
                })
            })
        }
    });
    jQuery.fn.extend({
        queue: function(type, data) {
            var setter = 2;
            if (typeof type !== "string") {
                data = type;
                type = "fx";
                setter--
            }
            if (arguments.length < setter) {
                return jQuery.queue(this[0], type)
            }
            return data === undefined ? this : this.each(function() {
                var queue = jQuery.queue(this, type, data);
                jQuery._queueHooks(this, type);
                if (type === "fx" && queue[0] !== "inprogress") {
                    jQuery.dequeue(this, type)
                }
            })
        },
        dequeue: function(type) {
            return this.each(function() {
                jQuery.dequeue(this, type)
            })
        },
        delay: function(time, type) {
            time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
            type = type || "fx";
            return this.queue(type, function(next, hooks) {
                var timeout = setTimeout(next, time);
                hooks.stop = function() {
                    clearTimeout(timeout)
                }
            })
        },
        clearQueue: function(type) {
            return this.queue(type || "fx", [])
        },
        promise: function(type, obj) {
            var tmp, count = 1,
                defer = jQuery.Deferred(),
                elements = this,
                i = this.length,
                resolve = function() {
                    if (!--count) {
                        defer.resolveWith(elements, [elements])
                    }
                };
            if (typeof type !== "string") {
                obj = type;
                type = undefined
            }
            type = type || "fx";
            while (i--) {
                tmp = data_priv.get(elements[i], type + "queueHooks");
                if (tmp && tmp.empty) {
                    count++;
                    tmp.empty.add(resolve)
                }
            }
            resolve();
            return defer.promise(obj)
        }
    });
    var nodeHook, boolHook, rclass = /[\t\r\n]/g,
        rreturn = /\r/g,
        rfocusable = /^(?:input|select|textarea|button)$/i;
    jQuery.fn.extend({
        attr: function(name, value) {
            return jQuery.access(this, jQuery.attr, name, value, arguments.length > 1)
        },
        removeAttr: function(name) {
            return this.each(function() {
                jQuery.removeAttr(this, name)
            })
        },
        prop: function(name, value) {
            return jQuery.access(this, jQuery.prop, name, value, arguments.length > 1)
        },
        removeProp: function(name) {
            return this.each(function() {
                delete this[jQuery.propFix[name] || name]
            })
        },
        addClass: function(value) {
            var classes, elem, cur, clazz, j, i = 0,
                len = this.length,
                proceed = typeof value === "string" && value;
            if (jQuery.isFunction(value)) {
                return this.each(function(j) {
                    jQuery(this).addClass(value.call(this, j, this.className))
                })
            }
            if (proceed) {
                classes = (value || "").match(core_rnotwhite) || [];
                for (; i < len; i++) {
                    elem = this[i];
                    cur = elem.nodeType === 1 && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : " ");
                    if (cur) {
                        j = 0;
                        while (clazz = classes[j++]) {
                            if (cur.indexOf(" " + clazz + " ") < 0) {
                                cur += clazz + " "
                            }
                        }
                        elem.className = jQuery.trim(cur)
                    }
                }
            }
            return this
        },
        removeClass: function(value) {
            var classes, elem, cur, clazz, j, i = 0,
                len = this.length,
                proceed = arguments.length === 0 || typeof value === "string" && value;
            if (jQuery.isFunction(value)) {
                return this.each(function(j) {
                    jQuery(this).removeClass(value.call(this, j, this.className))
                })
            }
            if (proceed) {
                classes = (value || "").match(core_rnotwhite) || [];
                for (; i < len; i++) {
                    elem = this[i];
                    cur = elem.nodeType === 1 && (elem.className ? (" " + elem.className + " ").replace(rclass, " ") : "");
                    if (cur) {
                        j = 0;
                        while (clazz = classes[j++]) {
                            while (cur.indexOf(" " + clazz + " ") >= 0) {
                                cur = cur.replace(" " + clazz + " ", " ")
                            }
                        }
                        elem.className = value ? jQuery.trim(cur) : ""
                    }
                }
            }
            return this
        },
        toggleClass: function(value, stateVal) {
            var type = typeof value,
                isBool = typeof stateVal === "boolean";
            if (jQuery.isFunction(value)) {
                return this.each(function(i) {
                    jQuery(this).toggleClass(value.call(this, i, this.className, stateVal), stateVal)
                })
            }
            return this.each(function() {
                if (type === "string") {
                    var className, i = 0,
                        self = jQuery(this),
                        state = stateVal,
                        classNames = value.match(core_rnotwhite) || [];
                    while (className = classNames[i++]) {
                        state = isBool ? state : !self.hasClass(className);
                        self[state ? "addClass" : "removeClass"](className)
                    }
                } else if (type === core_strundefined || type === "boolean") {
                    if (this.className) {
                        data_priv.set(this, "__className__", this.className)
                    }
                    this.className = this.className || value === false ? "" : data_priv.get(this, "__className__") || ""
                }
            })
        },
        hasClass: function(selector) {
            var className = " " + selector + " ",
                i = 0,
                l = this.length;
            for (; i < l; i++) {
                if (this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf(className) >= 0) {
                    return true
                }
            }
            return false
        },
        val: function(value) {
            var hooks, ret, isFunction, elem = this[0];
            if (!arguments.length) {
                if (elem) {
                    hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
                    if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== undefined) {
                        return ret
                    }
                    ret = elem.value;
                    return typeof ret === "string" ? ret.replace(rreturn, "") : ret == null ? "" : ret
                }
                return
            }
            isFunction = jQuery.isFunction(value);
            return this.each(function(i) {
                var val, self = jQuery(this);
                if (this.nodeType !== 1) {
                    return
                }
                if (isFunction) {
                    val = value.call(this, i, self.val())
                } else {
                    val = value
                }
                if (val == null) {
                    val = ""
                } else if (typeof val === "number") {
                    val += ""
                } else if (jQuery.isArray(val)) {
                    val = jQuery.map(val, function(value) {
                        return value == null ? "" : value + ""
                    })
                }
                hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
                if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === undefined) {
                    this.value = val
                }
            })
        }
    });
    jQuery.extend({
        valHooks: {
            option: {
                get: function(elem) {
                    var val = elem.attributes.value;
                    return !val || val.specified ? elem.value : elem.text
                }
            },
            select: {
                get: function(elem) {
                    var value, option, options = elem.options,
                        index = elem.selectedIndex,
                        one = elem.type === "select-one" || index < 0,
                        values = one ? null : [],
                        max = one ? index + 1 : options.length,
                        i = index < 0 ? max : one ? index : 0;
                    for (; i < max; i++) {
                        option = options[i];
                        if ((option.selected || i === index) && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && (!option.parentNode.disabled || !jQuery.nodeName(option.parentNode, "optgroup"))) {
                            value = jQuery(option).val();
                            if (one) {
                                return value
                            }
                            values.push(value)
                        }
                    }
                    return values
                },
                set: function(elem, value) {
                    var optionSet, option, options = elem.options,
                        values = jQuery.makeArray(value),
                        i = options.length;
                    while (i--) {
                        option = options[i];
                        if (option.selected = jQuery.inArray(jQuery(option).val(), values) >= 0) {
                            optionSet = true
                        }
                    }
                    if (!optionSet) {
                        elem.selectedIndex = -1
                    }
                    return values
                }
            }
        },
        attr: function(elem, name, value) {
            var hooks, ret, nType = elem.nodeType;
            if (!elem || nType === 3 || nType === 8 || nType === 2) {
                return
            }
            if (typeof elem.getAttribute === core_strundefined) {
                return jQuery.prop(elem, name, value)
            }
            if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
                name = name.toLowerCase();
                hooks = jQuery.attrHooks[name] || (jQuery.expr.match.boolean.test(name) ? boolHook : nodeHook)
            }
            if (value !== undefined) {
                if (value === null) {
                    jQuery.removeAttr(elem, name)
                } else if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined) {
                    return ret
                } else {
                    elem.setAttribute(name, value + "");
                    return value
                }
            } else if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
                return ret
            } else {
                ret = jQuery.find.attr(elem, name);
                return ret == null ? undefined : ret
            }
        },
        removeAttr: function(elem, value) {
            var name, propName, i = 0,
                attrNames = value && value.match(core_rnotwhite);
            if (attrNames && elem.nodeType === 1) {
                while (name = attrNames[i++]) {
                    propName = jQuery.propFix[name] || name;
                    if (jQuery.expr.match.boolean.test(name)) {
                        elem[propName] = false
                    }
                    elem.removeAttribute(name)
                }
            }
        },
        attrHooks: {
            type: {
                set: function(elem, value) {
                    if (!jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input")) {
                        var val = elem.value;
                        elem.setAttribute("type", value);
                        if (val) {
                            elem.value = val
                        }
                        return value
                    }
                }
            }
        },
        propFix: {
            "for": "htmlFor",
            "class": "className"
        },
        prop: function(elem, name, value) {
            var ret, hooks, notxml, nType = elem.nodeType;
            if (!elem || nType === 3 || nType === 8 || nType === 2) {
                return
            }
            notxml = nType !== 1 || !jQuery.isXMLDoc(elem);
            if (notxml) {
                name = jQuery.propFix[name] || name;
                hooks = jQuery.propHooks[name]
            }
            if (value !== undefined) {
                return hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== undefined ? ret : elem[name] = value
            } else {
                return hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null ? ret : elem[name]
            }
        },
        propHooks: {
            tabIndex: {
                get: function(elem) {
                    return elem.hasAttribute("tabindex") || rfocusable.test(elem.nodeName) || elem.href ? elem.tabIndex : -1
                }
            }
        }
    });
    boolHook = {
        set: function(elem, value, name) {
            if (value === false) {
                jQuery.removeAttr(elem, name)
            } else {
                elem.setAttribute(name, name)
            }
            return name
        }
    };
    jQuery.each(jQuery.expr.match.boolean.source.match(/\w+/g), function(i, name) {
        var getter = jQuery.expr.attrHandle[name] || jQuery.find.attr;
        jQuery.expr.attrHandle[name] = function(elem, name, isXML) {
            var fn = jQuery.expr.attrHandle[name],
                ret = isXML ? undefined : (jQuery.expr.attrHandle[name] = undefined) != getter(elem, name, isXML) ? name.toLowerCase() : null;
            jQuery.expr.attrHandle[name] = fn;
            return ret
        }
    });
    if (!jQuery.support.optSelected) {
        jQuery.propHooks.selected = {
            get: function(elem) {
                var parent = elem.parentNode;
                if (parent && parent.parentNode) {
                    parent.parentNode.selectedIndex
                }
                return null
            }
        }
    }
    jQuery.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
        jQuery.propFix[this.toLowerCase()] = this
    });
    jQuery.each(["radio", "checkbox"], function() {
        jQuery.valHooks[this] = {
            set: function(elem, value) {
                if (jQuery.isArray(value)) {
                    return elem.checked = jQuery.inArray(jQuery(elem).val(), value) >= 0
                }
            }
        };
        if (!jQuery.support.checkOn) {
            jQuery.valHooks[this].get = function(elem) {
                return elem.getAttribute("value") === null ? "on" : elem.value
            }
        }
    });
    var rkeyEvent = /^key/,
        rmouseEvent = /^(?:mouse|contextmenu)|click/,
        rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
        rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;

    function returnTrue() {
        return true
    }

    function returnFalse() {
        return false
    }

    function safeActiveElement() {
        try {
            return document.activeElement
        } catch (err) {}
    }
    jQuery.event = {
        global: {},
        add: function(elem, types, handler, data, selector) {
            var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = data_priv.get(elem);
            if (!elemData) {
                return
            }
            if (handler.handler) {
                handleObjIn = handler;
                handler = handleObjIn.handler;
                selector = handleObjIn.selector
            }
            if (!handler.guid) {
                handler.guid = jQuery.guid++
            }
            if (!(events = elemData.events)) {
                events = elemData.events = {}
            }
            if (!(eventHandle = elemData.handle)) {
                eventHandle = elemData.handle = function(e) {
                    return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ? jQuery.event.dispatch.apply(eventHandle.elem, arguments) : undefined
                };
                eventHandle.elem = elem
            }
            types = (types || "").match(core_rnotwhite) || [""];
            t = types.length;
            while (t--) {
                tmp = rtypenamespace.exec(types[t]) || [];
                type = origType = tmp[1];
                namespaces = (tmp[2] || "").split(".").sort();
                if (!type) {
                    continue
                }
                special = jQuery.event.special[type] || {};
                type = (selector ? special.delegateType : special.bindType) || type;
                special = jQuery.event.special[type] || {};
                handleObj = jQuery.extend({
                    type: type,
                    origType: origType,
                    data: data,
                    handler: handler,
                    guid: handler.guid,
                    selector: selector,
                    needsContext: selector && jQuery.expr.match.needsContext.test(selector),
                    namespace: namespaces.join(".")
                }, handleObjIn);
                if (!(handlers = events[type])) {
                    handlers = events[type] = [];
                    handlers.delegateCount = 0;
                    if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
                        if (elem.addEventListener) {
                            elem.addEventListener(type, eventHandle, false)
                        }
                    }
                }
                if (special.add) {
                    special.add.call(elem, handleObj);
                    if (!handleObj.handler.guid) {
                        handleObj.handler.guid = handler.guid
                    }
                }
                if (selector) {
                    handlers.splice(handlers.delegateCount++, 0, handleObj)
                } else {
                    handlers.push(handleObj)
                }
                jQuery.event.global[type] = true
            }
            elem = null
        },
        remove: function(elem, types, handler, selector, mappedTypes) {
            var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = data_priv.hasData(elem) && data_priv.get(elem);
            if (!elemData || !(events = elemData.events)) {
                return
            }
            types = (types || "").match(core_rnotwhite) || [""];
            t = types.length;
            while (t--) {
                tmp = rtypenamespace.exec(types[t]) || [];
                type = origType = tmp[1];
                namespaces = (tmp[2] || "").split(".").sort();
                if (!type) {
                    for (type in events) {
                        jQuery.event.remove(elem, type + types[t], handler, selector, true)
                    }
                    continue
                }
                special = jQuery.event.special[type] || {};
                type = (selector ? special.delegateType : special.bindType) || type;
                handlers = events[type] || [];
                tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
                origCount = j = handlers.length;
                while (j--) {
                    handleObj = handlers[j];
                    if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
                        handlers.splice(j, 1);
                        if (handleObj.selector) {
                            handlers.delegateCount--
                        }
                        if (special.remove) {
                            special.remove.call(elem, handleObj)
                        }
                    }
                }
                if (origCount && !handlers.length) {
                    if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
                        jQuery.removeEvent(elem, type, elemData.handle)
                    }
                    delete events[type]
                }
            }
            if (jQuery.isEmptyObject(events)) {
                delete elemData.handle;
                data_priv.remove(elem, "events")
            }
        },
        trigger: function(event, data, elem, onlyHandlers) {
            var i, cur, tmp, bubbleType, ontype, handle, special, eventPath = [elem || document],
                type = core_hasOwn.call(event, "type") ? event.type : event,
                namespaces = core_hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
            cur = tmp = elem = elem || document;
            if (elem.nodeType === 3 || elem.nodeType === 8) {
                return
            }
            if (rfocusMorph.test(type + jQuery.event.triggered)) {
                return
            }
            if (type.indexOf(".") >= 0) {
                namespaces = type.split(".");
                type = namespaces.shift();
                namespaces.sort()
            }
            ontype = type.indexOf(":") < 0 && "on" + type;
            event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event);
            event.isTrigger = onlyHandlers ? 2 : 3;
            event.namespace = namespaces.join(".");
            event.namespace_re = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
            event.result = undefined;
            if (!event.target) {
                event.target = elem
            }
            data = data == null ? [event] : jQuery.makeArray(data, [event]);
            special = jQuery.event.special[type] || {};
            if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
                return
            }
            if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {
                bubbleType = special.delegateType || type;
                if (!rfocusMorph.test(bubbleType + type)) {
                    cur = cur.parentNode
                }
                for (; cur; cur = cur.parentNode) {
                    eventPath.push(cur);
                    tmp = cur
                }
                if (tmp === (elem.ownerDocument || document)) {
                    eventPath.push(tmp.defaultView || tmp.parentWindow || window)
                }
            }
            i = 0;
            while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
                event.type = i > 1 ? bubbleType : special.bindType || type;
                handle = (data_priv.get(cur, "events") || {})[event.type] && data_priv.get(cur, "handle");
                if (handle) {
                    handle.apply(cur, data)
                }
                handle = ontype && cur[ontype];
                if (handle && jQuery.acceptData(cur) && handle.apply && handle.apply(cur, data) === false) {
                    event.preventDefault()
                }
            }
            event.type = type;
            if (!onlyHandlers && !event.isDefaultPrevented()) {
                if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && jQuery.acceptData(elem)) {
                    if (ontype && jQuery.isFunction(elem[type]) && !jQuery.isWindow(elem)) {
                        tmp = elem[ontype];
                        if (tmp) {
                            elem[ontype] = null
                        }
                        jQuery.event.triggered = type;
                        elem[type]();
                        jQuery.event.triggered = undefined;
                        if (tmp) {
                            elem[ontype] = tmp
                        }
                    }
                }
            }
            return event.result
        },
        dispatch: function(event) {
            event = jQuery.event.fix(event);
            var i, j, ret, matched, handleObj, handlerQueue = [],
                args = core_slice.call(arguments),
                handlers = (data_priv.get(this, "events") || {})[event.type] || [],
                special = jQuery.event.special[event.type] || {};
            args[0] = event;
            event.delegateTarget = this;
            if (special.preDispatch && special.preDispatch.call(this, event) === false) {
                return
            }
            handlerQueue = jQuery.event.handlers.call(this, event, handlers);
            i = 0;
            while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
                event.currentTarget = matched.elem;
                j = 0;
                while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
                    if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {
                        event.handleObj = handleObj;
                        event.data = handleObj.data;
                        ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
                        if (ret !== undefined) {
                            if ((event.result = ret) === false) {
                                event.preventDefault();
                                event.stopPropagation()
                            }
                        }
                    }
                }
            }
            if (special.postDispatch) {
                special.postDispatch.call(this, event)
            }
            return event.result
        },
        handlers: function(event, handlers) {
            var i, matches, sel, handleObj, handlerQueue = [],
                delegateCount = handlers.delegateCount,
                cur = event.target;
            if (delegateCount && cur.nodeType && (!event.button || event.type !== "click")) {
                for (; cur !== this; cur = cur.parentNode || this) {
                    if (cur.disabled !== true || event.type !== "click") {
                        matches = [];
                        for (i = 0; i < delegateCount; i++) {
                            handleObj = handlers[i];
                            sel = handleObj.selector + " ";
                            if (matches[sel] === undefined) {
                                matches[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) >= 0 : jQuery.find(sel, this, null, [cur]).length
                            }
                            if (matches[sel]) {
                                matches.push(handleObj)
                            }
                        }
                        if (matches.length) {
                            handlerQueue.push({
                                elem: cur,
                                handlers: matches
                            })
                        }
                    }
                }
            }
            if (delegateCount < handlers.length) {
                handlerQueue.push({
                    elem: this,
                    handlers: handlers.slice(delegateCount)
                })
            }
            return handlerQueue
        },
        props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
        fixHooks: {},
        keyHooks: {
            props: "char charCode key keyCode".split(" "),
            filter: function(event, original) {
                if (event.which == null) {
                    event.which = original.charCode != null ? original.charCode : original.keyCode
                }
                return event
            }
        },
        mouseHooks: {
            props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
            filter: function(event, original) {
                var eventDoc, doc, body, button = original.button;
                if (event.pageX == null && original.clientX != null) {
                    eventDoc = event.target.ownerDocument || document;
                    doc = eventDoc.documentElement;
                    body = eventDoc.body;
                    event.pageX = original.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
                    event.pageY = original.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0)
                }
                if (!event.which && button !== undefined) {
                    event.which = button & 1 ? 1 : button & 2 ? 3 : button & 4 ? 2 : 0
                }
                return event
            }
        },
        fix: function(event) {
            if (event[jQuery.expando]) {
                return event
            }
            var i, prop, copy, type = event.type,
                originalEvent = event,
                fixHook = this.fixHooks[type];
            if (!fixHook) {
                this.fixHooks[type] = fixHook = rmouseEvent.test(type) ? this.mouseHooks : rkeyEvent.test(type) ? this.keyHooks : {}
            }
            copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;
            event = new jQuery.Event(originalEvent);
            i = copy.length;
            while (i--) {
                prop = copy[i];
                event[prop] = originalEvent[prop]
            }
            if (event.target.nodeType === 3) {
                event.target = event.target.parentNode
            }
            return fixHook.filter ? fixHook.filter(event, originalEvent) : event
        },
        special: {
            load: {
                noBubble: true
            },
            focus: {
                trigger: function() {
                    if (this !== safeActiveElement() && this.focus) {
                        this.focus();
                        return false
                    }
                },
                delegateType: "focusin"
            },
            blur: {
                trigger: function() {
                    if (this === safeActiveElement() && this.blur) {
                        this.blur();
                        return false
                    }
                },
                delegateType: "focusout"
            },
            click: {
                trigger: function() {
                    if (this.type === "checkbox" && this.click && jQuery.nodeName(this, "input")) {
                        this.click();
                        return false
                    }
                },
                _default: function(event) {
                    return jQuery.nodeName(event.target, "a")
                }
            },
            beforeunload: {
                postDispatch: function(event) {
                    if (event.result !== undefined) {
                        event.originalEvent.returnValue = event.result
                    }
                }
            }
        },
        simulate: function(type, elem, event, bubble) {
            var e = jQuery.extend(new jQuery.Event, event, {
                type: type,
                isSimulated: true,
                originalEvent: {}
            });
            if (bubble) {
                jQuery.event.trigger(e, null, elem)
            } else {
                jQuery.event.dispatch.call(elem, e)
            }
            if (e.isDefaultPrevented()) {
                event.preventDefault()
            }
        }
    };
    jQuery.removeEvent = function(elem, type, handle) {
        if (elem.removeEventListener) {
            elem.removeEventListener(type, handle, false)
        }
    };
    jQuery.Event = function(src, props) {
        if (!(this instanceof jQuery.Event)) {
            return new jQuery.Event(src, props)
        }
        if (src && src.type) {
            this.originalEvent = src;
            this.type = src.type;
            this.isDefaultPrevented = src.defaultPrevented || src.getPreventDefault && src.getPreventDefault() ? returnTrue : returnFalse
        } else {
            this.type = src
        }
        if (props) {
            jQuery.extend(this, props)
        }
        this.timeStamp = src && src.timeStamp || jQuery.now();
        this[jQuery.expando] = true
    };
    jQuery.Event.prototype = {
        isDefaultPrevented: returnFalse,
        isPropagationStopped: returnFalse,
        isImmediatePropagationStopped: returnFalse,
        preventDefault: function() {
            var e = this.originalEvent;
            this.isDefaultPrevented = returnTrue;
            if (e && e.preventDefault) {
                e.preventDefault()
            }
        },
        stopPropagation: function() {
            var e = this.originalEvent;
            this.isPropagationStopped = returnTrue;
            if (e && e.stopPropagation) {
                e.stopPropagation()
            }
        },
        stopImmediatePropagation: function() {
            this.isImmediatePropagationStopped = returnTrue;
            this.stopPropagation()
        }
    };
    jQuery.each({
        mouseenter: "mouseover",
        mouseleave: "mouseout"
    }, function(orig, fix) {
        jQuery.event.special[orig] = {
            delegateType: fix,
            bindType: fix,
            handle: function(event) {
                var ret, target = this,
                    related = event.relatedTarget,
                    handleObj = event.handleObj;
                if (!related || related !== target && !jQuery.contains(target, related)) {
                    event.type = handleObj.origType;
                    ret = handleObj.handler.apply(this, arguments);
                    event.type = fix
                }
                return ret
            }
        }
    });
    if (!jQuery.support.focusinBubbles) {
        jQuery.each({
            focus: "focusin",
            blur: "focusout"
        }, function(orig, fix) {
            var attaches = 0,
                handler = function(event) {
                    jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true)
                };
            jQuery.event.special[fix] = {
                setup: function() {
                    if (attaches++ === 0) {
                        document.addEventListener(orig, handler, true)
                    }
                },
                teardown: function() {
                    if (--attaches === 0) {
                        document.removeEventListener(orig, handler, true)
                    }
                }
            }
        })
    }
    jQuery.fn.extend({
        on: function(types, selector, data, fn, one) {
            var origFn, type;
            if (typeof types === "object") {
                if (typeof selector !== "string") {
                    data = data || selector;
                    selector = undefined
                }
                for (type in types) {
                    this.on(type, selector, data, types[type], one)
                }
                return this
            }
            if (data == null && fn == null) {
                fn = selector;
                data = selector = undefined
            } else if (fn == null) {
                if (typeof selector === "string") {
                    fn = data;
                    data = undefined
                } else {
                    fn = data;
                    data = selector;
                    selector = undefined
                }
            }
            if (fn === false) {
                fn = returnFalse
            } else if (!fn) {
                return this
            }
            if (one === 1) {
                origFn = fn;
                fn = function(event) {
                    jQuery().off(event);
                    return origFn.apply(this, arguments)
                };
                fn.guid = origFn.guid || (origFn.guid = jQuery.guid++)
            }
            return this.each(function() {
                jQuery.event.add(this, types, fn, data, selector)
            })
        },
        one: function(types, selector, data, fn) {
            return this.on(types, selector, data, fn, 1)
        },
        off: function(types, selector, fn) {
            var handleObj, type;
            if (types && types.preventDefault && types.handleObj) {
                handleObj = types.handleObj;
                jQuery(types.delegateTarget).off(handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, handleObj.selector, handleObj.handler);
                return this
            }
            if (typeof types === "object") {
                for (type in types) {
                    this.off(type, selector, types[type])
                }
                return this
            }
            if (selector === false || typeof selector === "function") {
                fn = selector;
                selector = undefined
            }
            if (fn === false) {
                fn = returnFalse
            }
            return this.each(function() {
                jQuery.event.remove(this, types, fn, selector)
            })
        },
        trigger: function(type, data) {
            return this.each(function() {
                jQuery.event.trigger(type, data, this)
            })
        },
        triggerHandler: function(type, data) {
            var elem = this[0];
            if (elem) {
                return jQuery.event.trigger(type, data, elem, true)
            }
        }
    });
    var isSimple = /^.[^:#\[\.,]*$/,
        rneedsContext = jQuery.expr.match.needsContext,
        guaranteedUnique = {
            children: true,
            contents: true,
            next: true,
            prev: true
        };
    jQuery.fn.extend({
        find: function(selector) {
            var self, matched, i, l = this.length;
            if (typeof selector !== "string") {
                self = this;
                return this.pushStack(jQuery(selector).filter(function() {
                    for (i = 0; i < l; i++) {
                        if (jQuery.contains(self[i], this)) {
                            return true
                        }
                    }
                }))
            }
            matched = [];
            for (i = 0; i < l; i++) {
                jQuery.find(selector, this[i], matched)
            }
            matched = this.pushStack(l > 1 ? jQuery.unique(matched) : matched);
            matched.selector = (this.selector ? this.selector + " " : "") + selector;
            return matched
        },
        has: function(target) {
            var targets = jQuery(target, this),
                l = targets.length;
            return this.filter(function() {
                var i = 0;
                for (; i < l; i++) {
                    if (jQuery.contains(this, targets[i])) {
                        return true
                    }
                }
            })
        },
        not: function(selector) {
            return this.pushStack(winnow(this, selector || [], true))
        },
        filter: function(selector) {
            return this.pushStack(winnow(this, selector || [], false))
        },
        is: function(selector) {
            return !!selector && (typeof selector === "string" ? rneedsContext.test(selector) ? jQuery(selector, this.context).index(this[0]) >= 0 : jQuery.filter(selector, this).length > 0 : this.filter(selector).length > 0)
        },
        closest: function(selectors, context) {
            var cur, i = 0,
                l = this.length,
                matched = [],
                pos = rneedsContext.test(selectors) || typeof selectors !== "string" ? jQuery(selectors, context || this.context) : 0;
            for (; i < l; i++) {
                for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
                    if (cur.nodeType < 11 && (pos ? pos.index(cur) > -1 : cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors))) {
                        cur = matched.push(cur);
                        break
                    }
                }
            }
            return this.pushStack(matched.length > 1 ? jQuery.unique(matched) : matched)
        },
        index: function(elem) {
            if (!elem) {
                return this[0] && this[0].parentNode ? this.first().prevAll().length : -1
            }
            if (typeof elem === "string") {
                return core_indexOf.call(jQuery(elem), this[0])
            }
            return core_indexOf.call(this, elem.jquery ? elem[0] : elem)
        },
        add: function(selector, context) {
            var set = typeof selector === "string" ? jQuery(selector, context) : jQuery.makeArray(selector && selector.nodeType ? [selector] : selector),
                all = jQuery.merge(this.get(), set);
            return this.pushStack(jQuery.unique(all))
        },
        addBack: function(selector) {
            return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector))
        }
    });

    function sibling(cur, dir) {
        while ((cur = cur[dir]) && cur.nodeType !== 1) {}
        return cur
    }
    jQuery.each({
        parent: function(elem) {
            var parent = elem.parentNode;
            return parent && parent.nodeType !== 11 ? parent : null
        },
        parents: function(elem) {
            return jQuery.dir(elem, "parentNode")
        },
        parentsUntil: function(elem, i, until) {
            return jQuery.dir(elem, "parentNode", until)
        },
        next: function(elem) {
            return sibling(elem, "nextSibling")
        },
        prev: function(elem) {
            return sibling(elem, "previousSibling")
        },
        nextAll: function(elem) {
            return jQuery.dir(elem, "nextSibling")
        },
        prevAll: function(elem) {
            return jQuery.dir(elem, "previousSibling")
        },
        nextUntil: function(elem, i, until) {
            return jQuery.dir(elem, "nextSibling", until)
        },
        prevUntil: function(elem, i, until) {
            return jQuery.dir(elem, "previousSibling", until)
        },
        siblings: function(elem) {
            return jQuery.sibling((elem.parentNode || {}).firstChild, elem)
        },
        children: function(elem) {
            return jQuery.sibling(elem.firstChild)
        },
        contents: function(elem) {
            return jQuery.nodeName(elem, "iframe") ? elem.contentDocument || elem.contentWindow.document : jQuery.merge([], elem.childNodes)
        }
    }, function(name, fn) {
        jQuery.fn[name] = function(until, selector) {
            var matched = jQuery.map(this, fn, until);
            if (name.slice(-5) !== "Until") {
                selector = until
            }
            if (selector && typeof selector === "string") {
                matched = jQuery.filter(selector, matched)
            }
            if (this.length > 1) {
                if (!guaranteedUnique[name]) {
                    jQuery.unique(matched)
                }
                if (name[0] === "p") {
                    matched.reverse()
                }
            }
            return this.pushStack(matched)
        }
    });
    jQuery.extend({
        filter: function(expr, elems, not) {
            var elem = elems[0];
            if (not) {
                expr = ":not(" + expr + ")"
            }
            return elems.length === 1 && elem.nodeType === 1 ? jQuery.find.matchesSelector(elem, expr) ? [elem] : [] : jQuery.find.matches(expr, jQuery.grep(elems, function(elem) {
                return elem.nodeType === 1
            }))
        },
        dir: function(elem, dir, until) {
            var matched = [],
                truncate = until !== undefined;
            while ((elem = elem[dir]) && elem.nodeType !== 9) {
                if (elem.nodeType === 1) {
                    if (truncate && jQuery(elem).is(until)) {
                        break
                    }
                    matched.push(elem)
                }
            }
            return matched
        },
        sibling: function(n, elem) {
            var matched = [];
            for (; n; n = n.nextSibling) {
                if (n.nodeType === 1 && n !== elem) {
                    matched.push(n)
                }
            }
            return matched
        }
    });

    function winnow(elements, qualifier, not) {
        if (jQuery.isFunction(qualifier)) {
            return jQuery.grep(elements, function(elem, i) {
                return !!qualifier.call(elem, i, elem) !== not
            })
        }
        if (qualifier.nodeType) {
            return jQuery.grep(elements, function(elem) {
                return elem === qualifier !== not
            })
        }
        if (typeof qualifier === "string") {
            if (isSimple.test(qualifier)) {
                return jQuery.filter(qualifier, elements, not)
            }
            qualifier = jQuery.filter(qualifier, elements)
        }
        return jQuery.grep(elements, function(elem) {
            return core_indexOf.call(qualifier, elem) >= 0 !== not
        })
    }
    var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
        rtagName = /<([\w:]+)/,
        rhtml = /<|&#?\w+;/,
        rnoInnerhtml = /<(?:script|style|link)/i,
        manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
        rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
        rscriptType = /^$|\/(?:java|ecma)script/i,
        rscriptTypeMasked = /^true\/(.*)/,
        rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
        wrapMap = {
            option: [1, "<select multiple='multiple'>", "</select>"],
            thead: [1, "<table>", "</table>"],
            tr: [2, "<table><tbody>", "</tbody></table>"],
            td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
            _default: [0, "", ""]
        };
    wrapMap.optgroup = wrapMap.option;
    wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.col = wrapMap.thead;
    wrapMap.th = wrapMap.td;
    jQuery.fn.extend({
        text: function(value) {
            return jQuery.access(this, function(value) {
                return value === undefined ? jQuery.text(this) : this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(value))
            }, null, value, arguments.length)
        },
        append: function() {
            return this.domManip(arguments, function(elem) {
                if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
                    var target = manipulationTarget(this, elem);
                    target.appendChild(elem)
                }
            })
        },
        prepend: function() {
            return this.domManip(arguments, function(elem) {
                if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
                    var target = manipulationTarget(this, elem);
                    target.insertBefore(elem, target.firstChild)
                }
            })
        },
        before: function() {
            return this.domManip(arguments, function(elem) {
                if (this.parentNode) {
                    this.parentNode.insertBefore(elem, this)
                }
            })
        },
        after: function() {
            return this.domManip(arguments, function(elem) {
                if (this.parentNode) {
                    this.parentNode.insertBefore(elem, this.nextSibling)
                }
            })
        },
        remove: function(selector, keepData) {
            var elem, elems = selector ? jQuery.filter(selector, this) : this,
                i = 0;
            for (;
                (elem = elems[i]) != null; i++) {
                if (!keepData && elem.nodeType === 1) {
                    jQuery.cleanData(getAll(elem))
                }
                if (elem.parentNode) {
                    if (keepData && jQuery.contains(elem.ownerDocument, elem)) {
                        setGlobalEval(getAll(elem, "script"))
                    }
                    elem.parentNode.removeChild(elem)
                }
            }
            return this
        },
        empty: function() {
            var elem, i = 0;
            for (;
                (elem = this[i]) != null; i++) {
                if (elem.nodeType === 1) {
                    jQuery.cleanData(getAll(elem, false));
                    elem.textContent = ""
                }
            }
            return this
        },
        clone: function(dataAndEvents, deepDataAndEvents) {
            dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
            deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
            return this.map(function() {
                return jQuery.clone(this, dataAndEvents, deepDataAndEvents)
            })
        },
        html: function(value) {
            return jQuery.access(this, function(value) {
                var elem = this[0] || {},
                    i = 0,
                    l = this.length;
                if (value === undefined && elem.nodeType === 1) {
                    return elem.innerHTML
                }
                if (typeof value === "string" && !rnoInnerhtml.test(value) && !wrapMap[(rtagName.exec(value) || ["", ""])[1].toLowerCase()]) {
                    value = value.replace(rxhtmlTag, "<$1></$2>");
                    try {
                        for (; i < l; i++) {
                            elem = this[i] || {};
                            if (elem.nodeType === 1) {
                                jQuery.cleanData(getAll(elem, false));
                                elem.innerHTML = value
                            }
                        }
                        elem = 0
                    } catch (e) {}
                }
                if (elem) {
                    this.empty().append(value)
                }
            }, null, value, arguments.length)
        },
        replaceWith: function() {
            var args = jQuery.map(this, function(elem) {
                    return [elem.nextSibling, elem.parentNode]
                }),
                i = 0;
            this.domManip(arguments, function(elem) {
                var next = args[i++],
                    parent = args[i++];
                if (parent) {
                    jQuery(this).remove();
                    parent.insertBefore(elem, next)
                }
            }, true);
            return i ? this : this.remove()
        },
        detach: function(selector) {
            return this.remove(selector, true)
        },
        domManip: function(args, callback, allowIntersection) {
            args = core_concat.apply([], args);
            var fragment, first, scripts, hasScripts, node, doc, i = 0,
                l = this.length,
                set = this,
                iNoClone = l - 1,
                value = args[0],
                isFunction = jQuery.isFunction(value);
            if (isFunction || !(l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test(value))) {
                return this.each(function(index) {
                    var self = set.eq(index);
                    if (isFunction) {
                        args[0] = value.call(this, index, self.html())
                    }
                    self.domManip(args, callback, allowIntersection)
                })
            }
            if (l) {
                fragment = jQuery.buildFragment(args, this[0].ownerDocument, false, !allowIntersection && this);
                first = fragment.firstChild;
                if (fragment.childNodes.length === 1) {
                    fragment = first
                }
                if (first) {
                    scripts = jQuery.map(getAll(fragment, "script"), disableScript);
                    hasScripts = scripts.length;
                    for (; i < l; i++) {
                        node = fragment;
                        if (i !== iNoClone) {
                            node = jQuery.clone(node, true, true);
                            if (hasScripts) {
                                jQuery.merge(scripts, getAll(node, "script"));
                            }
                        }
                        callback.call(this[i], node, i)
                    }
                    if (hasScripts) {
                        doc = scripts[scripts.length - 1].ownerDocument;
                        jQuery.map(scripts, restoreScript);
                        for (i = 0; i < hasScripts; i++) {
                            node = scripts[i];
                            if (rscriptType.test(node.type || "") && !data_priv.access(node, "globalEval") && jQuery.contains(doc, node)) {
                                if (node.src) {
                                    jQuery._evalUrl(node.src)
                                } else {
                                    jQuery.globalEval(node.textContent.replace(rcleanScript, ""))
                                }
                            }
                        }
                    }
                }
            }
            return this
        }
    });
    jQuery.each({
        appendTo: "append",
        prependTo: "prepend",
        insertBefore: "before",
        insertAfter: "after",
        replaceAll: "replaceWith"
    }, function(name, original) {
        jQuery.fn[name] = function(selector) {
            var elems, ret = [],
                insert = jQuery(selector),
                last = insert.length - 1,
                i = 0;
            for (; i <= last; i++) {
                elems = i === last ? this : this.clone(true);
                jQuery(insert[i])[original](elems);
                core_push.apply(ret, elems.get())
            }
            return this.pushStack(ret)
        }
    });
    jQuery.extend({
        clone: function(elem, dataAndEvents, deepDataAndEvents) {
            var i, l, srcElements, destElements, clone = elem.cloneNode(true),
                inPage = jQuery.contains(elem.ownerDocument, elem);
            if (!jQuery.support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
                destElements = getAll(clone);
                srcElements = getAll(elem);
                for (i = 0, l = srcElements.length; i < l; i++) {
                    fixInput(srcElements[i], destElements[i])
                }
            }
            if (dataAndEvents) {
                if (deepDataAndEvents) {
                    srcElements = srcElements || getAll(elem);
                    destElements = destElements || getAll(clone);
                    for (i = 0, l = srcElements.length; i < l; i++) {
                        cloneCopyEvent(srcElements[i], destElements[i])
                    }
                } else {
                    cloneCopyEvent(elem, clone)
                }
            }
            destElements = getAll(clone, "script");
            if (destElements.length > 0) {
                setGlobalEval(destElements, !inPage && getAll(elem, "script"))
            }
            return clone
        },
        buildFragment: function(elems, context, scripts, selection) {
            var elem, tmp, tag, wrap, contains, j, i = 0,
                l = elems.length,
                fragment = context.createDocumentFragment(),
                nodes = [];
            for (; i < l; i++) {
                elem = elems[i];
                if (elem || elem === 0) {
                    if (jQuery.type(elem) === "object") {
                        jQuery.merge(nodes, elem.nodeType ? [elem] : elem)
                    } else if (!rhtml.test(elem)) {
                        nodes.push(context.createTextNode(elem))
                    } else {
                        tmp = tmp || fragment.appendChild(context.createElement("div"));
                        tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
                        wrap = wrapMap[tag] || wrapMap._default;
                        tmp.innerHTML = wrap[1] + elem.replace(rxhtmlTag, "<$1></$2>") + wrap[2];
                        j = wrap[0];
                        while (j--) {
                            tmp = tmp.firstChild
                        }
                        jQuery.merge(nodes, tmp.childNodes);
                        tmp = fragment.firstChild;
                        tmp.textContent = ""
                    }
                }
            }
            fragment.textContent = "";
            i = 0;
            while (elem = nodes[i++]) {
                if (selection && jQuery.inArray(elem, selection) !== -1) {
                    continue
                }
                contains = jQuery.contains(elem.ownerDocument, elem);
                tmp = getAll(fragment.appendChild(elem), "script");
                if (contains) {
                    setGlobalEval(tmp)
                }
                if (scripts) {
                    j = 0;
                    while (elem = tmp[j++]) {
                        if (rscriptType.test(elem.type || "")) {
                            scripts.push(elem)
                        }
                    }
                }
            }
            return fragment
        },
        cleanData: function(elems) {
            var data, elem, type, l = elems.length,
                i = 0,
                special = jQuery.event.special;
            for (; i < l; i++) {
                elem = elems[i];
                if (jQuery.acceptData(elem)) {
                    data = data_priv.access(elem);
                    if (data) {
                        for (type in data.events) {
                            if (special[type]) {
                                jQuery.event.remove(elem, type)
                            } else {
                                jQuery.removeEvent(elem, type, data.handle)
                            }
                        }
                    }
                }
                data_user.discard(elem);
                data_priv.discard(elem)
            }
        },
        _evalUrl: function(url) {
            return jQuery.ajax({
                url: url,
                type: "GET",
                dataType: "text",
                async: false,
                global: false,
                success: jQuery.globalEval
            })
        }
    });

    function manipulationTarget(elem, content) {
        return jQuery.nodeName(elem, "table") && jQuery.nodeName(content.nodeType === 1 ? content : content.firstChild, "tr") ? elem.getElementsByTagName("tbody")[0] || elem.appendChild(elem.ownerDocument.createElement("tbody")) : elem
    }

    function disableScript(elem) {
        elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
        return elem
    }

    function restoreScript(elem) {
        var match = rscriptTypeMasked.exec(elem.type);
        if (match) {
            elem.type = match[1]
        } else {
            elem.removeAttribute("type")
        }
        return elem
    }

    function setGlobalEval(elems, refElements) {
        var l = elems.length,
            i = 0;
        for (; i < l; i++) {
            data_priv.set(elems[i], "globalEval", !refElements || data_priv.get(refElements[i], "globalEval"))
        }
    }

    function cloneCopyEvent(src, dest) {
        var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
        if (dest.nodeType !== 1) {
            return
        }
        if (data_priv.hasData(src)) {
            pdataOld = data_priv.access(src);
            pdataCur = jQuery.extend({}, pdataOld);
            events = pdataOld.events;
            data_priv.set(dest, pdataCur);
            if (events) {
                delete pdataCur.handle;
                pdataCur.events = {};
                for (type in events) {
                    for (i = 0, l = events[type].length; i < l; i++) {
                        jQuery.event.add(dest, type, events[type][i])
                    }
                }
            }
        }
        if (data_user.hasData(src)) {
            udataOld = data_user.access(src);
            udataCur = jQuery.extend({}, udataOld);
            data_user.set(dest, udataCur)
        }
    }

    function getAll(context, tag) {
        var ret = context.getElementsByTagName ? context.getElementsByTagName(tag || "*") : context.querySelectorAll ? context.querySelectorAll(tag || "*") : [];
        return tag === undefined || tag && jQuery.nodeName(context, tag) ? jQuery.merge([context], ret) : ret
    }

    function fixInput(src, dest) {
        var nodeName = dest.nodeName.toLowerCase();
        if (nodeName === "input" && manipulation_rcheckableType.test(src.type)) {
            dest.checked = src.checked
        } else if (nodeName === "input" || nodeName === "textarea") {
            dest.defaultValue = src.defaultValue
        }
    }
    jQuery.fn.extend({
        wrapAll: function(html) {
            var wrap;
            if (jQuery.isFunction(html)) {
                return this.each(function(i) {
                    jQuery(this).wrapAll(html.call(this, i))
                })
            }
            if (this[0]) {
                wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
                if (this[0].parentNode) {
                    wrap.insertBefore(this[0])
                }
                wrap.map(function() {
                    var elem = this;
                    while (elem.firstElementChild) {
                        elem = elem.firstElementChild
                    }
                    return elem
                }).append(this)
            }
            return this
        },
        wrapInner: function(html) {
            if (jQuery.isFunction(html)) {
                return this.each(function(i) {
                    jQuery(this).wrapInner(html.call(this, i))
                })
            }
            return this.each(function() {
                var self = jQuery(this),
                    contents = self.contents();
                if (contents.length) {
                    contents.wrapAll(html)
                } else {
                    self.append(html)
                }
            })
        },
        wrap: function(html) {
            var isFunction = jQuery.isFunction(html);
            return this.each(function(i) {
                jQuery(this).wrapAll(isFunction ? html.call(this, i) : html)
            })
        },
        unwrap: function() {
            return this.parent().each(function() {
                if (!jQuery.nodeName(this, "body")) {
                    jQuery(this).replaceWith(this.childNodes)
                }
            }).end()
        }
    });
    var curCSS, iframe, rdisplayswap = /^(none|table(?!-c[ea]).+)/,
        rmargin = /^margin/,
        rnumsplit = new RegExp("^(" + core_pnum + ")(.*)$", "i"),
        rnumnonpx = new RegExp("^(" + core_pnum + ")(?!px)[a-z%]+$", "i"),
        rrelNum = new RegExp("^([+-])=(" + core_pnum + ")", "i"),
        elemdisplay = {
            BODY: "block"
        },
        cssShow = {
            position: "absolute",
            visibility: "hidden",
            display: "block"
        },
        cssNormalTransform = {
            letterSpacing: 0,
            fontWeight: 400
        },
        cssExpand = ["Top", "Right", "Bottom", "Left"],
        cssPrefixes = ["Webkit", "O", "Moz", "ms"];

    function vendorPropName(style, name) {
        if (name in style) {
            return name
        }
        var capName = name.charAt(0).toUpperCase() + name.slice(1),
            origName = name,
            i = cssPrefixes.length;
        while (i--) {
            name = cssPrefixes[i] + capName;
            if (name in style) {
                return name
            }
        }
        return origName
    }

    function isHidden(elem, el) {
        elem = el || elem;
        return jQuery.css(elem, "display") === "none" || !jQuery.contains(elem.ownerDocument, elem)
    }

    function getStyles(elem) {
        return window.getComputedStyle(elem, null)
    }

    function showHide(elements, show) {
        var display, elem, hidden, values = [],
            index = 0,
            length = elements.length;
        for (; index < length; index++) {
            elem = elements[index];
            if (!elem.style) {
                continue
            }
            values[index] = data_priv.get(elem, "olddisplay");
            display = elem.style.display;
            if (show) {
                if (!values[index] && display === "none") {
                    elem.style.display = ""
                }
                if (elem.style.display === "" && isHidden(elem)) {
                    values[index] = data_priv.access(elem, "olddisplay", css_defaultDisplay(elem.nodeName))
                }
            } else {
                if (!values[index]) {
                    hidden = isHidden(elem);
                    if (display && display !== "none" || !hidden) {
                        data_priv.set(elem, "olddisplay", hidden ? display : jQuery.css(elem, "display"))
                    }
                }
            }
        }
        for (index = 0; index < length; index++) {
            elem = elements[index];
            if (!elem.style) {
                continue
            }
            if (!show || elem.style.display === "none" || elem.style.display === "") {
                elem.style.display = show ? values[index] || "" : "none"
            }
        }
        return elements
    }
    jQuery.fn.extend({
        css: function(name, value) {
            return jQuery.access(this, function(elem, name, value) {
                var styles, len, map = {},
                    i = 0;
                if (jQuery.isArray(name)) {
                    styles = getStyles(elem);
                    len = name.length;
                    for (; i < len; i++) {
                        map[name[i]] = jQuery.css(elem, name[i], false, styles)
                    }
                    return map
                }
                return value !== undefined ? jQuery.style(elem, name, value) : jQuery.css(elem, name)
            }, name, value, arguments.length > 1)
        },
        show: function() {
            return showHide(this, true)
        },
        hide: function() {
            return showHide(this)
        },
        toggle: function(state) {
            var bool = typeof state === "boolean";
            return this.each(function() {
                if (bool ? state : isHidden(this)) {
                    jQuery(this).show()
                } else {
                    jQuery(this).hide()
                }
            })
        }
    });
    jQuery.extend({
        cssHooks: {
            opacity: {
                get: function(elem, computed) {
                    if (computed) {
                        var ret = curCSS(elem, "opacity");
                        return ret === "" ? "1" : ret
                    }
                }
            }
        },
        cssNumber: {
            columnCount: true,
            fillOpacity: true,
            fontWeight: true,
            lineHeight: true,
            opacity: true,
            orphans: true,
            widows: true,
            zIndex: true,
            zoom: true
        },
        cssProps: {
            "float": "cssFloat"
        },
        style: function(elem, name, value, extra) {
            if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
                return
            }
            var ret, type, hooks, origName = jQuery.camelCase(name),
                style = elem.style;
            name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(style, origName));
            hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
            if (value !== undefined) {
                type = typeof value;
                if (type === "string" && (ret = rrelNum.exec(value))) {
                    value = (ret[1] + 1) * ret[2] + parseFloat(jQuery.css(elem, name));
                    type = "number"
                }
                if (value == null || type === "number" && isNaN(value)) {
                    return
                }
                if (type === "number" && !jQuery.cssNumber[origName]) {
                    value += "px"
                }
                if (!jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
                    style[name] = "inherit"
                }
                if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== undefined) {
                    style[name] = value
                }
            } else {
                if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== undefined) {
                    return ret
                }
                return style[name]
            }
        },
        css: function(elem, name, extra, styles) {
            var val, num, hooks, origName = jQuery.camelCase(name);
            name = jQuery.cssProps[origName] || (jQuery.cssProps[origName] = vendorPropName(elem.style, origName));
            hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
            if (hooks && "get" in hooks) {
                val = hooks.get(elem, true, extra)
            }
            if (val === undefined) {
                val = curCSS(elem, name, styles)
            }
            if (val === "normal" && name in cssNormalTransform) {
                val = cssNormalTransform[name]
            }
            if (extra === "" || extra) {
                num = parseFloat(val);
                return extra === true || jQuery.isNumeric(num) ? num || 0 : val
            }
            return val
        }
    });
    curCSS = function(elem, name, _computed) {
        var width, minWidth, maxWidth, computed = _computed || getStyles(elem),
            ret = computed ? computed.getPropertyValue(name) || computed[name] : undefined,
            style = elem.style;
        if (computed) {
            if (ret === "" && !jQuery.contains(elem.ownerDocument, elem)) {
                ret = jQuery.style(elem, name)
            }
            if (rnumnonpx.test(ret) && rmargin.test(name)) {
                width = style.width;
                minWidth = style.minWidth;
                maxWidth = style.maxWidth;
                style.minWidth = style.maxWidth = style.width = ret;
                ret = computed.width;
                style.width = width;
                style.minWidth = minWidth;
                style.maxWidth = maxWidth
            }
        }
        return ret
    };

    function setPositiveNumber(elem, value, subtract) {
        var matches = rnumsplit.exec(value);
        return matches ? Math.max(0, matches[1] - (subtract || 0)) + (matches[2] || "px") : value
    }

    function augmentWidthOrHeight(elem, name, extra, isBorderBox, styles) {
        var i = extra === (isBorderBox ? "border" : "content") ? 4 : name === "width" ? 1 : 0,
            val = 0;
        for (; i < 4; i += 2) {
            if (extra === "margin") {
                val += jQuery.css(elem, extra + cssExpand[i], true, styles)
            }
            if (isBorderBox) {
                if (extra === "content") {
                    val -= jQuery.css(elem, "padding" + cssExpand[i], true, styles)
                }
                if (extra !== "margin") {
                    val -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles)
                }
            } else {
                val += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
                if (extra !== "padding") {
                    val += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles)
                }
            }
        }
        return val
    }

    function getWidthOrHeight(elem, name, extra) {
        var valueIsBorderBox = true,
            val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
            styles = getStyles(elem),
            isBorderBox = jQuery.support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box";
        if (val <= 0 || val == null) {
            val = curCSS(elem, name, styles);
            if (val < 0 || val == null) {
                val = elem.style[name]
            }
            if (rnumnonpx.test(val)) {
                return val
            }
            valueIsBorderBox = isBorderBox && (jQuery.support.boxSizingReliable || val === elem.style[name]);
            val = parseFloat(val) || 0
        }
        return val + augmentWidthOrHeight(elem, name, extra || (isBorderBox ? "border" : "content"), valueIsBorderBox, styles) + "px"
    }

    function css_defaultDisplay(nodeName) {
        var doc = document,
            display = elemdisplay[nodeName];
        if (!display) {
            display = actualDisplay(nodeName, doc);
            if (display === "none" || !display) {
                iframe = (iframe || jQuery("<iframe frameborder='0' width='0' height='0'/>").css("cssText", "display:block !important")).appendTo(doc.documentElement);
                doc = (iframe[0].contentWindow || iframe[0].contentDocument).document;
                doc.write("<!doctype html><html><body>");
                doc.close();
                display = actualDisplay(nodeName, doc);
                iframe.detach()
            }
            elemdisplay[nodeName] = display
        }
        return display
    }

    function actualDisplay(name, doc) {
        var elem = jQuery(doc.createElement(name)).appendTo(doc.body),
            display = jQuery.css(elem[0], "display");
        elem.remove();
        return display
    }
    jQuery.each(["height", "width"], function(i, name) {
        jQuery.cssHooks[name] = {
            get: function(elem, computed, extra) {
                if (computed) {
                    return elem.offsetWidth === 0 && rdisplayswap.test(jQuery.css(elem, "display")) ? jQuery.swap(elem, cssShow, function() {
                        return getWidthOrHeight(elem, name, extra)
                    }) : getWidthOrHeight(elem, name, extra)
                }
            },
            set: function(elem, value, extra) {
                var styles = extra && getStyles(elem);
                return setPositiveNumber(elem, value, extra ? augmentWidthOrHeight(elem, name, extra, jQuery.support.boxSizing && jQuery.css(elem, "boxSizing", false, styles) === "border-box", styles) : 0)
            }
        }
    });
    jQuery(function() {
        if (!jQuery.support.reliableMarginRight) {
            jQuery.cssHooks.marginRight = {
                get: function(elem, computed) {
                    if (computed) {
                        return jQuery.swap(elem, {
                            display: "inline-block"
                        }, curCSS, [elem, "marginRight"])
                    }
                }
            }
        }
        if (!jQuery.support.pixelPosition && jQuery.fn.position) {
            jQuery.each(["top", "left"], function(i, prop) {
                jQuery.cssHooks[prop] = {
                    get: function(elem, computed) {
                        if (computed) {
                            computed = curCSS(elem, prop);
                            return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed
                        }
                    }
                }
            })
        }
    });
    if (jQuery.expr && jQuery.expr.filters) {
        jQuery.expr.filters.hidden = function(elem) {
            return elem.offsetWidth <= 0 && elem.offsetHeight <= 0
        };
        jQuery.expr.filters.visible = function(elem) {
            return !jQuery.expr.filters.hidden(elem)
        }
    }
    jQuery.each({
        margin: "",
        padding: "",
        border: "Width"
    }, function(prefix, suffix) {
        jQuery.cssHooks[prefix + suffix] = {
            expand: function(value) {
                var i = 0,
                    expanded = {},
                    parts = typeof value === "string" ? value.split(" ") : [value];
                for (; i < 4; i++) {
                    expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0]
                }
                return expanded
            }
        };
        if (!rmargin.test(prefix)) {
            jQuery.cssHooks[prefix + suffix].set = setPositiveNumber
        }
    });
    var r20 = /%20/g,
        rbracket = /\[\]$/,
        rCRLF = /\r?\n/g,
        rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
        rsubmittable = /^(?:input|select|textarea|keygen)/i;
    jQuery.fn.extend({
        serialize: function() {
            return jQuery.param(this.serializeArray())
        },
        serializeArray: function() {
            return this.map(function() {
                var elements = jQuery.prop(this, "elements");
                return elements ? jQuery.makeArray(elements) : this
            }).filter(function() {
                var type = this.type;
                return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !manipulation_rcheckableType.test(type))
            }).map(function(i, elem) {
                var val = jQuery(this).val();
                return val == null ? null : jQuery.isArray(val) ? jQuery.map(val, function(val) {
                    return {
                        name: elem.name,
                        value: val.replace(rCRLF, "\r\n")
                    }
                }) : {
                    name: elem.name,
                    value: val.replace(rCRLF, "\r\n")
                }
            }).get()
        }
    });
    jQuery.param = function(a, traditional) {
        var prefix, s = [],
            add = function(key, value) {
                value = jQuery.isFunction(value) ? value() : value == null ? "" : value;
                s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value)
            };
        if (traditional === undefined) {
            traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional
        }
        if (jQuery.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
            jQuery.each(a, function() {
                add(this.name, this.value)
            })
        } else {
            for (prefix in a) {
                buildParams(prefix, a[prefix], traditional, add)
            }
        }
        return s.join("&").replace(r20, "+")
    };

    function buildParams(prefix, obj, traditional, add) {
        var name;
        if (jQuery.isArray(obj)) {
            jQuery.each(obj, function(i, v) {
                if (traditional || rbracket.test(prefix)) {
                    add(prefix, v)
                } else {
                    buildParams(prefix + "[" + (typeof v === "object" ? i : "") + "]", v, traditional, add)
                }
            })
        } else if (!traditional && jQuery.type(obj) === "object") {
            for (name in obj) {
                buildParams(prefix + "[" + name + "]", obj[name], traditional, add)
            }
        } else {
            add(prefix, obj)
        }
    }
    jQuery.each(("blur focus focusin focusout load resize scroll unload click dblclick " + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + "change select submit keydown keypress keyup error contextmenu").split(" "), function(i, name) {
        jQuery.fn[name] = function(data, fn) {
            return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name)
        }
    });
    jQuery.fn.extend({
        hover: function(fnOver, fnOut) {
            return this.mouseenter(fnOver).mouseleave(fnOut || fnOver)
        },
        bind: function(types, data, fn) {
            return this.on(types, null, data, fn)
        },
        unbind: function(types, fn) {
            return this.off(types, null, fn)
        },
        delegate: function(selector, types, data, fn) {
            return this.on(types, selector, data, fn)
        },
        undelegate: function(selector, types, fn) {
            return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn)
        }
    });
    var ajaxLocParts, ajaxLocation, ajax_nonce = jQuery.now(),
        ajax_rquery = /\?/,
        rhash = /#.*$/,
        rts = /([?&])_=[^&]*/,
        rheaders = /^(.*?):[ \t]*([^\r\n]*)$/gm,
        rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
        rnoContent = /^(?:GET|HEAD)$/,
        rprotocol = /^\/\//,
        rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
        _load = jQuery.fn.load,
        prefilters = {},
        transports = {},
        allTypes = "*/".concat("*");
    try {
        ajaxLocation = location.href
    } catch (e) {
        ajaxLocation = document.createElement("a");
        ajaxLocation.href = "";
        ajaxLocation = ajaxLocation.href
    }
    ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];

    function addToPrefiltersOrTransports(structure) {
        return function(dataTypeExpression, func) {
            if (typeof dataTypeExpression !== "string") {
                func = dataTypeExpression;
                dataTypeExpression = "*"
            }
            var dataType, i = 0,
                dataTypes = dataTypeExpression.toLowerCase().match(core_rnotwhite) || [];
            if (jQuery.isFunction(func)) {
                while (dataType = dataTypes[i++]) {
                    if (dataType[0] === "+") {
                        dataType = dataType.slice(1) || "*";
                        (structure[dataType] = structure[dataType] || []).unshift(func)
                    } else {
                        (structure[dataType] = structure[dataType] || []).push(func)
                    }
                }
            }
        }
    }

    function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
        var inspected = {},
            seekingTransport = structure === transports;

        function inspect(dataType) {
            var selected;
            inspected[dataType] = true;
            jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
                var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
                if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
                    options.dataTypes.unshift(dataTypeOrTransport);
                    inspect(dataTypeOrTransport);
                    return false
                } else if (seekingTransport) {
                    return !(selected = dataTypeOrTransport)
                }
            });
            return selected
        }
        return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*")
    }

    function ajaxExtend(target, src) {
        var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
        for (key in src) {
            if (src[key] !== undefined) {
                (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key]
            }
        }
        if (deep) {
            jQuery.extend(true, target, deep)
        }
        return target
    }
    jQuery.fn.load = function(url, params, callback) {
        if (typeof url !== "string" && _load) {
            return _load.apply(this, arguments)
        }
        var selector, type, response, self = this,
            off = url.indexOf(" ");
        if (off >= 0) {
            selector = url.slice(off);
            url = url.slice(0, off)
        }
        if (jQuery.isFunction(params)) {
            callback = params;
            params = undefined
        } else if (params && typeof params === "object") {
            type = "POST"
        }
        if (self.length > 0) {
            jQuery.ajax({
                url: url,
                type: type,
                dataType: "html",
                data: params
            }).done(function(responseText) {
                response = arguments;
                self.html(selector ? jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector) : responseText)
            }).complete(callback && function(jqXHR, status) {
                self.each(callback, response || [jqXHR.responseText, status, jqXHR])
            })
        }
        return this
    };
    jQuery.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(i, type) {
        jQuery.fn[type] = function(fn) {
            return this.on(type, fn)
        }
    });
    jQuery.extend({
        active: 0,
        lastModified: {},
        etag: {},
        ajaxSettings: {
            url: ajaxLocation,
            type: "GET",
            isLocal: rlocalProtocol.test(ajaxLocParts[1]),
            global: true,
            processData: true,
            async: true,
            contentType: "application/x-www-form-urlencoded; charset=UTF-8",
            accepts: {
                "*": allTypes,
                text: "text/plain",
                html: "text/html",
                xml: "application/xml, text/xml",
                json: "application/json, text/javascript"
            },
            contents: {
                xml: /xml/,
                html: /html/,
                json: /json/
            },
            responseFields: {
                xml: "responseXML",
                text: "responseText",
                json: "responseJSON"
            },
            converters: {
                "* text": String,
                "text html": true,
                "text json": jQuery.parseJSON,
                "text xml": jQuery.parseXML
            },
            flatOptions: {
                url: true,
                context: true
            }
        },
        ajaxSetup: function(target, settings) {
            return settings ? ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) : ajaxExtend(jQuery.ajaxSettings, target)
        },
        ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
        ajaxTransport: addToPrefiltersOrTransports(transports),
        ajax: function(url, options) {
            if (typeof url === "object") {
                options = url;
                url = undefined
            }
            options = options || {};
            var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, parts, fireGlobals, i, s = jQuery.ajaxSetup({}, options),
                callbackContext = s.context || s,
                globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event,
                deferred = jQuery.Deferred(),
                completeDeferred = jQuery.Callbacks("once memory"),
                statusCode = s.statusCode || {},
                requestHeaders = {},
                requestHeadersNames = {},
                state = 0,
                strAbort = "canceled",
                jqXHR = {
                    readyState: 0,
                    getResponseHeader: function(key) {
                        var match;
                        if (state === 2) {
                            if (!responseHeaders) {
                                responseHeaders = {};
                                while (match = rheaders.exec(responseHeadersString)) {
                                    responseHeaders[match[1].toLowerCase()] = match[2]
                                }
                            }
                            match = responseHeaders[key.toLowerCase()]
                        }
                        return match == null ? null : match
                    },
                    getAllResponseHeaders: function() {
                        return state === 2 ? responseHeadersString : null
                    },
                    setRequestHeader: function(name, value) {
                        var lname = name.toLowerCase();
                        if (!state) {
                            name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;
                            requestHeaders[name] = value
                        }
                        return this
                    },
                    overrideMimeType: function(type) {
                        if (!state) {
                            s.mimeType = type
                        }
                        return this
                    },
                    statusCode: function(map) {
                        var code;
                        if (map) {
                            if (state < 2) {
                                for (code in map) {
                                    statusCode[code] = [statusCode[code], map[code]]
                                }
                            } else {
                                jqXHR.always(map[jqXHR.status])
                            }
                        }
                        return this
                    },
                    abort: function(statusText) {
                        var finalText = statusText || strAbort;
                        if (transport) {
                            transport.abort(finalText)
                        }
                        done(0, finalText);
                        return this
                    }
                };
            deferred.promise(jqXHR).complete = completeDeferred.add;
            jqXHR.success = jqXHR.done;
            jqXHR.error = jqXHR.fail;
            s.url = ((url || s.url || ajaxLocation) + "").replace(rhash, "").replace(rprotocol, ajaxLocParts[1] + "//");
            s.type = options.method || options.type || s.method || s.type;
            s.dataTypes = jQuery.trim(s.dataType || "*").toLowerCase().match(core_rnotwhite) || [""];
            if (s.crossDomain == null) {
                parts = rurl.exec(s.url.toLowerCase());
                s.crossDomain = !!(parts && (parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] || (parts[3] || (parts[1] === "http:" ? "80" : "443")) !== (ajaxLocParts[3] || (ajaxLocParts[1] === "http:" ? "80" : "443"))))
            }
            if (s.data && s.processData && typeof s.data !== "string") {
                s.data = jQuery.param(s.data, s.traditional)
            }
            inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
            if (state === 2) {
                return jqXHR
            }
            fireGlobals = s.global;
            if (fireGlobals && jQuery.active++ === 0) {
                jQuery.event.trigger("ajaxStart")
            }
            s.type = s.type.toUpperCase();
            s.hasContent = !rnoContent.test(s.type);
            cacheURL = s.url;
            if (!s.hasContent) {
                if (s.data) {
                    cacheURL = s.url += (ajax_rquery.test(cacheURL) ? "&" : "?") + s.data;
                    delete s.data
                }
                if (s.cache === false) {
                    s.url = rts.test(cacheURL) ? cacheURL.replace(rts, "$1_=" + ajax_nonce++) : cacheURL + (ajax_rquery.test(cacheURL) ? "&" : "?") + "_=" + ajax_nonce++
                }
            }
            if (s.ifModified) {
                if (jQuery.lastModified[cacheURL]) {
                    jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL])
                }
                if (jQuery.etag[cacheURL]) {
                    jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL])
                }
            }
            if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
                jqXHR.setRequestHeader("Content-Type", s.contentType)
            }
            jqXHR.setRequestHeader("Accept", s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]);
            for (i in s.headers) {
                jqXHR.setRequestHeader(i, s.headers[i])
            }
            if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2)) {
                return jqXHR.abort()
            }
            strAbort = "abort";
            for (i in {
                    success: 1,
                    error: 1,
                    complete: 1
                }) {
                jqXHR[i](s[i])
            }
            transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
            if (!transport) {
                done(-1, "No Transport")
            } else {
                jqXHR.readyState = 1;
                if (fireGlobals) {
                    globalEventContext.trigger("ajaxSend", [jqXHR, s])
                }
                if (s.async && s.timeout > 0) {
                    timeoutTimer = setTimeout(function() {
                        jqXHR.abort("timeout")
                    }, s.timeout)
                }
                try {
                    state = 1;
                    transport.send(requestHeaders, done)
                } catch (e) {
                    if (state < 2) {
                        done(-1, e)
                    } else {
                        throw e
                    }
                }
            }

            function done(status, nativeStatusText, responses, headers) {
                var isSuccess, success, error, response, modified, statusText = nativeStatusText;
                if (state === 2) {
                    return
                }
                state = 2;
                if (timeoutTimer) {
                    clearTimeout(timeoutTimer)
                }
                transport = undefined;
                responseHeadersString = headers || "";
                jqXHR.readyState = status > 0 ? 4 : 0;
                isSuccess = status >= 200 && status < 300 || status === 304;
                if (responses) {
                    response = ajaxHandleResponses(s, jqXHR, responses)
                }
                response = ajaxConvert(s, response, jqXHR, isSuccess);
                if (isSuccess) {
                    if (s.ifModified) {
                        modified = jqXHR.getResponseHeader("Last-Modified");
                        if (modified) {
                            jQuery.lastModified[cacheURL] = modified
                        }
                        modified = jqXHR.getResponseHeader("etag");
                        if (modified) {
                            jQuery.etag[cacheURL] = modified
                        }
                    }
                    if (status === 204) {
                        statusText = "nocontent"
                    } else if (status === 304) {
                        statusText = "notmodified"
                    } else {
                        statusText = response.state;
                        success = response.data;
                        error = response.error;
                        isSuccess = !error
                    }
                } else {
                    error = statusText;
                    if (status || !statusText) {
                        statusText = "error";
                        if (status < 0) {
                            status = 0
                        }
                    }
                }
                jqXHR.status = status;
                jqXHR.statusText = (nativeStatusText || statusText) + "";
                if (isSuccess) {
                    deferred.resolveWith(callbackContext, [success, statusText, jqXHR])
                } else {
                    deferred.rejectWith(callbackContext, [jqXHR, statusText, error])
                }
                jqXHR.statusCode(statusCode);
                statusCode = undefined;
                if (fireGlobals) {
                    globalEventContext.trigger(isSuccess ? "ajaxSuccess" : "ajaxError", [jqXHR, s, isSuccess ? success : error])
                }
                completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
                if (fireGlobals) {
                    globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
                    if (!--jQuery.active) {
                        jQuery.event.trigger("ajaxStop")
                    }
                }
            }
            return jqXHR
        },
        getJSON: function(url, data, callback) {
            return jQuery.get(url, data, callback, "json")
        },
        getScript: function(url, callback) {
            return jQuery.get(url, undefined, callback, "script")
        }
    });
    jQuery.each(["get", "post"], function(i, method) {
        jQuery[method] = function(url, data, callback, type) {
            if (jQuery.isFunction(data)) {
                type = type || callback;
                callback = data;
                data = undefined
            }
            return jQuery.ajax({
                url: url,
                type: method,
                dataType: type,
                data: data,
                success: callback
            })
        }
    });

    function ajaxHandleResponses(s, jqXHR, responses) {
        var ct, type, finalDataType, firstDataType, contents = s.contents,
            dataTypes = s.dataTypes;
        while (dataTypes[0] === "*") {
            dataTypes.shift();
            if (ct === undefined) {
                ct = s.mimeType || jqXHR.getResponseHeader("Content-Type")
            }
        }
        if (ct) {
            for (type in contents) {
                if (contents[type] && contents[type].test(ct)) {
                    dataTypes.unshift(type);
                    break
                }
            }
        }
        if (dataTypes[0] in responses) {
            finalDataType = dataTypes[0]
        } else {
            for (type in responses) {
                if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
                    finalDataType = type;
                    break
                }
                if (!firstDataType) {
                    firstDataType = type
                }
            }
            finalDataType = finalDataType || firstDataType
        }
        if (finalDataType) {
            if (finalDataType !== dataTypes[0]) {
                dataTypes.unshift(finalDataType)
            }
            return responses[finalDataType]
        }
    }

    function ajaxConvert(s, response, jqXHR, isSuccess) {
        var conv2, current, conv, tmp, prev, converters = {},
            dataTypes = s.dataTypes.slice();
        if (dataTypes[1]) {
            for (conv in s.converters) {
                converters[conv.toLowerCase()] = s.converters[conv]
            }
        }
        current = dataTypes.shift();
        while (current) {
            if (s.responseFields[current]) {
                jqXHR[s.responseFields[current]] = response
            }
            if (!prev && isSuccess && s.dataFilter) {
                response = s.dataFilter(response, s.dataType)
            }
            prev = current;
            current = dataTypes.shift();
            if (current) {
                if (current === "*") {
                    current = prev
                } else if (prev !== "*" && prev !== current) {
                    conv = converters[prev + " " + current] || converters["* " + current];
                    if (!conv) {
                        for (conv2 in converters) {
                            tmp = conv2.split(" ");
                            if (tmp[1] === current) {
                                conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
                                if (conv) {
                                    if (conv === true) {
                                        conv = converters[conv2]
                                    } else if (converters[conv2] !== true) {
                                        current = tmp[0];
                                        dataTypes.unshift(tmp[1])
                                    }
                                    break
                                }
                            }
                        }
                    }
                    if (conv !== true) {
                        if (conv && s["throws"]) {
                            response = conv(response)
                        } else {
                            try {
                                response = conv(response)
                            } catch (e) {
                                return {
                                    state: "parsererror",
                                    error: conv ? e : "No conversion from " + prev + " to " + current
                                }
                            }
                        }
                    }
                }
            }
        }
        return {
            state: "success",
            data: response
        }
    }
    jQuery.ajaxSetup({
        accepts: {
            script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
        },
        contents: {
            script: /(?:java|ecma)script/
        },
        converters: {
            "text script": function(text) {
                jQuery.globalEval(text);
                return text
            }
        }
    });
    jQuery.ajaxPrefilter("script", function(s) {
        if (s.cache === undefined) {
            s.cache = false
        }
        if (s.crossDomain) {
            s.type = "GET"
        }
    });
    jQuery.ajaxTransport("script", function(s) {
        if (s.crossDomain) {
            var script, callback;
            return {
                send: function(_, complete) {
                    script = jQuery("<script>").prop({
                        async: true,
                        charset: s.scriptCharset,
                        src: s.url
                    }).on("load error", callback = function(evt) {
                        script.remove();
                        callback = null;
                        if (evt) {
                            complete(evt.type === "error" ? 404 : 200, evt.type)
                        }
                    });
                    document.head.appendChild(script[0])
                },
                abort: function() {
                    if (callback) {
                        callback()
                    }
                }
            }
        }
    });
    var oldCallbacks = [],
        rjsonp = /(=)\?(?=&|$)|\?\?/;
    jQuery.ajaxSetup({
        jsonp: "callback",
        jsonpCallback: function() {
            var callback = oldCallbacks.pop() || jQuery.expando + "_" + ajax_nonce++;
            this[callback] = true;
            return callback
        }
    });
    jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
        var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && !(s.contentType || "").indexOf("application/x-www-form-urlencoded") && rjsonp.test(s.data) && "data");
        if (jsonProp || s.dataTypes[0] === "jsonp") {
            callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
            if (jsonProp) {
                s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName)
            } else if (s.jsonp !== false) {
                s.url += (ajax_rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName
            }
            s.converters["script json"] = function() {
                if (!responseContainer) {
                    jQuery.error(callbackName + " was not called")
                }
                return responseContainer[0]
            };
            s.dataTypes[0] = "json";
            overwritten = window[callbackName];
            window[callbackName] = function() {
                responseContainer = arguments
            };
            jqXHR.always(function() {
                window[callbackName] = overwritten;
                if (s[callbackName]) {
                    s.jsonpCallback = originalSettings.jsonpCallback;
                    oldCallbacks.push(callbackName)
                }
                if (responseContainer && jQuery.isFunction(overwritten)) {
                    overwritten(responseContainer[0])
                }
                responseContainer = overwritten = undefined
            });
            return "script"
        }
    });
    jQuery.ajaxSettings.xhr = function() {
        try {
            return new XMLHttpRequest
        } catch (e) {}
    };
    var xhrSupported = jQuery.ajaxSettings.xhr(),
        xhrSuccessStatus = {
            0: 200,
            1223: 204
        },
        xhrId = 0,
        xhrCallbacks = {};
    if (window.ActiveXObject) {
        jQuery(window).on("unload", function() {
            for (var key in xhrCallbacks) {
                xhrCallbacks[key]()
            }
            xhrCallbacks = undefined
        })
    }
    jQuery.support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
    jQuery.support.ajax = xhrSupported = !!xhrSupported;
    jQuery.ajaxTransport(function(options) {
        var callback;
        if (jQuery.support.cors || xhrSupported && !options.crossDomain) {
            return {
                send: function(headers, complete) {
                    var i, id, xhr = options.xhr();
                    xhr.open(options.type, options.url, options.async, options.username, options.password);
                    if (options.xhrFields) {
                        for (i in options.xhrFields) {
                            xhr[i] = options.xhrFields[i]
                        }
                    }
                    if (options.mimeType && xhr.overrideMimeType) {
                        xhr.overrideMimeType(options.mimeType)
                    }
                    if (!options.crossDomain && !headers["X-Requested-With"]) {
                        headers["X-Requested-With"] = "XMLHttpRequest"
                    }
                    for (i in headers) {
                        xhr.setRequestHeader(i, headers[i])
                    }
                    callback = function(type) {
                        return function() {
                            if (callback) {
                                delete xhrCallbacks[id];
                                callback = xhr.onload = xhr.onerror = null;
                                if (type === "abort") {
                                    xhr.abort()
                                } else if (type === "error") {
                                    complete(xhr.status || 404, xhr.statusText)
                                } else {
                                    complete(xhrSuccessStatus[xhr.status] || xhr.status, xhr.statusText, typeof xhr.responseText === "string" ? {
                                        text: xhr.responseText
                                    } : undefined, xhr.getAllResponseHeaders())
                                }
                            }
                        }
                    };
                    xhr.onload = callback();
                    xhr.onerror = callback("error");
                    callback = xhrCallbacks[id = xhrId++] = callback("abort");
                    xhr.send(options.hasContent && options.data || null)
                },
                abort: function() {
                    if (callback) {
                        callback()
                    }
                }
            }
        }
    });
    var fxNow, timerId, rfxtypes = /^(?:toggle|show|hide)$/,
        rfxnum = new RegExp("^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i"),
        rrun = /queueHooks$/,
        animationPrefilters = [defaultPrefilter],
        tweeners = {
            "*": [function(prop, value) {
                var end, unit, tween = this.createTween(prop, value),
                    parts = rfxnum.exec(value),
                    target = tween.cur(),
                    start = +target || 0,
                    scale = 1,
                    maxIterations = 20;
                if (parts) {
                    end = +parts[2];
                    unit = parts[3] || (jQuery.cssNumber[prop] ? "" : "px");
                    if (unit !== "px" && start) {
                        start = jQuery.css(tween.elem, prop, true) || end || 1;
                        do {
                            scale = scale || ".5";
                            start = start / scale;
                            jQuery.style(tween.elem, prop, start + unit)
                        } while (scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations)
                    }
                    tween.unit = unit;
                    tween.start = start;
                    tween.end = parts[1] ? start + (parts[1] + 1) * end : end
                }
                return tween
            }]
        };

    function createFxNow() {
        setTimeout(function() {
            fxNow = undefined
        });
        return fxNow = jQuery.now()
    }

    function createTweens(animation, props) {
        jQuery.each(props, function(prop, value) {
            var collection = (tweeners[prop] || []).concat(tweeners["*"]),
                index = 0,
                length = collection.length;
            for (; index < length; index++) {
                if (collection[index].call(animation, prop, value)) {
                    return
                }
            }
        })
    }

    function Animation(elem, properties, options) {
        var result, stopped, index = 0,
            length = animationPrefilters.length,
            deferred = jQuery.Deferred().always(function() {
                delete tick.elem
            }),
            tick = function() {
                if (stopped) {
                    return false
                }
                var currentTime = fxNow || createFxNow(),
                    remaining = Math.max(0, animation.startTime + animation.duration - currentTime),
                    temp = remaining / animation.duration || 0,
                    percent = 1 - temp,
                    index = 0,
                    length = animation.tweens.length;
                for (; index < length; index++) {
                    animation.tweens[index].run(percent)
                }
                deferred.notifyWith(elem, [animation, percent, remaining]);
                if (percent < 1 && length) {
                    return remaining
                } else {
                    deferred.resolveWith(elem, [animation]);
                    return false
                }
            },
            animation = deferred.promise({
                elem: elem,
                props: jQuery.extend({}, properties),
                opts: jQuery.extend(true, {
                    specialEasing: {}
                }, options),
                originalProperties: properties,
                originalOptions: options,
                startTime: fxNow || createFxNow(),
                duration: options.duration,
                tweens: [],
                createTween: function(prop, end) {
                    var tween = jQuery.Tween(elem, animation.opts, prop, end, animation.opts.specialEasing[prop] || animation.opts.easing);
                    animation.tweens.push(tween);
                    return tween
                },
                stop: function(gotoEnd) {
                    var index = 0,
                        length = gotoEnd ? animation.tweens.length : 0;
                    if (stopped) {
                        return this
                    }
                    stopped = true;
                    for (; index < length; index++) {
                        animation.tweens[index].run(1)
                    }
                    if (gotoEnd) {
                        deferred.resolveWith(elem, [animation, gotoEnd])
                    } else {
                        deferred.rejectWith(elem, [animation, gotoEnd])
                    }
                    return this
                }
            }),
            props = animation.props;
        propFilter(props, animation.opts.specialEasing);
        for (; index < length; index++) {
            result = animationPrefilters[index].call(animation, elem, props, animation.opts);
            if (result) {
                return result
            }
        }
        createTweens(animation, props);
        if (jQuery.isFunction(animation.opts.start)) {
            animation.opts.start.call(elem, animation)
        }
        jQuery.fx.timer(jQuery.extend(tick, {
            elem: elem,
            anim: animation,
            queue: animation.opts.queue
        }));
        return animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always)
    }

    function propFilter(props, specialEasing) {
        var index, name, easing, value, hooks;
        for (index in props) {
            name = jQuery.camelCase(index);
            easing = specialEasing[name];
            value = props[index];
            if (jQuery.isArray(value)) {
                easing = value[1];
                value = props[index] = value[0]
            }
            if (index !== name) {
                props[name] = value;
                delete props[index]
            }
            hooks = jQuery.cssHooks[name];
            if (hooks && "expand" in hooks) {
                value = hooks.expand(value);
                delete props[name];
                for (index in value) {
                    if (!(index in props)) {
                        props[index] = value[index];
                        specialEasing[index] = easing
                    }
                }
            } else {
                specialEasing[name] = easing
            }
        }
    }
    jQuery.Animation = jQuery.extend(Animation, {
        tweener: function(props, callback) {
            if (jQuery.isFunction(props)) {
                callback = props;
                props = ["*"]
            } else {
                props = props.split(" ")
            }
            var prop, index = 0,
                length = props.length;
            for (; index < length; index++) {
                prop = props[index];
                tweeners[prop] = tweeners[prop] || [];
                tweeners[prop].unshift(callback)
            }
        },
        prefilter: function(callback, prepend) {
            if (prepend) {
                animationPrefilters.unshift(callback)
            } else {
                animationPrefilters.push(callback)
            }
        }
    });

    function defaultPrefilter(elem, props, opts) {
        var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire, anim = this,
            style = elem.style,
            orig = {},
            handled = [],
            hidden = elem.nodeType && isHidden(elem);
        if (!opts.queue) {
            hooks = jQuery._queueHooks(elem, "fx");
            if (hooks.unqueued == null) {
                hooks.unqueued = 0;
                oldfire = hooks.empty.fire;
                hooks.empty.fire = function() {
                    if (!hooks.unqueued) {
                        oldfire()
                    }
                }
            }
            hooks.unqueued++;
            anim.always(function() {
                anim.always(function() {
                    hooks.unqueued--;
                    if (!jQuery.queue(elem, "fx").length) {
                        hooks.empty.fire()
                    }
                })
            })
        }
        if (elem.nodeType === 1 && ("height" in props || "width" in props)) {
            opts.overflow = [style.overflow, style.overflowX, style.overflowY];
            if (jQuery.css(elem, "display") === "inline" && jQuery.css(elem, "float") === "none") {
                style.display = "inline-block"
            }
        }
        if (opts.overflow) {
            style.overflow = "hidden";
            anim.always(function() {
                style.overflow = opts.overflow[0];
                style.overflowX = opts.overflow[1];
                style.overflowY = opts.overflow[2]
            })
        }
        dataShow = data_priv.get(elem, "fxshow");
        for (index in props) {
            value = props[index];
            if (rfxtypes.exec(value)) {
                delete props[index];
                toggle = toggle || value === "toggle";
                if (value === (hidden ? "hide" : "show")) {
                    if (value === "show" && dataShow !== undefined && dataShow[index] !== undefined) {
                        hidden = true
                    } else {
                        continue
                    }
                }
                handled.push(index)
            }
        }
        length = handled.length;
        if (length) {
            dataShow = data_priv.get(elem, "fxshow") || data_priv.access(elem, "fxshow", {});
            if ("hidden" in dataShow) {
                hidden = dataShow.hidden
            }
            if (toggle) {
                dataShow.hidden = !hidden
            }
            if (hidden) {
                jQuery(elem).show()
            } else {
                anim.done(function() {
                    jQuery(elem).hide()
                })
            }
            anim.done(function() {
                var prop;
                data_priv.remove(elem, "fxshow");
                for (prop in orig) {
                    jQuery.style(elem, prop, orig[prop])
                }
            });
            for (index = 0; index < length; index++) {
                prop = handled[index];
                tween = anim.createTween(prop, hidden ? dataShow[prop] : 0);
                orig[prop] = dataShow[prop] || jQuery.style(elem, prop);
                if (!(prop in dataShow)) {
                    dataShow[prop] = tween.start;
                    if (hidden) {
                        tween.end = tween.start;
                        tween.start = prop === "width" || prop === "height" ? 1 : 0
                    }
                }
            }
        }
    }

    function Tween(elem, options, prop, end, easing) {
        return new Tween.prototype.init(elem, options, prop, end, easing)
    }
    jQuery.Tween = Tween;
    Tween.prototype = {
        constructor: Tween,
        init: function(elem, options, prop, end, easing, unit) {
            this.elem = elem;
            this.prop = prop;
            this.easing = easing || "swing";
            this.options = options;
            this.start = this.now = this.cur();
            this.end = end;
            this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px")
        },
        cur: function() {
            var hooks = Tween.propHooks[this.prop];
            return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this)
        },
        run: function(percent) {
            var eased, hooks = Tween.propHooks[this.prop];
            if (this.options.duration) {
                this.pos = eased = jQuery.easing[this.easing](percent, this.options.duration * percent, 0, 1, this.options.duration)
            } else {
                this.pos = eased = percent
            }
            this.now = (this.end - this.start) * eased + this.start;
            if (this.options.step) {
                this.options.step.call(this.elem, this.now, this)
            }
            if (hooks && hooks.set) {
                hooks.set(this)
            } else {
                Tween.propHooks._default.set(this)
            }
            return this
        }
    };
    Tween.prototype.init.prototype = Tween.prototype;
    Tween.propHooks = {
        _default: {
            get: function(tween) {
                var result;
                if (tween.elem[tween.prop] != null && (!tween.elem.style || tween.elem.style[tween.prop] == null)) {
                    return tween.elem[tween.prop]
                }
                result = jQuery.css(tween.elem, tween.prop, "");
                return !result || result === "auto" ? 0 : result
            },
            set: function(tween) {
                if (jQuery.fx.step[tween.prop]) {
                    jQuery.fx.step[tween.prop](tween)
                } else if (tween.elem.style && (tween.elem.style[jQuery.cssProps[tween.prop]] != null || jQuery.cssHooks[tween.prop])) {
                    jQuery.style(tween.elem, tween.prop, tween.now + tween.unit)
                } else {
                    tween.elem[tween.prop] = tween.now
                }
            }
        }
    };
    Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
        set: function(tween) {
            if (tween.elem.nodeType && tween.elem.parentNode) {
                tween.elem[tween.prop] = tween.now
            }
        }
    };
    jQuery.each(["toggle", "show", "hide"], function(i, name) {
        var cssFn = jQuery.fn[name];
        jQuery.fn[name] = function(speed, easing, callback) {
            return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback)
        }
    });
    jQuery.fn.extend({
        fadeTo: function(speed, to, easing, callback) {
            return this.filter(isHidden).css("opacity", 0).show().end().animate({
                opacity: to
            }, speed, easing, callback)
        },
        animate: function(prop, speed, easing, callback) {
            var empty = jQuery.isEmptyObject(prop),
                optall = jQuery.speed(speed, easing, callback),
                doAnimation = function() {
                    var anim = Animation(this, jQuery.extend({}, prop), optall);
                    doAnimation.finish = function() {
                        anim.stop(true)
                    };
                    if (empty || data_priv.get(this, "finish")) {
                        anim.stop(true)
                    }
                };
            doAnimation.finish = doAnimation;
            return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation)
        },
        stop: function(type, clearQueue, gotoEnd) {
            var stopQueue = function(hooks) {
                var stop = hooks.stop;
                delete hooks.stop;
                stop(gotoEnd)
            };
            if (typeof type !== "string") {
                gotoEnd = clearQueue;
                clearQueue = type;
                type = undefined
            }
            if (clearQueue && type !== false) {
                this.queue(type || "fx", [])
            }
            return this.each(function() {
                var dequeue = true,
                    index = type != null && type + "queueHooks",
                    timers = jQuery.timers,
                    data = data_priv.get(this);
                if (index) {
                    if (data[index] && data[index].stop) {
                        stopQueue(data[index])
                    }
                } else {
                    for (index in data) {
                        if (data[index] && data[index].stop && rrun.test(index)) {
                            stopQueue(data[index])
                        }
                    }
                }
                for (index = timers.length; index--;) {
                    if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
                        timers[index].anim.stop(gotoEnd);
                        dequeue = false;
                        timers.splice(index, 1)
                    }
                }
                if (dequeue || !gotoEnd) {
                    jQuery.dequeue(this, type)
                }
            })
        },
        finish: function(type) {
            if (type !== false) {
                type = type || "fx"
            }
            return this.each(function() {
                var index, data = data_priv.get(this),
                    queue = data[type + "queue"],
                    hooks = data[type + "queueHooks"],
                    timers = jQuery.timers,
                    length = queue ? queue.length : 0;
                data.finish = true;
                jQuery.queue(this, type, []);
                if (hooks && hooks.cur && hooks.cur.finish) {
                    hooks.cur.finish.call(this)
                }
                for (index = timers.length; index--;) {
                    if (timers[index].elem === this && timers[index].queue === type) {
                        timers[index].anim.stop(true);
                        timers.splice(index, 1)
                    }
                }
                for (index = 0; index < length; index++) {
                    if (queue[index] && queue[index].finish) {
                        queue[index].finish.call(this)
                    }
                }
                delete data.finish
            })
        }
    });

    function genFx(type, includeWidth) {
        var which, attrs = {
                height: type
            },
            i = 0;
        includeWidth = includeWidth ? 1 : 0;
        for (; i < 4; i += 2 - includeWidth) {
            which = cssExpand[i];
            attrs["margin" + which] = attrs["padding" + which] = type
        }
        if (includeWidth) {
            attrs.opacity = attrs.width = type
        }
        return attrs
    }
    jQuery.each({
        slideDown: genFx("show"),
        slideUp: genFx("hide"),
        slideToggle: genFx("toggle"),
        fadeIn: {
            opacity: "show"
        },
        fadeOut: {
            opacity: "hide"
        },
        fadeToggle: {
            opacity: "toggle"
        }
    }, function(name, props) {
        jQuery.fn[name] = function(speed, easing, callback) {
            return this.animate(props, speed, easing, callback)
        }
    });
    jQuery.speed = function(speed, easing, fn) {
        var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
            complete: fn || !fn && easing || jQuery.isFunction(speed) && speed,
            duration: speed,
            easing: fn && easing || easing && !jQuery.isFunction(easing) && easing
        };
        opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
        if (opt.queue == null || opt.queue === true) {
            opt.queue = "fx"
        }
        opt.old = opt.complete;
        opt.complete = function() {
            if (jQuery.isFunction(opt.old)) {
                opt.old.call(this)
            }
            if (opt.queue) {
                jQuery.dequeue(this, opt.queue)
            }
        };
        return opt
    };
    jQuery.easing = {
        linear: function(p) {
            return p
        },
        swing: function(p) {
            return .5 - Math.cos(p * Math.PI) / 2
        }
    };
    jQuery.timers = [];
    jQuery.fx = Tween.prototype.init;
    jQuery.fx.tick = function() {
        var timer, timers = jQuery.timers,
            i = 0;
        fxNow = jQuery.now();
        for (; i < timers.length; i++) {
            timer = timers[i];
            if (!timer() && timers[i] === timer) {
                timers.splice(i--, 1)
            }
        }
        if (!timers.length) {
            jQuery.fx.stop()
        }
        fxNow = undefined
    };
    jQuery.fx.timer = function(timer) {
        if (timer() && jQuery.timers.push(timer)) {
            jQuery.fx.start()
        }
    };
    jQuery.fx.interval = 13;
    jQuery.fx.start = function() {
        if (!timerId) {
            timerId = setInterval(jQuery.fx.tick, jQuery.fx.interval)
        }
    };
    jQuery.fx.stop = function() {
        clearInterval(timerId);
        timerId = null
    };
    jQuery.fx.speeds = {
        slow: 600,
        fast: 200,
        _default: 400
    };
    jQuery.fx.step = {};
    if (jQuery.expr && jQuery.expr.filters) {
        jQuery.expr.filters.animated = function(elem) {
            return jQuery.grep(jQuery.timers, function(fn) {
                return elem === fn.elem
            }).length
        }
    }
    jQuery.fn.offset = function(options) {
        if (arguments.length) {
            return options === undefined ? this : this.each(function(i) {
                jQuery.offset.setOffset(this, options, i)
            })
        }
        var docElem, win, elem = this[0],
            box = {
                top: 0,
                left: 0
            },
            doc = elem && elem.ownerDocument;
        if (!doc) {
            return
        }
        docElem = doc.documentElement;
        if (!jQuery.contains(docElem, elem)) {
            return box
        }
        if (typeof elem.getBoundingClientRect !== core_strundefined) {
            box = elem.getBoundingClientRect()
        }
        win = getWindow(doc);
        return {
            top: box.top + win.pageYOffset - docElem.clientTop,
            left: box.left + win.pageXOffset - docElem.clientLeft
        }
    };
    jQuery.offset = {
        setOffset: function(elem, options, i) {
            var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"),
                curElem = jQuery(elem),
                props = {};
            if (position === "static") {
                elem.style.position = "relative"
            }
            curOffset = curElem.offset();
            curCSSTop = jQuery.css(elem, "top");
            curCSSLeft = jQuery.css(elem, "left");
            calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
            if (calculatePosition) {
                curPosition = curElem.position();
                curTop = curPosition.top;
                curLeft = curPosition.left
            } else {
                curTop = parseFloat(curCSSTop) || 0;
                curLeft = parseFloat(curCSSLeft) || 0
            }
            if (jQuery.isFunction(options)) {
                options = options.call(elem, i, curOffset)
            }
            if (options.top != null) {
                props.top = options.top - curOffset.top + curTop
            }
            if (options.left != null) {
                props.left = options.left - curOffset.left + curLeft
            }
            if ("using" in options) {
                options.using.call(elem, props)
            } else {
                curElem.css(props)
            }
        }
    };
    jQuery.fn.extend({
        position: function() {
            if (!this[0]) {
                return
            }
            var offsetParent, offset, elem = this[0],
                parentOffset = {
                    top: 0,
                    left: 0
                };
            if (jQuery.css(elem, "position") === "fixed") {
                offset = elem.getBoundingClientRect()
            } else {
                offsetParent = this.offsetParent();
                offset = this.offset();
                if (!jQuery.nodeName(offsetParent[0], "html")) {
                    parentOffset = offsetParent.offset()
                }
                parentOffset.top += jQuery.css(offsetParent[0], "borderTopWidth", true);
                parentOffset.left += jQuery.css(offsetParent[0], "borderLeftWidth", true)
            }
            return {
                top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
                left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
            }
        },
        offsetParent: function() {
            return this.map(function() {
                var offsetParent = this.offsetParent || docElem;
                while (offsetParent && (!jQuery.nodeName(offsetParent, "html") && jQuery.css(offsetParent, "position") === "static")) {
                    offsetParent = offsetParent.offsetParent
                }
                return offsetParent || docElem
            })
        }
    });
    jQuery.each({
        scrollLeft: "pageXOffset",
        scrollTop: "pageYOffset"
    }, function(method, prop) {
        var top = "pageYOffset" === prop;
        jQuery.fn[method] = function(val) {
            return jQuery.access(this, function(elem, method, val) {
                var win = getWindow(elem);
                if (val === undefined) {
                    return win ? win[prop] : elem[method]
                }
                if (win) {
                    win.scrollTo(!top ? val : window.pageXOffset, top ? val : window.pageYOffset)
                } else {
                    elem[method] = val
                }
            }, method, val, arguments.length, null)
        }
    });

    function getWindow(elem) {
        return jQuery.isWindow(elem) ? elem : elem.nodeType === 9 && elem.defaultView
    }
    jQuery.each({
        Height: "height",
        Width: "width"
    }, function(name, type) {
        jQuery.each({
            padding: "inner" + name,
            content: type,
            "": "outer" + name
        }, function(defaultExtra, funcName) {
            jQuery.fn[funcName] = function(margin, value) {
                var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"),
                    extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
                return jQuery.access(this, function(elem, type, value) {
                    var doc;
                    if (jQuery.isWindow(elem)) {
                        return elem.document.documentElement["client" + name]
                    }
                    if (elem.nodeType === 9) {
                        doc = elem.documentElement;
                        return Math.max(elem.body["scroll" + name], doc["scroll" + name], elem.body["offset" + name], doc["offset" + name], doc["client" + name])
                    }
                    return value === undefined ? jQuery.css(elem, type, extra) : jQuery.style(elem, type, value, extra)
                }, type, chainable ? margin : undefined, chainable, null)
            }
        })
    });
    jQuery.fn.size = function() {
        return this.length
    };
    jQuery.fn.andSelf = jQuery.fn.addBack;
    if (typeof module === "object" && typeof module.exports === "object") {
        module.exports = jQuery
    } else {
        if (typeof define === "function" && define.amd) {
            define("jquery", [], function() {
                return jQuery
            })
        }
    }
    if (typeof window === "object" && typeof window.document === "object") {
        window.jQuery = window.$ = jQuery
    }
})(window); + function($) {
    "use strict";

    function transitionEnd() {
        var el = document.createElement("bootstrap");
        var transEndEventNames = {
            WebkitTransition: "webkitTransitionEnd",
            MozTransition: "transitionend",
            OTransition: "oTransitionEnd otransitionend",
            transition: "transitionend"
        };
        for (var name in transEndEventNames) {
            if (el.style[name] !== undefined) {
                return {
                    end: transEndEventNames[name]
                }
            }
        }
        return false
    }
    $.fn.emulateTransitionEnd = function(duration) {
        var called = false;
        var $el = this;
        $(this).one("bsTransitionEnd", function() {
            called = true
        });
        var callback = function() {
            if (!called) $($el).trigger($.support.transition.end)
        };
        setTimeout(callback, duration);
        return this
    };
    $(function() {
        $.support.transition = transitionEnd();
        if (!$.support.transition) return;
        $.event.special.bsTransitionEnd = {
            bindType: $.support.transition.end,
            delegateType: $.support.transition.end,
            handle: function(e) {
                if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments)
            }
        }
    })
}(jQuery); + function($) {
    "use strict";
    var Collapse = function(element, options) {
        this.$element = $(element);
        this.options = $.extend({}, Collapse.DEFAULTS, options);
        this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + '[data-toggle="collapse"][data-target="#' + element.id + '"]');
        this.transitioning = null;
        if (this.options.parent) {
            this.$parent = this.getParent()
        } else {
            this.addAriaAndCollapsedClass(this.$element, this.$trigger)
        }
        if (this.options.toggle) this.toggle()
    };
    Collapse.VERSION = "3.3.6";
    Collapse.TRANSITION_DURATION = 350;
    Collapse.DEFAULTS = {
        toggle: true
    };
    Collapse.prototype.dimension = function() {
        var hasWidth = this.$element.hasClass("width");
        return hasWidth ? "width" : "height"
    };
    Collapse.prototype.show = function() {
        if (this.transitioning || this.$element.hasClass("in")) return;
        var activesData;
        var actives = this.$parent && this.$parent.children(".panel").children(".in, .collapsing");
        if (actives && actives.length) {
            activesData = actives.data("bs.collapse");
            if (activesData && activesData.transitioning) return
        }
        var startEvent = $.Event("show.bs.collapse");
        this.$element.trigger(startEvent);
        if (startEvent.isDefaultPrevented()) return;
        if (actives && actives.length) {
            Plugin.call(actives, "hide");
            activesData || actives.data("bs.collapse", null)
        }
        var dimension = this.dimension();
        this.$element.removeClass("collapse").addClass("collapsing")[dimension](0).attr("aria-expanded", true);
        this.$trigger.removeClass("collapsed").attr("aria-expanded", true);
        this.transitioning = 1;
        var complete = function() {
            this.$element.removeClass("collapsing").addClass("collapse in")[dimension]("");
            this.transitioning = 0;
            this.$element.trigger("shown.bs.collapse")
        };
        if (!$.support.transition) return complete.call(this);
        var scrollSize = $.camelCase(["scroll", dimension].join("-"));
        this.$element.one("bsTransitionEnd", $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize])
    };
    Collapse.prototype.hide = function() {
        if (this.transitioning || !this.$element.hasClass("in")) return;
        var startEvent = $.Event("hide.bs.collapse");
        this.$element.trigger(startEvent);
        if (startEvent.isDefaultPrevented()) return;
        var dimension = this.dimension();
        this.$element[dimension](this.$element[dimension]())[0].offsetHeight;
        this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", false);
        this.$trigger.addClass("collapsed").attr("aria-expanded", false);
        this.transitioning = 1;
        var complete = function() {
            this.transitioning = 0;
            this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")
        };
        if (!$.support.transition) return complete.call(this);
        this.$element[dimension](0).one("bsTransitionEnd", $.proxy(complete, this)).emulateTransitionEnd(Collapse.TRANSITION_DURATION)
    };
    Collapse.prototype.toggle = function() {
        this[this.$element.hasClass("in") ? "hide" : "show"]()
    };
    Collapse.prototype.getParent = function() {
        return $(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each($.proxy(function(i, element) {
            var $element = $(element);
            this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element)
        }, this)).end()
    };
    Collapse.prototype.addAriaAndCollapsedClass = function($element, $trigger) {
        var isOpen = $element.hasClass("in");
        $element.attr("aria-expanded", isOpen);
        $trigger.toggleClass("collapsed", !isOpen).attr("aria-expanded", isOpen)
    };

    function getTargetFromTrigger($trigger) {
        var href;
        var target = $trigger.attr("data-target") || (href = $trigger.attr("href")) && href.replace(/.*(?=#[^\s]+$)/, "");
        return $(target)
    }

    function Plugin(option) {
        return this.each(function() {
            var $this = $(this);
            var data = $this.data("bs.collapse");
            var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == "object" && option);
            if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false;
            if (!data) $this.data("bs.collapse", data = new Collapse(this, options));
            if (typeof option == "string") data[option]()
        })
    }
    var old = $.fn.collapse;
    $.fn.collapse = Plugin;
    $.fn.collapse.Constructor = Collapse;
    $.fn.collapse.noConflict = function() {
        $.fn.collapse = old;
        return this
    };
    $(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(e) {
        var $this = $(this);
        if (!$this.attr("data-target")) e.preventDefault();
        var $target = getTargetFromTrigger($this);
        var data = $target.data("bs.collapse");
        var option = data ? "toggle" : $this.data();
        Plugin.call($target, option)
    })
}(jQuery); + function($) {
    "use strict";
    var backdrop = ".dropdown-backdrop";
    var toggle = '[data-toggle="dropdown"]';
    var Dropdown = function(element) {
        $(element).on("click.bs.dropdown", this.toggle)
    };
    Dropdown.VERSION = "3.3.6";

    function getParent($this) {
        var selector = $this.attr("data-target");
        if (!selector) {
            selector = $this.attr("href");
            selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, "")
        }
        var $parent = selector && $(selector);
        return $parent && $parent.length ? $parent : $this.parent()
    }

    function clearMenus(e) {
        if (e && e.which === 3) return;
        $(backdrop).remove();
        $(toggle).each(function() {
            var $this = $(this);
            var $parent = getParent($this);
            var relatedTarget = {
                relatedTarget: this
            };
            if (!$parent.hasClass("open")) return;
            if (e && e.type == "click" && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return;
            $parent.trigger(e = $.Event("hide.bs.dropdown", relatedTarget));
            if (e.isDefaultPrevented()) return;
            $this.attr("aria-expanded", "false");
            $parent.removeClass("open").trigger($.Event("hidden.bs.dropdown", relatedTarget))
        })
    }
    Dropdown.prototype.toggle = function(e) {
        var $this = $(this);
        if ($this.is(".disabled, :disabled")) return;
        var $parent = getParent($this);
        var isActive = $parent.hasClass("open");
        clearMenus();
        if (!isActive) {
            if ("ontouchstart" in document.documentElement && !$parent.closest(".navbar-nav").length) {
                $(document.createElement("div")).addClass("dropdown-backdrop").insertAfter($(this)).on("click", clearMenus)
            }
            var relatedTarget = {
                relatedTarget: this
            };
            $parent.trigger(e = $.Event("show.bs.dropdown", relatedTarget));
            if (e.isDefaultPrevented()) return;
            $this.trigger("focus").attr("aria-expanded", "true");
            $parent.toggleClass("open").trigger($.Event("shown.bs.dropdown", relatedTarget))
        }
        return false
    };
    Dropdown.prototype.keydown = function(e) {
        if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return;
        var $this = $(this);
        e.preventDefault();
        e.stopPropagation();
        if ($this.is(".disabled, :disabled")) return;
        var $parent = getParent($this);
        var isActive = $parent.hasClass("open");
        if (!isActive && e.which != 27 || isActive && e.which == 27) {
            if (e.which == 27) $parent.find(toggle).trigger("focus");
            return $this.trigger("click")
        }
        var desc = " li:not(.disabled):visible a";
        var $items = $parent.find(".dropdown-menu" + desc);
        if (!$items.length) return;
        var index = $items.index(e.target);
        if (e.which == 38 && index > 0) index--;
        if (e.which == 40 && index < $items.length - 1) index++;
        if (!~index) index = 0;
        $items.eq(index).trigger("focus")
    };

    function Plugin(option) {
        return this.each(function() {
            var $this = $(this);
            var data = $this.data("bs.dropdown");
            if (!data) $this.data("bs.dropdown", data = new Dropdown(this));
            if (typeof option == "string") data[option].call($this)
        })
    }
    var old = $.fn.dropdown;
    $.fn.dropdown = Plugin;
    $.fn.dropdown.Constructor = Dropdown;
    $.fn.dropdown.noConflict = function() {
        $.fn.dropdown = old;
        return this
    };
    $(document).on("click.bs.dropdown.data-api", clearMenus).on("click.bs.dropdown.data-api", ".dropdown form", function(e) {
        e.stopPropagation()
    }).on("click.bs.dropdown.data-api", toggle, Dropdown.prototype.toggle).on("keydown.bs.dropdown.data-api", toggle, Dropdown.prototype.keydown).on("keydown.bs.dropdown.data-api", ".dropdown-menu", Dropdown.prototype.keydown)
}(jQuery);
define("bootstraptour", ["jquery", "exports", "module"], function(jQuery, exports, module) {
    window.jQuery = jQuery; + function($) {
        "use strict";
        var Tooltip = function(element, options) {
            this.type = null;
            this.options = null;
            this.enabled = null;
            this.timeout = null;
            this.hoverState = null;
            this.$element = null;
            this.inState = null;
            this.init("tooltip", element, options)
        };
        Tooltip.VERSION = "3.3.6";
        Tooltip.TRANSITION_DURATION = 150;
        Tooltip.DEFAULTS = {
            animation: true,
            placement: "top",
            selector: false,
            template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
            trigger: "hover focus",
            title: "",
            delay: 0,
            html: false,
            container: false,
            viewport: {
                selector: "body",
                padding: 0
            }
        };
        Tooltip.prototype.init = function(type, element, options) {
            this.enabled = true;
            this.type = type;
            this.$element = $(element);
            this.options = this.getOptions(options);
            this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport);
            this.inState = {
                click: false,
                hover: false,
                focus: false
            };
            if (this.$element[0] instanceof document.constructor && !this.options.selector) {
                throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!")
            }
            var triggers = this.options.trigger.split(" ");
            for (var i = triggers.length; i--;) {
                var trigger = triggers[i];
                if (trigger == "click") {
                    this.$element.on("click." + this.type, this.options.selector, $.proxy(this.toggle, this))
                } else if (trigger != "manual") {
                    var eventIn = trigger == "hover" ? "mouseenter" : "focusin";
                    var eventOut = trigger == "hover" ? "mouseleave" : "focusout";
                    this.$element.on(eventIn + "." + this.type, this.options.selector, $.proxy(this.enter, this));
                    this.$element.on(eventOut + "." + this.type, this.options.selector, $.proxy(this.leave, this))
                }
            }
            this.options.selector ? this._options = $.extend({}, this.options, {
                trigger: "manual",
                selector: ""
            }) : this.fixTitle()
        };
        Tooltip.prototype.getDefaults = function() {
            return Tooltip.DEFAULTS
        };
        Tooltip.prototype.getOptions = function(options) {
            options = $.extend({}, this.getDefaults(), this.$element.data(), options);
            if (options.delay && typeof options.delay == "number") {
                options.delay = {
                    show: options.delay,
                    hide: options.delay
                }
            }
            return options
        };
        Tooltip.prototype.getDelegateOptions = function() {
            var options = {};
            var defaults = this.getDefaults();
            this._options && $.each(this._options, function(key, value) {
                if (defaults[key] != value) options[key] = value
            });
            return options
        };
        Tooltip.prototype.enter = function(obj) {
            var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data("bs." + this.type);
            if (!self) {
                self = new this.constructor(obj.currentTarget, this.getDelegateOptions());
                $(obj.currentTarget).data("bs." + this.type, self)
            }
            if (obj instanceof $.Event) {
                self.inState[obj.type == "focusin" ? "focus" : "hover"] = true
            }
            if (self.tip().hasClass("in") || self.hoverState == "in") {
                self.hoverState = "in";
                return
            }
            clearTimeout(self.timeout);
            self.hoverState = "in";
            if (!self.options.delay || !self.options.delay.show) return self.show();
            self.timeout = setTimeout(function() {
                if (self.hoverState == "in") self.show()
            }, self.options.delay.show)
        };
        Tooltip.prototype.isInStateTrue = function() {
            for (var key in this.inState) {
                if (this.inState[key]) return true
            }
            return false
        };
        Tooltip.prototype.leave = function(obj) {
            var self = obj instanceof this.constructor ? obj : $(obj.currentTarget).data("bs." + this.type);
            if (!self) {
                self = new this.constructor(obj.currentTarget, this.getDelegateOptions());
                $(obj.currentTarget).data("bs." + this.type, self)
            }
            if (obj instanceof $.Event) {
                self.inState[obj.type == "focusout" ? "focus" : "hover"] = false
            }
            if (self.isInStateTrue()) return;
            clearTimeout(self.timeout);
            self.hoverState = "out";
            if (!self.options.delay || !self.options.delay.hide) return self.hide();
            self.timeout = setTimeout(function() {
                if (self.hoverState == "out") self.hide()
            }, self.options.delay.hide)
        };
        Tooltip.prototype.show = function() {
            var e = $.Event("show.bs." + this.type);
            if (this.hasContent() && this.enabled) {
                this.$element.trigger(e);
                var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]);
                if (e.isDefaultPrevented() || !inDom) return;
                var that = this;
                var $tip = this.tip();
                var tipId = this.getUID(this.type);
                this.setContent();
                $tip.attr("id", tipId);
                this.$element.attr("aria-describedby", tipId);
                if (this.options.animation) $tip.addClass("fade");
                var placement = typeof this.options.placement == "function" ? this.options.placement.call(this, $tip[0], this.$element[0]) : this.options.placement;
                var autoToken = /\s?auto?\s?/i;
                var autoPlace = autoToken.test(placement);
                if (autoPlace) placement = placement.replace(autoToken, "") || "top";
                $tip.detach().css({
                    top: 0,
                    left: 0,
                    display: "block"
                }).addClass(placement).data("bs." + this.type, this);
                this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element);
                this.$element.trigger("inserted.bs." + this.type);
                var pos = this.getPosition();
                var actualWidth = $tip[0].offsetWidth;
                var actualHeight = $tip[0].offsetHeight;
                if (autoPlace) {
                    var orgPlacement = placement;
                    var viewportDim = this.getPosition(this.$viewport);
                    placement = placement == "bottom" && pos.bottom + actualHeight > viewportDim.bottom ? "top" : placement == "top" && pos.top - actualHeight < viewportDim.top ? "bottom" : placement == "right" && pos.right + actualWidth > viewportDim.width ? "left" : placement == "left" && pos.left - actualWidth < viewportDim.left ? "right" : placement;
                    $tip.removeClass(orgPlacement).addClass(placement)
                }
                var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight);
                this.applyPlacement(calculatedOffset, placement);
                var complete = function() {
                    var prevHoverState = that.hoverState;
                    that.$element.trigger("shown.bs." + that.type);
                    that.hoverState = null;
                    if (prevHoverState == "out") that.leave(that)
                };
                $.support.transition && this.$tip.hasClass("fade") ? $tip.one("bsTransitionEnd", complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete()
            }
        };
        Tooltip.prototype.applyPlacement = function(offset, placement) {
            var $tip = this.tip();
            var width = $tip[0].offsetWidth;
            var height = $tip[0].offsetHeight;
            var marginTop = parseInt($tip.css("margin-top"), 10);
            var marginLeft = parseInt($tip.css("margin-left"), 10);
            if (isNaN(marginTop)) marginTop = 0;
            if (isNaN(marginLeft)) marginLeft = 0;
            offset.top += marginTop;
            offset.left += marginLeft;
            $.offset.setOffset($tip[0], $.extend({
                using: function(props) {
                    $tip.css({
                        top: Math.round(props.top),
                        left: Math.round(props.left)
                    })
                }
            }, offset), 0);
            $tip.addClass("in");
            var actualWidth = $tip[0].offsetWidth;
            var actualHeight = $tip[0].offsetHeight;
            if (placement == "top" && actualHeight != height) {
                offset.top = offset.top + height - actualHeight
            }
            var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight);
            if (delta.left) offset.left += delta.left;
            else offset.top += delta.top;
            var isVertical = /top|bottom/.test(placement);
            var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight;
            var arrowOffsetPosition = isVertical ? "offsetWidth" : "offsetHeight";
            $tip.offset(offset);
            this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical)
        };
        Tooltip.prototype.replaceArrow = function(delta, dimension, isVertical) {
            this.arrow().css(isVertical ? "left" : "top", 50 * (1 - delta / dimension) + "%").css(isVertical ? "top" : "left", "")
        };
        Tooltip.prototype.setContent = function() {
            var $tip = this.tip();
            var title = this.getTitle();
            $tip.find(".tooltip-inner")[this.options.html ? "html" : "text"](title);
            $tip.removeClass("fade in top bottom left right")
        };
        Tooltip.prototype.hide = function(callback) {
            var that = this;
            var $tip = $(this.$tip);
            var e = $.Event("hide.bs." + this.type);

            function complete() {
                if (that.hoverState != "in") $tip.detach();
                that.$element.removeAttr("aria-describedby").trigger("hidden.bs." + that.type);
                callback && callback()
            }
            this.$element.trigger(e);
            if (e.isDefaultPrevented()) return;
            $tip.removeClass("in");
            $.support.transition && $tip.hasClass("fade") ? $tip.one("bsTransitionEnd", complete).emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : complete();
            this.hoverState = null;
            return this
        };
        Tooltip.prototype.fixTitle = function() {
            var $e = this.$element;
            if ($e.attr("title") || typeof $e.attr("data-original-title") != "string") {
                $e.attr("data-original-title", $e.attr("title") || "").attr("title", "")
            }
        };
        Tooltip.prototype.hasContent = function() {
            return this.getTitle()
        };
        Tooltip.prototype.getPosition = function($element) {
            $element = $element || this.$element;
            var el = $element[0];
            var isBody = el.tagName == "BODY";
            var elRect = el.getBoundingClientRect();
            if (elRect.width == null) {
                elRect = $.extend({}, elRect, {
                    width: elRect.right - elRect.left,
                    height: elRect.bottom - elRect.top
                })
            }
            var elOffset = isBody ? {
                top: 0,
                left: 0
            } : $element.offset();
            var scroll = {
                scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop()
            };
            var outerDims = isBody ? {
                width: $(window).width(),
                height: $(window).height()
            } : null;
            return $.extend({}, elRect, scroll, outerDims, elOffset)
        };
        Tooltip.prototype.getCalculatedOffset = function(placement, pos, actualWidth, actualHeight) {
            return placement == "bottom" ? {
                top: pos.top + pos.height,
                left: pos.left + pos.width / 2 - actualWidth / 2
            } : placement == "top" ? {
                top: pos.top - actualHeight,
                left: pos.left + pos.width / 2 - actualWidth / 2
            } : placement == "left" ? {
                top: pos.top + pos.height / 2 - actualHeight / 2,
                left: pos.left - actualWidth
            } : {
                top: pos.top + pos.height / 2 - actualHeight / 2,
                left: pos.left + pos.width
            }
        };
        Tooltip.prototype.getViewportAdjustedDelta = function(placement, pos, actualWidth, actualHeight) {
            var delta = {
                top: 0,
                left: 0
            };
            if (!this.$viewport) return delta;
            var viewportPadding = this.options.viewport && this.options.viewport.padding || 0;
            var viewportDimensions = this.getPosition(this.$viewport);
            if (/right|left/.test(placement)) {
                var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll;
                var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight;
                if (topEdgeOffset < viewportDimensions.top) {
                    delta.top = viewportDimensions.top - topEdgeOffset
                } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) {
                    delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset
                }
            } else {
                var leftEdgeOffset = pos.left - viewportPadding;
                var rightEdgeOffset = pos.left + viewportPadding + actualWidth;
                if (leftEdgeOffset < viewportDimensions.left) {
                    delta.left = viewportDimensions.left - leftEdgeOffset
                } else if (rightEdgeOffset > viewportDimensions.right) {
                    delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset
                }
            }
            return delta
        };
        Tooltip.prototype.getTitle = function() {
            var title;
            var $e = this.$element;
            var o = this.options;
            title = $e.attr("data-original-title") || (typeof o.title == "function" ? o.title.call($e[0]) : o.title);
            return title
        };
        Tooltip.prototype.getUID = function(prefix) {
            do prefix += ~~(Math.random() * 1e6); while (document.getElementById(prefix));
            return prefix
        };
        Tooltip.prototype.tip = function() {
            if (!this.$tip) {
                this.$tip = $(this.options.template);
                if (this.$tip.length != 1) {
                    throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!")
                }
            }
            return this.$tip
        };
        Tooltip.prototype.arrow = function() {
            return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
        };
        Tooltip.prototype.enable = function() {
            this.enabled = true
        };
        Tooltip.prototype.disable = function() {
            this.enabled = false
        };
        Tooltip.prototype.toggleEnabled = function() {
            this.enabled = !this.enabled
        };
        Tooltip.prototype.toggle = function(e) {
            var self = this;
            if (e) {
                self = $(e.currentTarget).data("bs." + this.type);
                if (!self) {
                    self = new this.constructor(e.currentTarget, this.getDelegateOptions());
                    $(e.currentTarget).data("bs." + this.type, self)
                }
            }
            if (e) {
                self.inState.click = !self.inState.click;
                if (self.isInStateTrue()) self.enter(self);
                else self.leave(self)
            } else {
                self.tip().hasClass("in") ? self.leave(self) : self.enter(self)
            }
        };
        Tooltip.prototype.destroy = function() {
            var that = this;
            clearTimeout(this.timeout);
            this.hide(function() {
                that.$element.off("." + that.type).removeData("bs." + that.type);
                if (that.$tip) {
                    that.$tip.detach()
                }
                that.$tip = null;
                that.$arrow = null;
                that.$viewport = null
            })
        };

        function Plugin(option) {
            return this.each(function() {
                var $this = $(this);
                var data = $this.data("bs.tooltip");
                var options = typeof option == "object" && option;
                if (!data && /destroy|hide/.test(option)) return;
                if (!data) $this.data("bs.tooltip", data = new Tooltip(this, options));
                if (typeof option == "string") data[option]()
            })
        }
        var old = $.fn.tooltip;
        $.fn.tooltip = Plugin;
        $.fn.tooltip.Constructor = Tooltip;
        $.fn.tooltip.noConflict = function() {
            $.fn.tooltip = old;
            return this
        }
    }(jQuery); + function($) {
        "use strict";
        var Popover = function(element, options) {
            this.init("popover", element, options)
        };
        if (!$.fn.tooltip) throw new Error("Popover requires tooltip.js");
        Popover.VERSION = "3.3.6";
        Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
            placement: "right",
            trigger: "click",
            content: "",
            template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
        });
        Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype);
        Popover.prototype.constructor = Popover;
        Popover.prototype.getDefaults = function() {
            return Popover.DEFAULTS
        };
        Popover.prototype.setContent = function() {
            var $tip = this.tip();
            var title = this.getTitle();
            var content = this.getContent();
            $tip.find(".popover-title")[this.options.html ? "html" : "text"](title);
            $tip.find(".popover-content").children().detach().end()[this.options.html ? typeof content == "string" ? "html" : "append" : "text"](content);
            $tip.removeClass("fade top bottom left right in");
            if (!$tip.find(".popover-title").html()) $tip.find(".popover-title").hide()
        };
        Popover.prototype.hasContent = function() {
            return this.getTitle() || this.getContent()
        };
        Popover.prototype.getContent = function() {
            var $e = this.$element;
            var o = this.options;
            return $e.attr("data-content") || (typeof o.content == "function" ? o.content.call($e[0]) : o.content)
        };
        Popover.prototype.arrow = function() {
            return this.$arrow = this.$arrow || this.tip().find(".arrow")
        };

        function Plugin(option) {
            return this.each(function() {
                var $this = $(this);
                var data = $this.data("bs.popover");
                var options = typeof option == "object" && option;
                if (!data && /destroy|hide/.test(option)) return;
                if (!data) $this.data("bs.popover", data = new Popover(this, options));
                if (typeof option == "string") data[option]()
            })
        }
        var old = $.fn.popover;
        $.fn.popover = Plugin;
        $.fn.popover.Constructor = Popover;
        $.fn.popover.noConflict = function() {
            $.fn.popover = old;
            return this
        }
    }(jQuery);
    (function($, window) {
        var Tour, document;
        document = window.document;
        Tour = function() {
            function Tour(options) {
                var storage;
                try {
                    storage = window.localStorage
                } catch (_error) {
                    storage = false
                }
                this._options = $.extend({
                    name: "tour",
                    steps: [],
                    container: "body",
                    autoscroll: true,
                    keyboard: true,
                    storage: storage,
                    debug: false,
                    backdrop: false,
                    backdropPadding: 0,
                    redirect: true,
                    orphan: false,
                    duration: false,
                    delay: false,
                    basePath: "",
                    template: '<div class="popover" role="tooltip"> <div class="arrow"></div> <h3 class="popover-title"></h3> <div class="popover-content"></div> <div class="popover-navigation"> <div class="btn-group"> <button class="btn btn-sm btn-default" data-role="prev">&laquo; Prev</button> <button class="btn btn-sm btn-default" data-role="next">Next &raquo;</button> <button class="btn btn-sm btn-default" data-role="pause-resume" data-pause-text="Pause" data-resume-text="Resume">Pause</button> </div> <button class="btn btn-sm btn-default" data-role="end">End tour</button> </div> </div>',
                    afterSetState: function(key, value) {},
                    afterGetState: function(key, value) {},
                    afterRemoveState: function(key) {},
                    onStart: function(tour) {},
                    onEnd: function(tour) {},
                    onShow: function(tour) {},
                    onShown: function(tour) {},
                    onHide: function(tour) {},
                    onHidden: function(tour) {},
                    onNext: function(tour) {},
                    onPrev: function(tour) {},
                    onPause: function(tour, duration) {},
                    onResume: function(tour, duration) {}
                }, options);
                this._force = false;
                this._inited = false;
                this.backdrop = {
                    overlay: null,
                    $element: null,
                    $background: null,
                    backgroundShown: false,
                    overlayElementShown: false
                };
                this
            }
            Tour.prototype.addSteps = function(steps) {
                var step, _i, _len;
                for (_i = 0, _len = steps.length; _i < _len; _i++) {
                    step = steps[_i];
                    this.addStep(step)
                }
                return this
            };
            Tour.prototype.addStep = function(step) {
                this._options.steps.push(step);
                return this
            };
            Tour.prototype.getStep = function(i) {
                if (this._options.steps[i] != null) {
                    return $.extend({
                        id: "step-" + i,
                        path: "",
                        placement: "right",
                        title: "",
                        content: "<p></p>",
                        next: i === this._options.steps.length - 1 ? -1 : i + 1,
                        prev: i - 1,
                        animation: true,
                        container: this._options.container,
                        autoscroll: this._options.autoscroll,
                        backdrop: this._options.backdrop,
                        backdropPadding: this._options.backdropPadding,
                        redirect: this._options.redirect,
                        orphan: this._options.orphan,
                        duration: this._options.duration,
                        delay: this._options.delay,
                        template: this._options.template,
                        onShow: this._options.onShow,
                        onShown: this._options.onShown,
                        onHide: this._options.onHide,
                        onHidden: this._options.onHidden,
                        onNext: this._options.onNext,
                        onPrev: this._options.onPrev,
                        onPause: this._options.onPause,
                        onResume: this._options.onResume
                    }, this._options.steps[i])
                }
            };
            Tour.prototype.init = function(force) {
                this._force = force;
                if (this.ended()) {
                    this._debug("Tour ended, init prevented.");
                    return this
                }
                this.setCurrentStep();
                this._initMouseNavigation();
                this._initKeyboardNavigation();
                this._onResize(function(_this) {
                    return function() {
                        return _this.showStep(_this._current)
                    }
                }(this));
                if (this._current !== null) {
                    this.showStep(this._current)
                }
                this._inited = true;
                return this
            };
            Tour.prototype.start = function(force) {
                var promise;
                if (force == null) {
                    force = false
                }
                if (!this._inited) {
                    this.init(force)
                }
                if (this._current === null) {
                    promise = this._makePromise(this._options.onStart != null ? this._options.onStart(this) : void 0);
                    this._callOnPromiseDone(promise, this.showStep, 0)
                }
                return this
            };
            Tour.prototype.next = function() {
                var promise;
                promise = this.hideStep(this._current);
                return this._callOnPromiseDone(promise, this._showNextStep)
            };
            Tour.prototype.prev = function() {
                var promise;
                promise = this.hideStep(this._current);
                return this._callOnPromiseDone(promise, this._showPrevStep)
            };
            Tour.prototype.goTo = function(i) {
                var promise;
                promise = this.hideStep(this._current);
                return this._callOnPromiseDone(promise, this.showStep, i)
            };
            Tour.prototype.end = function() {
                var endHelper, promise;
                endHelper = function(_this) {
                    return function(e) {
                        $(document).off("click.tour-" + _this._options.name);
                        $(document).off("keyup.tour-" + _this._options.name);
                        $(window).off("resize.tour-" + _this._options.name);
                        _this._setState("end", "yes");
                        _this._inited = false;
                        _this._force = false;
                        _this._clearTimer();
                        if (_this._options.onEnd != null) {
                            return _this._options.onEnd(_this)
                        }
                    }
                }(this);
                promise = this.hideStep(this._current);
                return this._callOnPromiseDone(promise, endHelper)
            };
            Tour.prototype.ended = function() {
                return !this._force && !!this._getState("end")
            };
            Tour.prototype.restart = function() {
                this._removeState("current_step");
                this._removeState("end");
                return this.start()
            };
            Tour.prototype.pause = function() {
                var step;
                step = this.getStep(this._current);
                if (!(step && step.duration)) {
                    return this
                }
                this._paused = true;
                this._duration -= (new Date).getTime() - this._start;
                window.clearTimeout(this._timer);
                this._debug("Paused/Stopped step " + (this._current + 1) + " timer (" + this._duration + " remaining).");
                if (step.onPause != null) {
                    return step.onPause(this, this._duration)
                }
            };
            Tour.prototype.resume = function() {
                var step;
                step = this.getStep(this._current);
                if (!(step && step.duration)) {
                    return this
                }
                this._paused = false;
                this._start = (new Date).getTime();
                this._duration = this._duration || step.duration;
                this._timer = window.setTimeout(function(_this) {
                    return function() {
                        if (_this._isLast()) {
                            return _this.next()
                        } else {
                            return _this.end()
                        }
                    }
                }(this), this._duration);
                this._debug("Started step " + (this._current + 1) + " timer with duration " + this._duration);
                if (step.onResume != null && this._duration !== step.duration) {
                    return step.onResume(this, this._duration)
                }
            };
            Tour.prototype.hideStep = function(i) {
                var hideStepHelper, promise, step;
                step = this.getStep(i);
                if (!step) {
                    return
                }
                this._clearTimer();
                promise = this._makePromise(step.onHide != null ? step.onHide(this, i) : void 0);
                hideStepHelper = function(_this) {
                    return function(e) {
                        var $element;
                        $element = $(step.element);
                        if (!($element.data("bs.popover") || $element.data("popover"))) {
                            $element = $("body")
                        }
                        $element.popover("destroy").removeClass("tour-" + _this._options.name + "-element tour-" + _this._options.name + "-" + i + "-element");
                        if (step.reflex) {
                            $element.removeClass("tour-step-element-reflex").off("" + _this._reflexEvent(step.reflex) + ".tour-" + _this._options.name)
                        }
                        if (step.backdrop) {
                            _this._hideBackdrop()
                        }
                        if (step.onHidden != null) {
                            return step.onHidden(_this)
                        }
                    }
                }(this);
                this._callOnPromiseDone(promise, hideStepHelper);
                return promise
            };
            Tour.prototype.showStep = function(i) {
                var promise, showStepHelper, skipToPrevious, step;
                if (this.ended()) {
                    this._debug("Tour ended, showStep prevented.");
                    return this
                }
                step = this.getStep(i);
                if (!step) {
                    return
                }
                skipToPrevious = i < this._current;
                promise = this._makePromise(step.onShow != null ? step.onShow(this, i) : void 0);
                showStepHelper = function(_this) {
                    return function(e) {
                        var current_path, path, showPopoverAndOverlay;
                        _this.setCurrentStep(i);
                        path = function() {
                            switch ({}.toString.call(step.path)) {
                                case "[object Function]":
                                    return step.path();
                                case "[object String]":
                                    return this._options.basePath + step.path;
                                default:
                                    return step.path
                            }
                        }.call(_this);
                        current_path = [document.location.pathname, document.location.hash].join("");
                        if (_this._isRedirect(path, current_path)) {
                            _this._redirect(step, path);
                            return
                        }
                        if (_this._isOrphan(step)) {
                            if (!step.orphan) {
                                _this._debug("Skip the orphan step " + (_this._current + 1) + ".\nOrphan option is false and the element does not exist or is hidden.");
                                if (skipToPrevious) {
                                    _this._showPrevStep()
                                } else {
                                    _this._showNextStep()
                                }
                                return
                            }
                            _this._debug("Show the orphan step " + (_this._current + 1) + ". Orphans option is true.")
                        }
                        if (step.backdrop) {
                            _this._showBackdrop(!_this._isOrphan(step) ? step.element : void 0)
                        }
                        showPopoverAndOverlay = function() {
                            if (_this.getCurrentStep() !== i) {
                                return
                            }
                            if (step.element != null && step.backdrop) {
                                _this._showOverlayElement(step)
                            }
                            _this._showPopover(step, i);
                            if (step.onShown != null) {
                                step.onShown(_this)
                            }
                            return _this._debug("Step " + (_this._current + 1) + " of " + _this._options.steps.length)
                        };
                        if (step.autoscroll) {
                            _this._scrollIntoView(step.element, showPopoverAndOverlay)
                        } else {
                            showPopoverAndOverlay()
                        }
                        if (step.duration) {
                            return _this.resume()
                        }
                    }
                }(this);
                if (step.delay) {
                    this._debug("Wait " + step.delay + " milliseconds to show the step " + (this._current + 1));
                    window.setTimeout(function(_this) {
                        return function() {
                            return _this._callOnPromiseDone(promise, showStepHelper)
                        }
                    }(this), step.delay)
                } else {
                    this._callOnPromiseDone(promise, showStepHelper)
                }
                return promise
            };
            Tour.prototype.getCurrentStep = function() {
                return this._current
            };
            Tour.prototype.setCurrentStep = function(value) {
                if (value != null) {
                    this._current = value;
                    this._setState("current_step", value)
                } else {
                    this._current = this._getState("current_step");
                    this._current = this._current === null ? null : parseInt(this._current, 10)
                }
                return this
            };
            Tour.prototype._setState = function(key, value) {
                var e, keyName;
                if (this._options.storage) {
                    keyName = "" + this._options.name + "_" + key;
                    try {
                        this._options.storage.setItem(keyName, value)
                    } catch (_error) {
                        e = _error;
                        if (e.code === DOMException.QUOTA_EXCEEDED_ERR) {
                            this.debug("LocalStorage quota exceeded. State storage failed.")
                        }
                    }
                    return this._options.afterSetState(keyName, value)
                } else {
                    if (this._state == null) {
                        this._state = {}
                    }
                    return this._state[key] = value
                }
            };
            Tour.prototype._removeState = function(key) {
                var keyName;
                if (this._options.storage) {
                    keyName = "" + this._options.name + "_" + key;
                    this._options.storage.removeItem(keyName);
                    return this._options.afterRemoveState(keyName)
                } else {
                    if (this._state != null) {
                        return delete this._state[key]
                    }
                }
            };
            Tour.prototype._getState = function(key) {
                var keyName, value;
                if (this._options.storage) {
                    keyName = "" + this._options.name + "_" + key;
                    value = this._options.storage.getItem(keyName)
                } else {
                    if (this._state != null) {
                        value = this._state[key]
                    }
                }
                if (value === void 0 || value === "null") {
                    value = null
                }
                this._options.afterGetState(key, value);
                return value
            };
            Tour.prototype._showNextStep = function() {
                var promise, showNextStepHelper, step;
                step = this.getStep(this._current);
                showNextStepHelper = function(_this) {
                    return function(e) {
                        return _this.showStep(step.next)
                    }
                }(this);
                promise = this._makePromise(step.onNext != null ? step.onNext(this) : void 0);
                return this._callOnPromiseDone(promise, showNextStepHelper)
            };
            Tour.prototype._showPrevStep = function() {
                var promise, showPrevStepHelper, step;
                step = this.getStep(this._current);
                showPrevStepHelper = function(_this) {
                    return function(e) {
                        return _this.showStep(step.prev)
                    }
                }(this);
                promise = this._makePromise(step.onPrev != null ? step.onPrev(this) : void 0);
                return this._callOnPromiseDone(promise, showPrevStepHelper)
            };
            Tour.prototype._debug = function(text) {
                if (this._options.debug) {
                    return window.console.log("Bootstrap Tour '" + this._options.name + "' | " + text)
                }
            };
            Tour.prototype._isRedirect = function(path, currentPath) {
                return path != null && path !== "" && ({}.toString.call(path) === "[object RegExp]" && !path.test(currentPath) || {}.toString.call(path) === "[object String]" && path.replace(/\?.*$/, "").replace(/\/?$/, "") !== currentPath.replace(/\/?$/, ""))
            };
            Tour.prototype._redirect = function(step, path) {
                if ($.isFunction(step.redirect)) {
                    return step.redirect.call(this, path)
                } else if (step.redirect === true) {
                    this._debug("Redirect to " + path);
                    return document.location.href = path
                }
            };
            Tour.prototype._isOrphan = function(step) {
                return step.element == null || !$(step.element).length || $(step.element).is(":hidden") && $(step.element)[0].namespaceURI !== "http://www.w3.org/2000/svg"
            };
            Tour.prototype._isLast = function() {
                return this._current < this._options.steps.length - 1
            };
            Tour.prototype._showPopover = function(step, i) {
                var $element, $tip, isOrphan, options;
                $(".tour-" + this._options.name).remove();
                options = $.extend({}, this._options);
                isOrphan = this._isOrphan(step);
                step.template = this._template(step, i);
                if (isOrphan) {
                    step.element = "body";
                    step.placement = "top"
                }
                $element = $(step.element);
                $element.addClass("tour-" + this._options.name + "-element tour-" + this._options.name + "-" + i + "-element");
                if (step.options) {
                    $.extend(options, step.options)
                }
                if (step.reflex && !isOrphan) {
                    $element.addClass("tour-step-element-reflex");
                    $element.off("" + this._reflexEvent(step.reflex) + ".tour-" + this._options.name);
                    $element.on("" + this._reflexEvent(step.reflex) + ".tour-" + this._options.name, function(_this) {
                        return function() {
                            if (_this._isLast()) {
                                return _this.next()
                            } else {
                                return _this.end()
                            }
                        }
                    }(this))
                }
                $element.popover({
                    placement: step.placement,
                    trigger: "manual",
                    title: step.title,
                    content: step.content,
                    html: true,
                    animation: step.animation,
                    container: step.container,
                    template: step.template,
                    selector: step.element
                }).popover("show");
                $tip = $element.data("bs.popover") ? $element.data("bs.popover").tip() : $element.data("popover").tip();
                $tip.attr("id", step.id);
                this._reposition($tip, step);
                if (isOrphan) {
                    return this._center($tip)
                }
            };
            Tour.prototype._template = function(step, i) {
                var $navigation, $next, $prev, $template;
                $template = $.isFunction(step.template) ? $(step.template(i, step)) : $(step.template);
                $navigation = $template.find(".popover-navigation");
                $prev = $navigation.find('[data-role="prev"]');
                $next = $navigation.find('[data-role="next"]');
                if (this._isOrphan(step)) {
                    $template.addClass("orphan")
                }
                $template.addClass("tour-" + this._options.name + " tour-" + this._options.name + "-" + i);
                if (step.prev < 0) {
                    $navigation.find('[data-role="prev"]').addClass("disabled")
                }
                if (step.next < 0) {
                    $navigation.find('[data-role="next"]').addClass("disabled")
                }
                if (!step.duration) {
                    $navigation.find('[data-role="pause-resume"]').remove()
                }
                return $template.clone().wrap("<div>").parent().html()
            };
            Tour.prototype._reflexEvent = function(reflex) {
                if ({}.toString.call(reflex) === "[object Boolean]") {
                    return "click"
                } else {
                    return reflex
                }
            };
            Tour.prototype._reposition = function($tip, step) {
                var offsetBottom, offsetHeight, offsetRight, offsetWidth, originalLeft, originalTop, tipOffset;
                offsetWidth = $tip[0].offsetWidth;
                offsetHeight = $tip[0].offsetHeight;
                tipOffset = $tip.offset();
                originalLeft = tipOffset.left;
                originalTop = tipOffset.top;
                offsetBottom = $(document).outerHeight() - tipOffset.top - $tip.outerHeight();
                if (offsetBottom < 0) {
                    tipOffset.top = tipOffset.top + offsetBottom
                }
                offsetRight = $("html").outerWidth() - tipOffset.left - $tip.outerWidth();
                if (offsetRight < 0) {
                    tipOffset.left = tipOffset.left + offsetRight
                }
                if (tipOffset.top < 0) {
                    tipOffset.top = 0
                }
                if (tipOffset.left < 0) {
                    tipOffset.left = 0
                }
                $tip.offset(tipOffset);
                if (step.placement === "bottom" || step.placement === "top") {
                    if (originalLeft !== tipOffset.left) {
                        return this._replaceArrow($tip, (tipOffset.left - originalLeft) * 2, offsetWidth, "left")
                    }
                } else {
                    if (originalTop !== tipOffset.top) {
                        return this._replaceArrow($tip, (tipOffset.top - originalTop) * 2, offsetHeight, "top")
                    }
                }
            };
            Tour.prototype._center = function($tip) {
                return $tip.css("top", $(window).outerHeight() / 2 - $tip.outerHeight() / 2)
            };
            Tour.prototype._replaceArrow = function($tip, delta, dimension, position) {
                return $tip.find(".arrow").css(position, delta ? 50 * (1 - delta / dimension) + "%" : "")
            };
            Tour.prototype._scrollIntoView = function(element, callback) {
                var $element, $window, counter, offsetTop, scrollTop, windowHeight;
                $element = $(element);
                if (!$element.length) {
                    return callback()
                }
                $window = $(window);
                offsetTop = $element.offset().top;
                windowHeight = $window.height();
                scrollTop = Math.max(0, offsetTop - windowHeight / 2);
                this._debug("Scroll into view. ScrollTop: " + scrollTop + ". Element offset: " + offsetTop + ". Window height: " + windowHeight + ".");
                counter = 0;
                return $("body, html").stop(true, true).animate({
                    scrollTop: Math.ceil(scrollTop)
                }, function(_this) {
                    return function() {
                        if (++counter === 2) {
                            callback();
                            return _this._debug("Scroll into view.\nAnimation end element offset: " + $element.offset().top + ".\nWindow height: " + $window.height() + ".")
                        }
                    }
                }(this))
            };
            Tour.prototype._onResize = function(callback, timeout) {
                return $(window).on("resize.tour-" + this._options.name, function() {
                    clearTimeout(timeout);
                    return timeout = setTimeout(callback, 100)
                })
            };
            Tour.prototype._initMouseNavigation = function() {
                var _this;
                _this = this;
                return $(document).off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']").off("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']").on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='next']", function(_this) {
                    return function(e) {
                        e.preventDefault();
                        return _this.next()
                    }
                }(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='prev']", function(_this) {
                    return function(e) {
                        e.preventDefault();
                        return _this.prev()
                    }
                }(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='end']", function(_this) {
                    return function(e) {
                        e.preventDefault();
                        return _this.end()
                    }
                }(this)).on("click.tour-" + this._options.name, ".popover.tour-" + this._options.name + " *[data-role='pause-resume']", function(e) {
                    var $this;
                    e.preventDefault();
                    $this = $(this);
                    $this.text(_this._paused ? $this.data("pause-text") : $this.data("resume-text"));
                    if (_this._paused) {
                        return _this.resume()
                    } else {
                        return _this.pause()
                    }
                })
            };
            Tour.prototype._initKeyboardNavigation = function() {
                if (!this._options.keyboard) {
                    return
                }
                return $(document).on("keyup.tour-" + this._options.name, function(_this) {
                    return function(e) {
                        if (!e.which) {
                            return
                        }
                        switch (e.which) {
                            case 39:
                                e.preventDefault();
                                if (_this._isLast()) {
                                    return _this.next()
                                } else {
                                    return _this.end()
                                }
                                break;
                            case 37:
                                e.preventDefault();
                                if (_this._current > 0) {
                                    return _this.prev()
                                }
                                break;
                            case 27:
                                e.preventDefault();
                                return _this.end()
                        }
                    }
                }(this))
            };
            Tour.prototype._makePromise = function(result) {
                if (result && $.isFunction(result.then)) {
                    return result
                } else {
                    return null
                }
            };
            Tour.prototype._callOnPromiseDone = function(promise, cb, arg) {
                if (promise) {
                    return promise.then(function(_this) {
                        return function(e) {
                            return cb.call(_this, arg)
                        }
                    }(this))
                } else {
                    return cb.call(this, arg)
                }
            };
            Tour.prototype._showBackdrop = function(element) {
                if (this.backdrop.backgroundShown) {
                    return
                }
                this.backdrop = $("<div>", {
                    "class": "tour-backdrop"
                });
                this.backdrop.backgroundShown = true;
                return $("body").append(this.backdrop)
            };
            Tour.prototype._hideBackdrop = function() {
                this._hideOverlayElement();
                return this._hideBackground()
            };
            Tour.prototype._hideBackground = function() {
                if (this.backdrop) {
                    this.backdrop.remove();
                    this.backdrop.overlay = null;
                    return this.backdrop.backgroundShown = false
                }
            };
            Tour.prototype._showOverlayElement = function(step) {
                var $element, elementData;
                $element = $(step.element);
                if (!$element || $element.length === 0 || this.backdrop.overlayElementShown) {
                    return
                }
                this.backdrop.overlayElementShown = true;
                this.backdrop.$element = $element.addClass("tour-step-backdrop");
                this.backdrop.$background = $("<div>", {
                    "class": "tour-step-background"
                });
                elementData = {
                    width: $element.innerWidth(),
                    height: $element.innerHeight(),
                    offset: $element.offset()
                };
                this.backdrop.$background.appendTo("body");
                if (step.backdropPadding) {
                    elementData = this._applyBackdropPadding(step.backdropPadding, elementData)
                }
                return this.backdrop.$background.width(elementData.width).height(elementData.height).offset(elementData.offset)
            };
            Tour.prototype._hideOverlayElement = function() {
                if (!this.backdrop.overlayElementShown) {
                    return
                }
                this.backdrop.$element.removeClass("tour-step-backdrop");
                this.backdrop.$background.remove();
                this.backdrop.$element = null;
                this.backdrop.$background = null;
                return this.backdrop.overlayElementShown = false
            };
            Tour.prototype._applyBackdropPadding = function(padding, data) {
                if (typeof padding === "object") {
                    if (padding.top == null) {
                        padding.top = 0
                    }
                    if (padding.right == null) {
                        padding.right = 0
                    }
                    if (padding.bottom == null) {
                        padding.bottom = 0
                    }
                    if (padding.left == null) {
                        padding.left = 0
                    }
                    data.offset.top = data.offset.top - padding.top;
                    data.offset.left = data.offset.left - padding.left;
                    data.width = data.width + padding.left + padding.right;
                    data.height = data.height + padding.top + padding.bottom
                } else {
                    data.offset.top = data.offset.top - padding;
                    data.offset.left = data.offset.left - padding;
                    data.width = data.width + padding * 2;
                    data.height = data.height + padding * 2
                }
                return data
            };
            Tour.prototype._clearTimer = function() {
                window.clearTimeout(this._timer);
                this._timer = null;
                return this._duration = null
            };
            return Tour
        }();
        return window.Tour = Tour
    })(jQuery, window);
    var tour = window.Tour;
    delete window.Tour;
    delete window.jQuery;
    return tour
});
define("eventemitter2", ["exports", "module"], function(exports, module) {
    var process = {
            title: "eventemitter2"
        },
        define = function() {};
    ! function(exports, undefined) {
        var isArray = Array.isArray ? Array.isArray : function _isArray(obj) {
            return Object.prototype.toString.call(obj) === "[object Array]"
        };
        var defaultMaxListeners = 10;

        function init() {
            this._events = {};
            if (this._conf) {
                configure.call(this, this._conf)
            }
        }

        function configure(conf) {
            if (conf) {
                this._conf = conf;
                conf.delimiter && (this.delimiter = conf.delimiter);
                conf.maxListeners && (this._events.maxListeners = conf.maxListeners);
                conf.wildcard && (this.wildcard = conf.wildcard);
                conf.newListener && (this.newListener = conf.newListener);
                if (this.wildcard) {
                    this.listenerTree = {}
                }
            }
        }

        function EventEmitter(conf) {
            this._events = {};
            this.newListener = false;
            configure.call(this, conf)
        }

        function searchListenerTree(handlers, type, tree, i) {
            if (!tree) {
                return []
            }
            var listeners = [],
                leaf, len, branch, xTree, xxTree, isolatedBranch, endReached, typeLength = type.length,
                currentType = type[i],
                nextType = type[i + 1];
            if (i === typeLength && tree._listeners) {
                if (typeof tree._listeners === "function") {
                    handlers && handlers.push(tree._listeners);
                    return [tree]
                } else {
                    for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {
                        handlers && handlers.push(tree._listeners[leaf])
                    }
                    return [tree]
                }
            }
            if (currentType === "*" || currentType === "**" || tree[currentType]) {
                if (currentType === "*") {
                    for (branch in tree) {
                        if (branch !== "_listeners" && tree.hasOwnProperty(branch)) {
                            listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i + 1))
                        }
                    }
                    return listeners
                } else if (currentType === "**") {
                    endReached = i + 1 === typeLength || i + 2 === typeLength && nextType === "*";
                    if (endReached && tree._listeners) {
                        listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength))
                    }
                    for (branch in tree) {
                        if (branch !== "_listeners" && tree.hasOwnProperty(branch)) {
                            if (branch === "*" || branch === "**") {
                                if (tree[branch]._listeners && !endReached) {
                                    listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength))
                                }
                                listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i))
                            } else if (branch === nextType) {
                                listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i + 2))
                            } else {
                                listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i))
                            }
                        }
                    }
                    return listeners
                }
                listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i + 1))
            }
            xTree = tree["*"];
            if (xTree) {
                searchListenerTree(handlers, type, xTree, i + 1)
            }
            xxTree = tree["**"];
            if (xxTree) {
                if (i < typeLength) {
                    if (xxTree._listeners) {
                        searchListenerTree(handlers, type, xxTree, typeLength)
                    }
                    for (branch in xxTree) {
                        if (branch !== "_listeners" && xxTree.hasOwnProperty(branch)) {
                            if (branch === nextType) {
                                searchListenerTree(handlers, type, xxTree[branch], i + 2)
                            } else if (branch === currentType) {
                                searchListenerTree(handlers, type, xxTree[branch], i + 1)
                            } else {
                                isolatedBranch = {};
                                isolatedBranch[branch] = xxTree[branch];
                                searchListenerTree(handlers, type, {
                                    "**": isolatedBranch
                                }, i + 1)
                            }
                        }
                    }
                } else if (xxTree._listeners) {
                    searchListenerTree(handlers, type, xxTree, typeLength)
                } else if (xxTree["*"] && xxTree["*"]._listeners) {
                    searchListenerTree(handlers, type, xxTree["*"], typeLength)
                }
            }
            return listeners
        }

        function growListenerTree(type, listener) {
            type = typeof type === "string" ? type.split(this.delimiter) : type.slice();
            for (var i = 0, len = type.length; i + 1 < len; i++) {
                if (type[i] === "**" && type[i + 1] === "**") {
                    return
                }
            }
            var tree = this.listenerTree;
            var name = type.shift();
            while (name) {
                if (!tree[name]) {
                    tree[name] = {}
                }
                tree = tree[name];
                if (type.length === 0) {
                    if (!tree._listeners) {
                        tree._listeners = listener
                    } else if (typeof tree._listeners === "function") {
                        tree._listeners = [tree._listeners, listener]
                    } else if (isArray(tree._listeners)) {
                        tree._listeners.push(listener);
                        if (!tree._listeners.warned) {
                            var m = defaultMaxListeners;
                            if (typeof this._events.maxListeners !== "undefined") {
                                m = this._events.maxListeners
                            }
                            if (m > 0 && tree._listeners.length > m) {
                                tree._listeners.warned = true;
                                console.error("(node) warning: possible EventEmitter memory " + "leak detected. %d listeners added. " + "Use emitter.setMaxListeners() to increase limit.", tree._listeners.length);
                                console.trace()
                            }
                        }
                    }
                    return true
                }
                name = type.shift()
            }
            return true
        }
        EventEmitter.prototype.delimiter = ".";
        EventEmitter.prototype.setMaxListeners = function(n) {
            this._events || init.call(this);
            this._events.maxListeners = n;
            if (!this._conf) this._conf = {};
            this._conf.maxListeners = n
        };
        EventEmitter.prototype.event = "";
        EventEmitter.prototype.once = function(event, fn) {
            this.many(event, 1, fn);
            return this
        };
        EventEmitter.prototype.many = function(event, ttl, fn) {
            var self = this;
            if (typeof fn !== "function") {
                throw new Error("many only accepts instances of Function")
            }

            function listener() {
                if (--ttl === 0) {
                    self.off(event, listener)
                }
                fn.apply(this, arguments)
            }
            listener._origin = fn;
            this.on(event, listener);
            return self
        };
        EventEmitter.prototype.emit = function() {
            this._events || init.call(this);
            var type = arguments[0];
            if (type === "newListener" && !this.newListener) {
                if (!this._events.newListener) {
                    return false
                }
            }
            if (this._all) {
                var l = arguments.length;
                var args = new Array(l - 1);
                for (var i = 1; i < l; i++) args[i - 1] = arguments[i];
                for (i = 0, l = this._all.length; i < l; i++) {
                    this.event = type;
                    this._all[i].apply(this, args)
                }
            }
            if (type === "error") {
                if (!this._all && !this._events.error && !(this.wildcard && this.listenerTree.error)) {
                    if (arguments[1] instanceof Error) {
                        throw arguments[1]
                    } else {
                        throw new Error("Uncaught, unspecified 'error' event.")
                    }
                    return false
                }
            }
            var handler;
            if (this.wildcard) {
                handler = [];
                var ns = typeof type === "string" ? type.split(this.delimiter) : type.slice();
                searchListenerTree.call(this, handler, ns, this.listenerTree, 0)
            } else {
                handler = this._events[type]
            }
            if (typeof handler === "function") {
                this.event = type;
                if (arguments.length === 1) {
                    handler.call(this)
                } else if (arguments.length > 1) switch (arguments.length) {
                    case 2:
                        handler.call(this, arguments[1]);
                        break;
                    case 3:
                        handler.call(this, arguments[1], arguments[2]);
                        break;
                    default:
                        var l = arguments.length;
                        var args = new Array(l - 1);
                        for (var i = 1; i < l; i++) args[i - 1] = arguments[i];
                        handler.apply(this, args)
                }
                return true
            } else if (handler) {
                var l = arguments.length;
                var args = new Array(l - 1);
                for (var i = 1; i < l; i++) args[i - 1] = arguments[i];
                var listeners = handler.slice();
                for (var i = 0, l = listeners.length; i < l; i++) {
                    this.event = type;
                    listeners[i].apply(this, args)
                }
                return listeners.length > 0 || this._all
            } else {
                return this._all
            }
        };
        EventEmitter.prototype.on = function(type, listener) {
            if (typeof type === "function") {
                this.onAny(type);
                return this
            }
            if (typeof listener !== "function") {
                throw new Error("on only accepts instances of Function")
            }
            this._events || init.call(this);
            this.emit("newListener", type, listener);
            if (this.wildcard) {
                growListenerTree.call(this, type, listener);
                return this
            }
            if (!this._events[type]) {
                this._events[type] = listener
            } else if (typeof this._events[type] === "function") {
                this._events[type] = [this._events[type], listener]
            } else if (isArray(this._events[type])) {
                this._events[type].push(listener);
                if (!this._events[type].warned) {
                    var m = defaultMaxListeners;
                    if (typeof this._events.maxListeners !== "undefined") {
                        m = this._events.maxListeners
                    }
                    if (m > 0 && this._events[type].length > m) {
                        this._events[type].warned = true;
                        console.error("(node) warning: possible EventEmitter memory " + "leak detected. %d listeners added. " + "Use emitter.setMaxListeners() to increase limit.", this._events[type].length);
                        console.trace()
                    }
                }
            }
            return this
        };
        EventEmitter.prototype.onAny = function(fn) {
            if (!this._all) {
                this._all = []
            }
            if (typeof fn !== "function") {
                throw new Error("onAny only accepts instances of Function")
            }
            this._all.push(fn);
            return this
        };
        EventEmitter.prototype.addListener = EventEmitter.prototype.on;
        EventEmitter.prototype.off = function(type, listener) {
            if (typeof listener !== "function") {
                throw new Error("removeListener only takes instances of Function")
            }
            var handlers, leafs = [];
            if (this.wildcard) {
                var ns = typeof type === "string" ? type.split(this.delimiter) : type.slice();
                leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0)
            } else {
                if (!this._events[type]) return this;
                handlers = this._events[type];
                leafs.push({
                    _listeners: handlers
                })
            }
            for (var iLeaf = 0; iLeaf < leafs.length; iLeaf++) {
                var leaf = leafs[iLeaf];
                handlers = leaf._listeners;
                if (isArray(handlers)) {
                    var position = -1;
                    for (var i = 0, length = handlers.length; i < length; i++) {
                        if (handlers[i] === listener || handlers[i].listener && handlers[i].listener === listener || handlers[i]._origin && handlers[i]._origin === listener) {
                            position = i;
                            break
                        }
                    }
                    if (position < 0) {
                        return this
                    }
                    if (this.wildcard) {
                        leaf._listeners.splice(position, 1)
                    } else {
                        this._events[type].splice(position, 1)
                    }
                    if (handlers.length === 0) {
                        if (this.wildcard) {
                            delete leaf._listeners
                        } else {
                            delete this._events[type]
                        }
                    }
                } else if (handlers === listener || handlers.listener && handlers.listener === listener || handlers._origin && handlers._origin === listener) {
                    if (this.wildcard) {
                        delete leaf._listeners
                    } else {
                        delete this._events[type]
                    }
                }
            }
            return this
        };
        EventEmitter.prototype.offAny = function(fn) {
            var i = 0,
                l = 0,
                fns;
            if (fn && this._all && this._all.length > 0) {
                fns = this._all;
                for (i = 0, l = fns.length; i < l; i++) {
                    if (fn === fns[i]) {
                        fns.splice(i, 1);
                        return this
                    }
                }
            } else {
                this._all = []
            }
            return this
        };
        EventEmitter.prototype.removeListener = EventEmitter.prototype.off;
        EventEmitter.prototype.removeAllListeners = function(type) {
            if (arguments.length === 0) {
                !this._events || init.call(this);
                return this
            }
            if (this.wildcard) {
                var ns = typeof type === "string" ? type.split(this.delimiter) : type.slice();
                var leafs = searchListenerTree.call(this, null, ns, this.listenerTree, 0);
                for (var iLeaf = 0; iLeaf < leafs.length; iLeaf++) {
                    var leaf = leafs[iLeaf];
                    leaf._listeners = null
                }
            } else {
                if (!this._events[type]) return this;
                this._events[type] = null
            }
            return this
        };
        EventEmitter.prototype.listeners = function(type) {
            if (this.wildcard) {
                var handlers = [];
                var ns = typeof type === "string" ? type.split(this.delimiter) : type.slice();
                searchListenerTree.call(this, handlers, ns, this.listenerTree, 0);
                return handlers
            }
            this._events || init.call(this);
            if (!this._events[type]) this._events[type] = [];
            if (!isArray(this._events[type])) {
                this._events[type] = [this._events[type]]
            }
            return this._events[type]
        };
        EventEmitter.prototype.listenersAny = function() {
            if (this._all) {
                return this._all
            } else {
                return []
            }
        };
        if (typeof define === "function" && define.amd) {
            define(function() {
                return EventEmitter
            })
        } else {
            exports.EventEmitter2 = EventEmitter
        }
    }(typeof process !== "undefined" && typeof process.title !== "undefined" && typeof exports !== "undefined" ? exports : window);
    return module.exports
});
define("q", ["exports", "module"], function(exports, module) {
    var define = function() {};
    (function(definition) {
        if (typeof bootstrap === "function") {
            bootstrap("promise", definition)
        } else if (typeof exports === "object") {
            module.exports = definition()
        } else if (typeof define === "function" && define.amd) {
            define(definition)
        } else if (typeof ses !== "undefined") {
            if (!ses.ok()) {
                return
            } else {
                ses.makeQ = definition
            }
        } else {
            Q = definition()
        }
    })(function() {
        "use strict";
        var hasStacks = false;
        try {
            throw new Error
        } catch (e) {
            hasStacks = !!e.stack
        }
        var qStartingLine = captureLine();
        var qFileName;
        var noop = function() {};
        var nextTick = function() {
            var head = {
                task: void 0,
                next: null
            };
            var tail = head;
            var flushing = false;
            var requestTick = void 0;
            var isNodeJS = false;

            function flush() {
                while (head.next) {
                    head = head.next;
                    var task = head.task;
                    head.task = void 0;
                    var domain = head.domain;
                    if (domain) {
                        head.domain = void 0;
                        domain.enter()
                    }
                    try {
                        task()
                    } catch (e) {
                        if (isNodeJS) {
                            if (domain) {
                                domain.exit()
                            }
                            setTimeout(flush, 0);
                            if (domain) {
                                domain.enter()
                            }
                            throw e
                        } else {
                            setTimeout(function() {
                                throw e
                            }, 0)
                        }
                    }
                    if (domain) {
                        domain.exit()
                    }
                }
                flushing = false
            }
            nextTick = function(task) {
                tail = tail.next = {
                    task: task,
                    domain: isNodeJS && process.domain,
                    next: null
                };
                if (!flushing) {
                    flushing = true;
                    requestTick()
                }
            };
            if (typeof process !== "undefined" && process.nextTick) {
                isNodeJS = true;
                requestTick = function() {
                    process.nextTick(flush)
                }
            } else if (typeof setImmediate === "function") {
                if (typeof window !== "undefined") {
                    requestTick = setImmediate.bind(window, flush)
                } else {
                    requestTick = function() {
                        setImmediate(flush)
                    }
                }
            } else if (typeof MessageChannel !== "undefined") {
                var channel = new MessageChannel;
                channel.port1.onmessage = function() {
                    requestTick = requestPortTick;
                    channel.port1.onmessage = flush;
                    flush()
                };
                var requestPortTick = function() {
                    channel.port2.postMessage(0)
                };
                requestTick = function() {
                    setTimeout(flush, 0);
                    requestPortTick()
                }
            } else {
                requestTick = function() {
                    setTimeout(flush, 0)
                }
            }
            return nextTick
        }();
        var call = Function.call;

        function uncurryThis(f) {
            return function() {
                return call.apply(f, arguments)
            }
        }
        var array_slice = uncurryThis(Array.prototype.slice);
        var array_reduce = uncurryThis(Array.prototype.reduce || function(callback, basis) {
            var index = 0,
                length = this.length;
            if (arguments.length === 1) {
                do {
                    if (index in this) {
                        basis = this[index++];
                        break
                    }
                    if (++index >= length) {
                        throw new TypeError
                    }
                } while (1)
            }
            for (; index < length; index++) {
                if (index in this) {
                    basis = callback(basis, this[index], index)
                }
            }
            return basis
        });
        var array_indexOf = uncurryThis(Array.prototype.indexOf || function(value) {
            for (var i = 0; i < this.length; i++) {
                if (this[i] === value) {
                    return i
                }
            }
            return -1
        });
        var array_map = uncurryThis(Array.prototype.map || function(callback, thisp) {
            var self = this;
            var collect = [];
            array_reduce(self, function(undefined, value, index) {
                collect.push(callback.call(thisp, value, index, self))
            }, void 0);
            return collect
        });
        var object_create = Object.create || function(prototype) {
            function Type() {}
            Type.prototype = prototype;
            return new Type
        };
        var object_hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
        var object_keys = Object.keys || function(object) {
            var keys = [];
            for (var key in object) {
                if (object_hasOwnProperty(object, key)) {
                    keys.push(key)
                }
            }
            return keys
        };
        var object_toString = uncurryThis(Object.prototype.toString);

        function isObject(value) {
            return value === Object(value)
        }

        function isStopIteration(exception) {
            return object_toString(exception) === "[object StopIteration]" || exception instanceof QReturnValue
        }
        var QReturnValue;
        if (typeof ReturnValue !== "undefined") {
            QReturnValue = ReturnValue
        } else {
            QReturnValue = function(value) {
                this.value = value
            }
        }
        var STACK_JUMP_SEPARATOR = "From previous event:";

        function makeStackTraceLong(error, promise) {
            if (hasStacks && promise.stack && typeof error === "object" && error !== null && error.stack && error.stack.indexOf(STACK_JUMP_SEPARATOR) === -1) {
                var stacks = [];
                for (var p = promise; !!p; p = p.source) {
                    if (p.stack) {
                        stacks.unshift(p.stack)
                    }
                }
                stacks.unshift(error.stack);
                var concatedStacks = stacks.join("\n" + STACK_JUMP_SEPARATOR + "\n");
                error.stack = filterStackString(concatedStacks)
            }
        }

        function filterStackString(stackString) {
            var lines = stackString.split("\n");
            var desiredLines = [];
            for (var i = 0; i < lines.length; ++i) {
                var line = lines[i];
                if (!isInternalFrame(line) && !isNodeFrame(line) && line) {
                    desiredLines.push(line)
                }
            }
            return desiredLines.join("\n")
        }

        function isNodeFrame(stackLine) {
            return stackLine.indexOf("(module.js:") !== -1 || stackLine.indexOf("(node.js:") !== -1
        }

        function getFileNameAndLineNumber(stackLine) {
            var attempt1 = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(stackLine);
            if (attempt1) {
                return [attempt1[1], Number(attempt1[2])]
            }
            var attempt2 = /at ([^ ]+):(\d+):(?:\d+)$/.exec(stackLine);
            if (attempt2) {
                return [attempt2[1], Number(attempt2[2])]
            }
            var attempt3 = /.*@(.+):(\d+)$/.exec(stackLine);
            if (attempt3) {
                return [attempt3[1], Number(attempt3[2])]
            }
        }

        function isInternalFrame(stackLine) {
            var fileNameAndLineNumber = getFileNameAndLineNumber(stackLine);
            if (!fileNameAndLineNumber) {
                return false
            }
            var fileName = fileNameAndLineNumber[0];
            var lineNumber = fileNameAndLineNumber[1];
            return fileName === qFileName && lineNumber >= qStartingLine && lineNumber <= qEndingLine
        }

        function captureLine() {
            if (!hasStacks) {
                return
            }
            try {
                throw new Error
            } catch (e) {
                var lines = e.stack.split("\n");
                var firstLine = lines[0].indexOf("@") > 0 ? lines[1] : lines[2];
                var fileNameAndLineNumber = getFileNameAndLineNumber(firstLine);
                if (!fileNameAndLineNumber) {
                    return
                }
                qFileName = fileNameAndLineNumber[0];
                return fileNameAndLineNumber[1]
            }
        }

        function deprecate(callback, name, alternative) {
            return function() {
                if (typeof console !== "undefined" && typeof console.warn === "function") {
                    console.warn(name + " is deprecated, use " + alternative + " instead.", new Error("").stack)
                }
                return callback.apply(callback, arguments)
            }
        }

        function Q(value) {
            if (isPromise(value)) {
                return value
            }
            if (isPromiseAlike(value)) {
                return coerce(value)
            } else {
                return fulfill(value)
            }
        }
        Q.resolve = Q;
        Q.nextTick = nextTick;
        Q.longStackSupport = false;
        Q.defer = defer;

        function defer() {
            var messages = [],
                progressListeners = [],
                resolvedPromise;
            var deferred = object_create(defer.prototype);
            var promise = object_create(Promise.prototype);
            promise.promiseDispatch = function(resolve, op, operands) {
                var args = array_slice(arguments);
                if (messages) {
                    messages.push(args);
                    if (op === "when" && operands[1]) {
                        progressListeners.push(operands[1])
                    }
                } else {
                    nextTick(function() {
                        resolvedPromise.promiseDispatch.apply(resolvedPromise, args)
                    })
                }
            };
            promise.valueOf = function() {
                if (messages) {
                    return promise
                }
                var nearerValue = nearer(resolvedPromise);
                if (isPromise(nearerValue)) {
                    resolvedPromise = nearerValue
                }
                return nearerValue
            };
            promise.inspect = function() {
                if (!resolvedPromise) {
                    return {
                        state: "pending"
                    }
                }
                return resolvedPromise.inspect()
            };
            if (Q.longStackSupport && hasStacks) {
                try {
                    throw new Error
                } catch (e) {
                    promise.stack = e.stack.substring(e.stack.indexOf("\n") + 1)
                }
            }

            function become(newPromise) {
                resolvedPromise = newPromise;
                promise.source = newPromise;
                array_reduce(messages, function(undefined, message) {
                    nextTick(function() {
                        newPromise.promiseDispatch.apply(newPromise, message)
                    })
                }, void 0);
                messages = void 0;
                progressListeners = void 0
            }
            deferred.promise = promise;
            deferred.resolve = function(value) {
                if (resolvedPromise) {
                    return
                }
                become(Q(value))
            };
            deferred.fulfill = function(value) {
                if (resolvedPromise) {
                    return
                }
                become(fulfill(value))
            };
            deferred.reject = function(reason) {
                if (resolvedPromise) {
                    return
                }
                become(reject(reason))
            };
            deferred.notify = function(progress) {
                if (resolvedPromise) {
                    return
                }
                array_reduce(progressListeners, function(undefined, progressListener) {
                    nextTick(function() {
                        progressListener(progress)
                    })
                }, void 0)
            };
            return deferred
        }
        defer.prototype.makeNodeResolver = function() {
            var self = this;
            return function(error, value) {
                if (error) {
                    self.reject(error)
                } else if (arguments.length > 2) {
                    self.resolve(array_slice(arguments, 1))
                } else {
                    self.resolve(value)
                }
            }
        };
        Q.Promise = promise;
        Q.promise = promise;

        function promise(resolver) {
            if (typeof resolver !== "function") {
                throw new TypeError("resolver must be a function.")
            }
            var deferred = defer();
            try {
                resolver(deferred.resolve, deferred.reject, deferred.notify)
            } catch (reason) {
                deferred.reject(reason)
            }
            return deferred.promise
        }
        promise.race = race;
        promise.all = all;
        promise.reject = reject;
        promise.resolve = Q;
        Q.passByCopy = function(object) {
            return object
        };
        Promise.prototype.passByCopy = function() {
            return this
        };
        Q.join = function(x, y) {
            return Q(x).join(y)
        };
        Promise.prototype.join = function(that) {
            return Q([this, that]).spread(function(x, y) {
                if (x === y) {
                    return x
                } else {
                    throw new Error("Can't join: not the same: " + x + " " + y)
                }
            })
        };
        Q.race = race;

        function race(answerPs) {
            return promise(function(resolve, reject) {
                for (var i = 0, len = answerPs.length; i < len; i++) {
                    Q(answerPs[i]).then(resolve, reject)
                }
            })
        }
        Promise.prototype.race = function() {
            return this.then(Q.race)
        };
        Q.makePromise = Promise;

        function Promise(descriptor, fallback, inspect) {
            if (fallback === void 0) {
                fallback = function(op) {
                    return reject(new Error("Promise does not support operation: " + op))
                }
            }
            if (inspect === void 0) {
                inspect = function() {
                    return {
                        state: "unknown"
                    }
                }
            }
            var promise = object_create(Promise.prototype);
            promise.promiseDispatch = function(resolve, op, args) {
                var result;
                try {
                    if (descriptor[op]) {
                        result = descriptor[op].apply(promise, args)
                    } else {
                        result = fallback.call(promise, op, args)
                    }
                } catch (exception) {
                    result = reject(exception)
                }
                if (resolve) {
                    resolve(result)
                }
            };
            promise.inspect = inspect;
            if (inspect) {
                var inspected = inspect();
                if (inspected.state === "rejected") {
                    promise.exception = inspected.reason
                }
                promise.valueOf = function() {
                    var inspected = inspect();
                    if (inspected.state === "pending" || inspected.state === "rejected") {
                        return promise
                    }
                    return inspected.value
                }
            }
            return promise
        }
        Promise.prototype.toString = function() {
            return "[object Promise]"
        };
        Promise.prototype.then = function(fulfilled, rejected, progressed) {
            var self = this;
            var deferred = defer();
            var done = false;

            function _fulfilled(value) {
                try {
                    return typeof fulfilled === "function" ? fulfilled(value) : value
                } catch (exception) {
                    return reject(exception)
                }
            }

            function _rejected(exception) {
                if (typeof rejected === "function") {
                    makeStackTraceLong(exception, self);
                    try {
                        return rejected(exception)
                    } catch (newException) {
                        return reject(newException)
                    }
                }
                return reject(exception)
            }

            function _progressed(value) {
                return typeof progressed === "function" ? progressed(value) : value
            }
            nextTick(function() {
                self.promiseDispatch(function(value) {
                    if (done) {
                        return
                    }
                    done = true;
                    deferred.resolve(_fulfilled(value))
                }, "when", [function(exception) {
                    if (done) {
                        return
                    }
                    done = true;
                    deferred.resolve(_rejected(exception))
                }])
            });
            self.promiseDispatch(void 0, "when", [void 0, function(value) {
                var newValue;
                var threw = false;
                try {
                    newValue = _progressed(value)
                } catch (e) {
                    threw = true;
                    if (Q.onerror) {
                        Q.onerror(e)
                    } else {
                        throw e
                    }
                }
                if (!threw) {
                    deferred.notify(newValue)
                }
            }]);
            return deferred.promise
        };
        Q.when = when;

        function when(value, fulfilled, rejected, progressed) {
            return Q(value).then(fulfilled, rejected, progressed)
        }
        Promise.prototype.thenResolve = function(value) {
            return this.then(function() {
                return value
            })
        };
        Q.thenResolve = function(promise, value) {
            return Q(promise).thenResolve(value)
        };
        Promise.prototype.thenReject = function(reason) {
            return this.then(function() {
                throw reason
            })
        };
        Q.thenReject = function(promise, reason) {
            return Q(promise).thenReject(reason)
        };
        Q.nearer = nearer;

        function nearer(value) {
            if (isPromise(value)) {
                var inspected = value.inspect();
                if (inspected.state === "fulfilled") {
                    return inspected.value
                }
            }
            return value
        }
        Q.isPromise = isPromise;

        function isPromise(object) {
            return isObject(object) && typeof object.promiseDispatch === "function" && typeof object.inspect === "function"
        }
        Q.isPromiseAlike = isPromiseAlike;

        function isPromiseAlike(object) {
            return isObject(object) && typeof object.then === "function"
        }
        Q.isPending = isPending;

        function isPending(object) {
            return isPromise(object) && object.inspect().state === "pending"
        }
        Promise.prototype.isPending = function() {
            return this.inspect().state === "pending"
        };
        Q.isFulfilled = isFulfilled;

        function isFulfilled(object) {
            return !isPromise(object) || object.inspect().state === "fulfilled"
        }
        Promise.prototype.isFulfilled = function() {
            return this.inspect().state === "fulfilled"
        };
        Q.isRejected = isRejected;

        function isRejected(object) {
            return isPromise(object) && object.inspect().state === "rejected"
        }
        Promise.prototype.isRejected = function() {
            return this.inspect().state === "rejected"
        };
        var unhandledReasons = [];
        var unhandledRejections = [];
        var trackUnhandledRejections = true;

        function resetUnhandledRejections() {
            unhandledReasons.length = 0;
            unhandledRejections.length = 0;
            if (!trackUnhandledRejections) {
                trackUnhandledRejections = true
            }
        }

        function trackRejection(promise, reason) {
            if (!trackUnhandledRejections) {
                return
            }
            unhandledRejections.push(promise);
            if (reason && typeof reason.stack !== "undefined") {
                unhandledReasons.push(reason.stack)
            } else {
                unhandledReasons.push("(no stack) " + reason)
            }
        }

        function untrackRejection(promise) {
            if (!trackUnhandledRejections) {
                return
            }
            var at = array_indexOf(unhandledRejections, promise);
            if (at !== -1) {
                unhandledRejections.splice(at, 1);
                unhandledReasons.splice(at, 1)
            }
        }
        Q.resetUnhandledRejections = resetUnhandledRejections;
        Q.getUnhandledReasons = function() {
            return unhandledReasons.slice()
        };
        Q.stopUnhandledRejectionTracking = function() {
            resetUnhandledRejections();
            trackUnhandledRejections = false
        };
        resetUnhandledRejections();
        Q.reject = reject;

        function reject(reason) {
            var rejection = Promise({
                when: function(rejected) {
                    if (rejected) {
                        untrackRejection(this)
                    }
                    return rejected ? rejected(reason) : this
                }
            }, function fallback() {
                return this
            }, function inspect() {
                return {
                    state: "rejected",
                    reason: reason
                }
            });
            trackRejection(rejection, reason);
            return rejection
        }
        Q.fulfill = fulfill;

        function fulfill(value) {
            return Promise({
                when: function() {
                    return value
                },
                get: function(name) {
                    return value[name]
                },
                set: function(name, rhs) {
                    value[name] = rhs
                },
                "delete": function(name) {
                    delete value[name]
                },
                post: function(name, args) {
                    if (name === null || name === void 0) {
                        return value.apply(void 0, args)
                    } else {
                        return value[name].apply(value, args)
                    }
                },
                apply: function(thisp, args) {
                    return value.apply(thisp, args)
                },
                keys: function() {
                    return object_keys(value)
                }
            }, void 0, function inspect() {
                return {
                    state: "fulfilled",
                    value: value
                }
            })
        }

        function coerce(promise) {
            var deferred = defer();
            nextTick(function() {
                try {
                    promise.then(deferred.resolve, deferred.reject, deferred.notify)
                } catch (exception) {
                    deferred.reject(exception)
                }
            });
            return deferred.promise
        }
        Q.master = master;

        function master(object) {
            return Promise({
                isDef: function() {}
            }, function fallback(op, args) {
                return dispatch(object, op, args)
            }, function() {
                return Q(object).inspect()
            })
        }
        Q.spread = spread;

        function spread(value, fulfilled, rejected) {
            return Q(value).spread(fulfilled, rejected)
        }
        Promise.prototype.spread = function(fulfilled, rejected) {
            return this.all().then(function(array) {
                return fulfilled.apply(void 0, array)
            }, rejected)
        };
        Q.async = async;

        function async(makeGenerator) {
            return function() {
                function continuer(verb, arg) {
                    var result;
                    if (typeof StopIteration === "undefined") {
                        try {
                            result = generator[verb](arg)
                        } catch (exception) {
                            return reject(exception)
                        }
                        if (result.done) {
                            return Q(result.value)
                        } else {
                            return when(result.value, callback, errback)
                        }
                    } else {
                        try {
                            result = generator[verb](arg)
                        } catch (exception) {
                            if (isStopIteration(exception)) {
                                return Q(exception.value)
                            } else {
                                return reject(exception)
                            }
                        }
                        return when(result, callback, errback)
                    }
                }
                var generator = makeGenerator.apply(this, arguments);
                var callback = continuer.bind(continuer, "next");
                var errback = continuer.bind(continuer, "throw");
                return callback()
            }
        }
        Q.spawn = spawn;

        function spawn(makeGenerator) {
            Q.done(Q.async(makeGenerator)())
        }
        Q["return"] = _return;

        function _return(value) {
            throw new QReturnValue(value)
        }
        Q.promised = promised;

        function promised(callback) {
            return function() {
                return spread([this, all(arguments)], function(self, args) {
                    return callback.apply(self, args)
                })
            }
        }
        Q.dispatch = dispatch;

        function dispatch(object, op, args) {
            return Q(object).dispatch(op, args)
        }
        Promise.prototype.dispatch = function(op, args) {
            var self = this;
            var deferred = defer();
            nextTick(function() {
                self.promiseDispatch(deferred.resolve, op, args)
            });
            return deferred.promise
        };
        Q.get = function(object, key) {
            return Q(object).dispatch("get", [key])
        };
        Promise.prototype.get = function(key) {
            return this.dispatch("get", [key])
        };
        Q.set = function(object, key, value) {
            return Q(object).dispatch("set", [key, value])
        };
        Promise.prototype.set = function(key, value) {
            return this.dispatch("set", [key, value])
        };
        Q.del = Q["delete"] = function(object, key) {
            return Q(object).dispatch("delete", [key])
        };
        Promise.prototype.del = Promise.prototype["delete"] = function(key) {
            return this.dispatch("delete", [key])
        };
        Q.mapply = Q.post = function(object, name, args) {
            return Q(object).dispatch("post", [name, args])
        };
        Promise.prototype.mapply = Promise.prototype.post = function(name, args) {
            return this.dispatch("post", [name, args])
        };
        Q.send = Q.mcall = Q.invoke = function(object, name) {
            return Q(object).dispatch("post", [name, array_slice(arguments, 2)])
        };
        Promise.prototype.send = Promise.prototype.mcall = Promise.prototype.invoke = function(name) {
            return this.dispatch("post", [name, array_slice(arguments, 1)])
        };
        Q.fapply = function(object, args) {
            return Q(object).dispatch("apply", [void 0, args])
        };
        Promise.prototype.fapply = function(args) {
            return this.dispatch("apply", [void 0, args])
        };
        Q["try"] = Q.fcall = function(object) {
            return Q(object).dispatch("apply", [void 0, array_slice(arguments, 1)])
        };
        Promise.prototype.fcall = function() {
            return this.dispatch("apply", [void 0, array_slice(arguments)])
        };
        Q.fbind = function(object) {
            var promise = Q(object);
            var args = array_slice(arguments, 1);
            return function fbound() {
                return promise.dispatch("apply", [this, args.concat(array_slice(arguments))])
            }
        };
        Promise.prototype.fbind = function() {
            var promise = this;
            var args = array_slice(arguments);
            return function fbound() {
                return promise.dispatch("apply", [this, args.concat(array_slice(arguments))])
            }
        };
        Q.keys = function(object) {
            return Q(object).dispatch("keys", [])
        };
        Promise.prototype.keys = function() {
            return this.dispatch("keys", [])
        };
        Q.all = all;

        function all(promises) {
            return when(promises, function(promises) {
                var countDown = 0;
                var deferred = defer();
                array_reduce(promises, function(undefined, promise, index) {
                    var snapshot;
                    if (isPromise(promise) && (snapshot = promise.inspect()).state === "fulfilled") {
                        promises[index] = snapshot.value
                    } else {
                        ++countDown;
                        when(promise, function(value) {
                            promises[index] = value;
                            if (--countDown === 0) {
                                deferred.resolve(promises)
                            }
                        }, deferred.reject, function(progress) {
                            deferred.notify({
                                index: index,
                                value: progress
                            })
                        })
                    }
                }, void 0);
                if (countDown === 0) {
                    deferred.resolve(promises)
                }
                return deferred.promise
            })
        }
        Promise.prototype.all = function() {
            return all(this)
        };
        Q.allResolved = deprecate(allResolved, "allResolved", "allSettled");

        function allResolved(promises) {
            return when(promises, function(promises) {
                promises = array_map(promises, Q);
                return when(all(array_map(promises, function(promise) {
                    return when(promise, noop, noop)
                })), function() {
                    return promises
                })
            })
        }
        Promise.prototype.allResolved = function() {
            return allResolved(this)
        };
        Q.allSettled = allSettled;

        function allSettled(promises) {
            return Q(promises).allSettled()
        }
        Promise.prototype.allSettled = function() {
            return this.then(function(promises) {
                return all(array_map(promises, function(promise) {
                    promise = Q(promise);

                    function regardless() {
                        return promise.inspect()
                    }
                    return promise.then(regardless, regardless)
                }))
            })
        };
        Q.fail = Q["catch"] = function(object, rejected) {
            return Q(object).then(void 0, rejected)
        };
        Promise.prototype.fail = Promise.prototype["catch"] = function(rejected) {
            return this.then(void 0, rejected)
        };
        Q.progress = progress;

        function progress(object, progressed) {
            return Q(object).then(void 0, void 0, progressed)
        }
        Promise.prototype.progress = function(progressed) {
            return this.then(void 0, void 0, progressed)
        };
        Q.fin = Q["finally"] = function(object, callback) {
            return Q(object)["finally"](callback)
        };
        Promise.prototype.fin = Promise.prototype["finally"] = function(callback) {
            callback = Q(callback);
            return this.then(function(value) {
                return callback.fcall().then(function() {
                    return value
                })
            }, function(reason) {
                return callback.fcall().then(function() {
                    throw reason
                })
            })
        };
        Q.done = function(object, fulfilled, rejected, progress) {
            return Q(object).done(fulfilled, rejected, progress)
        };
        Promise.prototype.done = function(fulfilled, rejected, progress) {
            var onUnhandledError = function(error) {
                nextTick(function() {
                    makeStackTraceLong(error, promise);
                    if (Q.onerror) {
                        Q.onerror(error)
                    } else {
                        throw error
                    }
                })
            };
            var promise = fulfilled || rejected || progress ? this.then(fulfilled, rejected, progress) : this;
            if (typeof process === "object" && process && process.domain) {
                onUnhandledError = process.domain.bind(onUnhandledError)
            }
            promise.then(void 0, onUnhandledError)
        };
        Q.timeout = function(object, ms, error) {
            return Q(object).timeout(ms, error)
        };
        Promise.prototype.timeout = function(ms, error) {
            var deferred = defer();
            var timeoutId = setTimeout(function() {
                if (!error || "string" === typeof error) {
                    error = new Error(error || "Timed out after " + ms + " ms");
                    error.code = "ETIMEDOUT"
                }
                deferred.reject(error)
            }, ms);
            this.then(function(value) {
                clearTimeout(timeoutId);
                deferred.resolve(value)
            }, function(exception) {
                clearTimeout(timeoutId);
                deferred.reject(exception)
            }, deferred.notify);
            return deferred.promise
        };
        Q.delay = function(object, timeout) {
            if (timeout === void 0) {
                timeout = object;
                object = void 0
            }
            return Q(object).delay(timeout)
        };
        Promise.prototype.delay = function(timeout) {
            return this.then(function(value) {
                var deferred = defer();
                setTimeout(function() {
                    deferred.resolve(value)
                }, timeout);
                return deferred.promise
            })
        };
        Q.nfapply = function(callback, args) {
            return Q(callback).nfapply(args)
        };
        Promise.prototype.nfapply = function(args) {
            var deferred = defer();
            var nodeArgs = array_slice(args);
            nodeArgs.push(deferred.makeNodeResolver());
            this.fapply(nodeArgs).fail(deferred.reject);
            return deferred.promise
        };
        Q.nfcall = function(callback) {
            var args = array_slice(arguments, 1);
            return Q(callback).nfapply(args)
        };
        Promise.prototype.nfcall = function() {
            var nodeArgs = array_slice(arguments);
            var deferred = defer();
            nodeArgs.push(deferred.makeNodeResolver());
            this.fapply(nodeArgs).fail(deferred.reject);
            return deferred.promise
        };
        Q.nfbind = Q.denodeify = function(callback) {
            var baseArgs = array_slice(arguments, 1);
            return function() {
                var nodeArgs = baseArgs.concat(array_slice(arguments));
                var deferred = defer();
                nodeArgs.push(deferred.makeNodeResolver());
                Q(callback).fapply(nodeArgs).fail(deferred.reject);
                return deferred.promise
            }
        };
        Promise.prototype.nfbind = Promise.prototype.denodeify = function() {
            var args = array_slice(arguments);
            args.unshift(this);
            return Q.denodeify.apply(void 0, args)
        };
        Q.nbind = function(callback, thisp) {
            var baseArgs = array_slice(arguments, 2);
            return function() {
                var nodeArgs = baseArgs.concat(array_slice(arguments));
                var deferred = defer();
                nodeArgs.push(deferred.makeNodeResolver());

                function bound() {
                    return callback.apply(thisp, arguments)
                }
                Q(bound).fapply(nodeArgs).fail(deferred.reject);
                return deferred.promise
            }
        };
        Promise.prototype.nbind = function() {
            var args = array_slice(arguments, 0);
            args.unshift(this);
            return Q.nbind.apply(void 0, args)
        };
        Q.nmapply = Q.npost = function(object, name, args) {
            return Q(object).npost(name, args)
        };
        Promise.prototype.nmapply = Promise.prototype.npost = function(name, args) {
            var nodeArgs = array_slice(args || []);
            var deferred = defer();
            nodeArgs.push(deferred.makeNodeResolver());
            this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
            return deferred.promise
        };
        Q.nsend = Q.nmcall = Q.ninvoke = function(object, name) {
            var nodeArgs = array_slice(arguments, 2);
            var deferred = defer();
            nodeArgs.push(deferred.makeNodeResolver());
            Q(object).dispatch("post", [name, nodeArgs]).fail(deferred.reject);
            return deferred.promise
        };
        Promise.prototype.nsend = Promise.prototype.nmcall = Promise.prototype.ninvoke = function(name) {
            var nodeArgs = array_slice(arguments, 1);
            var deferred = defer();
            nodeArgs.push(deferred.makeNodeResolver());
            this.dispatch("post", [name, nodeArgs]).fail(deferred.reject);
            return deferred.promise
        };
        Q.nodeify = nodeify;

        function nodeify(object, nodeback) {
            return Q(object).nodeify(nodeback)
        }
        Promise.prototype.nodeify = function(nodeback) {
            if (nodeback) {
                this.then(function(value) {
                    nextTick(function() {
                        nodeback(null, value)
                    })
                }, function(error) {
                    nextTick(function() {
                        nodeback(error)
                    })
                })
            } else {
                return this
            }
        };
        var qEndingLine = captureLine();
        return Q
    });
    return module.exports
});
define("lodash", ["exports", "module"], function(exports, module) {
    var process = {
            title: "lodash"
        },
        define = function() {};
    var lodash;

    function wrapper() {
        (function(window) {
            var undefined;
            var arrayPool = [],
                objectPool = [];
            var idCounter = 0;
            var indicatorObject = {};
            var keyPrefix = +new Date + "";
            var largeArraySize = 75;
            var maxPoolSize = 40;
            var reEmptyStringLeading = /\b__p \+= '';/g,
                reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
                reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
            var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g;
            var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
            var reFlags = /\w*$/;
            var reInterpolate = /<%=([\s\S]+?)%>/g;
            var reThis = (reThis = /\bthis\b/) && reThis.test(runInContext) && reThis;
            var whitespace = " 	\x0B\f \ufeff" + "\n\r\u2028\u2029" + " ᠎             　";
            var reLeadingSpacesAndZeros = RegExp("^[" + whitespace + "]*0+(?=.$)");
            var reNoMatch = /($^)/;
            var reUnescapedHtml = /[&<>"']/g;
            var reUnescapedString = /['\n\r\t\u2028\u2029\\]/g;
            var contextProps = ["Array", "Boolean", "Date", "Function", "Math", "Number", "Object", "RegExp", "String", "_", "attachEvent", "clearTimeout", "isFinite", "isNaN", "parseInt", "setImmediate", "setTimeout"];
            var templateCounter = 0;
            var argsClass = "[object Arguments]",
                arrayClass = "[object Array]",
                boolClass = "[object Boolean]",
                dateClass = "[object Date]",
                errorClass = "[object Error]",
                funcClass = "[object Function]",
                numberClass = "[object Number]",
                objectClass = "[object Object]",
                regexpClass = "[object RegExp]",
                stringClass = "[object String]";
            var cloneableClasses = {};
            cloneableClasses[funcClass] = false;
            cloneableClasses[argsClass] = cloneableClasses[arrayClass] = cloneableClasses[boolClass] = cloneableClasses[dateClass] = cloneableClasses[numberClass] = cloneableClasses[objectClass] = cloneableClasses[regexpClass] = cloneableClasses[stringClass] = true;
            var objectTypes = {
                "boolean": false,
                "function": true,
                object: true,
                number: false,
                string: false,
                undefined: false
            };
            var stringEscapes = {
                "\\": "\\",
                "'": "'",
                "\n": "n",
                "\r": "r",
                "	": "t",
                "\u2028": "u2028",
                "\u2029": "u2029"
            };
            var freeExports = objectTypes[typeof exports] && exports;
            var freeModule = objectTypes[typeof module] && module && module.exports == freeExports && module;
            var freeGlobal = objectTypes[typeof global] && global;
            if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal)) {
                window = freeGlobal
            }

            function basicIndexOf(array, value, fromIndex) {
                var index = (fromIndex || 0) - 1,
                    length = array.length;
                while (++index < length) {
                    if (array[index] === value) {
                        return index
                    }
                }
                return -1
            }

            function cacheIndexOf(cache, value) {
                var type = typeof value;
                cache = cache.cache;
                if (type == "boolean" || value == null) {
                    return cache[value]
                }
                if (type != "number" && type != "string") {
                    type = "object"
                }
                var key = type == "number" ? value : keyPrefix + value;
                cache = cache[type] || (cache[type] = {});
                return type == "object" ? cache[key] && basicIndexOf(cache[key], value) > -1 ? 0 : -1 : cache[key] ? 0 : -1
            }

            function cachePush(value) {
                var cache = this.cache,
                    type = typeof value;
                if (type == "boolean" || value == null) {
                    cache[value] = true
                } else {
                    if (type != "number" && type != "string") {
                        type = "object"
                    }
                    var key = type == "number" ? value : keyPrefix + value,
                        typeCache = cache[type] || (cache[type] = {});
                    if (type == "object") {
                        if ((typeCache[key] || (typeCache[key] = [])).push(value) == this.array.length) {
                            cache[type] = false
                        }
                    } else {
                        typeCache[key] = true
                    }
                }
            }

            function charAtCallback(value) {
                return value.charCodeAt(0)
            }

            function compareAscending(a, b) {
                var ai = a.index,
                    bi = b.index;
                a = a.criteria;
                b = b.criteria;
                if (a !== b) {
                    if (a > b || typeof a == "undefined") {
                        return 1
                    }
                    if (a < b || typeof b == "undefined") {
                        return -1
                    }
                }
                return ai < bi ? -1 : 1
            }

            function createCache(array) {
                var index = -1,
                    length = array.length;
                var cache = getObject();
                cache["false"] = cache["null"] = cache["true"] = cache["undefined"] = false;
                var result = getObject();
                result.array = array;
                result.cache = cache;
                result.push = cachePush;
                while (++index < length) {
                    result.push(array[index])
                }
                return cache.object === false ? (releaseObject(result), null) : result
            }

            function escapeStringChar(match) {
                return "\\" + stringEscapes[match]
            }

            function getArray() {
                return arrayPool.pop() || []
            }

            function getObject() {
                return objectPool.pop() || {
                    array: null,
                    cache: null,
                    criteria: null,
                    "false": false,
                    index: 0,
                    leading: false,
                    maxWait: 0,
                    "null": false,
                    number: null,
                    object: null,
                    push: null,
                    string: null,
                    trailing: false,
                    "true": false,
                    undefined: false,
                    value: null
                }
            }

            function noop() {}

            function releaseArray(array) {
                array.length = 0;
                if (arrayPool.length < maxPoolSize) {
                    arrayPool.push(array)
                }
            }

            function releaseObject(object) {
                var cache = object.cache;
                if (cache) {
                    releaseObject(cache)
                }
                object.array = object.cache = object.criteria = object.object = object.number = object.string = object.value = null;
                if (objectPool.length < maxPoolSize) {
                    objectPool.push(object)
                }
            }

            function slice(array, start, end) {
                start || (start = 0);
                if (typeof end == "undefined") {
                    end = array ? array.length : 0
                }
                var index = -1,
                    length = end - start || 0,
                    result = Array(length < 0 ? 0 : length);
                while (++index < length) {
                    result[index] = array[start + index]
                }
                return result
            }

            function runInContext(context) {
                context = context ? _.defaults(window.Object(), context, _.pick(window, contextProps)) : window;
                var Array = context.Array,
                    Boolean = context.Boolean,
                    Date = context.Date,
                    Function = context.Function,
                    Math = context.Math,
                    Number = context.Number,
                    Object = context.Object,
                    RegExp = context.RegExp,
                    String = context.String,
                    TypeError = context.TypeError;
                var arrayRef = [];
                var objectProto = Object.prototype,
                    stringProto = String.prototype;
                var oldDash = context._;
                var reNative = RegExp("^" + String(objectProto.valueOf).replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/valueOf|for [^\]]+/g, ".+?") + "$");
                var ceil = Math.ceil,
                    clearTimeout = context.clearTimeout,
                    concat = arrayRef.concat,
                    floor = Math.floor,
                    fnToString = Function.prototype.toString,
                    getPrototypeOf = reNative.test(getPrototypeOf = Object.getPrototypeOf) && getPrototypeOf,
                    hasOwnProperty = objectProto.hasOwnProperty,
                    push = arrayRef.push,
                    propertyIsEnumerable = objectProto.propertyIsEnumerable,
                    setImmediate = context.setImmediate,
                    setTimeout = context.setTimeout,
                    toString = objectProto.toString;
                var nativeBind = reNative.test(nativeBind = toString.bind) && nativeBind,
                    nativeCreate = reNative.test(nativeCreate = Object.create) && nativeCreate,
                    nativeIsArray = reNative.test(nativeIsArray = Array.isArray) && nativeIsArray,
                    nativeIsFinite = context.isFinite,
                    nativeIsNaN = context.isNaN,
                    nativeKeys = reNative.test(nativeKeys = Object.keys) && nativeKeys,
                    nativeMax = Math.max,
                    nativeMin = Math.min,
                    nativeParseInt = context.parseInt,
                    nativeRandom = Math.random,
                    nativeSlice = arrayRef.slice;
                var isIeOpera = reNative.test(context.attachEvent),
                    isV8 = nativeBind && !/\n|true/.test(nativeBind + isIeOpera);
                var ctorByClass = {};
                ctorByClass[arrayClass] = Array;
                ctorByClass[boolClass] = Boolean;
                ctorByClass[dateClass] = Date;
                ctorByClass[funcClass] = Function;
                ctorByClass[objectClass] = Object;
                ctorByClass[numberClass] = Number;
                ctorByClass[regexpClass] = RegExp;
                ctorByClass[stringClass] = String;

                function lodash(value) {
                    return value && typeof value == "object" && !isArray(value) && hasOwnProperty.call(value, "__wrapped__") ? value : new lodashWrapper(value)
                }

                function lodashWrapper(value) {
                    this.__wrapped__ = value
                }
                lodashWrapper.prototype = lodash.prototype;
                var support = lodash.support = {};
                support.fastBind = nativeBind && !isV8;
                lodash.templateSettings = {
                    escape: /<%-([\s\S]+?)%>/g,
                    evaluate: /<%([\s\S]+?)%>/g,
                    interpolate: reInterpolate,
                    variable: "",
                    imports: {
                        _: lodash
                    }
                };

                function createBound(func, thisArg, partialArgs, indicator) {
                    var isFunc = isFunction(func),
                        isPartial = !partialArgs,
                        key = thisArg;
                    if (isPartial) {
                        var rightIndicator = indicator;
                        partialArgs = thisArg
                    } else if (!isFunc) {
                        if (!indicator) {
                            throw new TypeError
                        }
                        thisArg = func
                    }

                    function bound() {
                        var args = arguments,
                            thisBinding = isPartial ? this : thisArg;
                        if (!isFunc) {
                            func = thisArg[key]
                        }
                        if (partialArgs.length) {
                            args = args.length ? (args = nativeSlice.call(args), rightIndicator ? args.concat(partialArgs) : partialArgs.concat(args)) : partialArgs
                        }
                        if (this instanceof bound) {
                            thisBinding = createObject(func.prototype);
                            var result = func.apply(thisBinding, args);
                            return isObject(result) ? result : thisBinding
                        }
                        return func.apply(thisBinding, args)
                    }
                    return bound
                }

                function createObject(prototype) {
                    return isObject(prototype) ? nativeCreate(prototype) : {}
                }

                function escapeHtmlChar(match) {
                    return htmlEscapes[match]
                }

                function getIndexOf(array, value, fromIndex) {
                    var result = (result = lodash.indexOf) === indexOf ? basicIndexOf : result;
                    return result
                }

                function overloadWrapper(func) {
                    return function(array, flag, callback, thisArg) {
                        if (typeof flag != "boolean" && flag != null) {
                            thisArg = callback;
                            callback = !(thisArg && thisArg[flag] === array) ? flag : undefined;
                            flag = false
                        }
                        if (callback != null) {
                            callback = lodash.createCallback(callback, thisArg)
                        }
                        return func(array, flag, callback, thisArg)
                    }
                }

                function shimIsPlainObject(value) {
                    var ctor, result;
                    if (!(value && toString.call(value) == objectClass) || (ctor = value.constructor, isFunction(ctor) && !(ctor instanceof ctor))) {
                        return false
                    }
                    forIn(value, function(value, key) {
                        result = key
                    });
                    return result === undefined || hasOwnProperty.call(value, result)
                }

                function unescapeHtmlChar(match) {
                    return htmlUnescapes[match]
                }

                function isArguments(value) {
                    return toString.call(value) == argsClass
                }
                var isArray = nativeIsArray;
                var shimKeys = function(object) {
                    var index, iterable = object,
                        result = [];
                    if (!iterable) return result;
                    if (!objectTypes[typeof object]) return result;
                    for (index in iterable) {
                        if (hasOwnProperty.call(iterable, index)) {
                            result.push(index)
                        }
                    }
                    return result
                };
                var keys = !nativeKeys ? shimKeys : function(object) {
                    if (!isObject(object)) {
                        return []
                    }
                    return nativeKeys(object)
                };
                var htmlEscapes = {
                    "&": "&amp;",
                    "<": "&lt;",
                    ">": "&gt;",
                    '"': "&quot;",
                    "'": "&#39;"
                };
                var htmlUnescapes = invert(htmlEscapes);
                var assign = function(object, source, guard) {
                    var index, iterable = object,
                        result = iterable;
                    if (!iterable) return result;
                    var args = arguments,
                        argsIndex = 0,
                        argsLength = typeof guard == "number" ? 2 : args.length;
                    if (argsLength > 3 && typeof args[argsLength - 2] == "function") {
                        var callback = lodash.createCallback(args[--argsLength - 1], args[argsLength--], 2)
                    } else if (argsLength > 2 && typeof args[argsLength - 1] == "function") {
                        callback = args[--argsLength]
                    }
                    while (++argsIndex < argsLength) {
                        iterable = args[argsIndex];
                        if (iterable && objectTypes[typeof iterable]) {
                            var ownIndex = -1,
                                ownProps = objectTypes[typeof iterable] && keys(iterable),
                                length = ownProps ? ownProps.length : 0;
                            while (++ownIndex < length) {
                                index = ownProps[ownIndex];
                                result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]
                            }
                        }
                    }
                    return result
                };

                function clone(value, deep, callback, thisArg, stackA, stackB) {
                    var result = value;
                    if (typeof deep != "boolean" && deep != null) {
                        thisArg = callback;
                        callback = deep;
                        deep = false
                    }
                    if (typeof callback == "function") {
                        callback = typeof thisArg == "undefined" ? callback : lodash.createCallback(callback, thisArg, 1);
                        result = callback(result);
                        if (typeof result != "undefined") {
                            return result
                        }
                        result = value
                    }
                    var isObj = isObject(result);
                    if (isObj) {
                        var className = toString.call(result);
                        if (!cloneableClasses[className]) {
                            return result
                        }
                        var isArr = isArray(result)
                    }
                    if (!isObj || !deep) {
                        return isObj ? isArr ? slice(result) : assign({}, result) : result
                    }
                    var ctor = ctorByClass[className];
                    switch (className) {
                        case boolClass:
                        case dateClass:
                            return new ctor(+result);
                        case numberClass:
                        case stringClass:
                            return new ctor(result);
                        case regexpClass:
                            return ctor(result.source, reFlags.exec(result))
                    }
                    var initedStack = !stackA;
                    stackA || (stackA = getArray());
                    stackB || (stackB = getArray());
                    var length = stackA.length;
                    while (length--) {
                        if (stackA[length] == value) {
                            return stackB[length]
                        }
                    }
                    result = isArr ? ctor(result.length) : {};
                    if (isArr) {
                        if (hasOwnProperty.call(value, "index")) {
                            result.index = value.index
                        }
                        if (hasOwnProperty.call(value, "input")) {
                            result.input = value.input
                        }
                    }
                    stackA.push(value);
                    stackB.push(result);
                    (isArr ? forEach : forOwn)(value, function(objValue, key) {
                        result[key] = clone(objValue, deep, callback, undefined, stackA, stackB)
                    });
                    if (initedStack) {
                        releaseArray(stackA);
                        releaseArray(stackB)
                    }
                    return result
                }

                function cloneDeep(value, callback, thisArg) {
                    return clone(value, true, callback, thisArg)
                }
                var defaults = function(object, source, guard) {
                    var index, iterable = object,
                        result = iterable;
                    if (!iterable) return result;
                    var args = arguments,
                        argsIndex = 0,
                        argsLength = typeof guard == "number" ? 2 : args.length;
                    while (++argsIndex < argsLength) {
                        iterable = args[argsIndex];
                        if (iterable && objectTypes[typeof iterable]) {
                            var ownIndex = -1,
                                ownProps = objectTypes[typeof iterable] && keys(iterable),
                                length = ownProps ? ownProps.length : 0;
                            while (++ownIndex < length) {
                                index = ownProps[ownIndex];
                                if (typeof result[index] == "undefined") result[index] = iterable[index]
                            }
                        }
                    }
                    return result
                };

                function findKey(object, callback, thisArg) {
                    var result;
                    callback = lodash.createCallback(callback, thisArg);
                    forOwn(object, function(value, key, object) {
                        if (callback(value, key, object)) {
                            result = key;
                            return false
                        }
                    });
                    return result
                }
                var forIn = function(collection, callback, thisArg) {
                    var index, iterable = collection,
                        result = iterable;
                    if (!iterable) return result;
                    if (!objectTypes[typeof iterable]) return result;
                    callback = callback && typeof thisArg == "undefined" ? callback : lodash.createCallback(callback, thisArg);
                    for (index in iterable) {
                        if (callback(iterable[index], index, collection) === false) return result
                    }
                    return result
                };
                var forOwn = function(collection, callback, thisArg) {
                    var index, iterable = collection,
                        result = iterable;
                    if (!iterable) return result;
                    if (!objectTypes[typeof iterable]) return result;
                    callback = callback && typeof thisArg == "undefined" ? callback : lodash.createCallback(callback, thisArg);
                    var ownIndex = -1,
                        ownProps = objectTypes[typeof iterable] && keys(iterable),
                        length = ownProps ? ownProps.length : 0;
                    while (++ownIndex < length) {
                        index = ownProps[ownIndex];
                        if (callback(iterable[index], index, collection) === false) return result
                    }
                    return result
                };

                function functions(object) {
                    var result = [];
                    forIn(object, function(value, key) {
                        if (isFunction(value)) {
                            result.push(key)
                        }
                    });
                    return result.sort()
                }

                function has(object, property) {
                    return object ? hasOwnProperty.call(object, property) : false
                }

                function invert(object) {
                    var index = -1,
                        props = keys(object),
                        length = props.length,
                        result = {};
                    while (++index < length) {
                        var key = props[index];
                        result[object[key]] = key
                    }
                    return result
                }

                function isBoolean(value) {
                    return value === true || value === false || toString.call(value) == boolClass
                }

                function isDate(value) {
                    return value ? typeof value == "object" && toString.call(value) == dateClass : false
                }

                function isElement(value) {
                    return value ? value.nodeType === 1 : false
                }

                function isEmpty(value) {
                    var result = true;
                    if (!value) {
                        return result
                    }
                    var className = toString.call(value),
                        length = value.length;
                    if (className == arrayClass || className == stringClass || className == argsClass || className == objectClass && typeof length == "number" && isFunction(value.splice)) {
                        return !length
                    }
                    forOwn(value, function() {
                        return result = false
                    });
                    return result
                }

                function isEqual(a, b, callback, thisArg, stackA, stackB) {
                    var whereIndicator = callback === indicatorObject;
                    if (typeof callback == "function" && !whereIndicator) {
                        callback = lodash.createCallback(callback, thisArg, 2);
                        var result = callback(a, b);
                        if (typeof result != "undefined") {
                            return !!result
                        }
                    }
                    if (a === b) {
                        return a !== 0 || 1 / a == 1 / b
                    }
                    var type = typeof a,
                        otherType = typeof b;
                    if (a === a && (!a || type != "function" && type != "object") && (!b || otherType != "function" && otherType != "object")) {
                        return false
                    }
                    if (a == null || b == null) {
                        return a === b
                    }
                    var className = toString.call(a),
                        otherClass = toString.call(b);
                    if (className == argsClass) {
                        className = objectClass
                    }
                    if (otherClass == argsClass) {
                        otherClass = objectClass
                    }
                    if (className != otherClass) {
                        return false
                    }
                    switch (className) {
                        case boolClass:
                        case dateClass:
                            return +a == +b;
                        case numberClass:
                            return a != +a ? b != +b : a == 0 ? 1 / a == 1 / b : a == +b;
                        case regexpClass:
                        case stringClass:
                            return a == String(b)
                    }
                    var isArr = className == arrayClass;
                    if (!isArr) {
                        if (hasOwnProperty.call(a, "__wrapped__ ") || hasOwnProperty.call(b, "__wrapped__")) {
                            return isEqual(a.__wrapped__ || a, b.__wrapped__ || b, callback, thisArg, stackA, stackB)
                        }
                        if (className != objectClass) {
                            return false
                        }
                        var ctorA = a.constructor,
                            ctorB = b.constructor;
                        if (ctorA != ctorB && !(isFunction(ctorA) && ctorA instanceof ctorA && isFunction(ctorB) && ctorB instanceof ctorB)) {
                            return false
                        }
                    }
                    var initedStack = !stackA;
                    stackA || (stackA = getArray());
                    stackB || (stackB = getArray());
                    var length = stackA.length;
                    while (length--) {
                        if (stackA[length] == a) {
                            return stackB[length] == b
                        }
                    }
                    var size = 0;
                    result = true;
                    stackA.push(a);
                    stackB.push(b);
                    if (isArr) {
                        length = a.length;
                        size = b.length;
                        result = size == a.length;
                        if (!result && !whereIndicator) {
                            return result
                        }
                        while (size--) {
                            var index = length,
                                value = b[size];
                            if (whereIndicator) {
                                while (index--) {
                                    if (result = isEqual(a[index], value, callback, thisArg, stackA, stackB)) {
                                        break
                                    }
                                }
                            } else if (!(result = isEqual(a[size], value, callback, thisArg, stackA, stackB))) {
                                break
                            }
                        }
                        return result
                    }
                    forIn(b, function(value, key, b) {
                        if (hasOwnProperty.call(b, key)) {
                            size++;
                            return result = hasOwnProperty.call(a, key) && isEqual(a[key], value, callback, thisArg, stackA, stackB)
                        }
                    });
                    if (result && !whereIndicator) {
                        forIn(a, function(value, key, a) {
                            if (hasOwnProperty.call(a, key)) {
                                return result = --size > -1
                            }
                        })
                    }
                    if (initedStack) {
                        releaseArray(stackA);
                        releaseArray(stackB)
                    }
                    return result
                }

                function isFinite(value) {
                    return nativeIsFinite(value) && !nativeIsNaN(parseFloat(value))
                }

                function isFunction(value) {
                    return typeof value == "function"
                }

                function isObject(value) {
                    return !!(value && objectTypes[typeof value])
                }

                function isNaN(value) {
                    return isNumber(value) && value != +value
                }

                function isNull(value) {
                    return value === null
                }

                function isNumber(value) {
                    return typeof value == "number" || toString.call(value) == numberClass
                }
                var isPlainObject = function(value) {
                    if (!(value && toString.call(value) == objectClass)) {
                        return false
                    }
                    var valueOf = value.valueOf,
                        objProto = typeof valueOf == "function" && (objProto = getPrototypeOf(valueOf)) && getPrototypeOf(objProto);
                    return objProto ? value == objProto || getPrototypeOf(value) == objProto : shimIsPlainObject(value)
                };

                function isRegExp(value) {
                    return value ? typeof value == "object" && toString.call(value) == regexpClass : false
                }

                function isString(value) {
                    return typeof value == "string" || toString.call(value) == stringClass
                }

                function isUndefined(value) {
                    return typeof value == "undefined"
                }

                function merge(object, source, deepIndicator) {
                    var args = arguments,
                        index = 0,
                        length = 2;
                    if (!isObject(object)) {
                        return object
                    }
                    if (deepIndicator === indicatorObject) {
                        var callback = args[3],
                            stackA = args[4],
                            stackB = args[5]
                    } else {
                        var initedStack = true;
                        stackA = getArray();
                        stackB = getArray();
                        if (typeof deepIndicator != "number") {
                            length = args.length
                        }
                        if (length > 3 && typeof args[length - 2] == "function") {
                            callback = lodash.createCallback(args[--length - 1], args[length--], 2)
                        } else if (length > 2 && typeof args[length - 1] == "function") {
                            callback = args[--length]
                        }
                    }
                    while (++index < length) {
                        (isArray(args[index]) ? forEach : forOwn)(args[index], function(source, key) {
                            var found, isArr, result = source,
                                value = object[key];
                            if (source && ((isArr = isArray(source)) || isPlainObject(source))) {
                                var stackLength = stackA.length;
                                while (stackLength--) {
                                    if (found = stackA[stackLength] == source) {
                                        value = stackB[stackLength];
                                        break
                                    }
                                }
                                if (!found) {
                                    var isShallow;
                                    if (callback) {
                                        result = callback(value, source);
                                        if (isShallow = typeof result != "undefined") {
                                            value = result
                                        }
                                    }
                                    if (!isShallow) {
                                        value = isArr ? isArray(value) ? value : [] : isPlainObject(value) ? value : {}
                                    }
                                    stackA.push(source);
                                    stackB.push(value);
                                    if (!isShallow) {
                                        value = merge(value, source, indicatorObject, callback, stackA, stackB)
                                    }
                                }
                            } else {
                                if (callback) {
                                    result = callback(value, source);
                                    if (typeof result == "undefined") {
                                        result = source
                                    }
                                }
                                if (typeof result != "undefined") {
                                    value = result
                                }
                            }
                            object[key] = value
                        })
                    }
                    if (initedStack) {
                        releaseArray(stackA);
                        releaseArray(stackB)
                    }
                    return object
                }

                function omit(object, callback, thisArg) {
                    var indexOf = getIndexOf(),
                        isFunc = typeof callback == "function",
                        result = {};
                    if (isFunc) {
                        callback = lodash.createCallback(callback, thisArg)
                    } else {
                        var props = concat.apply(arrayRef, nativeSlice.call(arguments, 1))
                    }
                    forIn(object, function(value, key, object) {
                        if (isFunc ? !callback(value, key, object) : indexOf(props, key) < 0) {
                            result[key] = value
                        }
                    });
                    return result
                }

                function pairs(object) {
                    var index = -1,
                        props = keys(object),
                        length = props.length,
                        result = Array(length);
                    while (++index < length) {
                        var key = props[index];
                        result[index] = [key, object[key]]
                    }
                    return result
                }

                function pick(object, callback, thisArg) {
                    var result = {};
                    if (typeof callback != "function") {
                        var index = -1,
                            props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
                            length = isObject(object) ? props.length : 0;
                        while (++index < length) {
                            var key = props[index];
                            if (key in object) {
                                result[key] = object[key]
                            }
                        }
                    } else {
                        callback = lodash.createCallback(callback, thisArg);
                        forIn(object, function(value, key, object) {
                            if (callback(value, key, object)) {
                                result[key] = value
                            }
                        })
                    }
                    return result
                }

                function transform(object, callback, accumulator, thisArg) {
                    var isArr = isArray(object);
                    callback = lodash.createCallback(callback, thisArg, 4);
                    if (accumulator == null) {
                        if (isArr) {
                            accumulator = []
                        } else {
                            var ctor = object && object.constructor,
                                proto = ctor && ctor.prototype;
                            accumulator = createObject(proto)
                        }
                    }(isArr ? forEach : forOwn)(object, function(value, index, object) {
                        return callback(accumulator, value, index, object)
                    });
                    return accumulator
                }

                function values(object) {
                    var index = -1,
                        props = keys(object),
                        length = props.length,
                        result = Array(length);
                    while (++index < length) {
                        result[index] = object[props[index]]
                    }
                    return result
                }

                function at(collection) {
                    var index = -1,
                        props = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
                        length = props.length,
                        result = Array(length);
                    while (++index < length) {
                        result[index] = collection[props[index]]
                    }
                    return result
                }

                function contains(collection, target, fromIndex) {
                    var index = -1,
                        indexOf = getIndexOf(),
                        length = collection ? collection.length : 0,
                        result = false;
                    fromIndex = (fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex) || 0;
                    if (length && typeof length == "number") {
                        result = (isString(collection) ? collection.indexOf(target, fromIndex) : indexOf(collection, target, fromIndex)) > -1
                    } else {
                        forOwn(collection, function(value) {
                            if (++index >= fromIndex) {
                                return !(result = value === target)
                            }
                        })
                    }
                    return result
                }

                function countBy(collection, callback, thisArg) {
                    var result = {};
                    callback = lodash.createCallback(callback, thisArg);
                    forEach(collection, function(value, key, collection) {
                        key = String(callback(value, key, collection));
                        hasOwnProperty.call(result, key) ? result[key]++ : result[key] = 1
                    });
                    return result
                }

                function every(collection, callback, thisArg) {
                    var result = true;
                    callback = lodash.createCallback(callback, thisArg);
                    var index = -1,
                        length = collection ? collection.length : 0;
                    if (typeof length == "number") {
                        while (++index < length) {
                            if (!(result = !!callback(collection[index], index, collection))) {
                                break
                            }
                        }
                    } else {
                        forOwn(collection, function(value, index, collection) {
                            return result = !!callback(value, index, collection)
                        })
                    }
                    return result
                }

                function filter(collection, callback, thisArg) {
                    var result = [];
                    callback = lodash.createCallback(callback, thisArg);
                    var index = -1,
                        length = collection ? collection.length : 0;
                    if (typeof length == "number") {
                        while (++index < length) {
                            var value = collection[index];
                            if (callback(value, index, collection)) {
                                result.push(value)
                            }
                        }
                    } else {
                        forOwn(collection, function(value, index, collection) {
                            if (callback(value, index, collection)) {
                                result.push(value)
                            }
                        })
                    }
                    return result
                }

                function find(collection, callback, thisArg) {
                    callback = lodash.createCallback(callback, thisArg);
                    var index = -1,
                        length = collection ? collection.length : 0;
                    if (typeof length == "number") {
                        while (++index < length) {
                            var value = collection[index];
                            if (callback(value, index, collection)) {
                                return value
                            }
                        }
                    } else {
                        var result;
                        forOwn(collection, function(value, index, collection) {
                            if (callback(value, index, collection)) {
                                result = value;
                                return false
                            }
                        });
                        return result
                    }
                }

                function forEach(collection, callback, thisArg) {
                    var index = -1,
                        length = collection ? collection.length : 0;
                    callback = callback && typeof thisArg == "undefined" ? callback : lodash.createCallback(callback, thisArg);
                    if (typeof length == "number") {
                        while (++index < length) {
                            if (callback(collection[index], index, collection) === false) {
                                break
                            }
                        }
                    } else {
                        forOwn(collection, callback)
                    }
                    return collection
                }

                function groupBy(collection, callback, thisArg) {
                    var result = {};
                    callback = lodash.createCallback(callback, thisArg);
                    forEach(collection, function(value, key, collection) {
                        key = String(callback(value, key, collection));
                        (hasOwnProperty.call(result, key) ? result[key] : result[key] = []).push(value)
                    });
                    return result
                }

                function invoke(collection, methodName) {
                    var args = nativeSlice.call(arguments, 2),
                        index = -1,
                        isFunc = typeof methodName == "function",
                        length = collection ? collection.length : 0,
                        result = Array(typeof length == "number" ? length : 0);
                    forEach(collection, function(value) {
                        result[++index] = (isFunc ? methodName : value[methodName]).apply(value, args)
                    });
                    return result
                }

                function map(collection, callback, thisArg) {
                    var index = -1,
                        length = collection ? collection.length : 0;
                    callback = lodash.createCallback(callback, thisArg);
                    if (typeof length == "number") {
                        var result = Array(length);
                        while (++index < length) {
                            result[index] = callback(collection[index], index, collection)
                        }
                    } else {
                        result = [];
                        forOwn(collection, function(value, key, collection) {
                            result[++index] = callback(value, key, collection)
                        })
                    }
                    return result
                }

                function max(collection, callback, thisArg) {
                    var computed = -Infinity,
                        result = computed;
                    if (!callback && isArray(collection)) {
                        var index = -1,
                            length = collection.length;
                        while (++index < length) {
                            var value = collection[index];
                            if (value > result) {
                                result = value
                            }
                        }
                    } else {
                        callback = !callback && isString(collection) ? charAtCallback : lodash.createCallback(callback, thisArg);
                        forEach(collection, function(value, index, collection) {
                            var current = callback(value, index, collection);
                            if (current > computed) {
                                computed = current;
                                result = value
                            }
                        })
                    }
                    return result
                }

                function min(collection, callback, thisArg) {
                    var computed = Infinity,
                        result = computed;
                    if (!callback && isArray(collection)) {
                        var index = -1,
                            length = collection.length;
                        while (++index < length) {
                            var value = collection[index];
                            if (value < result) {
                                result = value
                            }
                        }
                    } else {
                        callback = !callback && isString(collection) ? charAtCallback : lodash.createCallback(callback, thisArg);
                        forEach(collection, function(value, index, collection) {
                            var current = callback(value, index, collection);
                            if (current < computed) {
                                computed = current;
                                result = value
                            }
                        })
                    }
                    return result
                }

                function pluck(collection, property) {
                    var index = -1,
                        length = collection ? collection.length : 0;
                    if (typeof length == "number") {
                        var result = Array(length);
                        while (++index < length) {
                            result[index] = collection[index][property]
                        }
                    }
                    return result || map(collection, property)
                }

                function reduce(collection, callback, accumulator, thisArg) {
                    if (!collection) return accumulator;
                    var noaccum = arguments.length < 3;
                    callback = lodash.createCallback(callback, thisArg, 4);
                    var index = -1,
                        length = collection.length;
                    if (typeof length == "number") {
                        if (noaccum) {
                            accumulator = collection[++index]
                        }
                        while (++index < length) {
                            accumulator = callback(accumulator, collection[index], index, collection)
                        }
                    } else {
                        forOwn(collection, function(value, index, collection) {
                            accumulator = noaccum ? (noaccum = false, value) : callback(accumulator, value, index, collection)
                        })
                    }
                    return accumulator
                }

                function reduceRight(collection, callback, accumulator, thisArg) {
                    var iterable = collection,
                        length = collection ? collection.length : 0,
                        noaccum = arguments.length < 3;
                    if (typeof length != "number") {
                        var props = keys(collection);
                        length = props.length
                    }
                    callback = lodash.createCallback(callback, thisArg, 4);
                    forEach(collection, function(value, index, collection) {
                        index = props ? props[--length] : --length;
                        accumulator = noaccum ? (noaccum = false, iterable[index]) : callback(accumulator, iterable[index], index, collection)
                    });
                    return accumulator
                }

                function reject(collection, callback, thisArg) {
                    callback = lodash.createCallback(callback, thisArg);
                    return filter(collection, function(value, index, collection) {
                        return !callback(value, index, collection)
                    })
                }

                function shuffle(collection) {
                    var index = -1,
                        length = collection ? collection.length : 0,
                        result = Array(typeof length == "number" ? length : 0);
                    forEach(collection, function(value) {
                        var rand = floor(nativeRandom() * (++index + 1));
                        result[index] = result[rand];
                        result[rand] = value
                    });
                    return result
                }

                function size(collection) {
                    var length = collection ? collection.length : 0;
                    return typeof length == "number" ? length : keys(collection).length
                }

                function some(collection, callback, thisArg) {
                    var result;
                    callback = lodash.createCallback(callback, thisArg);
                    var index = -1,
                        length = collection ? collection.length : 0;
                    if (typeof length == "number") {
                        while (++index < length) {
                            if (result = callback(collection[index], index, collection)) {
                                break
                            }
                        }
                    } else {
                        forOwn(collection, function(value, index, collection) {
                            return !(result = callback(value, index, collection))
                        })
                    }
                    return !!result
                }

                function sortBy(collection, callback, thisArg) {
                    var index = -1,
                        length = collection ? collection.length : 0,
                        result = Array(typeof length == "number" ? length : 0);
                    callback = lodash.createCallback(callback, thisArg);
                    forEach(collection, function(value, key, collection) {
                        var object = result[++index] = getObject();
                        object.criteria = callback(value, key, collection);
                        object.index = index;
                        object.value = value
                    });
                    length = result.length;
                    result.sort(compareAscending);
                    while (length--) {
                        var object = result[length];
                        result[length] = object.value;
                        releaseObject(object)
                    }
                    return result
                }

                function toArray(collection) {
                    if (collection && typeof collection.length == "number") {
                        return slice(collection)
                    }
                    return values(collection)
                }
                var where = filter;

                function compact(array) {
                    var index = -1,
                        length = array ? array.length : 0,
                        result = [];
                    while (++index < length) {
                        var value = array[index];
                        if (value) {
                            result.push(value)
                        }
                    }
                    return result
                }

                function difference(array) {
                    var index = -1,
                        indexOf = getIndexOf(),
                        length = array ? array.length : 0,
                        seen = concat.apply(arrayRef, nativeSlice.call(arguments, 1)),
                        result = [];
                    var isLarge = length >= largeArraySize && indexOf === basicIndexOf;
                    if (isLarge) {
                        var cache = createCache(seen);
                        if (cache) {
                            indexOf = cacheIndexOf;
                            seen = cache
                        } else {
                            isLarge = false
                        }
                    }
                    while (++index < length) {
                        var value = array[index];
                        if (indexOf(seen, value) < 0) {
                            result.push(value)
                        }
                    }
                    if (isLarge) {
                        releaseObject(seen)
                    }
                    return result
                }

                function findIndex(array, callback, thisArg) {
                    var index = -1,
                        length = array ? array.length : 0;
                    callback = lodash.createCallback(callback, thisArg);
                    while (++index < length) {
                        if (callback(array[index], index, array)) {
                            return index
                        }
                    }
                    return -1
                }

                function first(array, callback, thisArg) {
                    if (array) {
                        var n = 0,
                            length = array.length;
                        if (typeof callback != "number" && callback != null) {
                            var index = -1;
                            callback = lodash.createCallback(callback, thisArg);
                            while (++index < length && callback(array[index], index, array)) {
                                n++
                            }
                        } else {
                            n = callback;
                            if (n == null || thisArg) {
                                return array[0]
                            }
                        }
                        return slice(array, 0, nativeMin(nativeMax(0, n), length))
                    }
                }
                var flatten = overloadWrapper(function flatten(array, isShallow, callback) {
                    var index = -1,
                        length = array ? array.length : 0,
                        result = [];
                    while (++index < length) {
                        var value = array[index];
                        if (callback) {
                            value = callback(value, index, array)
                        }
                        if (isArray(value)) {
                            push.apply(result, isShallow ? value : flatten(value))
                        } else {
                            result.push(value)
                        }
                    }
                    return result
                });

                function indexOf(array, value, fromIndex) {
                    if (typeof fromIndex == "number") {
                        var length = array ? array.length : 0;
                        fromIndex = fromIndex < 0 ? nativeMax(0, length + fromIndex) : fromIndex || 0
                    } else if (fromIndex) {
                        var index = sortedIndex(array, value);
                        return array[index] === value ? index : -1
                    }
                    return array ? basicIndexOf(array, value, fromIndex) : -1
                }

                function initial(array, callback, thisArg) {
                    if (!array) {
                        return []
                    }
                    var n = 0,
                        length = array.length;
                    if (typeof callback != "number" && callback != null) {
                        var index = length;
                        callback = lodash.createCallback(callback, thisArg);
                        while (index-- && callback(array[index], index, array)) {
                            n++
                        }
                    } else {
                        n = callback == null || thisArg ? 1 : callback || n
                    }
                    return slice(array, 0, nativeMin(nativeMax(0, length - n), length))
                }

                function intersection(array) {
                    var args = arguments,
                        argsLength = args.length,
                        argsIndex = -1,
                        caches = getArray(),
                        index = -1,
                        indexOf = getIndexOf(),
                        length = array ? array.length : 0,
                        result = [],
                        seen = getArray();
                    while (++argsIndex < argsLength) {
                        var value = args[argsIndex];
                        caches[argsIndex] = indexOf === basicIndexOf && (value ? value.length : 0) >= largeArraySize && createCache(argsIndex ? args[argsIndex] : seen)
                    }
                    outer: while (++index < length) {
                        var cache = caches[0];
                        value = array[index];
                        if ((cache ? cacheIndexOf(cache, value) : indexOf(seen, value)) < 0) {
                            argsIndex = argsLength;
                            (cache || seen).push(value);
                            while (--argsIndex) {
                                cache = caches[argsIndex];
                                if ((cache ? cacheIndexOf(cache, value) : indexOf(args[argsIndex], value)) < 0) {
                                    continue outer
                                }
                            }
                            result.push(value)
                        }
                    }
                    while (argsLength--) {
                        cache = caches[argsLength];
                        if (cache) {
                            releaseObject(cache)
                        }
                    }
                    releaseArray(caches);
                    releaseArray(seen);
                    return result
                }

                function last(array, callback, thisArg) {
                    if (array) {
                        var n = 0,
                            length = array.length;
                        if (typeof callback != "number" && callback != null) {
                            var index = length;
                            callback = lodash.createCallback(callback, thisArg);
                            while (index-- && callback(array[index], index, array)) {
                                n++
                            }
                        } else {
                            n = callback;
                            if (n == null || thisArg) {
                                return array[length - 1]
                            }
                        }
                        return slice(array, nativeMax(0, length - n))
                    }
                }

                function lastIndexOf(array, value, fromIndex) {
                    var index = array ? array.length : 0;
                    if (typeof fromIndex == "number") {
                        index = (fromIndex < 0 ? nativeMax(0, index + fromIndex) : nativeMin(fromIndex, index - 1)) + 1
                    }
                    while (index--) {
                        if (array[index] === value) {
                            return index
                        }
                    }
                    return -1
                }

                function range(start, end, step) {
                    start = +start || 0;
                    step = +step || 1;
                    if (end == null) {
                        end = start;
                        start = 0
                    }
                    var index = -1,
                        length = nativeMax(0, ceil((end - start) / step)),
                        result = Array(length);
                    while (++index < length) {
                        result[index] = start;
                        start += step
                    }
                    return result
                }

                function rest(array, callback, thisArg) {
                    if (typeof callback != "number" && callback != null) {
                        var n = 0,
                            index = -1,
                            length = array ? array.length : 0;
                        callback = lodash.createCallback(callback, thisArg);
                        while (++index < length && callback(array[index], index, array)) {
                            n++
                        }
                    } else {
                        n = callback == null || thisArg ? 1 : nativeMax(0, callback)
                    }
                    return slice(array, n)
                }

                function sortedIndex(array, value, callback, thisArg) {
                    var low = 0,
                        high = array ? array.length : low;
                    callback = callback ? lodash.createCallback(callback, thisArg, 1) : identity;
                    value = callback(value);
                    while (low < high) {
                        var mid = low + high >>> 1;
                        callback(array[mid]) < value ? low = mid + 1 : high = mid
                    }
                    return low
                }

                function union(array) {
                    if (!isArray(array)) {
                        arguments[0] = array ? nativeSlice.call(array) : arrayRef
                    }
                    return uniq(concat.apply(arrayRef, arguments))
                }
                var uniq = overloadWrapper(function(array, isSorted, callback) {
                    var index = -1,
                        indexOf = getIndexOf(),
                        length = array ? array.length : 0,
                        result = [];
                    var isLarge = !isSorted && length >= largeArraySize && indexOf === basicIndexOf,
                        seen = callback || isLarge ? getArray() : result;
                    if (isLarge) {
                        var cache = createCache(seen);
                        if (cache) {
                            indexOf = cacheIndexOf;
                            seen = cache
                        } else {
                            isLarge = false;
                            seen = callback ? seen : (releaseArray(seen), result)
                        }
                    }
                    while (++index < length) {
                        var value = array[index],
                            computed = callback ? callback(value, index, array) : value;
                        if (isSorted ? !index || seen[seen.length - 1] !== computed : indexOf(seen, computed) < 0) {
                            if (callback || isLarge) {
                                seen.push(computed)
                            }
                            result.push(value)
                        }
                    }
                    if (isLarge) {
                        releaseArray(seen.array);
                        releaseObject(seen)
                    } else if (callback) {
                        releaseArray(seen)
                    }
                    return result
                });

                function unzip(array) {
                    var index = -1,
                        length = array ? max(pluck(array, "length")) : 0,
                        result = Array(length < 0 ? 0 : length);
                    while (++index < length) {
                        result[index] = pluck(array, index)
                    }
                    return result
                }

                function without(array) {
                    return difference(array, nativeSlice.call(arguments, 1))
                }

                function zip(array) {
                    return array ? unzip(arguments) : []
                }

                function zipObject(keys, values) {
                    var index = -1,
                        length = keys ? keys.length : 0,
                        result = {};
                    while (++index < length) {
                        var key = keys[index];
                        if (values) {
                            result[key] = values[index]
                        } else {
                            result[key[0]] = key[1]
                        }
                    }
                    return result
                }

                function after(n, func) {
                    if (n < 1) {
                        return func()
                    }
                    return function() {
                        if (--n < 1) {
                            return func.apply(this, arguments)
                        }
                    }
                }

                function bind(func, thisArg) {
                    return support.fastBind || nativeBind && arguments.length > 2 ? nativeBind.call.apply(nativeBind, arguments) : createBound(func, thisArg, nativeSlice.call(arguments, 2))
                }

                function bindAll(object) {
                    var funcs = arguments.length > 1 ? concat.apply(arrayRef, nativeSlice.call(arguments, 1)) : functions(object),
                        index = -1,
                        length = funcs.length;
                    while (++index < length) {
                        var key = funcs[index];
                        object[key] = bind(object[key], object)
                    }
                    return object
                }

                function bindKey(object, key) {
                    return createBound(object, key, nativeSlice.call(arguments, 2), indicatorObject)
                }

                function compose() {
                    var funcs = arguments;
                    return function() {
                        var args = arguments,
                            length = funcs.length;
                        while (length--) {
                            args = [funcs[length].apply(this, args)]
                        }
                        return args[0]
                    }
                }

                function createCallback(func, thisArg, argCount) {
                    if (func == null) {
                        return identity
                    }
                    var type = typeof func;
                    if (type != "function") {
                        if (type != "object") {
                            return function(object) {
                                return object[func]
                            }
                        }
                        var props = keys(func);
                        return function(object) {
                            var length = props.length,
                                result = false;
                            while (length--) {
                                if (!(result = isEqual(object[props[length]], func[props[length]], indicatorObject))) {
                                    break
                                }
                            }
                            return result
                        }
                    }
                    if (typeof thisArg == "undefined" || reThis && !reThis.test(fnToString.call(func))) {
                        return func
                    }
                    if (argCount === 1) {
                        return function(value) {
                            return func.call(thisArg, value)
                        }
                    }
                    if (argCount === 2) {
                        return function(a, b) {
                            return func.call(thisArg, a, b)
                        }
                    }
                    if (argCount === 4) {
                        return function(accumulator, value, index, collection) {
                            return func.call(thisArg, accumulator, value, index, collection)
                        }
                    }
                    return function(value, index, collection) {
                        return func.call(thisArg, value, index, collection)
                    }
                }

                function debounce(func, wait, options) {
                    var args, result, thisArg, callCount = 0,
                        lastCalled = 0,
                        maxWait = false,
                        maxTimeoutId = null,
                        timeoutId = null,
                        trailing = true;

                    function clear() {
                        clearTimeout(maxTimeoutId);
                        clearTimeout(timeoutId);
                        callCount = 0;
                        maxTimeoutId = timeoutId = null
                    }

                    function delayed() {
                        var isCalled = trailing && (!leading || callCount > 1);
                        clear();
                        if (isCalled) {
                            if (maxWait !== false) {
                                lastCalled = new Date
                            }
                            result = func.apply(thisArg, args)
                        }
                    }

                    function maxDelayed() {
                        clear();
                        if (trailing || maxWait !== wait) {
                            lastCalled = new Date;
                            result = func.apply(thisArg, args)
                        }
                    }
                    wait = nativeMax(0, wait || 0);
                    if (options === true) {
                        var leading = true;
                        trailing = false
                    } else if (isObject(options)) {
                        leading = options.leading;
                        maxWait = "maxWait" in options && nativeMax(wait, options.maxWait || 0);
                        trailing = "trailing" in options ? options.trailing : trailing
                    }
                    return function() {
                        args = arguments;
                        thisArg = this;
                        callCount++;
                        clearTimeout(timeoutId);
                        if (maxWait === false) {
                            if (leading && callCount < 2) {
                                result = func.apply(thisArg, args)
                            }
                        } else {
                            var now = new Date;
                            if (!maxTimeoutId && !leading) {
                                lastCalled = now
                            }
                            var remaining = maxWait - (now - lastCalled);
                            if (remaining <= 0) {
                                clearTimeout(maxTimeoutId);
                                maxTimeoutId = null;
                                lastCalled = now;
                                result = func.apply(thisArg, args)
                            } else if (!maxTimeoutId) {
                                maxTimeoutId = setTimeout(maxDelayed, remaining)
                            }
                        }
                        if (wait !== maxWait) {
                            timeoutId = setTimeout(delayed, wait)
                        }
                        return result
                    }
                }

                function defer(func) {
                    var args = nativeSlice.call(arguments, 1);
                    return setTimeout(function() {
                        func.apply(undefined, args)
                    }, 1)
                }
                if (isV8 && freeModule && typeof setImmediate == "function") {
                    defer = bind(setImmediate, context)
                }

                function delay(func, wait) {
                    var args = nativeSlice.call(arguments, 2);
                    return setTimeout(function() {
                        func.apply(undefined, args)
                    }, wait)
                }

                function memoize(func, resolver) {
                    function memoized() {
                        var cache = memoized.cache,
                            key = keyPrefix + (resolver ? resolver.apply(this, arguments) : arguments[0]);
                        return hasOwnProperty.call(cache, key) ? cache[key] : cache[key] = func.apply(this, arguments)
                    }
                    memoized.cache = {};
                    return memoized
                }

                function once(func) {
                    var ran, result;
                    return function() {
                        if (ran) {
                            return result
                        }
                        ran = true;
                        result = func.apply(this, arguments);
                        func = null;
                        return result
                    }
                }

                function partial(func) {
                    return createBound(func, nativeSlice.call(arguments, 1))
                }

                function partialRight(func) {
                    return createBound(func, nativeSlice.call(arguments, 1), null, indicatorObject)
                }

                function throttle(func, wait, options) {
                    var leading = true,
                        trailing = true;
                    if (options === false) {
                        leading = false
                    } else if (isObject(options)) {
                        leading = "leading" in options ? options.leading : leading;
                        trailing = "trailing" in options ? options.trailing : trailing
                    }
                    options = getObject();
                    options.leading = leading;
                    options.maxWait = wait;
                    options.trailing = trailing;
                    var result = debounce(func, wait, options);
                    releaseObject(options);
                    return result
                }

                function wrap(value, wrapper) {
                    return function() {
                        var args = [value];
                        push.apply(args, arguments);
                        return wrapper.apply(this, args)
                    }
                }

                function escape(string) {
                    return string == null ? "" : String(string).replace(reUnescapedHtml, escapeHtmlChar)
                }

                function identity(value) {
                    return value
                }

                function mixin(object) {
                    forEach(functions(object), function(methodName) {
                        var func = lodash[methodName] = object[methodName];
                        lodash.prototype[methodName] = function() {
                            var value = this.__wrapped__,
                                args = [value];
                            push.apply(args, arguments);
                            var result = func.apply(lodash, args);
                            return value && typeof value == "object" && value === result ? this : new lodashWrapper(result);
                        }
                    })
                }

                function noConflict() {
                    context._ = oldDash;
                    return this
                }
                var parseInt = nativeParseInt(whitespace + "08") == 8 ? nativeParseInt : function(value, radix) {
                    return nativeParseInt(isString(value) ? value.replace(reLeadingSpacesAndZeros, "") : value, radix || 0)
                };

                function random(min, max) {
                    if (min == null && max == null) {
                        max = 1
                    }
                    min = +min || 0;
                    if (max == null) {
                        max = min;
                        min = 0
                    } else {
                        max = +max || 0
                    }
                    var rand = nativeRandom();
                    return min % 1 || max % 1 ? min + nativeMin(rand * (max - min + parseFloat("1e-" + ((rand + "").length - 1))), max) : min + floor(rand * (max - min + 1))
                }

                function result(object, property) {
                    var value = object ? object[property] : undefined;
                    return isFunction(value) ? object[property]() : value
                }

                function template(text, data, options) {
                    var settings = lodash.templateSettings;
                    text || (text = "");
                    options = defaults({}, options, settings);
                    var imports = defaults({}, options.imports, settings.imports),
                        importsKeys = keys(imports),
                        importsValues = values(imports);
                    var isEvaluating, index = 0,
                        interpolate = options.interpolate || reNoMatch,
                        source = "__p += '";
                    var reDelimiters = RegExp((options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", "g");
                    text.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
                        interpolateValue || (interpolateValue = esTemplateValue);
                        source += text.slice(index, offset).replace(reUnescapedString, escapeStringChar);
                        if (escapeValue) {
                            source += "' +\n__e(" + escapeValue + ") +\n'"
                        }
                        if (evaluateValue) {
                            isEvaluating = true;
                            source += "';\n" + evaluateValue + ";\n__p += '"
                        }
                        if (interpolateValue) {
                            source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"
                        }
                        index = offset + match.length;
                        return match
                    });
                    source += "';\n";
                    var variable = options.variable,
                        hasVariable = variable;
                    if (!hasVariable) {
                        variable = "obj";
                        source = "with (" + variable + ") {\n" + source + "\n}\n"
                    }
                    source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
                    source = "function(" + variable + ") {\n" + (hasVariable ? "" : variable + " || (" + variable + " = {});\n") + "var __t, __p = '', __e = _.escape" + (isEvaluating ? ", __j = Array.prototype.join;\n" + "function print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
                    var sourceURL = "\n/*\n//@ sourceURL=" + (options.sourceURL || "/lodash/template/source[" + templateCounter++ + "]") + "\n*/";
                    try {
                        var result = Function(importsKeys, "return " + source + sourceURL).apply(undefined, importsValues)
                    } catch (e) {
                        e.source = source;
                        throw e
                    }
                    if (data) {
                        return result(data)
                    }
                    result.source = source;
                    return result
                }

                function times(n, callback, thisArg) {
                    n = (n = +n) > -1 ? n : 0;
                    var index = -1,
                        result = Array(n);
                    callback = lodash.createCallback(callback, thisArg, 1);
                    while (++index < n) {
                        result[index] = callback(index)
                    }
                    return result
                }

                function unescape(string) {
                    return string == null ? "" : String(string).replace(reEscapedHtml, unescapeHtmlChar)
                }

                function uniqueId(prefix) {
                    var id = ++idCounter;
                    return String(prefix == null ? "" : prefix) + id
                }

                function tap(value, interceptor) {
                    interceptor(value);
                    return value
                }

                function wrapperToString() {
                    return String(this.__wrapped__)
                }

                function wrapperValueOf() {
                    return this.__wrapped__
                }
                lodash.after = after;
                lodash.assign = assign;
                lodash.at = at;
                lodash.bind = bind;
                lodash.bindAll = bindAll;
                lodash.bindKey = bindKey;
                lodash.compact = compact;
                lodash.compose = compose;
                lodash.countBy = countBy;
                lodash.createCallback = createCallback;
                lodash.debounce = debounce;
                lodash.defaults = defaults;
                lodash.defer = defer;
                lodash.delay = delay;
                lodash.difference = difference;
                lodash.filter = filter;
                lodash.flatten = flatten;
                lodash.forEach = forEach;
                lodash.forIn = forIn;
                lodash.forOwn = forOwn;
                lodash.functions = functions;
                lodash.groupBy = groupBy;
                lodash.initial = initial;
                lodash.intersection = intersection;
                lodash.invert = invert;
                lodash.invoke = invoke;
                lodash.keys = keys;
                lodash.map = map;
                lodash.max = max;
                lodash.memoize = memoize;
                lodash.merge = merge;
                lodash.min = min;
                lodash.omit = omit;
                lodash.once = once;
                lodash.pairs = pairs;
                lodash.partial = partial;
                lodash.partialRight = partialRight;
                lodash.pick = pick;
                lodash.pluck = pluck;
                lodash.range = range;
                lodash.reject = reject;
                lodash.rest = rest;
                lodash.shuffle = shuffle;
                lodash.sortBy = sortBy;
                lodash.tap = tap;
                lodash.throttle = throttle;
                lodash.times = times;
                lodash.toArray = toArray;
                lodash.transform = transform;
                lodash.union = union;
                lodash.uniq = uniq;
                lodash.unzip = unzip;
                lodash.values = values;
                lodash.where = where;
                lodash.without = without;
                lodash.wrap = wrap;
                lodash.zip = zip;
                lodash.zipObject = zipObject;
                lodash.collect = map;
                lodash.drop = rest;
                lodash.each = forEach;
                lodash.extend = assign;
                lodash.methods = functions;
                lodash.object = zipObject;
                lodash.select = filter;
                lodash.tail = rest;
                lodash.unique = uniq;
                mixin(lodash);
                lodash.chain = lodash;
                lodash.prototype.chain = function() {
                    return this
                };
                lodash.clone = clone;
                lodash.cloneDeep = cloneDeep;
                lodash.contains = contains;
                lodash.escape = escape;
                lodash.every = every;
                lodash.find = find;
                lodash.findIndex = findIndex;
                lodash.findKey = findKey;
                lodash.has = has;
                lodash.identity = identity;
                lodash.indexOf = indexOf;
                lodash.isArguments = isArguments;
                lodash.isArray = isArray;
                lodash.isBoolean = isBoolean;
                lodash.isDate = isDate;
                lodash.isElement = isElement;
                lodash.isEmpty = isEmpty;
                lodash.isEqual = isEqual;
                lodash.isFinite = isFinite;
                lodash.isFunction = isFunction;
                lodash.isNaN = isNaN;
                lodash.isNull = isNull;
                lodash.isNumber = isNumber;
                lodash.isObject = isObject;
                lodash.isPlainObject = isPlainObject;
                lodash.isRegExp = isRegExp;
                lodash.isString = isString;
                lodash.isUndefined = isUndefined;
                lodash.lastIndexOf = lastIndexOf;
                lodash.mixin = mixin;
                lodash.noConflict = noConflict;
                lodash.parseInt = parseInt;
                lodash.random = random;
                lodash.reduce = reduce;
                lodash.reduceRight = reduceRight;
                lodash.result = result;
                lodash.runInContext = runInContext;
                lodash.size = size;
                lodash.some = some;
                lodash.sortedIndex = sortedIndex;
                lodash.template = template;
                lodash.unescape = unescape;
                lodash.uniqueId = uniqueId;
                lodash.all = every;
                lodash.any = some;
                lodash.detect = find;
                lodash.findWhere = find;
                lodash.foldl = reduce;
                lodash.foldr = reduceRight;
                lodash.include = contains;
                lodash.inject = reduce;
                forOwn(lodash, function(func, methodName) {
                    if (!lodash.prototype[methodName]) {
                        lodash.prototype[methodName] = function() {
                            var args = [this.__wrapped__];
                            push.apply(args, arguments);
                            return func.apply(lodash, args)
                        }
                    }
                });
                lodash.first = first;
                lodash.last = last;
                lodash.take = first;
                lodash.head = first;
                forOwn(lodash, function(func, methodName) {
                    if (!lodash.prototype[methodName]) {
                        lodash.prototype[methodName] = function(callback, thisArg) {
                            var result = func(this.__wrapped__, callback, thisArg);
                            return callback == null || thisArg && typeof callback != "function" ? result : new lodashWrapper(result)
                        }
                    }
                });
                lodash.VERSION = "1.3.1";
                lodash.prototype.toString = wrapperToString;
                lodash.prototype.value = wrapperValueOf;
                lodash.prototype.valueOf = wrapperValueOf;
                forEach(["join", "pop", "shift"], function(methodName) {
                    var func = arrayRef[methodName];
                    lodash.prototype[methodName] = function() {
                        return func.apply(this.__wrapped__, arguments)
                    }
                });
                forEach(["push", "reverse", "sort", "unshift"], function(methodName) {
                    var func = arrayRef[methodName];
                    lodash.prototype[methodName] = function() {
                        func.apply(this.__wrapped__, arguments);
                        return this
                    }
                });
                forEach(["concat", "slice", "splice"], function(methodName) {
                    var func = arrayRef[methodName];
                    lodash.prototype[methodName] = function() {
                        return new lodashWrapper(func.apply(this.__wrapped__, arguments))
                    }
                });
                return lodash
            }
            var _ = runInContext();
            if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
                window._ = _;
                define(function() {
                    return _
                })
            } else if (freeExports && !freeExports.nodeType) {
                if (freeModule) {
                    (freeModule.exports = _)._ = _
                } else {
                    freeExports._ = _
                }
            } else {
                window._ = _
            }
        })(this);
        var _ = module.exports;
        _ = _.noConflict();
        delete this._;
        return _
    }
    lodash = wrapper.call(window);
    return lodash
});
define("underscore.string", ["lodash", "exports", "module"], function(_, exports, module) {
    ! function(e) {
        if ("object" == typeof exports) module.exports = e();
        else if ("function" == typeof define && define.amd) define(e);
        else {
            var r;
            "undefined" != typeof window ? r = window : "undefined" != typeof global ? r = global : "undefined" != typeof self && (r = self), r.s = e()
        }
    }(function() {
        return function e(r, t, n) {
            function i(o, p) {
                if (!t[o]) {
                    if (!r[o]) {
                        var u = "function" == typeof require && require;
                        if (!p && u) return u(o, !0);
                        if (a) return a(o, !0);
                        throw new Error("Cannot find module '" + o + "'")
                    }
                    var c = t[o] = {
                        exports: {}
                    };
                    r[o][0].call(c.exports, function(e) {
                        var t = r[o][1][e];
                        return i(t ? t : e)
                    }, c, c.exports, e, r, t, n)
                }
                return t[o].exports
            }
            for (var a = "function" == typeof require && require, o = 0; o < n.length; o++) i(n[o]);
            return i
        }({
            1: [function(e, r) {
                var t = e("./trim"),
                    n = e("./decapitalize");
                r.exports = function(e, r) {
                    return e = t(e).replace(/[-_\s]+(.)?/g, function(e, r) {
                        return r ? r.toUpperCase() : ""
                    }), r === !0 ? n(e) : e
                }
            }, {
                "./decapitalize": 9,
                "./trim": 60
            }],
            2: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e) {
                    return e = t(e), e.charAt(0).toUpperCase() + e.slice(1)
                }
            }, {
                "./helper/makeString": 19
            }],
            3: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e) {
                    return t(e).split("")
                }
            }, {
                "./helper/makeString": 19
            }],
            4: [function(e, r) {
                r.exports = function(e, r) {
                    return null == e ? [] : (e = String(e), r = ~~r, r > 0 ? e.match(new RegExp(".{1," + r + "}", "g")) : [e])
                }
            }, {}],
            5: [function(e, r) {
                var t = e("./capitalize"),
                    n = e("./camelize"),
                    i = e("./helper/makeString");
                r.exports = function(e) {
                    return e = i(e), t(n(e.replace(/[\W_]/g, " ")).replace(/\s/g, ""))
                }
            }, {
                "./camelize": 1,
                "./capitalize": 2,
                "./helper/makeString": 19
            }],
            6: [function(e, r) {
                var t = e("./trim");
                r.exports = function(e) {
                    return t(e).replace(/\s+/g, " ")
                }
            }, {
                "./trim": 60
            }],
            7: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r) {
                    if (e = t(e), r = t(r), 0 === e.length || 0 === r.length) return 0;
                    for (var n = 0, i = 0, a = r.length;;) {
                        if (i = e.indexOf(r, i), -1 === i) break;
                        n++, i += a
                    }
                    return n
                }
            }, {
                "./helper/makeString": 19
            }],
            8: [function(e, r) {
                var t = e("./trim");
                r.exports = function(e) {
                    return t(e).replace(/([A-Z])/g, "-$1").replace(/[-_\s]+/g, "-").toLowerCase()
                }
            }, {
                "./trim": 60
            }],
            9: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e) {
                    return e = t(e), e.charAt(0).toLowerCase() + e.slice(1)
                }
            }, {
                "./helper/makeString": 19
            }],
            10: [function(e, r) {
                function t(e) {
                    for (var r = e.match(/^[\s\\t]*/gm), t = r[0].length, n = 1; n < r.length; n++) t = Math.min(r[n].length, t);
                    return t
                }
                var n = e("./helper/makeString");
                r.exports = function(e, r) {
                    e = n(e);
                    var i, a = t(e);
                    return 0 === a ? e : (i = "string" == typeof r ? new RegExp("^" + r, "gm") : new RegExp("^[ \\t]{" + a + "}", "gm"), e.replace(i, ""))
                }
            }, {
                "./helper/makeString": 19
            }],
            11: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/toPositive");
                r.exports = function(e, r, i) {
                    return e = t(e), r = "" + r, i = "undefined" == typeof i ? e.length - r.length : Math.min(n(i), e.length) - r.length, i >= 0 && e.indexOf(r, i) === i
                }
            }, {
                "./helper/makeString": 19,
                "./helper/toPositive": 21
            }],
            12: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/escapeChars"),
                    i = {};
                for (var a in n) i[n[a]] = a;
                i["'"] = "#39", r.exports = function(e) {
                    return t(e).replace(/[&<>"']/g, function(e) {
                        return "&" + i[e] + ";"
                    })
                }
            }, {
                "./helper/escapeChars": 17,
                "./helper/makeString": 19
            }],
            13: [function(e, r) {
                r.exports = function() {
                    var e = {};
                    for (var r in this) this.hasOwnProperty(r) && !r.match(/^(?:include|contains|reverse|join)$/) && (e[r] = this[r]);
                    return e
                }
            }, {}],
            14: [function(e, r) {
                "use strict";

                function t(e) {
                    return this instanceof t ? void(this._wrapped = e) : new t(e)
                }

                function n(e, r) {
                    "function" == typeof r && (t.prototype[e] = function() {
                        var e = [this._wrapped].concat(Array.prototype.slice.call(arguments)),
                            n = r.apply(null, e);
                        return "string" == typeof n ? new t(n) : n
                    })
                }

                function i(e) {
                    n(e, function(r) {
                        var t = Array.prototype.slice.call(arguments, 1);
                        return String.prototype[e].apply(r, t)
                    })
                }
                t.VERSION = "3.0.3", t.isBlank = e("./isBlank"), t.stripTags = e("./stripTags"), t.capitalize = e("./capitalize"), t.decapitalize = e("./decapitalize"), t.chop = e("./chop"), t.trim = e("./trim"), t.clean = e("./clean"), t.count = e("./count"), t.chars = e("./chars"), t.swapCase = e("./swapCase"), t.escapeHTML = e("./escapeHTML"), t.unescapeHTML = e("./unescapeHTML"), t.splice = e("./splice"), t.insert = e("./insert"), t.replaceAll = e("./replaceAll"), t.include = e("./include"), t.join = e("./join"), t.lines = e("./lines"), t.dedent = e("./dedent"), t.reverse = e("./reverse"), t.startsWith = e("./startsWith"), t.endsWith = e("./endsWith"), t.pred = e("./pred"), t.succ = e("./succ"), t.titleize = e("./titleize"), t.camelize = e("./camelize"), t.underscored = e("./underscored"), t.dasherize = e("./dasherize"), t.classify = e("./classify"), t.humanize = e("./humanize"), t.ltrim = e("./ltrim"), t.rtrim = e("./rtrim"), t.truncate = e("./truncate"), t.prune = e("./prune"), t.words = e("./words"), t.pad = e("./pad"), t.lpad = e("./lpad"), t.rpad = e("./rpad"), t.lrpad = e("./lrpad"), t.sprintf = e("./sprintf"), t.vsprintf = e("./vsprintf"), t.toNumber = e("./toNumber"), t.numberFormat = e("./numberFormat"), t.strRight = e("./strRight"), t.strRightBack = e("./strRightBack"), t.strLeft = e("./strLeft"), t.strLeftBack = e("./strLeftBack"), t.toSentence = e("./toSentence"), t.toSentenceSerial = e("./toSentenceSerial"), t.slugify = e("./slugify"), t.surround = e("./surround"), t.quote = e("./quote"), t.unquote = e("./unquote"), t.repeat = e("./repeat"), t.naturalCmp = e("./naturalCmp"), t.levenshtein = e("./levenshtein"), t.toBoolean = e("./toBoolean"), t.exports = e("./exports"), t.escapeRegExp = e("./helper/escapeRegExp"), t.strip = t.trim, t.lstrip = t.ltrim, t.rstrip = t.rtrim, t.center = t.lrpad, t.rjust = t.lpad, t.ljust = t.rpad, t.contains = t.include, t.q = t.quote, t.toBool = t.toBoolean, t.camelcase = t.camelize, t.prototype = {
                    value: function() {
                        return this._wrapped
                    }
                };
                for (var a in t) n(a, t[a]);
                n("tap", function(e, r) {
                    return r(e)
                });
                var o = ["toUpperCase", "toLowerCase", "split", "replace", "slice", "substring", "substr", "concat"];
                for (var a in o) i(o[a]);
                r.exports = t
            }, {
                "./camelize": 1,
                "./capitalize": 2,
                "./chars": 3,
                "./chop": 4,
                "./classify": 5,
                "./clean": 6,
                "./count": 7,
                "./dasherize": 8,
                "./decapitalize": 9,
                "./dedent": 10,
                "./endsWith": 11,
                "./escapeHTML": 12,
                "./exports": 13,
                "./helper/escapeRegExp": 18,
                "./humanize": 22,
                "./include": 23,
                "./insert": 24,
                "./isBlank": 25,
                "./join": 26,
                "./levenshtein": 27,
                "./lines": 28,
                "./lpad": 29,
                "./lrpad": 30,
                "./ltrim": 31,
                "./naturalCmp": 32,
                "./numberFormat": 33,
                "./pad": 34,
                "./pred": 35,
                "./prune": 36,
                "./quote": 37,
                "./repeat": 38,
                "./replaceAll": 39,
                "./reverse": 40,
                "./rpad": 41,
                "./rtrim": 42,
                "./slugify": 43,
                "./splice": 44,
                "./sprintf": 45,
                "./startsWith": 46,
                "./strLeft": 47,
                "./strLeftBack": 48,
                "./strRight": 49,
                "./strRightBack": 50,
                "./stripTags": 51,
                "./succ": 52,
                "./surround": 53,
                "./swapCase": 54,
                "./titleize": 55,
                "./toBoolean": 56,
                "./toNumber": 57,
                "./toSentence": 58,
                "./toSentenceSerial": 59,
                "./trim": 60,
                "./truncate": 61,
                "./underscored": 62,
                "./unescapeHTML": 63,
                "./unquote": 64,
                "./vsprintf": 65,
                "./words": 66
            }],
            15: [function(e, r) {
                var t = e("./makeString");
                r.exports = function(e, r) {
                    return e = t(e), 0 === e.length ? "" : e.slice(0, -1) + String.fromCharCode(e.charCodeAt(e.length - 1) + r)
                }
            }, {
                "./makeString": 19
            }],
            16: [function(e, r) {
                var t = e("./escapeRegExp");
                r.exports = function(e) {
                    return null == e ? "\\s" : e.source ? e.source : "[" + t(e) + "]"
                }
            }, {
                "./escapeRegExp": 18
            }],
            17: [function(e, r) {
                var t = {
                    lt: "<",
                    gt: ">",
                    quot: '"',
                    amp: "&",
                    apos: "'"
                };
                r.exports = t
            }, {}],
            18: [function(e, r) {
                var t = e("./makeString");
                r.exports = function(e) {
                    return t(e).replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1")
                }
            }, {
                "./makeString": 19
            }],
            19: [function(e, r) {
                r.exports = function(e) {
                    return null == e ? "" : "" + e
                }
            }, {}],
            20: [function(e, r) {
                r.exports = function(e, r) {
                    if (1 > r) return "";
                    for (var t = ""; r > 0;) 1 & r && (t += e), r >>= 1, e += e;
                    return t
                }
            }, {}],
            21: [function(e, r) {
                r.exports = function(e) {
                    return 0 > e ? 0 : +e || 0
                }
            }, {}],
            22: [function(e, r) {
                var t = e("./capitalize"),
                    n = e("./underscored"),
                    i = e("./trim");
                r.exports = function(e) {
                    return t(i(n(e).replace(/_id$/, "").replace(/_/g, " ")))
                }
            }, {
                "./capitalize": 2,
                "./trim": 60,
                "./underscored": 62
            }],
            23: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r) {
                    return "" === r ? !0 : -1 !== t(e).indexOf(r)
                }
            }, {
                "./helper/makeString": 19
            }],
            24: [function(e, r) {
                var t = e("./splice");
                r.exports = function(e, r, n) {
                    return t(e, r, 0, n)
                }
            }, {
                "./splice": 44
            }],
            25: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e) {
                    return /^\s*$/.test(t(e))
                }
            }, {
                "./helper/makeString": 19
            }],
            26: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = [].slice;
                r.exports = function() {
                    var e = n.call(arguments),
                        r = e.shift();
                    return e.join(t(r))
                }
            }, {
                "./helper/makeString": 19
            }],
            27: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r) {
                    e = t(e), r = t(r);
                    for (var n, i, a = [], o = 0; o <= r.length; o++)
                        for (var p = 0; p <= e.length; p++) i = o && p ? e.charAt(p - 1) === r.charAt(o - 1) ? n : Math.min(a[p], a[p - 1], n) + 1 : o + p, n = a[p], a[p] = i;
                    return a.pop()
                }
            }, {
                "./helper/makeString": 19
            }],
            28: [function(e, r) {
                r.exports = function(e) {
                    return null == e ? [] : String(e).split(/\r?\n/)
                }
            }, {}],
            29: [function(e, r) {
                var t = e("./pad");
                r.exports = function(e, r, n) {
                    return t(e, r, n)
                }
            }, {
                "./pad": 34
            }],
            30: [function(e, r) {
                var t = e("./pad");
                r.exports = function(e, r, n) {
                    return t(e, r, n, "both")
                }
            }, {
                "./pad": 34
            }],
            31: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/defaultToWhiteSpace"),
                    i = String.prototype.trimLeft;
                r.exports = function(e, r) {
                    return e = t(e), !r && i ? i.call(e) : (r = n(r), e.replace(new RegExp("^" + r + "+"), ""))
                }
            }, {
                "./helper/defaultToWhiteSpace": 16,
                "./helper/makeString": 19
            }],
            32: [function(e, r) {
                r.exports = function(e, r) {
                    if (e == r) return 0;
                    if (!e) return -1;
                    if (!r) return 1;
                    for (var t = /(\.\d+)|(\d+)|(\D+)/g, n = String(e).match(t), i = String(r).match(t), a = Math.min(n.length, i.length), o = 0; a > o; o++) {
                        var p = n[o],
                            u = i[o];
                        if (p !== u) {
                            var c = +p,
                                s = +u;
                            return c === c && s === s ? c > s ? 1 : -1 : u > p ? -1 : 1
                        }
                    }
                    return n.length != i.length ? n.length - i.length : r > e ? -1 : 1
                }
            }, {}],
            33: [function(e, r) {
                r.exports = function(e, r, t, n) {
                    if (isNaN(e) || null == e) return "";
                    e = e.toFixed(~~r), n = "string" == typeof n ? n : ",";
                    var i = e.split("."),
                        a = i[0],
                        o = i[1] ? (t || ".") + i[1] : "";
                    return a.replace(/(\d)(?=(?:\d{3})+$)/g, "$1" + n) + o
                }
            }, {}],
            34: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/strRepeat");
                r.exports = function(e, r, i, a) {
                    e = t(e), r = ~~r;
                    var o = 0;
                    switch (i ? i.length > 1 && (i = i.charAt(0)) : i = " ", a) {
                        case "right":
                            return o = r - e.length, e + n(i, o);
                        case "both":
                            return o = r - e.length, n(i, Math.ceil(o / 2)) + e + n(i, Math.floor(o / 2));
                        default:
                            return o = r - e.length, n(i, o) + e
                    }
                }
            }, {
                "./helper/makeString": 19,
                "./helper/strRepeat": 20
            }],
            35: [function(e, r) {
                var t = e("./helper/adjacent");
                r.exports = function(e) {
                    return t(e, -1)
                }
            }, {
                "./helper/adjacent": 15
            }],
            36: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./rtrim");
                r.exports = function(e, r, i) {
                    if (e = t(e), r = ~~r, i = null != i ? String(i) : "...", e.length <= r) return e;
                    var a = function(e) {
                            return e.toUpperCase() !== e.toLowerCase() ? "A" : " "
                        },
                        o = e.slice(0, r + 1).replace(/.(?=\W*\w*$)/g, a);
                    return o = o.slice(o.length - 2).match(/\w\w/) ? o.replace(/\s*\S+$/, "") : n(o.slice(0, o.length - 1)), (o + i).length > e.length ? e : e.slice(0, o.length) + i
                }
            }, {
                "./helper/makeString": 19,
                "./rtrim": 42
            }],
            37: [function(e, r) {
                var t = e("./surround");
                r.exports = function(e, r) {
                    return t(e, r || '"')
                }
            }, {
                "./surround": 53
            }],
            38: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/strRepeat");
                r.exports = function i(e, r, a) {
                    if (e = t(e), r = ~~r, null == a) return n(e, r);
                    for (var i = []; r > 0; i[--r] = e);
                    return i.join(a)
                }
            }, {
                "./helper/makeString": 19,
                "./helper/strRepeat": 20
            }],
            39: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r, n, i) {
                    var a = i === !0 ? "gi" : "g",
                        o = new RegExp(r, a);
                    return t(e).replace(o, n)
                }
            }, {
                "./helper/makeString": 19
            }],
            40: [function(e, r) {
                var t = e("./chars");
                r.exports = function(e) {
                    return t(e).reverse().join("")
                }
            }, {
                "./chars": 3
            }],
            41: [function(e, r) {
                var t = e("./pad");
                r.exports = function(e, r, n) {
                    return t(e, r, n, "right")
                }
            }, {
                "./pad": 34
            }],
            42: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/defaultToWhiteSpace"),
                    i = String.prototype.trimRight;
                r.exports = function(e, r) {
                    return e = t(e), !r && i ? i.call(e) : (r = n(r), e.replace(new RegExp(r + "+$"), ""))
                }
            }, {
                "./helper/defaultToWhiteSpace": 16,
                "./helper/makeString": 19
            }],
            43: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/defaultToWhiteSpace"),
                    i = e("./trim"),
                    a = e("./dasherize");
                r.exports = function(e) {
                    var r = "ąàáäâãåæăćčĉęèéëêĝĥìíïîĵłľńňòóöőôõðøśșšŝťțŭùúüűûñÿýçżźž",
                        o = "aaaaaaaaaccceeeeeghiiiijllnnoooooooossssttuuuuuunyyczzz",
                        p = new RegExp(n(r), "g");
                    return e = t(e).toLowerCase().replace(p, function(e) {
                        var t = r.indexOf(e);
                        return o.charAt(t) || "-"
                    }), i(a(e.replace(/[^\w\s-]/g, "-")), "-")
                }
            }, {
                "./dasherize": 8,
                "./helper/defaultToWhiteSpace": 16,
                "./helper/makeString": 19,
                "./trim": 60
            }],
            44: [function(e, r) {
                var t = e("./chars");
                r.exports = function(e, r, n, i) {
                    var a = t(e);
                    return a.splice(~~r, ~~n, i), a.join("")
                }
            }, {
                "./chars": 3
            }],
            45: [function(e, r) {
                var t = e("./helper/strRepeat"),
                    n = Object.prototype.toString,
                    i = function() {
                        function e(e) {
                            return n.call(e).slice(8, -1).toLowerCase()
                        }
                        var r = t,
                            a = function() {
                                return a.cache.hasOwnProperty(arguments[0]) || (a.cache[arguments[0]] = a.parse(arguments[0])), a.format.call(null, a.cache[arguments[0]], arguments)
                            };
                        return a.format = function(t, n) {
                            var a, o, p, u, c, s, l, f = 1,
                                h = t.length,
                                g = "",
                                m = [];
                            for (o = 0; h > o; o++)
                                if (g = e(t[o]), "string" === g) m.push(t[o]);
                                else if ("array" === g) {
                                if (u = t[o], u[2])
                                    for (a = n[f], p = 0; p < u[2].length; p++) {
                                        if (!a.hasOwnProperty(u[2][p])) throw new Error(i('[_.sprintf] property "%s" does not exist', u[2][p]));
                                        a = a[u[2][p]]
                                    } else a = u[1] ? n[u[1]] : n[f++];
                                if (/[^s]/.test(u[8]) && "number" != e(a)) throw new Error(i("[_.sprintf] expecting number but found %s", e(a)));
                                switch (u[8]) {
                                    case "b":
                                        a = a.toString(2);
                                        break;
                                    case "c":
                                        a = String.fromCharCode(a);
                                        break;
                                    case "d":
                                        a = parseInt(a, 10);
                                        break;
                                    case "e":
                                        a = u[7] ? a.toExponential(u[7]) : a.toExponential();
                                        break;
                                    case "f":
                                        a = u[7] ? parseFloat(a).toFixed(u[7]) : parseFloat(a);
                                        break;
                                    case "o":
                                        a = a.toString(8);
                                        break;
                                    case "s":
                                        a = (a = String(a)) && u[7] ? a.substring(0, u[7]) : a;
                                        break;
                                    case "u":
                                        a = Math.abs(a);
                                        break;
                                    case "x":
                                        a = a.toString(16);
                                        break;
                                    case "X":
                                        a = a.toString(16).toUpperCase()
                                }
                                a = /[def]/.test(u[8]) && u[3] && a >= 0 ? "+" + a : a, s = u[4] ? "0" == u[4] ? "0" : u[4].charAt(1) : " ", l = u[6] - String(a).length, c = u[6] ? r(s, l) : "", m.push(u[5] ? a + c : c + a)
                            }
                            return m.join("")
                        }, a.cache = {}, a.parse = function(e) {
                            for (var r = e, t = [], n = [], i = 0; r;) {
                                if (null !== (t = /^[^\x25]+/.exec(r))) n.push(t[0]);
                                else if (null !== (t = /^\x25{2}/.exec(r))) n.push("%");
                                else {
                                    if (null === (t = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(r))) throw new Error("[_.sprintf] huh?");
                                    if (t[2]) {
                                        i |= 1;
                                        var a = [],
                                            o = t[2],
                                            p = [];
                                        if (null === (p = /^([a-z_][a-z_\d]*)/i.exec(o))) throw new Error("[_.sprintf] huh?");
                                        for (a.push(p[1]);
                                            "" !== (o = o.substring(p[0].length));)
                                            if (null !== (p = /^\.([a-z_][a-z_\d]*)/i.exec(o))) a.push(p[1]);
                                            else {
                                                if (null === (p = /^\[(\d+)\]/.exec(o))) throw new Error("[_.sprintf] huh?");
                                                a.push(p[1])
                                            }
                                        t[2] = a
                                    } else i |= 2;
                                    if (3 === i) throw new Error("[_.sprintf] mixing positional and named placeholders is not (yet) supported");
                                    n.push(t)
                                }
                                r = r.substring(t[0].length)
                            }
                            return n
                        }, a
                    }();
                r.exports = i
            }, {
                "./helper/strRepeat": 20
            }],
            46: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/toPositive");
                r.exports = function(e, r, i) {
                    return e = t(e), r = "" + r, i = null == i ? 0 : Math.min(n(i), e.length), e.lastIndexOf(r, i) === i
                }
            }, {
                "./helper/makeString": 19,
                "./helper/toPositive": 21
            }],
            47: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r) {
                    e = t(e), r = t(r);
                    var n = r ? e.indexOf(r) : -1;
                    return ~n ? e.slice(0, n) : e
                }
            }, {
                "./helper/makeString": 19
            }],
            48: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r) {
                    e = t(e), r = t(r);
                    var n = e.lastIndexOf(r);
                    return ~n ? e.slice(0, n) : e
                }
            }, {
                "./helper/makeString": 19
            }],
            49: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r) {
                    e = t(e), r = t(r);
                    var n = r ? e.indexOf(r) : -1;
                    return ~n ? e.slice(n + r.length, e.length) : e
                }
            }, {
                "./helper/makeString": 19
            }],
            50: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r) {
                    e = t(e), r = t(r);
                    var n = r ? e.lastIndexOf(r) : -1;
                    return ~n ? e.slice(n + r.length, e.length) : e
                }
            }, {
                "./helper/makeString": 19
            }],
            51: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e) {
                    return t(e).replace(/<\/?[^>]+>/g, "")
                }
            }, {
                "./helper/makeString": 19
            }],
            52: [function(e, r) {
                var t = e("./helper/adjacent");
                r.exports = function(e) {
                    return t(e, 1)
                }
            }, {
                "./helper/adjacent": 15
            }],
            53: [function(e, r) {
                r.exports = function(e, r) {
                    return [r, e, r].join("")
                }
            }, {}],
            54: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e) {
                    return t(e).replace(/\S/g, function(e) {
                        return e === e.toUpperCase() ? e.toLowerCase() : e.toUpperCase()
                    })
                }
            }, {
                "./helper/makeString": 19
            }],
            55: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e) {
                    return t(e).toLowerCase().replace(/(?:^|\s|-)\S/g, function(e) {
                        return e.toUpperCase()
                    })
                }
            }, {
                "./helper/makeString": 19
            }],
            56: [function(e, r) {
                function t(e, r) {
                    var t, n, i = e.toLowerCase();
                    for (r = [].concat(r), t = 0; t < r.length; t += 1)
                        if (n = r[t]) {
                            if (n.test && n.test(e)) return !0;
                            if (n.toLowerCase() === i) return !0
                        }
                }
                var n = e("./trim");
                r.exports = function(e, r, i) {
                    return "number" == typeof e && (e = "" + e), "string" != typeof e ? !!e : (e = n(e), t(e, r || ["true", "1"]) ? !0 : t(e, i || ["false", "0"]) ? !1 : void 0)
                }
            }, {
                "./trim": 60
            }],
            57: [function(e, r) {
                e("./trim");
                r.exports = function(e, r) {
                    if (null == e) return 0;
                    var t = Math.pow(10, isFinite(r) ? r : 0);
                    return Math.round(e * t) / t
                }
            }, {
                "./trim": 60
            }],
            58: [function(e, r) {
                var t = e("./rtrim");
                r.exports = function(e, r, n, i) {
                    r = r || ", ", n = n || " and ";
                    var a = e.slice(),
                        o = a.pop();
                    return e.length > 2 && i && (n = t(r) + n), a.length ? a.join(r) + n + o : o
                }
            }, {
                "./rtrim": 42
            }],
            59: [function(e, r) {
                var t = e("./toSentence");
                r.exports = function(e, r, n) {
                    return t(e, r, n, !0)
                }
            }, {
                "./toSentence": 58
            }],
            60: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/defaultToWhiteSpace"),
                    i = String.prototype.trim;
                r.exports = function(e, r) {
                    return e = t(e), !r && i ? i.call(e) : (r = n(r), e.replace(new RegExp("^" + r + "+|" + r + "+$", "g"), ""))
                }
            }, {
                "./helper/defaultToWhiteSpace": 16,
                "./helper/makeString": 19
            }],
            61: [function(e, r) {
                var t = e("./helper/makeString");
                r.exports = function(e, r, n) {
                    return e = t(e), n = n || "...", r = ~~r, e.length > r ? e.slice(0, r) + n : e
                }
            }, {
                "./helper/makeString": 19
            }],
            62: [function(e, r) {
                var t = e("./trim");
                r.exports = function(e) {
                    return t(e).replace(/([a-z\d])([A-Z]+)/g, "$1_$2").replace(/[-\s]+/g, "_").toLowerCase()
                }
            }, {
                "./trim": 60
            }],
            63: [function(e, r) {
                var t = e("./helper/makeString"),
                    n = e("./helper/escapeChars");
                r.exports = function(e) {
                    return t(e).replace(/\&([^;]+);/g, function(e, r) {
                        var t;
                        return r in n ? n[r] : (t = r.match(/^#x([\da-fA-F]+)$/)) ? String.fromCharCode(parseInt(t[1], 16)) : (t = r.match(/^#(\d+)$/)) ? String.fromCharCode(~~t[1]) : e
                    })
                }
            }, {
                "./helper/escapeChars": 17,
                "./helper/makeString": 19
            }],
            64: [function(e, r) {
                r.exports = function(e, r) {
                    return r = r || '"', e[0] === r && e[e.length - 1] === r ? e.slice(1, e.length - 1) : e
                }
            }, {}],
            65: [function(e, r) {
                var t = e("./sprintf");
                r.exports = function(e, r) {
                    return r.unshift(e), t.apply(null, r)
                }
            }, {
                "./sprintf": 45
            }],
            66: [function(e, r) {
                var t = e("./isBlank"),
                    n = e("./trim");
                r.exports = function(e, r) {
                    return t(e) ? [] : n(e, r).split(r || /\s+/)
                }
            }, {
                "./isBlank": 25,
                "./trim": 60
            }]
        }, {}, [14])(14)
    });
    return module.exports
});
define("fastclick", ["exports", "module"], function(exports, module) {
    var define = undefined;

    function FastClick(layer, options) {
        "use strict";
        var oldOnClick;
        options = options || {};
        this.trackingClick = false;
        this.trackingClickStart = 0;
        this.targetElement = null;
        this.touchStartX = 0;
        this.touchStartY = 0;
        this.lastTouchIdentifier = 0;
        this.touchBoundary = options.touchBoundary || 10;
        this.layer = layer;
        this.tapDelay = options.tapDelay || 200;
        if (FastClick.notNeeded(layer)) {
            return
        }

        function bind(method, context) {
            return function() {
                return method.apply(context, arguments)
            }
        }
        var methods = ["onMouse", "onClick", "onTouchStart", "onTouchMove", "onTouchEnd", "onTouchCancel"];
        var context = this;
        for (var i = 0, l = methods.length; i < l; i++) {
            context[methods[i]] = bind(context[methods[i]], context)
        }
        if (deviceIsAndroid) {
            layer.addEventListener("mouseover", this.onMouse, true);
            layer.addEventListener("mousedown", this.onMouse, true);
            layer.addEventListener("mouseup", this.onMouse, true)
        }
        layer.addEventListener("click", this.onClick, true);
        layer.addEventListener("touchstart", this.onTouchStart, false);
        layer.addEventListener("touchmove", this.onTouchMove, false);
        layer.addEventListener("touchend", this.onTouchEnd, false);
        layer.addEventListener("touchcancel", this.onTouchCancel, false);
        if (!Event.prototype.stopImmediatePropagation) {
            layer.removeEventListener = function(type, callback, capture) {
                var rmv = Node.prototype.removeEventListener;
                if (type === "click") {
                    rmv.call(layer, type, callback.hijacked || callback, capture)
                } else {
                    rmv.call(layer, type, callback, capture)
                }
            };
            layer.addEventListener = function(type, callback, capture) {
                var adv = Node.prototype.addEventListener;
                if (type === "click") {
                    adv.call(layer, type, callback.hijacked || (callback.hijacked = function(event) {
                        if (!event.propagationStopped) {
                            callback(event)
                        }
                    }), capture)
                } else {
                    adv.call(layer, type, callback, capture)
                }
            }
        }
        if (typeof layer.onclick === "function") {
            oldOnClick = layer.onclick;
            layer.addEventListener("click", function(event) {
                oldOnClick(event)
            }, false);
            layer.onclick = null
        }
    }
    var deviceIsAndroid = navigator.userAgent.indexOf("Android") > 0;
    var deviceIsIOS = /iP(ad|hone|od)/.test(navigator.userAgent);
    var deviceIsIOS4 = deviceIsIOS && /OS 4_\d(_\d)?/.test(navigator.userAgent);
    var deviceIsIOSWithBadTarget = deviceIsIOS && /OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);
    FastClick.prototype.needsClick = function(target) {
        "use strict";
        switch (target.nodeName.toLowerCase()) {
            case "button":
            case "select":
            case "textarea":
                if (target.disabled) {
                    return true
                }
                break;
            case "input":
                if (deviceIsIOS && target.type === "file" || target.disabled) {
                    return true
                }
                break;
            case "label":
            case "video":
                return true
        }
        return /\bneedsclick\b/.test(target.className)
    };
    FastClick.prototype.needsFocus = function(target) {
        "use strict";
        switch (target.nodeName.toLowerCase()) {
            case "textarea":
                return true;
            case "select":
                return !deviceIsAndroid;
            case "input":
                switch (target.type) {
                    case "button":
                    case "checkbox":
                    case "file":
                    case "image":
                    case "radio":
                    case "submit":
                        return false
                }
                return !target.disabled && !target.readOnly;
            default:
                return /\bneedsfocus\b/.test(target.className)
        }
    };
    FastClick.prototype.sendClick = function(targetElement, event) {
        "use strict";
        var clickEvent, touch;
        if (document.activeElement && document.activeElement !== targetElement) {
            document.activeElement.blur()
        }
        touch = event.changedTouches[0];
        clickEvent = document.createEvent("MouseEvents");
        clickEvent.initMouseEvent(this.determineEventType(targetElement), true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
        clickEvent.forwardedTouchEvent = true;
        targetElement.dispatchEvent(clickEvent)
    };
    FastClick.prototype.determineEventType = function(targetElement) {
        "use strict";
        if (deviceIsAndroid && targetElement.tagName.toLowerCase() === "select") {
            return "mousedown"
        }
        return "click"
    };
    FastClick.prototype.focus = function(targetElement) {
        "use strict";
        var length;
        if (deviceIsIOS && targetElement.setSelectionRange && targetElement.type.indexOf("date") !== 0 && targetElement.type !== "time") {
            length = targetElement.value.length;
            targetElement.setSelectionRange(length, length)
        } else {
            targetElement.focus()
        }
    };
    FastClick.prototype.updateScrollParent = function(targetElement) {
        "use strict";
        var scrollParent, parentElement;
        scrollParent = targetElement.fastClickScrollParent;
        if (!scrollParent || !scrollParent.contains(targetElement)) {
            parentElement = targetElement;
            do {
                if (parentElement.scrollHeight > parentElement.offsetHeight) {
                    scrollParent = parentElement;
                    targetElement.fastClickScrollParent = parentElement;
                    break
                }
                parentElement = parentElement.parentElement
            } while (parentElement)
        }
        if (scrollParent) {
            scrollParent.fastClickLastScrollTop = scrollParent.scrollTop
        }
    };
    FastClick.prototype.getTargetElementFromEventTarget = function(eventTarget) {
        "use strict";
        if (eventTarget.nodeType === Node.TEXT_NODE) {
            return eventTarget.parentNode
        }
        return eventTarget
    };
    FastClick.prototype.onTouchStart = function(event) {
        "use strict";
        var targetElement, touch, selection;
        if (event.targetTouches.length > 1) {
            return true
        }
        targetElement = this.getTargetElementFromEventTarget(event.target);
        touch = event.targetTouches[0];
        if (deviceIsIOS) {
            selection = window.getSelection();
            if (selection.rangeCount && !selection.isCollapsed) {
                return true
            }
            if (!deviceIsIOS4) {
                if (touch.identifier === this.lastTouchIdentifier) {
                    event.preventDefault();
                    return false
                }
                this.lastTouchIdentifier = touch.identifier;
                this.updateScrollParent(targetElement)
            }
        }
        this.trackingClick = true;
        this.trackingClickStart = event.timeStamp;
        this.targetElement = targetElement;
        this.touchStartX = touch.pageX;
        this.touchStartY = touch.pageY;
        if (event.timeStamp - this.lastClickTime < this.tapDelay) {
            event.preventDefault()
        }
        return true
    };
    FastClick.prototype.touchHasMoved = function(event) {
        "use strict";
        var touch = event.changedTouches[0],
            boundary = this.touchBoundary;
        if (Math.abs(touch.pageX - this.touchStartX) > boundary || Math.abs(touch.pageY - this.touchStartY) > boundary) {
            return true
        }
        return false
    };
    FastClick.prototype.onTouchMove = function(event) {
        "use strict";
        if (!this.trackingClick) {
            return true
        }
        if (this.targetElement !== this.getTargetElementFromEventTarget(event.target) || this.touchHasMoved(event)) {
            this.trackingClick = false;
            this.targetElement = null
        }
        return true
    };
    FastClick.prototype.findControl = function(labelElement) {
        "use strict";
        if (labelElement.control !== undefined) {
            return labelElement.control
        }
        if (labelElement.htmlFor) {
            return document.getElementById(labelElement.htmlFor)
        }
        return labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")
    };
    FastClick.prototype.onTouchEnd = function(event) {
        "use strict";
        var forElement, trackingClickStart, targetTagName, scrollParent, touch, targetElement = this.targetElement;
        if (!this.trackingClick) {
            return true
        }
        if (event.timeStamp - this.lastClickTime < this.tapDelay) {
            this.cancelNextClick = true;
            return true
        }
        this.cancelNextClick = false;
        this.lastClickTime = event.timeStamp;
        trackingClickStart = this.trackingClickStart;
        this.trackingClick = false;
        this.trackingClickStart = 0;
        if (deviceIsIOSWithBadTarget) {
            touch = event.changedTouches[0];
            targetElement = document.elementFromPoint(touch.pageX - window.pageXOffset, touch.pageY - window.pageYOffset) || targetElement;
            targetElement.fastClickScrollParent = this.targetElement.fastClickScrollParent
        }
        targetTagName = targetElement.tagName.toLowerCase();
        if (targetTagName === "label") {
            forElement = this.findControl(targetElement);
            if (forElement) {
                this.focus(targetElement);
                if (deviceIsAndroid) {
                    return false
                }
                targetElement = forElement
            }
        } else if (this.needsFocus(targetElement)) {
            if (event.timeStamp - trackingClickStart > 100 || deviceIsIOS && window.top !== window && targetTagName === "input") {
                this.targetElement = null;
                return false
            }
            this.focus(targetElement);
            this.sendClick(targetElement, event);
            if (!deviceIsIOS || targetTagName !== "select") {
                this.targetElement = null;
                event.preventDefault()
            }
            return false
        }
        if (deviceIsIOS && !deviceIsIOS4) {
            scrollParent = targetElement.fastClickScrollParent;
            if (scrollParent && scrollParent.fastClickLastScrollTop !== scrollParent.scrollTop) {
                return true
            }
        }
        if (!this.needsClick(targetElement)) {
            event.preventDefault();
            this.sendClick(targetElement, event)
        }
        return false
    };
    FastClick.prototype.onTouchCancel = function() {
        "use strict";
        this.trackingClick = false;
        this.targetElement = null
    };
    FastClick.prototype.onMouse = function(event) {
        "use strict";
        if (!this.targetElement) {
            return true
        }
        if (event.forwardedTouchEvent) {
            return true
        }
        if (!event.cancelable) {
            return true
        }
        if (!this.needsClick(this.targetElement) || this.cancelNextClick) {
            if (event.stopImmediatePropagation) {
                event.stopImmediatePropagation()
            } else {
                event.propagationStopped = true
            }
            event.stopPropagation();
            event.preventDefault();
            return false
        }
        return true
    };
    FastClick.prototype.onClick = function(event) {
        "use strict";
        var permitted;
        if (this.trackingClick) {
            this.targetElement = null;
            this.trackingClick = false;
            return true
        }
        if (event.target.type === "submit" && event.detail === 0) {
            return true
        }
        permitted = this.onMouse(event);
        if (!permitted) {
            this.targetElement = null
        }
        return permitted
    };
    FastClick.prototype.destroy = function() {
        "use strict";
        var layer = this.layer;
        if (deviceIsAndroid) {
            layer.removeEventListener("mouseover", this.onMouse, true);
            layer.removeEventListener("mousedown", this.onMouse, true);
            layer.removeEventListener("mouseup", this.onMouse, true)
        }
        layer.removeEventListener("click", this.onClick, true);
        layer.removeEventListener("touchstart", this.onTouchStart, false);
        layer.removeEventListener("touchmove", this.onTouchMove, false);
        layer.removeEventListener("touchend", this.onTouchEnd, false);
        layer.removeEventListener("touchcancel", this.onTouchCancel, false)
    };
    FastClick.notNeeded = function(layer) {
        "use strict";
        var metaViewport;
        var chromeVersion;
        if (typeof window.ontouchstart === "undefined") {
            return true
        }
        chromeVersion = +(/Chrome\/([0-9]+)/.exec(navigator.userAgent) || [, 0])[1];
        if (chromeVersion) {
            if (deviceIsAndroid) {
                metaViewport = document.querySelector("meta[name=viewport]");
                if (metaViewport) {
                    if (metaViewport.content.indexOf("user-scalable=no") !== -1) {
                        return true
                    }
                    if (chromeVersion > 31 && document.documentElement.scrollWidth <= window.outerWidth) {
                        return true
                    }
                }
            } else {
                return true
            }
        }
        if (layer.style.msTouchAction === "none") {
            return true
        }
        return false
    };
    FastClick.attach = function(layer, options) {
        "use strict";
        return new FastClick(layer, options)
    };
    if (typeof define !== "undefined" && define.amd) {
        define(function() {
            "use strict";
            return FastClick
        })
    } else if (typeof module !== "undefined" && module.exports) {
        module.exports = FastClick.attach;
        module.exports.FastClick = FastClick
    } else {
        window.FastClick = FastClick
    }
    return module.exports.FastClick
});
define("moment", ["exports", "module"], function(exports, module) {
    var define = undefined;
    (function(undefined) {
        var moment, VERSION = "2.8.3",
            globalScope = typeof global !== "undefined" ? global : this,
            oldGlobalMoment, round = Math.round,
            hasOwnProperty = Object.prototype.hasOwnProperty,
            i, YEAR = 0,
            MONTH = 1,
            DATE = 2,
            HOUR = 3,
            MINUTE = 4,
            SECOND = 5,
            MILLISECOND = 6,
            locales = {},
            momentProperties = [],
            hasModule = typeof module !== "undefined" && module.exports,
            aspNetJsonRegex = /^\/?Date\((\-?\d+)/i,
            aspNetTimeSpanJsonRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,
            isoDurationRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,
            formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|X|zz?|ZZ?|.)/g,
            localFormattingTokens = /(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,
            parseTokenOneOrTwoDigits = /\d\d?/,
            parseTokenOneToThreeDigits = /\d{1,3}/,
            parseTokenOneToFourDigits = /\d{1,4}/,
            parseTokenOneToSixDigits = /[+\-]?\d{1,6}/,
            parseTokenDigits = /\d+/,
            parseTokenWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,
            parseTokenTimezone = /Z|[\+\-]\d\d:?\d\d/gi,
            parseTokenT = /T/i,
            parseTokenTimestampMs = /[\+\-]?\d+(\.\d{1,3})?/,
            parseTokenOrdinal = /\d{1,2}/,
            parseTokenOneDigit = /\d/,
            parseTokenTwoDigits = /\d\d/,
            parseTokenThreeDigits = /\d{3}/,
            parseTokenFourDigits = /\d{4}/,
            parseTokenSixDigits = /[+-]?\d{6}/,
            parseTokenSignedNumber = /[+-]?\d+/,
            isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
            isoFormat = "YYYY-MM-DDTHH:mm:ssZ",
            isoDates = [
                ["YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/],
                ["YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/],
                ["GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/],
                ["GGGG-[W]WW", /\d{4}-W\d{2}/],
                ["YYYY-DDD", /\d{4}-\d{3}/]
            ],
            isoTimes = [
                ["HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/],
                ["HH:mm:ss", /(T| )\d\d:\d\d:\d\d/],
                ["HH:mm", /(T| )\d\d:\d\d/],
                ["HH", /(T| )\d\d/]
            ],
            parseTimezoneChunker = /([\+\-]|\d\d)/gi,
            proxyGettersAndSetters = "Date|Hours|Minutes|Seconds|Milliseconds".split("|"),
            unitMillisecondFactors = {
                Milliseconds: 1,
                Seconds: 1e3,
                Minutes: 6e4,
                Hours: 36e5,
                Days: 864e5,
                Months: 2592e6,
                Years: 31536e6
            },
            unitAliases = {
                ms: "millisecond",
                s: "second",
                m: "minute",
                h: "hour",
                d: "day",
                D: "date",
                w: "week",
                W: "isoWeek",
                M: "month",
                Q: "quarter",
                y: "year",
                DDD: "dayOfYear",
                e: "weekday",
                E: "isoWeekday",
                gg: "weekYear",
                GG: "isoWeekYear"
            },
            camelFunctions = {
                dayofyear: "dayOfYear",
                isoweekday: "isoWeekday",
                isoweek: "isoWeek",
                weekyear: "weekYear",
                isoweekyear: "isoWeekYear"
            },
            formatFunctions = {},
            relativeTimeThresholds = {
                s: 45,
                m: 45,
                h: 22,
                d: 26,
                M: 11
            },
            ordinalizeTokens = "DDD w W M D d".split(" "),
            paddedTokens = "M D H h m s w W".split(" "),
            formatTokenFunctions = {
                M: function() {
                    return this.month() + 1
                },
                MMM: function(format) {
                    return this.localeData().monthsShort(this, format)
                },
                MMMM: function(format) {
                    return this.localeData().months(this, format)
                },
                D: function() {
                    return this.date()
                },
                DDD: function() {
                    return this.dayOfYear()
                },
                d: function() {
                    return this.day()
                },
                dd: function(format) {
                    return this.localeData().weekdaysMin(this, format)
                },
                ddd: function(format) {
                    return this.localeData().weekdaysShort(this, format)
                },
                dddd: function(format) {
                    return this.localeData().weekdays(this, format)
                },
                w: function() {
                    return this.week()
                },
                W: function() {
                    return this.isoWeek()
                },
                YY: function() {
                    return leftZeroFill(this.year() % 100, 2)
                },
                YYYY: function() {
                    return leftZeroFill(this.year(), 4)
                },
                YYYYY: function() {
                    return leftZeroFill(this.year(), 5)
                },
                YYYYYY: function() {
                    var y = this.year(),
                        sign = y >= 0 ? "+" : "-";
                    return sign + leftZeroFill(Math.abs(y), 6)
                },
                gg: function() {
                    return leftZeroFill(this.weekYear() % 100, 2)
                },
                gggg: function() {
                    return leftZeroFill(this.weekYear(), 4)
                },
                ggggg: function() {
                    return leftZeroFill(this.weekYear(), 5)
                },
                GG: function() {
                    return leftZeroFill(this.isoWeekYear() % 100, 2)
                },
                GGGG: function() {
                    return leftZeroFill(this.isoWeekYear(), 4)
                },
                GGGGG: function() {
                    return leftZeroFill(this.isoWeekYear(), 5)
                },
                e: function() {
                    return this.weekday()
                },
                E: function() {
                    return this.isoWeekday()
                },
                a: function() {
                    return this.localeData().meridiem(this.hours(), this.minutes(), true)
                },
                A: function() {
                    return this.localeData().meridiem(this.hours(), this.minutes(), false)
                },
                H: function() {
                    return this.hours()
                },
                h: function() {
                    return this.hours() % 12 || 12
                },
                m: function() {
                    return this.minutes()
                },
                s: function() {
                    return this.seconds()
                },
                S: function() {
                    return toInt(this.milliseconds() / 100)
                },
                SS: function() {
                    return leftZeroFill(toInt(this.milliseconds() / 10), 2)
                },
                SSS: function() {
                    return leftZeroFill(this.milliseconds(), 3)
                },
                SSSS: function() {
                    return leftZeroFill(this.milliseconds(), 3)
                },
                Z: function() {
                    var a = -this.zone(),
                        b = "+";
                    if (a < 0) {
                        a = -a;
                        b = "-"
                    }
                    return b + leftZeroFill(toInt(a / 60), 2) + ":" + leftZeroFill(toInt(a) % 60, 2)
                },
                ZZ: function() {
                    var a = -this.zone(),
                        b = "+";
                    if (a < 0) {
                        a = -a;
                        b = "-"
                    }
                    return b + leftZeroFill(toInt(a / 60), 2) + leftZeroFill(toInt(a) % 60, 2)
                },
                z: function() {
                    return this.zoneAbbr()
                },
                zz: function() {
                    return this.zoneName()
                },
                X: function() {
                    return this.unix()
                },
                Q: function() {
                    return this.quarter()
                }
            },
            deprecations = {},
            lists = ["months", "monthsShort", "weekdays", "weekdaysShort", "weekdaysMin"];

        function dfl(a, b, c) {
            switch (arguments.length) {
                case 2:
                    return a != null ? a : b;
                case 3:
                    return a != null ? a : b != null ? b : c;
                default:
                    throw new Error("Implement me")
            }
        }

        function hasOwnProp(a, b) {
            return hasOwnProperty.call(a, b)
        }

        function defaultParsingFlags() {
            return {
                empty: false,
                unusedTokens: [],
                unusedInput: [],
                overflow: -2,
                charsLeftOver: 0,
                nullInput: false,
                invalidMonth: null,
                invalidFormat: false,
                userInvalidated: false,
                iso: false
            }
        }

        function printMsg(msg) {
            if (moment.suppressDeprecationWarnings === false && typeof console !== "undefined" && console.warn) {
                console.warn("Deprecation warning: " + msg)
            }
        }

        function deprecate(msg, fn) {
            var firstTime = true;
            return extend(function() {
                if (firstTime) {
                    printMsg(msg);
                    firstTime = false
                }
                return fn.apply(this, arguments)
            }, fn)
        }

        function deprecateSimple(name, msg) {
            if (!deprecations[name]) {
                printMsg(msg);
                deprecations[name] = true
            }
        }

        function padToken(func, count) {
            return function(a) {
                return leftZeroFill(func.call(this, a), count)
            }
        }

        function ordinalizeToken(func, period) {
            return function(a) {
                return this.localeData().ordinal(func.call(this, a), period)
            }
        }
        while (ordinalizeTokens.length) {
            i = ordinalizeTokens.pop();
            formatTokenFunctions[i + "o"] = ordinalizeToken(formatTokenFunctions[i], i)
        }
        while (paddedTokens.length) {
            i = paddedTokens.pop();
            formatTokenFunctions[i + i] = padToken(formatTokenFunctions[i], 2)
        }
        formatTokenFunctions.DDDD = padToken(formatTokenFunctions.DDD, 3);

        function Locale() {}

        function Moment(config, skipOverflow) {
            if (skipOverflow !== false) {
                checkOverflow(config)
            }
            copyConfig(this, config);
            this._d = new Date(+config._d)
        }

        function Duration(duration) {
            var normalizedInput = normalizeObjectUnits(duration),
                years = normalizedInput.year || 0,
                quarters = normalizedInput.quarter || 0,
                months = normalizedInput.month || 0,
                weeks = normalizedInput.week || 0,
                days = normalizedInput.day || 0,
                hours = normalizedInput.hour || 0,
                minutes = normalizedInput.minute || 0,
                seconds = normalizedInput.second || 0,
                milliseconds = normalizedInput.millisecond || 0;
            this._milliseconds = +milliseconds + seconds * 1e3 + minutes * 6e4 + hours * 36e5;
            this._days = +days + weeks * 7;
            this._months = +months + quarters * 3 + years * 12;
            this._data = {};
            this._locale = moment.localeData();
            this._bubble()
        }

        function extend(a, b) {
            for (var i in b) {
                if (hasOwnProp(b, i)) {
                    a[i] = b[i]
                }
            }
            if (hasOwnProp(b, "toString")) {
                a.toString = b.toString
            }
            if (hasOwnProp(b, "valueOf")) {
                a.valueOf = b.valueOf
            }
            return a
        }

        function copyConfig(to, from) {
            var i, prop, val;
            if (typeof from._isAMomentObject !== "undefined") {
                to._isAMomentObject = from._isAMomentObject
            }
            if (typeof from._i !== "undefined") {
                to._i = from._i
            }
            if (typeof from._f !== "undefined") {
                to._f = from._f
            }
            if (typeof from._l !== "undefined") {
                to._l = from._l
            }
            if (typeof from._strict !== "undefined") {
                to._strict = from._strict
            }
            if (typeof from._tzm !== "undefined") {
                to._tzm = from._tzm
            }
            if (typeof from._isUTC !== "undefined") {
                to._isUTC = from._isUTC
            }
            if (typeof from._offset !== "undefined") {
                to._offset = from._offset
            }
            if (typeof from._pf !== "undefined") {
                to._pf = from._pf
            }
            if (typeof from._locale !== "undefined") {
                to._locale = from._locale
            }
            if (momentProperties.length > 0) {
                for (i in momentProperties) {
                    prop = momentProperties[i];
                    val = from[prop];
                    if (typeof val !== "undefined") {
                        to[prop] = val
                    }
                }
            }
            return to
        }

        function absRound(number) {
            if (number < 0) {
                return Math.ceil(number)
            } else {
                return Math.floor(number)
            }
        }

        function leftZeroFill(number, targetLength, forceSign) {
            var output = "" + Math.abs(number),
                sign = number >= 0;
            while (output.length < targetLength) {
                output = "0" + output
            }
            return (sign ? forceSign ? "+" : "" : "-") + output
        }

        function positiveMomentsDifference(base, other) {
            var res = {
                milliseconds: 0,
                months: 0
            };
            res.months = other.month() - base.month() + (other.year() - base.year()) * 12;
            if (base.clone().add(res.months, "M").isAfter(other)) {
                --res.months
            }
            res.milliseconds = +other - +base.clone().add(res.months, "M");
            return res
        }

        function momentsDifference(base, other) {
            var res;
            other = makeAs(other, base);
            if (base.isBefore(other)) {
                res = positiveMomentsDifference(base, other)
            } else {
                res = positiveMomentsDifference(other, base);
                res.milliseconds = -res.milliseconds;
                res.months = -res.months
            }
            return res
        }

        function createAdder(direction, name) {
            return function(val, period) {
                var dur, tmp;
                if (period !== null && !isNaN(+period)) {
                    deprecateSimple(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period).");
                    tmp = val;
                    val = period;
                    period = tmp
                }
                val = typeof val === "string" ? +val : val;
                dur = moment.duration(val, period);
                addOrSubtractDurationFromMoment(this, dur, direction);
                return this
            }
        }

        function addOrSubtractDurationFromMoment(mom, duration, isAdding, updateOffset) {
            var milliseconds = duration._milliseconds,
                days = duration._days,
                months = duration._months;
            updateOffset = updateOffset == null ? true : updateOffset;
            if (milliseconds) {
                mom._d.setTime(+mom._d + milliseconds * isAdding)
            }
            if (days) {
                rawSetter(mom, "Date", rawGetter(mom, "Date") + days * isAdding)
            }
            if (months) {
                rawMonthSetter(mom, rawGetter(mom, "Month") + months * isAdding)
            }
            if (updateOffset) {
                moment.updateOffset(mom, days || months)
            }
        }

        function isArray(input) {
            return Object.prototype.toString.call(input) === "[object Array]"
        }

        function isDate(input) {
            return Object.prototype.toString.call(input) === "[object Date]" || input instanceof Date
        }

        function compareArrays(array1, array2, dontConvert) {
            var len = Math.min(array1.length, array2.length),
                lengthDiff = Math.abs(array1.length - array2.length),
                diffs = 0,
                i;
            for (i = 0; i < len; i++) {
                if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) {
                    diffs++
                }
            }
            return diffs + lengthDiff
        }

        function normalizeUnits(units) {
            if (units) {
                var lowered = units.toLowerCase().replace(/(.)s$/, "$1");
                units = unitAliases[units] || camelFunctions[lowered] || lowered
            }
            return units
        }

        function normalizeObjectUnits(inputObject) {
            var normalizedInput = {},
                normalizedProp, prop;
            for (prop in inputObject) {
                if (hasOwnProp(inputObject, prop)) {
                    normalizedProp = normalizeUnits(prop);
                    if (normalizedProp) {
                        normalizedInput[normalizedProp] = inputObject[prop]
                    }
                }
            }
            return normalizedInput
        }

        function makeList(field) {
            var count, setter;
            if (field.indexOf("week") === 0) {
                count = 7;
                setter = "day"
            } else if (field.indexOf("month") === 0) {
                count = 12;
                setter = "month"
            } else {
                return
            }
            moment[field] = function(format, index) {
                var i, getter, method = moment._locale[field],
                    results = [];
                if (typeof format === "number") {
                    index = format;
                    format = undefined
                }
                getter = function(i) {
                    var m = moment().utc().set(setter, i);
                    return method.call(moment._locale, m, format || "")
                };
                if (index != null) {
                    return getter(index)
                } else {
                    for (i = 0; i < count; i++) {
                        results.push(getter(i))
                    }
                    return results
                }
            }
        }

        function toInt(argumentForCoercion) {
            var coercedNumber = +argumentForCoercion,
                value = 0;
            if (coercedNumber !== 0 && isFinite(coercedNumber)) {
                if (coercedNumber >= 0) {
                    value = Math.floor(coercedNumber)
                } else {
                    value = Math.ceil(coercedNumber)
                }
            }
            return value
        }

        function daysInMonth(year, month) {
            return new Date(Date.UTC(year, month + 1, 0)).getUTCDate()
        }

        function weeksInYear(year, dow, doy) {
            return weekOfYear(moment([year, 11, 31 + dow - doy]), dow, doy).week
        }

        function daysInYear(year) {
            return isLeapYear(year) ? 366 : 365
        }

        function isLeapYear(year) {
            return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0
        }

        function checkOverflow(m) {
            var overflow;
            if (m._a && m._pf.overflow === -2) {
                overflow = m._a[MONTH] < 0 || m._a[MONTH] > 11 ? MONTH : m._a[DATE] < 1 || m._a[DATE] > daysInMonth(m._a[YEAR], m._a[MONTH]) ? DATE : m._a[HOUR] < 0 || m._a[HOUR] > 23 ? HOUR : m._a[MINUTE] < 0 || m._a[MINUTE] > 59 ? MINUTE : m._a[SECOND] < 0 || m._a[SECOND] > 59 ? SECOND : m._a[MILLISECOND] < 0 || m._a[MILLISECOND] > 999 ? MILLISECOND : -1;
                if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
                    overflow = DATE
                }
                m._pf.overflow = overflow
            }
        }

        function isValid(m) {
            if (m._isValid == null) {
                m._isValid = !isNaN(m._d.getTime()) && m._pf.overflow < 0 && !m._pf.empty && !m._pf.invalidMonth && !m._pf.nullInput && !m._pf.invalidFormat && !m._pf.userInvalidated;
                if (m._strict) {
                    m._isValid = m._isValid && m._pf.charsLeftOver === 0 && m._pf.unusedTokens.length === 0
                }
            }
            return m._isValid
        }

        function normalizeLocale(key) {
            return key ? key.toLowerCase().replace("_", "-") : key
        }

        function chooseLocale(names) {
            var i = 0,
                j, next, locale, split;
            while (i < names.length) {
                split = normalizeLocale(names[i]).split("-");
                j = split.length;
                next = normalizeLocale(names[i + 1]);
                next = next ? next.split("-") : null;
                while (j > 0) {
                    locale = loadLocale(split.slice(0, j).join("-"));
                    if (locale) {
                        return locale
                    }
                    if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) {
                        break
                    }
                    j--
                }
                i++
            }
            return null
        }

        function loadLocale(name) {
            var oldLocale = null;
            if (!locales[name] && hasModule) {
                try {
                    oldLocale = moment.locale();
                    require("./locale/" + name);
                    moment.locale(oldLocale)
                } catch (e) {}
            }
            return locales[name]
        }

        function makeAs(input, model) {
            return model._isUTC ? moment(input).zone(model._offset || 0) : moment(input).local()
        }
        extend(Locale.prototype, {
            set: function(config) {
                var prop, i;
                for (i in config) {
                    prop = config[i];
                    if (typeof prop === "function") {
                        this[i] = prop
                    } else {
                        this["_" + i] = prop
                    }
                }
            },
            _months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
            months: function(m) {
                return this._months[m.month()]
            },
            _monthsShort: "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),
            monthsShort: function(m) {
                return this._monthsShort[m.month()]
            },
            monthsParse: function(monthName) {
                var i, mom, regex;
                if (!this._monthsParse) {
                    this._monthsParse = []
                }
                for (i = 0; i < 12; i++) {
                    if (!this._monthsParse[i]) {
                        mom = moment.utc([2e3, i]);
                        regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, "");
                        this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i")
                    }
                    if (this._monthsParse[i].test(monthName)) {
                        return i
                    }
                }
            },
            _weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
            weekdays: function(m) {
                return this._weekdays[m.day()]
            },
            _weekdaysShort: "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),
            weekdaysShort: function(m) {
                return this._weekdaysShort[m.day()]
            },
            _weekdaysMin: "Su_Mo_Tu_We_Th_Fr_Sa".split("_"),
            weekdaysMin: function(m) {
                return this._weekdaysMin[m.day()]
            },
            weekdaysParse: function(weekdayName) {
                var i, mom, regex;
                if (!this._weekdaysParse) {
                    this._weekdaysParse = []
                }
                for (i = 0; i < 7; i++) {
                    if (!this._weekdaysParse[i]) {
                        mom = moment([2e3, 1]).day(i);
                        regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, "");
                        this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i")
                    }
                    if (this._weekdaysParse[i].test(weekdayName)) {
                        return i
                    }
                }
            },
            _longDateFormat: {
                LT: "h:mm A",
                L: "MM/DD/YYYY",
                LL: "MMMM D, YYYY",
                LLL: "MMMM D, YYYY LT",
                LLLL: "dddd, MMMM D, YYYY LT"
            },
            longDateFormat: function(key) {
                var output = this._longDateFormat[key];
                if (!output && this._longDateFormat[key.toUpperCase()]) {
                    output = this._longDateFormat[key.toUpperCase()].replace(/MMMM|MM|DD|dddd/g, function(val) {
                        return val.slice(1)
                    });
                    this._longDateFormat[key] = output
                }
                return output
            },
            isPM: function(input) {
                return (input + "").toLowerCase().charAt(0) === "p"
            },
            _meridiemParse: /[ap]\.?m?\.?/i,
            meridiem: function(hours, minutes, isLower) {
                if (hours > 11) {
                    return isLower ? "pm" : "PM"
                } else {
                    return isLower ? "am" : "AM"
                }
            },
            _calendar: {
                sameDay: "[Today at] LT",
                nextDay: "[Tomorrow at] LT",
                nextWeek: "dddd [at] LT",
                lastDay: "[Yesterday at] LT",
                lastWeek: "[Last] dddd [at] LT",
                sameElse: "L"
            },
            calendar: function(key, mom) {
                var output = this._calendar[key];
                return typeof output === "function" ? output.apply(mom) : output
            },
            _relativeTime: {
                future: "in %s",
                past: "%s ago",
                s: "a few seconds",
                m: "a minute",
                mm: "%d minutes",
                h: "an hour",
                hh: "%d hours",
                d: "a day",
                dd: "%d days",
                M: "a month",
                MM: "%d months",
                y: "a year",
                yy: "%d years"
            },
            relativeTime: function(number, withoutSuffix, string, isFuture) {
                var output = this._relativeTime[string];
                return typeof output === "function" ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number)
            },
            pastFuture: function(diff, output) {
                var format = this._relativeTime[diff > 0 ? "future" : "past"];
                return typeof format === "function" ? format(output) : format.replace(/%s/i, output)
            },
            ordinal: function(number) {
                return this._ordinal.replace("%d", number)
            },
            _ordinal: "%d",
            preparse: function(string) {
                return string
            },
            postformat: function(string) {
                return string
            },
            week: function(mom) {
                return weekOfYear(mom, this._week.dow, this._week.doy).week
            },
            _week: {
                dow: 0,
                doy: 6
            },
            _invalidDate: "Invalid date",
            invalidDate: function() {
                return this._invalidDate
            }
        });

        function removeFormattingTokens(input) {
            if (input.match(/\[[\s\S]/)) {
                return input.replace(/^\[|\]$/g, "")
            }
            return input.replace(/\\/g, "")
        }

        function makeFormatFunction(format) {
            var array = format.match(formattingTokens),
                i, length;
            for (i = 0, length = array.length; i < length; i++) {
                if (formatTokenFunctions[array[i]]) {
                    array[i] = formatTokenFunctions[array[i]]
                } else {
                    array[i] = removeFormattingTokens(array[i])
                }
            }
            return function(mom) {
                var output = "";
                for (i = 0; i < length; i++) {
                    output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]
                }
                return output
            }
        }

        function formatMoment(m, format) {
            if (!m.isValid()) {
                return m.localeData().invalidDate()
            }
            format = expandFormat(format, m.localeData());
            if (!formatFunctions[format]) {
                formatFunctions[format] = makeFormatFunction(format)
            }
            return formatFunctions[format](m)
        }

        function expandFormat(format, locale) {
            var i = 5;

            function replaceLongDateFormatTokens(input) {
                return locale.longDateFormat(input) || input
            }
            localFormattingTokens.lastIndex = 0;
            while (i >= 0 && localFormattingTokens.test(format)) {
                format = format.replace(localFormattingTokens, replaceLongDateFormatTokens);
                localFormattingTokens.lastIndex = 0;
                i -= 1
            }
            return format
        }

        function getParseRegexForToken(token, config) {
            var a, strict = config._strict;
            switch (token) {
                case "Q":
                    return parseTokenOneDigit;
                case "DDDD":
                    return parseTokenThreeDigits;
                case "YYYY":
                case "GGGG":
                case "gggg":
                    return strict ? parseTokenFourDigits : parseTokenOneToFourDigits;
                case "Y":
                case "G":
                case "g":
                    return parseTokenSignedNumber;
                case "YYYYYY":
                case "YYYYY":
                case "GGGGG":
                case "ggggg":
                    return strict ? parseTokenSixDigits : parseTokenOneToSixDigits;
                case "S":
                    if (strict) {
                        return parseTokenOneDigit
                    }
                case "SS":
                    if (strict) {
                        return parseTokenTwoDigits
                    }
                case "SSS":
                    if (strict) {
                        return parseTokenThreeDigits
                    }
                case "DDD":
                    return parseTokenOneToThreeDigits;
                case "MMM":
                case "MMMM":
                case "dd":
                case "ddd":
                case "dddd":
                    return parseTokenWord;
                case "a":
                case "A":
                    return config._locale._meridiemParse;
                case "X":
                    return parseTokenTimestampMs;
                case "Z":
                case "ZZ":
                    return parseTokenTimezone;
                case "T":
                    return parseTokenT;
                case "SSSS":
                    return parseTokenDigits;
                case "MM":
                case "DD":
                case "YY":
                case "GG":
                case "gg":
                case "HH":
                case "hh":
                case "mm":
                case "ss":
                case "ww":
                case "WW":
                    return strict ? parseTokenTwoDigits : parseTokenOneOrTwoDigits;
                case "M":
                case "D":
                case "d":
                case "H":
                case "h":
                case "m":
                case "s":
                case "w":
                case "W":
                case "e":
                case "E":
                    return parseTokenOneOrTwoDigits;
                case "Do":
                    return parseTokenOrdinal;
                default:
                    a = new RegExp(regexpEscape(unescapeFormat(token.replace("\\", "")), "i"));
                    return a
            }
        }

        function timezoneMinutesFromString(string) {
            string = string || "";
            var possibleTzMatches = string.match(parseTokenTimezone) || [],
                tzChunk = possibleTzMatches[possibleTzMatches.length - 1] || [],
                parts = (tzChunk + "").match(parseTimezoneChunker) || ["-", 0, 0],
                minutes = +(parts[1] * 60) + toInt(parts[2]);
            return parts[0] === "+" ? -minutes : minutes
        }

        function addTimeToArrayFromToken(token, input, config) {
            var a, datePartArray = config._a;
            switch (token) {
                case "Q":
                    if (input != null) {
                        datePartArray[MONTH] = (toInt(input) - 1) * 3
                    }
                    break;
                case "M":
                case "MM":
                    if (input != null) {
                        datePartArray[MONTH] = toInt(input) - 1
                    }
                    break;
                case "MMM":
                case "MMMM":
                    a = config._locale.monthsParse(input);
                    if (a != null) {
                        datePartArray[MONTH] = a
                    } else {
                        config._pf.invalidMonth = input
                    }
                    break;
                case "D":
                case "DD":
                    if (input != null) {
                        datePartArray[DATE] = toInt(input)
                    }
                    break;
                case "Do":
                    if (input != null) {
                        datePartArray[DATE] = toInt(parseInt(input, 10))
                    }
                    break;
                case "DDD":
                case "DDDD":
                    if (input != null) {
                        config._dayOfYear = toInt(input)
                    }
                    break;
                case "YY":
                    datePartArray[YEAR] = moment.parseTwoDigitYear(input);
                    break;
                case "YYYY":
                case "YYYYY":
                case "YYYYYY":
                    datePartArray[YEAR] = toInt(input);
                    break;
                case "a":
                case "A":
                    config._isPm = config._locale.isPM(input);
                    break;
                case "H":
                case "HH":
                case "h":
                case "hh":
                    datePartArray[HOUR] = toInt(input);
                    break;
                case "m":
                case "mm":
                    datePartArray[MINUTE] = toInt(input);
                    break;
                case "s":
                case "ss":
                    datePartArray[SECOND] = toInt(input);
                    break;
                case "S":
                case "SS":
                case "SSS":
                case "SSSS":
                    datePartArray[MILLISECOND] = toInt(("0." + input) * 1e3);
                    break;
                case "X":
                    config._d = new Date(parseFloat(input) * 1e3);
                    break;
                case "Z":
                case "ZZ":
                    config._useUTC = true;
                    config._tzm = timezoneMinutesFromString(input);
                    break;
                case "dd":
                case "ddd":
                case "dddd":
                    a = config._locale.weekdaysParse(input);
                    if (a != null) {
                        config._w = config._w || {};
                        config._w["d"] = a
                    } else {
                        config._pf.invalidWeekday = input
                    }
                    break;
                case "w":
                case "ww":
                case "W":
                case "WW":
                case "d":
                case "e":
                case "E":
                    token = token.substr(0, 1);
                case "gggg":
                case "GGGG":
                case "GGGGG":
                    token = token.substr(0, 2);
                    if (input) {
                        config._w = config._w || {};
                        config._w[token] = toInt(input)
                    }
                    break;
                case "gg":
                case "GG":
                    config._w = config._w || {};
                    config._w[token] = moment.parseTwoDigitYear(input)
            }
        }

        function dayOfYearFromWeekInfo(config) {
            var w, weekYear, week, weekday, dow, doy, temp;
            w = config._w;
            if (w.GG != null || w.W != null || w.E != null) {
                dow = 1;
                doy = 4;
                weekYear = dfl(w.GG, config._a[YEAR], weekOfYear(moment(), 1, 4).year);
                week = dfl(w.W, 1);
                weekday = dfl(w.E, 1)
            } else {
                dow = config._locale._week.dow;
                doy = config._locale._week.doy;
                weekYear = dfl(w.gg, config._a[YEAR], weekOfYear(moment(), dow, doy).year);
                week = dfl(w.w, 1);
                if (w.d != null) {
                    weekday = w.d;
                    if (weekday < dow) {
                        ++week
                    }
                } else if (w.e != null) {
                    weekday = w.e + dow
                } else {
                    weekday = dow
                }
            }
            temp = dayOfYearFromWeeks(weekYear, week, weekday, doy, dow);
            config._a[YEAR] = temp.year;
            config._dayOfYear = temp.dayOfYear
        }

        function dateFromConfig(config) {
            var i, date, input = [],
                currentDate, yearToUse;
            if (config._d) {
                return
            }
            currentDate = currentDateArray(config);
            if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
                dayOfYearFromWeekInfo(config)
            }
            if (config._dayOfYear) {
                yearToUse = dfl(config._a[YEAR], currentDate[YEAR]);
                if (config._dayOfYear > daysInYear(yearToUse)) {
                    config._pf._overflowDayOfYear = true
                }
                date = makeUTCDate(yearToUse, 0, config._dayOfYear);
                config._a[MONTH] = date.getUTCMonth();
                config._a[DATE] = date.getUTCDate()
            }
            for (i = 0; i < 3 && config._a[i] == null; ++i) {
                config._a[i] = input[i] = currentDate[i]
            }
            for (; i < 7; i++) {
                config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i]
            }
            config._d = (config._useUTC ? makeUTCDate : makeDate).apply(null, input);
            if (config._tzm != null) {
                config._d.setUTCMinutes(config._d.getUTCMinutes() + config._tzm)
            }
        }

        function dateFromObject(config) {
            var normalizedInput;
            if (config._d) {
                return
            }
            normalizedInput = normalizeObjectUnits(config._i);
            config._a = [normalizedInput.year, normalizedInput.month, normalizedInput.day, normalizedInput.hour, normalizedInput.minute, normalizedInput.second, normalizedInput.millisecond];
            dateFromConfig(config)
        }

        function currentDateArray(config) {
            var now = new Date;
            if (config._useUTC) {
                return [now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()]
            } else {
                return [now.getFullYear(), now.getMonth(), now.getDate()]
            }
        }

        function makeDateFromStringAndFormat(config) {
            if (config._f === moment.ISO_8601) {
                parseISO(config);
                return
            }
            config._a = [];
            config._pf.empty = true;
            var string = "" + config._i,
                i, parsedInput, tokens, token, skipped, stringLength = string.length,
                totalParsedInputLength = 0;
            tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [];
            for (i = 0; i < tokens.length; i++) {
                token = tokens[i];
                parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0];
                if (parsedInput) {
                    skipped = string.substr(0, string.indexOf(parsedInput));
                    if (skipped.length > 0) {
                        config._pf.unusedInput.push(skipped)
                    }
                    string = string.slice(string.indexOf(parsedInput) + parsedInput.length);
                    totalParsedInputLength += parsedInput.length
                }
                if (formatTokenFunctions[token]) {
                    if (parsedInput) {
                        config._pf.empty = false
                    } else {
                        config._pf.unusedTokens.push(token)
                    }
                    addTimeToArrayFromToken(token, parsedInput, config)
                } else if (config._strict && !parsedInput) {
                    config._pf.unusedTokens.push(token)
                }
            }
            config._pf.charsLeftOver = stringLength - totalParsedInputLength;
            if (string.length > 0) {
                config._pf.unusedInput.push(string)
            }
            if (config._isPm && config._a[HOUR] < 12) {
                config._a[HOUR] += 12
            }
            if (config._isPm === false && config._a[HOUR] === 12) {
                config._a[HOUR] = 0
            }
            dateFromConfig(config);
            checkOverflow(config)
        }

        function unescapeFormat(s) {
            return s.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) {
                return p1 || p2 || p3 || p4
            })
        }

        function regexpEscape(s) {
            return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")
        }

        function makeDateFromStringAndArray(config) {
            var tempConfig, bestMoment, scoreToBeat, i, currentScore;
            if (config._f.length === 0) {
                config._pf.invalidFormat = true;
                config._d = new Date(NaN);
                return
            }
            for (i = 0; i < config._f.length; i++) {
                currentScore = 0;
                tempConfig = copyConfig({}, config);
                if (config._useUTC != null) {
                    tempConfig._useUTC = config._useUTC
                }
                tempConfig._pf = defaultParsingFlags();
                tempConfig._f = config._f[i];
                makeDateFromStringAndFormat(tempConfig);
                if (!isValid(tempConfig)) {
                    continue
                }
                currentScore += tempConfig._pf.charsLeftOver;
                currentScore += tempConfig._pf.unusedTokens.length * 10;
                tempConfig._pf.score = currentScore;
                if (scoreToBeat == null || currentScore < scoreToBeat) {
                    scoreToBeat = currentScore;
                    bestMoment = tempConfig
                }
            }
            extend(config, bestMoment || tempConfig)
        }

        function parseISO(config) {
            var i, l, string = config._i,
                match = isoRegex.exec(string);
            if (match) {
                config._pf.iso = true;
                for (i = 0, l = isoDates.length; i < l; i++) {
                    if (isoDates[i][1].exec(string)) {
                        config._f = isoDates[i][0] + (match[6] || " ");
                        break
                    }
                }
                for (i = 0, l = isoTimes.length; i < l; i++) {
                    if (isoTimes[i][1].exec(string)) {
                        config._f += isoTimes[i][0];
                        break
                    }
                }
                if (string.match(parseTokenTimezone)) {
                    config._f += "Z"
                }
                makeDateFromStringAndFormat(config)
            } else {
                config._isValid = false
            }
        }

        function makeDateFromString(config) {
            parseISO(config);
            if (config._isValid === false) {
                delete config._isValid;
                moment.createFromInputFallback(config)
            }
        }

        function map(arr, fn) {
            var res = [],
                i;
            for (i = 0; i < arr.length; ++i) {
                res.push(fn(arr[i], i))
            }
            return res
        }

        function makeDateFromInput(config) {
            var input = config._i,
                matched;
            if (input === undefined) {
                config._d = new Date
            } else if (isDate(input)) {
                config._d = new Date(+input)
            } else if ((matched = aspNetJsonRegex.exec(input)) !== null) {
                config._d = new Date(+matched[1])
            } else if (typeof input === "string") {
                makeDateFromString(config)
            } else if (isArray(input)) {
                config._a = map(input.slice(0), function(obj) {
                    return parseInt(obj, 10)
                });
                dateFromConfig(config)
            } else if (typeof input === "object") {
                dateFromObject(config)
            } else if (typeof input === "number") {
                config._d = new Date(input)
            } else {
                moment.createFromInputFallback(config)
            }
        }

        function makeDate(y, m, d, h, M, s, ms) {
            var date = new Date(y, m, d, h, M, s, ms);
            if (y < 1970) {
                date.setFullYear(y)
            }
            return date
        }

        function makeUTCDate(y) {
            var date = new Date(Date.UTC.apply(null, arguments));
            if (y < 1970) {
                date.setUTCFullYear(y)
            }
            return date
        }

        function parseWeekday(input, locale) {
            if (typeof input === "string") {
                if (!isNaN(input)) {
                    input = parseInt(input, 10)
                } else {
                    input = locale.weekdaysParse(input);
                    if (typeof input !== "number") {
                        return null
                    }
                }
            }
            return input
        }

        function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
            return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture)
        }

        function relativeTime(posNegDuration, withoutSuffix, locale) {
            var duration = moment.duration(posNegDuration).abs(),
                seconds = round(duration.as("s")),
                minutes = round(duration.as("m")),
                hours = round(duration.as("h")),
                days = round(duration.as("d")),
                months = round(duration.as("M")),
                years = round(duration.as("y")),
                args = seconds < relativeTimeThresholds.s && ["s", seconds] || minutes === 1 && ["m"] || minutes < relativeTimeThresholds.m && ["mm", minutes] || hours === 1 && ["h"] || hours < relativeTimeThresholds.h && ["hh", hours] || days === 1 && ["d"] || days < relativeTimeThresholds.d && ["dd", days] || months === 1 && ["M"] || months < relativeTimeThresholds.M && ["MM", months] || years === 1 && ["y"] || ["yy", years];
            args[2] = withoutSuffix;
            args[3] = +posNegDuration > 0;
            args[4] = locale;
            return substituteTimeAgo.apply({}, args)
        }

        function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) {
            var end = firstDayOfWeekOfYear - firstDayOfWeek,
                daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(),
                adjustedMoment;
            if (daysToDayOfWeek > end) {
                daysToDayOfWeek -= 7
            }
            if (daysToDayOfWeek < end - 7) {
                daysToDayOfWeek += 7
            }
            adjustedMoment = moment(mom).add(daysToDayOfWeek, "d");
            return {
                week: Math.ceil(adjustedMoment.dayOfYear() / 7),
                year: adjustedMoment.year()
            }
        }

        function dayOfYearFromWeeks(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) {
            var d = makeUTCDate(year, 0, 1).getUTCDay(),
                daysToAdd, dayOfYear;
            d = d === 0 ? 7 : d;
            weekday = weekday != null ? weekday : firstDayOfWeek;
            daysToAdd = firstDayOfWeek - d + (d > firstDayOfWeekOfYear ? 7 : 0) - (d < firstDayOfWeek ? 7 : 0);
            dayOfYear = 7 * (week - 1) + (weekday - firstDayOfWeek) + daysToAdd + 1;
            return {
                year: dayOfYear > 0 ? year : year - 1,
                dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear
            }
        }

        function makeMoment(config) {
            var input = config._i,
                format = config._f;
            config._locale = config._locale || moment.localeData(config._l);
            if (input === null || format === undefined && input === "") {
                return moment.invalid({
                    nullInput: true
                })
            }
            if (typeof input === "string") {
                config._i = input = config._locale.preparse(input)
            }
            if (moment.isMoment(input)) {
                return new Moment(input, true)
            } else if (format) {
                if (isArray(format)) {
                    makeDateFromStringAndArray(config)
                } else {
                    makeDateFromStringAndFormat(config)
                }
            } else {
                makeDateFromInput(config)
            }
            return new Moment(config)
        }
        moment = function(input, format, locale, strict) {
            var c;
            if (typeof locale === "boolean") {
                strict = locale;
                locale = undefined
            }
            c = {};
            c._isAMomentObject = true;
            c._i = input;
            c._f = format;
            c._l = locale;
            c._strict = strict;
            c._isUTC = false;
            c._pf = defaultParsingFlags();
            return makeMoment(c)
        };
        moment.suppressDeprecationWarnings = false;
        moment.createFromInputFallback = deprecate("moment construction falls back to js Date. This is " + "discouraged and will be removed in upcoming major " + "release. Please refer to " + "https://github.com/moment/moment/issues/1407 for more info.", function(config) {
            config._d = new Date(config._i)
        });

        function pickBy(fn, moments) {
            var res, i;
            if (moments.length === 1 && isArray(moments[0])) {
                moments = moments[0]
            }
            if (!moments.length) {
                return moment()
            }
            res = moments[0];
            for (i = 1; i < moments.length; ++i) {
                if (moments[i][fn](res)) {
                    res = moments[i]
                }
            }
            return res
        }
        moment.min = function() {
            var args = [].slice.call(arguments, 0);
            return pickBy("isBefore", args)
        };
        moment.max = function() {
            var args = [].slice.call(arguments, 0);
            return pickBy("isAfter", args)
        };
        moment.utc = function(input, format, locale, strict) {
            var c;
            if (typeof locale === "boolean") {
                strict = locale;
                locale = undefined
            }
            c = {};
            c._isAMomentObject = true;
            c._useUTC = true;
            c._isUTC = true;
            c._l = locale;
            c._i = input;
            c._f = format;
            c._strict = strict;
            c._pf = defaultParsingFlags();
            return makeMoment(c).utc()
        };
        moment.unix = function(input) {
            return moment(input * 1e3)
        };
        moment.duration = function(input, key) {
            var duration = input,
                match = null,
                sign, ret, parseIso, diffRes;
            if (moment.isDuration(input)) {
                duration = {
                    ms: input._milliseconds,
                    d: input._days,
                    M: input._months
                }
            } else if (typeof input === "number") {
                duration = {};
                if (key) {
                    duration[key] = input
                } else {
                    duration.milliseconds = input
                }
            } else if (!!(match = aspNetTimeSpanJsonRegex.exec(input))) {
                sign = match[1] === "-" ? -1 : 1;
                duration = {
                    y: 0,
                    d: toInt(match[DATE]) * sign,
                    h: toInt(match[HOUR]) * sign,
                    m: toInt(match[MINUTE]) * sign,
                    s: toInt(match[SECOND]) * sign,
                    ms: toInt(match[MILLISECOND]) * sign
                }
            } else if (!!(match = isoDurationRegex.exec(input))) {
                sign = match[1] === "-" ? -1 : 1;
                parseIso = function(inp) {
                    var res = inp && parseFloat(inp.replace(",", "."));
                    return (isNaN(res) ? 0 : res) * sign
                };
                duration = {
                    y: parseIso(match[2]),
                    M: parseIso(match[3]),
                    d: parseIso(match[4]),
                    h: parseIso(match[5]),
                    m: parseIso(match[6]),
                    s: parseIso(match[7]),
                    w: parseIso(match[8])
                }
            } else if (typeof duration === "object" && ("from" in duration || "to" in duration)) {
                diffRes = momentsDifference(moment(duration.from), moment(duration.to));
                duration = {};
                duration.ms = diffRes.milliseconds;
                duration.M = diffRes.months
            }
            ret = new Duration(duration);
            if (moment.isDuration(input) && hasOwnProp(input, "_locale")) {
                ret._locale = input._locale
            }
            return ret
        };
        moment.version = VERSION;
        moment.defaultFormat = isoFormat;
        moment.ISO_8601 = function() {};
        moment.momentProperties = momentProperties;
        moment.updateOffset = function() {};
        moment.relativeTimeThreshold = function(threshold, limit) {
            if (relativeTimeThresholds[threshold] === undefined) {
                return false
            }
            if (limit === undefined) {
                return relativeTimeThresholds[threshold]
            }
            relativeTimeThresholds[threshold] = limit;
            return true
        };
        moment.lang = deprecate("moment.lang is deprecated. Use moment.locale instead.", function(key, value) {
            return moment.locale(key, value)
        });
        moment.locale = function(key, values) {
            var data;
            if (key) {
                if (typeof values !== "undefined") {
                    data = moment.defineLocale(key, values)
                } else {
                    data = moment.localeData(key)
                }
                if (data) {
                    moment.duration._locale = moment._locale = data
                }
            }
            return moment._locale._abbr
        };
        moment.defineLocale = function(name, values) {
            if (values !== null) {
                values.abbr = name;
                if (!locales[name]) {
                    locales[name] = new Locale
                }
                locales[name].set(values);
                moment.locale(name);
                return locales[name]
            } else {
                delete locales[name];
                return null
            }
        };
        moment.langData = deprecate("moment.langData is deprecated. Use moment.localeData instead.", function(key) {
            return moment.localeData(key)
        });
        moment.localeData = function(key) {
            var locale;
            if (key && key._locale && key._locale._abbr) {
                key = key._locale._abbr
            }
            if (!key) {
                return moment._locale
            }
            if (!isArray(key)) {
                locale = loadLocale(key);
                if (locale) {
                    return locale
                }
                key = [key]
            }
            return chooseLocale(key)
        };
        moment.isMoment = function(obj) {
            return obj instanceof Moment || obj != null && hasOwnProp(obj, "_isAMomentObject")
        };
        moment.isDuration = function(obj) {
            return obj instanceof Duration
        };
        for (i = lists.length - 1; i >= 0; --i) {
            makeList(lists[i])
        }
        moment.normalizeUnits = function(units) {
            return normalizeUnits(units)
        };
        moment.invalid = function(flags) {
            var m = moment.utc(NaN);
            if (flags != null) {
                extend(m._pf, flags)
            } else {
                m._pf.userInvalidated = true
            }
            return m
        };
        moment.parseZone = function() {
            return moment.apply(null, arguments).parseZone()
        };
        moment.parseTwoDigitYear = function(input) {
            return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3)
        };
        extend(moment.fn = Moment.prototype, {
            clone: function() {
                return moment(this)
            },
            valueOf: function() {
                return +this._d + (this._offset || 0) * 6e4
            },
            unix: function() {
                return Math.floor(+this / 1e3)
            },
            toString: function() {
                return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")
            },
            toDate: function() {
                return this._offset ? new Date(+this) : this._d
            },
            toISOString: function() {
                var m = moment(this).utc();
                if (0 < m.year() && m.year() <= 9999) {
                    return formatMoment(m, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]")
                } else {
                    return formatMoment(m, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")
                }
            },
            toArray: function() {
                var m = this;
                return [m.year(), m.month(), m.date(), m.hours(), m.minutes(), m.seconds(), m.milliseconds()]
            },
            isValid: function() {
                return isValid(this)
            },
            isDSTShifted: function() {
                if (this._a) {
                    return this.isValid() && compareArrays(this._a, (this._isUTC ? moment.utc(this._a) : moment(this._a)).toArray()) > 0
                }
                return false
            },
            parsingFlags: function() {
                return extend({}, this._pf)
            },
            invalidAt: function() {
                return this._pf.overflow
            },
            utc: function(keepLocalTime) {
                return this.zone(0, keepLocalTime)
            },
            local: function(keepLocalTime) {
                if (this._isUTC) {
                    this.zone(0, keepLocalTime);
                    this._isUTC = false;
                    if (keepLocalTime) {
                        this.add(this._dateTzOffset(), "m")
                    }
                }
                return this
            },
            format: function(inputString) {
                var output = formatMoment(this, inputString || moment.defaultFormat);
                return this.localeData().postformat(output)
            },
            add: createAdder(1, "add"),
            subtract: createAdder(-1, "subtract"),
            diff: function(input, units, asFloat) {
                var that = makeAs(input, this),
                    zoneDiff = (this.zone() - that.zone()) * 6e4,
                    diff, output, daysAdjust;
                units = normalizeUnits(units);
                if (units === "year" || units === "month") {
                    diff = (this.daysInMonth() + that.daysInMonth()) * 432e5;
                    output = (this.year() - that.year()) * 12 + (this.month() - that.month());
                    daysAdjust = this - moment(this).startOf("month") - (that - moment(that).startOf("month"));
                    daysAdjust -= (this.zone() - moment(this).startOf("month").zone() - (that.zone() - moment(that).startOf("month").zone())) * 6e4;
                    output += daysAdjust / diff;
                    if (units === "year") {
                        output = output / 12
                    }
                } else {
                    diff = this - that;
                    output = units === "second" ? diff / 1e3 : units === "minute" ? diff / 6e4 : units === "hour" ? diff / 36e5 : units === "day" ? (diff - zoneDiff) / 864e5 : units === "week" ? (diff - zoneDiff) / 6048e5 : diff
                }
                return asFloat ? output : absRound(output)
            },
            from: function(time, withoutSuffix) {
                return moment.duration({
                    to: this,
                    from: time
                }).locale(this.locale()).humanize(!withoutSuffix)
            },
            fromNow: function(withoutSuffix) {
                return this.from(moment(), withoutSuffix)
            },
            calendar: function(time) {
                var now = time || moment(),
                    sod = makeAs(now, this).startOf("day"),
                    diff = this.diff(sod, "days", true),
                    format = diff < -6 ? "sameElse" : diff < -1 ? "lastWeek" : diff < 0 ? "lastDay" : diff < 1 ? "sameDay" : diff < 2 ? "nextDay" : diff < 7 ? "nextWeek" : "sameElse";
                return this.format(this.localeData().calendar(format, this))
            },
            isLeapYear: function() {
                return isLeapYear(this.year())
            },
            isDST: function() {
                return this.zone() < this.clone().month(0).zone() || this.zone() < this.clone().month(5).zone()
            },
            day: function(input) {
                var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
                if (input != null) {
                    input = parseWeekday(input, this.localeData());
                    return this.add(input - day, "d")
                } else {
                    return day
                }
            },
            month: makeAccessor("Month", true),
            startOf: function(units) {
                units = normalizeUnits(units);
                switch (units) {
                    case "year":
                        this.month(0);
                    case "quarter":
                    case "month":
                        this.date(1);
                    case "week":
                    case "isoWeek":
                    case "day":
                        this.hours(0);
                    case "hour":
                        this.minutes(0);
                    case "minute":
                        this.seconds(0);
                    case "second":
                        this.milliseconds(0)
                }
                if (units === "week") {
                    this.weekday(0)
                } else if (units === "isoWeek") {
                    this.isoWeekday(1)
                }
                if (units === "quarter") {
                    this.month(Math.floor(this.month() / 3) * 3)
                }
                return this
            },
            endOf: function(units) {
                units = normalizeUnits(units);
                return this.startOf(units).add(1, units === "isoWeek" ? "week" : units).subtract(1, "ms")
            },
            isAfter: function(input, units) {
                units = normalizeUnits(typeof units !== "undefined" ? units : "millisecond");
                if (units === "millisecond") {
                    input = moment.isMoment(input) ? input : moment(input);
                    return +this > +input
                } else {
                    return +this.clone().startOf(units) > +moment(input).startOf(units)
                }
            },
            isBefore: function(input, units) {
                units = normalizeUnits(typeof units !== "undefined" ? units : "millisecond");
                if (units === "millisecond") {
                    input = moment.isMoment(input) ? input : moment(input);
                    return +this < +input
                } else {
                    return +this.clone().startOf(units) < +moment(input).startOf(units)
                }
            },
            isSame: function(input, units) {
                units = normalizeUnits(units || "millisecond");
                if (units === "millisecond") {
                    input = moment.isMoment(input) ? input : moment(input);
                    return +this === +input
                } else {
                    return +this.clone().startOf(units) === +makeAs(input, this).startOf(units)
                }
            },
            min: deprecate("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", function(other) {
                other = moment.apply(null, arguments);
                return other < this ? this : other
            }),
            max: deprecate("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", function(other) {
                other = moment.apply(null, arguments);
                return other > this ? this : other
            }),
            zone: function(input, keepLocalTime) {
                var offset = this._offset || 0,
                    localAdjust;
                if (input != null) {
                    if (typeof input === "string") {
                        input = timezoneMinutesFromString(input)
                    }
                    if (Math.abs(input) < 16) {
                        input = input * 60
                    }
                    if (!this._isUTC && keepLocalTime) {
                        localAdjust = this._dateTzOffset()
                    }
                    this._offset = input;
                    this._isUTC = true;
                    if (localAdjust != null) {
                        this.subtract(localAdjust, "m")
                    }
                    if (offset !== input) {
                        if (!keepLocalTime || this._changeInProgress) {
                            addOrSubtractDurationFromMoment(this, moment.duration(offset - input, "m"), 1, false)
                        } else if (!this._changeInProgress) {
                            this._changeInProgress = true;
                            moment.updateOffset(this, true);
                            this._changeInProgress = null
                        }
                    }
                } else {
                    return this._isUTC ? offset : this._dateTzOffset()
                }
                return this
            },
            zoneAbbr: function() {
                return this._isUTC ? "UTC" : ""
            },
            zoneName: function() {
                return this._isUTC ? "Coordinated Universal Time" : ""
            },
            parseZone: function() {
                if (this._tzm) {
                    this.zone(this._tzm)
                } else if (typeof this._i === "string") {
                    this.zone(this._i)
                }
                return this
            },
            hasAlignedHourOffset: function(input) {
                if (!input) {
                    input = 0
                } else {
                    input = moment(input).zone()
                }
                return (this.zone() - input) % 60 === 0
            },
            daysInMonth: function() {
                return daysInMonth(this.year(), this.month())
            },
            dayOfYear: function(input) {
                var dayOfYear = round((moment(this).startOf("day") - moment(this).startOf("year")) / 864e5) + 1;
                return input == null ? dayOfYear : this.add(input - dayOfYear, "d")
            },
            quarter: function(input) {
                return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3)
            },
            weekYear: function(input) {
                var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year;
                return input == null ? year : this.add(input - year, "y")
            },
            isoWeekYear: function(input) {
                var year = weekOfYear(this, 1, 4).year;
                return input == null ? year : this.add(input - year, "y")
            },
            week: function(input) {
                var week = this.localeData().week(this);
                return input == null ? week : this.add((input - week) * 7, "d")
            },
            isoWeek: function(input) {
                var week = weekOfYear(this, 1, 4).week;
                return input == null ? week : this.add((input - week) * 7, "d")
            },
            weekday: function(input) {
                var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
                return input == null ? weekday : this.add(input - weekday, "d")
            },
            isoWeekday: function(input) {
                return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7)
            },
            isoWeeksInYear: function() {
                return weeksInYear(this.year(), 1, 4)
            },
            weeksInYear: function() {
                var weekInfo = this.localeData()._week;
                return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy)
            },
            get: function(units) {
                units = normalizeUnits(units);
                return this[units]()
            },
            set: function(units, value) {
                units = normalizeUnits(units);
                if (typeof this[units] === "function") {
                    this[units](value)
                }
                return this
            },
            locale: function(key) {
                var newLocaleData;
                if (key === undefined) {
                    return this._locale._abbr
                } else {
                    newLocaleData = moment.localeData(key);
                    if (newLocaleData != null) {
                        this._locale = newLocaleData
                    }
                    return this
                }
            },
            lang: deprecate("moment().lang() is deprecated. Use moment().localeData() instead.", function(key) {
                if (key === undefined) {
                    return this.localeData()
                } else {
                    return this.locale(key)
                }
            }),
            localeData: function() {
                return this._locale
            },
            _dateTzOffset: function() {
                return Math.round(this._d.getTimezoneOffset() / 15) * 15
            }
        });

        function rawMonthSetter(mom, value) {
            var dayOfMonth;
            if (typeof value === "string") {
                value = mom.localeData().monthsParse(value);
                if (typeof value !== "number") {
                    return mom
                }
            }
            dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
            mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth);
            return mom
        }

        function rawGetter(mom, unit) {
            return mom._d["get" + (mom._isUTC ? "UTC" : "") + unit]()
        }

        function rawSetter(mom, unit, value) {
            if (unit === "Month") {
                return rawMonthSetter(mom, value)
            } else {
                return mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value)
            }
        }

        function makeAccessor(unit, keepTime) {
            return function(value) {
                if (value != null) {
                    rawSetter(this, unit, value);
                    moment.updateOffset(this, keepTime);
                    return this
                } else {
                    return rawGetter(this, unit)
                }
            }
        }
        moment.fn.millisecond = moment.fn.milliseconds = makeAccessor("Milliseconds", false);
        moment.fn.second = moment.fn.seconds = makeAccessor("Seconds", false);
        moment.fn.minute = moment.fn.minutes = makeAccessor("Minutes", false);
        moment.fn.hour = moment.fn.hours = makeAccessor("Hours", true);
        moment.fn.date = makeAccessor("Date", true);
        moment.fn.dates = deprecate("dates accessor is deprecated. Use date instead.", makeAccessor("Date", true));
        moment.fn.year = makeAccessor("FullYear", true);
        moment.fn.years = deprecate("years accessor is deprecated. Use year instead.", makeAccessor("FullYear", true));
        moment.fn.days = moment.fn.day;
        moment.fn.months = moment.fn.month;
        moment.fn.weeks = moment.fn.week;
        moment.fn.isoWeeks = moment.fn.isoWeek;
        moment.fn.quarters = moment.fn.quarter;
        moment.fn.toJSON = moment.fn.toISOString;

        function daysToYears(days) {
            return days * 400 / 146097
        }

        function yearsToDays(years) {
            return years * 146097 / 400
        }
        extend(moment.duration.fn = Duration.prototype, {
            _bubble: function() {
                var milliseconds = this._milliseconds,
                    days = this._days,
                    months = this._months,
                    data = this._data,
                    seconds, minutes, hours, years = 0;
                data.milliseconds = milliseconds % 1e3;
                seconds = absRound(milliseconds / 1e3);
                data.seconds = seconds % 60;
                minutes = absRound(seconds / 60);
                data.minutes = minutes % 60;
                hours = absRound(minutes / 60);
                data.hours = hours % 24;
                days += absRound(hours / 24);
                years = absRound(daysToYears(days));
                days -= absRound(yearsToDays(years));
                months += absRound(days / 30);
                days %= 30;
                years += absRound(months / 12);
                months %= 12;
                data.days = days;
                data.months = months;
                data.years = years
            },
            abs: function() {
                this._milliseconds = Math.abs(this._milliseconds);
                this._days = Math.abs(this._days);
                this._months = Math.abs(this._months);
                this._data.milliseconds = Math.abs(this._data.milliseconds);
                this._data.seconds = Math.abs(this._data.seconds);
                this._data.minutes = Math.abs(this._data.minutes);
                this._data.hours = Math.abs(this._data.hours);
                this._data.months = Math.abs(this._data.months);
                this._data.years = Math.abs(this._data.years);
                return this
            },
            weeks: function() {
                return absRound(this.days() / 7)
            },
            valueOf: function() {
                return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6
            },
            humanize: function(withSuffix) {
                var output = relativeTime(this, !withSuffix, this.localeData());
                if (withSuffix) {
                    output = this.localeData().pastFuture(+this, output)
                }
                return this.localeData().postformat(output)
            },
            add: function(input, val) {
                var dur = moment.duration(input, val);
                this._milliseconds += dur._milliseconds;
                this._days += dur._days;
                this._months += dur._months;
                this._bubble();
                return this
            },
            subtract: function(input, val) {
                var dur = moment.duration(input, val);
                this._milliseconds -= dur._milliseconds;
                this._days -= dur._days;
                this._months -= dur._months;
                this._bubble();
                return this
            },
            get: function(units) {
                units = normalizeUnits(units);
                return this[units.toLowerCase() + "s"]()
            },
            as: function(units) {
                var days, months;
                units = normalizeUnits(units);
                if (units === "month" || units === "year") {
                    days = this._days + this._milliseconds / 864e5;
                    months = this._months + daysToYears(days) * 12;
                    return units === "month" ? months : months / 12
                } else {
                    days = this._days + yearsToDays(this._months / 12);
                    switch (units) {
                        case "week":
                            return days / 7 + this._milliseconds / 6048e5;
                        case "day":
                            return days + this._milliseconds / 864e5;
                        case "hour":
                            return days * 24 + this._milliseconds / 36e5;
                        case "minute":
                            return days * 24 * 60 + this._milliseconds / 6e4;
                        case "second":
                            return days * 24 * 60 * 60 + this._milliseconds / 1e3;
                        case "millisecond":
                            return Math.floor(days * 24 * 60 * 60 * 1e3) + this._milliseconds;
                        default:
                            throw new Error("Unknown unit " + units)
                    }
                }
            },
            lang: moment.fn.lang,
            locale: moment.fn.locale,
            toIsoString: deprecate("toIsoString() is deprecated. Please use toISOString() instead " + "(notice the capitals)", function() {
                return this.toISOString()
            }),
            toISOString: function() {
                var years = Math.abs(this.years()),
                    months = Math.abs(this.months()),
                    days = Math.abs(this.days()),
                    hours = Math.abs(this.hours()),
                    minutes = Math.abs(this.minutes()),
                    seconds = Math.abs(this.seconds() + this.milliseconds() / 1e3);
                if (!this.asSeconds()) {
                    return "P0D"
                }
                return (this.asSeconds() < 0 ? "-" : "") + "P" + (years ? years + "Y" : "") + (months ? months + "M" : "") + (days ? days + "D" : "") + (hours || minutes || seconds ? "T" : "") + (hours ? hours + "H" : "") + (minutes ? minutes + "M" : "") + (seconds ? seconds + "S" : "")
            },
            localeData: function() {
                return this._locale
            }
        });
        moment.duration.fn.toString = moment.duration.fn.toISOString;

        function makeDurationGetter(name) {
            moment.duration.fn[name] = function() {
                return this._data[name]
            }
        }
        for (i in unitMillisecondFactors) {
            if (hasOwnProp(unitMillisecondFactors, i)) {
                makeDurationGetter(i.toLowerCase())
            }
        }
        moment.duration.fn.asMilliseconds = function() {
            return this.as("ms")
        };
        moment.duration.fn.asSeconds = function() {
            return this.as("s")
        };
        moment.duration.fn.asMinutes = function() {
            return this.as("m")
        };
        moment.duration.fn.asHours = function() {
            return this.as("h")
        };
        moment.duration.fn.asDays = function() {
            return this.as("d")
        };
        moment.duration.fn.asWeeks = function() {
            return this.as("weeks")
        };
        moment.duration.fn.asMonths = function() {
            return this.as("M")
        };
        moment.duration.fn.asYears = function() {
            return this.as("y")
        };
        moment.locale("en", {
            ordinal: function(number) {
                var b = number % 10,
                    output = toInt(number % 100 / 10) === 1 ? "th" : b === 1 ? "st" : b === 2 ? "nd" : b === 3 ? "rd" : "th";
                return number + output
            }
        });

        function makeGlobal(shouldDeprecate) {
            if (typeof ender !== "undefined") {
                return
            }
            oldGlobalMoment = globalScope.moment;
            if (shouldDeprecate) {
                globalScope.moment = deprecate("Accessing Moment through the global scope is " + "deprecated, and will be removed in an upcoming " + "release.", moment)
            } else {
                globalScope.moment = moment
            }
        }
        if (hasModule) {
            module.exports = moment
        } else if (typeof define === "function" && define.amd) {
            define("moment", function(require, exports, module) {
                if (module.config && module.config() && module.config().noGlobal === true) {
                    globalScope.moment = oldGlobalMoment
                }
                return moment
            });
            makeGlobal(true)
        } else {
            makeGlobal()
        }
    }).call(this);
    return module.exports
});
define("hammer", ["exports", "module"], function(exports, module) {
    var define = undefined;
    (function(window, document, exportName, undefined) {
        "use strict";
        var VENDOR_PREFIXES = ["", "webkit", "moz", "MS", "ms", "o"];
        var TEST_ELEMENT = document.createElement("div");
        var TYPE_FUNCTION = "function";
        var round = Math.round;
        var abs = Math.abs;
        var now = Date.now;

        function setTimeoutContext(fn, timeout, context) {
            return setTimeout(bindFn(fn, context), timeout)
        }

        function invokeArrayArg(arg, fn, context) {
            if (Array.isArray(arg)) {
                each(arg, context[fn], context);
                return true
            }
            return false
        }

        function each(obj, iterator, context) {
            var i;
            if (!obj) {
                return
            }
            if (obj.forEach) {
                obj.forEach(iterator, context)
            } else if (obj.length !== undefined) {
                i = 0;
                while (i < obj.length) {
                    iterator.call(context, obj[i], i, obj);
                    i++
                }
            } else {
                for (i in obj) {
                    obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj)
                }
            }
        }

        function extend(dest, src, merge) {
            var keys = Object.keys(src);
            var i = 0;
            while (i < keys.length) {
                if (!merge || merge && dest[keys[i]] === undefined) {
                    dest[keys[i]] = src[keys[i]]
                }
                i++
            }
            return dest
        }

        function merge(dest, src) {
            return extend(dest, src, true)
        }

        function inherit(child, base, properties) {
            var baseP = base.prototype,
                childP;
            childP = child.prototype = Object.create(baseP);
            childP.constructor = child;
            childP._super = baseP;
            if (properties) {
                extend(childP, properties)
            }
        }

        function bindFn(fn, context) {
            return function boundFn() {
                return fn.apply(context, arguments)
            }
        }

        function boolOrFn(val, args) {
            if (typeof val == TYPE_FUNCTION) {
                return val.apply(args ? args[0] || undefined : undefined, args)
            }
            return val
        }

        function ifUndefined(val1, val2) {
            return val1 === undefined ? val2 : val1
        }

        function addEventListeners(target, types, handler) {
            each(splitStr(types), function(type) {
                target.addEventListener(type, handler, false)
            })
        }

        function removeEventListeners(target, types, handler) {
            each(splitStr(types), function(type) {
                target.removeEventListener(type, handler, false)
            })
        }

        function hasParent(node, parent) {
            while (node) {
                if (node == parent) {
                    return true
                }
                node = node.parentNode
            }
            return false
        }

        function inStr(str, find) {
            return str.indexOf(find) > -1
        }

        function splitStr(str) {
            return str.trim().split(/\s+/g)
        }

        function inArray(src, find, findByKey) {
            if (src.indexOf && !findByKey) {
                return src.indexOf(find)
            } else {
                var i = 0;
                while (i < src.length) {
                    if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {
                        return i
                    }
                    i++
                }
                return -1
            }
        }

        function toArray(obj) {
            return Array.prototype.slice.call(obj, 0)
        }

        function uniqueArray(src, key, sort) {
            var results = [];
            var values = [];
            var i = 0;
            while (i < src.length) {
                var val = key ? src[i][key] : src[i];
                if (inArray(values, val) < 0) {
                    results.push(src[i])
                }
                values[i] = val;
                i++
            }
            if (sort) {
                if (!key) {
                    results = results.sort()
                } else {
                    results = results.sort(function sortUniqueArray(a, b) {
                        return a[key] > b[key]
                    })
                }
            }
            return results
        }

        function prefixed(obj, property) {
            var prefix, prop;
            var camelProp = property[0].toUpperCase() + property.slice(1);
            var i = 0;
            while (i < VENDOR_PREFIXES.length) {
                prefix = VENDOR_PREFIXES[i];
                prop = prefix ? prefix + camelProp : property;
                if (prop in obj) {
                    return prop
                }
                i++
            }
            return undefined
        }
        var _uniqueId = 1;

        function uniqueId() {
            return _uniqueId++
        }

        function getWindowForElement(element) {
            var doc = element.ownerDocument;
            return doc.defaultView || doc.parentWindow
        }
        var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
        var SUPPORT_TOUCH = "ontouchstart" in window;
        var SUPPORT_POINTER_EVENTS = prefixed(window, "PointerEvent") !== undefined;
        var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
        var INPUT_TYPE_TOUCH = "touch";
        var INPUT_TYPE_PEN = "pen";
        var INPUT_TYPE_MOUSE = "mouse";
        var INPUT_TYPE_KINECT = "kinect";
        var COMPUTE_INTERVAL = 25;
        var INPUT_START = 1;
        var INPUT_MOVE = 2;
        var INPUT_END = 4;
        var INPUT_CANCEL = 8;
        var DIRECTION_NONE = 1;
        var DIRECTION_LEFT = 2;
        var DIRECTION_RIGHT = 4;
        var DIRECTION_UP = 8;
        var DIRECTION_DOWN = 16;
        var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
        var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
        var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
        var PROPS_XY = ["x", "y"];
        var PROPS_CLIENT_XY = ["clientX", "clientY"];

        function Input(manager, callback) {
            var self = this;
            this.manager = manager;
            this.callback = callback;
            this.element = manager.element;
            this.target = manager.options.inputTarget;
            this.domHandler = function(ev) {
                if (boolOrFn(manager.options.enable, [manager])) {
                    self.handler(ev)
                }
            };
            this.init()
        }
        Input.prototype = {
            handler: function() {},
            init: function() {
                this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
                this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
                this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler)
            },
            destroy: function() {
                this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
                this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
                this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler)
            }
        };

        function createInputInstance(manager) {
            var Type;
            var inputClass = manager.options.inputClass;
            if (inputClass) {
                Type = inputClass
            } else if (SUPPORT_POINTER_EVENTS) {
                Type = PointerEventInput
            } else if (SUPPORT_ONLY_TOUCH) {
                Type = TouchInput
            } else if (!SUPPORT_TOUCH) {
                Type = MouseInput
            } else {
                Type = TouchMouseInput
            }
            return new Type(manager, inputHandler)
        }

        function inputHandler(manager, eventType, input) {
            var pointersLen = input.pointers.length;
            var changedPointersLen = input.changedPointers.length;
            var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
            var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
            input.isFirst = !!isFirst;
            input.isFinal = !!isFinal;
            if (isFirst) {
                manager.session = {}
            }
            input.eventType = eventType;
            computeInputData(manager, input);
            manager.emit("hammer.input", input);
            manager.recognize(input);
            manager.session.prevInput = input
        }

        function computeInputData(manager, input) {
            var session = manager.session;
            var pointers = input.pointers;
            var pointersLength = pointers.length;
            if (!session.firstInput) {
                session.firstInput = simpleCloneInputData(input)
            }
            if (pointersLength > 1 && !session.firstMultiple) {
                session.firstMultiple = simpleCloneInputData(input)
            } else if (pointersLength === 1) {
                session.firstMultiple = false
            }
            var firstInput = session.firstInput;
            var firstMultiple = session.firstMultiple;
            var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
            var center = input.center = getCenter(pointers);
            input.timeStamp = now();
            input.deltaTime = input.timeStamp - firstInput.timeStamp;
            input.angle = getAngle(offsetCenter, center);
            input.distance = getDistance(offsetCenter, center);
            computeDeltaXY(session, input);
            input.offsetDirection = getDirection(input.deltaX, input.deltaY);
            input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
            input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
            computeIntervalInputData(session, input);
            var target = manager.element;
            if (hasParent(input.srcEvent.target, target)) {
                target = input.srcEvent.target
            }
            input.target = target
        }

        function computeDeltaXY(session, input) {
            var center = input.center;
            var offset = session.offsetDelta || {};
            var prevDelta = session.prevDelta || {};
            var prevInput = session.prevInput || {};
            if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
                prevDelta = session.prevDelta = {
                    x: prevInput.deltaX || 0,
                    y: prevInput.deltaY || 0
                };
                offset = session.offsetDelta = {
                    x: center.x,
                    y: center.y
                }
            }
            input.deltaX = prevDelta.x + (center.x - offset.x);
            input.deltaY = prevDelta.y + (center.y - offset.y)
        }

        function computeIntervalInputData(session, input) {
            var last = session.lastInterval || input,
                deltaTime = input.timeStamp - last.timeStamp,
                velocity, velocityX, velocityY, direction;
            if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
                var deltaX = last.deltaX - input.deltaX;
                var deltaY = last.deltaY - input.deltaY;
                var v = getVelocity(deltaTime, deltaX, deltaY);
                velocityX = v.x;
                velocityY = v.y;
                velocity = abs(v.x) > abs(v.y) ? v.x : v.y;
                direction = getDirection(deltaX, deltaY);
                session.lastInterval = input
            } else {
                velocity = last.velocity;
                velocityX = last.velocityX;
                velocityY = last.velocityY;
                direction = last.direction
            }
            input.velocity = velocity;
            input.velocityX = velocityX;
            input.velocityY = velocityY;
            input.direction = direction
        }

        function simpleCloneInputData(input) {
            var pointers = [];
            var i = 0;
            while (i < input.pointers.length) {
                pointers[i] = {
                    clientX: round(input.pointers[i].clientX),
                    clientY: round(input.pointers[i].clientY)
                };
                i++
            }
            return {
                timeStamp: now(),
                pointers: pointers,
                center: getCenter(pointers),
                deltaX: input.deltaX,
                deltaY: input.deltaY
            }
        }

        function getCenter(pointers) {
            var pointersLength = pointers.length;
            if (pointersLength === 1) {
                return {
                    x: round(pointers[0].clientX),
                    y: round(pointers[0].clientY)
                }
            }
            var x = 0,
                y = 0,
                i = 0;
            while (i < pointersLength) {
                x += pointers[i].clientX;
                y += pointers[i].clientY;
                i++
            }
            return {
                x: round(x / pointersLength),
                y: round(y / pointersLength)
            }
        }

        function getVelocity(deltaTime, x, y) {
            return {
                x: x / deltaTime || 0,
                y: y / deltaTime || 0
            }
        }

        function getDirection(x, y) {
            if (x === y) {
                return DIRECTION_NONE
            }
            if (abs(x) >= abs(y)) {
                return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT
            }
            return y > 0 ? DIRECTION_UP : DIRECTION_DOWN
        }

        function getDistance(p1, p2, props) {
            if (!props) {
                props = PROPS_XY
            }
            var x = p2[props[0]] - p1[props[0]],
                y = p2[props[1]] - p1[props[1]];
            return Math.sqrt(x * x + y * y)
        }

        function getAngle(p1, p2, props) {
            if (!props) {
                props = PROPS_XY
            }
            var x = p2[props[0]] - p1[props[0]],
                y = p2[props[1]] - p1[props[1]];
            return Math.atan2(y, x) * 180 / Math.PI
        }

        function getRotation(start, end) {
            return getAngle(end[1], end[0], PROPS_CLIENT_XY) - getAngle(start[1], start[0], PROPS_CLIENT_XY)
        }

        function getScale(start, end) {
            return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY)
        }
        var MOUSE_INPUT_MAP = {
            mousedown: INPUT_START,
            mousemove: INPUT_MOVE,
            mouseup: INPUT_END
        };
        var MOUSE_ELEMENT_EVENTS = "mousedown";
        var MOUSE_WINDOW_EVENTS = "mousemove mouseup";

        function MouseInput() {
            this.evEl = MOUSE_ELEMENT_EVENTS;
            this.evWin = MOUSE_WINDOW_EVENTS;
            this.allow = true;
            this.pressed = false;
            Input.apply(this, arguments)
        }
        inherit(MouseInput, Input, {
            handler: function MEhandler(ev) {
                var eventType = MOUSE_INPUT_MAP[ev.type];
                if (eventType & INPUT_START && ev.button === 0) {
                    this.pressed = true
                }
                if (eventType & INPUT_MOVE && ev.which !== 1) {
                    eventType = INPUT_END
                }
                if (!this.pressed || !this.allow) {
                    return
                }
                if (eventType & INPUT_END) {
                    this.pressed = false
                }
                this.callback(this.manager, eventType, {
                    pointers: [ev],
                    changedPointers: [ev],
                    pointerType: INPUT_TYPE_MOUSE,
                    srcEvent: ev
                })
            }
        });
        var POINTER_INPUT_MAP = {
            pointerdown: INPUT_START,
            pointermove: INPUT_MOVE,
            pointerup: INPUT_END,
            pointercancel: INPUT_CANCEL,
            pointerout: INPUT_CANCEL
        };
        var IE10_POINTER_TYPE_ENUM = {
            2: INPUT_TYPE_TOUCH,
            3: INPUT_TYPE_PEN,
            4: INPUT_TYPE_MOUSE,
            5: INPUT_TYPE_KINECT
        };
        var POINTER_ELEMENT_EVENTS = "pointerdown";
        var POINTER_WINDOW_EVENTS = "pointermove pointerup pointercancel";
        if (window.MSPointerEvent) {
            POINTER_ELEMENT_EVENTS = "MSPointerDown";
            POINTER_WINDOW_EVENTS = "MSPointerMove MSPointerUp MSPointerCancel"
        }

        function PointerEventInput() {
            this.evEl = POINTER_ELEMENT_EVENTS;
            this.evWin = POINTER_WINDOW_EVENTS;
            Input.apply(this, arguments);
            this.store = this.manager.session.pointerEvents = []
        }
        inherit(PointerEventInput, Input, {
            handler: function PEhandler(ev) {
                var store = this.store;
                var removePointer = false;
                var eventTypeNormalized = ev.type.toLowerCase().replace("ms", "");
                var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
                var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
                var isTouch = pointerType == INPUT_TYPE_TOUCH;
                var storeIndex = inArray(store, ev.pointerId, "pointerId");
                if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
                    if (storeIndex < 0) {
                        store.push(ev);
                        storeIndex = store.length - 1
                    }
                } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
                    removePointer = true
                }
                if (storeIndex < 0) {
                    return
                }
                store[storeIndex] = ev;
                this.callback(this.manager, eventType, {
                    pointers: store,
                    changedPointers: [ev],
                    pointerType: pointerType,
                    srcEvent: ev
                });
                if (removePointer) {
                    store.splice(storeIndex, 1)
                }
            }
        });
        var SINGLE_TOUCH_INPUT_MAP = {
            touchstart: INPUT_START,
            touchmove: INPUT_MOVE,
            touchend: INPUT_END,
            touchcancel: INPUT_CANCEL
        };
        var SINGLE_TOUCH_TARGET_EVENTS = "touchstart";
        var SINGLE_TOUCH_WINDOW_EVENTS = "touchstart touchmove touchend touchcancel";

        function SingleTouchInput() {
            this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
            this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
            this.started = false;
            Input.apply(this, arguments)
        }
        inherit(SingleTouchInput, Input, {
            handler: function TEhandler(ev) {
                var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
                if (type === INPUT_START) {
                    this.started = true
                }
                if (!this.started) {
                    return
                }
                var touches = normalizeSingleTouches.call(this, ev, type);
                if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
                    this.started = false
                }
                this.callback(this.manager, type, {
                    pointers: touches[0],
                    changedPointers: touches[1],
                    pointerType: INPUT_TYPE_TOUCH,
                    srcEvent: ev
                })
            }
        });

        function normalizeSingleTouches(ev, type) {
            var all = toArray(ev.touches);
            var changed = toArray(ev.changedTouches);
            if (type & (INPUT_END | INPUT_CANCEL)) {
                all = uniqueArray(all.concat(changed), "identifier", true)
            }
            return [all, changed]
        }
        var TOUCH_INPUT_MAP = {
            touchstart: INPUT_START,
            touchmove: INPUT_MOVE,
            touchend: INPUT_END,
            touchcancel: INPUT_CANCEL
        };
        var TOUCH_TARGET_EVENTS = "touchstart touchmove touchend touchcancel";

        function TouchInput() {
            this.evTarget = TOUCH_TARGET_EVENTS;
            this.targetIds = {};
            Input.apply(this, arguments)
        }
        inherit(TouchInput, Input, {
            handler: function MTEhandler(ev) {
                var type = TOUCH_INPUT_MAP[ev.type];
                var touches = getTouches.call(this, ev, type);
                if (!touches) {
                    return
                }
                this.callback(this.manager, type, {
                    pointers: touches[0],
                    changedPointers: touches[1],
                    pointerType: INPUT_TYPE_TOUCH,
                    srcEvent: ev
                })
            }
        });

        function getTouches(ev, type) {
            var allTouches = toArray(ev.touches);
            var targetIds = this.targetIds;
            if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
                targetIds[allTouches[0].identifier] = true;
                return [allTouches, allTouches]
            }
            var i, targetTouches, changedTouches = toArray(ev.changedTouches),
                changedTargetTouches = [],
                target = this.target;
            targetTouches = allTouches.filter(function(touch) {
                return hasParent(touch.target, target)
            });
            if (type === INPUT_START) {
                i = 0;
                while (i < targetTouches.length) {
                    targetIds[targetTouches[i].identifier] = true;
                    i++
                }
            }
            i = 0;
            while (i < changedTouches.length) {
                if (targetIds[changedTouches[i].identifier]) {
                    changedTargetTouches.push(changedTouches[i])
                }
                if (type & (INPUT_END | INPUT_CANCEL)) {
                    delete targetIds[changedTouches[i].identifier]
                }
                i++
            }
            if (!changedTargetTouches.length) {
                return
            }
            return [uniqueArray(targetTouches.concat(changedTargetTouches), "identifier", true), changedTargetTouches]
        }

        function TouchMouseInput() {
            Input.apply(this, arguments);
            var handler = bindFn(this.handler, this);
            this.touch = new TouchInput(this.manager, handler);
            this.mouse = new MouseInput(this.manager, handler)
        }
        inherit(TouchMouseInput, Input, {
            handler: function TMEhandler(manager, inputEvent, inputData) {
                var isTouch = inputData.pointerType == INPUT_TYPE_TOUCH,
                    isMouse = inputData.pointerType == INPUT_TYPE_MOUSE;
                if (isTouch) {
                    this.mouse.allow = false
                } else if (isMouse && !this.mouse.allow) {
                    return
                }
                if (inputEvent & (INPUT_END | INPUT_CANCEL)) {
                    this.mouse.allow = true
                }
                this.callback(manager, inputEvent, inputData)
            },
            destroy: function destroy() {
                this.touch.destroy();
                this.mouse.destroy()
            }
        });
        var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, "touchAction");
        var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
        var TOUCH_ACTION_COMPUTE = "compute";
        var TOUCH_ACTION_AUTO = "auto";
        var TOUCH_ACTION_MANIPULATION = "manipulation";
        var TOUCH_ACTION_NONE = "none";
        var TOUCH_ACTION_PAN_X = "pan-x";
        var TOUCH_ACTION_PAN_Y = "pan-y";

        function TouchAction(manager, value) {
            this.manager = manager;
            this.set(value)
        }
        TouchAction.prototype = {
            set: function(value) {
                if (value == TOUCH_ACTION_COMPUTE) {
                    value = this.compute()
                }
                if (NATIVE_TOUCH_ACTION) {
                    this.manager.element.style[PREFIXED_TOUCH_ACTION] = value
                }
                this.actions = value.toLowerCase().trim()
            },
            update: function() {
                this.set(this.manager.options.touchAction)
            },
            compute: function() {
                var actions = [];
                each(this.manager.recognizers, function(recognizer) {
                    if (boolOrFn(recognizer.options.enable, [recognizer])) {
                        actions = actions.concat(recognizer.getTouchAction())
                    }
                });
                return cleanTouchActions(actions.join(" "))
            },
            preventDefaults: function(input) {
                if (NATIVE_TOUCH_ACTION) {
                    return
                }
                var srcEvent = input.srcEvent;
                var direction = input.offsetDirection;
                if (this.manager.session.prevented) {
                    srcEvent.preventDefault();
                    return
                }
                var actions = this.actions;
                var hasNone = inStr(actions, TOUCH_ACTION_NONE);
                var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
                var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
                if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {
                    return this.preventSrc(srcEvent)
                }
            },
            preventSrc: function(srcEvent) {
                this.manager.session.prevented = true;
                srcEvent.preventDefault()
            }
        };

        function cleanTouchActions(actions) {
            if (inStr(actions, TOUCH_ACTION_NONE)) {
                return TOUCH_ACTION_NONE
            }
            var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
            var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
            if (hasPanX && hasPanY) {
                return TOUCH_ACTION_PAN_X + " " + TOUCH_ACTION_PAN_Y
            }
            if (hasPanX || hasPanY) {
                return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y
            }
            if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
                return TOUCH_ACTION_MANIPULATION
            }
            return TOUCH_ACTION_AUTO
        }
        var STATE_POSSIBLE = 1;
        var STATE_BEGAN = 2;
        var STATE_CHANGED = 4;
        var STATE_ENDED = 8;
        var STATE_RECOGNIZED = STATE_ENDED;
        var STATE_CANCELLED = 16;
        var STATE_FAILED = 32;

        function Recognizer(options) {
            this.id = uniqueId();
            this.manager = null;
            this.options = merge(options || {}, this.defaults);
            this.options.enable = ifUndefined(this.options.enable, true);
            this.state = STATE_POSSIBLE;
            this.simultaneous = {};
            this.requireFail = []
        }
        Recognizer.prototype = {
            defaults: {},
            set: function(options) {
                extend(this.options, options);
                this.manager && this.manager.touchAction.update();
                return this
            },
            recognizeWith: function(otherRecognizer) {
                if (invokeArrayArg(otherRecognizer, "recognizeWith", this)) {
                    return this
                }
                var simultaneous = this.simultaneous;
                otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
                if (!simultaneous[otherRecognizer.id]) {
                    simultaneous[otherRecognizer.id] = otherRecognizer;
                    otherRecognizer.recognizeWith(this)
                }
                return this
            },
            dropRecognizeWith: function(otherRecognizer) {
                if (invokeArrayArg(otherRecognizer, "dropRecognizeWith", this)) {
                    return this
                }
                otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
                delete this.simultaneous[otherRecognizer.id];
                return this
            },
            requireFailure: function(otherRecognizer) {
                if (invokeArrayArg(otherRecognizer, "requireFailure", this)) {
                    return this
                }
                var requireFail = this.requireFail;
                otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
                if (inArray(requireFail, otherRecognizer) === -1) {
                    requireFail.push(otherRecognizer);
                    otherRecognizer.requireFailure(this)
                }
                return this
            },
            dropRequireFailure: function(otherRecognizer) {
                if (invokeArrayArg(otherRecognizer, "dropRequireFailure", this)) {
                    return this
                }
                otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
                var index = inArray(this.requireFail, otherRecognizer);
                if (index > -1) {
                    this.requireFail.splice(index, 1)
                }
                return this
            },
            hasRequireFailures: function() {
                return this.requireFail.length > 0
            },
            canRecognizeWith: function(otherRecognizer) {
                return !!this.simultaneous[otherRecognizer.id]
            },
            emit: function(input) {
                var self = this;
                var state = this.state;

                function emit(withState) {
                    self.manager.emit(self.options.event + (withState ? stateStr(state) : ""), input)
                }
                if (state < STATE_ENDED) {
                    emit(true)
                }
                emit();
                if (state >= STATE_ENDED) {
                    emit(true)
                }
            },
            tryEmit: function(input) {
                if (this.canEmit()) {
                    return this.emit(input)
                }
                this.state = STATE_FAILED
            },
            canEmit: function() {
                var i = 0;
                while (i < this.requireFail.length) {
                    if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
                        return false
                    }
                    i++
                }
                return true
            },
            recognize: function(inputData) {
                var inputDataClone = extend({}, inputData);
                if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
                    this.reset();
                    this.state = STATE_FAILED;
                    return
                }
                if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
                    this.state = STATE_POSSIBLE
                }
                this.state = this.process(inputDataClone);
                if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
                    this.tryEmit(inputDataClone)
                }
            },
            process: function(inputData) {},
            getTouchAction: function() {},
            reset: function() {}
        };

        function stateStr(state) {
            if (state & STATE_CANCELLED) {
                return "cancel"
            } else if (state & STATE_ENDED) {
                return "end"
            } else if (state & STATE_CHANGED) {
                return "move"
            } else if (state & STATE_BEGAN) {
                return "start"
            }
            return ""
        }

        function directionStr(direction) {
            if (direction == DIRECTION_DOWN) {
                return "down"
            } else if (direction == DIRECTION_UP) {
                return "up"
            } else if (direction == DIRECTION_LEFT) {
                return "left"
            } else if (direction == DIRECTION_RIGHT) {
                return "right"
            }
            return ""
        }

        function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
            var manager = recognizer.manager;
            if (manager) {
                return manager.get(otherRecognizer)
            }
            return otherRecognizer
        }

        function AttrRecognizer() {
            Recognizer.apply(this, arguments)
        }
        inherit(AttrRecognizer, Recognizer, {
            defaults: {
                pointers: 1
            },
            attrTest: function(input) {
                var optionPointers = this.options.pointers;
                return optionPointers === 0 || input.pointers.length === optionPointers
            },
            process: function(input) {
                var state = this.state;
                var eventType = input.eventType;
                var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
                var isValid = this.attrTest(input);
                if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
                    return state | STATE_CANCELLED
                } else if (isRecognized || isValid) {
                    if (eventType & INPUT_END) {
                        return state | STATE_ENDED
                    } else if (!(state & STATE_BEGAN)) {
                        return STATE_BEGAN
                    }
                    return state | STATE_CHANGED
                }
                return STATE_FAILED
            }
        });

        function PanRecognizer() {
            AttrRecognizer.apply(this, arguments);
            this.pX = null;
            this.pY = null
        }
        inherit(PanRecognizer, AttrRecognizer, {
            defaults: {
                event: "pan",
                threshold: 10,
                pointers: 1,
                direction: DIRECTION_ALL
            },
            getTouchAction: function() {
                var direction = this.options.direction;
                var actions = [];
                if (direction & DIRECTION_HORIZONTAL) {
                    actions.push(TOUCH_ACTION_PAN_Y)
                }
                if (direction & DIRECTION_VERTICAL) {
                    actions.push(TOUCH_ACTION_PAN_X)
                }
                return actions
            },
            directionTest: function(input) {
                var options = this.options;
                var hasMoved = true;
                var distance = input.distance;
                var direction = input.direction;
                var x = input.deltaX;
                var y = input.deltaY;
                if (!(direction & options.direction)) {
                    if (options.direction & DIRECTION_HORIZONTAL) {
                        direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
                        hasMoved = x != this.pX;
                        distance = Math.abs(input.deltaX)
                    } else {
                        direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
                        hasMoved = y != this.pY;
                        distance = Math.abs(input.deltaY)
                    }
                }
                input.direction = direction;
                return hasMoved && distance > options.threshold && direction & options.direction
            },
            attrTest: function(input) {
                return AttrRecognizer.prototype.attrTest.call(this, input) && (this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input))
            },
            emit: function(input) {
                this.pX = input.deltaX;
                this.pY = input.deltaY;
                var direction = directionStr(input.direction);
                if (direction) {
                    this.manager.emit(this.options.event + direction, input)
                }
                this._super.emit.call(this, input)
            }
        });

        function PinchRecognizer() {
            AttrRecognizer.apply(this, arguments)
        }
        inherit(PinchRecognizer, AttrRecognizer, {
            defaults: {
                event: "pinch",
                threshold: 0,
                pointers: 2
            },
            getTouchAction: function() {
                return [TOUCH_ACTION_NONE]
            },
            attrTest: function(input) {
                return this._super.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN)
            },
            emit: function(input) {
                this._super.emit.call(this, input);
                if (input.scale !== 1) {
                    var inOut = input.scale < 1 ? "in" : "out";
                    this.manager.emit(this.options.event + inOut, input)
                }
            }
        });

        function PressRecognizer() {
            Recognizer.apply(this, arguments);
            this._timer = null;
            this._input = null
        }
        inherit(PressRecognizer, Recognizer, {
            defaults: {
                event: "press",
                pointers: 1,
                time: 500,
                threshold: 5
            },
            getTouchAction: function() {
                return [TOUCH_ACTION_AUTO]
            },
            process: function(input) {
                var options = this.options;
                var validPointers = input.pointers.length === options.pointers;
                var validMovement = input.distance < options.threshold;
                var validTime = input.deltaTime > options.time;
                this._input = input;
                if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {
                    this.reset()
                } else if (input.eventType & INPUT_START) {
                    this.reset();
                    this._timer = setTimeoutContext(function() {
                        this.state = STATE_RECOGNIZED;
                        this.tryEmit()
                    }, options.time, this)
                } else if (input.eventType & INPUT_END) {
                    return STATE_RECOGNIZED
                }
                return STATE_FAILED
            },
            reset: function() {
                clearTimeout(this._timer)
            },
            emit: function(input) {
                if (this.state !== STATE_RECOGNIZED) {
                    return
                }
                if (input && input.eventType & INPUT_END) {
                    this.manager.emit(this.options.event + "up", input)
                } else {
                    this._input.timeStamp = now();
                    this.manager.emit(this.options.event, this._input)
                }
            }
        });

        function RotateRecognizer() {
            AttrRecognizer.apply(this, arguments)
        }
        inherit(RotateRecognizer, AttrRecognizer, {
            defaults: {
                event: "rotate",
                threshold: 0,
                pointers: 2
            },
            getTouchAction: function() {
                return [TOUCH_ACTION_NONE]
            },
            attrTest: function(input) {
                return this._super.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN)
            }
        });

        function SwipeRecognizer() {
            AttrRecognizer.apply(this, arguments)
        }
        inherit(SwipeRecognizer, AttrRecognizer, {
            defaults: {
                event: "swipe",
                threshold: 10,
                velocity: .65,
                direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
                pointers: 1
            },
            getTouchAction: function() {
                return PanRecognizer.prototype.getTouchAction.call(this)
            },
            attrTest: function(input) {
                var direction = this.options.direction;
                var velocity;
                if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
                    velocity = input.velocity
                } else if (direction & DIRECTION_HORIZONTAL) {
                    velocity = input.velocityX
                } else if (direction & DIRECTION_VERTICAL) {
                    velocity = input.velocityY
                }
                return this._super.attrTest.call(this, input) && direction & input.direction && input.distance > this.options.threshold && abs(velocity) > this.options.velocity && input.eventType & INPUT_END
            },
            emit: function(input) {
                var direction = directionStr(input.direction);
                if (direction) {
                    this.manager.emit(this.options.event + direction, input)
                }
                this.manager.emit(this.options.event, input)
            }
        });

        function TapRecognizer() {
            Recognizer.apply(this, arguments);
            this.pTime = false;
            this.pCenter = false;
            this._timer = null;
            this._input = null;
            this.count = 0
        }
        inherit(TapRecognizer, Recognizer, {
            defaults: {
                event: "tap",
                pointers: 1,
                taps: 1,
                interval: 300,
                time: 250,
                threshold: 2,
                posThreshold: 10
            },
            getTouchAction: function() {
                return [TOUCH_ACTION_MANIPULATION]
            },
            process: function(input) {
                var options = this.options;
                var validPointers = input.pointers.length === options.pointers;
                var validMovement = input.distance < options.threshold;
                var validTouchTime = input.deltaTime < options.time;
                this.reset();
                if (input.eventType & INPUT_START && this.count === 0) {
                    return this.failTimeout()
                }
                if (validMovement && validTouchTime && validPointers) {
                    if (input.eventType != INPUT_END) {
                        return this.failTimeout()
                    }
                    var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
                    var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
                    this.pTime = input.timeStamp;
                    this.pCenter = input.center;
                    if (!validMultiTap || !validInterval) {
                        this.count = 1
                    } else {
                        this.count += 1
                    }
                    this._input = input;
                    var tapCount = this.count % options.taps;
                    if (tapCount === 0) {
                        if (!this.hasRequireFailures()) {
                            return STATE_RECOGNIZED
                        } else {
                            this._timer = setTimeoutContext(function() {
                                this.state = STATE_RECOGNIZED;
                                this.tryEmit()
                            }, options.interval, this);
                            return STATE_BEGAN
                        }
                    }
                }
                return STATE_FAILED
            },
            failTimeout: function() {
                this._timer = setTimeoutContext(function() {
                    this.state = STATE_FAILED
                }, this.options.interval, this);
                return STATE_FAILED
            },
            reset: function() {
                clearTimeout(this._timer)
            },
            emit: function() {
                if (this.state == STATE_RECOGNIZED) {
                    this._input.tapCount = this.count;
                    this.manager.emit(this.options.event, this._input)
                }
            }
        });

        function Hammer(element, options) {
            options = options || {};
            options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
            return new Manager(element, options)
        }
        Hammer.VERSION = "2.0.4";
        Hammer.defaults = {
            domEvents: false,
            touchAction: TOUCH_ACTION_COMPUTE,
            enable: true,
            inputTarget: null,
            inputClass: null,
            preset: [
                [RotateRecognizer, {
                    enable: false
                }],
                [PinchRecognizer, {
                        enable: false
                    },
                    ["rotate"]
                ],
                [SwipeRecognizer, {
                    direction: DIRECTION_HORIZONTAL
                }],
                [PanRecognizer, {
                        direction: DIRECTION_HORIZONTAL
                    },
                    ["swipe"]
                ],
                [TapRecognizer],
                [TapRecognizer, {
                        event: "doubletap",
                        taps: 2
                    },
                    ["tap"]
                ],
                [PressRecognizer]
            ],
            cssProps: {
                userSelect: "none",
                touchSelect: "none",
                touchCallout: "none",
                contentZooming: "none",
                userDrag: "none",
                tapHighlightColor: "rgba(0,0,0,0)"
            }
        };
        var STOP = 1;
        var FORCED_STOP = 2;

        function Manager(element, options) {
            options = options || {};
            this.options = merge(options, Hammer.defaults);
            this.options.inputTarget = this.options.inputTarget || element;
            this.handlers = {};
            this.session = {};
            this.recognizers = [];
            this.element = element;
            this.input = createInputInstance(this);
            this.touchAction = new TouchAction(this, this.options.touchAction);
            toggleCssProps(this, true);
            each(options.recognizers, function(item) {
                var recognizer = this.add(new item[0](item[1]));
                item[2] && recognizer.recognizeWith(item[2]);
                item[3] && recognizer.requireFailure(item[3])
            }, this)
        }
        Manager.prototype = {
            set: function(options) {
                extend(this.options, options);
                if (options.touchAction) {
                    this.touchAction.update()
                }
                if (options.inputTarget) {
                    this.input.destroy();
                    this.input.target = options.inputTarget;
                    this.input.init()
                }
                return this
            },
            stop: function(force) {
                this.session.stopped = force ? FORCED_STOP : STOP
            },
            recognize: function(inputData) {
                var session = this.session;
                if (session.stopped) {
                    return
                }
                this.touchAction.preventDefaults(inputData);
                var recognizer;
                var recognizers = this.recognizers;
                var curRecognizer = session.curRecognizer;
                if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
                    curRecognizer = session.curRecognizer = null
                }
                var i = 0;
                while (i < recognizers.length) {
                    recognizer = recognizers[i];
                    if (session.stopped !== FORCED_STOP && (!curRecognizer || recognizer == curRecognizer || recognizer.canRecognizeWith(curRecognizer))) {
                        recognizer.recognize(inputData)
                    } else {
                        recognizer.reset()
                    }
                    if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
                        curRecognizer = session.curRecognizer = recognizer
                    }
                    i++
                }
            },
            get: function(recognizer) {
                if (recognizer instanceof Recognizer) {
                    return recognizer
                }
                var recognizers = this.recognizers;
                for (var i = 0; i < recognizers.length; i++) {
                    if (recognizers[i].options.event == recognizer) {
                        return recognizers[i]
                    }
                }
                return null
            },
            add: function(recognizer) {
                if (invokeArrayArg(recognizer, "add", this)) {
                    return this
                }
                var existing = this.get(recognizer.options.event);
                if (existing) {
                    this.remove(existing)
                }
                this.recognizers.push(recognizer);
                recognizer.manager = this;
                this.touchAction.update();
                return recognizer
            },
            remove: function(recognizer) {
                if (invokeArrayArg(recognizer, "remove", this)) {
                    return this
                }
                var recognizers = this.recognizers;
                recognizer = this.get(recognizer);
                recognizers.splice(inArray(recognizers, recognizer), 1);
                this.touchAction.update();
                return this
            },
            on: function(events, handler) {
                var handlers = this.handlers;
                each(splitStr(events), function(event) {
                    handlers[event] = handlers[event] || [];
                    handlers[event].push(handler)
                });
                return this
            },
            off: function(events, handler) {
                var handlers = this.handlers;
                each(splitStr(events), function(event) {
                    if (!handler) {
                        delete handlers[event]
                    } else {
                        handlers[event].splice(inArray(handlers[event], handler), 1)
                    }
                });
                return this
            },
            emit: function(event, data) {
                if (this.options.domEvents) {
                    triggerDomEvent(event, data)
                }
                var handlers = this.handlers[event] && this.handlers[event].slice();
                if (!handlers || !handlers.length) {
                    return
                }
                data.type = event;
                data.preventDefault = function() {
                    data.srcEvent.preventDefault()
                };
                var i = 0;
                while (i < handlers.length) {
                    handlers[i](data);
                    i++
                }
            },
            destroy: function() {
                this.element && toggleCssProps(this, false);
                this.handlers = {};
                this.session = {};
                this.input.destroy();
                this.element = null
            }
        };

        function toggleCssProps(manager, add) {
            var element = manager.element;
            each(manager.options.cssProps, function(value, name) {
                element.style[prefixed(element.style, name)] = add ? value : ""
            })
        }

        function triggerDomEvent(event, data) {
            var gestureEvent = document.createEvent("Event");
            gestureEvent.initEvent(event, true, true);
            gestureEvent.gesture = data;
            data.target.dispatchEvent(gestureEvent)
        }
        extend(Hammer, {
            INPUT_START: INPUT_START,
            INPUT_MOVE: INPUT_MOVE,
            INPUT_END: INPUT_END,
            INPUT_CANCEL: INPUT_CANCEL,
            STATE_POSSIBLE: STATE_POSSIBLE,
            STATE_BEGAN: STATE_BEGAN,
            STATE_CHANGED: STATE_CHANGED,
            STATE_ENDED: STATE_ENDED,
            STATE_RECOGNIZED: STATE_RECOGNIZED,
            STATE_CANCELLED: STATE_CANCELLED,
            STATE_FAILED: STATE_FAILED,
            DIRECTION_NONE: DIRECTION_NONE,
            DIRECTION_LEFT: DIRECTION_LEFT,
            DIRECTION_RIGHT: DIRECTION_RIGHT,
            DIRECTION_UP: DIRECTION_UP,
            DIRECTION_DOWN: DIRECTION_DOWN,
            DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
            DIRECTION_VERTICAL: DIRECTION_VERTICAL,
            DIRECTION_ALL: DIRECTION_ALL,
            Manager: Manager,
            Input: Input,
            TouchAction: TouchAction,
            TouchInput: TouchInput,
            MouseInput: MouseInput,
            PointerEventInput: PointerEventInput,
            TouchMouseInput: TouchMouseInput,
            SingleTouchInput: SingleTouchInput,
            Recognizer: Recognizer,
            AttrRecognizer: AttrRecognizer,
            Tap: TapRecognizer,
            Pan: PanRecognizer,
            Swipe: SwipeRecognizer,
            Pinch: PinchRecognizer,
            Rotate: RotateRecognizer,
            Press: PressRecognizer,
            on: addEventListeners,
            off: removeEventListeners,
            each: each,
            merge: merge,
            extend: extend,
            inherit: inherit,
            bindFn: bindFn,
            prefixed: prefixed
        });
        if (typeof define == TYPE_FUNCTION && define.amd) {
            define(function() {
                return Hammer
            })
        } else if (typeof module != "undefined" && module.exports) {
            module.exports = Hammer
        } else {
            window[exportName] = Hammer
        }
    })(window, document, "Hammer");
    return module.exports
});
define("jquery.hammer", ["jquery", "exports", "module"], function(jQuery, exports, module) {
    var define = undefined;
    window.jQuery = jQuery;
    window.Hammer = {};
    (function(window, undefined) {
        "use strict";
        var Hammer = function(element, options) {
            return new Hammer.Instance(element, options || {})
        };
        Hammer.VERSION = "1.0.10";
        Hammer.defaults = {
            stop_browser_behavior: {
                userSelect: "none",
                touchAction: "none",
                touchCallout: "none",
                contentZooming: "none",
                userDrag: "none",
                tapHighlightColor: "rgba(0,0,0,0)"
            }
        };
        Hammer.HAS_POINTEREVENTS = window.navigator.pointerEnabled || window.navigator.msPointerEnabled;
        Hammer.HAS_TOUCHEVENTS = "ontouchstart" in window;
        Hammer.MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android|silk/i;
        Hammer.NO_MOUSEEVENTS = Hammer.HAS_TOUCHEVENTS && window.navigator.userAgent.match(Hammer.MOBILE_REGEX);
        Hammer.EVENT_TYPES = {};
        Hammer.UPDATE_VELOCITY_INTERVAL = 16;
        Hammer.DOCUMENT = window.document;
        var DIRECTION_DOWN = Hammer.DIRECTION_DOWN = "down";
        var DIRECTION_LEFT = Hammer.DIRECTION_LEFT = "left";
        var DIRECTION_UP = Hammer.DIRECTION_UP = "up";
        var DIRECTION_RIGHT = Hammer.DIRECTION_RIGHT = "right";
        var POINTER_MOUSE = Hammer.POINTER_MOUSE = "mouse";
        var POINTER_TOUCH = Hammer.POINTER_TOUCH = "touch";
        var POINTER_PEN = Hammer.POINTER_PEN = "pen";
        var EVENT_START = Hammer.EVENT_START = "start";
        var EVENT_MOVE = Hammer.EVENT_MOVE = "move";
        var EVENT_END = Hammer.EVENT_END = "end";
        Hammer.plugins = Hammer.plugins || {};
        Hammer.gestures = Hammer.gestures || {};
        Hammer.READY = false;

        function setup() {
            if (Hammer.READY) {
                return
            }
            Event.determineEventTypes();
            Utils.each(Hammer.gestures, function(gesture) {
                Detection.register(gesture)
            });
            Event.onTouch(Hammer.DOCUMENT, EVENT_MOVE, Detection.detect);
            Event.onTouch(Hammer.DOCUMENT, EVENT_END, Detection.detect);
            Hammer.READY = true
        }
        var Utils = Hammer.utils = {
            extend: function extend(dest, src, merge) {
                for (var key in src) {
                    if (dest[key] !== undefined && merge) {
                        continue
                    }
                    dest[key] = src[key]
                }
                return dest
            },
            each: function each(obj, iterator, context) {
                var i, o;
                if ("forEach" in obj) {
                    obj.forEach(iterator, context)
                } else if (obj.length !== undefined) {
                    for (i = -1; o = obj[++i];) {
                        if (iterator.call(context, o, i, obj) === false) {
                            return
                        }
                    }
                } else {
                    for (i in obj) {
                        if (obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj) === false) {
                            return
                        }
                    }
                }
            },
            inStr: function inStr(src, needle) {
                return src.indexOf(needle) > -1
            },
            hasParent: function hasParent(node, parent) {
                while (node) {
                    if (node == parent) {
                        return true
                    }
                    node = node.parentNode
                }
                return false
            },
            getCenter: function getCenter(touches) {
                var pageX = [],
                    pageY = [],
                    clientX = [],
                    clientY = [],
                    min = Math.min,
                    max = Math.max;
                if (touches.length === 1) {
                    return {
                        pageX: touches[0].pageX,
                        pageY: touches[0].pageY,
                        clientX: touches[0].clientX,
                        clientY: touches[0].clientY
                    }
                }
                Utils.each(touches, function(touch) {
                    pageX.push(touch.pageX);
                    pageY.push(touch.pageY);
                    clientX.push(touch.clientX);
                    clientY.push(touch.clientY)
                });
                return {
                    pageX: (min.apply(Math, pageX) + max.apply(Math, pageX)) / 2,
                    pageY: (min.apply(Math, pageY) + max.apply(Math, pageY)) / 2,
                    clientX: (min.apply(Math, clientX) + max.apply(Math, clientX)) / 2,
                    clientY: (min.apply(Math, clientY) + max.apply(Math, clientY)) / 2
                }
            },
            getVelocity: function getVelocity(delta_time, delta_x, delta_y) {
                return {
                    x: Math.abs(delta_x / delta_time) || 0,
                    y: Math.abs(delta_y / delta_time) || 0
                }
            },
            getAngle: function getAngle(touch1, touch2) {
                var x = touch2.clientX - touch1.clientX,
                    y = touch2.clientY - touch1.clientY;
                return Math.atan2(y, x) * 180 / Math.PI
            },
            getDirection: function getDirection(touch1, touch2) {
                var x = Math.abs(touch1.clientX - touch2.clientX),
                    y = Math.abs(touch1.clientY - touch2.clientY);
                if (x >= y) {
                    return touch1.clientX - touch2.clientX > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT
                }
                return touch1.clientY - touch2.clientY > 0 ? DIRECTION_UP : DIRECTION_DOWN
            },
            getDistance: function getDistance(touch1, touch2) {
                var x = touch2.clientX - touch1.clientX,
                    y = touch2.clientY - touch1.clientY;
                return Math.sqrt(x * x + y * y)
            },
            getScale: function getScale(start, end) {
                if (start.length >= 2 && end.length >= 2) {
                    return this.getDistance(end[0], end[1]) / this.getDistance(start[0], start[1])
                }
                return 1
            },
            getRotation: function getRotation(start, end) {
                if (start.length >= 2 && end.length >= 2) {
                    return this.getAngle(end[1], end[0]) - this.getAngle(start[1], start[0])
                }
                return 0
            },
            isVertical: function isVertical(direction) {
                return direction == DIRECTION_UP || direction == DIRECTION_DOWN
            },
            toggleDefaultBehavior: function toggleDefaultBehavior(element, css_props, toggle) {
                if (!css_props || !element || !element.style) {
                    return
                }
                Utils.each(["webkit", "moz", "Moz", "ms", "o", ""], function setStyle(vendor) {
                    Utils.each(css_props, function(value, prop) {
                        if (vendor) {
                            prop = vendor + prop.substring(0, 1).toUpperCase() + prop.substring(1)
                        }
                        if (prop in element.style) {
                            element.style[prop] = !toggle && value
                        }
                    })
                });
                var false_fn = function() {
                    return false
                };
                if (css_props.userSelect == "none") {
                    element.onselectstart = !toggle && false_fn
                }
                if (css_props.userDrag == "none") {
                    element.ondragstart = !toggle && false_fn
                }
            }
        };
        Hammer.Instance = function(element, options) {
            var self = this;
            setup();
            this.element = element;
            this.enabled = true;
            this.options = Utils.extend(Utils.extend({}, Hammer.defaults), options || {});
            if (this.options.stop_browser_behavior) {
                Utils.toggleDefaultBehavior(this.element, this.options.stop_browser_behavior, false)
            }
            this.eventStartHandler = Event.onTouch(element, EVENT_START, function(ev) {
                if (self.enabled) {
                    Detection.startDetect(self, ev)
                }
            });
            this.eventHandlers = [];
            return this
        };
        Hammer.Instance.prototype = {
            on: function onEvent(gesture, handler) {
                var gestures = gesture.split(" ");
                Utils.each(gestures, function(gesture) {
                    this.element.addEventListener(gesture, handler, false);
                    this.eventHandlers.push({
                        gesture: gesture,
                        handler: handler
                    })
                }, this);
                return this
            },
            off: function offEvent(gesture, handler) {
                var gestures = gesture.split(" "),
                    i, eh;
                Utils.each(gestures, function(gesture) {
                    this.element.removeEventListener(gesture, handler, false);
                    for (i = -1; eh = this.eventHandlers[++i];) {
                        if (eh.gesture === gesture && eh.handler === handler) {
                            this.eventHandlers.splice(i, 1)
                        }
                    }
                }, this);
                return this
            },
            trigger: function triggerEvent(gesture, eventData) {
                if (!eventData) {
                    eventData = {}
                }
                var event = Hammer.DOCUMENT.createEvent("Event");
                event.initEvent(gesture, true, true);
                event.gesture = eventData;
                var element = this.element;
                if (Utils.hasParent(eventData.target, element)) {
                    element = eventData.target
                }
                element.dispatchEvent(event);
                return this
            },
            enable: function enable(state) {
                this.enabled = state;
                return this
            },
            dispose: function dispose() {
                var i, eh;
                if (this.options.stop_browser_behavior) {
                    Utils.toggleDefaultBehavior(this.element, this.options.stop_browser_behavior, true)
                }
                for (i = -1; eh = this.eventHandlers[++i];) {
                    this.element.removeEventListener(eh.gesture, eh.handler, false)
                }
                this.eventHandlers = [];
                Event.unbindDom(this.element, Hammer.EVENT_TYPES[EVENT_START], this.eventStartHandler);
                return null
            }
        };
        var last_move_event = null;
        var should_detect = false;
        var touch_triggered = false;
        var Event = Hammer.event = {
            bindDom: function(element, type, handler) {
                var types = type.split(" ");
                Utils.each(types, function(type) {
                    element.addEventListener(type, handler, false)
                })
            },
            unbindDom: function(element, type, handler) {
                var types = type.split(" ");
                Utils.each(types, function(type) {
                    element.removeEventListener(type, handler, false)
                })
            },
            onTouch: function onTouch(element, eventType, handler) {
                var self = this;
                var bindDomOnTouch = function bindDomOnTouch(ev) {
                    var srcEventType = ev.type.toLowerCase();
                    if (Utils.inStr(srcEventType, "mouse") && touch_triggered) {
                        return
                    } else if (Utils.inStr(srcEventType, "touch") || Utils.inStr(srcEventType, "pointerdown") || Utils.inStr(srcEventType, "mouse") && ev.which === 1) {
                        should_detect = true
                    } else if (Utils.inStr(srcEventType, "mouse") && !ev.which) {
                        should_detect = false
                    }
                    if (Utils.inStr(srcEventType, "touch") || Utils.inStr(srcEventType, "pointer")) {
                        touch_triggered = true
                    }
                    var count_touches = 0;
                    if (should_detect) {
                        if (Hammer.HAS_POINTEREVENTS && eventType != EVENT_END) {
                            count_touches = PointerEvent.updatePointer(eventType, ev)
                        } else if (Utils.inStr(srcEventType, "touch")) {
                            count_touches = ev.touches.length
                        } else if (!touch_triggered) {
                            count_touches = Utils.inStr(srcEventType, "up") ? 0 : 1
                        }
                        if (count_touches > 0 && eventType == EVENT_END) {
                            eventType = EVENT_MOVE
                        } else if (!count_touches) {
                            eventType = EVENT_END
                        }
                        if (count_touches || last_move_event === null) {
                            last_move_event = ev
                        }
                        handler.call(Detection, self.collectEventData(element, eventType, self.getTouchList(last_move_event, eventType), ev));
                        if (Hammer.HAS_POINTEREVENTS && eventType == EVENT_END) {
                            count_touches = PointerEvent.updatePointer(eventType, ev)
                        }
                    }
                    if (!count_touches) {
                        last_move_event = null;
                        should_detect = false;
                        touch_triggered = false;
                        PointerEvent.reset()
                    }
                };
                this.bindDom(element, Hammer.EVENT_TYPES[eventType], bindDomOnTouch);
                return bindDomOnTouch
            },
            determineEventTypes: function determineEventTypes() {
                var types;
                if (Hammer.HAS_POINTEREVENTS) {
                    types = PointerEvent.getEvents()
                } else if (Hammer.NO_MOUSEEVENTS) {
                    types = ["touchstart", "touchmove", "touchend touchcancel"]
                } else {
                    types = ["touchstart mousedown", "touchmove mousemove", "touchend touchcancel mouseup"]
                }
                Hammer.EVENT_TYPES[EVENT_START] = types[0];
                Hammer.EVENT_TYPES[EVENT_MOVE] = types[1];
                Hammer.EVENT_TYPES[EVENT_END] = types[2]
            },
            getTouchList: function getTouchList(ev) {
                if (Hammer.HAS_POINTEREVENTS) {
                    return PointerEvent.getTouchList()
                }
                if (ev.touches) {
                    return ev.touches
                }
                ev.identifier = 1;
                return [ev]
            },
            collectEventData: function collectEventData(element, eventType, touches, ev) {
                var pointerType = POINTER_TOUCH;
                if (Utils.inStr(ev.type, "mouse") || PointerEvent.matchType(POINTER_MOUSE, ev)) {
                    pointerType = POINTER_MOUSE
                }
                return {
                    center: Utils.getCenter(touches),
                    timeStamp: Date.now(),
                    target: ev.target,
                    touches: touches,
                    eventType: eventType,
                    pointerType: pointerType,
                    srcEvent: ev,
                    preventDefault: function() {
                        var srcEvent = this.srcEvent;
                        srcEvent.preventManipulation && srcEvent.preventManipulation();
                        srcEvent.preventDefault && srcEvent.preventDefault()
                    },
                    stopPropagation: function() {
                        this.srcEvent.stopPropagation()
                    },
                    stopDetect: function() {
                        return Detection.stopDetect()
                    }
                }
            }
        };
        var PointerEvent = Hammer.PointerEvent = {
            pointers: {},
            getTouchList: function getTouchList() {
                var touchlist = [];
                Utils.each(this.pointers, function(pointer) {
                    touchlist.push(pointer)
                });
                return touchlist
            },
            updatePointer: function updatePointer(type, pointerEvent) {
                if (type == EVENT_END) {
                    delete this.pointers[pointerEvent.pointerId]
                } else {
                    pointerEvent.identifier = pointerEvent.pointerId;
                    this.pointers[pointerEvent.pointerId] = pointerEvent
                }
                return Object.keys(this.pointers).length
            },
            matchType: function matchType(pointerType, ev) {
                if (!ev.pointerType) {
                    return false
                }
                var pt = ev.pointerType,
                    types = {};
                types[POINTER_MOUSE] = pt === POINTER_MOUSE;
                types[POINTER_TOUCH] = pt === POINTER_TOUCH;
                types[POINTER_PEN] = pt === POINTER_PEN;
                return types[pointerType]
            },
            getEvents: function getEvents() {
                return ["pointerdown MSPointerDown", "pointermove MSPointerMove", "pointerup pointercancel MSPointerUp MSPointerCancel"]
            },
            reset: function resetList() {
                this.pointers = {}
            }
        };
        var Detection = Hammer.detection = {
            gestures: [],
            current: null,
            previous: null,
            stopped: false,
            startDetect: function startDetect(inst, eventData) {
                if (this.current) {
                    return
                }
                this.stopped = false;
                this.current = {
                    inst: inst,
                    startEvent: Utils.extend({}, eventData),
                    lastEvent: false,
                    lastVelocityEvent: false,
                    velocity: false,
                    name: ""
                };
                this.detect(eventData)
            },
            detect: function detect(eventData) {
                if (!this.current || this.stopped) {
                    return
                }
                eventData = this.extendEventData(eventData);
                var inst = this.current.inst,
                    inst_options = inst.options;
                Utils.each(this.gestures, function triggerGesture(gesture) {
                    if (!this.stopped && inst_options[gesture.name] !== false && inst.enabled !== false) {
                        if (gesture.handler.call(gesture, eventData, inst) === false) {
                            this.stopDetect();
                            return false
                        }
                    }
                }, this);
                if (this.current) {
                    this.current.lastEvent = eventData
                }
                if (eventData.eventType == EVENT_END && !eventData.touches.length - 1) {
                    this.stopDetect()
                }
                return eventData
            },
            stopDetect: function stopDetect() {
                this.previous = Utils.extend({}, this.current);
                this.current = null;
                this.stopped = true
            },
            getVelocityData: function getVelocityData(ev, delta_time, delta_x, delta_y) {
                var cur = this.current,
                    velocityEv = cur.lastVelocityEvent,
                    velocity = cur.velocity;
                if (velocityEv && ev.timeStamp - velocityEv.timeStamp > Hammer.UPDATE_VELOCITY_INTERVAL) {
                    velocity = Utils.getVelocity(ev.timeStamp - velocityEv.timeStamp, ev.center.clientX - velocityEv.center.clientX, ev.center.clientY - velocityEv.center.clientY);
                    cur.lastVelocityEvent = ev
                } else if (!cur.velocity) {
                    velocity = Utils.getVelocity(delta_time, delta_x, delta_y);
                    cur.lastVelocityEvent = ev
                }
                cur.velocity = velocity;
                ev.velocityX = velocity.x;
                ev.velocityY = velocity.y
            },
            getInterimData: function getInterimData(ev) {
                var lastEvent = this.current.lastEvent,
                    angle, direction;
                if (ev.eventType == EVENT_END) {
                    angle = lastEvent && lastEvent.interimAngle;
                    direction = lastEvent && lastEvent.interimDirection
                } else {
                    angle = lastEvent && Utils.getAngle(lastEvent.center, ev.center);
                    direction = lastEvent && Utils.getDirection(lastEvent.center, ev.center)
                }
                ev.interimAngle = angle;
                ev.interimDirection = direction
            },
            extendEventData: function extendEventData(ev) {
                var cur = this.current,
                    startEv = cur.startEvent;
                if (ev.touches.length != startEv.touches.length || ev.touches === startEv.touches) {
                    startEv.touches = [];
                    Utils.each(ev.touches, function(touch) {
                        startEv.touches.push(Utils.extend({}, touch))
                    })
                }
                var delta_time = ev.timeStamp - startEv.timeStamp,
                    delta_x = ev.center.clientX - startEv.center.clientX,
                    delta_y = ev.center.clientY - startEv.center.clientY;
                this.getVelocityData(ev, delta_time, delta_x, delta_y);
                this.getInterimData(ev);
                Utils.extend(ev, {
                    startEvent: startEv,
                    deltaTime: delta_time,
                    deltaX: delta_x,
                    deltaY: delta_y,
                    distance: Utils.getDistance(startEv.center, ev.center),
                    angle: Utils.getAngle(startEv.center, ev.center),
                    direction: Utils.getDirection(startEv.center, ev.center),
                    scale: Utils.getScale(startEv.touches, ev.touches),
                    rotation: Utils.getRotation(startEv.touches, ev.touches)
                });
                return ev
            },
            register: function register(gesture) {
                var options = gesture.defaults || {};
                if (options[gesture.name] === undefined) {
                    options[gesture.name] = true
                }
                Utils.extend(Hammer.defaults, options, true);
                gesture.index = gesture.index || 1e3;
                this.gestures.push(gesture);
                this.gestures.sort(function(a, b) {
                    if (a.index < b.index) {
                        return -1
                    }
                    if (a.index > b.index) {
                        return 1
                    }
                    return 0
                });
                return this.gestures
            }
        };
        Hammer.gestures.Drag = {
            name: "drag",
            index: 50,
            defaults: {
                drag_min_distance: 10,
                correct_for_drag_min_distance: true,
                drag_max_touches: 1,
                drag_block_horizontal: false,
                drag_block_vertical: false,
                drag_lock_to_axis: false,
                drag_lock_min_distance: 25
            },
            triggered: false,
            handler: function dragGesture(ev, inst) {
                var cur = Detection.current;
                if (cur.name != this.name && this.triggered) {
                    inst.trigger(this.name + "end", ev);
                    this.triggered = false;
                    return
                }
                if (inst.options.drag_max_touches > 0 && ev.touches.length > inst.options.drag_max_touches) {
                    return
                }
                switch (ev.eventType) {
                    case EVENT_START:
                        this.triggered = false;
                        break;
                    case EVENT_MOVE:
                        if (ev.distance < inst.options.drag_min_distance && cur.name != this.name) {
                            return
                        }
                        var startCenter = cur.startEvent.center;
                        if (cur.name != this.name) {
                            cur.name = this.name;
                            if (inst.options.correct_for_drag_min_distance && ev.distance > 0) {
                                var factor = Math.abs(inst.options.drag_min_distance / ev.distance);
                                startCenter.pageX += ev.deltaX * factor;
                                startCenter.pageY += ev.deltaY * factor;
                                startCenter.clientX += ev.deltaX * factor;
                                startCenter.clientY += ev.deltaY * factor;
                                ev = Detection.extendEventData(ev)
                            }
                        }
                        if (cur.lastEvent.drag_locked_to_axis || inst.options.drag_lock_to_axis && inst.options.drag_lock_min_distance <= ev.distance) {
                            ev.drag_locked_to_axis = true
                        }
                        var last_direction = cur.lastEvent.direction;
                        if (ev.drag_locked_to_axis && last_direction !== ev.direction) {
                            if (Utils.isVertical(last_direction)) {
                                ev.direction = ev.deltaY < 0 ? DIRECTION_UP : DIRECTION_DOWN
                            } else {
                                ev.direction = ev.deltaX < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT
                            }
                        }
                        if (!this.triggered) {
                            inst.trigger(this.name + "start", ev);
                            this.triggered = true
                        }
                        inst.trigger(this.name, ev);
                        inst.trigger(this.name + ev.direction, ev);
                        var is_vertical = Utils.isVertical(ev.direction);
                        if (inst.options.drag_block_vertical && is_vertical || inst.options.drag_block_horizontal && !is_vertical) {
                            ev.preventDefault()
                        }
                        break;
                    case EVENT_END:
                        if (this.triggered) {
                            inst.trigger(this.name + "end", ev)
                        }
                        this.triggered = false;
                        break
                }
            }
        };
        Hammer.gestures.Hold = {
            name: "hold",
            index: 10,
            defaults: {
                hold_timeout: 500,
                hold_threshold: 2
            },
            timer: null,
            handler: function holdGesture(ev, inst) {
                switch (ev.eventType) {
                    case EVENT_START:
                        clearTimeout(this.timer);
                        Detection.current.name = this.name;
                        this.timer = setTimeout(function() {
                            if (Detection.current.name == "hold") {
                                inst.trigger("hold", ev)
                            }
                        }, inst.options.hold_timeout);
                        break;
                    case EVENT_MOVE:
                        if (ev.distance > inst.options.hold_threshold) {
                            clearTimeout(this.timer)
                        }
                        break;
                    case EVENT_END:
                        clearTimeout(this.timer);
                        break
                }
            }
        };
        Hammer.gestures.Release = {
            name: "release",
            index: Infinity,
            handler: function releaseGesture(ev, inst) {
                if (ev.eventType == EVENT_END) {
                    inst.trigger(this.name, ev)
                }
            }
        };
        Hammer.gestures.Swipe = {
            name: "swipe",
            index: 40,
            defaults: {
                swipe_min_touches: 1,
                swipe_max_touches: 1,
                swipe_velocity: .7
            },
            handler: function swipeGesture(ev, inst) {
                if (ev.eventType == EVENT_END) {
                    if (ev.touches.length < inst.options.swipe_min_touches || ev.touches.length > inst.options.swipe_max_touches) {
                        return
                    }
                    if (ev.velocityX > inst.options.swipe_velocity || ev.velocityY > inst.options.swipe_velocity) {
                        inst.trigger(this.name, ev);
                        inst.trigger(this.name + ev.direction, ev)
                    }
                }
            }
        };
        Hammer.gestures.Tap = {
            name: "tap",
            index: 100,
            defaults: {
                tap_max_touchtime: 250,
                tap_max_distance: 10,
                tap_always: true,
                doubletap_distance: 20,
                doubletap_interval: 300
            },
            has_moved: false,
            handler: function tapGesture(ev, inst) {
                var prev, since_prev, did_doubletap;
                if (ev.eventType == EVENT_START) {
                    this.has_moved = false
                } else if (ev.eventType == EVENT_MOVE && !this.moved) {
                    this.has_moved = ev.distance > inst.options.tap_max_distance
                } else if (ev.eventType == EVENT_END && ev.srcEvent.type != "touchcancel" && ev.deltaTime < inst.options.tap_max_touchtime && !this.has_moved) {
                    prev = Detection.previous;
                    since_prev = prev && prev.lastEvent && ev.timeStamp - prev.lastEvent.timeStamp;
                    did_doubletap = false;
                    if (prev && prev.name == "tap" && (since_prev && since_prev < inst.options.doubletap_interval) && ev.distance < inst.options.doubletap_distance) {
                        inst.trigger("doubletap", ev);
                        did_doubletap = true
                    }
                    if (!did_doubletap || inst.options.tap_always) {
                        Detection.current.name = "tap";
                        inst.trigger(Detection.current.name, ev)
                    }
                }
            }
        };
        Hammer.gestures.Touch = {
            name: "touch",
            index: -Infinity,
            defaults: {
                prevent_default: false,
                prevent_mouseevents: false
            },
            handler: function touchGesture(ev, inst) {
                if (inst.options.prevent_mouseevents && ev.pointerType == POINTER_MOUSE) {
                    ev.stopDetect();
                    return
                }
                if (inst.options.prevent_default) {
                    ev.preventDefault()
                }
                if (ev.eventType == EVENT_START) {
                    inst.trigger(this.name, ev)
                }
            }
        };
        Hammer.gestures.Transform = {
            name: "transform",
            index: 45,
            defaults: {
                transform_min_scale: .01,
                transform_min_rotation: 1,
                transform_always_block: false,
                transform_within_instance: false
            },
            triggered: false,
            handler: function transformGesture(ev, inst) {
                if (Detection.current.name != this.name && this.triggered) {
                    inst.trigger(this.name + "end", ev);
                    this.triggered = false;
                    return
                }
                if (ev.touches.length < 2) {
                    return
                }
                if (inst.options.transform_always_block) {
                    ev.preventDefault()
                }
                if (inst.options.transform_within_instance) {
                    for (var i = -1; ev.touches[++i];) {
                        if (!Utils.hasParent(ev.touches[i].target, inst.element)) {
                            return
                        }
                    }
                }
                switch (ev.eventType) {
                    case EVENT_START:
                        this.triggered = false;
                        break;
                    case EVENT_MOVE:
                        var scale_threshold = Math.abs(1 - ev.scale);
                        var rotation_threshold = Math.abs(ev.rotation);
                        if (scale_threshold < inst.options.transform_min_scale && rotation_threshold < inst.options.transform_min_rotation) {
                            return
                        }
                        Detection.current.name = this.name;
                        if (!this.triggered) {
                            inst.trigger(this.name + "start", ev);
                            this.triggered = true
                        }
                        inst.trigger(this.name, ev);
                        if (rotation_threshold > inst.options.transform_min_rotation) {
                            inst.trigger("rotate", ev)
                        }
                        if (scale_threshold > inst.options.transform_min_scale) {
                            inst.trigger("pinch", ev);
                            inst.trigger("pinch" + (ev.scale < 1 ? "in" : "out"), ev)
                        }
                        break;
                    case EVENT_END:
                        if (this.triggered) {
                            inst.trigger(this.name + "end", ev)
                        }
                        this.triggered = false;
                        break
                }
            }
        };
        window.Hammer = Hammer;
        if (typeof module == "object" && module.exports) {
            module.exports = Hammer
        }

        function setupPlugin(Hammer, $) {
            if (!Date.now) {
                Date.now = function now() {
                    return (new Date).getTime()
                }
            }
            Hammer.event.bindDom = function(element, eventTypes, handler) {
                $(element).on(eventTypes, function($ev) {
                    var data = $ev.originalEvent || $ev;
                    var props = ["pageX", "pageY", "clientX", "clientY", "target", "preventDefault", "stopPropagation"];
                    Hammer.utils.each(props, function(prop) {
                        if (data[prop] == null) {
                            data[prop] = $ev[prop]
                        }
                    });
                    if (data.which === undefined) {
                        data.which = data.button
                    }
                    handler.call(this, data)
                })
            };
            Hammer.utils.each(["on", "off"], function(method) {
                Hammer.Instance.prototype[method] = function(types, handler) {
                    return $(this.element)[method](types, handler)
                }
            });
            Hammer.Instance.prototype.trigger = function(gesture, eventData) {
                var el = $(this.element);
                if (el.has(eventData.target).length) {
                    el = $(eventData.target)
                }
                return el.trigger({
                    type: gesture,
                    gesture: eventData
                })
            };
            $.fn.hammer = function(options) {
                return this.each(function() {
                    var el = $(this);
                    var inst = el.data("hammer");
                    if (!inst) {
                        el.data("hammer", new Hammer(this, options || {}))
                    } else if (inst && options) {
                        Hammer.utils.extend(inst.options, options)
                    }
                })
            }
        }
        if (typeof define == "function" && define.amd) {
            define(["jquery"], function($) {
                return setupPlugin(window.Hammer, $)
            })
        } else {
            setupPlugin(window.Hammer, window.jQuery || window.Zepto)
        }
    })(window);
    delete window.jQuery;
    delete window.Hammer;
    return jQuery
});
define("jquery.ankama", ["jquery", "lodash"], function(jQuery, lodash) {
    (function($, _, undefined) {
        "use strict";
        var fnOriginalRemove = $.fn.remove,
            fnOriginalWrap = $.fn.wrap,
            fnOriginalWrapAll = $.fn.wrapAll;
        $.fn.akOptions = function() {
            var oOptions = {},
                oScript;
            oScript = this.is("script") ? this : this.nextAll('script[type="application/json"]').first();
            if (oScript.length > 0) {
                try {
                    oOptions = JSON.parse(oScript.html())
                } catch (oException) {
                    throw "Unable to parse (strict) options for element " + this.get()
                }
            }
            return oOptions
        };
        $.fn.remove = function() {
            var oScript = this.next('script[type="application/json"]').first();
            if (oScript.length > 0) oScript.remove();
            return fnOriginalRemove.apply(this, arguments)
        }, $.fn.wrap = function(html) {
            var oScript = this.next('script[type="application/json"]').first();
            if (oScript.length > 0) {
                var that = this.add(oScript);
                return that.wrapAll.apply(that, [jQuery.isFunction(html) ? html.call(this, 0) : html])
            }
            return fnOriginalWrap.apply(this, arguments)
        }, $.fn.wrapAll = function() {
            return fnOriginalWrapAll.apply(this, arguments)
        };
        $.fn.akRemoveAttributes = function() {
            return this.each(function() {
                var attributes = $.map(this.attributes, function(item) {
                    return item.name
                });
                var element = $(this);
                $.each(attributes, function(i, item) {
                    element.removeAttr(item)
                })
            })
        }, $.fn.akCallApi = function(sService, sMethod, oParams, fnSuccess, fnError) {
            var self = this;
            require("jquery.jsonrpc");
            require("jquery.loadmask");
            self.mask();
            var success = fnSuccess || $.noop,
                error = fnError || $.noop;
            $.jsonRPC.request(sMethod, {
                params: oParams,
                url: "/api/" + sService + (sService.lastIndexOf(".json") === -1 ? ".json" : ""),
                error: function(json) {
                    if ($.akEnv() === "dev") {
                        console.debug("Execute error callback", arguments)
                    }
                    self.unmask();
                    error.apply(self, arguments)
                },
                success: function(json) {
                    if ($.akEnv() === "dev") {
                        console.debug("Execute success callback", arguments)
                    }
                    self.unmask();
                    success.apply(self, arguments)
                }
            })
        };
        $.fn.exists = function() {
            return this.length > 0
        };
        $.extend({
            openLoginModal: function(jqEvent) {
                var jqModalLogin = $(".js-modal-login");
                if (!jqModalLogin || !jqModalLogin.length) {
                    if (jqEvent && $(jqEvent.target).is("a")) document.location.href = $(jqEvent.target)[0];
                    return false
                }
                jqModalLogin.ak_modal("open");
                return true
            },
            openNicknameModal: function(jqEvent) {
                var jqModalNickname = $(".ak-modal-nickname");
                if (!jqModalNickname || !jqModalNickname.length) {
                    if (jqEvent && $(jqEvent.target).is("a")) document.location.href = $(jqEvent.target)[0];
                    return false
                }
                jqModalNickname.ak_modal("open");
                return true
            },
            openBasketModal: function() {
                if ($("header:first").css("position") === "fixed" || $("header:first").hasClass("ak-navbar-fixed")) $(".ak-basket-link:last").ak_button_modal("show");
                else $(".ak-basket-link:first").ak_button_modal("show")
            },
            isTouchDevice: function() {
                return $("html").hasClass("touchevents")
            },
            getCurrentProfile: function() {
                return $(".device-profile:visible:first").data("deviceprofile")
            },
            akCallApi: function() {
                var jqTarget = $("body");
                jqTarget.akCallApi.apply(jqTarget, arguments)
            },
            akEnv: function() {
                return window.location.host.split(".").pop()
            },
            akLang: function() {
                return window.location.pathname.substr(1, 2)
            },
            akClientSupportFlash: function() {
                var bFlashPlugin = false;
                if ("plugins" in navigator)
                    for (var i in navigator.plugins) {
                        if (navigator.plugins[i].name == "Shockwave Flash") bFlashPlugin = true
                    }
                return bFlashPlugin
            },
            akClientLang: function(bFull) {
                var lang;
                var bFull = bFull === undefined ? false : bFull;
                if (navigator && navigator.userAgent && (lang = navigator.userAgent.match(/android.*\W(\w\w)-(\w\w)\W/i))) {
                    lang = lang[1]
                }
                if (!lang && navigator) {
                    if (navigator.language) {
                        lang = navigator.language
                    } else if (navigator.browserLanguage) {
                        lang = navigator.browserLanguage
                    } else if (navigator.systemLanguage) {
                        lang = navigator.systemLanguage
                    } else if (navigator.userLanguage) {
                        lang = navigator.userLanguage
                    }
                }
                if (bFull === false) lang = lang.substr(0, 2);
                return lang
            },
            akDateFormat: function() {
                var aFormats = {
                    "ar-ma": "DD/MM/YYYY",
                    "ar-sa": "DD/MM/YYYY",
                    ar: "DD/MM/YYYY",
                    az: "DD.MM.YYYY",
                    bg: "D.MM.YYYY",
                    bn: "DD/MM/YYYY",
                    br: "DD/MM/YYYY",
                    bs: "DD. MM. YYYY",
                    ca: "DD/MM/YYYY",
                    cs: "DD. MM. YYYY",
                    cv: "DD-MM-YYYY",
                    cy: "DD/MM/YYYY",
                    da: "DD/MM/YYYY",
                    "de-at": "DD.MM.YYYY",
                    de: "DD.MM.YYYY",
                    el: "DD/MM/YYYY",
                    en: "YYYY-MM-DD",
                    "en-au": "DD/MM/YYYY",
                    "en-ca": "YYYY-MM-DD",
                    "en-gb": "DD/MM/YYYY",
                    eo: "YYYY-MM-DD",
                    es: "DD/MM/YYYY",
                    et: "DD.MM.YYYY",
                    eu: "YYYY-MM-DD",
                    fa: "DD/MM/YYYY",
                    fi: "DD.MM.YYYY",
                    fo: "DD/MM/YYYY",
                    "fr-ca": "YYYY-MM-DD",
                    fr: "DD/MM/YYYY",
                    gl: "DD/MM/YYYY",
                    he: "DD/MM/YYYY",
                    hi: "DD/MM/YYYY",
                    hr: "DD. MM. YYYY",
                    hu: "YYYY.MM.DD.",
                    "hy-am": "DD.MM.YYYY",
                    id: "DD/MM/YYYY",
                    is: "DD/MM/YYYY",
                    it: "DD/MM/YYYY",
                    ja: "YYYY/MM/DD",
                    ka: "DD/MM/YYYY",
                    km: "DD/MM/YYYY",
                    ko: "YYYY.MM.DD",
                    lb: "DD.MM.YYYY",
                    lt: "YYYY-MM-DD",
                    lv: "DD.MM.YYYY",
                    mk: "D.MM.YYYY",
                    ml: "DD/MM/YYYY",
                    mr: "DD/MM/YYYY",
                    "ms-my": "DD/MM/YYYY",
                    nb: "DD.MM.YYYY",
                    ne: "DD/MM/YYYY",
                    nl: "DD-MM-YYYY",
                    nn: "DD.MM.YYYY",
                    pl: "DD.MM.YYYY",
                    "pt-br": "DD/MM/YYYY",
                    pt: "DD/MM/YYYY",
                    ro: "DD.MM.YYYY",
                    ru: "DD.MM.YYYY",
                    sk: "DD.MM.YYYY",
                    sl: "DD. MM. YYYY",
                    sq: "DD/MM/YYYY",
                    "sr-cyrl": "DD. MM. YYYY",
                    sr: "DD. MM. YYYY",
                    sv: "YYYY-MM-DD",
                    ta: "DD/MM/YYYY",
                    th: "YYYY/MM/DD",
                    "tl-ph": "MM/D/YYYY",
                    tr: "DD.MM.YYYY",
                    "tzm-latn": "DD/MM/YYYY",
                    tzm: "DD/MM/YYYY",
                    uk: "DD.MM.YYYY",
                    uz: "DD/MM/YYYY",
                    vi: "DD/MM/YYYY",
                    "zh-cn": "YYYY-MM-DD",
                    "zh-tw": "YYYY年MMMD日"
                };
                return aFormats[$.akLang()] || "YYYY-MM-DD"
            },
            akStatic: function() {
                var sHost = this.akEnv();
                return window.location.protocol + "//" + (window.location.protocol === "http:" ? "staticns.ankama." : "static.ankama.") + (sHost != "dev" && sHost != "tst" && sHost != "lan" && sHost != "pre" ? "com" : sHost)
            },
            akStorage: {
                _oDefaults: {
                    iTtl: 365
                },
                _prepareOptions: function(oOptions, oItem) {
                    oOptions = _.isObject(oOptions) ? $.extend(this._oDefaults, oOptions) : this._oDefaults;
                    oOptions = _.isObject(oItem) && _.isObject(oItem.oOptions) ? $.extend(oItem.oOptions, oOptions) : oOptions;
                    return oOptions
                },
                exists: function(sName) {
                    return window.localStorage.getItem(sName) != null
                },
                get: function(sName, bReturnOnlyValue) {
                    if (!window.localStorage) return false;
                    var sItem = window.localStorage.getItem(sName);
                    if (_.isNull(sItem)) return false;
                    bReturnOnlyValue = !_.isUndefined(bReturnOnlyValue) ? bReturnOnlyValue : true;
                    var oItem = {};
                    try {
                        oItem = JSON.parse(sItem)
                    } catch (e) {
                        return false
                    }
                    if (!_.isNull(oItem.dExpire)) {
                        var dNow = new Date;
                        var dExpire = new Date(oItem.dExpire);
                        if (dExpire.getTime() <= dNow.getTime()) {
                            this.remove(sName, null);
                            return null
                        }
                    }
                    return bReturnOnlyValue ? oItem.mValue : oItem
                },
                getSub: function(sName, sSubName) {
                    var oValue = this.get(sName, true);
                    return _.isObject(oValue) && !_.isUndefined(oValue[sSubName]) ? oValue[sSubName] : null
                },
                getSubs: function(sName) {
                    var oValue = this.get(sName, true);
                    return _.isObject(oValue) ? oValue : null
                },
                set: function(sName, mValue, oOptions, fCallback) {
                    if (!window.localStorage) return false;
                    oOptions = this._prepareOptions(oOptions, null);
                    var dExpire = null;
                    if (_.isNumber(oOptions.iTtl)) {
                        dExpire = new Date;
                        dExpire.setTime(dExpire.getTime() + oOptions.iTtl * 24 * 60 * 60 * 1e3)
                    }
                    if (_.isFunction(fCallback)) oOptions.bCallback = true;
                    var oItem = {
                        mValue: mValue,
                        dExpire: dExpire ? dExpire.toUTCString() : null,
                        oOptions: oOptions
                    };
                    try {
                        window.localStorage.setItem(sName, JSON.stringify(oItem))
                    } catch (e) {
                        console.error(e.message)
                    }
                    if (_.isFunction(fCallback)) fCallback.call(this, {
                        sAction: "set",
                        sName: sName,
                        oItem: oItem
                    });
                    return true
                },
                setSub: function(sName, sSubName, mValue, oOptions) {
                    var oItem = this.get(sName, false);
                    var oValue = _.isObject(oItem.mValue) ? oItem.mValue : {};
                    oOptions = this._prepareOptions(oOptions, oItem);
                    oValue[sSubName] = mValue;
                    return this.set(sName, oValue, oOptions, null)
                },
                setSubs: function(sName, oValue, oOptions) {
                    if (!_.isObject(oValue) || _.isEmpty(oValue)) return null;
                    var oItem = this.get(sName, false);
                    var oCurrentValue = _.isObject(oItem.mValue) ? oItem.mValue : {};
                    oOptions = this._prepareOptions(oOptions, oItem);
                    oValue = $.extend(true, oCurrentValue, oValue);
                    return this.set(sName, oValue, oOptions, null)
                },
                remove: function(sName, fCallback) {
                    if (!window.localStorage || !this.exists(sName)) return false;
                    var oItem = this.get(sName, false);
                    var oOptions = this._prepareOptions(null, oItem);
                    window.localStorage.removeItem(sName);
                    if (oOptions.bCallback && _.isFunction(fCallback)) fCallback.call(this, {
                        sAction: "remove",
                        sName: sName,
                        oItem: oItem
                    });
                    return true
                },
                removeSub: function(sName, sSubName) {
                    if (!window.localStorage || !this.exists(sName)) return false;
                    var oItem = this.get(sName, false);
                    var oValue = !_.isNull(oItem.mValue) ? oItem.mValue : null;
                    if (_.isObject(oValue) && !_.isUndefined(oValue[sSubName])) {
                        var oOptions = this._prepareOptions(null, oItem);
                        delete oValue[sSubName];
                        return this.set(sName, oValue, oOptions, null)
                    }
                    return null
                }
            },
            cookie: {
                _oDefaults: {
                    iExpires: 365,
                    sDomain: "",
                    bSecure: false,
                    sPath: "/"
                },
                exists: function(sName) {
                    return !_.isNull(this.get(sName))
                },
                get: function(sName) {
                    var sValue = null;
                    if (document.cookie && document.cookie != "") {
                        var aCookies = document.cookie.split(";");
                        for (var i = 0; i < aCookies.length; i++) {
                            var sCookie = $.trim(aCookies[i]);
                            if (sCookie.substring(0, sName.length + 1) == sName + "=") {
                                sValue = decodeURIComponent(sCookie.substring(sName.length + 1));
                                break
                            }
                        }
                    }
                    try {
                        return JSON.parse(sValue)
                    } catch (e) {
                        return sValue
                    }
                },
                getSub: function(sName, sSubName) {
                    var oCookie = this.get(sName);
                    return _.isObject(oCookie) && !_.isUndefined(oCookie[sSubName]) ? oCookie[sSubName] : null
                },
                getSubs: function(sName) {
                    var oCookie = this.get(sName);
                    return _.isObject(oCookie) ? oCookie : null
                },
                set: function(sName, mValue, oOptions) {
                    oOptions = !_.isUndefined(oOptions) ? $.extend(this._oDefaults, oOptions) : this._oDefaults;
                    var sPath = "; path=" + oOptions.sPath;
                    var sDomain = oOptions.sDomain ? "; domain=" + oOptions.sDomain : "";
                    var bSecure = oOptions.bSecure ? "; secure" : "";
                    if (mValue && (typeof mValue == "function" || typeof mValue == "object")) {
                        mValue = JSON.stringify(mValue)
                    }
                    mValue = encodeURIComponent(mValue);
                    var oDate;
                    if (_.isNumber(oOptions.iExpires)) {
                        oDate = new Date;
                        oDate.setTime(oDate.getTime() + oOptions.iExpires * 24 * 60 * 60 * 1e3)
                    } else {
                        oDate = oOptions.iExpires
                    }
                    var iExpires = _.isUndefined(oOptions.iExpires) ? "" : "; expires=" + oDate.toUTCString();
                    var sCreatedCookie = [sName, "=", mValue, iExpires, sPath, sDomain, bSecure].join("");
                    document.cookie = sCreatedCookie;
                    return sCreatedCookie
                },
                setSub: function(sName, sSubName, mValue, oOptions) {
                    oOptions = !_.isUndefined(oOptions) ? $.extend(this._oDefaults, oOptions) : this._oDefaults;
                    var oCookie = this.get(sName);
                    oCookie = _.isObject(oCookie) ? oCookie : {};
                    oCookie[sSubName] = mValue;
                    return this.set(sName, oCookie, oOptions)
                },
                setSubs: function(sName, oValue, oOptions) {
                    if (!_.isObject(oValue) || _.isEmpty(oValue)) return null;
                    oOptions = !_.isUndefined(oOptions) ? $.extend(this._oDefaults, oOptions) : this._oDefaults;
                    var oCookie = this.get(sName);
                    oCookie = _.isObject(oCookie) ? oCookie : {};
                    oCookie = $.extend(true, oCookie, oValue);
                    return this.set(sName, oCookie, oOptions)
                },
                clear: function(sName) {
                    this.set(sName, "", {})
                },
                remove: function(sName, oOptions) {
                    oOptions = _.isUndefined(oOptions) ? {} : oOptions;
                    if (this.exists(sName)) {
                        oOptions.iExpires = -1;
                        return this.set(sName, "", oOptions)
                    }
                    return null
                },
                removeSub: function(sName, sSubName, oOptions) {
                    var oCookie = this.get(sName);
                    if (_.isObject(oCookie) && !_.isUndefined(oCookie[sSubName])) {
                        delete oCookie[sSubName];
                        return this.set(sName, oCookie, oOptions)
                    }
                    return null
                }
            }
        });
        if ($.isTouchDevice()) {
            $(document).on("focus", "input, div, textarea", function(e) {
                $("body").addClass("fixfixed");
                e.stopImmediatePropagation()
            }).on("blur", "input, div, textarea", function(e) {
                $("body").removeClass("fixfixed");
                e.stopImmediatePropagation()
            })
        }
        $(document).bind("ready", function(oEvent) {
            var jqModalLogin = $(".js-modal-login");
            if (jqModalLogin.akOptions().popupblock) return true;
            jqModalLogin.bind("ak_dialogopen", function() {
                $(':input[name="login"]', this).focus()
            });
            var sLocationHash = window.location.hash;
            sLocationHash = sLocationHash.substr(1);
            var aPartsHash = sLocationHash.split("&");
            _.each(aPartsHash, function(part) {
                var aKV = part.split("=");
                if (aKV[0] == "loginfailed") {
                    $.ankama.ak_modal.prototype.enhanceWithin(oEvent.target);
                    window.location = "#";
                    $.openLoginModal();
                    return false
                }
            }, this)
        })
    })(jQuery, lodash);
    return jQuery
});
define("jquery.mailcheck", ["jquery"], function(jQuery) {
    var define = null;
    window.jQuery = jQuery;
    var Mailcheck = {
        domainThreshold: 2,
        secondLevelThreshold: 2,
        topLevelThreshold: 2,
        defaultDomains: ["msn.com", "bellsouth.net", "telus.net", "comcast.net", "optusnet.com.au", "earthlink.net", "qq.com", "sky.com", "icloud.com", "mac.com", "sympatico.ca", "googlemail.com", "att.net", "xtra.co.nz", "web.de", "cox.net", "gmail.com", "ymail.com", "aim.com", "rogers.com", "verizon.net", "rocketmail.com", "google.com", "optonline.net", "sbcglobal.net", "aol.com", "me.com", "btinternet.com", "charter.net", "shaw.ca"],
        defaultSecondLevelDomains: ["yahoo", "hotmail", "mail", "live", "outlook", "gmx"],
        defaultTopLevelDomains: ["com", "com.au", "com.tw", "ca", "co.nz", "co.uk", "de", "fr", "it", "ru", "net", "org", "edu", "gov", "jp", "nl", "kr", "se", "eu", "ie", "co.il", "us", "at", "be", "dk", "hk", "es", "gr", "ch", "no", "cz", "in", "net", "net.au", "info", "biz", "mil", "co.jp", "sg", "hu"],
        run: function(a) {
            a.domains = a.domains || Mailcheck.defaultDomains, a.secondLevelDomains = a.secondLevelDomains || Mailcheck.defaultSecondLevelDomains, a.topLevelDomains = a.topLevelDomains || Mailcheck.defaultTopLevelDomains, a.distanceFunction = a.distanceFunction || Mailcheck.sift3Distance;
            var b = function(a) {
                    return a
                },
                c = a.suggested || b,
                d = a.empty || b,
                e = Mailcheck.suggest(Mailcheck.encodeEmail(a.email), a.domains, a.secondLevelDomains, a.topLevelDomains, a.distanceFunction);
            return e ? c(e) : d()
        },
        suggest: function(a, b, c, d, e) {
            a = a.toLowerCase();
            var f = this.splitEmail(a);
            if (c && d && -1 !== c.indexOf(f.secondLevelDomain) && -1 !== d.indexOf(f.topLevelDomain)) return !1;
            var g = this.findClosestDomain(f.domain, b, e, this.domainThreshold);
            if (g) return g == f.domain ? !1 : {
                address: f.address,
                domain: g,
                full: f.address + "@" + g
            };
            var h = this.findClosestDomain(f.secondLevelDomain, c, e, this.secondLevelThreshold),
                i = this.findClosestDomain(f.topLevelDomain, d, e, this.topLevelThreshold);
            if (f.domain) {
                var g = f.domain,
                    j = !1;
                if (h && h != f.secondLevelDomain && (g = g.replace(f.secondLevelDomain, h), j = !0), i && i != f.topLevelDomain && (g = g.replace(f.topLevelDomain, i), j = !0), 1 == j) return {
                    address: f.address,
                    domain: g,
                    full: f.address + "@" + g
                }
            }
            return !1
        },
        findClosestDomain: function(a, b, c, d) {
            d = d || this.topLevelThreshold;
            var e, f = 99,
                g = null;
            if (!a || !b) return !1;
            c || (c = this.sift3Distance);
            for (var h = 0; h < b.length; h++) {
                if (a === b[h]) return a;
                e = c(a, b[h]), f > e && (f = e, g = b[h])
            }
            return d >= f && null !== g ? g : !1
        },
        sift3Distance: function(a, b) {
            if (null == a || 0 === a.length) return null == b || 0 === b.length ? 0 : b.length;
            if (null == b || 0 === b.length) return a.length;
            for (var c = 0, d = 0, e = 0, f = 0, g = 5; c + d < a.length && c + e < b.length;) {
                if (a.charAt(c + d) == b.charAt(c + e)) f++;
                else {
                    d = 0, e = 0;
                    for (var h = 0; g > h; h++) {
                        if (c + h < a.length && a.charAt(c + h) == b.charAt(c)) {
                            d = h;
                            break
                        }
                        if (c + h < b.length && a.charAt(c) == b.charAt(c + h)) {
                            e = h;
                            break
                        }
                    }
                }
                c++
            }
            return (a.length + b.length) / 2 - f
        },
        splitEmail: function(a) {
            var b = a.trim().split("@");
            if (b.length < 2) return !1;
            for (var c = 0; c < b.length; c++)
                if ("" === b[c]) return !1;
            var d = b.pop(),
                e = d.split("."),
                f = "",
                g = "";
            if (0 == e.length) return !1;
            if (1 == e.length) g = e[0];
            else {
                f = e[0];
                for (var c = 1; c < e.length; c++) g += e[c] + ".";
                g = g.substring(0, g.length - 1)
            }
            return {
                topLevelDomain: g,
                secondLevelDomain: f,
                domain: d,
                address: b.join("@")
            }
        },
        encodeEmail: function(a) {
            var b = encodeURI(a);
            return b = b.replace("%20", " ").replace("%25", "%").replace("%5E", "^").replace("%60", "`").replace("%7B", "{").replace("%7C", "|").replace("%7D", "}")
        }
    };
    "undefined" != typeof module && module.exports && (module.exports = Mailcheck), "function" == typeof define && define.amd && define("mailcheck", [], function() {
        return Mailcheck
    }), "undefined" != typeof window && window.jQuery && ! function(a) {
        a.fn.mailcheck = function(a) {
            var b = this;
            if (a.suggested) {
                var c = a.suggested;
                a.suggested = function(a) {
                    c(b, a)
                }
            }
            if (a.empty) {
                var d = a.empty;
                a.empty = function() {
                    d.call(null, b)
                }
            }
            a.email = this.val(), Mailcheck.run(a)
        }
    }(jQuery);
    delete window.jQuery;
    return [jQuery, Mailcheck]
});
define("jquery.form", ["jquery"], function(jQuery) {
    (function($) {
        "use strict";
        var feature = {};
        feature.fileapi = $("<input type='file'/>").get(0).files !== undefined;
        feature.formdata = window.FormData !== undefined;
        var hasProp = !!$.fn.prop;
        $.fn.attr2 = function() {
            if (!hasProp) return this.attr.apply(this, arguments);
            var val = this.prop.apply(this, arguments);
            if (val && val.jquery || typeof val === "string") return val;
            return this.attr.apply(this, arguments)
        };
        $.fn.ajaxSubmit = function(options) {
            if (!this.length) {
                log("ajaxSubmit: skipping submit process - no element selected");
                return this
            }
            var method, action, url, $form = this;
            if (typeof options == "function") {
                options = {
                    success: options
                }
            }
            method = options.type || this.attr2("method");
            action = options.url || this.attr2("action");
            url = typeof action === "string" ? $.trim(action) : "";
            url = url || window.location.href || "";
            if (url) {
                url = (url.match(/^([^#]+)/) || [])[1]
            }
            options = $.extend(true, {
                url: url,
                success: $.ajaxSettings.success,
                type: method || "GET",
                iframeSrc: /^https/i.test(window.location.href || "") ? "javascript:false" : "about:blank"
            }, options);
            var veto = {};
            this.trigger("form-pre-serialize", [this, options, veto]);
            if (veto.veto) {
                log("ajaxSubmit: submit vetoed via form-pre-serialize trigger");
                return this
            }
            if (options.beforeSerialize && options.beforeSerialize(this, options) === false) {
                log("ajaxSubmit: submit aborted via beforeSerialize callback");
                return this
            }
            var traditional = options.traditional;
            if (traditional === undefined) {
                traditional = $.ajaxSettings.traditional
            }
            var elements = [];
            var qx, a = this.formToArray(options.semantic, elements);
            if (options.data) {
                options.extraData = options.data;
                qx = $.param(options.data, traditional)
            }
            if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) {
                log("ajaxSubmit: submit aborted via beforeSubmit callback");
                return this
            }
            this.trigger("form-submit-validate", [a, this, options, veto]);
            if (veto.veto) {
                log("ajaxSubmit: submit vetoed via form-submit-validate trigger");
                return this
            }
            var q = $.param(a, traditional);
            if (qx) {
                q = q ? q + "&" + qx : qx
            }
            if (options.type.toUpperCase() == "GET") {
                options.url += (options.url.indexOf("?") >= 0 ? "&" : "?") + q;
                options.data = null
            } else {
                options.data = q
            }
            var callbacks = [];
            if (options.resetForm) {
                callbacks.push(function() {
                    $form.resetForm()
                })
            }
            if (options.clearForm) {
                callbacks.push(function() {
                    $form.clearForm(options.includeHidden)
                })
            }
            if (!options.dataType && options.target) {
                var oldSuccess = options.success || function() {};
                callbacks.push(function(data) {
                    var fn = options.replaceTarget ? "replaceWith" : "html";
                    $(options.target)[fn](data).each(oldSuccess, arguments)
                })
            } else if (options.success) {
                callbacks.push(options.success)
            }
            options.success = function(data, status, xhr) {
                var context = options.context || this;
                for (var i = 0, max = callbacks.length; i < max; i++) {
                    callbacks[i].apply(context, [data, status, xhr || $form, $form])
                }
            };
            if (options.error) {
                var oldError = options.error;
                options.error = function(xhr, status, error) {
                    var context = options.context || this;
                    oldError.apply(context, [xhr, status, error, $form])
                }
            }
            if (options.complete) {
                var oldComplete = options.complete;
                options.complete = function(xhr, status) {
                    var context = options.context || this;
                    oldComplete.apply(context, [xhr, status, $form])
                }
            }
            var fileInputs = $('input[type=file]:enabled[value!=""]', this);
            var hasFileInputs = fileInputs.length > 0;
            var mp = "multipart/form-data";
            var multipart = $form.attr("enctype") == mp || $form.attr("encoding") == mp;
            var fileAPI = feature.fileapi && feature.formdata;
            log("fileAPI :" + fileAPI);
            var shouldUseFrame = (hasFileInputs || multipart) && !fileAPI;
            var jqxhr;
            if (options.iframe !== false && (options.iframe || shouldUseFrame)) {
                if (options.closeKeepAlive) {
                    $.get(options.closeKeepAlive, function() {
                        jqxhr = fileUploadIframe(a)
                    })
                } else {
                    jqxhr = fileUploadIframe(a)
                }
            } else if ((hasFileInputs || multipart) && fileAPI) {
                jqxhr = fileUploadXhr(a)
            } else {
                jqxhr = $.ajax(options)
            }
            $form.removeData("jqxhr").data("jqxhr", jqxhr);
            for (var k = 0; k < elements.length; k++) elements[k] = null;
            this.trigger("form-submit-notify", [this, options]);
            return this;

            function deepSerialize(extraData) {
                var serialized = $.param(extraData, options.traditional).split("&");
                var len = serialized.length;
                var result = [];
                var i, part;
                for (i = 0; i < len; i++) {
                    serialized[i] = serialized[i].replace(/\+/g, " ");
                    part = serialized[i].split("=");
                    result.push([decodeURIComponent(part[0]), decodeURIComponent(part[1])])
                }
                return result
            }

            function fileUploadXhr(a) {
                var formdata = new FormData;
                for (var i = 0; i < a.length; i++) {
                    formdata.append(a[i].name, a[i].value)
                }
                if (options.extraData) {
                    var serializedData = deepSerialize(options.extraData);
                    for (i = 0; i < serializedData.length; i++)
                        if (serializedData[i]) formdata.append(serializedData[i][0], serializedData[i][1])
                }
                options.data = null;
                var s = $.extend(true, {}, $.ajaxSettings, options, {
                    contentType: false,
                    processData: false,
                    cache: false,
                    type: method || "POST"
                });
                if (options.uploadProgress) {
                    s.xhr = function() {
                        var xhr = $.ajaxSettings.xhr();
                        if (xhr.upload) {
                            xhr.upload.addEventListener("progress", function(event) {
                                var percent = 0;
                                var position = event.loaded || event.position;
                                var total = event.total;
                                if (event.lengthComputable) {
                                    percent = Math.ceil(position / total * 100)
                                }
                                options.uploadProgress(event, position, total, percent)
                            }, false)
                        }
                        return xhr
                    }
                }
                s.data = null;
                var beforeSend = s.beforeSend;
                s.beforeSend = function(xhr, o) {
                    o.data = formdata;
                    if (beforeSend) beforeSend.call(this, xhr, o)
                };
                return $.ajax(s)
            }

            function fileUploadIframe(a) {
                var form = $form[0],
                    el, i, s, g, id, $io, io, xhr, sub, n, timedOut, timeoutHandle;
                var deferred = $.Deferred();
                if (a) {
                    for (i = 0; i < elements.length; i++) {
                        el = $(elements[i]);
                        if (hasProp) el.prop("disabled", false);
                        else el.removeAttr("disabled")
                    }
                }
                s = $.extend(true, {}, $.ajaxSettings, options);
                s.context = s.context || s;
                id = "jqFormIO" + (new Date).getTime();
                if (s.iframeTarget) {
                    $io = $(s.iframeTarget);
                    n = $io.attr2("name");
                    if (!n) $io.attr2("name", id);
                    else id = n
                } else {
                    $io = $('<iframe name="' + id + '" src="' + s.iframeSrc + '" />');
                    $io.css({
                        position: "absolute",
                        top: "-1000px",
                        left: "-1000px"
                    })
                }
                io = $io[0];
                xhr = {
                    aborted: 0,
                    responseText: null,
                    responseXML: null,
                    status: 0,
                    statusText: "n/a",
                    getAllResponseHeaders: function() {},
                    getResponseHeader: function() {},
                    setRequestHeader: function() {},
                    abort: function(status) {
                        var e = status === "timeout" ? "timeout" : "aborted";
                        log("aborting upload... " + e);
                        this.aborted = 1;
                        try {
                            if (io.contentWindow.document.execCommand) {
                                io.contentWindow.document.execCommand("Stop")
                            }
                        } catch (ignore) {}
                        $io.attr("src", s.iframeSrc);
                        xhr.error = e;
                        if (s.error) s.error.call(s.context, xhr, e, status);
                        if (g) $.event.trigger("ajaxError", [xhr, s, e]);
                        if (s.complete) s.complete.call(s.context, xhr, e)
                    }
                };
                g = s.global;
                if (g && 0 === $.active++) {
                    $.event.trigger("ajaxStart")
                }
                if (g) {
                    $.event.trigger("ajaxSend", [xhr, s])
                }
                if (s.beforeSend && s.beforeSend.call(s.context, xhr, s) === false) {
                    if (s.global) {
                        $.active--
                    }
                    deferred.reject();
                    return deferred
                }
                if (xhr.aborted) {
                    deferred.reject();
                    return deferred
                }
                sub = form.clk;
                if (sub) {
                    n = sub.name;
                    if (n && !sub.disabled) {
                        s.extraData = s.extraData || {};
                        s.extraData[n] = sub.value;
                        if (sub.type == "image") {
                            s.extraData[n + ".x"] = form.clk_x;
                            s.extraData[n + ".y"] = form.clk_y
                        }
                    }
                }
                var CLIENT_TIMEOUT_ABORT = 1;
                var SERVER_ABORT = 2;

                function getDoc(frame) {
                    var doc = null;
                    try {
                        if (frame.contentWindow) {
                            doc = frame.contentWindow.document
                        }
                    } catch (err) {
                        log("cannot get iframe.contentWindow document: " + err)
                    }
                    if (doc) {
                        return doc
                    }
                    try {
                        doc = frame.contentDocument ? frame.contentDocument : frame.document
                    } catch (err) {
                        log("cannot get iframe.contentDocument: " + err);
                        doc = frame.document
                    }
                    return doc
                }
                var csrf_token = $("meta[name=csrf-token]").attr("content");
                var csrf_param = $("meta[name=csrf-param]").attr("content");
                if (csrf_param && csrf_token) {
                    s.extraData = s.extraData || {};
                    s.extraData[csrf_param] = csrf_token
                }

                function doSubmit() {
                    var t = $form.attr2("target"),
                        a = $form.attr2("action");
                    form.setAttribute("target", id);
                    if (!method) {
                        form.setAttribute("method", "POST")
                    }
                    if (a != s.url) {
                        form.setAttribute("action", s.url)
                    }
                    if (!s.skipEncodingOverride && (!method || /post/i.test(method))) {
                        $form.attr({
                            encoding: "multipart/form-data",
                            enctype: "multipart/form-data"
                        })
                    }
                    if (s.timeout) {
                        timeoutHandle = setTimeout(function() {
                            timedOut = true;
                            cb(CLIENT_TIMEOUT_ABORT)
                        }, s.timeout)
                    }

                    function checkState() {
                        try {
                            var state = getDoc(io).readyState;
                            log("state = " + state);
                            if (state && state.toLowerCase() == "uninitialized") setTimeout(checkState, 50)
                        } catch (e) {
                            log("Server abort: ", e, " (", e.name, ")");
                            cb(SERVER_ABORT);
                            if (timeoutHandle) clearTimeout(timeoutHandle);
                            timeoutHandle = undefined
                        }
                    }
                    var extraInputs = [];
                    try {
                        if (s.extraData) {
                            for (var n in s.extraData) {
                                if (s.extraData.hasOwnProperty(n)) {
                                    if ($.isPlainObject(s.extraData[n]) && s.extraData[n].hasOwnProperty("name") && s.extraData[n].hasOwnProperty("value")) {
                                        extraInputs.push($('<input type="hidden" name="' + s.extraData[n].name + '">').val(s.extraData[n].value).appendTo(form)[0])
                                    } else {
                                        extraInputs.push($('<input type="hidden" name="' + n + '">').val(s.extraData[n]).appendTo(form)[0])
                                    }
                                }
                            }
                        }
                        if (!s.iframeTarget) {
                            $io.appendTo("body");
                            if (io.attachEvent) io.attachEvent("onload", cb);
                            else io.addEventListener("load", cb, false)
                        }
                        setTimeout(checkState, 15);
                        try {
                            form.submit()
                        } catch (err) {
                            var submitFn = document.createElement("form").submit;
                            submitFn.apply(form)
                        }
                    } finally {
                        form.setAttribute("action", a);
                        if (t) {
                            form.setAttribute("target", t)
                        } else {
                            $form.removeAttr("target")
                        }
                        $(extraInputs).remove()
                    }
                }
                if (s.forceSync) {
                    doSubmit()
                } else {
                    setTimeout(doSubmit, 10)
                }
                var data, doc, domCheckCount = 50,
                    callbackProcessed;

                function cb(e) {
                    if (xhr.aborted || callbackProcessed) {
                        return
                    }
                    doc = getDoc(io);
                    if (!doc) {
                        log("cannot access response document");
                        e = SERVER_ABORT
                    }
                    if (e === CLIENT_TIMEOUT_ABORT && xhr) {
                        xhr.abort("timeout");
                        deferred.reject(xhr, "timeout");
                        return
                    } else if (e == SERVER_ABORT && xhr) {
                        xhr.abort("server abort");
                        deferred.reject(xhr, "error", "server abort");
                        return
                    }
                    if (!doc || doc.location.href == s.iframeSrc) {
                        if (!timedOut) return
                    }
                    if (io.detachEvent) io.detachEvent("onload", cb);
                    else io.removeEventListener("load", cb, false);
                    var status = "success",
                        errMsg;
                    try {
                        if (timedOut) {
                            throw "timeout"
                        }
                        var isXml = s.dataType == "xml" || doc.XMLDocument || $.isXMLDoc(doc);
                        log("isXml=" + isXml);
                        if (!isXml && window.opera && (doc.body === null || !doc.body.innerHTML)) {
                            if (--domCheckCount) {
                                log("requeing onLoad callback, DOM not available");
                                setTimeout(cb, 250);
                                return
                            }
                        }
                        var docRoot = doc.body ? doc.body : doc.documentElement;
                        xhr.responseText = docRoot ? docRoot.innerHTML : null;
                        xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc;
                        if (isXml) s.dataType = "xml";
                        xhr.getResponseHeader = function(header) {
                            var headers = {
                                "content-type": s.dataType
                            };
                            return headers[header]
                        };
                        if (docRoot) {
                            xhr.status = Number(docRoot.getAttribute("status")) || xhr.status;
                            xhr.statusText = docRoot.getAttribute("statusText") || xhr.statusText
                        }
                        var dt = (s.dataType || "").toLowerCase();
                        var scr = /(json|script|text)/.test(dt);
                        if (scr || s.textarea) {
                            var ta = doc.getElementsByTagName("textarea")[0];
                            if (ta) {
                                xhr.responseText = ta.value;
                                xhr.status = Number(ta.getAttribute("status")) || xhr.status;
                                xhr.statusText = ta.getAttribute("statusText") || xhr.statusText
                            } else if (scr) {
                                var pre = doc.getElementsByTagName("pre")[0];
                                var b = doc.getElementsByTagName("body")[0];
                                if (pre) {
                                    xhr.responseText = pre.textContent ? pre.textContent : pre.innerText
                                } else if (b) {
                                    xhr.responseText = b.textContent ? b.textContent : b.innerText
                                }
                            }
                        } else if (dt == "xml" && !xhr.responseXML && xhr.responseText) {
                            xhr.responseXML = toXml(xhr.responseText)
                        }
                        try {
                            data = httpData(xhr, dt, s)
                        } catch (err) {
                            status = "parsererror";
                            xhr.error = errMsg = err || status
                        }
                    } catch (err) {
                        log("error caught: ", err);
                        status = "error";
                        xhr.error = errMsg = err || status
                    }
                    if (xhr.aborted) {
                        log("upload aborted");
                        status = null
                    }
                    if (xhr.status) {
                        status = xhr.status >= 200 && xhr.status < 300 || xhr.status === 304 ? "success" : "error"
                    }
                    if (status === "success") {
                        if (s.success) s.success.call(s.context, data, "success", xhr);
                        deferred.resolve(xhr.responseText, "success", xhr);
                        if (g) $.event.trigger("ajaxSuccess", [xhr, s])
                    } else if (status) {
                        if (errMsg === undefined) errMsg = xhr.statusText;
                        if (s.error) s.error.call(s.context, xhr, status, errMsg);
                        deferred.reject(xhr, "error", errMsg);
                        if (g) $.event.trigger("ajaxError", [xhr, s, errMsg])
                    }
                    if (g) $.event.trigger("ajaxComplete", [xhr, s]);
                    if (g && !--$.active) {
                        $.event.trigger("ajaxStop")
                    }
                    if (s.complete) s.complete.call(s.context, xhr, status);
                    callbackProcessed = true;
                    if (s.timeout) clearTimeout(timeoutHandle);
                    setTimeout(function() {
                        if (!s.iframeTarget) $io.remove();
                        xhr.responseXML = null
                    }, 100)
                }
                var toXml = $.parseXML || function(s, doc) {
                    if (window.ActiveXObject) {
                        doc = new ActiveXObject("Microsoft.XMLDOM");
                        doc.async = "false";
                        doc.loadXML(s)
                    } else {
                        doc = (new DOMParser).parseFromString(s, "text/xml")
                    }
                    return doc && doc.documentElement && doc.documentElement.nodeName != "parsererror" ? doc : null
                };
                var parseJSON = $.parseJSON || function(s) {
                    return window["eval"]("(" + s + ")")
                };
                var httpData = function(xhr, type, s) {
                    var ct = xhr.getResponseHeader("content-type") || "",
                        xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
                        data = xml ? xhr.responseXML : xhr.responseText;
                    if (xml && data.documentElement.nodeName === "parsererror") {
                        if ($.error) $.error("parsererror")
                    }
                    if (s && s.dataFilter) {
                        data = s.dataFilter(data, type)
                    }
                    if (typeof data === "string") {
                        if (type === "json" || !type && ct.indexOf("json") >= 0) {
                            data = parseJSON(data)
                        } else if (type === "script" || !type && ct.indexOf("javascript") >= 0) {
                            $.globalEval(data)
                        }
                    }
                    return data
                };
                return deferred
            }
        };
        $.fn.ajaxForm = function(options) {
            options = options || {};
            options.delegation = options.delegation && $.isFunction($.fn.on);
            if (!options.delegation && this.length === 0) {
                var o = {
                    s: this.selector,
                    c: this.context
                };
                if (!$.isReady && o.s) {
                    log("DOM not ready, queuing ajaxForm");
                    $(function() {
                        $(o.s, o.c).ajaxForm(options)
                    });
                    return this
                }
                log("terminating; zero elements found by selector" + ($.isReady ? "" : " (DOM not ready)"));
                return this
            }
            if (options.delegation) {
                $(document).off("submit.form-plugin", this.selector, doAjaxSubmit).off("click.form-plugin", this.selector, captureSubmittingElement).on("submit.form-plugin", this.selector, options, doAjaxSubmit).on("click.form-plugin", this.selector, options, captureSubmittingElement);
                return this
            }
            return this.ajaxFormUnbind().bind("submit.form-plugin", options, doAjaxSubmit).bind("click.form-plugin", options, captureSubmittingElement)
        };

        function doAjaxSubmit(e) {
            var options = e.data;
            if (!e.isDefaultPrevented()) {
                e.preventDefault();
                $(this).ajaxSubmit(options)
            }
        }

        function captureSubmittingElement(e) {
            var target = e.target;
            var $el = $(target);
            if (!$el.is("[type=submit],[type=image]")) {
                var t = $el.closest("[type=submit]");
                if (t.length === 0) {
                    return
                }
                target = t[0]
            }
            var form = this;
            form.clk = target;
            if (target.type == "image") {
                if (e.offsetX !== undefined) {
                    form.clk_x = e.offsetX;
                    form.clk_y = e.offsetY
                } else if (typeof $.fn.offset == "function") {
                    var offset = $el.offset();
                    form.clk_x = e.pageX - offset.left;
                    form.clk_y = e.pageY - offset.top
                } else {
                    form.clk_x = e.pageX - target.offsetLeft;
                    form.clk_y = e.pageY - target.offsetTop
                }
            }
            setTimeout(function() {
                form.clk = form.clk_x = form.clk_y = null
            }, 100)
        }
        $.fn.ajaxFormUnbind = function() {
            return this.unbind("submit.form-plugin click.form-plugin")
        };
        $.fn.formToArray = function(semantic, elements) {
            var a = [];
            if (this.length === 0) {
                return a
            }
            var form = this[0];
            var els = semantic ? form.getElementsByTagName("*") : form.elements;
            if (!els) {
                return a
            }
            var i, j, n, v, el, max, jmax;
            for (i = 0, max = els.length; i < max; i++) {
                el = els[i];
                n = el.name;
                if (!n || el.disabled) {
                    continue
                }
                if (semantic && form.clk && el.type == "image") {
                    if (form.clk == el) {
                        a.push({
                            name: n,
                            value: $(el).val(),
                            type: el.type
                        });
                        a.push({
                            name: n + ".x",
                            value: form.clk_x
                        }, {
                            name: n + ".y",
                            value: form.clk_y
                        })
                    }
                    continue
                }
                v = $.fieldValue(el, true);
                if (v && v.constructor == Array) {
                    if (elements) elements.push(el);
                    for (j = 0, jmax = v.length; j < jmax; j++) {
                        a.push({
                            name: n,
                            value: v[j]
                        })
                    }
                } else if (feature.fileapi && el.type == "file") {
                    if (elements) elements.push(el);
                    var files = el.files;
                    if (files.length) {
                        for (j = 0; j < files.length; j++) {
                            a.push({
                                name: n,
                                value: files[j],
                                type: el.type
                            })
                        }
                    } else {
                        a.push({
                            name: n,
                            value: "",
                            type: el.type
                        })
                    }
                } else if (v !== null && typeof v != "undefined") {
                    if (elements) elements.push(el);
                    a.push({
                        name: n,
                        value: v,
                        type: el.type,
                        required: el.required
                    })
                }
            }
            if (!semantic && form.clk) {
                var $input = $(form.clk),
                    input = $input[0];
                n = input.name;
                if (n && !input.disabled && input.type == "image") {
                    a.push({
                        name: n,
                        value: $input.val()
                    });
                    a.push({
                        name: n + ".x",
                        value: form.clk_x
                    }, {
                        name: n + ".y",
                        value: form.clk_y
                    })
                }
            }
            return a
        };
        $.fn.formSerialize = function(semantic) {
            return $.param(this.formToArray(semantic))
        };
        $.fn.fieldSerialize = function(successful) {
            var a = [];
            this.each(function() {
                var n = this.name;
                if (!n) {
                    return
                }
                var v = $.fieldValue(this, successful);
                if (v && v.constructor == Array) {
                    for (var i = 0, max = v.length; i < max; i++) {
                        a.push({
                            name: n,
                            value: v[i]
                        })
                    }
                } else if (v !== null && typeof v != "undefined") {
                    a.push({
                        name: this.name,
                        value: v
                    })
                }
            });
            return $.param(a)
        };
        $.fn.fieldValue = function(successful) {
            for (var val = [], i = 0, max = this.length; i < max; i++) {
                var el = this[i];
                var v = $.fieldValue(el, successful);
                if (v === null || typeof v == "undefined" || v.constructor == Array && !v.length) {
                    continue
                }
                if (v.constructor == Array) $.merge(val, v);
                else val.push(v)
            }
            return val
        };
        $.fieldValue = function(el, successful) {
            var n = el.name,
                t = el.type,
                tag = el.tagName.toLowerCase();
            if (successful === undefined) {
                successful = true
            }
            if (successful && (!n || el.disabled || t == "reset" || t == "button" || (t == "checkbox" || t == "radio") && !el.checked || (t == "submit" || t == "image") && el.form && el.form.clk != el || tag == "select" && el.selectedIndex == -1)) {
                return null
            }
            if (tag == "select") {
                var index = el.selectedIndex;
                if (index < 0) {
                    return null
                }
                var a = [],
                    ops = el.options;
                var one = t == "select-one";
                var max = one ? index + 1 : ops.length;
                for (var i = one ? index : 0; i < max; i++) {
                    var op = ops[i];
                    if (op.selected) {
                        var v = op.value;
                        if (!v) {
                            v = op.attributes && op.attributes["value"] && !op.attributes["value"].specified ? op.text : op.value
                        }
                        if (one) {
                            return v
                        }
                        a.push(v)
                    }
                }
                return a
            }
            return $(el).val()
        };
        $.fn.clearForm = function(includeHidden) {
            return this.each(function() {
                $("input,select,textarea", this).clearFields(includeHidden)
            })
        };
        $.fn.clearFields = $.fn.clearInputs = function(includeHidden) {
            var re = /^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;
            return this.each(function() {
                var t = this.type,
                    tag = this.tagName.toLowerCase();
                if (re.test(t) || tag == "textarea") {
                    this.value = ""
                } else if (t == "checkbox" || t == "radio") {
                    this.checked = false
                } else if (tag == "select") {
                    this.selectedIndex = -1
                } else if (t == "file") {
                    if (/MSIE/.test(navigator.userAgent)) {
                        $(this).replaceWith($(this).clone(true))
                    } else {
                        $(this).val("")
                    }
                } else if (includeHidden) {
                    if (includeHidden === true && /hidden/.test(t) || typeof includeHidden == "string" && $(this).is(includeHidden)) this.value = ""
                }
            })
        };
        $.fn.resetForm = function() {
            return this.each(function() {
                if (typeof this.reset == "function" || typeof this.reset == "object" && !this.reset.nodeType) {
                    this.reset()
                }
            })
        };
        $.fn.enable = function(b) {
            if (b === undefined) {
                b = true
            }
            return this.each(function() {
                this.disabled = !b
            })
        };
        $.fn.selected = function(select) {
            if (select === undefined) {
                select = true
            }
            return this.each(function() {
                var t = this.type;
                if (t == "checkbox" || t == "radio") {
                    this.checked = select
                } else if (this.tagName.toLowerCase() == "option") {
                    var $sel = $(this).parent("select");
                    if (select && $sel[0] && $sel[0].type == "select-one") {
                        $sel.find("option").selected(false)
                    }
                    this.selected = select
                }
            })
        };
        $.fn.ajaxSubmit.debug = false;

        function log() {
            if (!$.fn.ajaxSubmit.debug) return;
            var msg = "[jquery.form] " + Array.prototype.join.call(arguments, "");
            if (window.console && window.console.log) {
                window.console.log(msg)
            } else if (window.opera && window.opera.postError) {
                window.opera.postError(msg)
            }
        }
    })(jQuery);
    return jQuery
});
define("jquery.pjax", ["jquery"], function(jQuery) {
    (function($) {
        function fnPjax(selector, container, options) {
            var context = this;
            return this.on("click.pjax", selector, function(event) {
                var opts = $.extend({}, optionsFor(container, options));
                if (!opts.container) opts.container = $(this).attr("data-pjax") || context;
                handleClick(event, opts)
            })
        }

        function handleClick(event, container, options) {
            options = optionsFor(container, options);
            var link = event.currentTarget;
            if (link.tagName.toUpperCase() !== "A") throw "$.fn.pjax or $.pjax.click requires an anchor element";
            if (event.which > 1 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return;
            if (event.isDefaultPrevented()) return;
            if (location.protocol !== link.protocol || location.hostname !== link.hostname) return;
            if (link.hash && link.href.replace(link.hash, "") === location.href.replace(location.hash, "")) return;
            if (link.href === location.href + "#") return;
            var defaults = {
                url: link.href,
                container: $(link).attr("data-pjax"),
                target: link
            };
            var opts = $.extend({}, defaults, options);
            var clickEvent = $.Event("pjax:click");
            $(link).trigger(clickEvent, [opts]);
            if (!clickEvent.isDefaultPrevented()) {
                pjax(opts);
                event.preventDefault()
            }
        }

        function handleSubmit(event, container, options) {
            if (event.isDefaultPrevented()) return;
            options = optionsFor(container, options);
            var form = event.currentTarget;
            var $form = $(form);
            if (form.tagName.toUpperCase() !== "FORM") throw "$.pjax.submit requires a form element";
            var defaults = {
                type: $form.attr("method").toUpperCase(),
                url: $form.attr("action") || window.location.href,
                data: $form.serializeArray(),
                container: $form.attr("data-pjax"),
                target: form
            };
            pjax($.extend({}, defaults, options));
            event.preventDefault()
        }

        function pjax(options) {
            options = $.extend(true, {}, $.ajaxSettings, pjax.defaults, options);
            if ($.isFunction(options.url)) options.url = options.url();
            var target = options.target;
            var hash = parseURL(options.url).hash;
            var context = options.context = findContainerFor(options.container);
            if (!options.data) options.data = {};
            options.data._pjax = context.selector;

            function fire(type, args) {
                var event = $.Event(type, {
                    relatedTarget: target
                });
                context.trigger(event, args);
                return !event.isDefaultPrevented()
            }
            var timeoutTimer;
            options.beforeSend = function(xhr, settings) {
                if (settings.type !== "GET") settings.timeout = 0;
                xhr.setRequestHeader("X-PJAX", "true");
                xhr.setRequestHeader("X-PJAX-Container", context.selector);
                if (!fire("pjax:beforeSend", [xhr, settings])) return false;
                if (settings.timeout > 0) {
                    timeoutTimer = setTimeout(function() {
                        if (fire("pjax:timeout", [xhr, options])) xhr.abort("timeout")
                    }, settings.timeout);
                    settings.timeout = 0
                }
                options.requestUrl = parseURL(settings.url).href
            };
            options.complete = function(xhr, textStatus) {
                if (timeoutTimer) clearTimeout(timeoutTimer);
                fire("pjax:complete", [xhr, textStatus, options]);
                fire("pjax:end", [xhr, options])
            };
            options.error = function(xhr, textStatus, errorThrown) {
                var container = extractContainer("", xhr, options);
                var allowed = fire("pjax:error", [xhr, textStatus, errorThrown, options]);
                window.console && console.log(xhr, textStatus, errorThrown, allowed, container);
                if (options.type == "GET" && textStatus !== "abort" && allowed || container.redirect) {
                    locationReplace(container.url)
                }
            };
            options.success = function(data, status, xhr) {
                if (!fire("pjax:requested", [data, status, xhr, options])) return;
                var currentVersion = typeof $.pjax.defaults.version === "function" ? $.pjax.defaults.version() : $.pjax.defaults.version;
                var latestVersion = xhr.getResponseHeader("X-PJAX-Version");
                var container = extractContainer(data, xhr, options);
                if (currentVersion && latestVersion && currentVersion !== latestVersion) {
                    locationReplace(container.url);
                    return
                }
                if (!container.contents) {
                    locationReplace(container.url);
                    return
                }
                pjax.state = {
                    id: options.id || uniqueId(),
                    url: container.url,
                    title: container.title,
                    container: context.selector,
                    fragment: options.fragment,
                    timeout: options.timeout
                };
                if (options.push || options.replace) {
                    window.history.replaceState(pjax.state, container.title, container.url)
                }
                if (document.activeElement && document.activeElement.node != "BODY") try {
                    document.activeElement.blur()
                } catch (e) {}
                if (container.title) document.title = container.title;
                fire("pjax:beforeReplace", [container.contents, options]);
                context.html(container.contents);
                var autofocusEl = context.find("input[autofocus], textarea[autofocus]").last()[0];
                if (autofocusEl && document.activeElement !== autofocusEl) {
                    autofocusEl.focus()
                }
                executeScriptTags(container.scripts);
                if (typeof options.scrollTo === "number") $(window).scrollTop(options.scrollTo);
                if (hash !== "") {
                    var url = parseURL(container.url);
                    url.hash = hash;
                    pjax.state.url = url.href;
                    window.history.replaceState(pjax.state, container.title, url.href);
                    var target = $(url.hash);
                    if (target.length) $(window).scrollTop(target.offset().top)
                }
                fire("pjax:success", [data, status, xhr, options])
            };
            if (!pjax.state && (options.push || options.replace)) {
                pjax.state = {
                    id: uniqueId(),
                    url: window.location.href,
                    title: document.title,
                    container: context.selector,
                    fragment: options.fragment,
                    timeout: options.timeout
                };
                window.history.replaceState(pjax.state, document.title)
            }
            var xhr = pjax.xhr;
            if (xhr && xhr.readyState < 4) {
                xhr.onreadystatechange = $.noop;
                xhr.abort()
            }
            pjax.options = options;
            var xhr = pjax.xhr = $.ajax(options);
            if (xhr.readyState > 0) {
                if (options.push && !options.replace) {
                    cachePush(pjax.state.id, context.clone().contents());
                    window.history.pushState(null, "", stripPjaxParam(options.requestUrl))
                }
                fire("pjax:start", [xhr, options]);
                fire("pjax:send", [xhr, options])
            }
            return pjax.xhr
        }

        function pjaxReload(container, options) {
            var defaults = {
                url: window.location.href,
                push: false,
                replace: true,
                scrollTo: false
            };
            return pjax($.extend(defaults, optionsFor(container, options)))
        }

        function locationReplace(url) {
            window.console && console.trace();
            window.history.replaceState(null, "", "#");
            window.location.replace(url)
        }
        var initialPop = true;
        var initialURL = window.location.href;
        var initialState = window.history.state;
        if (initialState && initialState.container) {
            pjax.state = initialState
        }
        if ("state" in window.history) {
            initialPop = false
        }

        function onPjaxPopstate(event) {
            var state = event.state;
            if (pjax.state && state && state.container) {
                if (initialPop && initialURL == state.url) return;
                if (pjax.state && pjax.state.id === state.id) return;
                var container = $(state.container);
                if (container.length) {
                    var direction, contents = cacheMapping[state.id];
                    if (pjax.state) {
                        direction = pjax.state.id < state.id ? "forward" : "back";
                        cachePop(direction, pjax.state.id, container.clone().contents())
                    }
                    var popstateEvent = $.Event("pjax:popstate", {
                        state: state,
                        direction: direction
                    });
                    container.trigger(popstateEvent);
                    var options = {
                        id: state.id,
                        url: state.url,
                        container: container,
                        push: false,
                        fragment: state.fragment,
                        timeout: state.timeout,
                        scrollTo: false
                    };
                    if (contents) {
                        container.trigger("pjax:start", [null, options]);
                        if (state.title) document.title = state.title;
                        container.trigger("pjax:beforeReplace", [contents, options]);
                        container.html(contents);
                        pjax.state = state;
                        container.trigger("pjax:end", [null, options])
                    } else {
                        pjax(options)
                    }
                    container[0].offsetHeight
                } else {
                    locationReplace(location.href)
                }
            }
            initialPop = false
        }

        function fallbackPjax(options) {
            var url = $.isFunction(options.url) ? options.url() : options.url,
                method = options.type ? options.type.toUpperCase() : "GET";
            var form = $("<form>", {
                method: method === "GET" ? "GET" : "POST",
                action: url,
                style: "display:none"
            });
            if (method !== "GET" && method !== "POST") {
                form.append($("<input>", {
                    type: "hidden",
                    name: "_method",
                    value: method.toLowerCase()
                }))
            }
            var data = options.data;
            if (typeof data === "string") {
                $.each(data.split("&"), function(index, value) {
                    var pair = value.split("=");
                    form.append($("<input>", {
                        type: "hidden",
                        name: pair[0],
                        value: pair[1]
                    }))
                })
            } else if (typeof data === "object") {
                for (key in data) form.append($("<input>", {
                    type: "hidden",
                    name: key,
                    value: data[key]
                }))
            }
            $(document.body).append(form);
            form.submit()
        }

        function uniqueId() {
            return (new Date).getTime()
        }

        function stripPjaxParam(url) {
            return url.replace(/\?_pjax=[^&]+&?/, "?").replace(/_pjax=[^&]+&?/, "").replace(/[\?&]$/, "")
        }

        function parseURL(url) {
            var a = document.createElement("a");
            a.href = url;
            return a
        }

        function optionsFor(container, options) {
            if (container && options) options.container = container;
            else if ($.isPlainObject(container)) options = container;
            else options = {
                container: container
            };
            if (options.container) options.container = findContainerFor(options.container);
            return options
        }

        function findContainerFor(container) {
            container = $(container);
            if (!container.length) {
                throw "no pjax container for " + container.selector
            } else if (container.selector !== "" && container.context === document) {
                return container
            } else if (container.attr("id")) {
                return $("#" + container.attr("id"))
            } else {
                throw "cant get selector for pjax container!"
            }
        }

        function findAll(elems, selector) {
            return elems.filter(selector).add(elems.find(selector))
        }

        function parseHTML(html) {
            return $.parseHTML(html, document, true)
        }

        function extractContainer(data, xhr, options) {
            var obj = {},
                parse = /<html/i.test(data);
            obj.redirect = xhr.getResponseHeader("X-PJAX-URL") ? true : false;
            obj.url = stripPjaxParam(xhr.getResponseHeader("X-PJAX-URL") || options.requestUrl);
            if (parse) {
                var $head = $(parseHTML(data.match(/<head[^>]*>([\s\S.]*)<\/head>/i)[0]));
                var $body = $(parseHTML(data.match(/<body[^>]*>([\s\S.]*)<\/body>/i)[0]))
            } else {
                var $head = $body = $(parseHTML(data))
            }
            if ($body.length === 0) return obj;
            obj.title = findAll($head, "title").last().text();
            if (options.fragment) {
                if (options.fragment === "body") {
                    var $fragment = $body
                } else {
                    var $fragment = findAll($body, options.fragment).first()
                }
                if ($fragment.length) {
                    obj.contents = $fragment.contents();
                    if (!obj.title) obj.title = $fragment.attr("title") || $fragment.data("title")
                }
            } else if (!parse) {
                obj.contents = $body
            }
            if (obj.contents) {
                obj.contents = obj.contents.not(function() {
                    return $(this).is("title")
                });
                obj.contents.find("title").remove();
                obj.scripts = findAll(obj.contents, "script[src]").remove();
                obj.contents = obj.contents.not(obj.scripts)
            }
            if (obj.title) obj.title = $.trim(obj.title);
            return obj
        }

        function executeScriptTags(scripts) {
            if (!scripts) return;
            var existingScripts = $("script[src]");
            scripts.each(function() {
                var src = this.src;
                var matchedScripts = existingScripts.filter(function() {
                    return this.src === src
                });
                if (matchedScripts.length) return;
                var script = document.createElement("script");
                script.type = $(this).attr("type");
                script.src = $(this).attr("src");
                document.head.appendChild(script)
            })
        }
        var cacheMapping = {};
        var cacheForwardStack = [];
        var cacheBackStack = [];

        function cachePush(id, value) {
            cacheMapping[id] = value;
            cacheBackStack.push(id);
            while (cacheForwardStack.length) delete cacheMapping[cacheForwardStack.shift()];
            while (cacheBackStack.length > pjax.defaults.maxCacheLength) delete cacheMapping[cacheBackStack.shift()]
        }

        function cachePop(direction, id, value) {
            var pushStack, popStack;
            cacheMapping[id] = value;
            if (direction === "forward") {
                pushStack = cacheBackStack;
                popStack = cacheForwardStack
            } else {
                pushStack = cacheForwardStack;
                popStack = cacheBackStack
            }
            pushStack.push(id);
            if (id = popStack.pop()) delete cacheMapping[id]
        }

        function findVersion() {
            return $("meta").filter(function() {
                var name = $(this).attr("http-equiv");
                return name && name.toUpperCase() === "X-PJAX-VERSION"
            }).attr("content")
        }

        function enable() {
            $.fn.pjax = fnPjax;
            $.pjax = pjax;
            $.pjax.enable = $.noop;
            $.pjax.disable = disable;
            $.pjax.click = handleClick;
            $.pjax.submit = handleSubmit;
            $.pjax.reload = pjaxReload;
            $.pjax.defaults = {
                timeout: 2e3,
                push: true,
                replace: false,
                type: "GET",
                dataType: "html",
                scrollTo: 0,
                maxCacheLength: 20,
                version: findVersion
            };
            $(window).on("popstate.pjax", onPjaxPopstate)
        }

        function disable() {
            $.fn.pjax = function() {
                return this
            };
            $.pjax = fallbackPjax;
            $.pjax.enable = enable;
            $.pjax.disable = $.noop;
            $.pjax.click = $.noop;
            $.pjax.submit = $.noop;
            $.pjax.reload = function() {
                window.location.reload()
            };
            $(window).off("popstate.pjax", onPjaxPopstate)
        }
        if ($.inArray("state", $.event.props) < 0) $.event.props.push("state");
        $.support.pjax = window.history && window.history.pushState && window.history.replaceState && !navigator.userAgent.match(/((iPod|iPhone|iPad).+\bOS\s+[1-4]|WebApps\/.+CFNetwork)/);
        $.support.pjax ? enable() : disable()
    })(jQuery);
    return jQuery
});
define("jquery.jsonrpc", ["jquery"], function(jQuery) {
    (function($, undefined) {
        $.extend({
            jsonRPC: {
                version: "2.0",
                endPoint: null,
                namespace: null,
                setup: function(params) {
                    this._validateConfigParams(params);
                    this.endPoint = params.endPoint;
                    this.namespace = params.namespace;
                    this.cache = params.cache !== undefined ? cache : true;
                    return this
                },
                withOptions: function(params, callback) {
                    this._validateConfigParams(params);
                    if (callback === undefined) throw "No callback specified";
                    origParams = {
                        endPoint: this.endPoint,
                        namespace: this.namespace
                    };
                    this.setup(params);
                    callback.call(this);
                    this.setup(origParams)
                },
                request: function(method, options) {
                    if (options === undefined) {
                        options = {
                            id: 1
                        }
                    }
                    if (options.id === undefined) {
                        options.id = 1
                    }
                    if (options.cache === undefined) {
                        options.cache = this.cache
                    }
                    this._validateRequestMethod(method);
                    this._validateRequestParams(options.params);
                    this._validateRequestCallbacks(options.success, options.error);
                    this._doRequest(JSON.stringify(this._requestDataObj(method, options.params, options.id)), options);
                    return true
                },
                batchRequest: function(requests, options) {
                    if (options === undefined) {
                        options = {}
                    }
                    if (!$.isArray(requests) || requests.length === 0) throw "Invalid requests supplied for jsonRPC batchRequest. Must be an array object that contain at least a method attribute";
                    var _that = this;
                    $.each(requests, function(i, req) {
                        _that._validateRequestMethod(req.method);
                        _that._validateRequestParams(req.params);
                        if (req.id === undefined) {
                            req.id = i + 1
                        }
                    });
                    this._validateRequestCallbacks(options.success, options.error);
                    var data = [],
                        request;
                    for (var i = 0; i < requests.length; i++) {
                        request = requests[i];
                        data.push(this._requestDataObj(request.method, request.params, request.id))
                    }
                    this._doRequest(JSON.stringify(data), options)
                },
                _validateConfigParams: function(params) {
                    if (params === undefined) {
                        throw "No params specified"
                    } else {
                        if (params.endPoint && typeof params.endPoint !== "string") {
                            throw "endPoint must be a string"
                        }
                        if (params.namespace && typeof params.namespace !== "string") {
                            throw "namespace must be a string"
                        }
                    }
                },
                _validateRequestMethod: function(method) {
                    if (typeof method !== "string") throw "Invalid method supplied for jsonRPC request";
                    return true
                },
                _validateRequestParams: function(params) {
                    if (!(params === null || params === undefined || typeof params === "object" || $.isArray(params))) {
                        throw "Invalid params supplied for jsonRPC request. It must be empty, an object or an array."
                    }
                    return true
                },
                _validateRequestCallbacks: function(success, error) {
                    if (success !== undefined && typeof success !== "function") throw "Invalid success callback supplied for jsonRPC request";
                    if (error !== undefined && typeof error !== "function") throw "Invalid error callback supplied for jsonRPC request";
                    return true
                },
                _doRequest: function(data, options) {
                    var _that = this;
                    $.ajax({
                        type: "POST",
                        async: false !== options.async,
                        dataType: "json",
                        contentType: "application/json",
                        url: this._requestUrl(options.endPoint || options.url, options.cache),
                        data: data,
                        cache: options.cache,
                        processData: false,
                        error: function(json) {
                            _that._requestError.call(_that, json, options.error)
                        },
                        success: function(json) {
                            _that._requestSuccess.call(_that, json, options.success, options.error)
                        }
                    })
                },
                _requestUrl: function(url, cache) {
                    url = url || this.endPoint;
                    if (!cache) {
                        if (url.indexOf("?") < 0) {
                            url += "?tm=" + (new Date).getTime()
                        } else {
                            url += "&tm=" + (new Date).getTime()
                        }
                    }
                    return url
                },
                _requestDataObj: function(method, params, id) {
                    var dataObj = {
                        jsonrpc: this.version,
                        method: this.namespace ? this.namespace + "." + method : method,
                        id: id
                    };
                    if (params !== undefined) {
                        dataObj.params = params
                    }
                    return dataObj
                },
                _requestError: function(json, error) {
                    if (error !== undefined && typeof error === "function") {
                        if (typeof json.responseText === "string") {
                            try {
                                error(eval("(" + json.responseText + ")"))
                            } catch (e) {
                                error(this._response())
                            }
                        } else {
                            error(this._response())
                        }
                    }
                },
                _requestSuccess: function(json, success, error) {
                    var response = this._response(json);
                    if (response.error && typeof error === "function") {
                        error(response);
                        return
                    }
                    if (typeof success === "function") {
                        success(response)
                    }
                },
                _response: function(json) {
                    if (json === undefined) {
                        return {
                            error: "Internal server error",
                            version: "2.0"
                        }
                    } else {
                        try {
                            if (typeof json === "string") {
                                json = eval("(" + json + ")")
                            }
                            if ($.isArray(json) && json.length > 0 && json[0].jsonrpc !== "2.0" || !$.isArray(json) && json.jsonrpc !== "2.0") {
                                throw "Version error"
                            }
                            return json
                        } catch (e) {
                            return {
                                error: "Internal server error: " + e,
                                version: "2.0"
                            }
                        }
                    }
                }
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.uri", ["jquery"], function(jQuery) {
    var define = null;
    window.jQuery = jQuery;
    (function(root, factory) {
        "use strict";
        if (typeof exports === "object") {
            module.exports = factory(require("./punycode"), require("./IPv6"), require("./SecondLevelDomains"))
        } else if (typeof define === "function" && define.amd) {
            define(["./punycode", "./IPv6", "./SecondLevelDomains"], factory)
        } else {
            root.URI = factory(root.punycode, root.IPv6, root.SecondLevelDomains, root)
        }
    })(this, function(punycode, IPv6, SLD, root) {
        "use strict";
        var _URI = root && root.URI;

        function URI(url, base) {
            if (!(this instanceof URI)) {
                return new URI(url, base)
            }
            if (url === undefined) {
                if (typeof location !== "undefined") {
                    url = location.href + ""
                } else {
                    url = ""
                }
            }
            this.href(url);
            if (base !== undefined) {
                return this.absoluteTo(base)
            }
            return this
        }
        URI.version = "1.14.2";
        var p = URI.prototype;
        var hasOwn = Object.prototype.hasOwnProperty;

        function escapeRegEx(string) {
            return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1")
        }

        function getType(value) {
            if (value === undefined) {
                return "Undefined"
            }
            return String(Object.prototype.toString.call(value)).slice(8, -1)
        }

        function isArray(obj) {
            return getType(obj) === "Array"
        }

        function filterArrayValues(data, value) {
            var lookup = {};
            var i, length;
            if (isArray(value)) {
                for (i = 0, length = value.length; i < length; i++) {
                    lookup[value[i]] = true
                }
            } else {
                lookup[value] = true
            }
            for (i = 0, length = data.length; i < length; i++) {
                if (lookup[data[i]] !== undefined) {
                    data.splice(i, 1);
                    length--;
                    i--
                }
            }
            return data
        }

        function arrayContains(list, value) {
            var i, length;
            if (isArray(value)) {
                for (i = 0, length = value.length; i < length; i++) {
                    if (!arrayContains(list, value[i])) {
                        return false
                    }
                }
                return true
            }
            var _type = getType(value);
            for (i = 0, length = list.length; i < length; i++) {
                if (_type === "RegExp") {
                    if (typeof list[i] === "string" && list[i].match(value)) {
                        return true
                    }
                } else if (list[i] === value) {
                    return true
                }
            }
            return false
        }

        function arraysEqual(one, two) {
            if (!isArray(one) || !isArray(two)) {
                return false
            }
            if (one.length !== two.length) {
                return false
            }
            one.sort();
            two.sort();
            for (var i = 0, l = one.length; i < l; i++) {
                if (one[i] !== two[i]) {
                    return false
                }
            }
            return true
        }
        URI._parts = function() {
            return {
                protocol: null,
                username: null,
                password: null,
                hostname: null,
                urn: null,
                port: null,
                path: null,
                query: null,
                fragment: null,
                duplicateQueryParameters: URI.duplicateQueryParameters,
                escapeQuerySpace: URI.escapeQuerySpace
            }
        };
        URI.duplicateQueryParameters = false;
        URI.escapeQuerySpace = true;
        URI.protocol_expression = /^[a-z][a-z0-9.+-]*$/i;
        URI.idn_expression = /[^a-z0-9\.-]/i;
        URI.punycode_expression = /(xn--)/i;
        URI.ip4_expression = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
        URI.ip6_expression = /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/;
        URI.find_uri_expression = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi;
        URI.findUri = {
            start: /\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,
            end: /[\s\r\n]|$/,
            trim: /[`!()\[\]{};:'".,<>?«»“”„‘’]+$/
        };
        URI.defaultPorts = {
            http: "80",
            https: "443",
            ftp: "21",
            gopher: "70",
            ws: "80",
            wss: "443"
        };
        URI.invalid_hostname_characters = /[^a-zA-Z0-9\.-]/;
        URI.domAttributes = {
            a: "href",
            blockquote: "cite",
            link: "href",
            base: "href",
            script: "src",
            form: "action",
            img: "src",
            area: "href",
            iframe: "src",
            embed: "src",
            source: "src",
            track: "src",
            input: "src",
            audio: "src",
            video: "src"
        };
        URI.getDomAttribute = function(node) {
            if (!node || !node.nodeName) {
                return undefined
            }
            var nodeName = node.nodeName.toLowerCase();
            if (nodeName === "input" && node.type !== "image") {
                return undefined
            }
            return URI.domAttributes[nodeName]
        };

        function escapeForDumbFirefox36(value) {
            return escape(value)
        }

        function strictEncodeURIComponent(string) {
            return encodeURIComponent(string).replace(/[!'()*]/g, escapeForDumbFirefox36).replace(/\*/g, "%2A")
        }
        URI.encode = strictEncodeURIComponent;
        URI.decode = decodeURIComponent;
        URI.iso8859 = function() {
            URI.encode = escape;
            URI.decode = unescape
        };
        URI.unicode = function() {
            URI.encode = strictEncodeURIComponent;
            URI.decode = decodeURIComponent
        };
        URI.characters = {
            pathname: {
                encode: {
                    expression: /%(24|26|2B|2C|3B|3D|3A|40)/gi,
                    map: {
                        "%24": "$",
                        "%26": "&",
                        "%2B": "+",
                        "%2C": ",",
                        "%3B": ";",
                        "%3D": "=",
                        "%3A": ":",
                        "%40": "@"
                    }
                },
                decode: {
                    expression: /[\/\?#]/g,
                    map: {
                        "/": "%2F",
                        "?": "%3F",
                        "#": "%23"
                    }
                }
            },
            reserved: {
                encode: {
                    expression: /%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/gi,
                    map: {
                        "%3A": ":",
                        "%2F": "/",
                        "%3F": "?",
                        "%23": "#",
                        "%5B": "[",
                        "%5D": "]",
                        "%40": "@",
                        "%21": "!",
                        "%24": "$",
                        "%26": "&",
                        "%27": "'",
                        "%28": "(",
                        "%29": ")",
                        "%2A": "*",
                        "%2B": "+",
                        "%2C": ",",
                        "%3B": ";",
                        "%3D": "="
                    }
                }
            }
        };
        URI.encodeQuery = function(string, escapeQuerySpace) {
            var escaped = URI.encode(string + "");
            if (escapeQuerySpace === undefined) {
                escapeQuerySpace = URI.escapeQuerySpace
            }
            return escapeQuerySpace ? escaped.replace(/%20/g, "+") : escaped
        };
        URI.decodeQuery = function(string, escapeQuerySpace) {
            string += "";
            if (escapeQuerySpace === undefined) {
                escapeQuerySpace = URI.escapeQuerySpace
            }
            try {
                return URI.decode(escapeQuerySpace ? string.replace(/\+/g, "%20") : string)
            } catch (e) {
                return string
            }
        };
        URI.recodePath = function(string) {
            var segments = (string + "").split("/");
            for (var i = 0, length = segments.length; i < length; i++) {
                segments[i] = URI.encodePathSegment(URI.decode(segments[i]))
            }
            return segments.join("/")
        };
        URI.decodePath = function(string) {
            var segments = (string + "").split("/");
            for (var i = 0, length = segments.length; i < length; i++) {
                segments[i] = URI.decodePathSegment(segments[i])
            }
            return segments.join("/")
        };
        var _parts = {
            encode: "encode",
            decode: "decode"
        };
        var _part;
        var generateAccessor = function(_group, _part) {
            return function(string) {
                try {
                    return URI[_part](string + "").replace(URI.characters[_group][_part].expression, function(c) {
                        return URI.characters[_group][_part].map[c]
                    })
                } catch (e) {
                    return string
                }
            }
        };
        for (_part in _parts) {
            URI[_part + "PathSegment"] = generateAccessor("pathname", _parts[_part])
        }
        URI.encodeReserved = generateAccessor("reserved", "encode");
        URI.parse = function(string, parts) {
            var pos;
            if (!parts) {
                parts = {}
            }
            pos = string.indexOf("#");
            if (pos > -1) {
                parts.fragment = string.substring(pos + 1) || null;
                string = string.substring(0, pos)
            }
            pos = string.indexOf("?");
            if (pos > -1) {
                parts.query = string.substring(pos + 1) || null;
                string = string.substring(0, pos)
            }
            if (string.substring(0, 2) === "//") {
                parts.protocol = null;
                string = string.substring(2);
                string = URI.parseAuthority(string, parts)
            } else {
                pos = string.indexOf(":");
                if (pos > -1) {
                    parts.protocol = string.substring(0, pos) || null;
                    if (parts.protocol && !parts.protocol.match(URI.protocol_expression)) {
                        parts.protocol = undefined
                    } else if (string.substring(pos + 1, pos + 3) === "//") {
                        string = string.substring(pos + 3);
                        string = URI.parseAuthority(string, parts)
                    } else {
                        string = string.substring(pos + 1);
                        parts.urn = true
                    }
                }
            }
            parts.path = string;
            return parts
        };
        URI.parseHost = function(string, parts) {
            var pos = string.indexOf("/");
            var bracketPos;
            var t;
            if (pos === -1) {
                pos = string.length
            }
            if (string.charAt(0) === "[") {
                bracketPos = string.indexOf("]");
                parts.hostname = string.substring(1, bracketPos) || null;
                parts.port = string.substring(bracketPos + 2, pos) || null;
                if (parts.port === "/") {
                    parts.port = null
                }
            } else {
                var firstColon = string.indexOf(":");
                var firstSlash = string.indexOf("/");
                var nextColon = string.indexOf(":", firstColon + 1);
                if (nextColon !== -1 && (firstSlash === -1 || nextColon < firstSlash)) {
                    parts.hostname = string.substring(0, pos) || null;
                    parts.port = null
                } else {
                    t = string.substring(0, pos).split(":");
                    parts.hostname = t[0] || null;
                    parts.port = t[1] || null
                }
            }
            if (parts.hostname && string.substring(pos).charAt(0) !== "/") {
                pos++;
                string = "/" + string
            }
            return string.substring(pos) || "/"
        };
        URI.parseAuthority = function(string, parts) {
            string = URI.parseUserinfo(string, parts);
            return URI.parseHost(string, parts)
        };
        URI.parseUserinfo = function(string, parts) {
            var firstSlash = string.indexOf("/");
            var pos = string.lastIndexOf("@", firstSlash > -1 ? firstSlash : string.length - 1);
            var t;
            if (pos > -1 && (firstSlash === -1 || pos < firstSlash)) {
                t = string.substring(0, pos).split(":");
                parts.username = t[0] ? URI.decode(t[0]) : null;
                t.shift();
                parts.password = t[0] ? URI.decode(t.join(":")) : null;
                string = string.substring(pos + 1)
            } else {
                parts.username = null;
                parts.password = null
            }
            return string
        };
        URI.parseQuery = function(string, escapeQuerySpace) {
            if (!string) {
                return {}
            }
            string = string.replace(/&+/g, "&").replace(/^\?*&*|&+$/g, "");
            if (!string) {
                return {}
            }
            var items = {};
            var splits = string.split("&");
            var length = splits.length;
            var v, name, value;
            for (var i = 0; i < length; i++) {
                v = splits[i].split("=");
                name = URI.decodeQuery(v.shift(), escapeQuerySpace);
                value = v.length ? URI.decodeQuery(v.join("="), escapeQuerySpace) : null;
                if (hasOwn.call(items, name)) {
                    if (typeof items[name] === "string") {
                        items[name] = [items[name]]
                    }
                    items[name].push(value)
                } else {
                    items[name] = value
                }
            }
            return items
        };
        URI.build = function(parts) {
            var t = "";
            if (parts.protocol) {
                t += parts.protocol + ":"
            }
            if (!parts.urn && (t || parts.hostname)) {
                t += "//"
            }
            t += URI.buildAuthority(parts) || "";
            if (typeof parts.path === "string") {
                if (parts.path.charAt(0) !== "/" && typeof parts.hostname === "string") {
                    t += "/"
                }
                t += parts.path
            }
            if (typeof parts.query === "string" && parts.query) {
                t += "?" + parts.query
            }
            if (typeof parts.fragment === "string" && parts.fragment) {
                t += "#" + parts.fragment
            }
            return t
        };
        URI.buildHost = function(parts) {
            var t = "";
            if (!parts.hostname) {
                return ""
            } else if (URI.ip6_expression.test(parts.hostname)) {
                t += "[" + parts.hostname + "]"
            } else {
                t += parts.hostname
            }
            if (parts.port) {
                t += ":" + parts.port
            }
            return t
        };
        URI.buildAuthority = function(parts) {
            return URI.buildUserinfo(parts) + URI.buildHost(parts)
        };
        URI.buildUserinfo = function(parts) {
            var t = "";
            if (parts.username) {
                t += URI.encode(parts.username);
                if (parts.password) {
                    t += ":" + URI.encode(parts.password)
                }
                t += "@"
            }
            return t
        };
        URI.buildQuery = function(data, duplicateQueryParameters, escapeQuerySpace) {
            var t = "";
            var unique, key, i, length;
            for (key in data) {
                if (hasOwn.call(data, key) && key) {
                    if (isArray(data[key])) {
                        unique = {};
                        for (i = 0, length = data[key].length; i < length; i++) {
                            if (data[key][i] !== undefined && unique[data[key][i] + ""] === undefined) {
                                t += "&" + URI.buildQueryParameter(key, data[key][i], escapeQuerySpace);
                                if (duplicateQueryParameters !== true) {
                                    unique[data[key][i] + ""] = true
                                }
                            }
                        }
                    } else if (data[key] !== undefined) {
                        t += "&" + URI.buildQueryParameter(key, data[key], escapeQuerySpace)
                    }
                }
            }
            return t.substring(1)
        };
        URI.buildQueryParameter = function(name, value, escapeQuerySpace) {
            return URI.encodeQuery(name, escapeQuerySpace) + (value !== null ? "=" + URI.encodeQuery(value, escapeQuerySpace) : "")
        };
        URI.addQuery = function(data, name, value) {
            if (typeof name === "object") {
                for (var key in name) {
                    if (hasOwn.call(name, key)) {
                        URI.addQuery(data, key, name[key])
                    }
                }
            } else if (typeof name === "string") {
                if (data[name] === undefined) {
                    data[name] = value;
                    return
                } else if (typeof data[name] === "string") {
                    data[name] = [data[name]]
                }
                if (!isArray(value)) {
                    value = [value]
                }
                data[name] = (data[name] || []).concat(value)
            } else {
                throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")
            }
        };
        URI.removeQuery = function(data, name, value) {
            var i, length, key;
            if (isArray(name)) {
                for (i = 0, length = name.length; i < length; i++) {
                    data[name[i]] = undefined
                }
            } else if (typeof name === "object") {
                for (key in name) {
                    if (hasOwn.call(name, key)) {
                        URI.removeQuery(data, key, name[key])
                    }
                }
            } else if (typeof name === "string") {
                if (value !== undefined) {
                    if (data[name] === value) {
                        data[name] = undefined
                    } else if (isArray(data[name])) {
                        data[name] = filterArrayValues(data[name], value)
                    }
                } else {
                    data[name] = undefined
                }
            } else {
                throw new TypeError("URI.removeQuery() accepts an object, string as the first parameter")
            }
        };
        URI.hasQuery = function(data, name, value, withinArray) {
            if (typeof name === "object") {
                for (var key in name) {
                    if (hasOwn.call(name, key)) {
                        if (!URI.hasQuery(data, key, name[key])) {
                            return false
                        }
                    }
                }
                return true
            } else if (typeof name !== "string") {
                throw new TypeError("URI.hasQuery() accepts an object, string as the name parameter")
            }
            switch (getType(value)) {
                case "Undefined":
                    return name in data;
                case "Boolean":
                    var _booly = Boolean(isArray(data[name]) ? data[name].length : data[name]);
                    return value === _booly;
                case "Function":
                    return !!value(data[name], name, data);
                case "Array":
                    if (!isArray(data[name])) {
                        return false
                    }
                    var op = withinArray ? arrayContains : arraysEqual;
                    return op(data[name], value);
                case "RegExp":
                    if (!isArray(data[name])) {
                        return Boolean(data[name] && data[name].match(value))
                    }
                    if (!withinArray) {
                        return false
                    }
                    return arrayContains(data[name], value);
                case "Number":
                    value = String(value);
                case "String":
                    if (!isArray(data[name])) {
                        return data[name] === value
                    }
                    if (!withinArray) {
                        return false
                    }
                    return arrayContains(data[name], value);
                default:
                    throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")
            }
        };
        URI.commonPath = function(one, two) {
            var length = Math.min(one.length, two.length);
            var pos;
            for (pos = 0; pos < length; pos++) {
                if (one.charAt(pos) !== two.charAt(pos)) {
                    pos--;
                    break
                }
            }
            if (pos < 1) {
                return one.charAt(0) === two.charAt(0) && one.charAt(0) === "/" ? "/" : ""
            }
            if (one.charAt(pos) !== "/" || two.charAt(pos) !== "/") {
                pos = one.substring(0, pos).lastIndexOf("/")
            }
            return one.substring(0, pos + 1)
        };
        URI.withinString = function(string, callback, options) {
            options || (options = {});
            var _start = options.start || URI.findUri.start;
            var _end = options.end || URI.findUri.end;
            var _trim = options.trim || URI.findUri.trim;
            var _attributeOpen = /[a-z0-9-]=["']?$/i;
            _start.lastIndex = 0;
            while (true) {
                var match = _start.exec(string);
                if (!match) {
                    break
                }
                var start = match.index;
                if (options.ignoreHtml) {
                    var attributeOpen = string.slice(Math.max(start - 3, 0), start);
                    if (attributeOpen && _attributeOpen.test(attributeOpen)) {
                        continue
                    }
                }
                var end = start + string.slice(start).search(_end);
                var slice = string.slice(start, end).replace(_trim, "");
                if (options.ignore && options.ignore.test(slice)) {
                    continue
                }
                end = start + slice.length;
                var result = callback(slice, start, end, string);
                string = string.slice(0, start) + result + string.slice(end);
                _start.lastIndex = start + result.length
            }
            _start.lastIndex = 0;
            return string
        };
        URI.ensureValidHostname = function(v) {
            if (v.match(URI.invalid_hostname_characters)) {
                if (!punycode) {
                    throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-] and Punycode.js is not available')
                }
                if (punycode.toASCII(v).match(URI.invalid_hostname_characters)) {
                    throw new TypeError('Hostname "' + v + '" contains characters other than [A-Z0-9.-]')
                }
            }
        };
        URI.noConflict = function(removeAll) {
            if (removeAll) {
                var unconflicted = {
                    URI: this.noConflict()
                };
                if (root.URITemplate && typeof root.URITemplate.noConflict === "function") {
                    unconflicted.URITemplate = root.URITemplate.noConflict()
                }
                if (root.IPv6 && typeof root.IPv6.noConflict === "function") {
                    unconflicted.IPv6 = root.IPv6.noConflict()
                }
                if (root.SecondLevelDomains && typeof root.SecondLevelDomains.noConflict === "function") {
                    unconflicted.SecondLevelDomains = root.SecondLevelDomains.noConflict()
                }
                return unconflicted
            } else if (root.URI === this) {
                root.URI = _URI
            }
            return this
        };
        p.build = function(deferBuild) {
            if (deferBuild === true) {
                this._deferred_build = true
            } else if (deferBuild === undefined || this._deferred_build) {
                this._string = URI.build(this._parts);
                this._deferred_build = false
            }
            return this
        };
        p.clone = function() {
            return new URI(this)
        };
        p.valueOf = p.toString = function() {
            return this.build(false)._string
        };

        function generateSimpleAccessor(_part) {
            return function(v, build) {
                if (v === undefined) {
                    return this._parts[_part] || ""
                } else {
                    this._parts[_part] = v || null;
                    this.build(!build);
                    return this
                }
            }
        }

        function generatePrefixAccessor(_part, _key) {
            return function(v, build) {
                if (v === undefined) {
                    return this._parts[_part] || ""
                } else {
                    if (v !== null) {
                        v = v + "";
                        if (v.charAt(0) === _key) {
                            v = v.substring(1)
                        }
                    }
                    this._parts[_part] = v;
                    this.build(!build);
                    return this
                }
            }
        }
        p.protocol = generateSimpleAccessor("protocol");
        p.username = generateSimpleAccessor("username");
        p.password = generateSimpleAccessor("password");
        p.hostname = generateSimpleAccessor("hostname");
        p.port = generateSimpleAccessor("port");
        p.query = generatePrefixAccessor("query", "?");
        p.fragment = generatePrefixAccessor("fragment", "#");
        p.search = function(v, build) {
            var t = this.query(v, build);
            return typeof t === "string" && t.length ? "?" + t : t
        };
        p.hash = function(v, build) {
            var t = this.fragment(v, build);
            return typeof t === "string" && t.length ? "#" + t : t
        };
        p.pathname = function(v, build) {
            if (v === undefined || v === true) {
                var res = this._parts.path || (this._parts.hostname ? "/" : "");
                return v ? URI.decodePath(res) : res
            } else {
                this._parts.path = v ? URI.recodePath(v) : "/";
                this.build(!build);
                return this
            }
        };
        p.path = p.pathname;
        p.href = function(href, build) {
            var key;
            if (href === undefined) {
                return this.toString()
            }
            this._string = "";
            this._parts = URI._parts();
            var _URI = href instanceof URI;
            var _object = typeof href === "object" && (href.hostname || href.path || href.pathname);
            if (href.nodeName) {
                var attribute = URI.getDomAttribute(href);
                href = href[attribute] || "";
                _object = false
            }
            if (!_URI && _object && href.pathname !== undefined) {
                href = href.toString()
            }
            if (typeof href === "string" || href instanceof String) {
                this._parts = URI.parse(String(href), this._parts)
            } else if (_URI || _object) {
                var src = _URI ? href._parts : href;
                for (key in src) {
                    if (hasOwn.call(this._parts, key)) {
                        this._parts[key] = src[key]
                    }
                }
            } else {
                throw new TypeError("invalid input")
            }
            this.build(!build);
            return this
        };
        p.is = function(what) {
            var ip = false;
            var ip4 = false;
            var ip6 = false;
            var name = false;
            var sld = false;
            var idn = false;
            var punycode = false;
            var relative = !this._parts.urn;
            if (this._parts.hostname) {
                relative = false;
                ip4 = URI.ip4_expression.test(this._parts.hostname);
                ip6 = URI.ip6_expression.test(this._parts.hostname);
                ip = ip4 || ip6;
                name = !ip;
                sld = name && SLD && SLD.has(this._parts.hostname);
                idn = name && URI.idn_expression.test(this._parts.hostname);
                punycode = name && URI.punycode_expression.test(this._parts.hostname)
            }
            switch (what.toLowerCase()) {
                case "relative":
                    return relative;
                case "absolute":
                    return !relative;
                case "domain":
                case "name":
                    return name;
                case "sld":
                    return sld;
                case "ip":
                    return ip;
                case "ip4":
                case "ipv4":
                case "inet4":
                    return ip4;
                case "ip6":
                case "ipv6":
                case "inet6":
                    return ip6;
                case "idn":
                    return idn;
                case "url":
                    return !this._parts.urn;
                case "urn":
                    return !!this._parts.urn;
                case "punycode":
                    return punycode
            }
            return null
        };
        var _protocol = p.protocol;
        var _port = p.port;
        var _hostname = p.hostname;
        p.protocol = function(v, build) {
            if (v !== undefined) {
                if (v) {
                    v = v.replace(/:(\/\/)?$/, "");
                    if (!v.match(URI.protocol_expression)) {
                        throw new TypeError('Protocol "' + v + "\" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]")
                    }
                }
            }
            return _protocol.call(this, v, build)
        };
        p.scheme = p.protocol;
        p.port = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v !== undefined) {
                if (v === 0) {
                    v = null
                }
                if (v) {
                    v += "";
                    if (v.charAt(0) === ":") {
                        v = v.substring(1)
                    }
                    if (v.match(/[^0-9]/)) {
                        throw new TypeError('Port "' + v + '" contains characters other than [0-9]')
                    }
                }
            }
            return _port.call(this, v, build)
        };
        p.hostname = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v !== undefined) {
                var x = {};
                URI.parseHost(v, x);
                v = x.hostname
            }
            return _hostname.call(this, v, build)
        };
        p.host = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v === undefined) {
                return this._parts.hostname ? URI.buildHost(this._parts) : ""
            } else {
                URI.parseHost(v, this._parts);
                this.build(!build);
                return this
            }
        };
        p.authority = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v === undefined) {
                return this._parts.hostname ? URI.buildAuthority(this._parts) : ""
            } else {
                URI.parseAuthority(v, this._parts);
                this.build(!build);
                return this
            }
        };
        p.userinfo = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v === undefined) {
                if (!this._parts.username) {
                    return ""
                }
                var t = URI.buildUserinfo(this._parts);
                return t.substring(0, t.length - 1)
            } else {
                if (v[v.length - 1] !== "@") {
                    v += "@"
                }
                URI.parseUserinfo(v, this._parts);
                this.build(!build);
                return this
            }
        };
        p.resource = function(v, build) {
            var parts;
            if (v === undefined) {
                return this.path() + this.search() + this.hash()
            }
            parts = URI.parse(v);
            this._parts.path = parts.path;
            this._parts.query = parts.query;
            this._parts.fragment = parts.fragment;
            this.build(!build);
            return this
        };
        p.subdomain = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v === undefined) {
                if (!this._parts.hostname || this.is("IP")) {
                    return ""
                }
                var end = this._parts.hostname.length - this.domain().length - 1;
                return this._parts.hostname.substring(0, end) || ""
            } else {
                var e = this._parts.hostname.length - this.domain().length;
                var sub = this._parts.hostname.substring(0, e);
                var replace = new RegExp("^" + escapeRegEx(sub));
                if (v && v.charAt(v.length - 1) !== ".") {
                    v += "."
                }
                if (v) {
                    URI.ensureValidHostname(v)
                }
                this._parts.hostname = this._parts.hostname.replace(replace, v);
                this.build(!build);
                return this
            }
        };
        p.domain = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (typeof v === "boolean") {
                build = v;
                v = undefined
            }
            if (v === undefined) {
                if (!this._parts.hostname || this.is("IP")) {
                    return ""
                }
                var t = this._parts.hostname.match(/\./g);
                if (t && t.length < 2) {
                    return this._parts.hostname
                }
                var end = this._parts.hostname.length - this.tld(build).length - 1;
                end = this._parts.hostname.lastIndexOf(".", end - 1) + 1;
                return this._parts.hostname.substring(end) || ""
            } else {
                if (!v) {
                    throw new TypeError("cannot set domain empty")
                }
                URI.ensureValidHostname(v);
                if (!this._parts.hostname || this.is("IP")) {
                    this._parts.hostname = v
                } else {
                    var replace = new RegExp(escapeRegEx(this.domain()) + "$");
                    this._parts.hostname = this._parts.hostname.replace(replace, v)
                }
                this.build(!build);
                return this
            }
        };
        p.tld = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (typeof v === "boolean") {
                build = v;
                v = undefined
            }
            if (v === undefined) {
                if (!this._parts.hostname || this.is("IP")) {
                    return ""
                }
                var pos = this._parts.hostname.lastIndexOf(".");
                var tld = this._parts.hostname.substring(pos + 1);
                if (build !== true && SLD && SLD.list[tld.toLowerCase()]) {
                    return SLD.get(this._parts.hostname) || tld
                }
                return tld
            } else {
                var replace;
                if (!v) {
                    throw new TypeError("cannot set TLD empty")
                } else if (v.match(/[^a-zA-Z0-9-]/)) {
                    if (SLD && SLD.is(v)) {
                        replace = new RegExp(escapeRegEx(this.tld()) + "$");
                        this._parts.hostname = this._parts.hostname.replace(replace, v)
                    } else {
                        throw new TypeError('TLD "' + v + '" contains characters other than [A-Z0-9]')
                    }
                } else if (!this._parts.hostname || this.is("IP")) {
                    throw new ReferenceError("cannot set TLD on non-domain host")
                } else {
                    replace = new RegExp(escapeRegEx(this.tld()) + "$");
                    this._parts.hostname = this._parts.hostname.replace(replace, v)
                }
                this.build(!build);
                return this
            }
        };
        p.directory = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v === undefined || v === true) {
                if (!this._parts.path && !this._parts.hostname) {
                    return ""
                }
                if (this._parts.path === "/") {
                    return "/"
                }
                var end = this._parts.path.length - this.filename().length - 1;
                var res = this._parts.path.substring(0, end) || (this._parts.hostname ? "/" : "");
                return v ? URI.decodePath(res) : res
            } else {
                var e = this._parts.path.length - this.filename().length;
                var directory = this._parts.path.substring(0, e);
                var replace = new RegExp("^" + escapeRegEx(directory));
                if (!this.is("relative")) {
                    if (!v) {
                        v = "/"
                    }
                    if (v.charAt(0) !== "/") {
                        v = "/" + v
                    }
                }
                if (v && v.charAt(v.length - 1) !== "/") {
                    v += "/"
                }
                v = URI.recodePath(v);
                this._parts.path = this._parts.path.replace(replace, v);
                this.build(!build);
                return this
            }
        };
        p.filename = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v === undefined || v === true) {
                if (!this._parts.path || this._parts.path === "/") {
                    return ""
                }
                var pos = this._parts.path.lastIndexOf("/");
                var res = this._parts.path.substring(pos + 1);
                return v ? URI.decodePathSegment(res) : res
            } else {
                var mutatedDirectory = false;
                if (v.charAt(0) === "/") {
                    v = v.substring(1)
                }
                if (v.match(/\.?\//)) {
                    mutatedDirectory = true
                }
                var replace = new RegExp(escapeRegEx(this.filename()) + "$");
                v = URI.recodePath(v);
                this._parts.path = this._parts.path.replace(replace, v);
                if (mutatedDirectory) {
                    this.normalizePath(build)
                } else {
                    this.build(!build)
                }
                return this
            }
        };
        p.suffix = function(v, build) {
            if (this._parts.urn) {
                return v === undefined ? "" : this
            }
            if (v === undefined || v === true) {
                if (!this._parts.path || this._parts.path === "/") {
                    return ""
                }
                var filename = this.filename();
                var pos = filename.lastIndexOf(".");
                var s, res;
                if (pos === -1) {
                    return ""
                }
                s = filename.substring(pos + 1);
                res = /^[a-z0-9%]+$/i.test(s) ? s : "";
                return v ? URI.decodePathSegment(res) : res
            } else {
                if (v.charAt(0) === ".") {
                    v = v.substring(1)
                }
                var suffix = this.suffix();
                var replace;
                if (!suffix) {
                    if (!v) {
                        return this
                    }
                    this._parts.path += "." + URI.recodePath(v)
                } else if (!v) {
                    replace = new RegExp(escapeRegEx("." + suffix) + "$")
                } else {
                    replace = new RegExp(escapeRegEx(suffix) + "$")
                }
                if (replace) {
                    v = URI.recodePath(v);
                    this._parts.path = this._parts.path.replace(replace, v)
                }
                this.build(!build);
                return this
            }
        };
        p.segment = function(segment, v, build) {
            var separator = this._parts.urn ? ":" : "/";
            var path = this.path();
            var absolute = path.substring(0, 1) === "/";
            var segments = path.split(separator);
            if (segment !== undefined && typeof segment !== "number") {
                build = v;
                v = segment;
                segment = undefined
            }
            if (segment !== undefined && typeof segment !== "number") {
                throw new Error('Bad segment "' + segment + '", must be 0-based integer')
            }
            if (absolute) {
                segments.shift()
            }
            if (segment < 0) {
                segment = Math.max(segments.length + segment, 0)
            }
            if (v === undefined) {
                return segment === undefined ? segments : segments[segment]
            } else if (segment === null || segments[segment] === undefined) {
                if (isArray(v)) {
                    segments = [];
                    for (var i = 0, l = v.length; i < l; i++) {
                        if (!v[i].length && (!segments.length || !segments[segments.length - 1].length)) {
                            continue
                        }
                        if (segments.length && !segments[segments.length - 1].length) {
                            segments.pop()
                        }
                        segments.push(v[i])
                    }
                } else if (v || typeof v === "string") {
                    if (segments[segments.length - 1] === "") {
                        segments[segments.length - 1] = v
                    } else {
                        segments.push(v)
                    }
                }
            } else {
                if (v) {
                    segments[segment] = v
                } else {
                    segments.splice(segment, 1)
                }
            }
            if (absolute) {
                segments.unshift("")
            }
            return this.path(segments.join(separator), build)
        };
        p.segmentCoded = function(segment, v, build) {
            var segments, i, l;
            if (typeof segment !== "number") {
                build = v;
                v = segment;
                segment = undefined
            }
            if (v === undefined) {
                segments = this.segment(segment, v, build);
                if (!isArray(segments)) {
                    segments = segments !== undefined ? URI.decode(segments) : undefined
                } else {
                    for (i = 0, l = segments.length; i < l; i++) {
                        segments[i] = URI.decode(segments[i])
                    }
                }
                return segments
            }
            if (!isArray(v)) {
                v = typeof v === "string" || v instanceof String ? URI.encode(v) : v
            } else {
                for (i = 0, l = v.length; i < l; i++) {
                    v[i] = URI.decode(v[i])
                }
            }
            return this.segment(segment, v, build)
        };
        var q = p.query;
        p.query = function(v, build) {
            if (v === true) {
                return URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace)
            } else if (typeof v === "function") {
                var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
                var result = v.call(this, data);
                this._parts.query = URI.buildQuery(result || data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
                this.build(!build);
                return this
            } else if (v !== undefined && typeof v !== "string") {
                this._parts.query = URI.buildQuery(v, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
                this.build(!build);
                return this
            } else {
                return q.call(this, v, build)
            }
        };
        p.setQuery = function(name, value, build) {
            var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
            if (typeof name === "string" || name instanceof String) {
                data[name] = value !== undefined ? value : null
            } else if (typeof name === "object") {
                for (var key in name) {
                    if (hasOwn.call(name, key)) {
                        data[key] = name[key]
                    }
                }
            } else {
                throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")
            }
            this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
            if (typeof name !== "string") {
                build = value
            }
            this.build(!build);
            return this
        };
        p.addQuery = function(name, value, build) {
            var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
            URI.addQuery(data, name, value === undefined ? null : value);
            this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
            if (typeof name !== "string") {
                build = value
            }
            this.build(!build);
            return this
        };
        p.removeQuery = function(name, value, build) {
            var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
            URI.removeQuery(data, name, value);
            this._parts.query = URI.buildQuery(data, this._parts.duplicateQueryParameters, this._parts.escapeQuerySpace);
            if (typeof name !== "string") {
                build = value
            }
            this.build(!build);
            return this
        };
        p.hasQuery = function(name, value, withinArray) {
            var data = URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace);
            return URI.hasQuery(data, name, value, withinArray)
        };
        p.setSearch = p.setQuery;
        p.addSearch = p.addQuery;
        p.removeSearch = p.removeQuery;
        p.hasSearch = p.hasQuery;
        p.normalize = function() {
            if (this._parts.urn) {
                return this.normalizeProtocol(false).normalizeQuery(false).normalizeFragment(false).build()
            }
            return this.normalizeProtocol(false).normalizeHostname(false).normalizePort(false).normalizePath(false).normalizeQuery(false).normalizeFragment(false).build()
        };
        p.normalizeProtocol = function(build) {
            if (typeof this._parts.protocol === "string") {
                this._parts.protocol = this._parts.protocol.toLowerCase();
                this.build(!build)
            }
            return this
        };
        p.normalizeHostname = function(build) {
            if (this._parts.hostname) {
                if (this.is("IDN") && punycode) {
                    this._parts.hostname = punycode.toASCII(this._parts.hostname)
                } else if (this.is("IPv6") && IPv6) {
                    this._parts.hostname = IPv6.best(this._parts.hostname)
                }
                this._parts.hostname = this._parts.hostname.toLowerCase();
                this.build(!build)
            }
            return this
        };
        p.normalizePort = function(build) {
            if (typeof this._parts.protocol === "string" && this._parts.port === URI.defaultPorts[this._parts.protocol]) {
                this._parts.port = null;
                this.build(!build)
            }
            return this
        };
        p.normalizePath = function(build) {
            if (this._parts.urn) {
                return this
            }
            if (!this._parts.path || this._parts.path === "/") {
                return this
            }
            var _was_relative;
            var _path = this._parts.path;
            var _leadingParents = "";
            var _parent, _pos;
            if (_path.charAt(0) !== "/") {
                _was_relative = true;
                _path = "/" + _path
            }
            _path = _path.replace(/(\/(\.\/)+)|(\/\.$)/g, "/").replace(/\/{2,}/g, "/");
            if (_was_relative) {
                _leadingParents = _path.substring(1).match(/^(\.\.\/)+/) || "";
                if (_leadingParents) {
                    _leadingParents = _leadingParents[0]
                }
            }
            while (true) {
                _parent = _path.indexOf("/..");
                if (_parent === -1) {
                    break
                } else if (_parent === 0) {
                    _path = _path.substring(3);
                    continue
                }
                _pos = _path.substring(0, _parent).lastIndexOf("/");
                if (_pos === -1) {
                    _pos = _parent
                }
                _path = _path.substring(0, _pos) + _path.substring(_parent + 3)
            }
            if (_was_relative && this.is("relative")) {
                _path = _leadingParents + _path.substring(1)
            }
            _path = URI.recodePath(_path);
            this._parts.path = _path;
            this.build(!build);
            return this
        };
        p.normalizePathname = p.normalizePath;
        p.normalizeQuery = function(build) {
            if (typeof this._parts.query === "string") {
                if (!this._parts.query.length) {
                    this._parts.query = null
                } else {
                    this.query(URI.parseQuery(this._parts.query, this._parts.escapeQuerySpace))
                }
                this.build(!build)
            }
            return this
        };
        p.normalizeFragment = function(build) {
            if (!this._parts.fragment) {
                this._parts.fragment = null;
                this.build(!build)
            }
            return this
        };
        p.normalizeSearch = p.normalizeQuery;
        p.normalizeHash = p.normalizeFragment;
        p.iso8859 = function() {
            var e = URI.encode;
            var d = URI.decode;
            URI.encode = escape;
            URI.decode = decodeURIComponent;
            this.normalize();
            URI.encode = e;
            URI.decode = d;
            return this
        };
        p.unicode = function() {
            var e = URI.encode;
            var d = URI.decode;
            URI.encode = strictEncodeURIComponent;
            URI.decode = unescape;
            this.normalize();
            URI.encode = e;
            URI.decode = d;
            return this
        };
        p.readable = function() {
            var uri = this.clone();
            uri.username("").password("").normalize();
            var t = "";
            if (uri._parts.protocol) {
                t += uri._parts.protocol + "://"
            }
            if (uri._parts.hostname) {
                if (uri.is("punycode") && punycode) {
                    t += punycode.toUnicode(uri._parts.hostname);
                    if (uri._parts.port) {
                        t += ":" + uri._parts.port
                    }
                } else {
                    t += uri.host()
                }
            }
            if (uri._parts.hostname && uri._parts.path && uri._parts.path.charAt(0) !== "/") {
                t += "/"
            }
            t += uri.path(true);
            if (uri._parts.query) {
                var q = "";
                for (var i = 0, qp = uri._parts.query.split("&"), l = qp.length; i < l; i++) {
                    var kv = (qp[i] || "").split("=");
                    q += "&" + URI.decodeQuery(kv[0], this._parts.escapeQuerySpace).replace(/&/g, "%26");
                    if (kv[1] !== undefined) {
                        q += "=" + URI.decodeQuery(kv[1], this._parts.escapeQuerySpace).replace(/&/g, "%26")
                    }
                }
                t += "?" + q.substring(1)
            }
            t += URI.decodeQuery(uri.hash(), true);
            return t
        };
        p.absoluteTo = function(base) {
            var resolved = this.clone();
            var properties = ["protocol", "username", "password", "hostname", "port"];
            var basedir, i, p;
            if (this._parts.urn) {
                throw new Error("URNs do not have any generally defined hierarchical components")
            }
            if (!(base instanceof URI)) {
                base = new URI(base)
            }
            if (!resolved._parts.protocol) {
                resolved._parts.protocol = base._parts.protocol
            }
            if (this._parts.hostname) {
                return resolved
            }
            for (i = 0; p = properties[i]; i++) {
                resolved._parts[p] = base._parts[p]
            }
            if (!resolved._parts.path) {
                resolved._parts.path = base._parts.path;
                if (!resolved._parts.query) {
                    resolved._parts.query = base._parts.query
                }
            } else if (resolved._parts.path.substring(-2) === "..") {
                resolved._parts.path += "/"
            }
            if (resolved.path().charAt(0) !== "/") {
                basedir = base.directory();
                resolved._parts.path = (basedir ? basedir + "/" : "") + resolved._parts.path;
                resolved.normalizePath()
            }
            resolved.build();
            return resolved
        };
        p.relativeTo = function(base) {
            var relative = this.clone().normalize();
            var relativeParts, baseParts, common, relativePath, basePath;
            if (relative._parts.urn) {
                throw new Error("URNs do not have any generally defined hierarchical components")
            }
            base = new URI(base).normalize();
            relativeParts = relative._parts;
            baseParts = base._parts;
            relativePath = relative.path();
            basePath = base.path();
            if (relativePath.charAt(0) !== "/") {
                throw new Error("URI is already relative")
            }
            if (basePath.charAt(0) !== "/") {
                throw new Error("Cannot calculate a URI relative to another relative URI")
            }
            if (relativeParts.protocol === baseParts.protocol) {
                relativeParts.protocol = null
            }
            if (relativeParts.username !== baseParts.username || relativeParts.password !== baseParts.password) {
                return relative.build()
            }
            if (relativeParts.protocol !== null || relativeParts.username !== null || relativeParts.password !== null) {
                return relative.build()
            }
            if (relativeParts.hostname === baseParts.hostname && relativeParts.port === baseParts.port) {
                relativeParts.hostname = null;
                relativeParts.port = null
            } else {
                return relative.build()
            }
            if (relativePath === basePath) {
                relativeParts.path = "";
                return relative.build()
            }
            common = URI.commonPath(relative.path(), base.path());
            if (!common) {
                return relative.build()
            }
            var parents = baseParts.path.substring(common.length).replace(/[^\/]*$/, "").replace(/.*?\//g, "../");
            relativeParts.path = parents + relativeParts.path.substring(common.length);
            return relative.build()
        };
        p.equals = function(uri) {
            var one = this.clone();
            var two = new URI(uri);
            var one_map = {};
            var two_map = {};
            var checked = {};
            var one_query, two_query, key;
            one.normalize();
            two.normalize();
            if (one.toString() === two.toString()) {
                return true
            }
            one_query = one.query();
            two_query = two.query();
            one.query("");
            two.query("");
            if (one.toString() !== two.toString()) {
                return false
            }
            if (one_query.length !== two_query.length) {
                return false
            }
            one_map = URI.parseQuery(one_query, this._parts.escapeQuerySpace);
            two_map = URI.parseQuery(two_query, this._parts.escapeQuerySpace);
            for (key in one_map) {
                if (hasOwn.call(one_map, key)) {
                    if (!isArray(one_map[key])) {
                        if (one_map[key] !== two_map[key]) {
                            return false
                        }
                    } else if (!arraysEqual(one_map[key], two_map[key])) {
                        return false
                    }
                    checked[key] = true
                }
            }
            for (key in two_map) {
                if (hasOwn.call(two_map, key)) {
                    if (!checked[key]) {
                        return false
                    }
                }
            }
            return true
        };
        p.duplicateQueryParameters = function(v) {
            this._parts.duplicateQueryParameters = !!v;
            return this
        };
        p.escapeQuerySpace = function(v) {
            this._parts.escapeQuerySpace = !!v;
            return this
        };
        return URI
    });
    (function(root, factory) {
        "use strict";
        if (typeof exports === "object") {
            module.exports = factory(require("jquery", "./URI"))
        } else if (typeof define === "function" && define.amd) {
            define(["jquery", "./URI"], factory)
        } else {
            factory(root.jQuery, root.URI)
        }
    })(this, function($, URI) {
        "use strict";
        var comparable = {};
        var compare = {
            "=": function(value, target) {
                return value === target
            },
            "^=": function(value, target) {
                return !!(value + "").match(new RegExp("^" + escapeRegEx(target), "i"))
            },
            "$=": function(value, target) {
                return !!(value + "").match(new RegExp(escapeRegEx(target) + "$", "i"))
            },
            "*=": function(value, target, property) {
                if (property === "directory") {
                    value += "/"
                }
                return !!(value + "").match(new RegExp(escapeRegEx(target), "i"))
            },
            "equals:": function(uri, target) {
                return uri.equals(target)
            },
            "is:": function(uri, target) {
                return uri.is(target)
            }
        };

        function escapeRegEx(string) {
            return string.replace(/([.*+?^=!:${}()|[\]\/\\])/g, "\\$1")
        }

        function getUriProperty(elem) {
            var nodeName = elem.nodeName.toLowerCase();
            var property = URI.domAttributes[nodeName];
            if (nodeName === "input" && elem.type !== "image") {
                return undefined
            }
            return property
        }

        function generateAccessor(property) {
            return {
                get: function(elem) {
                    return $(elem).uri()[property]()
                },
                set: function(elem, value) {
                    $(elem).uri()[property](value);
                    return value
                }
            }
        }
        $.each("authority directory domain filename fragment hash host hostname href password path pathname port protocol query resource scheme search subdomain suffix tld username".split(" "), function(k, v) {
            comparable[v] = true;
            $.attrHooks["uri:" + v] = generateAccessor(v)
        });
        var _attrHooks = {
            get: function(elem) {
                return $(elem).uri()
            },
            set: function(elem, value) {
                return $(elem).uri().href(value).toString()
            }
        };
        $.each(["src", "href", "action", "uri", "cite"], function(k, v) {
            $.attrHooks[v] = {
                set: _attrHooks.set
            }
        });
        $.attrHooks.uri.get = _attrHooks.get;
        $.fn.uri = function(uri) {
            var $this = this.first();
            var elem = $this.get(0);
            var property = getUriProperty(elem);
            if (!property) {
                throw new Error('Element "' + elem.nodeName + '" does not have either property: href, src, action, cite')
            }
            if (uri !== undefined) {
                var old = $this.data("uri");
                if (old) {
                    return old.href(uri)
                }
                if (!(uri instanceof URI)) {
                    uri = URI(uri || "")
                }
            } else {
                uri = $this.data("uri");
                if (uri) {
                    return uri
                } else {
                    uri = URI($this.attr(property) || "")
                }
            }
            uri._dom_element = elem;
            uri._dom_attribute = property;
            uri.normalize();
            $this.data("uri", uri);
            return uri
        };
        URI.prototype.build = function(deferBuild) {
            if (this._dom_element) {
                this._string = URI.build(this._parts);
                this._deferred_build = false;
                this._dom_element.setAttribute(this._dom_attribute, this._string);
                this._dom_element[this._dom_attribute] = this._string
            } else if (deferBuild === true) {
                this._deferred_build = true
            } else if (deferBuild === undefined || this._deferred_build) {
                this._string = URI.build(this._parts);
                this._deferred_build = false
            }
            return this
        };
        var uriSizzle;
        var pseudoArgs = /^([a-zA-Z]+)\s*([\^\$*]?=|:)\s*(['"]?)(.+)\3|^\s*([a-zA-Z0-9]+)\s*$/;

        function uriPseudo(elem, text) {
            var match, property, uri;
            if (!getUriProperty(elem) || !text) {
                return false
            }
            match = text.match(pseudoArgs);
            if (!match || !match[5] && match[2] !== ":" && !compare[match[2]]) {
                return false
            }
            uri = $(elem).uri();
            if (match[5]) {
                return uri.is(match[5])
            } else if (match[2] === ":") {
                property = match[1].toLowerCase() + ":";
                if (!compare[property]) {
                    return false
                }
                return compare[property](uri, match[4])
            } else {
                property = match[1].toLowerCase();
                if (!comparable[property]) {
                    return false
                }
                return compare[match[2]](uri[property](), match[4], property)
            }
            return false
        }
        if ($.expr.createPseudo) {
            uriSizzle = $.expr.createPseudo(function(text) {
                return function(elem) {
                    return uriPseudo(elem, text)
                }
            })
        } else {
            uriSizzle = function(elem, i, match) {
                return uriPseudo(elem, match[3])
            }
        }
        $.expr[":"].uri = uriSizzle;
        return $
    });
    var uri = window.URI;
    delete window.jQuery;
    delete window.URI;
    return uri
});
define("jquery.serialize-object", ["jquery"], function(jQuery) {
    var define = null;
    window.jQuery = jQuery;
    (function(root, factory) {
        if (typeof define === "function" && define.amd) {
            define(["exports", "jquery"], function(exports, $) {
                return factory(exports, $)
            })
        } else if (typeof exports !== "undefined") {
            var $ = require("jquery");
            factory(exports, $)
        } else {
            factory(root, root.jQuery || root.Zepto || root.ender || root.$)
        }
    })(this, function(exports, $) {
        var patterns = {
            validate: /^[a-z_][a-z0-9_]*(?:\[(?:\d*|[a-z0-9_]+)\])*$/i,
            key: /[a-z0-9_]+|(?=\[\])/gi,
            push: /^$/,
            fixed: /^\d+$/,
            named: /^[a-z0-9_]+$/i
        };

        function FormSerializer(helper, $form) {
            var data = {},
                pushes = {};

            function build(base, key, value) {
                base[key] = value;
                return base
            }

            function makeObject(root, value) {
                var keys = root.match(patterns.key),
                    k;
                while ((k = keys.pop()) !== undefined) {
                    if (patterns.push.test(k)) {
                        var idx = incrementPush(root.replace(/\[\]$/, ""));
                        value = build([], idx, value)
                    } else if (patterns.fixed.test(k)) {
                        value = build([], k, value)
                    } else if (patterns.named.test(k)) {
                        value = build({}, k, value)
                    }
                }
                return value
            }

            function incrementPush(key) {
                if (pushes[key] === undefined) {
                    pushes[key] = 0
                }
                return pushes[key]++
            }

            function encode(pair) {
                switch ($('[name="' + pair.name + '"]', $form).attr("type")) {
                    case "checkbox":
                        return pair.value === "on" ? true : pair.value;
                    default:
                        return pair.value
                }
            }

            function addPair(pair) {
                if (!patterns.validate.test(pair.name)) return this;
                var obj = makeObject(pair.name, encode(pair));
                data = helper.extend(true, data, obj);
                return this
            }

            function addPairs(pairs) {
                if (!helper.isArray(pairs)) {
                    throw new Error("formSerializer.addPairs expects an Array")
                }
                for (var i = 0, len = pairs.length; i < len; i++) {
                    this.addPair(pairs[i])
                }
                return this
            }

            function serialize() {
                return data
            }

            function serializeJSON() {
                return JSON.stringify(serialize())
            }
            this.addPair = addPair;
            this.addPairs = addPairs;
            this.serialize = serialize;
            this.serializeJSON = serializeJSON
        }
        FormSerializer.patterns = patterns;
        FormSerializer.serializeObject = function serializeObject() {
            if (this.length > 1) {
                return new Error("jquery-serialize-object can only serialize one form at a time")
            }
            return new FormSerializer($, this).addPairs(this.serializeArray()).serialize()
        };
        FormSerializer.serializeJSON = function serializeJSON() {
            if (this.length > 1) {
                return new Error("jquery-serialize-object can only serialize one form at a time")
            }
            return new FormSerializer($, this).addPairs(this.serializeArray()).serializeJSON()
        };
        if (typeof $.fn !== "undefined") {
            $.fn.serializeObject = FormSerializer.serializeObject;
            $.fn.serializeJSON = FormSerializer.serializeJSON
        }
        exports.FormSerializer = FormSerializer;
        return FormSerializer
    });
    delete window.jQuery;
    return jQuery
});
define("jquery.loadmask", ["jquery"], function(jQuery) {
    (function($) {
        $.fn.mask = function(label, delay) {
            $(this).each(function() {
                if (delay !== undefined && delay > 0) {
                    var element = $(this);
                    element.data("_mask_timeout", setTimeout(function() {
                        $.maskElement(element, label)
                    }, delay))
                } else {
                    $.maskElement($(this), label)
                }
            })
        };
        $.fn.unmask = function() {
            $(this).each(function() {
                $.unmaskElement($(this))
            })
        };
        $.fn.isMasked = function() {
            return this.hasClass("masked")
        };
        $.maskElement = function(element, label) {
            if (element.data("_mask_timeout") !== undefined) {
                clearTimeout(element.data("_mask_timeout"));
                element.removeData("_mask_timeout")
            }
            if (element.isMasked()) {
                $.unmaskElement(element)
            }
            if (element.css("position") == "static") {
                element.addClass("masked-relative")
            }
            element.addClass("masked");
            var maskDiv = $('<div class="loadmask"></div>');
            if (navigator.userAgent.toLowerCase().indexOf("msie") > -1) {
                maskDiv.height(element.height() + parseInt(element.css("padding-top")) + parseInt(element.css("padding-bottom")));
                maskDiv.width(element.width() + parseInt(element.css("padding-left")) + parseInt(element.css("padding-right")))
            }
            if (navigator.userAgent.toLowerCase().indexOf("msie 6") > -1) {
                element.find("select").addClass("masked-hidden")
            }
            element.append(maskDiv);
            if (label !== undefined) {
                var maskMsgDiv = $('<div class="loadmask-msg" style="display:none;"></div>');
                maskMsgDiv.append("<div>" + label + "</div>");
                element.append(maskMsgDiv);
                maskMsgDiv.css("top", Math.round(element.height() / 2 - (maskMsgDiv.height() - parseInt(maskMsgDiv.css("padding-top")) - parseInt(maskMsgDiv.css("padding-bottom"))) / 2) + "px");
                maskMsgDiv.css("left", Math.round(element.width() / 2 - (maskMsgDiv.width() - parseInt(maskMsgDiv.css("padding-left")) - parseInt(maskMsgDiv.css("padding-right"))) / 2) + "px");
                maskMsgDiv.show()
            } else {
                element.find(".masked").each(function(i, o) {
                    $.unmaskElement($(o))
                });
                if (!element.parents(".masked").length) {
                    var oLoadingDiv = $('<div class="ak-loading" style="display:none;"></div>');
                    var iWinHeight = $(window).height();
                    var iElHeight = $(element).outerHeight();
                    var iElTop = $(element).offset().top;
                    var iScrollTop = $(document).scrollTop();
                    var iVisibleHeight = iElHeight;
                    if (iScrollTop > iElTop) iVisibleHeight -= iScrollTop - iElTop;
                    if (iElTop + iElHeight > iScrollTop + iWinHeight) iVisibleHeight -= iElTop + iElHeight - iScrollTop - iWinHeight;
                    iVisibleHeight = Math.min(iWinHeight, iVisibleHeight);
                    var iTop = (iScrollTop > iElTop ? iScrollTop - iElTop : 0) + iVisibleHeight / 2;
                    if (iVisibleHeight > 0) oLoadingDiv.css("top", iTop + "px");
                    oLoadingDiv.append('<div class="spinner"><div class="mask"><div class="circle"></div></div></div>');
                    element.append(oLoadingDiv);
                    oLoadingDiv.show()
                }
            }
        };
        $.unmaskElement = function(element) {
            if (element.data("_mask_timeout") !== undefined) {
                clearTimeout(element.data("_mask_timeout"));
                element.removeData("_mask_timeout")
            }
            $(".ak-loading").css("display", "none");
            element.find(".loadmask-msg,.loadmask").remove();
            element.removeClass("masked");
            element.removeClass("masked-relative");
            element.find("select").removeClass("masked-hidden")
        }
    })(jQuery);
    return jQuery
});
define("jquery.steps", ["jquery"], function(jQuery) {
    (function($, undefined) {
        "use strict";
        var _uniqueId = 0;
        var _cookiePrefix = "jQu3ry_5teps_St@te_";
        var _tabSuffix = "-t-";
        var _tabpanelSuffix = "-p-";
        var _titleSuffix = "-h-";
        $.fn.steps = function(method) {
            if ($.fn.steps[method]) {
                return $.fn.steps[method].apply(this, Array.prototype.slice.call(arguments, 1))
            } else if (typeof method === "object" || !method) {
                return initialize.apply(this, arguments)
            } else {
                $.error("Method " + method + " does not exist on jQuery.steps")
            }
        };
        $.fn.steps.contentMode = {
            html: 0,
            iframe: 1,
            async: 2
        };
        $.fn.steps.transitionEffect = {
            none: 0,
            fade: 1,
            slide: 2,
            slideLeft: 3
        };
        $.fn.steps.defaults = {
            headerTag: "h1",
            bodyTag: "div",
            contentContainerTag: "div",
            actionContainerTag: "div",
            stepsContainerTag: "div",
            cssClass: "wizard",
            titleTemplate: '<span class="number">#index#.</span> #title#',
            loadingTemplate: '<span class="spinner"></span> #text#',
            autoFocus: false,
            enableAllSteps: false,
            enableKeyNavigation: true,
            enablePagination: true,
            suppressPaginationOnFocus: true,
            enableContentCache: true,
            enableFinishButton: true,
            preloadContent: false,
            showFinishButtonAlways: false,
            forceMoveForward: false,
            saveState: false,
            startIndex: 0,
            transitionEffect: $.fn.steps.transitionEffect.none,
            transitionEffectSpeed: 200,
            onStepChanging: function(event, currentIndex, newIndex) {
                return true
            },
            onStepChanged: function(event, currentIndex, priorIndex) {},
            onFinishing: function(event, currentIndex) {
                return true
            },
            onFinished: function(event, currentIndex) {},
            labels: {
                current: "current step:",
                pagination: "Pagination",
                finish: "Finish",
                next: "Next",
                previous: "Previous",
                loading: "Loading ..."
            }
        };
        $.fn.steps.getCurrentIndex = function() {
            return $(this).data("state").currentIndex
        };
        $.fn.steps.getCurrentStep = function() {
            return $(this).data("state").currentStep
        };
        $.fn.steps.getStep = function(index) {
            var wizard = $(this),
                state = wizard.data("state");
            return index === state.currentStep ? state.currentStep : getStepProperties(wizard, index)
        };
        $.fn.steps.next = function() {
            var wizard = $(this);
            return actionClick(wizard, wizard.data("state").currentIndex + 1)
        };
        $.fn.steps.previous = function() {
            var wizard = $(this);
            return actionClick(wizard, wizard.data("state").currentIndex - 1)
        };
        $.fn.steps.skip = function(count) {
            throw new Error("Not yet implemented!")
        };
        $.fn.steps.finish = function() {
            var wizard = $(this),
                options = wizard.data("options"),
                state = wizard.data("state"),
                currentStep = wizard.find(".steps li").eq(state.currentIndex);
            if (wizard.triggerHandler("finishing", [state.currentIndex])) {
                currentStep.addClass("done").removeClass("error");
                wizard.triggerHandler("finished", [state.currentIndex])
            } else {
                currentStep.addClass("error")
            }
        };
        $.fn.steps.remove = function(index) {
            var wizard = $(this),
                uniqueId = getUniqueId(wizard),
                options = wizard.data("options"),
                state = wizard.data("state");
            if (index < 0 || index > state.stepCount || state.currentIndex === index) {
                return false
            }
            wizard.find("#" + uniqueId + _titleSuffix + index).remove();
            wizard.find("#" + uniqueId + _tabpanelSuffix + index).remove();
            wizard.find("#" + uniqueId + _tabSuffix + index).parent().remove();
            if (state.currentIndex > index) {
                state.currentIndex--;
                saveStateToCookie(wizard, state.currentIndex)
            }
            state.stepCount--;
            state.currentStep = getStepProperties(wizard, state.currentIndex);
            if (index === 0) {
                wizard.find(".steps li").first().addClass("first")
            }
            if (index === state.stepCount) {
                wizard.find(".steps li").eq(index).addClass("last")
            }
            updateSteps(wizard, index);
            refreshActionState(wizard);
            return true
        };
        $.fn.steps.add = function(step) {
            var wizard = $(this);
            wizard.steps("insert", wizard.data("state").stepCount, step);
            return wizard
        };
        $.fn.steps.insert = function(index, step) {
            var wizard = $(this),
                uniqueId = getUniqueId(wizard),
                options = wizard.data("options"),
                state = wizard.data("state");
            if (index < 0 || index > state.stepCount) {
                throw new Error("Index out of range.")
            }
            var contentContainer = wizard.find(".content"),
                header = $(document.createElement(options.headerTag)).html(step.title),
                body = $(document.createElement(options.bodyTag));
            if (step.contentMode == null || step.contentMode === $.fn.steps.contentMode.html) {
                body.html(step.content)
            }
            if (index === 0) {
                contentContainer.prepend(body).prepend(header)
            } else {
                contentContainer.find("#" + uniqueId + _tabpanelSuffix + (index - 1)).after(body).after(header)
            }
            if (state.currentIndex >= index) {
                state.currentIndex++;
                saveStateToCookie(wizard, state.currentIndex)
            }
            state.stepCount++;
            transformBody(wizard, body, index);
            transformTitle(wizard, header, index);
            var currentStepAnchor = wizard.find("#" + uniqueId + _tabSuffix + index);
            var currentStep = currentStepAnchor.parent();
            if (state.currentIndex > index) {
                currentStep.removeClass("disabled").attr("aria-disabled", "false").addClass("done")
            }
            state.currentStep = getStepProperties(wizard, state.currentIndex);
            currentStepAnchor.bind("click.steps", stepClickHandler);
            updateSteps(wizard, index);
            refreshActionState(wizard);
            return wizard
        };

        function initialize(options) {
            var opts = $.extend(true, {}, $.fn.steps.defaults, options);
            return this.each(function(i) {
                var wizard = $(this);
                wizard.data("options", opts);
                wizard.data("state", {
                    currentIndex: opts.startIndex,
                    currentStep: null,
                    stepCount: 0,
                    transitionShowElement: null
                });
                createUniqueId(wizard);
                transform(wizard);
                if (opts.autoFocus && _uniqueId === 1) {
                    wizard.find("#" + getUniqueId(wizard) + _tabSuffix + opts.startIndex).focus()
                }
                wizard.bind("finishing.steps", opts.onFinishing);
                wizard.bind("finished.steps", opts.onFinished);
                wizard.bind("stepChanging.steps", opts.onStepChanging);
                wizard.bind("stepChanged.steps", opts.onStepChanged);
                if (opts.enableKeyNavigation) {
                    wizard.keyup(keyUpHandler)
                }
                wizard.find(".steps a").bind("click.steps", stepClickHandler);
                wizard.find(".actions a").bind("click.steps", actionClickHandler)
            })
        }

        function actionClick(wizard, index) {
            var options = wizard.data("options"),
                state = wizard.data("state"),
                oldIndex = state.currentIndex;
            if (index >= 0 && index < state.stepCount && !(options.forceMoveForward && index < state.currentIndex)) {
                var anchor = wizard.find("#" + getUniqueId(wizard) + _tabSuffix + index),
                    parent = anchor.parent(),
                    isDisabled = parent.hasClass("disabled");
                parent.removeClass("disabled").attr("aria-disabled", "false");
                anchor.click();
                if (oldIndex === state.currentIndex && isDisabled) {
                    parent.addClass("disabled").attr("aria-disabled", "true");
                    return false
                }
                return true
            }
            return false
        }

        function goToStep(wizard, index) {
            var options = wizard.data("options"),
                state = wizard.data("state");
            if (index < 0 || index >= state.stepCount || state.stepCount === 0) {
                throw new Error("Index out of range.")
            }
            if (options.forceMoveForward && index < state.currentIndex) {
                return
            }
            var oldIndex = state.currentIndex;
            if (wizard.triggerHandler("stepChanging", [state.currentIndex, index])) {
                state.currentIndex = index;
                saveStateToCookie(wizard, index);
                state.currentStep = getStepProperties(wizard, index);
                updateStepClasses(wizard, index, oldIndex);
                refreshActionState(wizard);
                loadAsyncContent(wizard);
                var stepContents = wizard.find(".content > .body");
                switch (getValidEnumValue($.fn.steps.transitionEffect, options.transitionEffect)) {
                    case $.fn.steps.transitionEffect.fade:
                        state.transitionShowElement = stepContents.eq(index);
                        stepContents.eq(oldIndex).fadeOut(options.transitionEffectSpeed, function() {
                            var wizard = $(this).attr("aria-hidden", "true").parents(":has(.steps)");
                            var state = wizard.data("state");
                            if (state.transitionShowElement) {
                                state.transitionShowElement.fadeIn(options.transitionEffectSpeed, function() {
                                    $(this).attr("aria-hidden", "false")
                                });
                                state.transitionShowElement = null
                            }
                        }).promise();
                        break;
                    case $.fn.steps.transitionEffect.slide:
                        state.transitionShowElement = stepContents.eq(index);
                        stepContents.eq(oldIndex).slideUp(options.transitionEffectSpeed, function() {
                            var wizard = $(this).attr("aria-hidden", "true").parents(":has(.steps)");
                            var state = wizard.data("state");
                            if (state.transitionShowElement) {
                                state.transitionShowElement.slideDown(options.transitionEffectSpeed, function() {
                                    $(this).attr("aria-hidden", "false")
                                });
                                state.transitionShowElement = null
                            }
                        }).promise();
                        break;
                    case $.fn.steps.transitionEffect.slideLeft:
                        var newStep = stepContents.eq(index),
                            currentStep = stepContents.eq(oldIndex),
                            outerWidth = currentStep.outerWidth(true),
                            posFadeOut = index > oldIndex ? -outerWidth : outerWidth,
                            posFadeIn = index > oldIndex ? outerWidth : -outerWidth;
                        currentStep.animate({
                            left: posFadeOut
                        }, options.transitionEffectSpeed, function() {
                            $(this).hide().attr("aria-hidden", "true")
                        }).promise();
                        newStep.css("left", posFadeIn + "px").show().attr("aria-hidden", "false");
                        newStep.animate({
                            left: 0
                        }, options.transitionEffectSpeed).promise();
                        break;
                    default:
                        stepContents.eq(oldIndex).hide().attr("aria-hidden", "true");
                        stepContents.eq(index).show().attr("aria-hidden", "false");
                        break
                }
                wizard.triggerHandler("stepChanged", [index, oldIndex])
            } else {
                wizard.find(".steps li").eq(oldIndex).addClass("error")
            }
            return true
        }

        function transform(wizard) {
            var options = wizard.data("options"),
                state = wizard.data("state"),
                uniqueId = getUniqueId(wizard),
                contentWrapper = $(document.createElement(options.contentContainerTag)).addClass("content"),
                startIndex = options.startIndex;
            contentWrapper.html(wizard.html());
            wizard.attr("role", "application").addClass(options.cssClass).empty().append(contentWrapper);
            var stepTitles = contentWrapper.children(options.headerTag),
                stepContents = contentWrapper.children(options.bodyTag);
            if (stepTitles.length > stepContents.length) {
                throw new Error("One or more corresponding step contents are missing.")
            } else if (stepTitles.length < stepContents.length) {
                throw new Error("One or more corresponding step titles are missing.")
            }
            state.stepCount = stepContents.length;
            if (options.saveState && $.cookie) {
                var savedState = $.cookie(_cookiePrefix + uniqueId);
                var savedIndex = parseInt(savedState, 0);
                if (!isNaN(savedIndex) && savedIndex < state.stepCount) {
                    startIndex = savedIndex
                }
            }
            stepContents.each(function(index) {
                transformBody(wizard, $(this), index)
            });
            stepContents.eq(startIndex).show().attr("aria-hidden", "false");
            var stepsWrapper = $(document.createElement(options.stepsContainerTag)).addClass("steps").append($('<ul role="tablist"></ul>'));
            wizard.prepend(stepsWrapper);
            stepTitles.each(function(index) {
                transformTitle(wizard, $(this), index);
                if (index < startIndex) {
                    wizard.find(".steps li").eq(index).removeClass("disabled").attr("aria-disabled", "false").addClass("done")
                }
            });
            updateStepClasses(wizard, startIndex);
            state.currentIndex = startIndex;
            state.currentStep = getStepProperties(wizard, state.currentIndex);
            if (options.enablePagination) {
                var actionCollection = $('<ul role="menu" aria-label="' + options.labels.pagination + '"></ul>'),
                    actionWrapper = $(document.createElement(options.actionContainerTag)).addClass("actions").append(actionCollection);
                wizard.append(actionWrapper);
                if (!options.forceMoveForward) {
                    actionCollection.append($('<li><a href="#previous" role="menuitem">' + options.labels.previous + "</a></li>"))
                }
                actionCollection.append($('<li><a href="#next" role="menuitem">' + options.labels.next + "</a></li>"));
                if (options.enableFinishButton) {
                    actionCollection.append($('<li><a href="#finish" role="menuitem">' + options.labels.finish + "</a></li>"))
                }
                refreshActionState(wizard);
                loadAsyncContent(wizard)
            }
        }

        function transformBody(wizard, body, index) {
            var uniqueId = getUniqueId(wizard),
                uniqueBodyId = uniqueId + _tabpanelSuffix + index,
                uniqueHeaderId = uniqueId + _titleSuffix + index;
            body.attr("id", uniqueBodyId).attr("role", "tabpanel").attr("aria-labelledby", uniqueHeaderId).addClass("body").hide().attr("aria-hidden", "true")
        }

        function transformTitle(wizard, header, index) {
            var uniqueId = getUniqueId(wizard),
                uniqueStepId = uniqueId + _tabSuffix + index,
                uniqueBodyId = uniqueId + _tabpanelSuffix + index,
                uniqueHeaderId = uniqueId + _titleSuffix + index,
                options = wizard.data("options"),
                state = wizard.data("state"),
                stepCollection = wizard.find(".steps > ul"),
                title = renderTemplate(options.titleTemplate, {
                    index: index + 1,
                    title: header.html()
                }),
                stepItem = $('<li role="tab"><a id="' + uniqueStepId + '" href="#' + uniqueHeaderId + '" aria-controls="' + uniqueBodyId + '">' + title + "</a></li>");
            if (!options.enableAllSteps) {
                stepItem.addClass("disabled").attr("aria-disabled", "true")
            }
            header.attr("id", uniqueHeaderId).attr("tabindex", "-1").addClass("title");
            if (index === 0) {
                stepCollection.prepend(stepItem)
            } else {
                stepCollection.find("li").eq(index - 1).after(stepItem)
            }
            if (index === 0) {
                stepCollection.find("li").removeClass("first").eq(index).addClass("first")
            }
            if (index === state.stepCount - 1) {
                stepCollection.find("li").removeClass("last").eq(index).addClass("last")
            }
        }

        function loadAsyncContent(wizard) {
            var options = wizard.data("options"),
                state = wizard.data("state");
            if (!options.enableContentCache || !state.currentStep.contentLoaded) {
                switch (getValidEnumValue($.fn.steps.contentMode, state.currentStep.contentMode)) {
                    case $.fn.steps.contentMode.iframe:
                        wizard.find(".content > .body").eq(state.currentIndex).empty().html($('<iframe src="' + state.currentStep.contentUrl + '" />')).data("loaded", "1");
                        break;
                    case $.fn.steps.contentMode.async:
                        var currentStepContent = wizard.find("#" + getUniqueId(wizard) + _tabpanelSuffix + state.currentIndex).attr("aria-busy", "true").empty().append(renderTemplate(options.loadingTemplate, {
                            text: options.labels.loading
                        }));
                        $.ajax({
                            url: state.currentStep.contentUrl,
                            cache: false
                        }).done(function(data) {
                            currentStepContent.empty().html(data).attr("aria-busy", "false").data("loaded", "1")
                        });
                        break
                }
            }
        }

        function updateSteps(wizard, index) {
            var options = wizard.data("options"),
                state = wizard.data("state"),
                uniqueId = getUniqueId(wizard);
            for (var i = index; i < state.stepCount; i++) {
                var uniqueStepId = uniqueId + _tabSuffix + i,
                    uniqueBodyId = uniqueId + _tabpanelSuffix + i,
                    uniqueHeaderId = uniqueId + _titleSuffix + i,
                    title = wizard.find(".title").eq(i).attr("id", uniqueHeaderId);
                wizard.find(".steps a").eq(i).attr("id", uniqueStepId).attr("aria-controls", uniqueBodyId).attr("href", "#" + uniqueHeaderId).html(renderTemplate(options.titleTemplate, {
                    index: i + 1,
                    title: title.html()
                }));
                wizard.find(".body").eq(i).attr("id", uniqueBodyId).attr("aria-labelledby", uniqueHeaderId)
            }
        }

        function updateStepClasses(wizard, index, oldIndex) {
            var uniqueId = getUniqueId(wizard),
                options = wizard.data("options"),
                currentOrNewStepAnchor = wizard.find("#" + uniqueId + _tabSuffix + index),
                currentInfo = $('<span class="current-info audible">' + options.labels.current + " </span>"),
                stepTitles = wizard.find(".content > .title");
            if (oldIndex != null) {
                var oldStepAnchor = wizard.find("#" + uniqueId + _tabSuffix + oldIndex);
                oldStepAnchor.parent().addClass("done").removeClass("current error").attr("aria-selected", "false");
                stepTitles.eq(oldIndex).removeClass("current").next(".body").removeClass("current");
                currentInfo = oldStepAnchor.find(".current-info");
                currentOrNewStepAnchor.focus()
            }
            currentOrNewStepAnchor.prepend(currentInfo).parent().addClass("current").attr("aria-selected", "true").removeClass("disabled done").attr("aria-disabled", "false");
            stepTitles.eq(index).addClass("current").next(".body").addClass("current")
        }

        function refreshActionState(wizard) {
            var options = wizard.data("options"),
                state = wizard.data("state");
            if (options.enablePagination) {
                var finish = wizard.find(".actions a[href$='#finish']").parent(),
                    next = wizard.find(".actions a[href$='#next']").parent();
                if (!options.forceMoveForward) {
                    var previous = wizard.find(".actions a[href$='#previous']").parent();
                    if (state.currentIndex > 0) {
                        previous.removeClass("disabled").attr("aria-disabled", "false")
                    } else {
                        previous.addClass("disabled").attr("aria-disabled", "true")
                    }
                }
                if (options.enableFinishButton && options.showFinishButtonAlways) {
                    if (state.stepCount === 0) {
                        finish.addClass("disabled").attr("aria-disabled", "true");
                        next.addClass("disabled").attr("aria-disabled", "true")
                    } else if (state.stepCount > 1 && state.stepCount > state.currentIndex + 1) {
                        finish.removeClass("disabled").attr("aria-disabled", "false");
                        next.removeClass("disabled").attr("aria-disabled", "false")
                    } else {
                        finish.removeClass("disabled").attr("aria-disabled", "false");
                        next.addClass("disabled").attr("aria-disabled", "true")
                    }
                } else {
                    if (state.stepCount === 0) {
                        finish.hide().attr("aria-hidden", "true");
                        next.show().attr("aria-hidden", "false").addClass("disabled").attr("aria-disabled", "true")
                    } else if (state.stepCount > state.currentIndex + 1) {
                        finish.hide().attr("aria-hidden", "true");
                        next.show().attr("aria-hidden", "false").removeClass("disabled").attr("aria-disabled", "false")
                    } else if (!options.enableFinishButton) {
                        next.addClass("disabled").attr("aria-disabled", "true")
                    } else {
                        finish.show().attr("aria-hidden", "false");
                        next.hide().attr("aria-hidden", "true")
                    }
                }
            }
        }

        function renderTemplate(template, substitutes) {
            var matches = template.match(/#([a-z]*)#/gi);
            for (var i = 0; i < matches.length; i++) {
                var match = matches[i],
                    key = match.substring(1, match.length - 1);
                template = template.replace(match, getSubstitute(substitutes, key))
            }
            return template
        }

        function getSubstitute(substitutes, key) {
            if (substitutes[key] === undefined) {
                throw new Error('The key "' + key + '" does not exist in the substitute collection!')
            }
            return substitutes[key]
        }

        function getStepProperties(wizard, index) {
            var options = wizard.data("options"),
                header = wizard.find("#" + getUniqueId(wizard) + _titleSuffix + index),
                content = header.next(".body"),
                mode = content.data("mode") == null ? $.fn.steps.contentMode.html : getValidEnumValue($.fn.steps.contentMode, /^\s*$/.test(content.data("mode")) || isNaN(content.data("mode")) ? content.data("mode") : parseInt(content.data("mode"), 0)),
                contentUrl = mode === $.fn.steps.contentMode.html || content.data("url") === undefined ? "" : content.data("url"),
                contentLoaded = mode !== $.fn.steps.contentMode.html && content.data("loaded") === "1";
            return {
                title: header.html(),
                content: mode === $.fn.steps.contentMode.html ? content.html() : "",
                contentUrl: contentUrl,
                contentMode: mode,
                contentLoaded: contentLoaded
            }
        }

        function getValidEnumValue(enumType, keyOrValue) {
            validateArgument("enumType", enumType);
            validateArgument("keyOrValue", keyOrValue);
            if (typeof keyOrValue === "string") {
                var value = enumType[keyOrValue];
                if (value === undefined) {
                    throw new Error('The enum key "' + keyOrValue + '" does not exist.')
                }
                return value
            } else if (typeof keyOrValue === "number") {
                for (var key in enumType) {
                    if (enumType[key] === keyOrValue) {
                        return keyOrValue
                    }
                }
                throw new Error('Invalid enum value "' + keyOrValue + '".')
            } else {
                throw new Error("Invalid key or value type.")
            }
        }

        function validateArgument(argumentName, argumentValue) {
            if (argumentValue == null) {
                throw new Error('The argument "' + argumentName + '" is null or undefined.')
            }
        }

        function createUniqueId(wizard) {
            if (wizard.data("uid") == null) {
                wizard.data("uid", "steps-uid-".concat(++_uniqueId))
            }
        }

        function getUniqueId(wizard) {
            return wizard.data("uid")
        }

        function getStepPosition(anchor) {
            return parseInt(anchor.attr("href").substring(anchor.attr("href").lastIndexOf("-") + 1), 0)
        }

        function saveStateToCookie(wizard, index) {
            var options = wizard.data("options");
            if (options.saveState && $.cookie) {
                $.cookie(_cookiePrefix + getUniqueId(wizard), index)
            }
        }

        function keyUpHandler(event) {
            var wizard = $(this);
            if (wizard.data("options").suppressPaginationOnFocus && wizard.find(":focus").is(":input")) {
                event.preventDefault();
                return false
            }
            var keyCodes = {
                left: 37,
                right: 39
            };
            if (event.keyCode === keyCodes.left) {
                event.preventDefault();
                wizard.steps("previous")
            } else if (event.keyCode === keyCodes.right) {
                event.preventDefault();
                wizard.steps("next")
            }
        }

        function actionClickHandler(event) {
            event.preventDefault();
            var anchor = $(this),
                wizard = anchor.parents(":has(.steps)"),
                href = anchor.attr("href");
            switch (href.substring(href.lastIndexOf("#"))) {
                case "#finish":
                    wizard.steps("finish");
                    break;
                case "#next":
                    wizard.steps("next");
                    break;
                case "#previous":
                    wizard.steps("previous");
                    break
            }
        }

        function stepClickHandler(event) {
            event.preventDefault();
            var anchor = $(this),
                wizard = anchor.parents(":has(.steps)"),
                state = wizard.data("state"),
                oldIndex = state.currentIndex;
            if (anchor.parent().is(":not(.disabled):not(.current)")) {
                goToStep(wizard, getStepPosition(anchor))
            }
            if (oldIndex === state.currentIndex) {
                wizard.find("#" + getUniqueId(wizard) + _tabSuffix + oldIndex).focus();
                return false
            }
        }
    })(jQuery);
    return jQuery
});
define("jquery.validate", ["jquery"], function(jQuery) {
    var define = null;
    (function(factory) {
        if (typeof define === "function" && define.amd) {
            define(["jquery"], factory)
        } else {
            factory(jQuery)
        }
    })(function($) {
        $.extend($.fn, {
            validate: function(options) {
                if (!this.length) {
                    if (options && options.debug && window.console) {
                        console.warn("Nothing selected, can't validate, returning nothing.")
                    }
                    return
                }
                var validator = $.data(this[0], "validator");
                if (validator) {
                    return validator
                }
                this.attr("novalidate", "novalidate");
                validator = new $.validator(options, this[0]);
                $.data(this[0], "validator", validator);
                if (validator.settings.onsubmit) {
                    this.validateDelegate(":submit", "click", function(event) {
                        if (validator.settings.submitHandler) {
                            validator.submitButton = event.target
                        }
                        if ($(event.target).hasClass("cancel")) {
                            validator.cancelSubmit = true
                        }
                        if ($(event.target).attr("formnovalidate") !== undefined) {
                            validator.cancelSubmit = true
                        }
                    });
                    this.submit(function(event) {
                        if (validator.settings.debug) {
                            event.preventDefault()
                        }

                        function handle() {
                            var hidden;
                            if (validator.settings.submitHandler) {
                                if (validator.submitButton) {
                                    hidden = $("<input type='hidden'/>").attr("name", validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm)
                                }
                                validator.settings.submitHandler.call(validator, validator.currentForm, event);
                                if (validator.submitButton) {
                                    hidden.remove()
                                }
                                return false
                            }
                            return true
                        }
                        if (validator.cancelSubmit) {
                            validator.cancelSubmit = false;
                            return handle()
                        }
                        if (validator.form()) {
                            if (validator.pendingRequest) {
                                validator.formSubmitted = true;
                                return false
                            }
                            return handle()
                        } else if (validator.pendingRequest) {
                            validator.formSubmitted = true;
                            return false
                        } else {
                            validator.focusInvalid();
                            return false
                        }
                    })
                }
                return validator
            },
            valid: function() {
                var valid, validator;
                if ($(this[0]).is("form")) {
                    valid = this.validate().form()
                } else {
                    valid = true;
                    validator = $(this[0].form).validate();
                    this.each(function() {
                        valid = validator.element(this) && valid
                    })
                }
                return valid
            },
            removeAttrs: function(attributes) {
                var result = {},
                    $element = this;
                $.each(attributes.split(/\s/), function(index, value) {
                    result[value] = $element.attr(value);
                    $element.removeAttr(value)
                });
                return result
            },
            rules: function(command, argument) {
                var element = this[0],
                    settings, staticRules, existingRules, data, param, filtered;
                if (command) {
                    settings = $.data(element.form, "validator").settings;
                    staticRules = settings.rules;
                    existingRules = $.validator.staticRules(element);
                    switch (command) {
                        case "add":
                            $.extend(existingRules, $.validator.normalizeRule(argument));
                            delete existingRules.messages;
                            staticRules[element.name] = existingRules;
                            if (argument.messages) {
                                settings.messages[element.name] = $.extend(settings.messages[element.name], argument.messages)
                            }
                            break;
                        case "remove":
                            if (!argument) {
                                delete staticRules[element.name];
                                return existingRules
                            }
                            filtered = {};
                            $.each(argument.split(/\s/), function(index, method) {
                                filtered[method] = existingRules[method];
                                delete existingRules[method];
                                if (method === "required") {
                                    $(element).removeAttr("aria-required")
                                }
                            });
                            return filtered
                    }
                }
                data = $.validator.normalizeRules($.extend({}, $.validator.classRules(element), $.validator.attributeRules(element), $.validator.dataRules(element), $.validator.staticRules(element)), element);
                if (data.required) {
                    param = data.required;
                    delete data.required;
                    data = $.extend({
                        required: param
                    }, data);
                    $(element).attr("aria-required", "true")
                }
                if (data.remote) {
                    param = data.remote;
                    delete data.remote;
                    data = $.extend(data, {
                        remote: param
                    })
                }
                return data
            }
        });
        $.extend($.expr[":"], {
            blank: function(a) {
                return !$.trim("" + $(a).val())
            },
            filled: function(a) {
                return !!$.trim("" + $(a).val())
            },
            unchecked: function(a) {
                return !$(a).prop("checked")
            }
        });
        $.validator = function(options, form) {
            this.settings = $.extend(true, {}, $.validator.defaults, options);
            this.currentForm = form;
            this.init()
        };
        $.validator.format = function(source, params) {
            if (arguments.length === 1) {
                return function() {
                    var args = $.makeArray(arguments);
                    args.unshift(source);
                    return $.validator.format.apply(this, args)
                }
            }
            if (arguments.length > 2 && params.constructor !== Array) {
                params = $.makeArray(arguments).slice(1)
            }
            if (params.constructor !== Array) {
                params = [params]
            }
            $.each(params, function(i, n) {
                source = source.replace(new RegExp("\\{" + i + "\\}", "g"), function() {
                    return n
                })
            });
            return source
        };
        $.extend($.validator, {
            defaults: {
                messages: {},
                groups: {},
                rules: {},
                errorClass: "error",
                validClass: "valid",
                errorElement: "label",
                focusInvalid: true,
                errorContainer: $([]),
                errorLabelContainer: $([]),
                onsubmit: true,
                ignore: ":hidden",
                ignoreTitle: false,
                onfocusin: function(element) {
                    this.lastActive = element;
                    if (this.settings.focusCleanup && !this.blockFocusCleanup) {
                        if (this.settings.unhighlight) {
                            this.settings.unhighlight.call(this, element, this.settings.errorClass, this.settings.validClass)
                        }
                        this.hideThese(this.errorsFor(element))
                    }
                },
                onfocusout: function(element) {
                    if (!this.checkable(element) && (element.name in this.submitted || !this.optional(element))) {
                        this.element(element)
                    }
                },
                onkeyup: function(element, event) {
                    if (event.which === 9 && this.elementValue(element) === "") {
                        return
                    } else if (element.name in this.submitted || element === this.lastElement) {
                        this.element(element)
                    }
                },
                onclick: function(element) {
                    if (element.name in this.submitted) {
                        this.element(element)
                    } else if (element.parentNode.name in this.submitted) {
                        this.element(element.parentNode)
                    }
                },
                highlight: function(element, errorClass, validClass) {
                    if (element.type === "radio") {
                        this.findByName(element.name).addClass(errorClass).removeClass(validClass)
                    } else {
                        $(element).addClass(errorClass).removeClass(validClass)
                    }
                },
                unhighlight: function(element, errorClass, validClass) {
                    if (element.type === "radio") {
                        this.findByName(element.name).removeClass(errorClass).addClass(validClass)
                    } else {
                        $(element).removeClass(errorClass).addClass(validClass)
                    }
                }
            },
            setDefaults: function(settings) {
                $.extend($.validator.defaults, settings)
            },
            messages: {
                required: "This field is required.",
                remote: "Please fix this field.",
                email: "Please enter a valid email address.",
                url: "Please enter a valid URL.",
                date: "Please enter a valid date.",
                dateISO: "Please enter a valid date ( ISO ).",
                number: "Please enter a valid number.",
                digits: "Please enter only digits.",
                creditcard: "Please enter a valid credit card number.",
                equalTo: "Please enter the same value again.",
                maxlength: $.validator.format("Please enter no more than {0} characters."),
                minlength: $.validator.format("Please enter at least {0} characters."),
                rangelength: $.validator.format("Please enter a value between {0} and {1} characters long."),
                range: $.validator.format("Please enter a value between {0} and {1}."),
                max: $.validator.format("Please enter a value less than or equal to {0}."),
                min: $.validator.format("Please enter a value greater than or equal to {0}.")
            },
            autoCreateRanges: false,
            prototype: {
                init: function() {
                    this.labelContainer = $(this.settings.errorLabelContainer);
                    this.errorContext = this.labelContainer.length && this.labelContainer || $(this.currentForm);
                    this.containers = $(this.settings.errorContainer).add(this.settings.errorLabelContainer);
                    this.submitted = {};
                    this.valueCache = {};
                    this.pendingRequest = 0;
                    this.pending = {};
                    this.invalid = {};
                    this.reset();
                    var groups = this.groups = {},
                        rules;
                    $.each(this.settings.groups, function(key, value) {
                        if (typeof value === "string") {
                            value = value.split(/\s/)
                        }
                        $.each(value, function(index, name) {
                            groups[name] = key
                        })
                    });
                    rules = this.settings.rules;
                    $.each(rules, function(key, value) {
                        rules[key] = $.validator.normalizeRule(value)
                    });

                    function delegate(event) {
                        var validator = $.data(this[0].form, "validator"),
                            eventType = "on" + event.type.replace(/^validate/, ""),
                            settings = validator.settings;
                        if (settings[eventType] && !this.is(settings.ignore)) {
                            settings[eventType].call(validator, this[0], event)
                        }
                    }
                    $(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, " + "[type='number'], [type='search'] ,[type='tel'], [type='url'], " + "[type='email'], [type='datetime'], [type='date'], [type='month'], " + "[type='week'], [type='time'], [type='datetime-local'], " + "[type='range'], [type='color'], [type='radio'], [type='checkbox']", "focusin focusout keyup", delegate).validateDelegate("select, option, [type='radio'], [type='checkbox']", "click", delegate);
                    if (this.settings.invalidHandler) {
                        $(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
                    }
                    $(this.currentForm).find("[required], [data-rule-required], .required").attr("aria-required", "true");
                },
                form: function() {
                    this.checkForm();
                    $.extend(this.submitted, this.errorMap);
                    this.invalid = $.extend({}, this.errorMap);
                    if (!this.valid()) {
                        $(this.currentForm).triggerHandler("invalid-form", [this])
                    }
                    this.showErrors();
                    return this.valid()
                },
                checkForm: function() {
                    this.prepareForm();
                    for (var i = 0, elements = this.currentElements = this.elements(); elements[i]; i++) {
                        this.check(elements[i])
                    }
                    return this.valid()
                },
                element: function(element) {
                    var cleanElement = this.clean(element),
                        checkElement = this.validationTargetFor(cleanElement),
                        result = true;
                    this.lastElement = checkElement;
                    if (checkElement === undefined) {
                        delete this.invalid[cleanElement.name]
                    } else {
                        this.prepareElement(checkElement);
                        this.currentElements = $(checkElement);
                        result = this.check(checkElement) !== false;
                        if (result) {
                            delete this.invalid[checkElement.name]
                        } else {
                            this.invalid[checkElement.name] = true
                        }
                    }
                    $(element).attr("aria-invalid", !result);
                    if (!this.numberOfInvalids()) {
                        this.toHide = this.toHide.add(this.containers)
                    }
                    this.showErrors();
                    return result
                },
                showErrors: function(errors) {
                    if (errors) {
                        $.extend(this.errorMap, errors);
                        this.errorList = [];
                        for (var name in errors) {
                            this.errorList.push({
                                message: errors[name],
                                element: this.findByName(name)[0]
                            })
                        }
                        this.successList = $.grep(this.successList, function(element) {
                            return !(element.name in errors)
                        })
                    }
                    if (this.settings.showErrors) {
                        this.settings.showErrors.call(this, this.errorMap, this.errorList)
                    } else {
                        this.defaultShowErrors()
                    }
                },
                resetForm: function() {
                    if ($.fn.resetForm) {
                        $(this.currentForm).resetForm()
                    }
                    this.submitted = {};
                    this.lastElement = null;
                    this.prepareForm();
                    this.hideErrors();
                    this.elements().removeClass(this.settings.errorClass).removeData("previousValue").removeAttr("aria-invalid")
                },
                numberOfInvalids: function() {
                    return this.objectLength(this.invalid)
                },
                objectLength: function(obj) {
                    var count = 0,
                        i;
                    for (i in obj) {
                        count++
                    }
                    return count
                },
                hideErrors: function() {
                    this.hideThese(this.toHide)
                },
                hideThese: function(errors) {
                    errors.not(this.containers).text("");
                    this.addWrapper(errors).hide()
                },
                valid: function() {
                    return this.size() === 0
                },
                size: function() {
                    return this.errorList.length
                },
                focusInvalid: function() {
                    if (this.settings.focusInvalid) {
                        try {
                            $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
                        } catch (e) {}
                    }
                },
                findLastActive: function() {
                    var lastActive = this.lastActive;
                    return lastActive && $.grep(this.errorList, function(n) {
                        return n.element.name === lastActive.name
                    }).length === 1 && lastActive
                },
                elements: function() {
                    var validator = this,
                        rulesCache = {};
                    return $(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function() {
                        if (!this.name && validator.settings.debug && window.console) {
                            console.error("%o has no name assigned", this)
                        }
                        if (this.name in rulesCache || !validator.objectLength($(this).rules())) {
                            return false
                        }
                        rulesCache[this.name] = true;
                        return true
                    })
                },
                clean: function(selector) {
                    return $(selector)[0]
                },
                errors: function() {
                    var errorClass = this.settings.errorClass.split(" ").join(".");
                    return $(this.settings.errorElement + "." + errorClass, this.errorContext)
                },
                reset: function() {
                    this.successList = [];
                    this.errorList = [];
                    this.errorMap = {};
                    this.toShow = $([]);
                    this.toHide = $([]);
                    this.currentElements = $([])
                },
                prepareForm: function() {
                    this.reset();
                    this.toHide = this.errors().add(this.containers)
                },
                prepareElement: function(element) {
                    this.reset();
                    this.toHide = this.errorsFor(element)
                },
                elementValue: function(element) {
                    var val, $element = $(element),
                        type = element.type;
                    if (type === "radio" || type === "checkbox") {
                        return $("input[name='" + element.name + "']:checked").val()
                    } else if (type === "number" && typeof element.validity !== "undefined") {
                        return element.validity.badInput ? false : $element.val()
                    }
                    val = $element.val();
                    if (typeof val === "string") {
                        return val.replace(/\r/g, "")
                    }
                    return val
                },
                check: function(element) {
                    element = this.validationTargetFor(this.clean(element));
                    var rules = $(element).rules(),
                        rulesCount = $.map(rules, function(n, i) {
                            return i
                        }).length,
                        dependencyMismatch = false,
                        val = this.elementValue(element),
                        result, method, rule;
                    for (method in rules) {
                        rule = {
                            method: method,
                            parameters: rules[method]
                        };
                        try {
                            result = $.validator.methods[method].call(this, val, element, rule.parameters);
                            if (result === "dependency-mismatch" && rulesCount === 1) {
                                dependencyMismatch = true;
                                continue
                            }
                            dependencyMismatch = false;
                            if (result === "pending") {
                                this.toHide = this.toHide.not(this.errorsFor(element));
                                return
                            }
                            if (!result) {
                                this.formatAndAdd(element, rule);
                                return false
                            }
                        } catch (e) {
                            if (this.settings.debug && window.console) {
                                console.log("Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e)
                            }
                            throw e
                        }
                    }
                    if (dependencyMismatch) {
                        return
                    }
                    if (this.objectLength(rules)) {
                        this.successList.push(element)
                    }
                    return true
                },
                customDataMessage: function(element, method) {
                    return $(element).data("msg" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase()) || $(element).data("msg")
                },
                customMessage: function(name, method) {
                    var m = this.settings.messages[name];
                    return m && (m.constructor === String ? m : m[method])
                },
                findDefined: function() {
                    for (var i = 0; i < arguments.length; i++) {
                        if (arguments[i] !== undefined) {
                            return arguments[i]
                        }
                    }
                    return undefined
                },
                defaultMessage: function(element, method) {
                    return this.findDefined(this.customMessage(element.name, method), this.customDataMessage(element, method), !this.settings.ignoreTitle && element.title || undefined, $.validator.messages[method], "<strong>Warning: No message defined for " + element.name + "</strong>")
                },
                formatAndAdd: function(element, rule) {
                    var message = this.defaultMessage(element, rule.method),
                        theregex = /\$?\{(\d+)\}/g;
                    if (typeof message === "function") {
                        message = message.call(this, rule.parameters, element)
                    } else if (theregex.test(message)) {
                        message = $.validator.format(message.replace(theregex, "{$1}"), rule.parameters)
                    }
                    this.errorList.push({
                        message: message,
                        element: element,
                        method: rule.method
                    });
                    this.errorMap[element.name] = message;
                    this.submitted[element.name] = message
                },
                addWrapper: function(toToggle) {
                    if (this.settings.wrapper) {
                        toToggle = toToggle.add(toToggle.parent(this.settings.wrapper))
                    }
                    return toToggle
                },
                defaultShowErrors: function() {
                    var i, elements, error;
                    for (i = 0; this.errorList[i]; i++) {
                        error = this.errorList[i];
                        if (this.settings.highlight) {
                            this.settings.highlight.call(this, error.element, this.settings.errorClass, this.settings.validClass)
                        }
                        this.showLabel(error.element, error.message)
                    }
                    if (this.errorList.length) {
                        this.toShow = this.toShow.add(this.containers)
                    }
                    if (this.settings.success) {
                        for (i = 0; this.successList[i]; i++) {
                            this.showLabel(this.successList[i])
                        }
                    }
                    if (this.settings.unhighlight) {
                        for (i = 0, elements = this.validElements(); elements[i]; i++) {
                            this.settings.unhighlight.call(this, elements[i], this.settings.errorClass, this.settings.validClass)
                        }
                    }
                    this.toHide = this.toHide.not(this.toShow);
                    this.hideErrors();
                    this.addWrapper(this.toShow).show()
                },
                validElements: function() {
                    return this.currentElements.not(this.invalidElements())
                },
                invalidElements: function() {
                    return $(this.errorList).map(function() {
                        return this.element
                    })
                },
                showLabel: function(element, message) {
                    var place, group, errorID, error = this.errorsFor(element),
                        elementID = this.idOrName(element),
                        describedBy = $(element).attr("aria-describedby");
                    if (error.length) {
                        error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);
                        error.html(message)
                    } else {
                        error = $("<" + this.settings.errorElement + ">").attr("id", elementID + "-error").addClass(this.settings.errorClass).html(message || "");
                        place = error;
                        if (this.settings.wrapper) {
                            place = error.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()
                        }
                        if (this.labelContainer.length) {
                            this.labelContainer.append(place)
                        } else if (this.settings.errorPlacement) {
                            this.settings.errorPlacement(place, $(element))
                        } else {
                            place.insertAfter(element)
                        }
                        if (error.is("label")) {
                            error.attr("for", elementID)
                        } else if (error.parents("label[for='" + elementID + "']").length === 0) {
                            errorID = error.attr("id");
                            if (!describedBy) {
                                describedBy = errorID
                            } else if (!describedBy.match(new RegExp("\b" + errorID + "\b"))) {
                                describedBy += " " + errorID
                            }
                            $(element).attr("aria-describedby", describedBy);
                            group = this.groups[element.name];
                            if (group) {
                                $.each(this.groups, function(name, testgroup) {
                                    if (testgroup === group) {
                                        $("[name='" + name + "']", this.currentForm).attr("aria-describedby", error.attr("id"))
                                    }
                                })
                            }
                        }
                    }
                    if (!message && this.settings.success) {
                        error.text("");
                        if (typeof this.settings.success === "string") {
                            error.addClass(this.settings.success)
                        } else {
                            this.settings.success(error, element)
                        }
                    }
                    this.toShow = this.toShow.add(error)
                },
                errorsFor: function(element) {
                    var name = this.idOrName(element),
                        describer = $(element).attr("aria-describedby"),
                        selector = "label[for='" + name + "'], label[for='" + name + "'] *";
                    if (describer) {
                        selector = selector + ", #" + describer.replace(/\s+/g, ", #")
                    }
                    return this.errors().filter(selector)
                },
                idOrName: function(element) {
                    return this.groups[element.name] || (this.checkable(element) ? element.name : element.id || element.name)
                },
                validationTargetFor: function(element) {
                    if (this.checkable(element)) {
                        element = this.findByName(element.name).not(this.settings.ignore)[0]
                    }
                    return element
                },
                checkable: function(element) {
                    return /radio|checkbox/i.test(element.type)
                },
                findByName: function(name) {
                    return $(this.currentForm).find("[name='" + name + "']")
                },
                getLength: function(value, element) {
                    switch (element.nodeName.toLowerCase()) {
                        case "select":
                            return $("option:selected", element).length;
                        case "input":
                            if (this.checkable(element)) {
                                return this.findByName(element.name).filter(":checked").length
                            }
                    }
                    return value.length
                },
                depend: function(param, element) {
                    return this.dependTypes[typeof param] ? this.dependTypes[typeof param](param, element) : true
                },
                dependTypes: {
                    "boolean": function(param) {
                        return param
                    },
                    string: function(param, element) {
                        return !!$(param, element.form).length
                    },
                    "function": function(param, element) {
                        return param(element)
                    }
                },
                optional: function(element) {
                    var val = this.elementValue(element);
                    return !$.validator.methods.required.call(this, val, element) && "dependency-mismatch"
                },
                startRequest: function(element) {
                    if (!this.pending[element.name]) {
                        this.pendingRequest++;
                        this.pending[element.name] = true
                    }
                },
                stopRequest: function(element, valid) {
                    this.pendingRequest--;
                    if (this.pendingRequest < 0) {
                        this.pendingRequest = 0
                    }
                    delete this.pending[element.name];
                    if (valid && this.pendingRequest === 0 && this.formSubmitted && this.form()) {
                        $(this.currentForm).submit();
                        this.formSubmitted = false
                    } else if (!valid && this.pendingRequest === 0 && this.formSubmitted) {
                        $(this.currentForm).triggerHandler("invalid-form", [this]);
                        this.formSubmitted = false
                    }
                },
                previousValue: function(element) {
                    return $.data(element, "previousValue") || $.data(element, "previousValue", {
                        old: null,
                        valid: true,
                        message: this.defaultMessage(element, "remote")
                    })
                }
            },
            classRuleSettings: {
                required: {
                    required: true
                },
                email: {
                    email: true
                },
                url: {
                    url: true
                },
                date: {
                    date: true
                },
                dateISO: {
                    dateISO: true
                },
                number: {
                    number: true
                },
                digits: {
                    digits: true
                },
                creditcard: {
                    creditcard: true
                }
            },
            addClassRules: function(className, rules) {
                if (className.constructor === String) {
                    this.classRuleSettings[className] = rules
                } else {
                    $.extend(this.classRuleSettings, className)
                }
            },
            classRules: function(element) {
                var rules = {},
                    classes = $(element).attr("class");
                if (classes) {
                    $.each(classes.split(" "), function() {
                        if (this in $.validator.classRuleSettings) {
                            $.extend(rules, $.validator.classRuleSettings[this])
                        }
                    })
                }
                return rules
            },
            attributeRules: function(element) {
                var rules = {},
                    $element = $(element),
                    type = element.getAttribute("type"),
                    method, value;
                for (method in $.validator.methods) {
                    if (method === "required") {
                        value = element.getAttribute(method);
                        if (value === "") {
                            value = true
                        }
                        value = !!value
                    } else {
                        value = $element.attr(method)
                    }
                    if (/min|max/.test(method) && (type === null || /number|range|text/.test(type))) {
                        value = Number(value)
                    }
                    if (value || value === 0) {
                        rules[method] = value
                    } else if (type === method && type !== "range") {
                        rules[method] = true
                    }
                }
                if (rules.maxlength && /-1|2147483647|524288/.test(rules.maxlength)) {
                    delete rules.maxlength
                }
                return rules
            },
            dataRules: function(element) {
                var method, value, rules = {},
                    $element = $(element);
                for (method in $.validator.methods) {
                    value = $element.data("rule" + method.charAt(0).toUpperCase() + method.substring(1).toLowerCase());
                    if (value !== undefined) {
                        rules[method] = value
                    }
                }
                return rules
            },
            staticRules: function(element) {
                var rules = {},
                    validator = $.data(element.form, "validator");
                if (validator.settings.rules) {
                    rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {}
                }
                return rules
            },
            normalizeRules: function(rules, element) {
                $.each(rules, function(prop, val) {
                    if (val === false) {
                        delete rules[prop];
                        return
                    }
                    if (val.param || val.depends) {
                        var keepRule = true;
                        switch (typeof val.depends) {
                            case "string":
                                keepRule = !!$(val.depends, element.form).length;
                                break;
                            case "function":
                                keepRule = val.depends.call(element, element);
                                break
                        }
                        if (keepRule) {
                            rules[prop] = val.param !== undefined ? val.param : true
                        } else {
                            delete rules[prop]
                        }
                    }
                });
                $.each(rules, function(rule, parameter) {
                    rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter
                });
                $.each(["minlength", "maxlength"], function() {
                    if (rules[this]) {
                        rules[this] = Number(rules[this])
                    }
                });
                $.each(["rangelength", "range"], function() {
                    var parts;
                    if (rules[this]) {
                        if ($.isArray(rules[this])) {
                            rules[this] = [Number(rules[this][0]), Number(rules[this][1])]
                        } else if (typeof rules[this] === "string") {
                            parts = rules[this].replace(/[\[\]]/g, "").split(/[\s,]+/);
                            rules[this] = [Number(parts[0]), Number(parts[1])]
                        }
                    }
                });
                if ($.validator.autoCreateRanges) {
                    if (rules.min && rules.max) {
                        rules.range = [rules.min, rules.max];
                        delete rules.min;
                        delete rules.max
                    }
                    if (rules.minlength && rules.maxlength) {
                        rules.rangelength = [rules.minlength, rules.maxlength];
                        delete rules.minlength;
                        delete rules.maxlength
                    }
                }
                return rules
            },
            normalizeRule: function(data) {
                if (typeof data === "string") {
                    var transformed = {};
                    $.each(data.split(/\s/), function() {
                        transformed[this] = true
                    });
                    data = transformed
                }
                return data
            },
            addMethod: function(name, method, message) {
                $.validator.methods[name] = method;
                $.validator.messages[name] = message !== undefined ? message : $.validator.messages[name];
                if (method.length < 3) {
                    $.validator.addClassRules(name, $.validator.normalizeRule(name))
                }
            },
            methods: {
                required: function(value, element, param) {
                    if (!this.depend(param, element)) {
                        return "dependency-mismatch"
                    }
                    if (element.nodeName.toLowerCase() === "select") {
                        var val = $(element).val();
                        return val && val.length > 0
                    }
                    if (this.checkable(element)) {
                        return this.getLength(value, element) > 0
                    }
                    return $.trim(value).length > 0
                },
                email: function(value, element) {
                    return this.optional(element) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value)
                },
                url: function(value, element) {
                    return this.optional(element) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value)
                },
                date: function(value, element) {
                    return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString())
                },
                dateISO: function(value, element) {
                    return this.optional(element) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value)
                },
                number: function(value, element) {
                    return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)
                },
                digits: function(value, element) {
                    return this.optional(element) || /^\d+$/.test(value)
                },
                creditcard: function(value, element) {
                    if (this.optional(element)) {
                        return "dependency-mismatch"
                    }
                    if (/[^0-9 \-]+/.test(value)) {
                        return false
                    }
                    var nCheck = 0,
                        nDigit = 0,
                        bEven = false,
                        n, cDigit;
                    value = value.replace(/\D/g, "");
                    if (value.length < 13 || value.length > 19) {
                        return false
                    }
                    for (n = value.length - 1; n >= 0; n--) {
                        cDigit = value.charAt(n);
                        nDigit = parseInt(cDigit, 10);
                        if (bEven) {
                            if ((nDigit *= 2) > 9) {
                                nDigit -= 9
                            }
                        }
                        nCheck += nDigit;
                        bEven = !bEven
                    }
                    return nCheck % 10 === 0
                },
                minlength: function(value, element, param) {
                    var length = $.isArray(value) ? value.length : this.getLength($.trim(value), element);
                    return this.optional(element) || length >= param
                },
                maxlength: function(value, element, param) {
                    var length = $.isArray(value) ? value.length : this.getLength($.trim(value), element);
                    return this.optional(element) || length <= param
                },
                rangelength: function(value, element, param) {
                    var length = $.isArray(value) ? value.length : this.getLength($.trim(value), element);
                    return this.optional(element) || length >= param[0] && length <= param[1]
                },
                min: function(value, element, param) {
                    return this.optional(element) || value >= param
                },
                max: function(value, element, param) {
                    return this.optional(element) || value <= param
                },
                range: function(value, element, param) {
                    return this.optional(element) || value >= param[0] && value <= param[1]
                },
                equalTo: function(value, element, param) {
                    var target = $(param);
                    if (this.settings.onfocusout) {
                        target.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
                            $(element).valid()
                        })
                    }
                    return value === target.val()
                },
                remote: function(value, element, param) {
                    if (this.optional(element)) {
                        return "dependency-mismatch"
                    }
                    var previous = this.previousValue(element),
                        validator, data;
                    if (!this.settings.messages[element.name]) {
                        this.settings.messages[element.name] = {}
                    }
                    previous.originalMessage = this.settings.messages[element.name].remote;
                    this.settings.messages[element.name].remote = previous.message;
                    param = typeof param === "string" && {
                        url: param
                    } || param;
                    if (previous.old === value) {
                        return previous.valid
                    }
                    previous.old = value;
                    validator = this;
                    this.startRequest(element);
                    data = {};
                    data[element.name] = value;
                    $.ajax($.extend(true, {
                        url: param,
                        mode: "abort",
                        port: "validate" + element.name,
                        dataType: "json",
                        data: data,
                        context: validator.currentForm,
                        success: function(response) {
                            var valid = response === true || response === "true",
                                errors, message, submitted;
                            validator.settings.messages[element.name].remote = previous.originalMessage;
                            if (valid) {
                                submitted = validator.formSubmitted;
                                validator.prepareElement(element);
                                validator.formSubmitted = submitted;
                                validator.successList.push(element);
                                delete validator.invalid[element.name];
                                validator.showErrors()
                            } else {
                                errors = {};
                                message = response || validator.defaultMessage(element, "remote");
                                errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
                                validator.invalid[element.name] = true;
                                validator.showErrors(errors)
                            }
                            previous.valid = valid;
                            validator.stopRequest(element, valid)
                        }
                    }, param));
                    return "pending"
                }
            }
        });
        $.format = function deprecated() {
            throw "$.format has been deprecated. Please use $.validator.format instead."
        };
        var pendingRequests = {},
            ajax;
        if ($.ajaxPrefilter) {
            $.ajaxPrefilter(function(settings, _, xhr) {
                var port = settings.port;
                if (settings.mode === "abort") {
                    if (pendingRequests[port]) {
                        pendingRequests[port].abort()
                    }
                    pendingRequests[port] = xhr
                }
            })
        } else {
            ajax = $.ajax;
            $.ajax = function(settings) {
                var mode = ("mode" in settings ? settings : $.ajaxSettings).mode,
                    port = ("port" in settings ? settings : $.ajaxSettings).port;
                if (mode === "abort") {
                    if (pendingRequests[port]) {
                        pendingRequests[port].abort()
                    }
                    pendingRequests[port] = ajax.apply(this, arguments);
                    return pendingRequests[port]
                }
                return ajax.apply(this, arguments)
            }
        }
        $.extend($.fn, {
            validateDelegate: function(delegate, type, handler) {
                return this.bind(type, function(event) {
                    var target = $(event.target);
                    if (target.is(delegate)) {
                        return handler.apply(target, arguments)
                    }
                })
            }
        })
    });
    return jQuery
});
define("jquery.complexify", ["jquery"], function(jQuery) {
    (function($) {
        $.fn.extend({
            complexify: function(options, callback) {
                var MIN_COMPLEXITY = 49;
                var MAX_COMPLEXITY = 120;
                var COMPLEXIFY_BANLIST = "123456|password|12345678|1234|pussy|12345|dragon|qwerty|696969|mustang|letmein|baseball|master|michael|football|shadow|monkey|abc123|pass|fuckme|6969|jordan|harley|ranger|iwantu|jennifer|hunter|fuck|2000|test|batman|trustno1|thomas|tigger|robert|access|love|buster|1234567|soccer|hockey|killer|george|sexy|andrew|charlie|superman|asshole|fuckyou|dallas|jessica|panties|pepper|1111|austin|william|daniel|golfer|summer|heather|hammer|yankees|joshua|maggie|biteme|enter|ashley|thunder|cowboy|silver|richard|fucker|orange|merlin|michelle|corvette|bigdog|cheese|matthew|121212|patrick|martin|freedom|ginger|blowjob|nicole|sparky|yellow|camaro|secret|dick|falcon|taylor|111111|131313|123123|bitch|hello|scooter|please|porsche|guitar|chelsea|black|diamond|nascar|jackson|cameron|654321|computer|amanda|wizard|xxxxxxxx|money|phoenix|mickey|bailey|knight|iceman|tigers|purple|andrea|horny|dakota|aaaaaa|player|sunshine|morgan|starwars|boomer|cowboys|edward|charles|girls|booboo|coffee|xxxxxx|bulldog|ncc1701|rabbit|peanut|john|johnny|gandalf|spanky|winter|brandy|compaq|carlos|tennis|james|mike|brandon|fender|anthony|blowme|ferrari|cookie|chicken|maverick|chicago|joseph|diablo|sexsex|hardcore|666666|willie|welcome|chris|panther|yamaha|justin|banana|driver|marine|angels|fishing|david|maddog|hooters|wilson|butthead|dennis|fucking|captain|bigdick|chester|smokey|xavier|steven|viking|snoopy|blue|eagles|winner|samantha|house|miller|flower|jack|firebird|butter|united|turtle|steelers|tiffany|zxcvbn|tomcat|golf|bond007|bear|tiger|doctor|gateway|gators|angel|junior|thx1138|porno|badboy|debbie|spider|melissa|booger|1212|flyers|fish|porn|matrix|teens|scooby|jason|walter|cumshot|boston|braves|yankee|lover|barney|victor|tucker|princess|mercedes|5150|doggie|zzzzzz|gunner|horney|bubba|2112|fred|johnson|xxxxx|tits|member|boobs|donald|bigdaddy|bronco|penis|voyager|rangers|birdie|trouble|white|topgun|bigtits|bitches|green|super|qazwsx|magic|lakers|rachel|slayer|scott|2222|asdf|video|london|7777|marlboro|srinivas|internet|action|carter|jasper|monster|teresa|jeremy|11111111|bill|crystal|peter|pussies|cock|beer|rocket|theman|oliver|prince|beach|amateur|7777777|muffin|redsox|star|testing|shannon|murphy|frank|hannah|dave|eagle1|11111|mother|nathan|raiders|steve|forever|angela|viper|ou812|jake|lovers|suckit|gregory|buddy|whatever|young|nicholas|lucky|helpme|jackie|monica|midnight|college|baby|cunt|brian|mark|startrek|sierra|leather|232323|4444|beavis|bigcock|happy|sophie|ladies|naughty|giants|booty|blonde|fucked|golden|0|fire|sandra|pookie|packers|einstein|dolphins|chevy|winston|warrior|sammy|slut|8675309|zxcvbnm|nipples|power|victoria|asdfgh|vagina|toyota|travis|hotdog|paris|rock|xxxx|extreme|redskins|erotic|dirty|ford|freddy|arsenal|access14|wolf|nipple|iloveyou|alex|florida|eric|legend|movie|success|rosebud|jaguar|great|cool|cooper|1313|scorpio|mountain|madison|987654|brazil|lauren|japan|naked|squirt|stars|apple|alexis|aaaa|bonnie|peaches|jasmine|kevin|matt|qwertyui|danielle|beaver|4321|4128|runner|swimming|dolphin|gordon|casper|stupid|shit|saturn|gemini|apples|august|3333|canada|blazer|cumming|hunting|kitty|rainbow|112233|arthur|cream|calvin|shaved|surfer|samson|kelly|paul|mine|king|racing|5555|eagle|hentai|newyork|little|redwings|smith|sticky|cocacola|animal|broncos|private|skippy|marvin|blondes|enjoy|girl|apollo|parker|qwert|time|sydney|women|voodoo|magnum|juice|abgrtyu|777777|dreams|maxwell|music|rush2112|russia|scorpion|rebecca|tester|mistress|phantom|billy|6666|albert|111111|11111111|112233|121212|123123|123456|1234567|12345678|131313|232323|654321|666666|696969|777777|7777777|8675309|987654|abcdef|password1|password12|password123|twitter".split("|");
                var CHARSETS = [
                    [48, 57],
                    [65, 90],
                    [97, 122],
                    [33, 47],
                    [58, 64],
                    [91, 96],
                    [123, 126],
                    [128, 255],
                    [256, 383],
                    [384, 591],
                    [592, 687],
                    [688, 767],
                    [768, 879],
                    [880, 1023],
                    [1024, 1279],
                    [1328, 1423],
                    [1424, 1535],
                    [1536, 1791],
                    [1792, 1871],
                    [1920, 1983],
                    [2304, 2431],
                    [2432, 2559],
                    [2560, 2687],
                    [2688, 2815],
                    [2816, 2943],
                    [2944, 3071],
                    [3072, 3199],
                    [3200, 3327],
                    [3328, 3455],
                    [3456, 3583],
                    [3584, 3711],
                    [3712, 3839],
                    [3840, 4095],
                    [4096, 4255],
                    [4256, 4351],
                    [4352, 4607],
                    [4608, 4991],
                    [5024, 5119],
                    [5120, 5759],
                    [5760, 5791],
                    [5792, 5887],
                    [6016, 6143],
                    [6144, 6319],
                    [7680, 7935],
                    [7936, 8191],
                    [8192, 8303],
                    [8304, 8351],
                    [8352, 8399],
                    [8400, 8447],
                    [8448, 8527],
                    [8528, 8591],
                    [8592, 8703],
                    [8704, 8959],
                    [8960, 9215],
                    [9216, 9279],
                    [9280, 9311],
                    [9312, 9471],
                    [9472, 9599],
                    [9600, 9631],
                    [9632, 9727],
                    [9728, 9983],
                    [9984, 10175],
                    [10240, 10495],
                    [11904, 12031],
                    [12032, 12255],
                    [12272, 12287],
                    [12288, 12351],
                    [12352, 12447],
                    [12448, 12543],
                    [12544, 12591],
                    [12592, 12687],
                    [12688, 12703],
                    [12704, 12735],
                    [12800, 13055],
                    [13056, 13311],
                    [13312, 19893],
                    [19968, 40959],
                    [40960, 42127],
                    [42128, 42191],
                    [44032, 55203],
                    [55296, 56191],
                    [56192, 56319],
                    [56320, 57343],
                    [57344, 63743],
                    [63744, 64255],
                    [64256, 64335],
                    [64336, 65023],
                    [65056, 65071],
                    [65072, 65103],
                    [65104, 65135],
                    [65136, 65278],
                    [65279, 65279],
                    [65280, 65519],
                    [65520, 65533]
                ];
                var defaults = {
                    minimumChars: 8,
                    strengthScaleFactor: .5,
                    bannedPasswords: COMPLEXIFY_BANLIST,
                    banmode: "strict"
                };
                if ($.isFunction(options) && !callback) {
                    callback = options;
                    options = {}
                }
                options = $.extend(defaults, options);

                function additionalComplexityForCharset(str, charset) {
                    for (var i = str.length - 1; i >= 0; i--) {
                        if (charset[0] <= str.charCodeAt(i) && str.charCodeAt(i) <= charset[1]) {
                            return charset[1] - charset[0] + 1
                        }
                    }
                    return 0
                }

                function inBanlist(str) {
                    if (options.banmode === "strict") {
                        for (var i = 0; i < options.bannedPasswords.length; i++) {
                            if (options.bannedPasswords[i].indexOf(str) !== -1) {
                                return true
                            }
                        }
                        return false
                    } else {
                        return $.inArray(str, options.bannedPasswords) > -1 ? true : false
                    }
                }

                function evaluateSecurity() {
                    var password = $(this).val();
                    var complexity = 0,
                        valid = false;
                    if (!inBanlist(password)) {
                        for (var i = CHARSETS.length - 1; i >= 0; i--) {
                            complexity += additionalComplexityForCharset(password, CHARSETS[i])
                        }
                    } else {
                        complexity = 1
                    }
                    complexity = Math.log(Math.pow(complexity, password.length)) * (1 / options.strengthScaleFactor);
                    valid = complexity > MIN_COMPLEXITY && password.length >= options.minimumChars;
                    complexity = complexity / MAX_COMPLEXITY * 100;
                    complexity = complexity > 100 ? 100 : complexity;
                    callback.call(this, valid, complexity)
                }
                return this.each(function() {
                    $(this).bind("keyup focus", evaluateSecurity)
                })
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.magnific-popup", ["jquery"], function(jQuery, exports, module) {
    window.jQuery = jQuery;
    (function($) {
        var CLOSE_EVENT = "Close",
            BEFORE_CLOSE_EVENT = "BeforeClose",
            AFTER_CLOSE_EVENT = "AfterClose",
            BEFORE_APPEND_EVENT = "BeforeAppend",
            MARKUP_PARSE_EVENT = "MarkupParse",
            OPEN_EVENT = "Open",
            CHANGE_EVENT = "Change",
            NS = "mfp",
            EVENT_NS = "." + NS,
            READY_CLASS = "mfp-ready",
            REMOVING_CLASS = "mfp-removing",
            PREVENT_CLOSE_CLASS = "mfp-prevent-close";
        var mfp, MagnificPopup = function() {},
            _isJQ = !!window.jQuery,
            _prevStatus, _window = $(window),
            _body, _document, _prevContentType, _wrapClasses, _currPopupType;
        var _mfpOn = function(name, f) {
                mfp.ev.on(NS + name + EVENT_NS, f)
            },
            _getEl = function(className, appendTo, html, raw) {
                var el = document.createElement("div");
                el.className = "mfp-" + className;
                if (html) {
                    el.innerHTML = html
                }
                if (!raw) {
                    el = $(el);
                    if (appendTo) {
                        el.appendTo(appendTo)
                    }
                } else if (appendTo) {
                    appendTo.appendChild(el)
                }
                return el
            },
            _mfpTrigger = function(e, data) {
                mfp.ev.triggerHandler(NS + e, data);
                if (mfp.st.callbacks) {
                    e = e.charAt(0).toLowerCase() + e.slice(1);
                    if (mfp.st.callbacks[e]) {
                        mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data])
                    }
                }
            },
            _setFocus = function() {
                (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).trigger("focus")
            },
            _getCloseBtn = function(type) {
                if (type !== _currPopupType || !mfp.currTemplate.closeBtn) {
                    mfp.currTemplate.closeBtn = $(mfp.st.closeMarkup.replace("%title%", mfp.st.tClose));
                    _currPopupType = type
                }
                return mfp.currTemplate.closeBtn
            },
            _checkInstance = function() {
                if (!$.magnificPopup.instance) {
                    mfp = new MagnificPopup;
                    mfp.init();
                    $.magnificPopup.instance = mfp
                }
            },
            _checkIfClose = function(target) {
                if ($(target).hasClass(PREVENT_CLOSE_CLASS)) {
                    return
                }
                var closeOnContent = mfp.st.closeOnContentClick;
                var closeOnBg = mfp.st.closeOnBgClick;
                if (closeOnContent && closeOnBg) {
                    return true
                } else {
                    if (!mfp.content || $(target).hasClass("mfp-close") || mfp.preloader && target === mfp.preloader[0]) {
                        return true
                    }
                    if (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) {
                        if (closeOnBg) {
                            if ($.contains(document, target)) {
                                return true
                            }
                        }
                    } else if (closeOnContent) {
                        return true
                    }
                }
                return false
            },
            supportsTransitions = function() {
                var s = document.createElement("p").style,
                    v = ["ms", "O", "Moz", "Webkit"];
                if (s["transition"] !== undefined) {
                    return true
                }
                while (v.length) {
                    if (v.pop() + "Transition" in s) {
                        return true
                    }
                }
                return false
            };
        MagnificPopup.prototype = {
            constructor: MagnificPopup,
            init: function() {
                var appVersion = navigator.appVersion;
                mfp.isIE7 = appVersion.indexOf("MSIE 7.") !== -1;
                mfp.isIE8 = appVersion.indexOf("MSIE 8.") !== -1;
                mfp.isLowIE = mfp.isIE7 || mfp.isIE8;
                mfp.isAndroid = /android/gi.test(appVersion);
                mfp.isIOS = /iphone|ipad|ipod/gi.test(appVersion);
                mfp.supportsTransition = supportsTransitions();
                mfp.probablyMobile = mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent);
                _body = $(document.body);
                _document = $(document);
                mfp.popupsCache = {}
            },
            open: function(data) {
                var i;
                if (data.isObj === false) {
                    mfp.items = data.items.toArray();
                    mfp.index = 0;
                    var items = data.items,
                        item;
                    for (i = 0; i < items.length; i++) {
                        item = items[i];
                        if (item.parsed) {
                            item = item.el[0]
                        }
                        if (item === data.el[0]) {
                            mfp.index = i;
                            break
                        }
                    }
                } else {
                    mfp.items = $.isArray(data.items) ? data.items : [data.items];
                    mfp.index = data.index || 0
                }
                if (mfp.isOpen) {
                    mfp.updateItemHTML();
                    return
                }
                mfp.types = [];
                _wrapClasses = "";
                if (data.mainEl && data.mainEl.length) {
                    mfp.ev = data.mainEl.eq(0)
                } else {
                    mfp.ev = _document
                }
                if (data.key) {
                    if (!mfp.popupsCache[data.key]) {
                        mfp.popupsCache[data.key] = {}
                    }
                    mfp.currTemplate = mfp.popupsCache[data.key]
                } else {
                    mfp.currTemplate = {}
                }
                mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data);
                mfp.fixedContentPos = mfp.st.fixedContentPos === "auto" ? !mfp.probablyMobile : mfp.st.fixedContentPos;
                if (mfp.st.modal) {
                    mfp.st.closeOnContentClick = false;
                    mfp.st.closeOnBgClick = false;
                    mfp.st.showCloseBtn = false;
                    mfp.st.enableEscapeKey = false
                }
                if (!mfp.bgOverlay) {
                    mfp.bgOverlay = _getEl("bg").on("click" + EVENT_NS, function() {
                        mfp.close()
                    });
                    mfp.wrap = _getEl("wrap").attr("tabindex", -1).on("click" + EVENT_NS, function(e) {
                        if (_checkIfClose(e.target)) {
                            mfp.close()
                        }
                    });
                    mfp.container = _getEl("container", mfp.wrap)
                }
                mfp.contentContainer = _getEl("content");
                if (mfp.st.preloader) {
                    mfp.preloader = _getEl("preloader", mfp.container, mfp.st.tLoading)
                }
                var modules = $.magnificPopup.modules;
                for (i = 0; i < modules.length; i++) {
                    var n = modules[i];
                    n = n.charAt(0).toUpperCase() + n.slice(1);
                    mfp["init" + n].call(mfp)
                }
                _mfpTrigger("BeforeOpen");
                if (mfp.st.showCloseBtn) {
                    if (!mfp.st.closeBtnInside) {
                        mfp.wrap.append(_getCloseBtn())
                    } else {
                        _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
                            values.close_replaceWith = _getCloseBtn(item.type)
                        });
                        _wrapClasses += " mfp-close-btn-in"
                    }
                }
                if (mfp.st.alignTop) {
                    _wrapClasses += " mfp-align-top"
                }
                if (mfp.fixedContentPos) {
                    mfp.wrap.css({
                        overflow: mfp.st.overflowY,
                        overflowX: "hidden",
                        overflowY: mfp.st.overflowY
                    })
                } else {
                    mfp.wrap.css({
                        top: _window.scrollTop(),
                        position: "absolute"
                    })
                }
                if (mfp.st.fixedBgPos === false || mfp.st.fixedBgPos === "auto" && !mfp.fixedContentPos) {
                    mfp.bgOverlay.css({
                        height: _document.height(),
                        position: "absolute"
                    })
                }
                if (mfp.st.enableEscapeKey) {
                    _document.on("keyup" + EVENT_NS, function(e) {
                        if (e.keyCode === 27) {
                            mfp.close()
                        }
                    })
                }
                _window.on("resize" + EVENT_NS, function() {
                    mfp.updateSize()
                });
                if (!mfp.st.closeOnContentClick) {
                    _wrapClasses += " mfp-auto-cursor"
                }
                if (_wrapClasses) mfp.wrap.addClass(_wrapClasses);
                var windowHeight = mfp.wH = _window.height();
                var windowStyles = {};
                if (mfp.fixedContentPos) {
                    if (mfp._hasScrollBar(windowHeight)) {
                        var s = mfp._getScrollbarSize();
                        if (s) {
                            windowStyles.paddingRight = s
                        }
                    }
                }
                if (mfp.fixedContentPos) {
                    if (!mfp.isIE7) {
                        windowStyles.overflow = "hidden"
                    } else {
                        $("body, html").css("overflow", "hidden")
                    }
                }
                var classesToadd = mfp.st.mainClass;
                if (mfp.isIE7) {
                    classesToadd += " mfp-ie7"
                }
                if (classesToadd) {
                    mfp._addClassToMFP(classesToadd)
                }
                mfp.updateItemHTML();
                _mfpTrigger("BuildControls");
                $("html").css(windowStyles);
                mfp.bgOverlay.add(mfp.wrap).prependTo(document.body);
                mfp._lastFocusedEl = document.activeElement;
                setTimeout(function() {
                    if (mfp.content) {
                        mfp._addClassToMFP(READY_CLASS);
                        _setFocus()
                    } else {
                        mfp.bgOverlay.addClass(READY_CLASS)
                    }
                    _document.on("focusin" + EVENT_NS, function(e) {
                        if (e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target)) {
                            _setFocus();
                            return false
                        }
                    })
                }, 16);
                mfp.isOpen = true;
                mfp.updateSize(windowHeight);
                _mfpTrigger(OPEN_EVENT)
            },
            close: function() {
                if (!mfp.isOpen) return;
                _mfpTrigger(BEFORE_CLOSE_EVENT);
                mfp.isOpen = false;
                if (mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition) {
                    mfp._addClassToMFP(REMOVING_CLASS);
                    setTimeout(function() {
                        mfp._close()
                    }, mfp.st.removalDelay)
                } else {
                    mfp._close()
                }
            },
            _close: function() {
                _mfpTrigger(CLOSE_EVENT);
                var classesToRemove = REMOVING_CLASS + " " + READY_CLASS + " ";
                mfp.bgOverlay.detach();
                mfp.wrap.detach();
                mfp.container.empty();
                if (mfp.st.mainClass) {
                    classesToRemove += mfp.st.mainClass + " "
                }
                mfp._removeClassFromMFP(classesToRemove);
                if (mfp.fixedContentPos) {
                    var windowStyles = {
                        paddingRight: ""
                    };
                    if (mfp.isIE7) {
                        $("body, html").css("overflow", "")
                    } else {
                        windowStyles.overflow = ""
                    }
                    $("html").css(windowStyles)
                }
                _document.off("keyup" + EVENT_NS + " focusin" + EVENT_NS);
                mfp.ev.off(EVENT_NS);
                mfp.wrap.attr("class", "mfp-wrap").removeAttr("style");
                mfp.bgOverlay.attr("class", "mfp-bg");
                mfp.container.attr("class", "mfp-container");
                if (mfp.st.showCloseBtn && (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
                    if (mfp.currTemplate.closeBtn) mfp.currTemplate.closeBtn.detach()
                }
                if (mfp._lastFocusedEl) {
                    $(mfp._lastFocusedEl).trigger("focus")
                }
                mfp.currItem = null;
                mfp.content = null;
                mfp.currTemplate = null;
                mfp.prevHeight = 0;
                _mfpTrigger(AFTER_CLOSE_EVENT)
            },
            updateSize: function(winHeight) {
                if (mfp.isIOS) {
                    var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
                    var height = window.innerHeight * zoomLevel;
                    mfp.wrap.css("height", height);
                    mfp.wH = height
                } else {
                    mfp.wH = winHeight || _window.height()
                }
                if (!mfp.fixedContentPos) {
                    mfp.wrap.css("height", mfp.wH)
                }
                _mfpTrigger("Resize")
            },
            updateItemHTML: function() {
                var item = mfp.items[mfp.index];
                mfp.contentContainer.detach();
                if (mfp.content) mfp.content.detach();
                if (!item.parsed) {
                    item = mfp.parseEl(mfp.index)
                }
                var type = item.type;
                _mfpTrigger("BeforeChange", [mfp.currItem ? mfp.currItem.type : "", type]);
                mfp.currItem = item;
                if (!mfp.currTemplate[type]) {
                    var markup = mfp.st[type] ? mfp.st[type].markup : false;
                    _mfpTrigger("FirstMarkupParse", markup);
                    if (markup) {
                        mfp.currTemplate[type] = $(markup)
                    } else {
                        mfp.currTemplate[type] = true
                    }
                }
                if (_prevContentType && _prevContentType !== item.type) {
                    mfp.container.removeClass("mfp-" + _prevContentType + "-holder")
                }
                var newContent = mfp["get" + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
                mfp.appendContent(newContent, type);
                item.preloaded = true;
                _mfpTrigger(CHANGE_EVENT, item);
                _prevContentType = item.type;
                mfp.container.prepend(mfp.contentContainer);
                _mfpTrigger("AfterChange")
            },
            appendContent: function(newContent, type) {
                mfp.content = newContent;
                if (newContent) {
                    if (mfp.st.showCloseBtn && mfp.st.closeBtnInside && mfp.currTemplate[type] === true) {
                        if (!mfp.content.find(".mfp-close").length) {
                            mfp.content.append(_getCloseBtn())
                        }
                    } else {
                        mfp.content = newContent
                    }
                } else {
                    mfp.content = ""
                }
                _mfpTrigger(BEFORE_APPEND_EVENT);
                mfp.container.addClass("mfp-" + type + "-holder");
                mfp.contentContainer.append(mfp.content)
            },
            parseEl: function(index) {
                var item = mfp.items[index],
                    type = item.type;
                if (item.tagName) {
                    item = {
                        el: $(item)
                    }
                } else {
                    item = {
                        data: item,
                        src: item.src
                    }
                }
                if (item.el) {
                    var types = mfp.types;
                    for (var i = 0; i < types.length; i++) {
                        if (item.el.hasClass("mfp-" + types[i])) {
                            type = types[i];
                            break
                        }
                    }
                    item.src = item.el.attr("data-mfp-src");
                    if (!item.src) {
                        item.src = item.el.attr("href")
                    }
                }
                item.type = type || mfp.st.type || "inline";
                item.index = index;
                item.parsed = true;
                mfp.items[index] = item;
                _mfpTrigger("ElementParse", item);
                return mfp.items[index]
            },
            addGroup: function(el, options) {
                var eHandler = function(e) {
                    e.mfpEl = this;
                    mfp._openClick(e, el, options)
                };
                if (!options) {
                    options = {}
                }
                var eName = "click.magnificPopup";
                options.mainEl = el;
                if (options.items) {
                    options.isObj = true;
                    el.off(eName).on(eName, eHandler)
                } else {
                    options.isObj = false;
                    if (options.delegate) {
                        el.off(eName).on(eName, options.delegate, eHandler)
                    } else {
                        options.items = el;
                        el.off(eName).on(eName, eHandler)
                    }
                }
            },
            _openClick: function(e, el, options) {
                var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
                if (!midClick && (e.which === 2 || e.ctrlKey || e.metaKey)) {
                    return
                }
                var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
                if (disableOn) {
                    if ($.isFunction(disableOn)) {
                        if (!disableOn.call(mfp)) {
                            return true
                        }
                    } else {
                        if (_window.width() < disableOn) {
                            return true
                        }
                    }
                }
                if (e.type) {
                    e.preventDefault();
                    if (mfp.isOpen) {
                        e.stopPropagation()
                    }
                }
                options.el = $(e.mfpEl);
                if (options.delegate) {
                    options.items = el.find(options.delegate)
                }
                mfp.open(options)
            },
            updateStatus: function(status, text) {
                if (mfp.preloader) {
                    if (_prevStatus !== status) {
                        mfp.container.removeClass("mfp-s-" + _prevStatus)
                    }
                    if (!text && status === "loading") {
                        text = mfp.st.tLoading
                    }
                    var data = {
                        status: status,
                        text: text
                    };
                    _mfpTrigger("UpdateStatus", data);
                    status = data.status;
                    text = data.text;
                    mfp.preloader.html(text);
                    mfp.preloader.find("a").on("click", function(e) {
                        e.stopImmediatePropagation()
                    });
                    mfp.container.addClass("mfp-s-" + status);
                    _prevStatus = status
                }
            },
            _addClassToMFP: function(cName) {
                mfp.bgOverlay.addClass(cName);
                mfp.wrap.addClass(cName)
            },
            _removeClassFromMFP: function(cName) {
                this.bgOverlay.removeClass(cName);
                mfp.wrap.removeClass(cName)
            },
            _hasScrollBar: function(winHeight) {
                return (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height())
            },
            _parseMarkup: function(template, values, item) {
                var arr;
                if (item.data) {
                    values = $.extend(item.data, values)
                }
                _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item]);
                $.each(values, function(key, value) {
                    if (value === undefined || value === false) {
                        return true
                    }
                    arr = key.split("_");
                    if (arr.length > 1) {
                        var el = template.find(EVENT_NS + "-" + arr[0]);
                        if (el.length > 0) {
                            var attr = arr[1];
                            if (attr === "replaceWith") {
                                if (el[0] !== value[0]) {
                                    el.replaceWith(value)
                                }
                            } else if (attr === "img") {
                                if (el.is("img")) {
                                    el.attr("src", value)
                                } else {
                                    el.replaceWith('<img src="' + value + '" class="' + el.attr("class") + '" />')
                                }
                            } else {
                                el.attr(arr[1], value)
                            }
                        }
                    } else {
                        template.find(EVENT_NS + "-" + key).html(value)
                    }
                })
            },
            _getScrollbarSize: function() {
                if (mfp.scrollbarSize === undefined) {
                    var scrollDiv = document.createElement("div");
                    scrollDiv.id = "mfp-sbm";
                    scrollDiv.style.cssText = "width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;";
                    document.body.appendChild(scrollDiv);
                    mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
                    document.body.removeChild(scrollDiv)
                }
                return mfp.scrollbarSize
            }
        };
        $.magnificPopup = {
            instance: null,
            proto: MagnificPopup.prototype,
            modules: [],
            open: function(options, index) {
                _checkInstance();
                if (!options) options = {};
                options.isObj = true;
                options.index = index || 0;
                return this.instance.open(options)
            },
            close: function() {
                return $.magnificPopup.instance.close()
            },
            registerModule: function(name, module) {
                if (module.options) {
                    $.magnificPopup.defaults[name] = module.options
                }
                $.extend(this.proto, module.proto);
                this.modules.push(name)
            },
            defaults: {
                disableOn: 0,
                key: null,
                midClick: false,
                mainClass: "",
                preloader: true,
                focus: "",
                closeOnContentClick: false,
                closeOnBgClick: true,
                closeBtnInside: true,
                showCloseBtn: true,
                enableEscapeKey: true,
                modal: false,
                alignTop: false,
                removalDelay: 0,
                fixedContentPos: "auto",
                fixedBgPos: "auto",
                overflowY: "auto",
                closeMarkup: '<button title="%title%" type="button" class="mfp-close">&times;</button>',
                tClose: "Close (Esc)",
                tLoading: "Loading..."
            }
        };
        $.fn.magnificPopup = function(options) {
            _checkInstance();
            var jqEl = $(this);
            if (typeof options === "string") {
                if (options === "open") {
                    var items, itemOpts = _isJQ ? jqEl.data("magnificPopup") : jqEl[0].magnificPopup,
                        index = parseInt(arguments[1], 10) || 0;
                    if (itemOpts.items) {
                        items = itemOpts.items[index]
                    } else {
                        items = jqEl;
                        if (itemOpts.delegate) {
                            items = items.find(itemOpts.delegate)
                        }
                        items = items.eq(index)
                    }
                    mfp._openClick({
                        mfpEl: items
                    }, jqEl, itemOpts)
                } else {
                    if (mfp.isOpen) mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1))
                }
            } else {
                if (_isJQ) {
                    jqEl.data("magnificPopup", options)
                } else {
                    jqEl[0].magnificPopup = options
                }
                mfp.addGroup(jqEl, options)
            }
            return jqEl
        };
        var INLINE_NS = "inline",
            _hiddenClass, _inlinePlaceholder, _lastInlineElement, _putInlineElementsBack = function() {
                if (_lastInlineElement) {
                    _inlinePlaceholder.after(_lastInlineElement.addClass(_hiddenClass)).detach();
                    _lastInlineElement = null
                }
            };
        $.magnificPopup.registerModule(INLINE_NS, {
            options: {
                hiddenClass: "hide",
                markup: "",
                tNotFound: "Content not found"
            },
            proto: {
                initInline: function() {
                    mfp.types.push(INLINE_NS);
                    _mfpOn(CLOSE_EVENT + "." + INLINE_NS, function() {
                        _putInlineElementsBack()
                    })
                },
                getInline: function(item, template) {
                    _putInlineElementsBack();
                    if (item.src) {
                        var inlineSt = mfp.st.inline,
                            el = $(item.src);
                        if (el.length) {
                            var parent = el[0].parentNode;
                            if (parent && parent.tagName) {
                                if (!_inlinePlaceholder) {
                                    _hiddenClass = inlineSt.hiddenClass;
                                    _inlinePlaceholder = _getEl(_hiddenClass);
                                    _hiddenClass = "mfp-" + _hiddenClass
                                }
                                _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass)
                            }
                            mfp.updateStatus("ready")
                        } else {
                            mfp.updateStatus("error", inlineSt.tNotFound);
                            el = $("<div>")
                        }
                        item.inlineElement = el;
                        return el
                    }
                    mfp.updateStatus("ready");
                    mfp._parseMarkup(template, {}, item);
                    return template
                }
            }
        });
        var AJAX_NS = "ajax",
            _ajaxCur, _removeAjaxCursor = function() {
                if (_ajaxCur) {
                    _body.removeClass(_ajaxCur)
                }
            };
        $.magnificPopup.registerModule(AJAX_NS, {
            options: {
                settings: null,
                cursor: "mfp-ajax-cur",
                tError: '<a href="%url%">The content</a> could not be loaded.'
            },
            proto: {
                initAjax: function() {
                    mfp.types.push(AJAX_NS);
                    _ajaxCur = mfp.st.ajax.cursor;
                    _mfpOn(CLOSE_EVENT + "." + AJAX_NS, function() {
                        _removeAjaxCursor();
                        if (mfp.req) {
                            mfp.req.abort()
                        }
                    })
                },
                getAjax: function(item) {
                    if (_ajaxCur) _body.addClass(_ajaxCur);
                    mfp.updateStatus("loading");
                    var opts = $.extend({
                        url: item.src,
                        success: function(data, textStatus, jqXHR) {
                            var temp = {
                                data: data,
                                xhr: jqXHR
                            };
                            _mfpTrigger("ParseAjax", temp);
                            mfp.appendContent($(temp.data), AJAX_NS);
                            item.finished = true;
                            _removeAjaxCursor();
                            _setFocus();
                            setTimeout(function() {
                                mfp.wrap.addClass(READY_CLASS)
                            }, 16);
                            mfp.updateStatus("ready");
                            _mfpTrigger("AjaxContentAdded")
                        },
                        error: function() {
                            _removeAjaxCursor();
                            item.finished = item.loadError = true;
                            mfp.updateStatus("error", mfp.st.ajax.tError.replace("%url%", item.src))
                        }
                    }, mfp.st.ajax.settings);
                    mfp.req = $.ajax(opts);
                    return ""
                }
            }
        });
        var _imgInterval, _getTitle = function(item) {
            if (item.data && item.data.title !== undefined) return item.data.title;
            var src = mfp.st.image.titleSrc;
            if (src) {
                if ($.isFunction(src)) {
                    return src.call(mfp, item)
                } else if (item.el) {
                    return item.el.attr(src) || ""
                }
            }
            return ""
        };
        $.magnificPopup.registerModule("image", {
            options: {
                markup: '<div class="mfp-figure">' + '<div class="mfp-close"></div>' + '<div class="mfp-img"></div>' + '<div class="mfp-bottom-bar">' + '<div class="mfp-title"></div>' + '<div class="mfp-counter"></div>' + "</div>" + "</div>",
                cursor: "mfp-zoom-out-cur",
                titleSrc: "title",
                verticalFit: true,
                tError: '<a href="%url%">The image</a> could not be loaded.'
            },
            proto: {
                initImage: function() {
                    var imgSt = mfp.st.image,
                        ns = ".image";
                    mfp.types.push("image");
                    _mfpOn(OPEN_EVENT + ns, function() {
                        if (mfp.currItem.type === "image" && imgSt.cursor) {
                            _body.addClass(imgSt.cursor)
                        }
                    });
                    _mfpOn(CLOSE_EVENT + ns, function() {
                        if (imgSt.cursor) {
                            _body.removeClass(imgSt.cursor)
                        }
                        _window.off("resize" + EVENT_NS)
                    });
                    _mfpOn("Resize" + ns, mfp.resizeImage);
                    if (mfp.isLowIE) {
                        _mfpOn("AfterChange", mfp.resizeImage)
                    }
                },
                resizeImage: function() {
                    var item = mfp.currItem;
                    if (!item.img) return;
                    if (mfp.st.image.verticalFit) {
                        var decr = 0;
                        if (mfp.isLowIE) {
                            decr = parseInt(item.img.css("padding-top"), 10) + parseInt(item.img.css("padding-bottom"), 10)
                        }
                        item.img.css("max-height", mfp.wH - decr)
                    }
                },
                _onImageHasSize: function(item) {
                    if (item.img) {
                        item.hasSize = true;
                        if (_imgInterval) {
                            clearInterval(_imgInterval)
                        }
                        item.isCheckingImgSize = false;
                        _mfpTrigger("ImageHasSize", item);
                        if (item.imgHidden) {
                            if (mfp.content) mfp.content.removeClass("mfp-loading");
                            item.imgHidden = false
                        }
                    }
                },
                findImageSize: function(item) {
                    var counter = 0,
                        img = item.img[0],
                        mfpSetInterval = function(delay) {
                            if (_imgInterval) {
                                clearInterval(_imgInterval)
                            }
                            _imgInterval = setInterval(function() {
                                if (img.naturalWidth > 0) {
                                    mfp._onImageHasSize(item);
                                    return
                                }
                                if (counter > 200) {
                                    clearInterval(_imgInterval)
                                }
                                counter++;
                                if (counter === 3) {
                                    mfpSetInterval(10)
                                } else if (counter === 40) {
                                    mfpSetInterval(50)
                                } else if (counter === 100) {
                                    mfpSetInterval(500)
                                }
                            }, delay)
                        };
                    mfpSetInterval(1)
                },
                getImage: function(item, template) {
                    var guard = 0,
                        onLoadComplete = function() {
                            if (item) {
                                if (item.img[0].complete) {
                                    item.img.off(".mfploader");
                                    if (item === mfp.currItem) {
                                        mfp._onImageHasSize(item);
                                        mfp.updateStatus("ready")
                                    }
                                    item.hasSize = true;
                                    item.loaded = true;
                                    _mfpTrigger("ImageLoadComplete")
                                } else {
                                    guard++;
                                    if (guard < 200) {
                                        setTimeout(onLoadComplete, 100)
                                    } else {
                                        onLoadError()
                                    }
                                }
                            }
                        },
                        onLoadError = function() {
                            if (item) {
                                item.img.off(".mfploader");
                                if (item === mfp.currItem) {
                                    mfp._onImageHasSize(item);
                                    mfp.updateStatus("error", imgSt.tError.replace("%url%", item.src))
                                }
                                item.hasSize = true;
                                item.loaded = true;
                                item.loadError = true
                            }
                        },
                        imgSt = mfp.st.image;
                    var el = template.find(".mfp-img");
                    if (el.length) {
                        var img = new Image;
                        img.className = "mfp-img";
                        item.img = $(img).on("load.mfploader", onLoadComplete).on("error.mfploader", onLoadError);
                        img.src = item.src;
                        if (el.is("img")) {
                            item.img = item.img.clone()
                        }
                        if (item.img[0].naturalWidth > 0) {
                            item.hasSize = true
                        }
                    }
                    mfp._parseMarkup(template, {
                        title: _getTitle(item),
                        img_replaceWith: item.img
                    }, item);
                    mfp.resizeImage();
                    if (item.hasSize) {
                        if (_imgInterval) clearInterval(_imgInterval);
                        if (item.loadError) {
                            template.addClass("mfp-loading");
                            mfp.updateStatus("error", imgSt.tError.replace("%url%", item.src))
                        } else {
                            template.removeClass("mfp-loading");
                            mfp.updateStatus("ready")
                        }
                        return template
                    }
                    mfp.updateStatus("loading");
                    item.loading = true;
                    if (!item.hasSize) {
                        item.imgHidden = true;
                        template.addClass("mfp-loading");
                        mfp.findImageSize(item)
                    }
                    return template
                }
            }
        });
        var hasMozTransform, getHasMozTransform = function() {
            if (hasMozTransform === undefined) {
                hasMozTransform = document.createElement("p").style.MozTransform !== undefined
            }
            return hasMozTransform
        };
        $.magnificPopup.registerModule("zoom", {
            options: {
                enabled: false,
                easing: "ease-in-out",
                duration: 300,
                opener: function(element) {
                    return element.is("img") ? element : element.find("img")
                }
            },
            proto: {
                initZoom: function() {
                    var zoomSt = mfp.st.zoom,
                        ns = ".zoom";
                    if (!zoomSt.enabled || !mfp.supportsTransition) {
                        return
                    }
                    var duration = zoomSt.duration,
                        getElToAnimate = function(image) {
                            var newImg = image.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),
                                transition = "all " + zoomSt.duration / 1e3 + "s " + zoomSt.easing,
                                cssObj = {
                                    position: "fixed",
                                    zIndex: 9999,
                                    left: 0,
                                    top: 0,
                                    "-webkit-backface-visibility": "hidden"
                                },
                                t = "transition";
                            cssObj["-webkit-" + t] = cssObj["-moz-" + t] = cssObj["-o-" + t] = cssObj[t] = transition;
                            newImg.css(cssObj);
                            return newImg
                        },
                        showMainContent = function() {
                            mfp.content.css("visibility", "visible")
                        },
                        openTimeout, animatedImg;
                    _mfpOn("BuildControls" + ns, function() {
                        if (mfp._allowZoom()) {
                            clearTimeout(openTimeout);
                            mfp.content.css("visibility", "hidden");
                            image = mfp._getItemToZoom();
                            if (!image) {
                                showMainContent();
                                return
                            }
                            animatedImg = getElToAnimate(image);
                            animatedImg.css(mfp._getOffset());
                            mfp.wrap.append(animatedImg);
                            openTimeout = setTimeout(function() {
                                animatedImg.css(mfp._getOffset(true));
                                openTimeout = setTimeout(function() {
                                    showMainContent();
                                    setTimeout(function() {
                                        animatedImg.remove();
                                        image = animatedImg = null;
                                        _mfpTrigger("ZoomAnimationEnded")
                                    }, 16)
                                }, duration)
                            }, 16)
                        }
                    });
                    _mfpOn(BEFORE_CLOSE_EVENT + ns, function() {
                        if (mfp._allowZoom()) {
                            clearTimeout(openTimeout);
                            mfp.st.removalDelay = duration;
                            if (!image) {
                                image = mfp._getItemToZoom();
                                if (!image) {
                                    return
                                }
                                animatedImg = getElToAnimate(image)
                            }
                            animatedImg.css(mfp._getOffset(true));
                            mfp.wrap.append(animatedImg);
                            mfp.content.css("visibility", "hidden");
                            setTimeout(function() {
                                animatedImg.css(mfp._getOffset())
                            }, 16)
                        }
                    });
                    _mfpOn(CLOSE_EVENT + ns, function() {
                        if (mfp._allowZoom()) {
                            showMainContent();
                            if (animatedImg) {
                                animatedImg.remove()
                            }
                        }
                    })
                },
                _allowZoom: function() {
                    return mfp.currItem.type === "image"
                },
                _getItemToZoom: function() {
                    if (mfp.currItem.hasSize) {
                        return mfp.currItem.img
                    } else {
                        return false
                    }
                },
                _getOffset: function(isLarge) {
                    var el;
                    if (isLarge) {
                        el = mfp.currItem.img
                    } else {
                        el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem)
                    }
                    var offset = el.offset();
                    var paddingTop = parseInt(el.css("padding-top"), 10);
                    var paddingBottom = parseInt(el.css("padding-bottom"), 10);
                    offset.top -= $(window).scrollTop() - paddingTop;
                    var obj = {
                        width: el.width(),
                        height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
                    };
                    if (getHasMozTransform()) {
                        obj["-moz-transform"] = obj["transform"] = "translate(" + offset.left + "px," + offset.top + "px)"
                    } else {
                        obj.left = offset.left;
                        obj.top = offset.top
                    }
                    return obj
                }
            }
        });
        var IFRAME_NS = "iframe",
            _emptyPage = "//about:blank",
            _fixIframeBugs = function(isShowing) {
                if (mfp.currTemplate[IFRAME_NS]) {
                    var el = mfp.currTemplate[IFRAME_NS].find("iframe");
                    if (el.length) {
                        if (!isShowing) {
                            el[0].src = _emptyPage
                        }
                        if (mfp.isIE8) {
                            el.css("display", isShowing ? "block" : "none")
                        }
                    }
                }
            };
        $.magnificPopup.registerModule(IFRAME_NS, {
            options: {
                markup: '<div class="mfp-iframe-scaler">' + '<div class="mfp-close"></div>' + '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>' + "</div>",
                srcAction: "iframe_src",
                patterns: {
                    youtube: {
                        index: "youtube.com",
                        id: "v=",
                        src: "//www.youtube.com/embed/%id%?autoplay=1"
                    },
                    vimeo: {
                        index: "vimeo.com/",
                        id: "/",
                        src: "//player.vimeo.com/video/%id%?autoplay=1"
                    },
                    gmaps: {
                        index: "//maps.google.",
                        src: "%id%&output=embed"
                    }
                }
            },
            proto: {
                initIframe: function() {
                    mfp.types.push(IFRAME_NS);
                    _mfpOn("BeforeChange", function(e, prevType, newType) {
                        if (prevType !== newType) {
                            if (prevType === IFRAME_NS) {
                                _fixIframeBugs()
                            } else if (newType === IFRAME_NS) {
                                _fixIframeBugs(true)
                            }
                        }
                    });
                    _mfpOn(CLOSE_EVENT + "." + IFRAME_NS, function() {
                        _fixIframeBugs()
                    })
                },
                getIframe: function(item, template) {
                    var embedSrc = item.src;
                    var iframeSt = mfp.st.iframe;
                    $.each(iframeSt.patterns, function() {
                        if (embedSrc.indexOf(this.index) > -1) {
                            if (this.id) {
                                if (typeof this.id === "string") {
                                    embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id) + this.id.length, embedSrc.length)
                                } else {
                                    embedSrc = this.id.call(this, embedSrc)
                                }
                            }
                            embedSrc = this.src.replace("%id%", embedSrc);
                            return false
                        }
                    });
                    var dataObj = {};
                    if (iframeSt.srcAction) {
                        dataObj[iframeSt.srcAction] = embedSrc
                    }
                    mfp._parseMarkup(template, dataObj, item);
                    mfp.updateStatus("ready");
                    return template
                }
            }
        });
        var _getLoopedId = function(index) {
                var numSlides = mfp.items.length;
                if (index > numSlides - 1) {
                    return index - numSlides
                } else if (index < 0) {
                    return numSlides + index
                }
                return index
            },
            _replaceCurrTotal = function(text, curr, total) {
                return text.replace("%curr%", curr + 1).replace("%total%", total)
            };
        $.magnificPopup.registerModule("gallery", {
            options: {
                enabled: false,
                arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
                preload: [0, 2],
                navigateByImgClick: true,
                arrows: true,
                tPrev: "Previous (Left arrow key)",
                tNext: "Next (Right arrow key)",
                tCounter: "%curr% of %total%"
            },
            proto: {
                initGallery: function() {
                    var gSt = mfp.st.gallery,
                        ns = ".mfp-gallery",
                        supportsFastClick = Boolean($.fn.mfpFastClick);
                    mfp.direction = true;
                    if (!gSt || !gSt.enabled) return false;
                    _wrapClasses += " mfp-gallery";
                    _mfpOn(OPEN_EVENT + ns, function() {
                        if (gSt.navigateByImgClick) {
                            mfp.wrap.on("click" + ns, ".mfp-img", function() {
                                if (mfp.items.length > 1) {
                                    mfp.next();
                                    return false
                                }
                            })
                        }
                        _document.on("keydown" + ns, function(e) {
                            if (e.keyCode === 37) {
                                mfp.prev()
                            } else if (e.keyCode === 39) {
                                mfp.next()
                            }
                        })
                    });
                    _mfpOn("UpdateStatus" + ns, function(e, data) {
                        if (data.text) {
                            data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length)
                        }
                    });
                    _mfpOn(MARKUP_PARSE_EVENT + ns, function(e, element, values, item) {
                        var l = mfp.items.length;
                        values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ""
                    });
                    _mfpOn("BuildControls" + ns, function() {
                        if (mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
                            var markup = gSt.arrowMarkup,
                                arrowLeft = mfp.arrowLeft = $(markup.replace("%title%", gSt.tPrev).replace("%dir%", "left")).addClass(PREVENT_CLOSE_CLASS),
                                arrowRight = mfp.arrowRight = $(markup.replace("%title%", gSt.tNext).replace("%dir%", "right")).addClass(PREVENT_CLOSE_CLASS);
                            var eName = supportsFastClick ? "mfpFastClick" : "click";
                            arrowLeft[eName](function() {
                                mfp.prev()
                            });
                            arrowRight[eName](function() {
                                mfp.next()
                            });
                            if (mfp.isIE7) {
                                _getEl("b", arrowLeft[0], false, true);
                                _getEl("a", arrowLeft[0], false, true);
                                _getEl("b", arrowRight[0], false, true);
                                _getEl("a", arrowRight[0], false, true)
                            }
                            mfp.container.append(arrowLeft.add(arrowRight))
                        }
                    });
                    _mfpOn(CHANGE_EVENT + ns, function() {
                        if (mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
                        mfp._preloadTimeout = setTimeout(function() {
                            mfp.preloadNearbyImages();
                            mfp._preloadTimeout = null
                        }, 16)
                    });
                    _mfpOn(CLOSE_EVENT + ns, function() {
                        _document.off(ns);
                        mfp.wrap.off("click" + ns);
                        if (mfp.arrowLeft && supportsFastClick) {
                            mfp.arrowLeft.add(mfp.arrowRight).destroyMfpFastClick()
                        }
                        mfp.arrowRight = mfp.arrowLeft = null
                    })
                },
                next: function() {
                    mfp.direction = true;
                    mfp.index = _getLoopedId(mfp.index + 1);
                    mfp.updateItemHTML()
                },
                prev: function() {
                    mfp.direction = false;
                    mfp.index = _getLoopedId(mfp.index - 1);
                    mfp.updateItemHTML()
                },
                goTo: function(newIndex) {
                    mfp.direction = newIndex >= mfp.index;
                    mfp.index = newIndex;
                    mfp.updateItemHTML()
                },
                preloadNearbyImages: function() {
                    var p = mfp.st.gallery.preload,
                        preloadBefore = Math.min(p[0], mfp.items.length),
                        preloadAfter = Math.min(p[1], mfp.items.length),
                        i;
                    for (i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
                        mfp._preloadItem(mfp.index + i)
                    }
                    for (i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
                        mfp._preloadItem(mfp.index - i)
                    }
                },
                _preloadItem: function(index) {
                    index = _getLoopedId(index);
                    if (mfp.items[index].preloaded) {
                        return
                    }
                    var item = mfp.items[index];
                    if (!item.parsed) {
                        item = mfp.parseEl(index)
                    }
                    _mfpTrigger("LazyLoad", item);
                    if (item.type === "image") {
                        item.img = $('<img class="mfp-img" />').on("load.mfploader", function() {
                            item.hasSize = true
                        }).on("error.mfploader", function() {
                            item.hasSize = true;
                            item.loadError = true;
                            _mfpTrigger("LazyLoadError", item)
                        }).attr("src", item.src)
                    }
                    item.preloaded = true
                }
            }
        });
        var RETINA_NS = "retina";
        $.magnificPopup.registerModule(RETINA_NS, {
            options: {
                replaceSrc: function(item) {
                    return item.src.replace(/\.\w+$/, function(m) {
                        return "@2x" + m
                    })
                },
                ratio: 1
            },
            proto: {
                initRetina: function() {
                    if (window.devicePixelRatio > 1) {
                        var st = mfp.st.retina,
                            ratio = st.ratio;
                        ratio = !isNaN(ratio) ? ratio : ratio();
                        if (ratio > 1) {
                            _mfpOn("ImageHasSize" + "." + RETINA_NS, function(e, item) {
                                item.img.css({
                                    "max-width": item.img[0].naturalWidth / ratio,
                                    width: "100%"
                                })
                            });
                            _mfpOn("ElementParse" + "." + RETINA_NS, function(e, item) {
                                item.src = st.replaceSrc(item, ratio)
                            })
                        }
                    }
                }
            }
        });
        (function() {
            var ghostClickDelay = 1e3,
                supportsTouch = "ontouchstart" in window,
                unbindTouchMove = function() {
                    _window.off("touchmove" + ns + " touchend" + ns)
                },
                eName = "mfpFastClick",
                ns = "." + eName;
            $.fn.mfpFastClick = function(callback) {
                return $(this).each(function() {
                    var elem = $(this),
                        lock;
                    if (supportsTouch) {
                        var timeout, startX, startY, pointerMoved, point, numPointers;
                        elem.on("touchstart" + ns, function(e) {
                            pointerMoved = false;
                            numPointers = 1;
                            point = e.originalEvent ? e.originalEvent.touches[0] : e.touches[0];
                            startX = point.clientX;
                            startY = point.clientY;
                            _window.on("touchmove" + ns, function(e) {
                                point = e.originalEvent ? e.originalEvent.touches : e.touches;
                                numPointers = point.length;
                                point = point[0];
                                if (Math.abs(point.clientX - startX) > 10 || Math.abs(point.clientY - startY) > 10) {
                                    pointerMoved = true;
                                    unbindTouchMove()
                                }
                            }).on("touchend" + ns, function(e) {
                                unbindTouchMove();
                                if (pointerMoved || numPointers > 1) {
                                    return
                                }
                                lock = true;
                                e.preventDefault();
                                clearTimeout(timeout);
                                timeout = setTimeout(function() {
                                    lock = false
                                }, ghostClickDelay);
                                callback()
                            })
                        })
                    }
                    elem.on("click" + ns, function() {
                        if (!lock) {
                            callback()
                        }
                    })
                })
            };
            $.fn.destroyMfpFastClick = function() {
                $(this).off("touchstart" + ns + " click" + ns);
                if (supportsTouch) _window.off("touchmove" + ns + " touchend" + ns)
            }
        })();
        if (typeof module === "object" && typeof module.exports === "object") {
            module.exports = MagnificPopup
        }
    })(window.jQuery || window.Zepto);
    setTimeout(function() {
        delete window.jQuery
    }, 0);
    return jQuery
});
define("jquery.smoothscroll", ["jquery"], function(jQuery) {
    (function($) {
        var version = "1.4.13",
            optionOverrides = {},
            defaults = {
                exclude: [],
                excludeWithin: [],
                offset: 0,
                direction: "top",
                scrollElement: null,
                scrollTarget: null,
                beforeScroll: function() {},
                afterScroll: function() {},
                easing: "swing",
                speed: 400,
                autoCoefficent: 2,
                preventDefault: true
            },
            getScrollable = function(opts) {
                var scrollable = [],
                    scrolled = false,
                    dir = opts.dir && opts.dir == "left" ? "scrollLeft" : "scrollTop";
                this.each(function() {
                    if (this == document || this == window) {
                        return
                    }
                    var el = $(this);
                    if (el[dir]() > 0) {
                        scrollable.push(this)
                    } else {
                        el[dir](1);
                        scrolled = el[dir]() > 0;
                        if (scrolled) {
                            scrollable.push(this)
                        }
                        el[dir](0)
                    }
                });
                if (!scrollable.length) {
                    this.each(function(index) {
                        if (this.nodeName === "BODY") {
                            scrollable = [this]
                        }
                    })
                }
                if (opts.el === "first" && scrollable.length > 1) {
                    scrollable = [scrollable[0]]
                }
                return scrollable
            },
            isTouch = "ontouchend" in document;
        $.fn.extend({
            scrollable: function(dir) {
                var scrl = getScrollable.call(this, {
                    dir: dir
                });
                return this.pushStack(scrl)
            },
            firstScrollable: function(dir) {
                var scrl = getScrollable.call(this, {
                    el: "first",
                    dir: dir
                });
                return this.pushStack(scrl)
            },
            smoothScroll: function(options, extra) {
                options = options || {};
                if (options === "options") {
                    if (!extra) {
                        return this.first().data("ssOpts")
                    }
                    return this.each(function() {
                        var $this = $(this),
                            opts = $.extend($this.data("ssOpts") || {}, extra);
                        $(this).data("ssOpts", opts)
                    })
                }
                var opts = $.extend({}, $.fn.smoothScroll.defaults, options),
                    locationPath = $.smoothScroll.filterPath(location.pathname);
                this.unbind("click.smoothscroll").bind("click.smoothscroll", function(event) {
                    var link = this,
                        $link = $(this),
                        thisOpts = $.extend({}, opts, $link.data("ssOpts") || {}),
                        exclude = opts.exclude,
                        excludeWithin = thisOpts.excludeWithin,
                        elCounter = 0,
                        ewlCounter = 0,
                        include = true,
                        clickOpts = {},
                        hostMatch = location.hostname === link.hostname || !link.hostname,
                        pathMatch = thisOpts.scrollTarget || ($.smoothScroll.filterPath(link.pathname) || locationPath) === locationPath,
                        thisHash = escapeSelector(link.hash);
                    if (!thisOpts.scrollTarget && (!hostMatch || !pathMatch || !thisHash)) {
                        include = false
                    } else {
                        while (include && elCounter < exclude.length) {
                            if ($link.is(escapeSelector(exclude[elCounter++]))) {
                                include = false
                            }
                        }
                        while (include && ewlCounter < excludeWithin.length) {
                            if ($link.closest(excludeWithin[ewlCounter++]).length) {
                                include = false
                            }
                        }
                    }
                    if (include) {
                        if (thisOpts.preventDefault) {
                            event.preventDefault()
                        }
                        $.extend(clickOpts, thisOpts, {
                            scrollTarget: thisOpts.scrollTarget || thisHash,
                            link: link
                        });
                        $.smoothScroll(clickOpts)
                    }
                });
                return this
            }
        });
        $.smoothScroll = function(options, px) {
            if (options === "options" && typeof px === "object") {
                return $.extend(optionOverrides, px)
            }
            var opts, $scroller, scrollTargetOffset, speed, scrollerOffset = 0,
                offPos = "offset",
                scrollDir = "scrollTop",
                aniProps = {},
                aniOpts = {},
                scrollprops = [];
            if (typeof options === "number") {
                opts = $.extend({
                    link: null
                }, $.fn.smoothScroll.defaults, optionOverrides);
                scrollTargetOffset = options
            } else {
                opts = $.extend({
                    link: null
                }, $.fn.smoothScroll.defaults, options || {}, optionOverrides);
                if (opts.scrollElement) {
                    offPos = "position";
                    if (opts.scrollElement.css("position") == "static") {
                        opts.scrollElement.css("position", "relative")
                    }
                }
            }
            scrollDir = opts.direction == "left" ? "scrollLeft" : scrollDir;
            if (opts.scrollElement) {
                $scroller = opts.scrollElement;
                if (!/^(?:HTML|BODY)$/.test($scroller[0].nodeName)) {
                    scrollerOffset = $scroller[scrollDir]()
                }
            } else {
                $scroller = $("html, body").firstScrollable(opts.direction)
            }
            opts.beforeScroll.call($scroller, opts);
            scrollTargetOffset = typeof options === "number" ? options : px || $(opts.scrollTarget)[offPos]() && $(opts.scrollTarget)[offPos]()[opts.direction] || 0;
            aniProps[scrollDir] = scrollTargetOffset + scrollerOffset + opts.offset;
            speed = opts.speed;
            if (speed === "auto") {
                speed = aniProps[scrollDir] || $scroller.scrollTop();
                speed = speed / opts.autoCoefficent
            }
            aniOpts = {
                duration: speed,
                easing: opts.easing,
                complete: function() {
                    opts.afterScroll.call(opts.link, opts)
                }
            };
            if (opts.step) {
                aniOpts.step = opts.step
            }
            if ($scroller.length) {
                $scroller.stop().animate(aniProps, aniOpts)
            } else {
                opts.afterScroll.call(opts.link, opts)
            }
        };
        $.smoothScroll.version = version;
        $.smoothScroll.filterPath = function(string) {
            return string.replace(/^\//, "").replace(/(?:index|default).[a-zA-Z]{3,4}$/, "").replace(/\/$/, "")
        };
        $.fn.smoothScroll.defaults = defaults;

        function escapeSelector(str) {
            return str.replace(/(:|\.)/g, "\\$1")
        }
    })(jQuery);
    return jQuery
});
define("jquery.jstorage", ["jquery"], function(jQuery) {
    window.jQuery = jQuery;
    (function() {
        var JSTORAGE_VERSION = "0.4.8",
            $ = window.jQuery || window.$ || (window.$ = {}),
            JSON = {
                parse: window.JSON && (window.JSON.parse || window.JSON.decode) || String.prototype.evalJSON && function(str) {
                    return String(str).evalJSON()
                } || $.parseJSON || $.evalJSON,
                stringify: Object.toJSON || window.JSON && (window.JSON.stringify || window.JSON.encode) || $.toJSON
            };
        if (!("parse" in JSON) || !("stringify" in JSON)) {
            throw new Error("No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page")
        }
        var _storage = {
                __jstorage_meta: {
                    CRC32: {}
                }
            },
            _storage_service = {
                jStorage: "{}"
            },
            _storage_elm = null,
            _storage_size = 0,
            _backend = false,
            _observers = {},
            _observer_timeout = false,
            _observer_update = 0,
            _pubsub_observers = {},
            _pubsub_last = +new Date,
            _ttl_timeout, _XMLService = {
                isXML: function(elm) {
                    var documentElement = (elm ? elm.ownerDocument || elm : 0).documentElement;
                    return documentElement ? documentElement.nodeName !== "HTML" : false
                },
                encode: function(xmlNode) {
                    if (!this.isXML(xmlNode)) {
                        return false
                    }
                    try {
                        return (new XMLSerializer).serializeToString(xmlNode)
                    } catch (E1) {
                        try {
                            return xmlNode.xml
                        } catch (E2) {}
                    }
                    return false
                },
                decode: function(xmlString) {
                    var dom_parser = "DOMParser" in window && (new DOMParser).parseFromString || window.ActiveXObject && function(_xmlString) {
                            var xml_doc = new ActiveXObject("Microsoft.XMLDOM");
                            xml_doc.async = "false";
                            xml_doc.loadXML(_xmlString);
                            return xml_doc
                        },
                        resultXML;
                    if (!dom_parser) {
                        return false
                    }
                    resultXML = dom_parser.call("DOMParser" in window && new DOMParser || window, xmlString, "text/xml");
                    return this.isXML(resultXML) ? resultXML : false
                }
            };

        function _init() {
            var localStorageReallyWorks = false;
            if ("localStorage" in window) {
                try {
                    window.localStorage.setItem("_tmptest", "tmpval");
                    localStorageReallyWorks = true;
                    window.localStorage.removeItem("_tmptest")
                } catch (BogusQuotaExceededErrorOnIos5) {}
            }
            if (localStorageReallyWorks) {
                try {
                    if (window.localStorage) {
                        _storage_service = window.localStorage;
                        _backend = "localStorage";
                        _observer_update = _storage_service.jStorage_update
                    }
                } catch (E3) {}
            } else if ("globalStorage" in window) {
                try {
                    if (window.globalStorage) {
                        if (window.location.hostname == "localhost") {
                            _storage_service = window.globalStorage["localhost.localdomain"]
                        } else {
                            _storage_service = window.globalStorage[window.location.hostname]
                        }
                        _backend = "globalStorage";
                        _observer_update = _storage_service.jStorage_update
                    }
                } catch (E4) {}
            } else {
                _storage_elm = document.createElement("link");
                if (_storage_elm.addBehavior) {
                    _storage_elm.style.behavior = "url(#default#userData)";
                    document.getElementsByTagName("head")[0].appendChild(_storage_elm);
                    try {
                        _storage_elm.load("jStorage")
                    } catch (E) {
                        _storage_elm.setAttribute("jStorage", "{}");
                        _storage_elm.save("jStorage");
                        _storage_elm.load("jStorage")
                    }
                    var data = "{}";
                    try {
                        data = _storage_elm.getAttribute("jStorage")
                    } catch (E5) {}
                    try {
                        _observer_update = _storage_elm.getAttribute("jStorage_update")
                    } catch (E6) {}
                    _storage_service.jStorage = data;
                    _backend = "userDataBehavior"
                } else {
                    _storage_elm = null;
                    return
                }
            }
            _load_storage();
            _handleTTL();
            _setupObserver();
            _handlePubSub();
            if ("addEventListener" in window) {
                window.addEventListener("pageshow", function(event) {
                    if (event.persisted) {
                        _storageObserver()
                    }
                }, false)
            }
        }

        function _reloadData() {
            var data = "{}";
            if (_backend == "userDataBehavior") {
                _storage_elm.load("jStorage");
                try {
                    data = _storage_elm.getAttribute("jStorage")
                } catch (E5) {}
                try {
                    _observer_update = _storage_elm.getAttribute("jStorage_update")
                } catch (E6) {}
                _storage_service.jStorage = data
            }
            _load_storage();
            _handleTTL();
            _handlePubSub()
        }

        function _setupObserver() {
            if (_backend == "localStorage" || _backend == "globalStorage") {
                if ("addEventListener" in window) {
                    window.addEventListener("storage", _storageObserver, false)
                } else {
                    document.attachEvent("onstorage", _storageObserver)
                }
            } else if (_backend == "userDataBehavior") {
                setInterval(_storageObserver, 1e3)
            }
        }

        function _storageObserver() {
            var updateTime;
            clearTimeout(_observer_timeout);
            _observer_timeout = setTimeout(function() {
                if (_backend == "localStorage" || _backend == "globalStorage") {
                    updateTime = _storage_service.jStorage_update
                } else if (_backend == "userDataBehavior") {
                    _storage_elm.load("jStorage");
                    try {
                        updateTime = _storage_elm.getAttribute("jStorage_update")
                    } catch (E5) {}
                }
                if (updateTime && updateTime != _observer_update) {
                    _observer_update = updateTime;
                    _checkUpdatedKeys()
                }
            }, 25)
        }

        function _checkUpdatedKeys() {
            var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)),
                newCrc32List;
            _reloadData();
            newCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32));
            var key, updated = [],
                removed = [];
            for (key in oldCrc32List) {
                if (oldCrc32List.hasOwnProperty(key)) {
                    if (!newCrc32List[key]) {
                        removed.push(key);
                        continue
                    }
                    if (oldCrc32List[key] != newCrc32List[key] && String(oldCrc32List[key]).substr(0, 2) == "2.") {
                        updated.push(key)
                    }
                }
            }
            for (key in newCrc32List) {
                if (newCrc32List.hasOwnProperty(key)) {
                    if (!oldCrc32List[key]) {
                        updated.push(key)
                    }
                }
            }
            _fireObservers(updated, "updated");
            _fireObservers(removed, "deleted")
        }

        function _fireObservers(keys, action) {
            keys = [].concat(keys || []);
            if (action == "flushed") {
                keys = [];
                for (var key in _observers) {
                    if (_observers.hasOwnProperty(key)) {
                        keys.push(key)
                    }
                }
                action = "deleted"
            }
            for (var i = 0, len = keys.length; i < len; i++) {
                if (_observers[keys[i]]) {
                    for (var j = 0, jlen = _observers[keys[i]].length; j < jlen; j++) {
                        _observers[keys[i]][j](keys[i], action)
                    }
                }
                if (_observers["*"]) {
                    for (var j = 0, jlen = _observers["*"].length; j < jlen; j++) {
                        _observers["*"][j](keys[i], action);
                    }
                }
            }
        }

        function _publishChange() {
            var updateTime = (+new Date).toString();
            if (_backend == "localStorage" || _backend == "globalStorage") {
                try {
                    _storage_service.jStorage_update = updateTime
                } catch (E8) {
                    _backend = false
                }
            } else if (_backend == "userDataBehavior") {
                _storage_elm.setAttribute("jStorage_update", updateTime);
                _storage_elm.save("jStorage")
            }
            _storageObserver()
        }

        function _load_storage() {
            if (_storage_service.jStorage) {
                try {
                    _storage = JSON.parse(String(_storage_service.jStorage))
                } catch (E6) {
                    _storage_service.jStorage = "{}"
                }
            } else {
                _storage_service.jStorage = "{}"
            }
            _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;
            if (!_storage.__jstorage_meta) {
                _storage.__jstorage_meta = {}
            }
            if (!_storage.__jstorage_meta.CRC32) {
                _storage.__jstorage_meta.CRC32 = {}
            }
        }

        function _save() {
            _dropOldEvents();
            try {
                _storage_service.jStorage = JSON.stringify(_storage);
                if (_storage_elm) {
                    _storage_elm.setAttribute("jStorage", _storage_service.jStorage);
                    _storage_elm.save("jStorage")
                }
                _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0
            } catch (E7) {}
        }

        function _checkKey(key) {
            if (typeof key != "string" && typeof key != "number") {
                throw new TypeError("Key name must be string or numeric")
            }
            if (key == "__jstorage_meta") {
                throw new TypeError("Reserved key name")
            }
            return true
        }

        function _handleTTL() {
            var curtime, i, TTL, CRC32, nextExpire = Infinity,
                changed = false,
                deleted = [];
            clearTimeout(_ttl_timeout);
            if (!_storage.__jstorage_meta || typeof _storage.__jstorage_meta.TTL != "object") {
                return
            }
            curtime = +new Date;
            TTL = _storage.__jstorage_meta.TTL;
            CRC32 = _storage.__jstorage_meta.CRC32;
            for (i in TTL) {
                if (TTL.hasOwnProperty(i)) {
                    if (TTL[i] <= curtime) {
                        delete TTL[i];
                        delete CRC32[i];
                        delete _storage[i];
                        changed = true;
                        deleted.push(i)
                    } else if (TTL[i] < nextExpire) {
                        nextExpire = TTL[i]
                    }
                }
            }
            if (nextExpire != Infinity) {
                _ttl_timeout = setTimeout(_handleTTL, nextExpire - curtime)
            }
            if (changed) {
                _save();
                _publishChange();
                _fireObservers(deleted, "deleted")
            }
        }

        function _handlePubSub() {
            var i, len;
            if (!_storage.__jstorage_meta.PubSub) {
                return
            }
            var pubelm, _pubsubCurrent = _pubsub_last;
            for (i = len = _storage.__jstorage_meta.PubSub.length - 1; i >= 0; i--) {
                pubelm = _storage.__jstorage_meta.PubSub[i];
                if (pubelm[0] > _pubsub_last) {
                    _pubsubCurrent = pubelm[0];
                    _fireSubscribers(pubelm[1], pubelm[2])
                }
            }
            _pubsub_last = _pubsubCurrent
        }

        function _fireSubscribers(channel, payload) {
            if (_pubsub_observers[channel]) {
                for (var i = 0, len = _pubsub_observers[channel].length; i < len; i++) {
                    try {
                        _pubsub_observers[channel][i](channel, JSON.parse(JSON.stringify(payload)))
                    } catch (E) {}
                }
            }
        }

        function _dropOldEvents() {
            if (!_storage.__jstorage_meta.PubSub) {
                return
            }
            var retire = +new Date - 2e3;
            for (var i = 0, len = _storage.__jstorage_meta.PubSub.length; i < len; i++) {
                if (_storage.__jstorage_meta.PubSub[i][0] <= retire) {
                    _storage.__jstorage_meta.PubSub.splice(i, _storage.__jstorage_meta.PubSub.length - i);
                    break
                }
            }
            if (!_storage.__jstorage_meta.PubSub.length) {
                delete _storage.__jstorage_meta.PubSub
            }
        }

        function _publish(channel, payload) {
            if (!_storage.__jstorage_meta) {
                _storage.__jstorage_meta = {}
            }
            if (!_storage.__jstorage_meta.PubSub) {
                _storage.__jstorage_meta.PubSub = []
            }
            _storage.__jstorage_meta.PubSub.unshift([+new Date, channel, payload]);
            _save();
            _publishChange()
        }

        function murmurhash2_32_gc(str, seed) {
            var l = str.length,
                h = seed ^ l,
                i = 0,
                k;
            while (l >= 4) {
                k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
                k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
                k ^= k >>> 24;
                k = (k & 65535) * 1540483477 + (((k >>> 16) * 1540483477 & 65535) << 16);
                h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16) ^ k;
                l -= 4;
                ++i
            }
            switch (l) {
                case 3:
                    h ^= (str.charCodeAt(i + 2) & 255) << 16;
                case 2:
                    h ^= (str.charCodeAt(i + 1) & 255) << 8;
                case 1:
                    h ^= str.charCodeAt(i) & 255;
                    h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16)
            }
            h ^= h >>> 13;
            h = (h & 65535) * 1540483477 + (((h >>> 16) * 1540483477 & 65535) << 16);
            h ^= h >>> 15;
            return h >>> 0
        }
        $.jStorage = {
            version: JSTORAGE_VERSION,
            set: function(key, value, options) {
                _checkKey(key);
                options = options || {};
                if (typeof value == "undefined") {
                    this.deleteKey(key);
                    return value
                }
                if (_XMLService.isXML(value)) {
                    value = {
                        _is_xml: true,
                        xml: _XMLService.encode(value)
                    }
                } else if (typeof value == "function") {
                    return undefined
                } else if (value && typeof value == "object") {
                    value = JSON.parse(JSON.stringify(value))
                }
                _storage[key] = value;
                _storage.__jstorage_meta.CRC32[key] = "2." + murmurhash2_32_gc(JSON.stringify(value), 2538058380);
                this.setTTL(key, options.TTL || 0);
                _fireObservers(key, "updated");
                return value
            },
            get: function(key, def) {
                _checkKey(key);
                if (key in _storage) {
                    if (_storage[key] && typeof _storage[key] == "object" && _storage[key]._is_xml) {
                        return _XMLService.decode(_storage[key].xml)
                    } else {
                        return _storage[key]
                    }
                }
                return typeof def == "undefined" ? null : def
            },
            deleteKey: function(key) {
                _checkKey(key);
                if (key in _storage) {
                    delete _storage[key];
                    if (typeof _storage.__jstorage_meta.TTL == "object" && key in _storage.__jstorage_meta.TTL) {
                        delete _storage.__jstorage_meta.TTL[key]
                    }
                    delete _storage.__jstorage_meta.CRC32[key];
                    _save();
                    _publishChange();
                    _fireObservers(key, "deleted");
                    return true
                }
                return false
            },
            setTTL: function(key, ttl) {
                var curtime = +new Date;
                _checkKey(key);
                ttl = Number(ttl) || 0;
                if (key in _storage) {
                    if (!_storage.__jstorage_meta.TTL) {
                        _storage.__jstorage_meta.TTL = {}
                    }
                    if (ttl > 0) {
                        _storage.__jstorage_meta.TTL[key] = curtime + ttl
                    } else {
                        delete _storage.__jstorage_meta.TTL[key]
                    }
                    _save();
                    _handleTTL();
                    _publishChange();
                    return true
                }
                return false
            },
            getTTL: function(key) {
                var curtime = +new Date,
                    ttl;
                _checkKey(key);
                if (key in _storage && _storage.__jstorage_meta.TTL && _storage.__jstorage_meta.TTL[key]) {
                    ttl = _storage.__jstorage_meta.TTL[key] - curtime;
                    return ttl || 0
                }
                return 0
            },
            flush: function() {
                _storage = {
                    __jstorage_meta: {
                        CRC32: {}
                    }
                };
                _save();
                _publishChange();
                _fireObservers(null, "flushed");
                return true
            },
            storageObj: function() {
                function F() {}
                F.prototype = _storage;
                return new F
            },
            index: function() {
                var index = [],
                    i;
                for (i in _storage) {
                    if (_storage.hasOwnProperty(i) && i != "__jstorage_meta") {
                        index.push(i)
                    }
                }
                return index
            },
            storageSize: function() {
                return _storage_size
            },
            currentBackend: function() {
                return _backend
            },
            storageAvailable: function() {
                return !!_backend
            },
            listenKeyChange: function(key, callback) {
                _checkKey(key);
                if (!_observers[key]) {
                    _observers[key] = []
                }
                _observers[key].push(callback)
            },
            stopListening: function(key, callback) {
                _checkKey(key);
                if (!_observers[key]) {
                    return
                }
                if (!callback) {
                    delete _observers[key];
                    return
                }
                for (var i = _observers[key].length - 1; i >= 0; i--) {
                    if (_observers[key][i] == callback) {
                        _observers[key].splice(i, 1)
                    }
                }
            },
            subscribe: function(channel, callback) {
                channel = (channel || "").toString();
                if (!channel) {
                    throw new TypeError("Channel not defined")
                }
                if (!_pubsub_observers[channel]) {
                    _pubsub_observers[channel] = []
                }
                _pubsub_observers[channel].push(callback)
            },
            publish: function(channel, payload) {
                channel = (channel || "").toString();
                if (!channel) {
                    throw new TypeError("Channel not defined")
                }
                _publish(channel, payload)
            },
            reInit: function() {
                _reloadData()
            },
            noConflict: function(saveInGlobal) {
                delete window.$.jStorage;
                if (saveInGlobal) {
                    window.jStorage = this
                }
                return this
            }
        };
        _init()
    })();
    delete window.jQuery;
    return jQuery
});
define("jquery.timepicker", ["jquery"], function(jQuery) {
    (function($) {
        $.ui.timepicker = $.ui.timepicker || {};
        if ($.ui.timepicker.version) {
            return
        }
        $.extend($.ui, {
            timepicker: {
                version: "1.4.3"
            }
        });
        var Timepicker = function() {
            this.regional = [];
            this.regional[""] = {
                currentText: "Now",
                closeText: "Done",
                amNames: ["AM", "A"],
                pmNames: ["PM", "P"],
                timeFormat: "HH:mm",
                timeSuffix: "",
                timeOnlyTitle: "Choose Time",
                timeText: "Time",
                hourText: "Hour",
                minuteText: "Minute",
                secondText: "Second",
                millisecText: "Millisecond",
                microsecText: "Microsecond",
                timezoneText: "Time Zone",
                isRTL: false
            };
            this._defaults = {
                showButtonPanel: true,
                timeOnly: false,
                showHour: null,
                showMinute: null,
                showSecond: null,
                showMillisec: null,
                showMicrosec: null,
                showTimezone: null,
                showTime: true,
                stepHour: 1,
                stepMinute: 1,
                stepSecond: 1,
                stepMillisec: 1,
                stepMicrosec: 1,
                hour: 0,
                minute: 0,
                second: 0,
                millisec: 0,
                microsec: 0,
                timezone: null,
                hourMin: 0,
                minuteMin: 0,
                secondMin: 0,
                millisecMin: 0,
                microsecMin: 0,
                hourMax: 23,
                minuteMax: 59,
                secondMax: 59,
                millisecMax: 999,
                microsecMax: 999,
                minDateTime: null,
                maxDateTime: null,
                onSelect: null,
                hourGrid: 0,
                minuteGrid: 0,
                secondGrid: 0,
                millisecGrid: 0,
                microsecGrid: 0,
                alwaysSetTime: true,
                separator: " ",
                altFieldTimeOnly: true,
                altTimeFormat: null,
                altSeparator: null,
                altTimeSuffix: null,
                pickerTimeFormat: null,
                pickerTimeSuffix: null,
                showTimepicker: true,
                timezoneList: null,
                addSliderAccess: false,
                sliderAccessArgs: null,
                controlType: "slider",
                defaultValue: null,
                parse: "strict"
            };
            $.extend(this._defaults, this.regional[""])
        };
        $.extend(Timepicker.prototype, {
            $input: null,
            $altInput: null,
            $timeObj: null,
            inst: null,
            hour_slider: null,
            minute_slider: null,
            second_slider: null,
            millisec_slider: null,
            microsec_slider: null,
            timezone_select: null,
            hour: 0,
            minute: 0,
            second: 0,
            millisec: 0,
            microsec: 0,
            timezone: null,
            hourMinOriginal: null,
            minuteMinOriginal: null,
            secondMinOriginal: null,
            millisecMinOriginal: null,
            microsecMinOriginal: null,
            hourMaxOriginal: null,
            minuteMaxOriginal: null,
            secondMaxOriginal: null,
            millisecMaxOriginal: null,
            microsecMaxOriginal: null,
            ampm: "",
            formattedDate: "",
            formattedTime: "",
            formattedDateTime: "",
            timezoneList: null,
            units: ["hour", "minute", "second", "millisec", "microsec"],
            support: {},
            control: null,
            setDefaults: function(settings) {
                extendRemove(this._defaults, settings || {});
                return this
            },
            _newInst: function($input, opts) {
                var tp_inst = new Timepicker,
                    inlineSettings = {},
                    fns = {},
                    overrides, i;
                for (var attrName in this._defaults) {
                    if (this._defaults.hasOwnProperty(attrName)) {
                        var attrValue = $input.attr("time:" + attrName);
                        if (attrValue) {
                            try {
                                inlineSettings[attrName] = eval(attrValue)
                            } catch (err) {
                                inlineSettings[attrName] = attrValue
                            }
                        }
                    }
                }
                overrides = {
                    beforeShow: function(input, dp_inst) {
                        if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) {
                            return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst)
                        }
                    },
                    onChangeMonthYear: function(year, month, dp_inst) {
                        tp_inst._updateDateTime(dp_inst);
                        if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) {
                            tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst)
                        }
                    },
                    onClose: function(dateText, dp_inst) {
                        if (tp_inst.timeDefined === true && $input.val() !== "") {
                            tp_inst._updateDateTime(dp_inst)
                        }
                        if ($.isFunction(tp_inst._defaults.evnts.onClose)) {
                            tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst)
                        }
                    }
                };
                for (i in overrides) {
                    if (overrides.hasOwnProperty(i)) {
                        fns[i] = opts[i] || null
                    }
                }
                tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, {
                    evnts: fns,
                    timepicker: tp_inst
                });
                tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) {
                    return val.toUpperCase()
                });
                tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) {
                    return val.toUpperCase()
                });
                tp_inst.support = detectSupport(tp_inst._defaults.timeFormat + (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : "") + (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : ""));
                if (typeof tp_inst._defaults.controlType === "string") {
                    if (tp_inst._defaults.controlType === "slider" && typeof $.ui.slider === "undefined") {
                        tp_inst._defaults.controlType = "select"
                    }
                    tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]
                } else {
                    tp_inst.control = tp_inst._defaults.controlType
                }
                var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840];
                if (tp_inst._defaults.timezoneList !== null) {
                    timezoneList = tp_inst._defaults.timezoneList
                }
                var tzl = timezoneList.length,
                    tzi = 0,
                    tzv = null;
                if (tzl > 0 && typeof timezoneList[0] !== "object") {
                    for (; tzi < tzl; tzi++) {
                        tzv = timezoneList[tzi];
                        timezoneList[tzi] = {
                            value: tzv,
                            label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601)
                        }
                    }
                }
                tp_inst._defaults.timezoneList = timezoneList;
                tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : (new Date).getTimezoneOffset() * -1;
                tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour;
                tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute;
                tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second;
                tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec;
                tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec;
                tp_inst.ampm = "";
                tp_inst.$input = $input;
                if (tp_inst._defaults.altField) {
                    tp_inst.$altInput = $(tp_inst._defaults.altField).css({
                        cursor: "pointer"
                    }).focus(function() {
                        $input.trigger("focus")
                    })
                }
                if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) {
                    tp_inst._defaults.minDate = new Date
                }
                if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) {
                    tp_inst._defaults.maxDate = new Date
                }
                if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
                    tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime())
                }
                if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
                    tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime())
                }
                if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
                    tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime())
                }
                if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
                    tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime())
                }
                tp_inst.$input.bind("focus", function() {
                    tp_inst._onFocus()
                });
                return tp_inst
            },
            _addTimePicker: function(dp_inst) {
                var currDT = this.$altInput && this._defaults.altFieldTimeOnly ? this.$input.val() + " " + this.$altInput.val() : this.$input.val();
                this.timeDefined = this._parseTime(currDT);
                this._limitMinMaxDateTime(dp_inst, false);
                this._injectTimePicker()
            },
            _parseTime: function(timeString, withDate) {
                if (!this.inst) {
                    this.inst = $.datepicker._getInst(this.$input[0])
                }
                if (withDate || !this._defaults.timeOnly) {
                    var dp_dateFormat = $.datepicker._get(this.inst, "dateFormat");
                    try {
                        var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
                        if (!parseRes.timeObj) {
                            return false
                        }
                        $.extend(this, parseRes.timeObj)
                    } catch (err) {
                        $.timepicker.log("Error parsing the date/time string: " + err + "\ndate/time string = " + timeString + "\ntimeFormat = " + this._defaults.timeFormat + "\ndateFormat = " + dp_dateFormat);
                        return false
                    }
                    return true
                } else {
                    var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
                    if (!timeObj) {
                        return false
                    }
                    $.extend(this, timeObj);
                    return true
                }
            },
            _injectTimePicker: function() {
                var $dp = this.inst.dpDiv,
                    o = this.inst.settings,
                    tp_inst = this,
                    litem = "",
                    uitem = "",
                    show = null,
                    max = {},
                    gridSize = {},
                    size = null,
                    i = 0,
                    l = 0;
                if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) {
                    var noDisplay = ' style="display:none;"',
                        html = '<div class="ui-timepicker-div' + (o.isRTL ? " ui-timepicker-rtl" : "") + '"><dl>' + '<dt class="ui_tpicker_time_label"' + (o.showTime ? "" : noDisplay) + ">" + o.timeText + "</dt>" + '<dd class="ui_tpicker_time"' + (o.showTime ? "" : noDisplay) + "></dd>";
                    for (i = 0, l = this.units.length; i < l; i++) {
                        litem = this.units[i];
                        uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
                        show = o["show" + uitem] !== null ? o["show" + uitem] : this.support[litem];
                        max[litem] = parseInt(o[litem + "Max"] - (o[litem + "Max"] - o[litem + "Min"]) % o["step" + uitem], 10);
                        gridSize[litem] = 0;
                        html += '<dt class="ui_tpicker_' + litem + '_label"' + (show ? "" : noDisplay) + ">" + o[litem + "Text"] + "</dt>" + '<dd class="ui_tpicker_' + litem + '"><div class="ui_tpicker_' + litem + '_slider"' + (show ? "" : noDisplay) + "></div>";
                        if (show && o[litem + "Grid"] > 0) {
                            html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
                            if (litem === "hour") {
                                for (var h = o[litem + "Min"]; h <= max[litem]; h += parseInt(o[litem + "Grid"], 10)) {
                                    gridSize[litem]++;
                                    var tmph = $.datepicker.formatTime(this.support.ampm ? "hht" : "HH", {
                                        hour: h
                                    }, o);
                                    html += '<td data-for="' + litem + '">' + tmph + "</td>"
                                }
                            } else {
                                for (var m = o[litem + "Min"]; m <= max[litem]; m += parseInt(o[litem + "Grid"], 10)) {
                                    gridSize[litem]++;
                                    html += '<td data-for="' + litem + '">' + (m < 10 ? "0" : "") + m + "</td>"
                                }
                            }
                            html += "</tr></table></div>"
                        }
                        html += "</dd>"
                    }
                    var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone;
                    html += '<dt class="ui_tpicker_timezone_label"' + (showTz ? "" : noDisplay) + ">" + o.timezoneText + "</dt>";
                    html += '<dd class="ui_tpicker_timezone" ' + (showTz ? "" : noDisplay) + "></dd>";
                    html += "</dl></div>";
                    var $tp = $(html);
                    if (o.timeOnly === true) {
                        $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + "</div>" + "</div>");
                        $dp.find(".ui-datepicker-header, .ui-datepicker-calendar").hide()
                    }
                    for (i = 0, l = tp_inst.units.length; i < l; i++) {
                        litem = tp_inst.units[i];
                        uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1);
                        show = o["show" + uitem] !== null ? o["show" + uitem] : this.support[litem];
                        tp_inst[litem + "_slider"] = tp_inst.control.create(tp_inst, $tp.find(".ui_tpicker_" + litem + "_slider"), litem, tp_inst[litem], o[litem + "Min"], max[litem], o["step" + uitem]);
                        if (show && o[litem + "Grid"] > 0) {
                            size = 100 * gridSize[litem] * o[litem + "Grid"] / (max[litem] - o[litem + "Min"]);
                            $tp.find(".ui_tpicker_" + litem + " table").css({
                                width: size + "%",
                                marginLeft: o.isRTL ? "0" : size / (-2 * gridSize[litem]) + "%",
                                marginRight: o.isRTL ? size / (-2 * gridSize[litem]) + "%" : "0",
                                borderCollapse: "collapse"
                            }).find("td").click(function(e) {
                                var $t = $(this),
                                    h = $t.html(),
                                    n = parseInt(h.replace(/[^0-9]/g), 10),
                                    ap = h.replace(/[^apm]/gi),
                                    f = $t.data("for");
                                if (f === "hour") {
                                    if (ap.indexOf("p") !== -1 && n < 12) {
                                        n += 12
                                    } else {
                                        if (ap.indexOf("a") !== -1 && n === 12) {
                                            n = 0
                                        }
                                    }
                                }
                                tp_inst.control.value(tp_inst, tp_inst[f + "_slider"], litem, n);
                                tp_inst._onTimeChange();
                                tp_inst._onSelectHandler()
                            }).css({
                                cursor: "pointer",
                                width: 100 / gridSize[litem] + "%",
                                textAlign: "center",
                                overflow: "hidden"
                            })
                        }
                    }
                    this.timezone_select = $tp.find(".ui_tpicker_timezone").append("<select></select>").find("select");
                    $.fn.append.apply(this.timezone_select, $.map(o.timezoneList, function(val, idx) {
                        return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val)
                    }));
                    if (typeof this.timezone !== "undefined" && this.timezone !== null && this.timezone !== "") {
                        var local_timezone = new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12).getTimezoneOffset() * -1;
                        if (local_timezone === this.timezone) {
                            selectLocalTimezone(tp_inst)
                        } else {
                            this.timezone_select.val(this.timezone)
                        }
                    } else {
                        if (typeof this.hour !== "undefined" && this.hour !== null && this.hour !== "") {
                            this.timezone_select.val(o.timezone)
                        } else {
                            selectLocalTimezone(tp_inst)
                        }
                    }
                    this.timezone_select.change(function() {
                        tp_inst._onTimeChange();
                        tp_inst._onSelectHandler()
                    });
                    var $buttonPanel = $dp.find(".ui-datepicker-buttonpane");
                    if ($buttonPanel.length) {
                        $buttonPanel.before($tp)
                    } else {
                        $dp.append($tp)
                    }
                    this.$timeObj = $tp.find(".ui_tpicker_time");
                    if (this.inst !== null) {
                        var timeDefined = this.timeDefined;
                        this._onTimeChange();
                        this.timeDefined = timeDefined
                    }
                    if (this._defaults.addSliderAccess) {
                        var sliderAccessArgs = this._defaults.sliderAccessArgs,
                            rtl = this._defaults.isRTL;
                        sliderAccessArgs.isRTL = rtl;
                        setTimeout(function() {
                            if ($tp.find(".ui-slider-access").length === 0) {
                                $tp.find(".ui-slider:visible").sliderAccess(sliderAccessArgs);
                                var sliderAccessWidth = $tp.find(".ui-slider-access:eq(0)").outerWidth(true);
                                if (sliderAccessWidth) {
                                    $tp.find("table:visible").each(function() {
                                        var $g = $(this),
                                            oldWidth = $g.outerWidth(),
                                            oldMarginLeft = $g.css(rtl ? "marginRight" : "marginLeft").toString().replace("%", ""),
                                            newWidth = oldWidth - sliderAccessWidth,
                                            newMarginLeft = oldMarginLeft * newWidth / oldWidth + "%",
                                            css = {
                                                width: newWidth,
                                                marginRight: 0,
                                                marginLeft: 0
                                            };
                                        css[rtl ? "marginRight" : "marginLeft"] = newMarginLeft;
                                        $g.css(css)
                                    })
                                }
                            }
                        }, 10)
                    }
                    tp_inst._limitMinMaxDateTime(this.inst, true)
                }
            },
            _limitMinMaxDateTime: function(dp_inst, adjustSliders) {
                var o = this._defaults,
                    dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
                if (!this._defaults.showTimepicker) {
                    return
                }
                if ($.datepicker._get(dp_inst, "minDateTime") !== null && $.datepicker._get(dp_inst, "minDateTime") !== undefined && dp_date) {
                    var minDateTime = $.datepicker._get(dp_inst, "minDateTime"),
                        minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
                    if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) {
                        this.hourMinOriginal = o.hourMin;
                        this.minuteMinOriginal = o.minuteMin;
                        this.secondMinOriginal = o.secondMin;
                        this.millisecMinOriginal = o.millisecMin;
                        this.microsecMinOriginal = o.microsecMin
                    }
                    if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) {
                        this._defaults.hourMin = minDateTime.getHours();
                        if (this.hour <= this._defaults.hourMin) {
                            this.hour = this._defaults.hourMin;
                            this._defaults.minuteMin = minDateTime.getMinutes();
                            if (this.minute <= this._defaults.minuteMin) {
                                this.minute = this._defaults.minuteMin;
                                this._defaults.secondMin = minDateTime.getSeconds();
                                if (this.second <= this._defaults.secondMin) {
                                    this.second = this._defaults.secondMin;
                                    this._defaults.millisecMin = minDateTime.getMilliseconds();
                                    if (this.millisec <= this._defaults.millisecMin) {
                                        this.millisec = this._defaults.millisecMin;
                                        this._defaults.microsecMin = minDateTime.getMicroseconds()
                                    } else {
                                        if (this.microsec < this._defaults.microsecMin) {
                                            this.microsec = this._defaults.microsecMin
                                        }
                                        this._defaults.microsecMin = this.microsecMinOriginal
                                    }
                                } else {
                                    this._defaults.millisecMin = this.millisecMinOriginal;
                                    this._defaults.microsecMin = this.microsecMinOriginal
                                }
                            } else {
                                this._defaults.secondMin = this.secondMinOriginal;
                                this._defaults.millisecMin = this.millisecMinOriginal;
                                this._defaults.microsecMin = this.microsecMinOriginal
                            }
                        } else {
                            this._defaults.minuteMin = this.minuteMinOriginal;
                            this._defaults.secondMin = this.secondMinOriginal;
                            this._defaults.millisecMin = this.millisecMinOriginal;
                            this._defaults.microsecMin = this.microsecMinOriginal
                        }
                    } else {
                        this._defaults.hourMin = this.hourMinOriginal;
                        this._defaults.minuteMin = this.minuteMinOriginal;
                        this._defaults.secondMin = this.secondMinOriginal;
                        this._defaults.millisecMin = this.millisecMinOriginal;
                        this._defaults.microsecMin = this.microsecMinOriginal
                    }
                }
                if ($.datepicker._get(dp_inst, "maxDateTime") !== null && $.datepicker._get(dp_inst, "maxDateTime") !== undefined && dp_date) {
                    var maxDateTime = $.datepicker._get(dp_inst, "maxDateTime"),
                        maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
                    if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) {
                        this.hourMaxOriginal = o.hourMax;
                        this.minuteMaxOriginal = o.minuteMax;
                        this.secondMaxOriginal = o.secondMax;
                        this.millisecMaxOriginal = o.millisecMax;
                        this.microsecMaxOriginal = o.microsecMax
                    }
                    if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) {
                        this._defaults.hourMax = maxDateTime.getHours();
                        if (this.hour >= this._defaults.hourMax) {
                            this.hour = this._defaults.hourMax;
                            this._defaults.minuteMax = maxDateTime.getMinutes();
                            if (this.minute >= this._defaults.minuteMax) {
                                this.minute = this._defaults.minuteMax;
                                this._defaults.secondMax = maxDateTime.getSeconds();
                                if (this.second >= this._defaults.secondMax) {
                                    this.second = this._defaults.secondMax;
                                    this._defaults.millisecMax = maxDateTime.getMilliseconds();
                                    if (this.millisec >= this._defaults.millisecMax) {
                                        this.millisec = this._defaults.millisecMax;
                                        this._defaults.microsecMax = maxDateTime.getMicroseconds()
                                    } else {
                                        if (this.microsec > this._defaults.microsecMax) {
                                            this.microsec = this._defaults.microsecMax
                                        }
                                        this._defaults.microsecMax = this.microsecMaxOriginal
                                    }
                                } else {
                                    this._defaults.millisecMax = this.millisecMaxOriginal;
                                    this._defaults.microsecMax = this.microsecMaxOriginal
                                }
                            } else {
                                this._defaults.secondMax = this.secondMaxOriginal;
                                this._defaults.millisecMax = this.millisecMaxOriginal;
                                this._defaults.microsecMax = this.microsecMaxOriginal
                            }
                        } else {
                            this._defaults.minuteMax = this.minuteMaxOriginal;
                            this._defaults.secondMax = this.secondMaxOriginal;
                            this._defaults.millisecMax = this.millisecMaxOriginal;
                            this._defaults.microsecMax = this.microsecMaxOriginal
                        }
                    } else {
                        this._defaults.hourMax = this.hourMaxOriginal;
                        this._defaults.minuteMax = this.minuteMaxOriginal;
                        this._defaults.secondMax = this.secondMaxOriginal;
                        this._defaults.millisecMax = this.millisecMaxOriginal;
                        this._defaults.microsecMax = this.microsecMaxOriginal
                    }
                }
                if (adjustSliders !== undefined && adjustSliders === true) {
                    var hourMax = parseInt(this._defaults.hourMax - (this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour, 10),
                        minMax = parseInt(this._defaults.minuteMax - (this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute, 10),
                        secMax = parseInt(this._defaults.secondMax - (this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond, 10),
                        millisecMax = parseInt(this._defaults.millisecMax - (this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec, 10),
                        microsecMax = parseInt(this._defaults.microsecMax - (this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec, 10);
                    if (this.hour_slider) {
                        this.control.options(this, this.hour_slider, "hour", {
                            min: this._defaults.hourMin,
                            max: hourMax
                        });
                        this.control.value(this, this.hour_slider, "hour", this.hour - this.hour % this._defaults.stepHour)
                    }
                    if (this.minute_slider) {
                        this.control.options(this, this.minute_slider, "minute", {
                            min: this._defaults.minuteMin,
                            max: minMax
                        });
                        this.control.value(this, this.minute_slider, "minute", this.minute - this.minute % this._defaults.stepMinute)
                    }
                    if (this.second_slider) {
                        this.control.options(this, this.second_slider, "second", {
                            min: this._defaults.secondMin,
                            max: secMax
                        });
                        this.control.value(this, this.second_slider, "second", this.second - this.second % this._defaults.stepSecond)
                    }
                    if (this.millisec_slider) {
                        this.control.options(this, this.millisec_slider, "millisec", {
                            min: this._defaults.millisecMin,
                            max: millisecMax
                        });
                        this.control.value(this, this.millisec_slider, "millisec", this.millisec - this.millisec % this._defaults.stepMillisec)
                    }
                    if (this.microsec_slider) {
                        this.control.options(this, this.microsec_slider, "microsec", {
                            min: this._defaults.microsecMin,
                            max: microsecMax
                        });
                        this.control.value(this, this.microsec_slider, "microsec", this.microsec - this.microsec % this._defaults.stepMicrosec)
                    }
                }
            },
            _onTimeChange: function() {
                if (!this._defaults.showTimepicker) {
                    return
                }
                var hour = this.hour_slider ? this.control.value(this, this.hour_slider, "hour") : false,
                    minute = this.minute_slider ? this.control.value(this, this.minute_slider, "minute") : false,
                    second = this.second_slider ? this.control.value(this, this.second_slider, "second") : false,
                    millisec = this.millisec_slider ? this.control.value(this, this.millisec_slider, "millisec") : false,
                    microsec = this.microsec_slider ? this.control.value(this, this.microsec_slider, "microsec") : false,
                    timezone = this.timezone_select ? this.timezone_select.val() : false,
                    o = this._defaults,
                    pickerTimeFormat = o.pickerTimeFormat || o.timeFormat,
                    pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix;
                if (typeof hour === "object") {
                    hour = false
                }
                if (typeof minute === "object") {
                    minute = false
                }
                if (typeof second === "object") {
                    second = false
                }
                if (typeof millisec === "object") {
                    millisec = false
                }
                if (typeof microsec === "object") {
                    microsec = false
                }
                if (typeof timezone === "object") {
                    timezone = false
                }
                if (hour !== false) {
                    hour = parseInt(hour, 10)
                }
                if (minute !== false) {
                    minute = parseInt(minute, 10)
                }
                if (second !== false) {
                    second = parseInt(second, 10)
                }
                if (millisec !== false) {
                    millisec = parseInt(millisec, 10)
                }
                if (microsec !== false) {
                    microsec = parseInt(microsec, 10)
                }
                if (timezone !== false) {
                    timezone = timezone.toString()
                }
                var ampm = o[hour < 12 ? "amNames" : "pmNames"][0];
                var hasChanged = hour !== parseInt(this.hour, 10) || minute !== parseInt(this.minute, 10) || second !== parseInt(this.second, 10) || millisec !== parseInt(this.millisec, 10) || microsec !== parseInt(this.microsec, 10) || this.ampm.length > 0 && hour < 12 !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1) || this.timezone !== null && timezone !== this.timezone.toString();
                if (hasChanged) {
                    if (hour !== false) {
                        this.hour = hour
                    }
                    if (minute !== false) {
                        this.minute = minute
                    }
                    if (second !== false) {
                        this.second = second
                    }
                    if (millisec !== false) {
                        this.millisec = millisec
                    }
                    if (microsec !== false) {
                        this.microsec = microsec
                    }
                    if (timezone !== false) {
                        this.timezone = timezone
                    }
                    if (!this.inst) {
                        this.inst = $.datepicker._getInst(this.$input[0])
                    }
                    this._limitMinMaxDateTime(this.inst, true)
                }
                if (this.support.ampm) {
                    this.ampm = ampm
                }
                this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o);
                if (this.$timeObj) {
                    if (pickerTimeFormat === o.timeFormat) {
                        this.$timeObj.text(this.formattedTime + pickerTimeSuffix)
                    } else {
                        this.$timeObj.text($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix)
                    }
                }
                this.timeDefined = true;
                if (hasChanged) {
                    this._updateDateTime();
                    this.$input.focus()
                }
            },
            _onSelectHandler: function() {
                var onSelect = this._defaults.onSelect || this.inst.settings.onSelect;
                var inputEl = this.$input ? this.$input[0] : null;
                if (onSelect && inputEl) {
                    onSelect.apply(inputEl, [this.formattedDateTime, this])
                }
            },
            _updateDateTime: function(dp_inst) {
                dp_inst = this.inst || dp_inst;
                var dtTmp = dp_inst.currentYear > 0 ? new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) : new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay),
                    dt = $.datepicker._daylightSavingAdjust(dtTmp),
                    dateFmt = $.datepicker._get(dp_inst, "dateFormat"),
                    formatCfg = $.datepicker._getFormatConfig(dp_inst),
                    timeAvailable = dt !== null && this.timeDefined;
                this.formattedDate = $.datepicker.formatDate(dateFmt, dt === null ? new Date : dt, formatCfg);
                var formattedDateTime = this.formattedDate;
                if (dp_inst.lastVal === "") {
                    dp_inst.currentYear = dp_inst.selectedYear;
                    dp_inst.currentMonth = dp_inst.selectedMonth;
                    dp_inst.currentDay = dp_inst.selectedDay
                }
                if (this._defaults.timeOnly === true) {
                    formattedDateTime = this.formattedTime
                } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
                    formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix
                }
                this.formattedDateTime = formattedDateTime;
                if (!this._defaults.showTimepicker) {
                    this.$input.val(this.formattedDate)
                } else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
                    this.$altInput.val(this.formattedTime);
                    this.$input.val(this.formattedDate)
                } else if (this.$altInput) {
                    this.$input.val(formattedDateTime);
                    var altFormattedDateTime = "",
                        altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
                        altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
                    if (!this._defaults.timeOnly) {
                        if (this._defaults.altFormat) {
                            altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, dt === null ? new Date : dt, formatCfg)
                        } else {
                            altFormattedDateTime = this.formattedDate
                        }
                        if (altFormattedDateTime) {
                            altFormattedDateTime += altSeparator
                        }
                    }
                    if (this._defaults.altTimeFormat) {
                        altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix
                    } else {
                        altFormattedDateTime += this.formattedTime + altTimeSuffix
                    }
                    this.$altInput.val(altFormattedDateTime)
                } else {
                    this.$input.val(formattedDateTime)
                }
                this.$input.trigger("change")
            },
            _onFocus: function() {
                if (!this.$input.val() && this._defaults.defaultValue) {
                    this.$input.val(this._defaults.defaultValue);
                    var inst = $.datepicker._getInst(this.$input.get(0)),
                        tp_inst = $.datepicker._get(inst, "timepicker");
                    if (tp_inst) {
                        if (tp_inst._defaults.timeOnly && inst.input.val() !== inst.lastVal) {
                            try {
                                $.datepicker._updateDatepicker(inst)
                            } catch (err) {
                                $.timepicker.log(err)
                            }
                        }
                    }
                }
            },
            _controls: {
                slider: {
                    create: function(tp_inst, obj, unit, val, min, max, step) {
                        var rtl = tp_inst._defaults.isRTL;
                        return obj.prop("slide", null).slider({
                            orientation: "horizontal",
                            value: rtl ? val * -1 : val,
                            min: rtl ? max * -1 : min,
                            max: rtl ? min * -1 : max,
                            step: step,
                            slide: function(event, ui) {
                                tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value);
                                tp_inst._onTimeChange()
                            },
                            stop: function(event, ui) {
                                tp_inst._onSelectHandler()
                            }
                        })
                    },
                    options: function(tp_inst, obj, unit, opts, val) {
                        if (tp_inst._defaults.isRTL) {
                            if (typeof opts === "string") {
                                if (opts === "min" || opts === "max") {
                                    if (val !== undefined) {
                                        return obj.slider(opts, val * -1)
                                    }
                                    return Math.abs(obj.slider(opts))
                                }
                                return obj.slider(opts)
                            }
                            var min = opts.min,
                                max = opts.max;
                            opts.min = opts.max = null;
                            if (min !== undefined) {
                                opts.max = min * -1
                            }
                            if (max !== undefined) {
                                opts.min = max * -1
                            }
                            return obj.slider(opts)
                        }
                        if (typeof opts === "string" && val !== undefined) {
                            return obj.slider(opts, val)
                        }
                        return obj.slider(opts)
                    },
                    value: function(tp_inst, obj, unit, val) {
                        if (tp_inst._defaults.isRTL) {
                            if (val !== undefined) {
                                return obj.slider("value", val * -1)
                            }
                            return Math.abs(obj.slider("value"));
                        }
                        if (val !== undefined) {
                            return obj.slider("value", val)
                        }
                        return obj.slider("value")
                    }
                },
                select: {
                    create: function(tp_inst, obj, unit, val, min, max, step) {
                        var sel = '<select class="ui-timepicker-select" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">',
                            format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat;
                        for (var i = min; i <= max; i += step) {
                            sel += '<option value="' + i + '"' + (i === val ? " selected" : "") + ">";
                            if (unit === "hour") {
                                sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/gi, "")), {
                                    hour: i
                                }, tp_inst._defaults)
                            } else if (unit === "millisec" || unit === "microsec" || i >= 10) {
                                sel += i
                            } else {
                                sel += "0" + i.toString()
                            }
                            sel += "</option>"
                        }
                        sel += "</select>";
                        obj.children("select").remove();
                        $(sel).appendTo(obj).change(function(e) {
                            tp_inst._onTimeChange();
                            tp_inst._onSelectHandler()
                        });
                        return obj
                    },
                    options: function(tp_inst, obj, unit, opts, val) {
                        var o = {},
                            $t = obj.children("select");
                        if (typeof opts === "string") {
                            if (val === undefined) {
                                return $t.data(opts)
                            }
                            o[opts] = val
                        } else {
                            o = opts
                        }
                        return tp_inst.control.create(tp_inst, obj, $t.data("unit"), $t.val(), o.min || $t.data("min"), o.max || $t.data("max"), o.step || $t.data("step"))
                    },
                    value: function(tp_inst, obj, unit, val) {
                        var $t = obj.children("select");
                        if (val !== undefined) {
                            return $t.val(val)
                        }
                        return $t.val()
                    }
                }
            }
        });
        $.fn.extend({
            timepicker: function(o) {
                o = o || {};
                var tmp_args = Array.prototype.slice.call(arguments);
                if (typeof o === "object") {
                    tmp_args[0] = $.extend(o, {
                        timeOnly: true
                    })
                }
                return $(this).each(function() {
                    $.fn.datetimepicker.apply($(this), tmp_args)
                })
            },
            datetimepicker: function(o) {
                o = o || {};
                var tmp_args = arguments;
                if (typeof o === "string") {
                    if (o === "getDate") {
                        return $.fn.datepicker.apply($(this[0]), tmp_args)
                    } else {
                        return this.each(function() {
                            var $t = $(this);
                            $t.datepicker.apply($t, tmp_args)
                        })
                    }
                } else {
                    return this.each(function() {
                        var $t = $(this);
                        $t.datepicker($.timepicker._newInst($t, o)._defaults)
                    })
                }
            }
        });
        $.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
            var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
            if (parseRes.timeObj) {
                var t = parseRes.timeObj;
                parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
                parseRes.date.setMicroseconds(t.microsec)
            }
            return parseRes.date
        };
        $.datepicker.parseTime = function(timeFormat, timeString, options) {
            var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}),
                iso8601 = timeFormat.replace(/\'.*?\'/g, "").indexOf("Z") !== -1;
            var strictParse = function(f, s, o) {
                var getPatternAmpm = function(amNames, pmNames) {
                    var markers = [];
                    if (amNames) {
                        $.merge(markers, amNames)
                    }
                    if (pmNames) {
                        $.merge(markers, pmNames)
                    }
                    markers = $.map(markers, function(val) {
                        return val.replace(/[.*+?|()\[\]{}\\]/g, "\\$&")
                    });
                    return "(" + markers.join("|") + ")?"
                };
                var getFormatPositions = function(timeFormat) {
                    var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g),
                        orders = {
                            h: -1,
                            m: -1,
                            s: -1,
                            l: -1,
                            c: -1,
                            t: -1,
                            z: -1
                        };
                    if (finds) {
                        for (var i = 0; i < finds.length; i++) {
                            if (orders[finds[i].toString().charAt(0)] === -1) {
                                orders[finds[i].toString().charAt(0)] = i + 1
                            }
                        }
                    }
                    return orders
                };
                var regstr = "^" + f.toString().replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function(match) {
                        var ml = match.length;
                        switch (match.charAt(0).toLowerCase()) {
                            case "h":
                                return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
                            case "m":
                                return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
                            case "s":
                                return ml === 1 ? "(\\d?\\d)" : "(\\d{" + ml + "})";
                            case "l":
                                return "(\\d?\\d?\\d)";
                            case "c":
                                return "(\\d?\\d?\\d)";
                            case "z":
                                return "(z|[-+]\\d\\d:?\\d\\d|\\S+)?";
                            case "t":
                                return getPatternAmpm(o.amNames, o.pmNames);
                            default:
                                return "(" + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function(m) {
                                    return "\\" + m
                                }) + ")?"
                        }
                    }).replace(/\s/g, "\\s?") + o.timeSuffix + "$",
                    order = getFormatPositions(f),
                    ampm = "",
                    treg;
                treg = s.match(new RegExp(regstr, "i"));
                var resTime = {
                    hour: 0,
                    minute: 0,
                    second: 0,
                    millisec: 0,
                    microsec: 0
                };
                if (treg) {
                    if (order.t !== -1) {
                        if (treg[order.t] === undefined || treg[order.t].length === 0) {
                            ampm = "";
                            resTime.ampm = ""
                        } else {
                            ampm = $.inArray(treg[order.t].toUpperCase(), o.amNames) !== -1 ? "AM" : "PM";
                            resTime.ampm = o[ampm === "AM" ? "amNames" : "pmNames"][0]
                        }
                    }
                    if (order.h !== -1) {
                        if (ampm === "AM" && treg[order.h] === "12") {
                            resTime.hour = 0
                        } else {
                            if (ampm === "PM" && treg[order.h] !== "12") {
                                resTime.hour = parseInt(treg[order.h], 10) + 12
                            } else {
                                resTime.hour = Number(treg[order.h])
                            }
                        }
                    }
                    if (order.m !== -1) {
                        resTime.minute = Number(treg[order.m])
                    }
                    if (order.s !== -1) {
                        resTime.second = Number(treg[order.s])
                    }
                    if (order.l !== -1) {
                        resTime.millisec = Number(treg[order.l])
                    }
                    if (order.c !== -1) {
                        resTime.microsec = Number(treg[order.c])
                    }
                    if (order.z !== -1 && treg[order.z] !== undefined) {
                        resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z])
                    }
                    return resTime
                }
                return false
            };
            var looseParse = function(f, s, o) {
                try {
                    var d = new Date("2012-01-01 " + s);
                    if (isNaN(d.getTime())) {
                        d = new Date("2012-01-01T" + s);
                        if (isNaN(d.getTime())) {
                            d = new Date("01/01/2012 " + s);
                            if (isNaN(d.getTime())) {
                                throw "Unable to parse time with native Date: " + s
                            }
                        }
                    }
                    return {
                        hour: d.getHours(),
                        minute: d.getMinutes(),
                        second: d.getSeconds(),
                        millisec: d.getMilliseconds(),
                        microsec: d.getMicroseconds(),
                        timezone: d.getTimezoneOffset() * -1
                    }
                } catch (err) {
                    try {
                        return strictParse(f, s, o)
                    } catch (err2) {
                        $.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f)
                    }
                }
                return false
            };
            if (typeof o.parse === "function") {
                return o.parse(timeFormat, timeString, o)
            }
            if (o.parse === "loose") {
                return looseParse(timeFormat, timeString, o)
            }
            return strictParse(timeFormat, timeString, o)
        };
        $.datepicker.formatTime = function(format, time, options) {
            options = options || {};
            options = $.extend({}, $.timepicker._defaults, options);
            time = $.extend({
                hour: 0,
                minute: 0,
                second: 0,
                millisec: 0,
                microsec: 0,
                timezone: null
            }, time);
            var tmptime = format,
                ampmName = options.amNames[0],
                hour = parseInt(time.hour, 10);
            if (hour > 11) {
                ampmName = options.pmNames[0]
            }
            tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function(match) {
                switch (match) {
                    case "HH":
                        return ("0" + hour).slice(-2);
                    case "H":
                        return hour;
                    case "hh":
                        return ("0" + convert24to12(hour)).slice(-2);
                    case "h":
                        return convert24to12(hour);
                    case "mm":
                        return ("0" + time.minute).slice(-2);
                    case "m":
                        return time.minute;
                    case "ss":
                        return ("0" + time.second).slice(-2);
                    case "s":
                        return time.second;
                    case "l":
                        return ("00" + time.millisec).slice(-3);
                    case "c":
                        return ("00" + time.microsec).slice(-3);
                    case "z":
                        return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false);
                    case "Z":
                        return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true);
                    case "T":
                        return ampmName.charAt(0).toUpperCase();
                    case "TT":
                        return ampmName.toUpperCase();
                    case "t":
                        return ampmName.charAt(0).toLowerCase();
                    case "tt":
                        return ampmName.toLowerCase();
                    default:
                        return match.replace(/'/g, "")
                }
            });
            return tmptime
        };
        $.datepicker._base_selectDate = $.datepicker._selectDate;
        $.datepicker._selectDate = function(id, dateStr) {
            var inst = this._getInst($(id)[0]),
                tp_inst = this._get(inst, "timepicker");
            if (tp_inst) {
                tp_inst._limitMinMaxDateTime(inst, true);
                inst.inline = inst.stay_open = true;
                this._base_selectDate(id, dateStr);
                inst.inline = inst.stay_open = false;
                this._notifyChange(inst);
                this._updateDatepicker(inst)
            } else {
                this._base_selectDate(id, dateStr)
            }
        };
        $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
        $.datepicker._updateDatepicker = function(inst) {
            var input = inst.input[0];
            if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
                return
            }
            if (typeof inst.stay_open !== "boolean" || inst.stay_open === false) {
                this._base_updateDatepicker(inst);
                var tp_inst = this._get(inst, "timepicker");
                if (tp_inst) {
                    tp_inst._addTimePicker(inst)
                }
            }
        };
        $.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
        $.datepicker._doKeyPress = function(event) {
            var inst = $.datepicker._getInst(event.target),
                tp_inst = $.datepicker._get(inst, "timepicker");
            if (tp_inst) {
                if ($.datepicker._get(inst, "constrainInput")) {
                    var ampm = tp_inst.support.ampm,
                        tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone,
                        dateChars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat")),
                        datetimeChars = tp_inst._defaults.timeFormat.toString().replace(/[hms]/g, "").replace(/TT/g, ampm ? "APM" : "").replace(/Tt/g, ampm ? "AaPpMm" : "").replace(/tT/g, ampm ? "AaPpMm" : "").replace(/T/g, ampm ? "AP" : "").replace(/tt/g, ampm ? "apm" : "").replace(/t/g, ampm ? "ap" : "") + " " + tp_inst._defaults.separator + tp_inst._defaults.timeSuffix + (tz ? tp_inst._defaults.timezoneList.join("") : "") + tp_inst._defaults.amNames.join("") + tp_inst._defaults.pmNames.join("") + dateChars,
                        chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
                    return event.ctrlKey || (chr < " " || !dateChars || datetimeChars.indexOf(chr) > -1)
                }
            }
            return $.datepicker._base_doKeyPress(event)
        };
        $.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
        $.datepicker._updateAlternate = function(inst) {
            var tp_inst = this._get(inst, "timepicker");
            if (tp_inst) {
                var altField = tp_inst._defaults.altField;
                if (altField) {
                    var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat,
                        date = this._getDate(inst),
                        formatCfg = $.datepicker._getFormatConfig(inst),
                        altFormattedDateTime = "",
                        altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator,
                        altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix,
                        altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat;
                    altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix;
                    if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) {
                        if (tp_inst._defaults.altFormat) {
                            altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime
                        } else {
                            altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime
                        }
                    }
                    $(altField).val(altFormattedDateTime)
                }
            } else {
                $.datepicker._base_updateAlternate(inst)
            }
        };
        $.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
        $.datepicker._doKeyUp = function(event) {
            var inst = $.datepicker._getInst(event.target),
                tp_inst = $.datepicker._get(inst, "timepicker");
            if (tp_inst) {
                if (tp_inst._defaults.timeOnly && inst.input.val() !== inst.lastVal) {
                    try {
                        $.datepicker._updateDatepicker(inst)
                    } catch (err) {
                        $.timepicker.log(err)
                    }
                }
            }
            return $.datepicker._base_doKeyUp(event)
        };
        $.datepicker._base_gotoToday = $.datepicker._gotoToday;
        $.datepicker._gotoToday = function(id) {
            var inst = this._getInst($(id)[0]),
                $dp = inst.dpDiv;
            this._base_gotoToday(id);
            var tp_inst = this._get(inst, "timepicker");
            selectLocalTimezone(tp_inst);
            var now = new Date;
            this._setTime(inst, now);
            $(".ui-datepicker-today", $dp).click()
        };
        $.datepicker._disableTimepickerDatepicker = function(target) {
            var inst = this._getInst(target);
            if (!inst) {
                return
            }
            var tp_inst = this._get(inst, "timepicker");
            $(target).datepicker("getDate");
            if (tp_inst) {
                inst.settings.showTimepicker = false;
                tp_inst._defaults.showTimepicker = false;
                tp_inst._updateDateTime(inst)
            }
        };
        $.datepicker._enableTimepickerDatepicker = function(target) {
            var inst = this._getInst(target);
            if (!inst) {
                return
            }
            var tp_inst = this._get(inst, "timepicker");
            $(target).datepicker("getDate");
            if (tp_inst) {
                inst.settings.showTimepicker = true;
                tp_inst._defaults.showTimepicker = true;
                tp_inst._addTimePicker(inst);
                tp_inst._updateDateTime(inst)
            }
        };
        $.datepicker._setTime = function(inst, date) {
            var tp_inst = this._get(inst, "timepicker");
            if (tp_inst) {
                var defaults = tp_inst._defaults;
                tp_inst.hour = date ? date.getHours() : defaults.hour;
                tp_inst.minute = date ? date.getMinutes() : defaults.minute;
                tp_inst.second = date ? date.getSeconds() : defaults.second;
                tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec;
                tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec;
                tp_inst._limitMinMaxDateTime(inst, true);
                tp_inst._onTimeChange();
                tp_inst._updateDateTime(inst)
            }
        };
        $.datepicker._setTimeDatepicker = function(target, date, withDate) {
            var inst = this._getInst(target);
            if (!inst) {
                return
            }
            var tp_inst = this._get(inst, "timepicker");
            if (tp_inst) {
                this._setDateFromField(inst);
                var tp_date;
                if (date) {
                    if (typeof date === "string") {
                        tp_inst._parseTime(date, withDate);
                        tp_date = new Date;
                        tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
                        tp_date.setMicroseconds(tp_inst.microsec)
                    } else {
                        tp_date = new Date(date.getTime());
                        tp_date.setMicroseconds(date.getMicroseconds())
                    }
                    if (tp_date.toString() === "Invalid Date") {
                        tp_date = undefined
                    }
                    this._setTime(inst, tp_date)
                }
            }
        };
        $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
        $.datepicker._setDateDatepicker = function(target, date) {
            var inst = this._getInst(target);
            if (!inst) {
                return
            }
            if (typeof date === "string") {
                date = new Date(date);
                if (!date.getTime()) {
                    $.timepicker.log("Error creating Date object from string.")
                }
            }
            var tp_inst = this._get(inst, "timepicker");
            var tp_date;
            if (date instanceof Date) {
                tp_date = new Date(date.getTime());
                tp_date.setMicroseconds(date.getMicroseconds())
            } else {
                tp_date = date
            }
            if (tp_inst && tp_date) {
                if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
                    tp_inst.timezone = tp_date.getTimezoneOffset() * -1
                }
                date = $.timepicker.timezoneAdjust(date, tp_inst.timezone);
                tp_date = $.timepicker.timezoneAdjust(tp_date, tp_inst.timezone)
            }
            this._updateDatepicker(inst);
            this._base_setDateDatepicker.apply(this, arguments);
            this._setTimeDatepicker(target, tp_date, true)
        };
        $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
        $.datepicker._getDateDatepicker = function(target, noDefault) {
            var inst = this._getInst(target);
            if (!inst) {
                return
            }
            var tp_inst = this._get(inst, "timepicker");
            if (tp_inst) {
                if (inst.lastVal === undefined) {
                    this._setDateFromField(inst, noDefault)
                }
                var date = this._getDate(inst);
                if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
                    date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
                    date.setMicroseconds(tp_inst.microsec);
                    if (tp_inst.timezone != null) {
                        if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) {
                            tp_inst.timezone = date.getTimezoneOffset() * -1
                        }
                        date = $.timepicker.timezoneAdjust(date, tp_inst.timezone)
                    }
                }
                return date
            }
            return this._base_getDateDatepicker(target, noDefault)
        };
        $.datepicker._base_parseDate = $.datepicker.parseDate;
        $.datepicker.parseDate = function(format, value, settings) {
            var date;
            try {
                date = this._base_parseDate(format, value, settings)
            } catch (err) {
                if (err.indexOf(":") >= 0) {
                    date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(":") - 2)), settings);
                    $.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format)
                } else {
                    throw err
                }
            }
            return date
        };
        $.datepicker._base_formatDate = $.datepicker._formatDate;
        $.datepicker._formatDate = function(inst, day, month, year) {
            var tp_inst = this._get(inst, "timepicker");
            if (tp_inst) {
                tp_inst._updateDateTime(inst);
                return tp_inst.$input.val()
            }
            return this._base_formatDate(inst)
        };
        $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
        $.datepicker._optionDatepicker = function(target, name, value) {
            var inst = this._getInst(target),
                name_clone;
            if (!inst) {
                return null
            }
            var tp_inst = this._get(inst, "timepicker");
            if (tp_inst) {
                var min = null,
                    max = null,
                    onselect = null,
                    overrides = tp_inst._defaults.evnts,
                    fns = {},
                    prop;
                if (typeof name === "string") {
                    if (name === "minDate" || name === "minDateTime") {
                        min = value
                    } else if (name === "maxDate" || name === "maxDateTime") {
                        max = value
                    } else if (name === "onSelect") {
                        onselect = value
                    } else if (overrides.hasOwnProperty(name)) {
                        if (typeof value === "undefined") {
                            return overrides[name]
                        }
                        fns[name] = value;
                        name_clone = {}
                    }
                } else if (typeof name === "object") {
                    if (name.minDate) {
                        min = name.minDate
                    } else if (name.minDateTime) {
                        min = name.minDateTime
                    } else if (name.maxDate) {
                        max = name.maxDate
                    } else if (name.maxDateTime) {
                        max = name.maxDateTime
                    }
                    for (prop in overrides) {
                        if (overrides.hasOwnProperty(prop) && name[prop]) {
                            fns[prop] = name[prop]
                        }
                    }
                }
                for (prop in fns) {
                    if (fns.hasOwnProperty(prop)) {
                        overrides[prop] = fns[prop];
                        if (!name_clone) {
                            name_clone = $.extend({}, name)
                        }
                        delete name_clone[prop]
                    }
                }
                if (name_clone && isEmptyObject(name_clone)) {
                    return
                }
                if (min) {
                    if (min === 0) {
                        min = new Date
                    } else {
                        min = new Date(min)
                    }
                    tp_inst._defaults.minDate = min;
                    tp_inst._defaults.minDateTime = min
                } else if (max) {
                    if (max === 0) {
                        max = new Date
                    } else {
                        max = new Date(max)
                    }
                    tp_inst._defaults.maxDate = max;
                    tp_inst._defaults.maxDateTime = max
                } else if (onselect) {
                    tp_inst._defaults.onSelect = onselect
                }
            }
            if (value === undefined) {
                return this._base_optionDatepicker.call($.datepicker, target, name)
            }
            return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value)
        };
        var isEmptyObject = function(obj) {
            var prop;
            for (prop in obj) {
                if (obj.hasOwnProperty(prop)) {
                    return false
                }
            }
            return true
        };
        var extendRemove = function(target, props) {
            $.extend(target, props);
            for (var name in props) {
                if (props[name] === null || props[name] === undefined) {
                    target[name] = props[name]
                }
            }
            return target
        };
        var detectSupport = function(timeFormat) {
            var tf = timeFormat.replace(/'.*?'/g, "").toLowerCase(),
                isIn = function(f, t) {
                    return f.indexOf(t) !== -1 ? true : false
                };
            return {
                hour: isIn(tf, "h"),
                minute: isIn(tf, "m"),
                second: isIn(tf, "s"),
                millisec: isIn(tf, "l"),
                microsec: isIn(tf, "c"),
                timezone: isIn(tf, "z"),
                ampm: isIn(tf, "t") && isIn(timeFormat, "h"),
                iso8601: isIn(timeFormat, "Z")
            }
        };
        var convert24to12 = function(hour) {
            hour %= 12;
            if (hour === 0) {
                hour = 12
            }
            return String(hour)
        };
        var computeEffectiveSetting = function(settings, property) {
            return settings && settings[property] ? settings[property] : $.timepicker._defaults[property]
        };
        var splitDateTime = function(dateTimeString, timeSettings) {
            var separator = computeEffectiveSetting(timeSettings, "separator"),
                format = computeEffectiveSetting(timeSettings, "timeFormat"),
                timeParts = format.split(separator),
                timePartsLen = timeParts.length,
                allParts = dateTimeString.split(separator),
                allPartsLen = allParts.length;
            if (allPartsLen > 1) {
                return {
                    dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator),
                    timeString: allParts.splice(0, timePartsLen).join(separator)
                }
            }
            return {
                dateString: dateTimeString,
                timeString: ""
            }
        };
        var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
            var date, parts, parsedTime;
            parts = splitDateTime(dateTimeString, timeSettings);
            date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings);
            if (parts.timeString === "") {
                return {
                    date: date
                }
            }
            parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings);
            if (!parsedTime) {
                throw "Wrong time format"
            }
            return {
                date: date,
                timeObj: parsedTime
            }
        };
        var selectLocalTimezone = function(tp_inst, date) {
            if (tp_inst && tp_inst.timezone_select) {
                var now = date || new Date;
                tp_inst.timezone_select.val(-now.getTimezoneOffset())
            }
        };
        $.timepicker = new Timepicker;
        $.timepicker.timezoneOffsetString = function(tzMinutes, iso8601) {
            if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) {
                return tzMinutes
            }
            var off = tzMinutes,
                minutes = off % 60,
                hours = (off - minutes) / 60,
                iso = iso8601 ? ":" : "",
                tz = (off >= 0 ? "+" : "-") + ("0" + Math.abs(hours)).slice(-2) + iso + ("0" + Math.abs(minutes)).slice(-2);
            if (tz === "+00:00") {
                return "Z"
            }
            return tz
        };
        $.timepicker.timezoneOffsetNumber = function(tzString) {
            var normalized = tzString.toString().replace(":", "");
            if (normalized.toUpperCase() === "Z") {
                return 0
            }
            if (!/^(\-|\+)\d{4}$/.test(normalized)) {
                return tzString
            }
            return (normalized.substr(0, 1) === "-" ? -1 : 1) * (parseInt(normalized.substr(1, 2), 10) * 60 + parseInt(normalized.substr(3, 2), 10))
        };
        $.timepicker.timezoneAdjust = function(date, toTimezone) {
            var toTz = $.timepicker.timezoneOffsetNumber(toTimezone);
            if (!isNaN(toTz)) {
                date.setMinutes(date.getMinutes() + -date.getTimezoneOffset() - toTz)
            }
            return date
        };
        $.timepicker.timeRange = function(startTime, endTime, options) {
            return $.timepicker.handleRange("timepicker", startTime, endTime, options)
        };
        $.timepicker.datetimeRange = function(startTime, endTime, options) {
            $.timepicker.handleRange("datetimepicker", startTime, endTime, options)
        };
        $.timepicker.dateRange = function(startTime, endTime, options) {
            $.timepicker.handleRange("datepicker", startTime, endTime, options)
        };
        $.timepicker.handleRange = function(method, startTime, endTime, options) {
            options = $.extend({}, {
                minInterval: 0,
                maxInterval: 0,
                start: {},
                end: {}
            }, options);

            function checkDates(changed, other) {
                var startdt = startTime[method]("getDate"),
                    enddt = endTime[method]("getDate"),
                    changeddt = changed[method]("getDate");
                if (startdt !== null) {
                    var minDate = new Date(startdt.getTime()),
                        maxDate = new Date(startdt.getTime());
                    minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval);
                    maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval);
                    if (options.minInterval > 0 && minDate > enddt) {
                        endTime[method]("setDate", minDate)
                    } else if (options.maxInterval > 0 && maxDate < enddt) {
                        endTime[method]("setDate", maxDate)
                    } else if (startdt > enddt) {
                        other[method]("setDate", changeddt)
                    }
                }
            }

            function selected(changed, other, option) {
                if (!changed.val()) {
                    return
                }
                var date = changed[method].call(changed, "getDate");
                if (date !== null && options.minInterval > 0) {
                    if (option === "minDate") {
                        date.setMilliseconds(date.getMilliseconds() + options.minInterval)
                    }
                    if (option === "maxDate") {
                        date.setMilliseconds(date.getMilliseconds() - options.minInterval)
                    }
                }
                if (date.getTime) {
                    other[method].call(other, "option", option, date)
                }
            }
            $.fn[method].call(startTime, $.extend({
                onClose: function(dateText, inst) {
                    checkDates($(this), endTime)
                },
                onSelect: function(selectedDateTime) {
                    selected($(this), endTime, "minDate")
                }
            }, options, options.start));
            $.fn[method].call(endTime, $.extend({
                onClose: function(dateText, inst) {
                    checkDates($(this), startTime)
                },
                onSelect: function(selectedDateTime) {
                    selected($(this), startTime, "maxDate")
                }
            }, options, options.end));
            checkDates(startTime, endTime);
            selected(startTime, endTime, "minDate");
            selected(endTime, startTime, "maxDate");
            return $([startTime.get(0), endTime.get(0)])
        };
        $.timepicker.log = function(err) {
            if (window.console) {
                window.console.log(err)
            }
        };
        $.timepicker._util = {
            _extendRemove: extendRemove,
            _isEmptyObject: isEmptyObject,
            _convert24to12: convert24to12,
            _detectSupport: detectSupport,
            _selectLocalTimezone: selectLocalTimezone,
            _computeEffectiveSetting: computeEffectiveSetting,
            _splitDateTime: splitDateTime,
            _parseDateTimeInternal: parseDateTimeInternal
        };
        if (!Date.prototype.getMicroseconds) {
            Date.prototype.microseconds = 0;
            Date.prototype.getMicroseconds = function() {
                return this.microseconds
            };
            Date.prototype.setMicroseconds = function(m) {
                this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1e3));
                this.microseconds = m % 1e3;
                return this
            }
        }
        $.timepicker.version = "1.4.3"
    })(jQuery);
    (function($) {
        $.timepicker.regional["fr"] = {
            timeOnlyTitle: "Choisir une heure",
            timeText: "Heure",
            hourText: "Heures",
            minuteText: "Minutes",
            secondText: "Secondes",
            millisecText: "Millisecondes",
            microsecText: "Microsecondes",
            timezoneText: "Fuseau horaire",
            currentText: "Maintenant",
            closeText: "Terminé",
            timeFormat: "HH:mm",
            amNames: ["AM", "A"],
            pmNames: ["PM", "P"],
            isRTL: false
        };
        $.timepicker.setDefaults($.timepicker.regional["fr"])
    })(jQuery);
    return jQuery
});
define("jquery.sticky", ["jquery"], function(jQuery) {
    (function($) {
        var defaults = {
                topSpacing: 0,
                bottomSpacing: 0,
                className: "is-sticky",
                wrapperClassName: "sticky-wrapper",
                center: false,
                getWidthFrom: "",
                responsiveWidth: false
            },
            $window = $(window),
            $document = $(document),
            sticked = [],
            windowHeight = $window.height(),
            scroller = function() {
                var scrollTop = $window.scrollTop(),
                    documentHeight = $document.height(),
                    dwh = documentHeight - windowHeight,
                    extra = scrollTop > dwh ? dwh - scrollTop : 0;
                for (var i = 0; i < sticked.length; i++) {
                    var s = sticked[i],
                        elementTop = s.stickyWrapper.offset().top,
                        etse = elementTop - s.topSpacing - extra;
                    if (scrollTop <= etse) {
                        if (s.currentTop !== null) {
                            s.stickyElement.css("width", "").css("position", "").css("top", "");
                            s.stickyElement.trigger("sticky-end", [s]).parent().removeClass(s.className);
                            s.currentTop = null
                        }
                    } else {
                        var newTop = documentHeight - s.stickyElement.outerHeight() - s.topSpacing - s.bottomSpacing - scrollTop - extra;
                        if (newTop < 0) {
                            newTop = newTop + s.topSpacing
                        } else if (s.topSpacing < elementTop) {
                            newTop = s.topSpacing
                        } else {
                            newTop = elementTop
                        }
                        if (s.currentTop != newTop) {
                            s.stickyElement.css("width", s.stickyElement.width()).css("position", "fixed").css("top", newTop);
                            if (typeof s.getWidthFrom !== "undefined") {
                                s.stickyElement.css("width", $(s.getWidthFrom).width())
                            }
                            s.stickyElement.trigger("sticky-start", [s]).parent().addClass(s.className);
                            s.currentTop = newTop
                        }
                    }
                }
            },
            resizer = function() {
                windowHeight = $window.height();
                for (var i = 0; i < sticked.length; i++) {
                    var s = sticked[i];
                    if (typeof s.getWidthFrom !== "undefined" && s.responsiveWidth === true) {
                        s.stickyElement.css("width", $(s.getWidthFrom).width())
                    }
                }
            },
            methods = {
                init: function(options) {
                    var o = $.extend({}, defaults, options);
                    return this.each(function() {
                        var stickyElement = $(this);
                        var stickyId = stickyElement.attr("id") ? stickyElement.attr("id") : "node" + sticked.length;
                        var wrapper = $("<div></div>").attr("id", stickyId + "-sticky-wrapper").addClass(o.wrapperClassName);
                        stickyElement.wrapAll(wrapper);
                        if (stickyElement.is("tr")) {
                            stickyElement.parents("table").first().find("tr:first-of-type > th, tr:first-of-type > td").each(function() {
                                $(this).width($(this).width())
                            })
                        }
                        if (o.center) {
                            stickyElement.parent().css({
                                width: stickyElement.outerWidth(),
                                marginLeft: "auto",
                                marginRight: "auto"
                            })
                        }
                        if (stickyElement.css("float") == "right") {
                            stickyElement.css("left", stickyElement.offset().left);
                            stickyElement.css({
                                "float": "none"
                            }).parent().css({
                                "float": "right"
                            })
                        }
                        var stickyWrapper = stickyElement.parent();
                        stickyWrapper.css("height", stickyElement.outerHeight());
                        sticked.push({
                            topSpacing: o.topSpacing,
                            bottomSpacing: o.bottomSpacing,
                            stickyElement: stickyElement,
                            currentTop: null,
                            stickyWrapper: stickyWrapper,
                            className: o.className,
                            getWidthFrom: o.getWidthFrom,
                            responsiveWidth: o.responsiveWidth
                        })
                    })
                },
                update: function(options) {
                    for (var i = 0; i < sticked.length; i++) {
                        var s = sticked[i];
                        s.stickyWrapper.css("height", s.stickyElement.outerHeight());
                        for (var property in s) {
                            if (options && options.hasOwnProperty(property)) s[property] = options[property]
                        }
                    }
                    scroller.apply(this, arguments)
                },
                unstick: function(options) {
                    return this.each(function() {
                        var unstickyElement = $(this);
                        var removeIdx = -1;
                        for (var i = 0; i < sticked.length; i++) {
                            if (sticked[i].stickyElement.get(0) == unstickyElement.get(0)) {
                                removeIdx = i
                            }
                        }
                        if (removeIdx != -1) {
                            sticked.splice(removeIdx, 1);
                            unstickyElement.unwrap();
                            unstickyElement.removeAttr("style")
                        }
                    })
                }
            };
        if (window.addEventListener) {
            window.addEventListener("scroll", scroller, false);
            window.addEventListener("resize", resizer, false)
        } else if (window.attachEvent) {
            window.attachEvent("onscroll", scroller);
            window.attachEvent("onresize", resizer)
        }
        $.fn.sticky = function(method) {
            if (methods[method]) {
                return methods[method].apply(this, Array.prototype.slice.call(arguments, 1))
            } else if (typeof method === "object" || !method) {
                return methods.init.apply(this, arguments)
            } else {
                $.error("Method " + method + " does not exist on jQuery.sticky")
            }
        };
        $.fn.unstick = function(method) {
            if (methods[method]) {
                return methods[method].apply(this, Array.prototype.slice.call(arguments, 1))
            } else if (typeof method === "object" || !method) {
                return methods.unstick.apply(this, arguments)
            } else {
                $.error("Method " + method + " does not exist on jQuery.sticky")
            }
        };
        $(window).load(function() {
            setTimeout(scroller, 0)
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.effect", ["jquery"], function(jQuery) {
    (function($, undefined) {
        var dataSpace = "ui-effects-";
        $.effects = {
            effect: {}
        };
        (function(jQuery, undefined) {
            var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
                rplusequals = /^([\-+])=\s*(\d+\.?\d*)/,
                stringParsers = [{
                    re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
                    parse: function(execResult) {
                        return [execResult[1], execResult[2], execResult[3], execResult[4]]
                    }
                }, {
                    re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
                    parse: function(execResult) {
                        return [execResult[1] * 2.55, execResult[2] * 2.55, execResult[3] * 2.55, execResult[4]]
                    }
                }, {
                    re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,
                    parse: function(execResult) {
                        return [parseInt(execResult[1], 16), parseInt(execResult[2], 16), parseInt(execResult[3], 16)]
                    }
                }, {
                    re: /#([a-f0-9])([a-f0-9])([a-f0-9])/,
                    parse: function(execResult) {
                        return [parseInt(execResult[1] + execResult[1], 16), parseInt(execResult[2] + execResult[2], 16), parseInt(execResult[3] + execResult[3], 16)]
                    }
                }, {
                    re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,
                    space: "hsla",
                    parse: function(execResult) {
                        return [execResult[1], execResult[2] / 100, execResult[3] / 100, execResult[4]]
                    }
                }],
                color = jQuery.Color = function(color, green, blue, alpha) {
                    return new jQuery.Color.fn.parse(color, green, blue, alpha)
                },
                spaces = {
                    rgba: {
                        props: {
                            red: {
                                idx: 0,
                                type: "byte"
                            },
                            green: {
                                idx: 1,
                                type: "byte"
                            },
                            blue: {
                                idx: 2,
                                type: "byte"
                            }
                        }
                    },
                    hsla: {
                        props: {
                            hue: {
                                idx: 0,
                                type: "degrees"
                            },
                            saturation: {
                                idx: 1,
                                type: "percent"
                            },
                            lightness: {
                                idx: 2,
                                type: "percent"
                            }
                        }
                    }
                },
                propTypes = {
                    "byte": {
                        floor: true,
                        max: 255
                    },
                    percent: {
                        max: 1
                    },
                    degrees: {
                        mod: 360,
                        floor: true
                    }
                },
                support = color.support = {},
                supportElem = jQuery("<p>")[0],
                colors, each = jQuery.each;
            supportElem.style.cssText = "background-color:rgba(1,1,1,.5)";
            support.rgba = supportElem.style.backgroundColor.indexOf("rgba") > -1;
            each(spaces, function(spaceName, space) {
                space.cache = "_" + spaceName;
                space.props.alpha = {
                    idx: 3,
                    type: "percent",
                    def: 1
                }
            });

            function clamp(value, prop, allowEmpty) {
                var type = propTypes[prop.type] || {};
                if (value == null) {
                    return allowEmpty || !prop.def ? null : prop.def
                }
                value = type.floor ? ~~value : parseFloat(value);
                if (isNaN(value)) {
                    return prop.def
                }
                if (type.mod) {
                    return (value + type.mod) % type.mod
                }
                return 0 > value ? 0 : type.max < value ? type.max : value
            }

            function stringParse(string) {
                var inst = color(),
                    rgba = inst._rgba = [];
                string = string.toLowerCase();
                each(stringParsers, function(i, parser) {
                    var parsed, match = parser.re.exec(string),
                        values = match && parser.parse(match),
                        spaceName = parser.space || "rgba";
                    if (values) {
                        parsed = inst[spaceName](values);
                        inst[spaces[spaceName].cache] = parsed[spaces[spaceName].cache];
                        rgba = inst._rgba = parsed._rgba;
                        return false
                    }
                });
                if (rgba.length) {
                    if (rgba.join() === "0,0,0,0") {
                        jQuery.extend(rgba, colors.transparent)
                    }
                    return inst
                }
                return colors[string]
            }
            color.fn = jQuery.extend(color.prototype, {
                parse: function(red, green, blue, alpha) {
                    if (red === undefined) {
                        this._rgba = [null, null, null, null];
                        return this
                    }
                    if (red.jquery || red.nodeType) {
                        red = jQuery(red).css(green);
                        green = undefined
                    }
                    var inst = this,
                        type = jQuery.type(red),
                        rgba = this._rgba = [];
                    if (green !== undefined) {
                        red = [red, green, blue, alpha];
                        type = "array"
                    }
                    if (type === "string") {
                        return this.parse(stringParse(red) || colors._default)
                    }
                    if (type === "array") {
                        each(spaces.rgba.props, function(key, prop) {
                            rgba[prop.idx] = clamp(red[prop.idx], prop)
                        });
                        return this
                    }
                    if (type === "object") {
                        if (red instanceof color) {
                            each(spaces, function(spaceName, space) {
                                if (red[space.cache]) {
                                    inst[space.cache] = red[space.cache].slice()
                                }
                            })
                        } else {
                            each(spaces, function(spaceName, space) {
                                var cache = space.cache;
                                each(space.props, function(key, prop) {
                                    if (!inst[cache] && space.to) {
                                        if (key === "alpha" || red[key] == null) {
                                            return
                                        }
                                        inst[cache] = space.to(inst._rgba)
                                    }
                                    inst[cache][prop.idx] = clamp(red[key], prop, true)
                                });
                                if (inst[cache] && jQuery.inArray(null, inst[cache].slice(0, 3)) < 0) {
                                    inst[cache][3] = 1;
                                    if (space.from) {
                                        inst._rgba = space.from(inst[cache])
                                    }
                                }
                            })
                        }
                        return this
                    }
                },
                is: function(compare) {
                    var is = color(compare),
                        same = true,
                        inst = this;
                    each(spaces, function(_, space) {
                        var localCache, isCache = is[space.cache];
                        if (isCache) {
                            localCache = inst[space.cache] || space.to && space.to(inst._rgba) || [];
                            each(space.props, function(_, prop) {
                                if (isCache[prop.idx] != null) {
                                    same = isCache[prop.idx] === localCache[prop.idx];
                                    return same
                                }
                            })
                        }
                        return same
                    });
                    return same
                },
                _space: function() {
                    var used = [],
                        inst = this;
                    each(spaces, function(spaceName, space) {
                        if (inst[space.cache]) {
                            used.push(spaceName)
                        }
                    });
                    return used.pop()
                },
                transition: function(other, distance) {
                    var end = color(other),
                        spaceName = end._space(),
                        space = spaces[spaceName],
                        startColor = this.alpha() === 0 ? color("transparent") : this,
                        start = startColor[space.cache] || space.to(startColor._rgba),
                        result = start.slice();
                    end = end[space.cache];
                    each(space.props, function(key, prop) {
                        var index = prop.idx,
                            startValue = start[index],
                            endValue = end[index],
                            type = propTypes[prop.type] || {};
                        if (endValue === null) {
                            return
                        }
                        if (startValue === null) {
                            result[index] = endValue
                        } else {
                            if (type.mod) {
                                if (endValue - startValue > type.mod / 2) {
                                    startValue += type.mod
                                } else if (startValue - endValue > type.mod / 2) {
                                    startValue -= type.mod
                                }
                            }
                            result[index] = clamp((endValue - startValue) * distance + startValue, prop)
                        }
                    });
                    return this[spaceName](result)
                },
                blend: function(opaque) {
                    if (this._rgba[3] === 1) {
                        return this
                    }
                    var rgb = this._rgba.slice(),
                        a = rgb.pop(),
                        blend = color(opaque)._rgba;
                    return color(jQuery.map(rgb, function(v, i) {
                        return (1 - a) * blend[i] + a * v
                    }))
                },
                toRgbaString: function() {
                    var prefix = "rgba(",
                        rgba = jQuery.map(this._rgba, function(v, i) {
                            return v == null ? i > 2 ? 1 : 0 : v
                        });
                    if (rgba[3] === 1) {
                        rgba.pop();
                        prefix = "rgb("
                    }
                    return prefix + rgba.join() + ")"
                },
                toHslaString: function() {
                    var prefix = "hsla(",
                        hsla = jQuery.map(this.hsla(), function(v, i) {
                            if (v == null) {
                                v = i > 2 ? 1 : 0
                            }
                            if (i && i < 3) {
                                v = Math.round(v * 100) + "%"
                            }
                            return v
                        });
                    if (hsla[3] === 1) {
                        hsla.pop();
                        prefix = "hsl("
                    }
                    return prefix + hsla.join() + ")"
                },
                toHexString: function(includeAlpha) {
                    var rgba = this._rgba.slice(),
                        alpha = rgba.pop();
                    if (includeAlpha) {
                        rgba.push(~~(alpha * 255))
                    }
                    return "#" + jQuery.map(rgba, function(v) {
                        v = (v || 0).toString(16);
                        return v.length === 1 ? "0" + v : v
                    }).join("")
                },
                toString: function() {
                    return this._rgba[3] === 0 ? "transparent" : this.toRgbaString()
                }
            });
            color.fn.parse.prototype = color.fn;

            function hue2rgb(p, q, h) {
                h = (h + 1) % 1;
                if (h * 6 < 1) {
                    return p + (q - p) * h * 6
                }
                if (h * 2 < 1) {
                    return q
                }
                if (h * 3 < 2) {
                    return p + (q - p) * (2 / 3 - h) * 6
                }
                return p
            }
            spaces.hsla.to = function(rgba) {
                if (rgba[0] == null || rgba[1] == null || rgba[2] == null) {
                    return [null, null, null, rgba[3]]
                }
                var r = rgba[0] / 255,
                    g = rgba[1] / 255,
                    b = rgba[2] / 255,
                    a = rgba[3],
                    max = Math.max(r, g, b),
                    min = Math.min(r, g, b),
                    diff = max - min,
                    add = max + min,
                    l = add * .5,
                    h, s;
                if (min === max) {
                    h = 0
                } else if (r === max) {
                    h = 60 * (g - b) / diff + 360
                } else if (g === max) {
                    h = 60 * (b - r) / diff + 120
                } else {
                    h = 60 * (r - g) / diff + 240
                }
                if (diff === 0) {
                    s = 0
                } else if (l <= .5) {
                    s = diff / add
                } else {
                    s = diff / (2 - add)
                }
                return [Math.round(h) % 360, s, l, a == null ? 1 : a]
            };
            spaces.hsla.from = function(hsla) {
                if (hsla[0] == null || hsla[1] == null || hsla[2] == null) {
                    return [null, null, null, hsla[3]]
                }
                var h = hsla[0] / 360,
                    s = hsla[1],
                    l = hsla[2],
                    a = hsla[3],
                    q = l <= .5 ? l * (1 + s) : l + s - l * s,
                    p = 2 * l - q;
                return [Math.round(hue2rgb(p, q, h + 1 / 3) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h - 1 / 3) * 255), a]
            };
            each(spaces, function(spaceName, space) {
                var props = space.props,
                    cache = space.cache,
                    to = space.to,
                    from = space.from;
                color.fn[spaceName] = function(value) {
                    if (to && !this[cache]) {
                        this[cache] = to(this._rgba)
                    }
                    if (value === undefined) {
                        return this[cache].slice()
                    }
                    var ret, type = jQuery.type(value),
                        arr = type === "array" || type === "object" ? value : arguments,
                        local = this[cache].slice();
                    each(props, function(key, prop) {
                        var val = arr[type === "object" ? key : prop.idx];
                        if (val == null) {
                            val = local[prop.idx]
                        }
                        local[prop.idx] = clamp(val, prop)
                    });
                    if (from) {
                        ret = color(from(local));
                        ret[cache] = local;
                        return ret
                    } else {
                        return color(local)
                    }
                };
                each(props, function(key, prop) {
                    if (color.fn[key]) {
                        return
                    }
                    color.fn[key] = function(value) {
                        var vtype = jQuery.type(value),
                            fn = key === "alpha" ? this._hsla ? "hsla" : "rgba" : spaceName,
                            local = this[fn](),
                            cur = local[prop.idx],
                            match;
                        if (vtype === "undefined") {
                            return cur
                        }
                        if (vtype === "function") {
                            value = value.call(this, cur);
                            vtype = jQuery.type(value)
                        }
                        if (value == null && prop.empty) {
                            return this
                        }
                        if (vtype === "string") {
                            match = rplusequals.exec(value);
                            if (match) {
                                value = cur + parseFloat(match[2]) * (match[1] === "+" ? 1 : -1)
                            }
                        }
                        local[prop.idx] = value;
                        return this[fn](local)
                    }
                })
            });
            color.hook = function(hook) {
                var hooks = hook.split(" ");
                each(hooks, function(i, hook) {
                    jQuery.cssHooks[hook] = {
                        set: function(elem, value) {
                            var parsed, curElem, backgroundColor = "";
                            if (value !== "transparent" && (jQuery.type(value) !== "string" || (parsed = stringParse(value)))) {
                                value = color(parsed || value);
                                if (!support.rgba && value._rgba[3] !== 1) {
                                    curElem = hook === "backgroundColor" ? elem.parentNode : elem;
                                    while ((backgroundColor === "" || backgroundColor === "transparent") && curElem && curElem.style) {
                                        try {
                                            backgroundColor = jQuery.css(curElem, "backgroundColor");
                                            curElem = curElem.parentNode
                                        } catch (e) {}
                                    }
                                    value = value.blend(backgroundColor && backgroundColor !== "transparent" ? backgroundColor : "_default")
                                }
                                value = value.toRgbaString()
                            }
                            try {
                                elem.style[hook] = value
                            } catch (e) {}
                        }
                    };
                    jQuery.fx.step[hook] = function(fx) {
                        if (!fx.colorInit) {
                            fx.start = color(fx.elem, hook);
                            fx.end = color(fx.end);
                            fx.colorInit = true
                        }
                        jQuery.cssHooks[hook].set(fx.elem, fx.start.transition(fx.end, fx.pos))
                    }
                })
            };
            color.hook(stepHooks);
            jQuery.cssHooks.borderColor = {
                expand: function(value) {
                    var expanded = {};
                    each(["Top", "Right", "Bottom", "Left"], function(i, part) {
                        expanded["border" + part + "Color"] = value
                    });
                    return expanded
                }
            };
            colors = jQuery.Color.names = {
                aqua: "#00ffff",
                black: "#000000",
                blue: "#0000ff",
                fuchsia: "#ff00ff",
                gray: "#808080",
                green: "#008000",
                lime: "#00ff00",
                maroon: "#800000",
                navy: "#000080",
                olive: "#808000",
                purple: "#800080",
                red: "#ff0000",
                silver: "#c0c0c0",
                teal: "#008080",
                white: "#ffffff",
                yellow: "#ffff00",
                transparent: [null, null, null, 0],
                _default: "#ffffff"
            }
        })(jQuery);
        (function() {
            var classAnimationActions = ["add", "remove", "toggle"],
                shorthandStyles = {
                    border: 1,
                    borderBottom: 1,
                    borderColor: 1,
                    borderLeft: 1,
                    borderRight: 1,
                    borderTop: 1,
                    borderWidth: 1,
                    margin: 1,
                    padding: 1
                };
            $.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function(_, prop) {
                $.fx.step[prop] = function(fx) {
                    if (fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr) {
                        jQuery.style(fx.elem, prop, fx.end);
                        fx.setAttr = true
                    }
                }
            });

            function getElementStyles(elem) {
                var key, len, style = elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle,
                    styles = {};
                if (style && style.length && style[0] && style[style[0]]) {
                    len = style.length;
                    while (len--) {
                        key = style[len];
                        if (typeof style[key] === "string") {
                            styles[$.camelCase(key)] = style[key]
                        }
                    }
                } else {
                    for (key in style) {
                        if (typeof style[key] === "string") {
                            styles[key] = style[key]
                        }
                    }
                }
                return styles
            }

            function styleDifference(oldStyle, newStyle) {
                var diff = {},
                    name, value;
                for (name in newStyle) {
                    value = newStyle[name];
                    if (oldStyle[name] !== value) {
                        if (!shorthandStyles[name]) {
                            if ($.fx.step[name] || !isNaN(parseFloat(value))) {
                                diff[name] = value
                            }
                        }
                    }
                }
                return diff
            }
            if (!$.fn.addBack) {
                $.fn.addBack = function(selector) {
                    return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector))
                }
            }
            $.effects.animateClass = function(value, duration, easing, callback) {
                var o = $.speed(duration, easing, callback);
                return this.queue(function() {
                    var animated = $(this),
                        baseClass = animated.attr("class") || "",
                        applyClassChange, allAnimations = o.children ? animated.find("*").addBack() : animated;
                    allAnimations = allAnimations.map(function() {
                        var el = $(this);
                        return {
                            el: el,
                            start: getElementStyles(this)
                        }
                    });
                    applyClassChange = function() {
                        $.each(classAnimationActions, function(i, action) {
                            if (value[action]) {
                                animated[action + "Class"](value[action])
                            }
                        })
                    };
                    applyClassChange();
                    allAnimations = allAnimations.map(function() {
                        this.end = getElementStyles(this.el[0]);
                        this.diff = styleDifference(this.start, this.end);
                        return this
                    });
                    animated.attr("class", baseClass);
                    allAnimations = allAnimations.map(function() {
                        var styleInfo = this,
                            dfd = $.Deferred(),
                            opts = $.extend({}, o, {
                                queue: false,
                                complete: function() {
                                    dfd.resolve(styleInfo)
                                }
                            });
                        this.el.animate(this.diff, opts);
                        return dfd.promise()
                    });
                    $.when.apply($, allAnimations.get()).done(function() {
                        applyClassChange();
                        $.each(arguments, function() {
                            var el = this.el;
                            $.each(this.diff, function(key) {
                                el.css(key, "")
                            })
                        });
                        o.complete.call(animated[0])
                    })
                })
            };
            $.fn.extend({
                addClass: function(orig) {
                    return function(classNames, speed, easing, callback) {
                        return speed ? $.effects.animateClass.call(this, {
                            add: classNames
                        }, speed, easing, callback) : orig.apply(this, arguments)
                    }
                }($.fn.addClass),
                removeClass: function(orig) {
                    return function(classNames, speed, easing, callback) {
                        return arguments.length > 1 ? $.effects.animateClass.call(this, {
                            remove: classNames
                        }, speed, easing, callback) : orig.apply(this, arguments)
                    }
                }($.fn.removeClass),
                toggleClass: function(orig) {
                    return function(classNames, force, speed, easing, callback) {
                        if (typeof force === "boolean" || force === undefined) {
                            if (!speed) {
                                return orig.apply(this, arguments)
                            } else {
                                return $.effects.animateClass.call(this, force ? {
                                    add: classNames
                                } : {
                                    remove: classNames
                                }, speed, easing, callback)
                            }
                        } else {
                            return $.effects.animateClass.call(this, {
                                toggle: classNames
                            }, force, speed, easing)
                        }
                    }
                }($.fn.toggleClass),
                switchClass: function(remove, add, speed, easing, callback) {
                    return $.effects.animateClass.call(this, {
                        add: add,
                        remove: remove
                    }, speed, easing, callback)
                }
            })
        })();
        (function() {
            $.extend($.effects, {
                version: "@VERSION",
                save: function(element, set) {
                    for (var i = 0; i < set.length; i++) {
                        if (set[i] !== null) {
                            element.data(dataSpace + set[i], element[0].style[set[i]])
                        }
                    }
                },
                restore: function(element, set) {
                    var val, i;
                    for (i = 0; i < set.length; i++) {
                        if (set[i] !== null) {
                            val = element.data(dataSpace + set[i]);
                            if (val === undefined) {
                                val = ""
                            }
                            element.css(set[i], val)
                        }
                    }
                },
                setMode: function(el, mode) {
                    if (mode === "toggle") {
                        mode = el.is(":hidden") ? "show" : "hide"
                    }
                    return mode
                },
                getBaseline: function(origin, original) {
                    var y, x;
                    switch (origin[0]) {
                        case "top":
                            y = 0;
                            break;
                        case "middle":
                            y = .5;
                            break;
                        case "bottom":
                            y = 1;
                            break;
                        default:
                            y = origin[0] / original.height
                    }
                    switch (origin[1]) {
                        case "left":
                            x = 0;
                            break;
                        case "center":
                            x = .5;
                            break;
                        case "right":
                            x = 1;
                            break;
                        default:
                            x = origin[1] / original.width
                    }
                    return {
                        x: x,
                        y: y
                    }
                },
                createWrapper: function(element) {
                    if (element.parent().is(".ui-effects-wrapper")) {
                        return element.parent()
                    }
                    var props = {
                            width: element.outerWidth(true),
                            height: element.outerHeight(true),
                            "float": element.css("float")
                        },
                        wrapper = $("<div></div>").addClass("ui-effects-wrapper").css({
                            fontSize: "100%",
                            background: "transparent",
                            border: "none",
                            margin: 0,
                            padding: 0
                        }),
                        size = {
                            width: element.width(),
                            height: element.height()
                        },
                        active = document.activeElement;
                    try {
                        active.id
                    } catch (e) {
                        active = document.body
                    }
                    element.wrap(wrapper);
                    if (element[0] === active || $.contains(element[0], active)) {
                        $(active).focus()
                    }
                    wrapper = element.parent();
                    if (element.css("position") === "static") {
                        wrapper.css({
                            position: "relative"
                        });
                        element.css({
                            position: "relative"
                        })
                    } else {
                        $.extend(props, {
                            position: element.css("position"),
                            zIndex: element.css("z-index")
                        });
                        $.each(["top", "left", "bottom", "right"], function(i, pos) {
                            props[pos] = element.css(pos);
                            if (isNaN(parseInt(props[pos], 10))) {
                                props[pos] = "auto"
                            }
                        });
                        element.css({
                            position: "relative",
                            top: 0,
                            left: 0,
                            right: "auto",
                            bottom: "auto"
                        })
                    }
                    element.css(size);
                    return wrapper.css(props).show()
                },
                removeWrapper: function(element) {
                    var active = document.activeElement;
                    if (element.parent().is(".ui-effects-wrapper")) {
                        element.parent().replaceWith(element);
                        if (element[0] === active || $.contains(element[0], active)) {
                            $(active).focus()
                        }
                    }
                    return element
                },
                setTransition: function(element, list, factor, value) {
                    value = value || {};
                    $.each(list, function(i, x) {
                        var unit = element.cssUnit(x);
                        if (unit[0] > 0) {
                            value[x] = unit[0] * factor + unit[1]
                        }
                    });
                    return value
                }
            });

            function _normalizeArguments(effect, options, speed, callback) {
                if ($.isPlainObject(effect)) {
                    options = effect;
                    effect = effect.effect
                }
                effect = {
                    effect: effect
                };
                if (options == null) {
                    options = {}
                }
                if ($.isFunction(options)) {
                    callback = options;
                    speed = null;
                    options = {}
                }
                if (typeof options === "number" || $.fx.speeds[options]) {
                    callback = speed;
                    speed = options;
                    options = {}
                }
                if ($.isFunction(speed)) {
                    callback = speed;
                    speed = null
                }
                if (options) {
                    $.extend(effect, options)
                }
                speed = speed || options.duration;
                effect.duration = $.fx.off ? 0 : typeof speed === "number" ? speed : speed in $.fx.speeds ? $.fx.speeds[speed] : $.fx.speeds._default;
                effect.complete = callback || options.complete;
                return effect
            }

            function standardAnimationOption(option) {
                if (!option || typeof option === "number" || $.fx.speeds[option]) {
                    return true
                }
                if (typeof option === "string" && !$.effects.effect[option]) {
                    return true
                }
                if ($.isFunction(option)) {
                    return true
                }
                if (typeof option === "object" && !option.effect) {
                    return true
                }
                return false
            }
            $.fn.extend({
                effect: function() {
                    var args = _normalizeArguments.apply(this, arguments),
                        mode = args.mode,
                        queue = args.queue,
                        effectMethod = $.effects.effect[args.effect];
                    if ($.fx.off || !effectMethod) {
                        if (mode) {
                            return this[mode](args.duration, args.complete)
                        } else {
                            return this.each(function() {
                                if (args.complete) {
                                    args.complete.call(this)
                                }
                            })
                        }
                    }

                    function run(next) {
                        var elem = $(this),
                            complete = args.complete,
                            mode = args.mode;

                        function done() {
                            if ($.isFunction(complete)) {
                                complete.call(elem[0])
                            }
                            if ($.isFunction(next)) {
                                next()
                            }
                        }
                        if (elem.is(":hidden") ? mode === "hide" : mode === "show") {
                            elem[mode]();
                            done()
                        } else {
                            effectMethod.call(elem[0], args, done)
                        }
                    }
                    return queue === false ? this.each(run) : this.queue(queue || "fx", run)
                },
                show: function(orig) {
                    return function(option) {
                        if (standardAnimationOption(option)) {
                            return orig.apply(this, arguments)
                        } else {
                            var args = _normalizeArguments.apply(this, arguments);
                            args.mode = "show";
                            return this.effect.call(this, args)
                        }
                    }
                }($.fn.show),
                hide: function(orig) {
                    return function(option) {
                        if (standardAnimationOption(option)) {
                            return orig.apply(this, arguments)
                        } else {
                            var args = _normalizeArguments.apply(this, arguments);
                            args.mode = "hide";
                            return this.effect.call(this, args)
                        }
                    }
                }($.fn.hide),
                toggle: function(orig) {
                    return function(option) {
                        if (standardAnimationOption(option) || typeof option === "boolean") {
                            return orig.apply(this, arguments)
                        } else {
                            var args = _normalizeArguments.apply(this, arguments);
                            args.mode = "toggle";
                            return this.effect.call(this, args)
                        }
                    }
                }($.fn.toggle),
                cssUnit: function(key) {
                    var style = this.css(key),
                        val = [];
                    $.each(["em", "px", "%", "pt"], function(i, unit) {
                        if (style.indexOf(unit) > 0) {
                            val = [parseFloat(style), unit]
                        }
                    });
                    return val
                }
            })
        })();
        (function() {
            var baseEasings = {};
            $.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function(i, name) {
                baseEasings[name] = function(p) {
                    return Math.pow(p, i + 2)
                }
            });
            $.extend(baseEasings, {
                Sine: function(p) {
                    return 1 - Math.cos(p * Math.PI / 2)
                },
                Circ: function(p) {
                    return 1 - Math.sqrt(1 - p * p)
                },
                Elastic: function(p) {
                    return p === 0 || p === 1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15)
                },
                Back: function(p) {
                    return p * p * (3 * p - 2)
                },
                Bounce: function(p) {
                    var pow2, bounce = 4;
                    while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) {}
                    return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2)
                }
            });
            $.each(baseEasings, function(name, easeIn) {
                $.easing["easeIn" + name] = easeIn;
                $.easing["easeOut" + name] = function(p) {
                    return 1 - easeIn(1 - p)
                };
                $.easing["easeInOut" + name] = function(p) {
                    return p < .5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2
                }
            })
        })()
    })(jQuery);
    return jQuery
});
define("jquery.ui.mouse", ["jquery"], function(jQuery) {
    (function($, undefined) {
        var mouseHandled = false;
        $(document).mouseup(function() {
            mouseHandled = false
        });
        $.widget("ui.mouse", {
            version: "@VERSION",
            options: {
                cancel: "input,textarea,button,select,option",
                distance: 1,
                delay: 0
            },
            _mouseInit: function() {
                var that = this;
                this.element.bind("mousedown." + this.widgetName, function(event) {
                    return that._mouseDown(event)
                }).bind("click." + this.widgetName, function(event) {
                    if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
                        $.removeData(event.target, that.widgetName + ".preventClickEvent");
                        event.stopImmediatePropagation();
                        return false
                    }
                });
                this.started = false
            },
            _mouseDestroy: function() {
                this.element.unbind("." + this.widgetName);
                if (this._mouseMoveDelegate) {
                    this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate)
                }
            },
            _mouseDown: function(event) {
                if (mouseHandled) {
                    return
                }
                this._mouseStarted && this._mouseUp(event);
                this._mouseDownEvent = event;
                var that = this,
                    btnIsLeft = event.which === 1,
                    elIsCancel = typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false;
                if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
                    return true
                }
                this.mouseDelayMet = !this.options.delay;
                if (!this.mouseDelayMet) {
                    this._mouseDelayTimer = setTimeout(function() {
                        that.mouseDelayMet = true
                    }, this.options.delay)
                }
                if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
                    this._mouseStarted = this._mouseStart(event) !== false;
                    if (!this._mouseStarted) {
                        event.preventDefault();
                        return true
                    }
                }
                if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
                    $.removeData(event.target, this.widgetName + ".preventClickEvent")
                }
                this._mouseMoveDelegate = function(event) {
                    return that._mouseMove(event)
                };
                this._mouseUpDelegate = function(event) {
                    return that._mouseUp(event)
                };
                this.document.bind("mousemove." + this.widgetName, this._mouseMoveDelegate).bind("mouseup." + this.widgetName, this._mouseUpDelegate);
                event.preventDefault();
                mouseHandled = true;
                return true
            },
            _mouseMove: function(event) {
                if ($.ui.ie && (!document.documentMode || document.documentMode < 9) && !event.button) {
                    return this._mouseUp(event)
                } else if (!event.which) {
                    return this._mouseUp(event)
                }
                if (this._mouseStarted) {
                    this._mouseDrag(event);
                    return event.preventDefault()
                }
                if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
                    this._mouseStarted = this._mouseStart(this._mouseDownEvent, event) !== false;
                    this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event)
                }
                return !this._mouseStarted
            },
            _mouseUp: function(event) {
                this.document.unbind("mousemove." + this.widgetName, this._mouseMoveDelegate).unbind("mouseup." + this.widgetName, this._mouseUpDelegate);
                if (this._mouseStarted) {
                    this._mouseStarted = false;
                    if (event.target === this._mouseDownEvent.target) {
                        $.data(event.target, this.widgetName + ".preventClickEvent", true)
                    }
                    this._mouseStop(event)
                }
                mouseHandled = false;
                return false
            },
            _mouseDistanceMet: function(event) {
                return Math.max(Math.abs(this._mouseDownEvent.pageX - event.pageX), Math.abs(this._mouseDownEvent.pageY - event.pageY)) >= this.options.distance
            },
            _mouseDelayMet: function() {
                return this.mouseDelayMet
            },
            _mouseStart: function() {},
            _mouseDrag: function() {},
            _mouseStop: function() {},
            _mouseCapture: function() {
                return true
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.position", ["jquery"], function(jQuery) {
    (function($, undefined) {
        (function() {
            $.ui = $.ui || {};
            var cachedScrollbarWidth, max = Math.max,
                abs = Math.abs,
                round = Math.round,
                rhorizontal = /left|center|right/,
                rvertical = /top|center|bottom/,
                roffset = /[\+\-]\d+(\.[\d]+)?%?/,
                rposition = /^\w+/,
                rpercent = /%$/,
                _position = $.fn.position;

            function getOffsets(offsets, width, height) {
                return [parseFloat(offsets[0]) * (rpercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (rpercent.test(offsets[1]) ? height / 100 : 1)]
            }

            function parseCss(element, property) {
                return parseInt($.css(element, property), 10) || 0
            }

            function getDimensions(elem) {
                var raw = elem[0];
                if (raw.nodeType === 9) {
                    return {
                        width: elem.width(),
                        height: elem.height(),
                        offset: {
                            top: 0,
                            left: 0
                        }
                    }
                }
                if ($.isWindow(raw)) {
                    return {
                        width: elem.width(),
                        height: elem.height(),
                        offset: {
                            top: elem.scrollTop(),
                            left: elem.scrollLeft()
                        }
                    }
                }
                if (raw.preventDefault) {
                    return {
                        width: 0,
                        height: 0,
                        offset: {
                            top: raw.pageY,
                            left: raw.pageX
                        }
                    }
                }
                return {
                    width: elem.outerWidth(),
                    height: elem.outerHeight(),
                    offset: elem.offset()
                }
            }
            $.position = {
                scrollbarWidth: function() {
                    if (cachedScrollbarWidth !== undefined) {
                        return cachedScrollbarWidth
                    }
                    var w1, w2, div = $("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),
                        innerDiv = div.children()[0];
                    $("body").append(div);
                    w1 = innerDiv.offsetWidth;
                    div.css("overflow", "scroll");
                    w2 = innerDiv.offsetWidth;
                    if (w1 === w2) {
                        w2 = div[0].clientWidth
                    }
                    div.remove();
                    return cachedScrollbarWidth = w1 - w2
                },
                getScrollInfo: function(within) {
                    var overflowX = within.isWindow || within.isDocument ? "" : within.element.css("overflow-x"),
                        overflowY = within.isWindow || within.isDocument ? "" : within.element.css("overflow-y"),
                        hasOverflowX = overflowX === "scroll" || overflowX === "auto" && within.width < within.element[0].scrollWidth,
                        hasOverflowY = overflowY === "scroll" || overflowY === "auto" && within.height < within.element[0].scrollHeight;
                    return {
                        width: hasOverflowY ? $.position.scrollbarWidth() : 0,
                        height: hasOverflowX ? $.position.scrollbarWidth() : 0
                    }
                },
                getWithinInfo: function(element) {
                    var withinElement = $(element || window),
                        isWindow = $.isWindow(withinElement[0]),
                        isDocument = !!withinElement[0] && withinElement[0].nodeType === 9;
                    return {
                        element: withinElement,
                        isWindow: isWindow,
                        isDocument: isDocument,
                        offset: withinElement.offset() || {
                            left: 0,
                            top: 0
                        },
                        scrollLeft: withinElement.scrollLeft(),
                        scrollTop: withinElement.scrollTop(),
                        width: isWindow ? withinElement.width() : withinElement.outerWidth(),
                        height: isWindow ? withinElement.height() : withinElement.outerHeight()
                    }
                }
            };
            $.fn.position = function(options) {
                if (!options || !options.of) {
                    return _position.apply(this, arguments)
                }
                options = $.extend({}, options);
                var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions, target = $(options.of),
                    within = $.position.getWithinInfo(options.within),
                    scrollInfo = $.position.getScrollInfo(within),
                    collision = (options.collision || "flip").split(" "),
                    offsets = {};
                dimensions = getDimensions(target);
                if (target[0].preventDefault) {
                    options.at = "left top"
                }
                targetWidth = dimensions.width;
                targetHeight = dimensions.height;
                targetOffset = dimensions.offset;
                basePosition = $.extend({}, targetOffset);
                $.each(["my", "at"], function() {
                    var pos = (options[this] || "").split(" "),
                        horizontalOffset, verticalOffset;
                    if (pos.length === 1) {
                        pos = rhorizontal.test(pos[0]) ? pos.concat(["center"]) : rvertical.test(pos[0]) ? ["center"].concat(pos) : ["center", "center"]
                    }
                    pos[0] = rhorizontal.test(pos[0]) ? pos[0] : "center";
                    pos[1] = rvertical.test(pos[1]) ? pos[1] : "center";
                    horizontalOffset = roffset.exec(pos[0]);
                    verticalOffset = roffset.exec(pos[1]);
                    offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0];
                    options[this] = [rposition.exec(pos[0])[0], rposition.exec(pos[1])[0]]
                });
                if (collision.length === 1) {
                    collision[1] = collision[0]
                }
                if (options.at[0] === "right") {
                    basePosition.left += targetWidth
                } else if (options.at[0] === "center") {
                    basePosition.left += targetWidth / 2
                }
                if (options.at[1] === "bottom") {
                    basePosition.top += targetHeight
                } else if (options.at[1] === "center") {
                    basePosition.top += targetHeight / 2
                }
                atOffset = getOffsets(offsets.at, targetWidth, targetHeight);
                basePosition.left += atOffset[0];
                basePosition.top += atOffset[1];
                return this.each(function() {
                    var collisionPosition, using, elem = $(this),
                        elemWidth = elem.outerWidth(),
                        elemHeight = elem.outerHeight(),
                        marginLeft = parseCss(this, "marginLeft"),
                        marginTop = parseCss(this, "marginTop"),
                        collisionWidth = elemWidth + marginLeft + parseCss(this, "marginRight") + scrollInfo.width,
                        collisionHeight = elemHeight + marginTop + parseCss(this, "marginBottom") + scrollInfo.height,
                        position = $.extend({}, basePosition),
                        myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight());
                    if (options.my[0] === "right") {
                        position.left -= elemWidth
                    } else if (options.my[0] === "center") {
                        position.left -= elemWidth / 2
                    }
                    if (options.my[1] === "bottom") {
                        position.top -= elemHeight
                    } else if (options.my[1] === "center") {
                        position.top -= elemHeight / 2
                    }
                    position.left += myOffset[0];
                    position.top += myOffset[1];
                    if (!$.support.offsetFractions) {
                        position.left = round(position.left);
                        position.top = round(position.top)
                    }
                    collisionPosition = {
                        marginLeft: marginLeft,
                        marginTop: marginTop
                    };
                    $.each(["left", "top"], function(i, dir) {
                        if ($.ui.position[collision[i]]) {
                            $.ui.position[collision[i]][dir](position, {
                                targetWidth: targetWidth,
                                targetHeight: targetHeight,
                                elemWidth: elemWidth,
                                elemHeight: elemHeight,
                                collisionPosition: collisionPosition,
                                collisionWidth: collisionWidth,
                                collisionHeight: collisionHeight,
                                offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]],
                                my: options.my,
                                at: options.at,
                                within: within,
                                elem: elem
                            })
                        }
                    });
                    if (options.using) {
                        using = function(props) {
                            var left = targetOffset.left - position.left,
                                right = left + targetWidth - elemWidth,
                                top = targetOffset.top - position.top,
                                bottom = top + targetHeight - elemHeight,
                                feedback = {
                                    target: {
                                        element: target,
                                        left: targetOffset.left,
                                        top: targetOffset.top,
                                        width: targetWidth,
                                        height: targetHeight
                                    },
                                    element: {
                                        element: elem,
                                        left: position.left,
                                        top: position.top,
                                        width: elemWidth,
                                        height: elemHeight
                                    },
                                    horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
                                    vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
                                };
                            if (targetWidth < elemWidth && abs(left + right) < targetWidth) {
                                feedback.horizontal = "center"
                            }
                            if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) {
                                feedback.vertical = "middle"
                            }
                            if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) {
                                feedback.important = "horizontal"
                            } else {
                                feedback.important = "vertical"
                            }
                            options.using.call(this, props, feedback)
                        }
                    }
                    elem.offset($.extend(position, {
                        using: using
                    }))
                })
            };
            $.ui.position = {
                fit: {
                    left: function(position, data) {
                        var within = data.within,
                            withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
                            outerWidth = within.width,
                            collisionPosLeft = position.left - data.collisionPosition.marginLeft,
                            overLeft = withinOffset - collisionPosLeft,
                            overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset,
                            newOverRight;
                        if (data.collisionWidth > outerWidth) {
                            if (overLeft > 0 && overRight <= 0) {
                                newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset;
                                position.left += overLeft - newOverRight
                            } else if (overRight > 0 && overLeft <= 0) {
                                position.left = withinOffset
                            } else {
                                if (overLeft > overRight) {
                                    position.left = withinOffset + outerWidth - data.collisionWidth
                                } else {
                                    position.left = withinOffset
                                }
                            }
                        } else if (overLeft > 0) {
                            position.left += overLeft
                        } else if (overRight > 0) {
                            position.left -= overRight
                        } else {
                            position.left = max(position.left - collisionPosLeft, position.left)
                        }
                    },
                    top: function(position, data) {
                        var within = data.within,
                            withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
                            outerHeight = data.within.height,
                            collisionPosTop = position.top - data.collisionPosition.marginTop,
                            overTop = withinOffset - collisionPosTop,
                            overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset,
                            newOverBottom;
                        if (data.collisionHeight > outerHeight) {
                            if (overTop > 0 && overBottom <= 0) {
                                newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset;
                                position.top += overTop - newOverBottom
                            } else if (overBottom > 0 && overTop <= 0) {
                                position.top = withinOffset
                            } else {
                                if (overTop > overBottom) {
                                    position.top = withinOffset + outerHeight - data.collisionHeight
                                } else {
                                    position.top = withinOffset
                                }
                            }
                        } else if (overTop > 0) {
                            position.top += overTop
                        } else if (overBottom > 0) {
                            position.top -= overBottom
                        } else {
                            position.top = max(position.top - collisionPosTop, position.top)
                        }
                    }
                },
                flip: {
                    left: function(position, data) {
                        var within = data.within,
                            withinOffset = within.offset.left + within.scrollLeft,
                            outerWidth = within.width,
                            offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
                            collisionPosLeft = position.left - data.collisionPosition.marginLeft,
                            overLeft = collisionPosLeft - offsetLeft,
                            overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
                            myOffset = data.my[0] === "left" ? -data.elemWidth : data.my[0] === "right" ? data.elemWidth : 0,
                            atOffset = data.at[0] === "left" ? data.targetWidth : data.at[0] === "right" ? -data.targetWidth : 0,
                            offset = -2 * data.offset[0],
                            newOverRight, newOverLeft;
                        if (overLeft < 0) {
                            newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset;
                            if (newOverRight < 0 || newOverRight < abs(overLeft)) {
                                position.left += myOffset + atOffset + offset
                            }
                        } else if (overRight > 0) {
                            newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft;
                            if (newOverLeft > 0 || abs(newOverLeft) < overRight) {
                                position.left += myOffset + atOffset + offset
                            }
                        }
                    },
                    top: function(position, data) {
                        var within = data.within,
                            withinOffset = within.offset.top + within.scrollTop,
                            outerHeight = within.height,
                            offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
                            collisionPosTop = position.top - data.collisionPosition.marginTop,
                            overTop = collisionPosTop - offsetTop,
                            overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,
                            top = data.my[1] === "top",
                            myOffset = top ? -data.elemHeight : data.my[1] === "bottom" ? data.elemHeight : 0,
                            atOffset = data.at[1] === "top" ? data.targetHeight : data.at[1] === "bottom" ? -data.targetHeight : 0,
                            offset = -2 * data.offset[1],
                            newOverTop, newOverBottom;
                        if (overTop < 0) {
                            newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset;
                            if (position.top + myOffset + atOffset + offset > overTop && (newOverBottom < 0 || newOverBottom < abs(overTop))) {
                                position.top += myOffset + atOffset + offset
                            }
                        } else if (overBottom > 0) {
                            newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop;
                            if (position.top + myOffset + atOffset + offset > overBottom && (newOverTop > 0 || abs(newOverTop) < overBottom)) {
                                position.top += myOffset + atOffset + offset
                            }
                        }
                    }
                },
                flipfit: {
                    left: function() {
                        $.ui.position.flip.left.apply(this, arguments);
                        $.ui.position.fit.left.apply(this, arguments)
                    },
                    top: function() {
                        $.ui.position.flip.top.apply(this, arguments);
                        $.ui.position.fit.top.apply(this, arguments)
                    }
                }
            };
            (function() {
                var testElement, testElementParent, testElementStyle, offsetLeft, i, body = document.getElementsByTagName("body")[0],
                    div = document.createElement("div");
                testElement = document.createElement(body ? "div" : "body");
                testElementStyle = {
                    visibility: "hidden",
                    width: 0,
                    height: 0,
                    border: 0,
                    margin: 0,
                    background: "none"
                };
                if (body) {
                    $.extend(testElementStyle, {
                        position: "absolute",
                        left: "-1000px",
                        top: "-1000px"
                    })
                }
                for (i in testElementStyle) {
                    testElement.style[i] = testElementStyle[i]
                }
                testElement.appendChild(div);
                testElementParent = body || document.documentElement;
                testElementParent.insertBefore(testElement, testElementParent.firstChild);
                div.style.cssText = "position: absolute; left: 10.7432222px;";
                offsetLeft = $(div).offset().left;
                $.support.offsetFractions = offsetLeft > 10 && offsetLeft < 11;
                testElement.innerHTML = "";
                testElementParent.removeChild(testElement)
            })()
        })()
    })(jQuery);
    return jQuery
});
define("jquery.ui.resizable", ["jquery"], function(jQuery) {
    (function($, undefined) {
        $.widget("ui.resizable", $.ui.mouse, {
            version: "@VERSION",
            widgetEventPrefix: "resize",
            options: {
                alsoResize: false,
                animate: false,
                animateDuration: "slow",
                animateEasing: "swing",
                aspectRatio: false,
                autoHide: false,
                containment: false,
                ghost: false,
                grid: false,
                handles: "e,s,se",
                helper: false,
                maxHeight: null,
                maxWidth: null,
                minHeight: 10,
                minWidth: 10,
                zIndex: 90,
                resize: null,
                start: null,
                stop: null
            },
            _num: function(value) {
                return parseInt(value, 10) || 0
            },
            _isNumber: function(value) {
                return !isNaN(parseInt(value, 10))
            },
            _hasScroll: function(el, a) {
                if ($(el).css("overflow") === "hidden") {
                    return false
                }
                var scroll = a && a === "left" ? "scrollLeft" : "scrollTop",
                    has = false;
                if (el[scroll] > 0) {
                    return true
                }
                el[scroll] = 1;
                has = el[scroll] > 0;
                el[scroll] = 0;
                return has
            },
            _create: function() {
                var n, i, handle, axis, hname, that = this,
                    o = this.options;
                this.element.addClass("ui-resizable");
                $.extend(this, {
                    _aspectRatio: !!o.aspectRatio,
                    aspectRatio: o.aspectRatio,
                    originalElement: this.element,
                    _proportionallyResizeElements: [],
                    _helper: o.helper || o.ghost || o.animate ? o.helper || "ui-resizable-helper" : null
                });
                if (this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)) {
                    this.element.wrap($("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({
                        position: this.element.css("position"),
                        width: this.element.outerWidth(),
                        height: this.element.outerHeight(),
                        top: this.element.css("top"),
                        left: this.element.css("left")
                    }));
                    this.element = this.element.parent().data("ui-resizable", this.element.resizable("instance"));
                    this.elementIsWrapper = true;
                    this.element.css({
                        marginLeft: this.originalElement.css("marginLeft"),
                        marginTop: this.originalElement.css("marginTop"),
                        marginRight: this.originalElement.css("marginRight"),
                        marginBottom: this.originalElement.css("marginBottom")
                    });
                    this.originalElement.css({
                        marginLeft: 0,
                        marginTop: 0,
                        marginRight: 0,
                        marginBottom: 0
                    });
                    this.originalResizeStyle = this.originalElement.css("resize");
                    this.originalElement.css("resize", "none");
                    this._proportionallyResizeElements.push(this.originalElement.css({
                        position: "static",
                        zoom: 1,
                        display: "block"
                    }));
                    this.originalElement.css({
                        margin: this.originalElement.css("margin")
                    });
                    this._proportionallyResize()
                }
                this.handles = o.handles || (!$(".ui-resizable-handle", this.element).length ? "e,s,se" : {
                    n: ".ui-resizable-n",
                    e: ".ui-resizable-e",
                    s: ".ui-resizable-s",
                    w: ".ui-resizable-w",
                    se: ".ui-resizable-se",
                    sw: ".ui-resizable-sw",
                    ne: ".ui-resizable-ne",
                    nw: ".ui-resizable-nw"
                });
                if (this.handles.constructor === String) {
                    if (this.handles === "all") {
                        this.handles = "n,e,s,w,se,sw,ne,nw"
                    }
                    n = this.handles.split(",");
                    this.handles = {};
                    for (i = 0; i < n.length; i++) {
                        handle = $.trim(n[i]);
                        hname = "ui-resizable-" + handle;
                        axis = $("<div class='ui-resizable-handle " + hname + "'></div>");
                        axis.css({
                            zIndex: o.zIndex
                        });
                        if ("se" === handle) {
                            axis.addClass("ui-icon ui-icon-gripsmall-diagonal-se")
                        }
                        this.handles[handle] = ".ui-resizable-" + handle;
                        this.element.append(axis)
                    }
                }
                this._renderAxis = function(target) {
                    var i, axis, padPos, padWrapper;
                    target = target || this.element;
                    for (i in this.handles) {
                        if (this.handles[i].constructor === String) {
                            this.handles[i] = this.element.children(this.handles[i]).first().show()
                        }
                        if (this.elementIsWrapper && this.originalElement[0].nodeName.match(/textarea|input|select|button/i)) {
                            axis = $(this.handles[i], this.element);
                            padWrapper = /sw|ne|nw|se|n|s/.test(i) ? axis.outerHeight() : axis.outerWidth();
                            padPos = ["padding", /ne|nw|n/.test(i) ? "Top" : /se|sw|s/.test(i) ? "Bottom" : /^e$/.test(i) ? "Right" : "Left"].join("");
                            target.css(padPos, padWrapper);
                            this._proportionallyResize()
                        }
                        if (!$(this.handles[i]).length) {
                            continue
                        }
                    }
                };
                this._renderAxis(this.element);
                this._handles = $(".ui-resizable-handle", this.element).disableSelection();
                this._handles.mouseover(function() {
                    if (!that.resizing) {
                        if (this.className) {
                            axis = this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)
                        }
                        that.axis = axis && axis[1] ? axis[1] : "se"
                    }
                });
                if (o.autoHide) {
                    this._handles.hide();
                    $(this.element).addClass("ui-resizable-autohide").mouseenter(function() {
                        if (o.disabled) {
                            return
                        }
                        $(this).removeClass("ui-resizable-autohide");
                        that._handles.show()
                    }).mouseleave(function() {
                        if (o.disabled) {
                            return
                        }
                        if (!that.resizing) {
                            $(this).addClass("ui-resizable-autohide");
                            that._handles.hide()
                        }
                    })
                }
                this._mouseInit()
            },
            _destroy: function() {
                this._mouseDestroy();
                var wrapper, _destroy = function(exp) {
                    $(exp).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()
                };
                if (this.elementIsWrapper) {
                    _destroy(this.element);
                    wrapper = this.element;
                    this.originalElement.css({
                        position: wrapper.css("position"),
                        width: wrapper.outerWidth(),
                        height: wrapper.outerHeight(),
                        top: wrapper.css("top"),
                        left: wrapper.css("left")
                    }).insertAfter(wrapper);
                    wrapper.remove()
                }
                this.originalElement.css("resize", this.originalResizeStyle);
                _destroy(this.originalElement);
                return this
            },
            _mouseCapture: function(event) {
                var i, handle, capture = false;
                for (i in this.handles) {
                    handle = $(this.handles[i])[0];
                    if (handle === event.target || $.contains(handle, event.target)) {
                        capture = true
                    }
                }
                return !this.options.disabled && capture
            },
            _mouseStart: function(event) {
                var curleft, curtop, cursor, o = this.options,
                    iniPos = this.element.position(),
                    el = this.element;
                this.resizing = true;
                if (/absolute/.test(el.css("position"))) {
                    el.css({
                        position: "absolute",
                        top: el.css("top"),
                        left: el.css("left")
                    })
                } else if (el.is(".ui-draggable")) {
                    el.css({
                        position: "absolute",
                        top: iniPos.top,
                        left: iniPos.left
                    })
                }
                this._renderProxy();
                curleft = this._num(this.helper.css("left"));
                curtop = this._num(this.helper.css("top"));
                if (o.containment) {
                    curleft += $(o.containment).scrollLeft() || 0;
                    curtop += $(o.containment).scrollTop() || 0
                }
                this.offset = this.helper.offset();
                this.position = {
                    left: curleft,
                    top: curtop
                };
                this.size = this._helper ? {
                    width: this.helper.width(),
                    height: this.helper.height()
                } : {
                    width: el.width(),
                    height: el.height()
                };
                this.originalSize = this._helper ? {
                    width: el.outerWidth(),
                    height: el.outerHeight()
                } : {
                    width: el.width(),
                    height: el.height()
                };
                this.originalPosition = {
                    left: curleft,
                    top: curtop
                };
                this.sizeDiff = {
                    width: el.outerWidth() - el.width(),
                    height: el.outerHeight() - el.height()
                };
                this.originalMousePosition = {
                    left: event.pageX,
                    top: event.pageY
                };
                this.aspectRatio = typeof o.aspectRatio === "number" ? o.aspectRatio : this.originalSize.width / this.originalSize.height || 1;
                cursor = $(".ui-resizable-" + this.axis).css("cursor");
                $("body").css("cursor", cursor === "auto" ? this.axis + "-resize" : cursor);
                el.addClass("ui-resizable-resizing");
                this._propagate("start", event);
                return true
            },
            _mouseDrag: function(event) {
                var data, el = this.helper,
                    props = {},
                    smp = this.originalMousePosition,
                    a = this.axis,
                    dx = event.pageX - smp.left || 0,
                    dy = event.pageY - smp.top || 0,
                    trigger = this._change[a];
                this.prevPosition = {
                    top: this.position.top,
                    left: this.position.left
                };
                this.prevSize = {
                    width: this.size.width,
                    height: this.size.height
                };
                if (!trigger) {
                    return false
                }
                data = trigger.apply(this, [event, dx, dy]);
                this._updateVirtualBoundaries(event.shiftKey);
                if (this._aspectRatio || event.shiftKey) {
                    data = this._updateRatio(data, event)
                }
                data = this._respectSize(data, event);
                this._updateCache(data);
                this._propagate("resize", event);
                if (this.position.top !== this.prevPosition.top) {
                    props.top = this.position.top + "px"
                }
                if (this.position.left !== this.prevPosition.left) {
                    props.left = this.position.left + "px"
                }
                if (this.size.width !== this.prevSize.width) {
                    props.width = this.size.width + "px"
                }
                if (this.size.height !== this.prevSize.height) {
                    props.height = this.size.height + "px"
                }
                el.css(props);
                if (!this._helper && this._proportionallyResizeElements.length) {
                    this._proportionallyResize()
                }
                if (!$.isEmptyObject(props)) {
                    this._trigger("resize", event, this.ui())
                }
                return false
            },
            _mouseStop: function(event) {
                this.resizing = false;
                var pr, ista, soffseth, soffsetw, s, left, top, o = this.options,
                    that = this;
                if (this._helper) {
                    pr = this._proportionallyResizeElements;
                    ista = pr.length && /textarea/i.test(pr[0].nodeName);
                    soffseth = ista && this._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height;
                    soffsetw = ista ? 0 : that.sizeDiff.width;
                    s = {
                        width: that.helper.width() - soffsetw,
                        height: that.helper.height() - soffseth
                    };
                    left = parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left) || null;
                    top = parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top) || null;
                    if (!o.animate) {
                        this.element.css($.extend(s, {
                            top: top,
                            left: left
                        }))
                    }
                    that.helper.height(that.size.height);
                    that.helper.width(that.size.width);
                    if (this._helper && !o.animate) {
                        this._proportionallyResize()
                    }
                }
                $("body").css("cursor", "auto");
                this.element.removeClass("ui-resizable-resizing");
                this._propagate("stop", event);
                if (this._helper) {
                    this.helper.remove()
                }
                return false
            },
            _updateVirtualBoundaries: function(forceAspectRatio) {
                var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b, o = this.options;
                b = {
                    minWidth: this._isNumber(o.minWidth) ? o.minWidth : 0,
                    maxWidth: this._isNumber(o.maxWidth) ? o.maxWidth : Infinity,
                    minHeight: this._isNumber(o.minHeight) ? o.minHeight : 0,
                    maxHeight: this._isNumber(o.maxHeight) ? o.maxHeight : Infinity
                };
                if (this._aspectRatio || forceAspectRatio) {
                    pMinWidth = b.minHeight * this.aspectRatio;
                    pMinHeight = b.minWidth / this.aspectRatio;
                    pMaxWidth = b.maxHeight * this.aspectRatio;
                    pMaxHeight = b.maxWidth / this.aspectRatio;
                    if (pMinWidth > b.minWidth) {
                        b.minWidth = pMinWidth
                    }
                    if (pMinHeight > b.minHeight) {
                        b.minHeight = pMinHeight
                    }
                    if (pMaxWidth < b.maxWidth) {
                        b.maxWidth = pMaxWidth
                    }
                    if (pMaxHeight < b.maxHeight) {
                        b.maxHeight = pMaxHeight
                    }
                }
                this._vBoundaries = b
            },
            _updateCache: function(data) {
                this.offset = this.helper.offset();
                if (this._isNumber(data.left)) {
                    this.position.left = data.left
                }
                if (this._isNumber(data.top)) {
                    this.position.top = data.top
                }
                if (this._isNumber(data.height)) {
                    this.size.height = data.height
                }
                if (this._isNumber(data.width)) {
                    this.size.width = data.width
                }
            },
            _updateRatio: function(data) {
                var cpos = this.position,
                    csize = this.size,
                    a = this.axis;
                if (this._isNumber(data.height)) {
                    data.width = data.height * this.aspectRatio
                } else if (this._isNumber(data.width)) {
                    data.height = data.width / this.aspectRatio
                }
                if (a === "sw") {
                    data.left = cpos.left + (csize.width - data.width);
                    data.top = null
                }
                if (a === "nw") {
                    data.top = cpos.top + (csize.height - data.height);
                    data.left = cpos.left + (csize.width - data.width)
                }
                return data
            },
            _respectSize: function(data) {
                var o = this._vBoundaries,
                    a = this.axis,
                    ismaxw = this._isNumber(data.width) && o.maxWidth && o.maxWidth < data.width,
                    ismaxh = this._isNumber(data.height) && o.maxHeight && o.maxHeight < data.height,
                    isminw = this._isNumber(data.width) && o.minWidth && o.minWidth > data.width,
                    isminh = this._isNumber(data.height) && o.minHeight && o.minHeight > data.height,
                    dw = this.originalPosition.left + this.originalSize.width,
                    dh = this.position.top + this.size.height,
                    cw = /sw|nw|w/.test(a),
                    ch = /nw|ne|n/.test(a);
                if (isminw) {
                    data.width = o.minWidth
                }
                if (isminh) {
                    data.height = o.minHeight
                }
                if (ismaxw) {
                    data.width = o.maxWidth
                }
                if (ismaxh) {
                    data.height = o.maxHeight
                }
                if (isminw && cw) {
                    data.left = dw - o.minWidth
                }
                if (ismaxw && cw) {
                    data.left = dw - o.maxWidth
                }
                if (isminh && ch) {
                    data.top = dh - o.minHeight
                }
                if (ismaxh && ch) {
                    data.top = dh - o.maxHeight
                }
                if (!data.width && !data.height && !data.left && data.top) {
                    data.top = null
                } else if (!data.width && !data.height && !data.top && data.left) {
                    data.left = null
                }
                return data
            },
            _proportionallyResize: function() {
                if (!this._proportionallyResizeElements.length) {
                    return
                }
                var i, j, borders, paddings, prel, element = this.helper || this.element;
                for (i = 0; i < this._proportionallyResizeElements.length; i++) {
                    prel = this._proportionallyResizeElements[i];
                    if (!this.borderDif) {
                        this.borderDif = [];
                        borders = [prel.css("borderTopWidth"), prel.css("borderRightWidth"), prel.css("borderBottomWidth"), prel.css("borderLeftWidth")];
                        paddings = [prel.css("paddingTop"), prel.css("paddingRight"), prel.css("paddingBottom"), prel.css("paddingLeft")];
                        for (j = 0; j < borders.length; j++) {
                            this.borderDif[j] = (parseInt(borders[j], 10) || 0) + (parseInt(paddings[j], 10) || 0)
                        }
                    }
                    prel.css({
                        height: element.height() - this.borderDif[0] - this.borderDif[2] || 0,
                        width: element.width() - this.borderDif[1] - this.borderDif[3] || 0
                    })
                }
            },
            _renderProxy: function() {
                var el = this.element,
                    o = this.options;
                this.elementOffset = el.offset();
                if (this._helper) {
                    this.helper = this.helper || $("<div style='overflow:hidden;'></div>");
                    this.helper.addClass(this._helper).css({
                        width: this.element.outerWidth() - 1,
                        height: this.element.outerHeight() - 1,
                        position: "absolute",
                        left: this.elementOffset.left + "px",
                        top: this.elementOffset.top + "px",
                        zIndex: ++o.zIndex
                    });
                    this.helper.appendTo("body").disableSelection()
                } else {
                    this.helper = this.element
                }
            },
            _change: {
                e: function(event, dx) {
                    return {
                        width: this.originalSize.width + dx
                    }
                },
                w: function(event, dx) {
                    var cs = this.originalSize,
                        sp = this.originalPosition;
                    return {
                        left: sp.left + dx,
                        width: cs.width - dx
                    }
                },
                n: function(event, dx, dy) {
                    var cs = this.originalSize,
                        sp = this.originalPosition;
                    return {
                        top: sp.top + dy,
                        height: cs.height - dy
                    }
                },
                s: function(event, dx, dy) {
                    return {
                        height: this.originalSize.height + dy
                    }
                },
                se: function(event, dx, dy) {
                    return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]))
                },
                sw: function(event, dx, dy) {
                    return $.extend(this._change.s.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]))
                },
                ne: function(event, dx, dy) {
                    return $.extend(this._change.n.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]))
                },
                nw: function(event, dx, dy) {
                    return $.extend(this._change.n.apply(this, arguments), this._change.w.apply(this, [event, dx, dy]))
                }
            },
            _propagate: function(n, event) {
                $.ui.plugin.call(this, n, [event, this.ui()]);
                n !== "resize" && this._trigger(n, event, this.ui())
            },
            plugins: {},
            ui: function() {
                return {
                    originalElement: this.originalElement,
                    element: this.element,
                    helper: this.helper,
                    position: this.position,
                    size: this.size,
                    originalSize: this.originalSize,
                    originalPosition: this.originalPosition,
                    prevSize: this.prevSize,
                    prevPosition: this.prevPosition
                }
            }
        });
        $.ui.plugin.add("resizable", "animate", {
            stop: function(event) {
                var that = $(this).resizable("instance"),
                    o = that.options,
                    pr = that._proportionallyResizeElements,
                    ista = pr.length && /textarea/i.test(pr[0].nodeName),
                    soffseth = ista && that._hasScroll(pr[0], "left") ? 0 : that.sizeDiff.height,
                    soffsetw = ista ? 0 : that.sizeDiff.width,
                    style = {
                        width: that.size.width - soffsetw,
                        height: that.size.height - soffseth
                    },
                    left = parseInt(that.element.css("left"), 10) + (that.position.left - that.originalPosition.left) || null,
                    top = parseInt(that.element.css("top"), 10) + (that.position.top - that.originalPosition.top) || null;
                that.element.animate($.extend(style, top && left ? {
                    top: top,
                    left: left
                } : {}), {
                    duration: o.animateDuration,
                    easing: o.animateEasing,
                    step: function() {
                        var data = {
                            width: parseInt(that.element.css("width"), 10),
                            height: parseInt(that.element.css("height"), 10),
                            top: parseInt(that.element.css("top"), 10),
                            left: parseInt(that.element.css("left"), 10)
                        };
                        if (pr && pr.length) {
                            $(pr[0]).css({
                                width: data.width,
                                height: data.height
                            })
                        }
                        that._updateCache(data);
                        that._propagate("resize", event)
                    }
                })
            }
        });
        $.ui.plugin.add("resizable", "containment", {
            start: function() {
                var element, p, co, ch, cw, width, height, that = $(this).resizable("instance"),
                    o = that.options,
                    el = that.element,
                    oc = o.containment,
                    ce = oc instanceof $ ? oc.get(0) : /parent/.test(oc) ? el.parent().get(0) : oc;
                if (!ce) {
                    return
                }
                that.containerElement = $(ce);
                if (/document/.test(oc) || oc === document) {
                    that.containerOffset = {
                        left: 0,
                        top: 0
                    };
                    that.containerPosition = {
                        left: 0,
                        top: 0
                    };
                    that.parentData = {
                        element: $(document),
                        left: 0,
                        top: 0,
                        width: $(document).width(),
                        height: $(document).height() || document.body.parentNode.scrollHeight
                    }
                } else {
                    element = $(ce);
                    p = [];
                    $(["Top", "Right", "Left", "Bottom"]).each(function(i, name) {
                        p[i] = that._num(element.css("padding" + name))
                    });
                    that.containerOffset = element.offset();
                    that.containerPosition = element.position();
                    that.containerSize = {
                        height: element.innerHeight() - p[3],
                        width: element.innerWidth() - p[1]
                    };
                    co = that.containerOffset;
                    ch = that.containerSize.height;
                    cw = that.containerSize.width;
                    width = that._hasScroll(ce, "left") ? ce.scrollWidth : cw;
                    height = that._hasScroll(ce) ? ce.scrollHeight : ch;
                    that.parentData = {
                        element: ce,
                        left: co.left,
                        top: co.top,
                        width: width,
                        height: height
                    }
                }
            },
            resize: function(event, ui) {
                var woset, hoset, isParent, isOffsetRelative, that = $(this).resizable("instance"),
                    o = that.options,
                    co = that.containerOffset,
                    cp = that.position,
                    pRatio = that._aspectRatio || event.shiftKey,
                    cop = {
                        top: 0,
                        left: 0
                    },
                    ce = that.containerElement,
                    continueResize = true;
                if (ce[0] !== document && /static/.test(ce.css("position"))) {
                    cop = co
                }
                if (cp.left < (that._helper ? co.left : 0)) {
                    that.size.width = that.size.width + (that._helper ? that.position.left - co.left : that.position.left - cop.left);
                    if (pRatio) {
                        that.size.height = that.size.width / that.aspectRatio;
                        continueResize = false
                    }
                    that.position.left = o.helper ? co.left : 0
                }
                if (cp.top < (that._helper ? co.top : 0)) {
                    that.size.height = that.size.height + (that._helper ? that.position.top - co.top : that.position.top);
                    if (pRatio) {
                        that.size.width = that.size.height * that.aspectRatio;
                        continueResize = false
                    }
                    that.position.top = that._helper ? co.top : 0
                }
                that.offset.left = that.parentData.left + that.position.left;
                that.offset.top = that.parentData.top + that.position.top;
                woset = Math.abs((that._helper ? that.offset.left - cop.left : that.offset.left - co.left) + that.sizeDiff.width);
                hoset = Math.abs((that._helper ? that.offset.top - cop.top : that.offset.top - co.top) + that.sizeDiff.height);
                isParent = that.containerElement.get(0) === that.element.parent().get(0);
                isOffsetRelative = /relative|absolute/.test(that.containerElement.css("position"));
                if (isParent && isOffsetRelative) {
                    woset -= Math.abs(that.parentData.left)
                }
                if (woset + that.size.width >= that.parentData.width) {
                    that.size.width = that.parentData.width - woset;
                    if (pRatio) {
                        that.size.height = that.size.width / that.aspectRatio;
                        continueResize = false
                    }
                }
                if (hoset + that.size.height >= that.parentData.height) {
                    that.size.height = that.parentData.height - hoset;
                    if (pRatio) {
                        that.size.width = that.size.height * that.aspectRatio;
                        continueResize = false
                    }
                }
                if (!continueResize) {
                    that.position.left = ui.prevPosition.left;
                    that.position.top = ui.prevPosition.top;
                    that.size.width = ui.prevSize.width;
                    that.size.height = ui.prevSize.height
                }
            },
            stop: function() {
                var that = $(this).resizable("instance"),
                    o = that.options,
                    co = that.containerOffset,
                    cop = that.containerPosition,
                    ce = that.containerElement,
                    helper = $(that.helper),
                    ho = helper.offset(),
                    w = helper.outerWidth() - that.sizeDiff.width,
                    h = helper.outerHeight() - that.sizeDiff.height;
                if (that._helper && !o.animate && /relative/.test(ce.css("position"))) {
                    $(this).css({
                        left: ho.left - cop.left - co.left,
                        width: w,
                        height: h
                    })
                }
                if (that._helper && !o.animate && /static/.test(ce.css("position"))) {
                    $(this).css({
                        left: ho.left - cop.left - co.left,
                        width: w,
                        height: h
                    })
                }
            }
        });
        $.ui.plugin.add("resizable", "alsoResize", {
            start: function() {
                var that = $(this).resizable("instance"),
                    o = that.options,
                    _store = function(exp) {
                        $(exp).each(function() {
                            var el = $(this);
                            el.data("ui-resizable-alsoresize", {
                                width: parseInt(el.width(), 10),
                                height: parseInt(el.height(), 10),
                                left: parseInt(el.css("left"), 10),
                                top: parseInt(el.css("top"), 10)
                            })
                        })
                    };
                if (typeof o.alsoResize === "object" && !o.alsoResize.parentNode) {
                    if (o.alsoResize.length) {
                        o.alsoResize = o.alsoResize[0];
                        _store(o.alsoResize)
                    } else {
                        $.each(o.alsoResize, function(exp) {
                            _store(exp)
                        })
                    }
                } else {
                    _store(o.alsoResize)
                }
            },
            resize: function(event, ui) {
                var that = $(this).resizable("instance"),
                    o = that.options,
                    os = that.originalSize,
                    op = that.originalPosition,
                    delta = {
                        height: that.size.height - os.height || 0,
                        width: that.size.width - os.width || 0,
                        top: that.position.top - op.top || 0,
                        left: that.position.left - op.left || 0
                    },
                    _alsoResize = function(exp, c) {
                        $(exp).each(function() {
                            var el = $(this),
                                start = $(this).data("ui-resizable-alsoresize"),
                                style = {},
                                css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ["width", "height"] : ["width", "height", "top", "left"];
                            $.each(css, function(i, prop) {
                                var sum = (start[prop] || 0) + (delta[prop] || 0);
                                if (sum && sum >= 0) {
                                    style[prop] = sum || null
                                }
                            });
                            el.css(style)
                        })
                    };
                if (typeof o.alsoResize === "object" && !o.alsoResize.nodeType) {
                    $.each(o.alsoResize, function(exp, c) {
                        _alsoResize(exp, c)
                    })
                } else {
                    _alsoResize(o.alsoResize)
                }
            },
            stop: function() {
                $(this).removeData("resizable-alsoresize")
            }
        });
        $.ui.plugin.add("resizable", "ghost", {
            start: function() {
                var that = $(this).resizable("instance"),
                    o = that.options,
                    cs = that.size;
                that.ghost = that.originalElement.clone();
                that.ghost.css({
                    opacity: .25,
                    display: "block",
                    position: "relative",
                    height: cs.height,
                    width: cs.width,
                    margin: 0,
                    left: 0,
                    top: 0
                }).addClass("ui-resizable-ghost").addClass(typeof o.ghost === "string" ? o.ghost : "");
                that.ghost.appendTo(that.helper)
            },
            resize: function() {
                var that = $(this).resizable("instance");
                if (that.ghost) {
                    that.ghost.css({
                        position: "relative",
                        height: that.size.height,
                        width: that.size.width
                    })
                }
            },
            stop: function() {
                var that = $(this).resizable("instance");
                if (that.ghost && that.helper) {
                    that.helper.get(0).removeChild(that.ghost.get(0))
                }
            }
        });
        $.ui.plugin.add("resizable", "grid", {
            resize: function() {
                var that = $(this).resizable("instance"),
                    o = that.options,
                    cs = that.size,
                    os = that.originalSize,
                    op = that.originalPosition,
                    a = that.axis,
                    grid = typeof o.grid === "number" ? [o.grid, o.grid] : o.grid,
                    gridX = grid[0] || 1,
                    gridY = grid[1] || 1,
                    ox = Math.round((cs.width - os.width) / gridX) * gridX,
                    oy = Math.round((cs.height - os.height) / gridY) * gridY,
                    newWidth = os.width + ox,
                    newHeight = os.height + oy,
                    isMaxWidth = o.maxWidth && o.maxWidth < newWidth,
                    isMaxHeight = o.maxHeight && o.maxHeight < newHeight,
                    isMinWidth = o.minWidth && o.minWidth > newWidth,
                    isMinHeight = o.minHeight && o.minHeight > newHeight;
                o.grid = grid;
                if (isMinWidth) {
                    newWidth = newWidth + gridX
                }
                if (isMinHeight) {
                    newHeight = newHeight + gridY
                }
                if (isMaxWidth) {
                    newWidth = newWidth - gridX
                }
                if (isMaxHeight) {
                    newHeight = newHeight - gridY
                }
                if (/^(se|s|e)$/.test(a)) {
                    that.size.width = newWidth;
                    that.size.height = newHeight
                } else if (/^(ne)$/.test(a)) {
                    that.size.width = newWidth;
                    that.size.height = newHeight;
                    that.position.top = op.top - oy
                } else if (/^(sw)$/.test(a)) {
                    that.size.width = newWidth;
                    that.size.height = newHeight;
                    that.position.left = op.left - ox
                } else {
                    if (newHeight - gridY > 0) {
                        that.size.height = newHeight;
                        that.position.top = op.top - oy
                    } else {
                        that.size.height = gridY;
                        that.position.top = op.top + os.height - gridY
                    }
                    if (newWidth - gridX > 0) {
                        that.size.width = newWidth;
                        that.position.left = op.left - ox
                    } else {
                        that.size.width = gridX;
                        that.position.left = op.left + os.width - gridX
                    }
                }
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.button", ["jquery"], function(jQuery) {
    (function($, undefined) {
        var lastActive, baseClasses = "ui-button ui-widget ui-state-default ui-corner-all",
            typeClasses = "ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",
            formResetHandler = function() {
                var form = $(this);
                setTimeout(function() {
                    form.find(":ui-button").button("refresh")
                }, 1)
            },
            radioGroup = function(radio) {
                var name = radio.name,
                    form = radio.form,
                    radios = $([]);
                if (name) {
                    name = name.replace(/'/g, "\\'");
                    if (form) {
                        radios = $(form).find("[name='" + name + "']")
                    } else {
                        radios = $("[name='" + name + "']", radio.ownerDocument).filter(function() {
                            return !this.form
                        })
                    }
                }
                return radios
            };
        $.widget("ui.button", {
            version: "@VERSION",
            defaultElement: "<button>",
            options: {
                disabled: null,
                text: true,
                label: null,
                icons: {
                    primary: null,
                    secondary: null
                }
            },
            _create: function() {
                this.element.closest("form").unbind("reset" + this.eventNamespace).bind("reset" + this.eventNamespace, formResetHandler);
                if (typeof this.options.disabled !== "boolean") {
                    this.options.disabled = !!this.element.prop("disabled")
                } else {
                    this.element.prop("disabled", this.options.disabled)
                }
                this._determineButtonType();
                this.hasTitle = !!this.buttonElement.attr("title");
                var that = this,
                    options = this.options,
                    toggleButton = this.type === "checkbox" || this.type === "radio",
                    activeClass = !toggleButton ? "ui-state-active" : "";
                if (options.label === null) {
                    options.label = this.type === "input" ? this.buttonElement.val() : this.buttonElement.html()
                }
                this._hoverable(this.buttonElement);
                this.buttonElement.addClass(baseClasses).attr("role", "button").bind("mouseenter" + this.eventNamespace, function() {
                    if (options.disabled) {
                        return
                    }
                    if (this === lastActive) {
                        $(this).addClass("ui-state-active")
                    }
                }).bind("mouseleave" + this.eventNamespace, function() {
                    if (options.disabled) {
                        return
                    }
                    $(this).removeClass(activeClass)
                }).bind("click" + this.eventNamespace, function(event) {
                    if (options.disabled) {
                        event.preventDefault();
                        event.stopImmediatePropagation()
                    }
                });
                this._on({
                    focus: function() {
                        this.buttonElement.addClass("ui-state-focus")
                    },
                    blur: function() {
                        this.buttonElement.removeClass("ui-state-focus")
                    }
                });
                if (toggleButton) {
                    this.element.bind("change" + this.eventNamespace, function() {
                        that.refresh()
                    })
                }
                if (this.type === "checkbox") {
                    this.buttonElement.bind("click" + this.eventNamespace, function() {
                        if (options.disabled) {
                            return false
                        }
                    })
                } else if (this.type === "radio") {
                    this.buttonElement.bind("click" + this.eventNamespace, function() {
                        if (options.disabled) {
                            return false
                        }
                        $(this).addClass("ui-state-active");
                        that.buttonElement.attr("aria-pressed", "true");
                        var radio = that.element[0];
                        radioGroup(radio).not(radio).map(function() {
                            return $(this).button("widget")[0]
                        }).removeClass("ui-state-active").attr("aria-pressed", "false")
                    })
                } else {
                    this.buttonElement.bind("mousedown" + this.eventNamespace, function() {
                        if (options.disabled) {
                            return false
                        }
                        $(this).addClass("ui-state-active");
                        lastActive = this;
                        that.document.one("mouseup", function() {
                            lastActive = null
                        })
                    }).bind("mouseup" + this.eventNamespace, function() {
                        if (options.disabled) {
                            return false
                        }
                        $(this).removeClass("ui-state-active")
                    }).bind("keydown" + this.eventNamespace, function(event) {
                        if (options.disabled) {
                            return false
                        }
                        if (event.keyCode === $.ui.keyCode.SPACE || event.keyCode === $.ui.keyCode.ENTER) {
                            $(this).addClass("ui-state-active")
                        }
                    }).bind("keyup" + this.eventNamespace + " blur" + this.eventNamespace, function() {
                        $(this).removeClass("ui-state-active")
                    });
                    if (this.buttonElement.is("a")) {
                        this.buttonElement.keyup(function(event) {
                            if (event.keyCode === $.ui.keyCode.SPACE) {
                                $(this).click()
                            }
                        })
                    }
                }
                this._setOption("disabled", options.disabled);
                this._resetButton()
            },
            _determineButtonType: function() {
                var ancestor, labelSelector, checked;
                if (this.element.is("[type=checkbox]")) {
                    this.type = "checkbox"
                } else if (this.element.is("[type=radio]")) {
                    this.type = "radio"
                } else if (this.element.is("input")) {
                    this.type = "input"
                } else {
                    this.type = "button"
                }
                if (this.type === "checkbox" || this.type === "radio") {
                    ancestor = this.element.parents().last();
                    labelSelector = "label[for='" + this.element.attr("id") + "']";
                    this.buttonElement = ancestor.find(labelSelector);
                    if (!this.buttonElement.length) {
                        ancestor = ancestor.length ? ancestor.siblings() : this.element.siblings();
                        this.buttonElement = ancestor.filter(labelSelector);
                        if (!this.buttonElement.length) {
                            this.buttonElement = ancestor.find(labelSelector)
                        }
                    }
                    this.element.addClass("ui-helper-hidden-accessible");
                    checked = this.element.is(":checked");
                    if (checked) {
                        this.buttonElement.addClass("ui-state-active")
                    }
                    this.buttonElement.prop("aria-pressed", checked)
                } else {
                    this.buttonElement = this.element
                }
            },
            widget: function() {
                return this.buttonElement
            },
            _destroy: function() {
                this.element.removeClass("ui-helper-hidden-accessible");
                this.buttonElement.removeClass(baseClasses + " ui-state-active " + typeClasses).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());
                if (!this.hasTitle) {
                    this.buttonElement.removeAttr("title")
                }
            },
            _setOption: function(key, value) {
                this._super(key, value);
                if (key === "disabled") {
                    this.widget().toggleClass("ui-state-disabled", !!value);
                    this.element.prop("disabled", !!value);
                    if (value) {
                        this.buttonElement.removeClass("ui-state-focus")
                    }
                    return
                }
                this._resetButton()
            },
            refresh: function() {
                var isDisabled = this.element.is("input, button") ? this.element.is(":disabled") : this.element.hasClass("ui-button-disabled");
                if (isDisabled !== this.options.disabled) {
                    this._setOption("disabled", isDisabled)
                }
                if (this.type === "radio") {
                    radioGroup(this.element[0]).each(function() {
                        if ($(this).is(":checked")) {
                            $(this).button("widget").addClass("ui-state-active").attr("aria-pressed", "true")
                        } else {
                            $(this).button("widget").removeClass("ui-state-active").attr("aria-pressed", "false")
                        }
                    })
                } else if (this.type === "checkbox") {
                    if (this.element.is(":checked")) {
                        this.buttonElement.addClass("ui-state-active").attr("aria-pressed", "true")
                    } else {
                        this.buttonElement.removeClass("ui-state-active").attr("aria-pressed", "false")
                    }
                }
            },
            _resetButton: function() {
                if (this.type === "input") {
                    if (this.options.label) {
                        this.element.val(this.options.label)
                    }
                    return
                }
                var buttonElement = this.buttonElement.removeClass(typeClasses),
                    buttonText = $("<span></span>", this.document[0]).addClass("ui-button-text").html(this.options.label).appendTo(buttonElement.empty()).text(),
                    icons = this.options.icons,
                    multipleIcons = icons.primary && icons.secondary,
                    buttonClasses = [];
                if (icons.primary || icons.secondary) {
                    if (this.options.text) {
                        buttonClasses.push("ui-button-text-icon" + (multipleIcons ? "s" : icons.primary ? "-primary" : "-secondary"))
                    }
                    if (icons.primary) {
                        buttonElement.prepend("<span class='ui-button-icon-primary ui-icon " + icons.primary + "'></span>")
                    }
                    if (icons.secondary) {
                        buttonElement.append("<span class='ui-button-icon-secondary ui-icon " + icons.secondary + "'></span>")
                    }
                    if (!this.options.text) {
                        buttonClasses.push(multipleIcons ? "ui-button-icons-only" : "ui-button-icon-only");
                        if (!this.hasTitle) {
                            buttonElement.attr("title", $.trim(buttonText))
                        }
                    }
                } else {
                    buttonClasses.push("ui-button-text-only")
                }
                buttonElement.addClass(buttonClasses.join(" "))
            }
        });
        $.widget("ui.buttonset", {
            version: "@VERSION",
            options: {
                items: "button, input[type=button], input[type=submit], input[type=reset], input[type=checkbox], input[type=radio], a, :data(ui-button)"
            },
            _create: function() {
                this.element.addClass("ui-buttonset")
            },
            _init: function() {
                this.refresh()
            },
            _setOption: function(key, value) {
                if (key === "disabled") {
                    this.buttons.button("option", key, value)
                }
                this._super(key, value)
            },
            refresh: function() {
                var rtl = this.element.css("direction") === "rtl";
                this.buttons = this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function() {
                    return $(this).button("widget")[0]
                }).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(rtl ? "ui-corner-right" : "ui-corner-left").end().filter(":last").addClass(rtl ? "ui-corner-left" : "ui-corner-right").end().end()
            },
            _destroy: function() {
                this.element.removeClass("ui-buttonset");
                this.buttons.map(function() {
                    return $(this).button("widget")[0]
                }).removeClass("ui-corner-left ui-corner-right").end().button("destroy")
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.menu", ["jquery", "require"], function(jQuery, require) {
    require("jquery.ui.widget");
    (function($, undefined) {
        $.widget("ui.menu", {
            version: "@VERSION",
            defaultElement: "<ul>",
            delay: 300,
            options: {
                icons: {
                    submenu: "ui-icon-carat-1-e"
                },
                items: "> *",
                menus: "ul",
                position: {
                    my: "left-1 top",
                    at: "right top"
                },
                role: "menu",
                blur: null,
                focus: null,
                select: null
            },
            _create: function() {
                this.activeMenu = this.element;
                this.mouseHandled = false;
                this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content").toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length).attr({
                    role: this.options.role,
                    tabIndex: 0
                });
                if (this.options.disabled) {
                    this.element.addClass("ui-state-disabled").attr("aria-disabled", "true")
                }
                this._on({
                    "mousedown .ui-menu-item": function(event) {
                        event.preventDefault()
                    },
                    "click .ui-menu-item": function(event) {
                        var target = $(event.target);
                        if (!this.mouseHandled && target.not(".ui-state-disabled").length) {
                            this.select(event);
                            if (!event.isPropagationStopped()) {
                                this.mouseHandled = true
                            }
                            if (target.has(".ui-menu").length) {
                                this.expand(event)
                            } else if (!this.element.is(":focus") && $(this.document[0].activeElement).closest(".ui-menu").length) {
                                this.element.trigger("focus", [true]);
                                if (this.active && this.active.parents(".ui-menu").length === 1) {
                                    clearTimeout(this.timer)
                                }
                            }
                        }
                    },
                    "mouseenter .ui-menu-item": function(event) {
                        var target = $(event.currentTarget);
                        target.siblings(".ui-state-active").removeClass("ui-state-active");
                        this.focus(event, target)
                    },
                    mouseleave: "collapseAll",
                    "mouseleave .ui-menu": "collapseAll",
                    focus: function(event, keepActiveItem) {
                        var item = this.active || this.element.find(this.options.items).eq(0);
                        if (!keepActiveItem) {
                            this.focus(event, item)
                        }
                    },
                    blur: function(event) {
                        this._delay(function() {
                            if (!$.contains(this.element[0], this.document[0].activeElement)) {
                                this.collapseAll(event)
                            }
                        })
                    },
                    keydown: "_keydown"
                });
                this.refresh();
                this._on(this.document, {
                    click: function(event) {
                        if (this._closeOnDocumentClick(event)) {
                            this.collapseAll(event)
                        }
                        this.mouseHandled = false
                    }
                })
            },
            _destroy: function() {
                this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-menu-icons ui-front").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show();
                this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").removeUniqueId().removeClass("ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function() {
                    var elem = $(this);
                    if (elem.data("ui-menu-submenu-carat")) {
                        elem.remove()
                    }
                });
                this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")
            },
            _keydown: function(event) {
                var match, prev, character, skip, regex, preventDefault = true;

                function escape(value) {
                    return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
                }
                switch (event.keyCode) {
                    case $.ui.keyCode.PAGE_UP:
                        this.previousPage(event);
                        break;
                    case $.ui.keyCode.PAGE_DOWN:
                        this.nextPage(event);
                        break;
                    case $.ui.keyCode.HOME:
                        this._move("first", "first", event);
                        break;
                    case $.ui.keyCode.END:
                        this._move("last", "last", event);
                        break;
                    case $.ui.keyCode.UP:
                        this.previous(event);
                        break;
                    case $.ui.keyCode.DOWN:
                        this.next(event);
                        break;
                    case $.ui.keyCode.LEFT:
                        this.collapse(event);
                        break;
                    case $.ui.keyCode.RIGHT:
                        if (this.active && !this.active.is(".ui-state-disabled")) {
                            this.expand(event)
                        }
                        break;
                    case $.ui.keyCode.ENTER:
                    case $.ui.keyCode.SPACE:
                        this._activate(event);
                        break;
                    case $.ui.keyCode.ESCAPE:
                        this.collapse(event);
                        break;
                    default:
                        preventDefault = false;
                        prev = this.previousFilter || "";
                        character = String.fromCharCode(event.keyCode);
                        skip = false;
                        clearTimeout(this.filterTimer);
                        if (character === prev) {
                            skip = true
                        } else {
                            character = prev + character
                        }
                        regex = new RegExp("^" + escape(character), "i");
                        match = this.activeMenu.find(this.options.items).filter(function() {
                            return regex.test($(this).text())
                        });
                        match = skip && match.index(this.active.next()) !== -1 ? this.active.nextAll(".ui-menu-item") : match;
                        if (!match.length) {
                            character = String.fromCharCode(event.keyCode);
                            regex = new RegExp("^" + escape(character), "i");
                            match = this.activeMenu.find(this.options.items).filter(function() {
                                return regex.test($(this).text())
                            })
                        }
                        if (match.length) {
                            this.focus(event, match);
                            if (match.length > 1) {
                                this.previousFilter = character;
                                this.filterTimer = this._delay(function() {
                                    delete this.previousFilter
                                }, 1e3)
                            } else {
                                delete this.previousFilter
                            }
                        } else {
                            delete this.previousFilter
                        }
                }
                if (preventDefault) {
                    event.preventDefault()
                }
            },
            _activate: function(event) {
                if (!this.active.is(".ui-state-disabled")) {
                    if (this.active.is("[aria-haspopup='true']")) {
                        this.expand(event)
                    } else {
                        this.select(event)
                    }
                }
            },
            refresh: function() {
                var menus, items, that = this,
                    icon = this.options.icons.submenu,
                    submenus = this.element.find(this.options.menus);
                this.element.toggleClass("ui-menu-icons", !!this.element.find(".ui-icon").length);
                submenus.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-front").hide().attr({
                    role: this.options.role,
                    "aria-hidden": "true",
                    "aria-expanded": "false"
                }).each(function() {
                    var menu = $(this),
                        item = menu.parent(),
                        submenuCarat = $("<span>").addClass("ui-menu-icon ui-icon " + icon).data("ui-menu-submenu-carat", true);
                    item.attr("aria-haspopup", "true").prepend(submenuCarat);
                    menu.attr("aria-labelledby", item.attr("id"))
                });
                menus = submenus.add(this.element);
                items = menus.find(this.options.items);
                items.not(".ui-menu-item").each(function() {
                    var item = $(this);
                    if (that._isDivider(item)) {
                        item.addClass("ui-widget-content ui-menu-divider")
                    }
                });
                items.not(".ui-menu-item, .ui-menu-divider").addClass("ui-menu-item").uniqueId().attr({
                    tabIndex: -1,
                    role: this._itemRole()
                });
                items.filter(".ui-state-disabled").attr("aria-disabled", "true");
                if (this.active && !$.contains(this.element[0], this.active[0])) {
                    this.blur()
                }
            },
            _itemRole: function() {
                return {
                    menu: "menuitem",
                    listbox: "option"
                }[this.options.role]
            },
            _setOption: function(key, value) {
                if (key === "icons") {
                    this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(value.submenu)
                }
                if (key === "disabled") {
                    this.element.toggleClass("ui-state-disabled", !!value).attr("aria-disabled", value)
                }
                this._super(key, value)
            },
            focus: function(event, item) {
                var nested, focused;
                this.blur(event, event && event.type === "focus");
                this._scrollIntoView(item);
                this.active = item.first();
                focused = this.active.addClass("ui-state-focus").removeClass("ui-state-active");
                if (this.options.role) {
                    this.element.attr("aria-activedescendant", focused.attr("id"))
                }
                this.active.parent().closest(".ui-menu-item").addClass("ui-state-active");
                if (event && event.type === "keydown") {
                    this._close()
                } else {
                    this.timer = this._delay(function() {
                        this._close()
                    }, this.delay)
                }
                nested = item.children(".ui-menu");
                if (nested.length && event && /^mouse/.test(event.type)) {
                    this._startOpening(nested)
                }
                this.activeMenu = item.parent();
                this._trigger("focus", event, {
                    item: item
                })
            },
            _scrollIntoView: function(item) {
                var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight;
                if (this._hasScroll()) {
                    borderTop = parseFloat($.css(this.activeMenu[0], "borderTopWidth")) || 0;
                    paddingTop = parseFloat($.css(this.activeMenu[0], "paddingTop")) || 0;
                    offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop;
                    scroll = this.activeMenu.scrollTop();
                    elementHeight = this.activeMenu.height();
                    itemHeight = item.height();
                    if (offset < 0) {
                        this.activeMenu.scrollTop(scroll + offset)
                    } else if (offset + itemHeight > elementHeight) {
                        this.activeMenu.scrollTop(scroll + offset - elementHeight + itemHeight)
                    }
                }
            },
            blur: function(event, fromFocus) {
                if (!fromFocus) {
                    clearTimeout(this.timer)
                }
                if (!this.active) {
                    return
                }
                this.active.removeClass("ui-state-focus");
                this.active = null;
                this._trigger("blur", event, {
                    item: this.active
                })
            },
            _startOpening: function(submenu) {
                clearTimeout(this.timer);
                if (submenu.attr("aria-hidden") !== "true") {
                    return
                }
                this.timer = this._delay(function() {
                    this._close();
                    this._open(submenu)
                }, this.delay)
            },
            _open: function(submenu) {
                var position = $.extend({
                    of: this.active
                }, this.options.position);
                clearTimeout(this.timer);
                this.element.find(".ui-menu").not(submenu.parents(".ui-menu")).hide().attr("aria-hidden", "true");
                submenu.show().removeAttr("aria-hidden").attr("aria-expanded", "true").position(position);
            },
            collapseAll: function(event, all) {
                clearTimeout(this.timer);
                this.timer = this._delay(function() {
                    var currentMenu = all ? this.element : $(event && event.target).closest(this.element.find(".ui-menu"));
                    if (!currentMenu.length) {
                        currentMenu = this.element
                    }
                    this._close(currentMenu);
                    this.blur(event);
                    this.activeMenu = currentMenu
                }, this.delay)
            },
            _close: function(startMenu) {
                if (!startMenu) {
                    startMenu = this.active ? this.active.parent() : this.element
                }
                startMenu.find(".ui-menu").hide().attr("aria-hidden", "true").attr("aria-expanded", "false").end().find(".ui-state-active").not(".ui-state-focus").removeClass("ui-state-active")
            },
            _closeOnDocumentClick: function(event) {
                return !$(event.target).closest(".ui-menu").length
            },
            _isDivider: function(item) {
                return !/[^\-\u2014\u2013\s]/.test(item.text())
            },
            collapse: function(event) {
                var newItem = this.active && this.active.parent().closest(".ui-menu-item", this.element);
                if (newItem && newItem.length) {
                    this._close();
                    this.focus(event, newItem)
                }
            },
            expand: function(event) {
                var newItem = this.active && this.active.children(".ui-menu ").find(this.options.items).first();
                if (newItem && newItem.length) {
                    this._open(newItem.parent());
                    this._delay(function() {
                        this.focus(event, newItem)
                    })
                }
            },
            next: function(event) {
                this._move("next", "first", event)
            },
            previous: function(event) {
                this._move("prev", "last", event)
            },
            isFirstItem: function() {
                return this.active && !this.active.prevAll(".ui-menu-item").length
            },
            isLastItem: function() {
                return this.active && !this.active.nextAll(".ui-menu-item").length
            },
            _move: function(direction, filter, event) {
                var next;
                if (this.active) {
                    if (direction === "first" || direction === "last") {
                        next = this.active[direction === "first" ? "prevAll" : "nextAll"](".ui-menu-item").eq(-1)
                    } else {
                        next = this.active[direction + "All"](".ui-menu-item").eq(0)
                    }
                }
                if (!next || !next.length || !this.active) {
                    next = this.activeMenu.find(this.options.items)[filter]()
                }
                this.focus(event, next)
            },
            nextPage: function(event) {
                var item, base, height;
                if (!this.active) {
                    this.next(event);
                    return
                }
                if (this.isLastItem()) {
                    return
                }
                if (this._hasScroll()) {
                    base = this.active.offset().top;
                    height = this.element.height();
                    this.active.nextAll(".ui-menu-item").each(function() {
                        item = $(this);
                        return item.offset().top - base - height < 0
                    });
                    this.focus(event, item)
                } else {
                    this.focus(event, this.activeMenu.find(this.options.items)[!this.active ? "first" : "last"]())
                }
            },
            previousPage: function(event) {
                var item, base, height;
                if (!this.active) {
                    this.next(event);
                    return
                }
                if (this.isFirstItem()) {
                    return
                }
                if (this._hasScroll()) {
                    base = this.active.offset().top;
                    height = this.element.height();
                    this.active.prevAll(".ui-menu-item").each(function() {
                        item = $(this);
                        return item.offset().top - base + height > 0
                    });
                    this.focus(event, item)
                } else {
                    this.focus(event, this.activeMenu.find(this.options.items).first())
                }
            },
            _hasScroll: function() {
                return this.element.outerHeight() < this.element.prop("scrollHeight")
            },
            select: function(event) {
                this.active = this.active || $(event.target).closest(".ui-menu-item");
                var ui = {
                    item: this.active
                };
                if (!this.active.has(".ui-menu").length) {
                    this.collapseAll(event, true)
                }
                this._trigger("select", event, ui)
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.autocomplete", ["jquery", "require"], function(jQuery, require) {
    require("jquery.ui.widget");
    require("jquery.ui.menu");
    (function($, undefined) {
        $.widget("ui.autocomplete", {
            version: "@VERSION",
            defaultElement: "<input>",
            options: {
                appendTo: null,
                autoFocus: false,
                delay: 300,
                minLength: 1,
                position: {
                    my: "left top",
                    at: "left bottom",
                    collision: "none"
                },
                source: null,
                change: null,
                close: null,
                focus: null,
                open: null,
                response: null,
                search: null,
                select: null
            },
            requestIndex: 0,
            pending: 0,
            _create: function() {
                var suppressKeyPress, suppressKeyPressRepeat, suppressInput, nodeName = this.element[0].nodeName.toLowerCase(),
                    isTextarea = nodeName === "textarea",
                    isInput = nodeName === "input";
                this.isMultiLine = isTextarea ? true : isInput ? false : this.element.prop("isContentEditable");
                this.valueMethod = this.element[isTextarea || isInput ? "val" : "text"];
                this.isNewMenu = true;
                this.element.addClass("ui-autocomplete-input").attr("autocomplete", "off");
                this._on(this.element, {
                    keydown: function(event) {
                        if (this.element.prop("readOnly")) {
                            suppressKeyPress = true;
                            suppressInput = true;
                            suppressKeyPressRepeat = true;
                            return
                        }
                        suppressKeyPress = false;
                        suppressInput = false;
                        suppressKeyPressRepeat = false;
                        var keyCode = $.ui.keyCode;
                        switch (event.keyCode) {
                            case keyCode.PAGE_UP:
                                suppressKeyPress = true;
                                this._move("previousPage", event);
                                break;
                            case keyCode.PAGE_DOWN:
                                suppressKeyPress = true;
                                this._move("nextPage", event);
                                break;
                            case keyCode.UP:
                                suppressKeyPress = true;
                                this._keyEvent("previous", event);
                                break;
                            case keyCode.DOWN:
                                suppressKeyPress = true;
                                this._keyEvent("next", event);
                                break;
                            case keyCode.ENTER:
                                if (this.menu.active) {
                                    suppressKeyPress = true;
                                    event.preventDefault();
                                    this.menu.select(event)
                                }
                                break;
                            case keyCode.TAB:
                                if (this.menu.active) {
                                    this.menu.select(event)
                                }
                                break;
                            case keyCode.ESCAPE:
                                if (this.menu.element.is(":visible")) {
                                    this._value(this.term);
                                    this.close(event);
                                    event.preventDefault()
                                }
                                break;
                            default:
                                suppressKeyPressRepeat = true;
                                this._searchTimeout(event);
                                break
                        }
                    },
                    keypress: function(event) {
                        if (suppressKeyPress) {
                            suppressKeyPress = false;
                            if (!this.isMultiLine || this.menu.element.is(":visible")) {
                                event.preventDefault()
                            }
                            return
                        }
                        if (suppressKeyPressRepeat) {
                            return
                        }
                        var keyCode = $.ui.keyCode;
                        switch (event.keyCode) {
                            case keyCode.PAGE_UP:
                                this._move("previousPage", event);
                                break;
                            case keyCode.PAGE_DOWN:
                                this._move("nextPage", event);
                                break;
                            case keyCode.UP:
                                this._keyEvent("previous", event);
                                break;
                            case keyCode.DOWN:
                                this._keyEvent("next", event);
                                break
                        }
                    },
                    input: function(event) {
                        if (suppressInput) {
                            suppressInput = false;
                            event.preventDefault();
                            return
                        }
                        this._searchTimeout(event)
                    },
                    focus: function() {
                        this.selectedItem = null;
                        this.previous = this._value()
                    },
                    blur: function(event) {
                        if (this.cancelBlur) {
                            delete this.cancelBlur;
                            return
                        }
                        clearTimeout(this.searching);
                        this.close(event);
                        this._change(event)
                    }
                });
                this._initSource();
                this.menu = $("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({
                    role: null
                }).hide().menu("instance");
                this._on(this.menu.element, {
                    mousedown: function(event) {
                        event.preventDefault();
                        this.cancelBlur = true;
                        this._delay(function() {
                            delete this.cancelBlur
                        });
                        var menuElement = this.menu.element[0];
                        if (!$(event.target).closest(".ui-menu-item").length) {
                            this._delay(function() {
                                var that = this;
                                this.document.one("mousedown", function(event) {
                                    if (event.target !== that.element[0] && event.target !== menuElement && !$.contains(menuElement, event.target)) {
                                        that.close()
                                    }
                                })
                            })
                        }
                    },
                    menufocus: function(event, ui) {
                        var label, item;
                        if (this.isNewMenu) {
                            this.isNewMenu = false;
                            if (event.originalEvent && /^mouse/.test(event.originalEvent.type)) {
                                this.menu.blur();
                                this.document.one("mousemove", function() {
                                    $(event.target).trigger(event.originalEvent)
                                });
                                return
                            }
                        }
                        item = ui.item.data("ui-autocomplete-item");
                        if (false !== this._trigger("focus", event, {
                                item: item
                            })) {
                            if (event.originalEvent && /^key/.test(event.originalEvent.type)) {
                                this._value(item.value)
                            }
                        }
                        label = ui.item.attr("aria-label") || item.value;
                        if (label && jQuery.trim(label).length) {
                            this.liveRegion.children().hide();
                            $("<div>").text(label).appendTo(this.liveRegion)
                        }
                    },
                    menuselect: function(event, ui) {
                        var item = ui.item.data("ui-autocomplete-item"),
                            previous = this.previous;
                        if (this.element[0] !== this.document[0].activeElement) {
                            this.element.focus();
                            this.previous = previous;
                            this._delay(function() {
                                this.previous = previous;
                                this.selectedItem = item
                            })
                        }
                        if (false !== this._trigger("select", event, {
                                item: item
                            })) {
                            this._value(item.value)
                        }
                        this.term = this._value();
                        this.close(event);
                        this.selectedItem = item
                    }
                });
                this.liveRegion = $("<span>", {
                    role: "status",
                    "aria-live": "assertive",
                    "aria-relevant": "additions"
                }).addClass("ui-helper-hidden-accessible").appendTo(this.document[0].body);
                this._on(this.window, {
                    beforeunload: function() {
                        this.element.removeAttr("autocomplete")
                    }
                })
            },
            _destroy: function() {
                clearTimeout(this.searching);
                this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete");
                this.menu.element.remove();
                this.liveRegion.remove()
            },
            _setOption: function(key, value) {
                this._super(key, value);
                if (key === "source") {
                    this._initSource()
                }
                if (key === "appendTo") {
                    this.menu.element.appendTo(this._appendTo())
                }
                if (key === "disabled" && value && this.xhr) {
                    this.xhr.abort()
                }
            },
            _appendTo: function() {
                var element = this.options.appendTo;
                if (element) {
                    element = element.jquery || element.nodeType ? $(element) : this.document.find(element).eq(0)
                }
                if (!element || !element[0]) {
                    element = this.element.closest(".ui-front")
                }
                if (!element.length) {
                    element = this.document[0].body
                }
                return element
            },
            _initSource: function() {
                var array, url, that = this;
                if ($.isArray(this.options.source)) {
                    array = this.options.source;
                    this.source = function(request, response) {
                        response($.ui.autocomplete.filter(array, request.term))
                    }
                } else if (typeof this.options.source === "string") {
                    url = this.options.source;
                    this.source = function(request, response) {
                        if (that.xhr) {
                            that.xhr.abort()
                        }
                        that.xhr = $.ajax({
                            url: url,
                            data: request,
                            dataType: "json",
                            success: function(data) {
                                response(data)
                            },
                            error: function() {
                                response([])
                            }
                        })
                    }
                } else {
                    this.source = this.options.source
                }
            },
            _searchTimeout: function(event) {
                clearTimeout(this.searching);
                this.searching = this._delay(function() {
                    if (this.term !== this._value()) {
                        this.selectedItem = null;
                        this.search(null, event)
                    }
                }, this.options.delay)
            },
            search: function(value, event) {
                value = value != null ? value : this._value();
                this.term = this._value();
                if (value.length < this.options.minLength) {
                    return this.close(event)
                }
                if (this._trigger("search", event) === false) {
                    return
                }
                return this._search(value)
            },
            _search: function(value) {
                this.pending++;
                this.element.addClass("ui-autocomplete-loading");
                this.cancelSearch = false;
                this.source({
                    term: value
                }, this._response())
            },
            _response: function() {
                var index = ++this.requestIndex;
                return $.proxy(function(content) {
                    if (index === this.requestIndex) {
                        this.__response(content)
                    }
                    this.pending--;
                    if (!this.pending) {
                        this.element.removeClass("ui-autocomplete-loading")
                    }
                }, this)
            },
            __response: function(content) {
                if (content) {
                    content = this._normalize(content)
                }
                this._trigger("response", null, {
                    content: content
                });
                if (!this.options.disabled && content && content.length && !this.cancelSearch) {
                    this._suggest(content);
                    this._trigger("open")
                } else {
                    this._close()
                }
            },
            close: function(event) {
                this.cancelSearch = true;
                this._close(event)
            },
            _close: function(event) {
                if (this.menu.element.is(":visible")) {
                    this.menu.element.hide();
                    this.menu.blur();
                    this.isNewMenu = true;
                    this._trigger("close", event)
                }
            },
            _change: function(event) {
                if (this.previous !== this._value()) {
                    this._trigger("change", event, {
                        item: this.selectedItem
                    })
                }
            },
            _normalize: function(items) {
                if (items.length && items[0].label && items[0].value) {
                    return items
                }
                return $.map(items, function(item) {
                    if (typeof item === "string") {
                        return {
                            label: item,
                            value: item
                        }
                    }
                    return $.extend({
                        label: item.label || item.value,
                        value: item.value || item.label
                    }, item)
                })
            },
            _suggest: function(items) {
                var ul = this.menu.element.empty();
                this._renderMenu(ul, items);
                this.isNewMenu = true;
                this.menu.refresh();
                ul.show();
                this._resizeMenu();
                ul.position($.extend({
                    of: this.element
                }, this.options.position));
                if (this.options.autoFocus) {
                    this.menu.next()
                }
            },
            _resizeMenu: function() {
                var ul = this.menu.element;
                ul.outerWidth(Math.max(ul.width("").outerWidth() + 1, this.element.outerWidth()))
            },
            _renderMenu: function(ul, items) {
                var that = this;
                $.each(items, function(index, item) {
                    that._renderItemData(ul, item)
                })
            },
            _renderItemData: function(ul, item) {
                return this._renderItem(ul, item).data("ui-autocomplete-item", item)
            },
            _renderItem: function(ul, item) {
                return $("<li>").text(item.label).appendTo(ul)
            },
            _move: function(direction, event) {
                if (!this.menu.element.is(":visible")) {
                    this.search(null, event);
                    return
                }
                if (this.menu.isFirstItem() && /^previous/.test(direction) || this.menu.isLastItem() && /^next/.test(direction)) {
                    this._value(this.term);
                    this.menu.blur();
                    return
                }
                this.menu[direction](event)
            },
            widget: function() {
                return this.menu.element
            },
            _value: function() {
                return this.valueMethod.apply(this.element, arguments)
            },
            _keyEvent: function(keyEvent, event) {
                if (!this.isMultiLine || this.menu.element.is(":visible")) {
                    this._move(keyEvent, event);
                    event.preventDefault()
                }
            }
        });
        $.extend($.ui.autocomplete, {
            escapeRegex: function(value) {
                return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&")
            },
            filter: function(array, term) {
                var matcher = new RegExp($.ui.autocomplete.escapeRegex(term), "i");
                return $.grep(array, function(value) {
                    return matcher.test(value.label || value.value || value)
                })
            }
        });
        $.widget("ui.autocomplete", $.ui.autocomplete, {
            options: {
                messages: {
                    noResults: "No search results.",
                    results: function(amount) {
                        return amount + (amount > 1 ? " results are" : " result is") + " available, use up and down arrow keys to navigate."
                    }
                }
            },
            __response: function(content) {
                var message;
                this._superApply(arguments);
                if (this.options.disabled || this.cancelSearch) {
                    return
                }
                if (content && content.length) {
                    message = this.options.messages.results(content.length)
                } else {
                    message = this.options.messages.noResults
                }
                this.liveRegion.children().hide();
                $("<div>").text(message).appendTo(this.liveRegion)
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.draggable", ["jquery", "require"], function(jQuery, require) {
    require("jquery.ui.widget");
    require("jquery.ui.mouse");
    (function($, undefined) {
        $.widget("ui.draggable", $.ui.mouse, {
            version: "@VERSION",
            widgetEventPrefix: "drag",
            options: {
                addClasses: true,
                appendTo: "parent",
                axis: false,
                connectToSortable: false,
                containment: false,
                cursor: "auto",
                cursorAt: false,
                grid: false,
                handle: false,
                helper: "original",
                iframeFix: false,
                opacity: false,
                refreshPositions: false,
                revert: false,
                revertDuration: 500,
                scope: "default",
                scroll: true,
                scrollSensitivity: 20,
                scrollSpeed: 20,
                snap: false,
                snapMode: "both",
                snapTolerance: 20,
                stack: false,
                zIndex: false,
                drag: null,
                start: null,
                stop: null
            },
            _create: function() {
                if (this.options.helper === "original" && !/^(?:r|a|f)/.test(this.element.css("position"))) {
                    this.element[0].style.position = "relative"
                }
                if (this.options.addClasses) {
                    this.element.addClass("ui-draggable")
                }
                if (this.options.disabled) {
                    this.element.addClass("ui-draggable-disabled")
                }
                this._setHandleClassName();
                this._mouseInit()
            },
            _setOption: function(key, value) {
                this._super(key, value);
                if (key === "handle") {
                    this._setHandleClassName()
                }
            },
            _destroy: function() {
                if ((this.helper || this.element).is(".ui-draggable-dragging")) {
                    this.destroyOnClear = true;
                    return
                }
                this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");
                this._removeHandleClassName();
                this._mouseDestroy()
            },
            _mouseCapture: function(event) {
                var document = this.document[0],
                    o = this.options;
                try {
                    if (document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body") {
                        $(document.activeElement).blur()
                    }
                } catch (error) {}
                if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
                    return false
                }
                this.handle = this._getHandle(event);
                if (!this.handle) {
                    return false
                }
                $(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
                    $("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({
                        width: this.offsetWidth + "px",
                        height: this.offsetHeight + "px",
                        position: "absolute",
                        opacity: "0.001",
                        zIndex: 1e3
                    }).css($(this).offset()).appendTo("body")
                });
                return true
            },
            _mouseStart: function(event) {
                var o = this.options;
                this.helper = this._createHelper(event);
                this.helper.addClass("ui-draggable-dragging");
                this._cacheHelperProportions();
                if ($.ui.ddmanager) {
                    $.ui.ddmanager.current = this
                }
                this._cacheMargins();
                this.cssPosition = this.helper.css("position");
                this.scrollParent = this.helper.scrollParent();
                this.offsetParent = this.helper.offsetParent();
                this.offsetParentCssPosition = this.offsetParent.css("position");
                this.offset = this.positionAbs = this.element.offset();
                this.offset = {
                    top: this.offset.top - this.margins.top,
                    left: this.offset.left - this.margins.left
                };
                this.offset.scroll = false;
                $.extend(this.offset, {
                    click: {
                        left: event.pageX - this.offset.left,
                        top: event.pageY - this.offset.top
                    },
                    parent: this._getParentOffset(),
                    relative: this._getRelativeOffset()
                });
                this.originalPosition = this.position = this._generatePosition(event, false);
                this.originalPageX = event.pageX;
                this.originalPageY = event.pageY;
                o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt);
                this._setContainment();
                if (this._trigger("start", event) === false) {
                    this._clear();
                    return false
                }
                this._cacheHelperProportions();
                if ($.ui.ddmanager && !o.dropBehaviour) {
                    $.ui.ddmanager.prepareOffsets(this, event)
                }
                this._mouseDrag(event, true);
                if ($.ui.ddmanager) {
                    $.ui.ddmanager.dragStart(this, event)
                }
                return true
            },
            _mouseDrag: function(event, noPropagation) {
                if (this.offsetParentCssPosition === "fixed") {
                    this.offset.parent = this._getParentOffset()
                }
                this.position = this._generatePosition(event, true);
                this.positionAbs = this._convertPositionTo("absolute");
                if (!noPropagation) {
                    var ui = this._uiHash();
                    if (this._trigger("drag", event, ui) === false) {
                        this._mouseUp({});
                        return false
                    }
                    this.position = ui.position
                }
                this.helper[0].style.left = this.position.left + "px";
                this.helper[0].style.top = this.position.top + "px";
                if ($.ui.ddmanager) {
                    $.ui.ddmanager.drag(this, event)
                }
                return false
            },
            _mouseStop: function(event) {
                var that = this,
                    dropped = false;
                if ($.ui.ddmanager && !this.options.dropBehaviour) {
                    dropped = $.ui.ddmanager.drop(this, event)
                }
                if (this.dropped) {
                    dropped = this.dropped;
                    this.dropped = false
                }
                if (this.options.revert === "invalid" && !dropped || this.options.revert === "valid" && dropped || this.options.revert === true || $.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped)) {
                    $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
                        if (that._trigger("stop", event) !== false) {
                            that._clear()
                        }
                    })
                } else {
                    if (this._trigger("stop", event) !== false) {
                        this._clear()
                    }
                }
                return false
            },
            _mouseUp: function(event) {
                $("div.ui-draggable-iframeFix").each(function() {
                    this.parentNode.removeChild(this)
                });
                if ($.ui.ddmanager) {
                    $.ui.ddmanager.dragStop(this, event)
                }
                this.element.focus();
                return $.ui.mouse.prototype._mouseUp.call(this, event)
            },
            cancel: function() {
                if (this.helper.is(".ui-draggable-dragging")) {
                    this._mouseUp({})
                } else {
                    this._clear()
                }
                return this
            },
            _getHandle: function(event) {
                return this.options.handle ? !!$(event.target).closest(this.element.find(this.options.handle)).length : true
            },
            _setHandleClassName: function() {
                this._removeHandleClassName();
                $(this.options.handle || this.element).addClass("ui-draggable-handle")
            },
            _removeHandleClassName: function() {
                this.element.find(".ui-draggable-handle").addBack().removeClass("ui-draggable-handle")
            },
            _createHelper: function(event) {
                var o = this.options,
                    helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element;
                if (!helper.parents("body").length) {
                    helper.appendTo(o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo)
                }
                if (helper[0] !== this.element[0] && !/(fixed|absolute)/.test(helper.css("position"))) {
                    helper.css("position", "absolute")
                }
                return helper
            },
            _adjustOffsetFromHelper: function(obj) {
                if (typeof obj === "string") {
                    obj = obj.split(" ")
                }
                if ($.isArray(obj)) {
                    obj = {
                        left: +obj[0],
                        top: +obj[1] || 0
                    }
                }
                if ("left" in obj) {
                    this.offset.click.left = obj.left + this.margins.left
                }
                if ("right" in obj) {
                    this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left
                }
                if ("top" in obj) {
                    this.offset.click.top = obj.top + this.margins.top
                }
                if ("bottom" in obj) {
                    this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top
                }
            },
            _isRootNode: function(element) {
                return /(html|body)/i.test(element.tagName) || element === this.document[0]
            },
            _getParentOffset: function() {
                var po = this.offsetParent.offset(),
                    document = this.document[0];
                if (this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
                    po.left += this.scrollParent.scrollLeft();
                    po.top += this.scrollParent.scrollTop()
                }
                if (this._isRootNode(this.offsetParent[0])) {
                    po = {
                        top: 0,
                        left: 0
                    }
                }
                return {
                    top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"), 10) || 0),
                    left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"), 10) || 0)
                }
            },
            _getRelativeOffset: function() {
                if (this.cssPosition !== "relative") {
                    return {
                        top: 0,
                        left: 0
                    }
                }
                var p = this.element.position(),
                    scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
                return {
                    top: p.top - (parseInt(this.helper.css("top"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollTop() : 0),
                    left: p.left - (parseInt(this.helper.css("left"), 10) || 0) + (!scrollIsRootNode ? this.scrollParent.scrollLeft() : 0)
                }
            },
            _cacheMargins: function() {
                this.margins = {
                    left: parseInt(this.element.css("marginLeft"), 10) || 0,
                    top: parseInt(this.element.css("marginTop"), 10) || 0,
                    right: parseInt(this.element.css("marginRight"), 10) || 0,
                    bottom: parseInt(this.element.css("marginBottom"), 10) || 0
                }
            },
            _cacheHelperProportions: function() {
                this.helperProportions = {
                    width: this.helper.outerWidth(),
                    height: this.helper.outerHeight()
                }
            },
            _setContainment: function() {
                var over, c, ce, o = this.options,
                    document = this.document[0];
                this.relative_container = null;
                if (!o.containment) {
                    this.containment = null;
                    return
                }
                if (o.containment === "window") {
                    this.containment = [$(window).scrollLeft() - this.offset.relative.left - this.offset.parent.left, $(window).scrollTop() - this.offset.relative.top - this.offset.parent.top, $(window).scrollLeft() + $(window).width() - this.helperProportions.width - this.margins.left, $(window).scrollTop() + ($(window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
                    return
                }
                if (o.containment === "document") {
                    this.containment = [0, 0, $(document).width() - this.helperProportions.width - this.margins.left, ($(document).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top];
                    return
                }
                if (o.containment.constructor === Array) {
                    this.containment = o.containment;
                    return
                }
                if (o.containment === "parent") {
                    o.containment = this.helper[0].parentNode
                }
                c = $(o.containment);
                ce = c[0];
                if (!ce) {
                    return
                }
                over = c.css("overflow") !== "hidden";
                this.containment = [(parseInt(c.css("borderLeftWidth"), 10) || 0) + (parseInt(c.css("paddingLeft"), 10) || 0), (parseInt(c.css("borderTopWidth"), 10) || 0) + (parseInt(c.css("paddingTop"), 10) || 0), (over ? Math.max(ce.scrollWidth, ce.offsetWidth) : ce.offsetWidth) - (parseInt(c.css("borderRightWidth"), 10) || 0) - (parseInt(c.css("paddingRight"), 10) || 0) - this.helperProportions.width - this.margins.left - this.margins.right, (over ? Math.max(ce.scrollHeight, ce.offsetHeight) : ce.offsetHeight) - (parseInt(c.css("borderBottomWidth"), 10) || 0) - (parseInt(c.css("paddingBottom"), 10) || 0) - this.helperProportions.height - this.margins.top - this.margins.bottom];
                this.relative_container = c
            },
            _convertPositionTo: function(d, pos) {
                if (!pos) {
                    pos = this.position
                }
                var mod = d === "absolute" ? 1 : -1,
                    scrollIsRootNode = this._isRootNode(this.scrollParent[0]);
                return {
                    top: pos.top + this.offset.relative.top * mod + this.offset.parent.top * mod - (this.cssPosition === "fixed" ? -this.offset.scroll.top : scrollIsRootNode ? 0 : this.offset.scroll.top) * mod,
                    left: pos.left + this.offset.relative.left * mod + this.offset.parent.left * mod - (this.cssPosition === "fixed" ? -this.offset.scroll.left : scrollIsRootNode ? 0 : this.offset.scroll.left) * mod
                }
            },
            _generatePosition: function(event, constrainPosition) {
                var containment, co, top, left, o = this.options,
                    scrollIsRootNode = this._isRootNode(this.scrollParent[0]),
                    pageX = event.pageX,
                    pageY = event.pageY;
                if (!scrollIsRootNode || !this.offset.scroll) {
                    this.offset.scroll = {
                        top: this.scrollParent.scrollTop(),
                        left: this.scrollParent.scrollLeft()
                    }
                }
                if (constrainPosition) {
                    if (this.containment) {
                        if (this.relative_container) {
                            co = this.relative_container.offset();
                            containment = [this.containment[0] + co.left, this.containment[1] + co.top, this.containment[2] + co.left, this.containment[3] + co.top]
                        } else {
                            containment = this.containment
                        }
                        if (event.pageX - this.offset.click.left < containment[0]) {
                            pageX = containment[0] + this.offset.click.left
                        }
                        if (event.pageY - this.offset.click.top < containment[1]) {
                            pageY = containment[1] + this.offset.click.top
                        }
                        if (event.pageX - this.offset.click.left > containment[2]) {
                            pageX = containment[2] + this.offset.click.left
                        }
                        if (event.pageY - this.offset.click.top > containment[3]) {
                            pageY = containment[3] + this.offset.click.top
                        }
                    }
                    if (o.grid) {
                        top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
                        pageY = containment ? top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3] ? top : top - this.offset.click.top >= containment[1] ? top - o.grid[1] : top + o.grid[1] : top;
                        left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
                        pageX = containment ? left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2] ? left : left - this.offset.click.left >= containment[0] ? left - o.grid[0] : left + o.grid[0] : left
                    }
                    if (o.axis === "y") {
                        pageX = this.originalPageX
                    }
                    if (o.axis === "x") {
                        pageY = this.originalPageY
                    }
                }
                return {
                    top: pageY - this.offset.click.top - this.offset.relative.top - this.offset.parent.top + (this.cssPosition === "fixed" ? -this.offset.scroll.top : scrollIsRootNode ? 0 : this.offset.scroll.top),
                    left: pageX - this.offset.click.left - this.offset.relative.left - this.offset.parent.left + (this.cssPosition === "fixed" ? -this.offset.scroll.left : scrollIsRootNode ? 0 : this.offset.scroll.left)
                }
            },
            _clear: function() {
                this.helper.removeClass("ui-draggable-dragging");
                if (this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
                    this.helper.remove()
                }
                this.helper = null;
                this.cancelHelperRemoval = false;
                if (this.destroyOnClear) {
                    this.destroy()
                }
            },
            _trigger: function(type, event, ui) {
                ui = ui || this._uiHash();
                $.ui.plugin.call(this, type, [event, ui, this], true);
                if (type === "drag") {
                    this.positionAbs = this._convertPositionTo("absolute")
                }
                return $.Widget.prototype._trigger.call(this, type, event, ui)
            },
            plugins: {},
            _uiHash: function() {
                return {
                    helper: this.helper,
                    position: this.position,
                    originalPosition: this.originalPosition,
                    offset: this.positionAbs
                }
            }
        });
        $.ui.plugin.add("draggable", "connectToSortable", {
            start: function(event, ui, inst) {
                var o = inst.options,
                    uiSortable = $.extend({}, ui, {
                        item: inst.element
                    });
                inst.sortables = [];
                $(o.connectToSortable).each(function() {
                    var sortable = $(this).sortable("instance");
                    if (sortable && !sortable.options.disabled) {
                        inst.sortables.push({
                            instance: sortable,
                            shouldRevert: sortable.options.revert
                        });
                        sortable.refreshPositions();
                        sortable._trigger("activate", event, uiSortable)
                    }
                })
            },
            stop: function(event, ui, inst) {
                var uiSortable = $.extend({}, ui, {
                    item: inst.element
                });
                $.each(inst.sortables, function() {
                    if (this.instance.isOver) {
                        this.instance.isOver = 0;
                        inst.cancelHelperRemoval = true;
                        this.instance.cancelHelperRemoval = false;
                        if (this.shouldRevert) {
                            this.instance.options.revert = this.shouldRevert
                        }
                        this.instance._mouseStop(event);
                        this.instance.options.helper = this.instance.options._helper;
                        if (inst.options.helper === "original") {
                            this.instance.currentItem.css({
                                top: "auto",
                                left: "auto"
                            })
                        }
                    } else {
                        this.instance.cancelHelperRemoval = false;
                        this.instance._trigger("deactivate", event, uiSortable)
                    }
                })
            },
            drag: function(event, ui, inst) {
                var that = this;
                $.each(inst.sortables, function() {
                    var innermostIntersecting = false,
                        thisSortable = this;
                    this.instance.positionAbs = inst.positionAbs;
                    this.instance.helperProportions = inst.helperProportions;
                    this.instance.offset.click = inst.offset.click;
                    if (this.instance._intersectsWith(this.instance.containerCache)) {
                        innermostIntersecting = true;
                        $.each(inst.sortables, function() {
                            this.instance.positionAbs = inst.positionAbs;
                            this.instance.helperProportions = inst.helperProportions;
                            this.instance.offset.click = inst.offset.click;
                            if (this !== thisSortable && this.instance._intersectsWith(this.instance.containerCache) && $.contains(thisSortable.instance.element[0], this.instance.element[0])) {
                                innermostIntersecting = false
                            }
                            return innermostIntersecting
                        })
                    }
                    if (innermostIntersecting) {
                        if (!this.instance.isOver) {
                            this.instance.isOver = 1;
                            this.instance.currentItem = $(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true);
                            this.instance.options._helper = this.instance.options.helper;
                            this.instance.options.helper = function() {
                                return ui.helper[0]
                            };
                            event.target = this.instance.currentItem[0];
                            this.instance._mouseCapture(event, true);
                            this.instance._mouseStart(event, true, true);
                            this.instance.offset.click.top = inst.offset.click.top;
                            this.instance.offset.click.left = inst.offset.click.left;
                            this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
                            this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
                            inst._trigger("toSortable", event);
                            inst.dropped = this.instance.element;
                            inst.currentItem = inst.element;
                            this.instance.fromOutside = inst
                        }
                        if (this.instance.currentItem) {
                            this.instance._mouseDrag(event)
                        }
                    } else {
                        if (this.instance.isOver) {
                            this.instance.isOver = 0;
                            this.instance.cancelHelperRemoval = true;
                            this.instance.options.revert = false;
                            this.instance._trigger("out", event, this.instance._uiHash(this.instance));
                            this.instance._mouseStop(event, true);
                            this.instance.options.helper = this.instance.options._helper;
                            this.instance.currentItem.remove();
                            if (this.instance.placeholder) {
                                this.instance.placeholder.remove()
                            }
                            inst._trigger("fromSortable", event);
                            inst.dropped = false
                        }
                    }
                })
            }
        });
        $.ui.plugin.add("draggable", "cursor", {
            start: function(event, ui, instance) {
                var t = $("body"),
                    o = instance.options;
                if (t.css("cursor")) {
                    o._cursor = t.css("cursor")
                }
                t.css("cursor", o.cursor)
            },
            stop: function(event, ui, instance) {
                var o = instance.options;
                if (o._cursor) {
                    $("body").css("cursor", o._cursor)
                }
            }
        });
        $.ui.plugin.add("draggable", "opacity", {
            start: function(event, ui, instance) {
                var t = $(ui.helper),
                    o = instance.options;
                if (t.css("opacity")) {
                    o._opacity = t.css("opacity")
                }
                t.css("opacity", o.opacity)
            },
            stop: function(event, ui, instance) {
                var o = instance.options;
                if (o._opacity) {
                    $(ui.helper).css("opacity", o._opacity)
                }
            }
        });
        $.ui.plugin.add("draggable", "scroll", {
            start: function(event, ui, i) {
                if (i.scrollParent[0] !== i.document[0] && i.scrollParent[0].tagName !== "HTML") {
                    i.overflowOffset = i.scrollParent.offset()
                }
            },
            drag: function(event, ui, i) {
                var o = i.options,
                    scrolled = false,
                    document = i.document[0];
                if (i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
                    if (!o.axis || o.axis !== "x") {
                        if (i.overflowOffset.top + i.scrollParent[0].offsetHeight - event.pageY < o.scrollSensitivity) {
                            i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed
                        } else if (event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
                            i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed
                        }
                    }
                    if (!o.axis || o.axis !== "y") {
                        if (i.overflowOffset.left + i.scrollParent[0].offsetWidth - event.pageX < o.scrollSensitivity) {
                            i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed
                        } else if (event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
                            i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed
                        }
                    }
                } else {
                    if (!o.axis || o.axis !== "x") {
                        if (event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
                            scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed)
                        } else if ($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
                            scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed)
                        }
                    }
                    if (!o.axis || o.axis !== "y") {
                        if (event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
                            scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed)
                        } else if ($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
                            scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed)
                        }
                    }
                }
                if (scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
                    $.ui.ddmanager.prepareOffsets(i, event)
                }
            }
        });
        $.ui.plugin.add("draggable", "snap", {
            start: function(event, ui, i) {
                var o = i.options;
                i.snapElements = [];
                $(o.snap.constructor !== String ? o.snap.items || ":data(ui-draggable)" : o.snap).each(function() {
                    var $t = $(this),
                        $o = $t.offset();
                    if (this !== i.element[0]) {
                        i.snapElements.push({
                            item: this,
                            width: $t.outerWidth(),
                            height: $t.outerHeight(),
                            top: $o.top,
                            left: $o.left
                        })
                    }
                })
            },
            drag: function(event, ui, inst) {
                var ts, bs, ls, rs, l, r, t, b, i, first, o = inst.options,
                    d = o.snapTolerance,
                    x1 = ui.offset.left,
                    x2 = x1 + inst.helperProportions.width,
                    y1 = ui.offset.top,
                    y2 = y1 + inst.helperProportions.height;
                for (i = inst.snapElements.length - 1; i >= 0; i--) {
                    l = inst.snapElements[i].left;
                    r = l + inst.snapElements[i].width;
                    t = inst.snapElements[i].top;
                    b = t + inst.snapElements[i].height;
                    if (x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains(inst.snapElements[i].item.ownerDocument, inst.snapElements[i].item)) {
                        if (inst.snapElements[i].snapping) {
                            inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), {
                                snapItem: inst.snapElements[i].item
                            }))
                        }
                        inst.snapElements[i].snapping = false;
                        continue
                    }
                    if (o.snapMode !== "inner") {
                        ts = Math.abs(t - y2) <= d;
                        bs = Math.abs(b - y1) <= d;
                        ls = Math.abs(l - x2) <= d;
                        rs = Math.abs(r - x1) <= d;
                        if (ts) {
                            ui.position.top = inst._convertPositionTo("relative", {
                                top: t - inst.helperProportions.height,
                                left: 0
                            }).top - inst.margins.top
                        }
                        if (bs) {
                            ui.position.top = inst._convertPositionTo("relative", {
                                top: b,
                                left: 0
                            }).top - inst.margins.top
                        }
                        if (ls) {
                            ui.position.left = inst._convertPositionTo("relative", {
                                top: 0,
                                left: l - inst.helperProportions.width
                            }).left - inst.margins.left
                        }
                        if (rs) {
                            ui.position.left = inst._convertPositionTo("relative", {
                                top: 0,
                                left: r
                            }).left - inst.margins.left
                        }
                    }
                    first = ts || bs || ls || rs;
                    if (o.snapMode !== "outer") {
                        ts = Math.abs(t - y1) <= d;
                        bs = Math.abs(b - y2) <= d;
                        ls = Math.abs(l - x1) <= d;
                        rs = Math.abs(r - x2) <= d;
                        if (ts) {
                            ui.position.top = inst._convertPositionTo("relative", {
                                top: t,
                                left: 0
                            }).top - inst.margins.top
                        }
                        if (bs) {
                            ui.position.top = inst._convertPositionTo("relative", {
                                top: b - inst.helperProportions.height,
                                left: 0
                            }).top - inst.margins.top
                        }
                        if (ls) {
                            ui.position.left = inst._convertPositionTo("relative", {
                                top: 0,
                                left: l
                            }).left - inst.margins.left
                        }
                        if (rs) {
                            ui.position.left = inst._convertPositionTo("relative", {
                                top: 0,
                                left: r - inst.helperProportions.width
                            }).left - inst.margins.left
                        }
                    }
                    if (!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
                        inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), {
                            snapItem: inst.snapElements[i].item
                        }))
                    }
                    inst.snapElements[i].snapping = ts || bs || ls || rs || first
                }
            }
        });
        $.ui.plugin.add("draggable", "stack", {
            start: function(event, ui, instance) {
                var min, o = instance.options,
                    group = $.makeArray($(o.stack)).sort(function(a, b) {
                        return (parseInt($(a).css("zIndex"), 10) || 0) - (parseInt($(b).css("zIndex"), 10) || 0)
                    });
                if (!group.length) {
                    return
                }
                min = parseInt($(group[0]).css("zIndex"), 10) || 0;
                $(group).each(function(i) {
                    $(this).css("zIndex", min + i)
                });
                this.css("zIndex", min + group.length)
            }
        });
        $.ui.plugin.add("draggable", "zIndex", {
            start: function(event, ui, instance) {
                var t = $(ui.helper),
                    o = instance.options;
                if (t.css("zIndex")) {
                    o._zIndex = t.css("zIndex")
                }
                t.css("zIndex", o.zIndex)
            },
            stop: function(event, ui, instance) {
                var o = instance.options;
                if (o._zIndex) {
                    $(ui.helper).css("zIndex", o._zIndex)
                }
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.slider", ["jquery", "require"], function(jQuery, require) {
    require("jquery.ui.widget");
    require("jquery.ui.mouse");
    (function($, undefined) {
        $.widget("ui.slider", $.ui.mouse, {
            version: "@VERSION",
            widgetEventPrefix: "slide",
            options: {
                animate: false,
                distance: 0,
                max: 100,
                min: 0,
                orientation: "horizontal",
                range: false,
                step: 1,
                value: 0,
                values: null,
                change: null,
                slide: null,
                start: null,
                stop: null
            },
            numPages: 5,
            _create: function() {
                this._keySliding = false;
                this._mouseSliding = false;
                this._animateOff = true;
                this._handleIndex = null;
                this._detectOrientation();
                this._mouseInit();
                this.element.addClass("ui-slider" + " ui-slider-" + this.orientation + " ui-widget" + " ui-widget-content" + " ui-corner-all");
                this._refresh();
                this._setOption("disabled", this.options.disabled);
                this._animateOff = false
            },
            _refresh: function() {
                this._createRange();
                this._createHandles();
                this._setupEvents();
                this._refreshValue()
            },
            _createHandles: function() {
                var i, handleCount, options = this.options,
                    existingHandles = this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),
                    handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
                    handles = [];
                handleCount = options.values && options.values.length || 1;
                if (existingHandles.length > handleCount) {
                    existingHandles.slice(handleCount).remove();
                    existingHandles = existingHandles.slice(0, handleCount)
                }
                for (i = existingHandles.length; i < handleCount; i++) {
                    handles.push(handle)
                }
                this.handles = existingHandles.add($(handles.join("")).appendTo(this.element));
                this.handle = this.handles.eq(0);
                this.handles.each(function(i) {
                    $(this).data("ui-slider-handle-index", i)
                })
            },
            _createRange: function() {
                var options = this.options,
                    classes = "";
                if (options.range) {
                    if (options.range === true) {
                        if (!options.values) {
                            options.values = [this._valueMin(), this._valueMin()]
                        } else if (options.values.length && options.values.length !== 2) {
                            options.values = [options.values[0], options.values[0]]
                        } else if ($.isArray(options.values)) {
                            options.values = options.values.slice(0)
                        }
                    }
                    if (!this.range || !this.range.length) {
                        this.range = $("<div></div>").appendTo(this.element);
                        classes = "ui-slider-range" + " ui-widget-header ui-corner-all"
                    } else {
                        this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({
                            left: "",
                            bottom: ""
                        })
                    }
                    this.range.addClass(classes + (options.range === "min" || options.range === "max" ? " ui-slider-range-" + options.range : ""))
                } else {
                    if (this.range) {
                        this.range.remove()
                    }
                    this.range = null
                }
            },
            _setupEvents: function() {
                var elements = this.handles.add(this.range).filter("a");
                this._off(elements);
                this._on(elements, this._handleEvents);
                this._hoverable(elements);
                this._focusable(elements)
            },
            _destroy: function() {
                this.handles.remove();
                if (this.range) {
                    this.range.remove()
                }
                this.element.removeClass("ui-slider" + " ui-slider-horizontal" + " ui-slider-vertical" + " ui-widget" + " ui-widget-content" + " ui-corner-all");
                this._mouseDestroy()
            },
            _mouseCapture: function(event) {
                var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle, that = this,
                    o = this.options;
                if (o.disabled) {
                    return false
                }
                this.elementSize = {
                    width: this.element.outerWidth(),
                    height: this.element.outerHeight()
                };
                this.elementOffset = this.element.offset();
                position = {
                    x: event.pageX,
                    y: event.pageY
                };
                normValue = this._normValueFromMouse(position);
                distance = this._valueMax() - this._valueMin() + 1;
                this.handles.each(function(i) {
                    var thisDistance = Math.abs(normValue - that.values(i));
                    if (distance > thisDistance || distance === thisDistance && (i === that._lastChangedValue || that.values(i) === o.min)) {
                        distance = thisDistance;
                        closestHandle = $(this);
                        index = i
                    }
                });
                allowed = this._start(event, index);
                if (allowed === false) {
                    return false
                }
                this._mouseSliding = true;
                this._handleIndex = index;
                closestHandle.addClass("ui-state-active").focus();
                offset = closestHandle.offset();
                mouseOverHandle = !$(event.target).parents().addBack().is(".ui-slider-handle");
                this._clickOffset = mouseOverHandle ? {
                    left: 0,
                    top: 0
                } : {
                    left: event.pageX - offset.left - closestHandle.width() / 2,
                    top: event.pageY - offset.top - closestHandle.height() / 2 - (parseInt(closestHandle.css("borderTopWidth"), 10) || 0) - (parseInt(closestHandle.css("borderBottomWidth"), 10) || 0) + (parseInt(closestHandle.css("marginTop"), 10) || 0)
                };
                if (!this.handles.hasClass("ui-state-hover")) {
                    this._slide(event, index, normValue)
                }
                this._animateOff = true;
                return true
            },
            _mouseStart: function() {
                return true
            },
            _mouseDrag: function(event) {
                var position = {
                        x: event.pageX,
                        y: event.pageY
                    },
                    normValue = this._normValueFromMouse(position);
                this._slide(event, this._handleIndex, normValue);
                return false
            },
            _mouseStop: function(event) {
                this.handles.removeClass("ui-state-active");
                this._mouseSliding = false;
                this._stop(event, this._handleIndex);
                this._change(event, this._handleIndex);
                this._handleIndex = null;
                this._clickOffset = null;
                this._animateOff = false;
                return false
            },
            _detectOrientation: function() {
                this.orientation = this.options.orientation === "vertical" ? "vertical" : "horizontal"
            },
            _normValueFromMouse: function(position) {
                var pixelTotal, pixelMouse, percentMouse, valueTotal, valueMouse;
                if (this.orientation === "horizontal") {
                    pixelTotal = this.elementSize.width;
                    pixelMouse = position.x - this.elementOffset.left - (this._clickOffset ? this._clickOffset.left : 0)
                } else {
                    pixelTotal = this.elementSize.height;
                    pixelMouse = position.y - this.elementOffset.top - (this._clickOffset ? this._clickOffset.top : 0)
                }
                percentMouse = pixelMouse / pixelTotal;
                if (percentMouse > 1) {
                    percentMouse = 1
                }
                if (percentMouse < 0) {
                    percentMouse = 0
                }
                if (this.orientation === "vertical") {
                    percentMouse = 1 - percentMouse
                }
                valueTotal = this._valueMax() - this._valueMin();
                valueMouse = this._valueMin() + percentMouse * valueTotal;
                return this._trimAlignValue(valueMouse)
            },
            _start: function(event, index) {
                var uiHash = {
                    handle: this.handles[index],
                    value: this.value()
                };
                if (this.options.values && this.options.values.length) {
                    uiHash.value = this.values(index);
                    uiHash.values = this.values()
                }
                return this._trigger("start", event, uiHash)
            },
            _slide: function(event, index, newVal) {
                var otherVal, newValues, allowed;
                if (this.options.values && this.options.values.length) {
                    otherVal = this.values(index ? 0 : 1);
                    if (this.options.values.length === 2 && this.options.range === true && (index === 0 && newVal > otherVal || index === 1 && newVal < otherVal)) {
                        newVal = otherVal
                    }
                    if (newVal !== this.values(index)) {
                        newValues = this.values();
                        newValues[index] = newVal;
                        allowed = this._trigger("slide", event, {
                            handle: this.handles[index],
                            value: newVal,
                            values: newValues
                        });
                        otherVal = this.values(index ? 0 : 1);
                        if (allowed !== false) {
                            this.values(index, newVal)
                        }
                    }
                } else {
                    if (newVal !== this.value()) {
                        allowed = this._trigger("slide", event, {
                            handle: this.handles[index],
                            value: newVal
                        });
                        if (allowed !== false) {
                            this.value(newVal)
                        }
                    }
                }
            },
            _stop: function(event, index) {
                var uiHash = {
                    handle: this.handles[index],
                    value: this.value()
                };
                if (this.options.values && this.options.values.length) {
                    uiHash.value = this.values(index);
                    uiHash.values = this.values()
                }
                this._trigger("stop", event, uiHash)
            },
            _change: function(event, index) {
                if (!this._keySliding && !this._mouseSliding) {
                    var uiHash = {
                        handle: this.handles[index],
                        value: this.value()
                    };
                    if (this.options.values && this.options.values.length) {
                        uiHash.value = this.values(index);
                        uiHash.values = this.values()
                    }
                    this._lastChangedValue = index;
                    this._trigger("change", event, uiHash)
                }
            },
            value: function(newValue) {
                if (arguments.length) {
                    this.options.value = this._trimAlignValue(newValue);
                    this._refreshValue();
                    this._change(null, 0);
                    return
                }
                return this._value()
            },
            values: function(index, newValue) {
                var vals, newValues, i;
                if (arguments.length > 1) {
                    this.options.values[index] = this._trimAlignValue(newValue);
                    this._refreshValue();
                    this._change(null, index);
                    return
                }
                if (arguments.length) {
                    if ($.isArray(arguments[0])) {
                        vals = this.options.values;
                        newValues = arguments[0];
                        for (i = 0; i < vals.length; i += 1) {
                            vals[i] = this._trimAlignValue(newValues[i]);
                            this._change(null, i)
                        }
                        this._refreshValue()
                    } else {
                        if (this.options.values && this.options.values.length) {
                            return this._values(index)
                        } else {
                            return this.value()
                        }
                    }
                } else {
                    return this._values()
                }
            },
            _setOption: function(key, value) {
                var i, valsLength = 0;
                if (key === "range" && this.options.range === true) {
                    if (value === "min") {
                        this.options.value = this._values(0);
                        this.options.values = null
                    } else if (value === "max") {
                        this.options.value = this._values(this.options.values.length - 1);
                        this.options.values = null
                    }
                }
                if ($.isArray(this.options.values)) {
                    valsLength = this.options.values.length
                }
                if (key === "disabled") {
                    this.element.toggleClass("ui-state-disabled", !!value)
                }
                this._super(key, value);
                switch (key) {
                    case "orientation":
                        this._detectOrientation();
                        this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-" + this.orientation);
                        this._refreshValue();
                        break;
                    case "value":
                        this._animateOff = true;
                        this._refreshValue();
                        this._change(null, 0);
                        this._animateOff = false;
                        break;
                    case "values":
                        this._animateOff = true;
                        this._refreshValue();
                        for (i = 0; i < valsLength; i += 1) {
                            this._change(null, i)
                        }
                        this._animateOff = false;
                        break;
                    case "min":
                    case "max":
                        this._animateOff = true;
                        this._refreshValue();
                        this._animateOff = false;
                        break;
                    case "range":
                        this._animateOff = true;
                        this._refresh();
                        this._animateOff = false;
                        break
                }
            },
            _value: function() {
                var val = this.options.value;
                val = this._trimAlignValue(val);
                return val
            },
            _values: function(index) {
                var val, vals, i;
                if (arguments.length) {
                    val = this.options.values[index];
                    val = this._trimAlignValue(val);
                    return val
                } else if (this.options.values && this.options.values.length) {
                    vals = this.options.values.slice();
                    for (i = 0; i < vals.length; i += 1) {
                        vals[i] = this._trimAlignValue(vals[i])
                    }
                    return vals
                } else {
                    return []
                }
            },
            _trimAlignValue: function(val) {
                if (val <= this._valueMin()) {
                    return this._valueMin()
                }
                if (val >= this._valueMax()) {
                    return this._valueMax()
                }
                var step = this.options.step > 0 ? this.options.step : 1,
                    valModStep = (val - this._valueMin()) % step,
                    alignValue = val - valModStep;
                if (Math.abs(valModStep) * 2 >= step) {
                    alignValue += valModStep > 0 ? step : -step
                }
                return parseFloat(alignValue.toFixed(5))
            },
            _valueMin: function() {
                return this.options.min
            },
            _valueMax: function() {
                return this.options.max
            },
            _refreshValue: function() {
                var lastValPercent, valPercent, value, valueMin, valueMax, oRange = this.options.range,
                    o = this.options,
                    that = this,
                    animate = !this._animateOff ? o.animate : false,
                    _set = {};
                if (this.options.values && this.options.values.length) {
                    this.handles.each(function(i) {
                        valPercent = (that.values(i) - that._valueMin()) / (that._valueMax() - that._valueMin()) * 100;
                        _set[that.orientation === "horizontal" ? "left" : "bottom"] = valPercent + "%";
                        $(this).stop(1, 1)[animate ? "animate" : "css"](_set, o.animate);
                        if (that.options.range === true) {
                            if (that.orientation === "horizontal") {
                                if (i === 0) {
                                    that.range.stop(1, 1)[animate ? "animate" : "css"]({
                                        left: valPercent + "%"
                                    }, o.animate)
                                }
                                if (i === 1) {
                                    that.range[animate ? "animate" : "css"]({
                                        width: valPercent - lastValPercent + "%"
                                    }, {
                                        queue: false,
                                        duration: o.animate
                                    })
                                }
                            } else {
                                if (i === 0) {
                                    that.range.stop(1, 1)[animate ? "animate" : "css"]({
                                        bottom: valPercent + "%"
                                    }, o.animate)
                                }
                                if (i === 1) {
                                    that.range[animate ? "animate" : "css"]({
                                        height: valPercent - lastValPercent + "%"
                                    }, {
                                        queue: false,
                                        duration: o.animate
                                    })
                                }
                            }
                        }
                        lastValPercent = valPercent
                    })
                } else {
                    value = this.value();
                    valueMin = this._valueMin();
                    valueMax = this._valueMax();
                    valPercent = valueMax !== valueMin ? (value - valueMin) / (valueMax - valueMin) * 100 : 0;
                    _set[this.orientation === "horizontal" ? "left" : "bottom"] = valPercent + "%";
                    this.handle.stop(1, 1)[animate ? "animate" : "css"](_set, o.animate);
                    if (oRange === "min" && this.orientation === "horizontal") {
                        this.range.stop(1, 1)[animate ? "animate" : "css"]({
                            width: valPercent + "%"
                        }, o.animate)
                    }
                    if (oRange === "max" && this.orientation === "horizontal") {
                        this.range[animate ? "animate" : "css"]({
                            width: 100 - valPercent + "%"
                        }, {
                            queue: false,
                            duration: o.animate
                        })
                    }
                    if (oRange === "min" && this.orientation === "vertical") {
                        this.range.stop(1, 1)[animate ? "animate" : "css"]({
                            height: valPercent + "%"
                        }, o.animate)
                    }
                    if (oRange === "max" && this.orientation === "vertical") {
                        this.range[animate ? "animate" : "css"]({
                            height: 100 - valPercent + "%"
                        }, {
                            queue: false,
                            duration: o.animate
                        })
                    }
                }
            },
            _handleEvents: {
                keydown: function(event) {
                    var allowed, curVal, newVal, step, index = $(event.target).data("ui-slider-handle-index");
                    switch (event.keyCode) {
                        case $.ui.keyCode.HOME:
                        case $.ui.keyCode.END:
                        case $.ui.keyCode.PAGE_UP:
                        case $.ui.keyCode.PAGE_DOWN:
                        case $.ui.keyCode.UP:
                        case $.ui.keyCode.RIGHT:
                        case $.ui.keyCode.DOWN:
                        case $.ui.keyCode.LEFT:
                            event.preventDefault();
                            if (!this._keySliding) {
                                this._keySliding = true;
                                $(event.target).addClass("ui-state-active");
                                allowed = this._start(event, index);
                                if (allowed === false) {
                                    return
                                }
                            }
                            break
                    }
                    step = this.options.step;
                    if (this.options.values && this.options.values.length) {
                        curVal = newVal = this.values(index)
                    } else {
                        curVal = newVal = this.value()
                    }
                    switch (event.keyCode) {
                        case $.ui.keyCode.HOME:
                            newVal = this._valueMin();
                            break;
                        case $.ui.keyCode.END:
                            newVal = this._valueMax();
                            break;
                        case $.ui.keyCode.PAGE_UP:
                            newVal = this._trimAlignValue(curVal + (this._valueMax() - this._valueMin()) / this.numPages);
                            break;
                        case $.ui.keyCode.PAGE_DOWN:
                            newVal = this._trimAlignValue(curVal - (this._valueMax() - this._valueMin()) / this.numPages);
                            break;
                        case $.ui.keyCode.UP:
                        case $.ui.keyCode.RIGHT:
                            if (curVal === this._valueMax()) {
                                return
                            }
                            newVal = this._trimAlignValue(curVal + step);
                            break;
                        case $.ui.keyCode.DOWN:
                        case $.ui.keyCode.LEFT:
                            if (curVal === this._valueMin()) {
                                return
                            }
                            newVal = this._trimAlignValue(curVal - step);
                            break
                    }
                    this._slide(event, index, newVal)
                },
                click: function(event) {
                    event.preventDefault()
                },
                keyup: function(event) {
                    var index = $(event.target).data("ui-slider-handle-index");
                    if (this._keySliding) {
                        this._keySliding = false;
                        this._stop(event, index);
                        this._change(event, index);
                        $(event.target).removeClass("ui-state-active")
                    }
                }
            }
        })
    })(jQuery);
    return jQuery
});
define("jquery.ui.datepicker", ["jquery"], function(jQuery) {
    jQuery(function(a) {
        a.datepicker.regional.af = {
            closeText: "Selekteer",
            prevText: "Vorige",
            nextText: "Volgende",
            currentText: "Vandag",
            monthNames: ["Januarie", "Februarie", "Maart", "April", "Mei", "Junie", "Julie", "Augustus", "September", "Oktober", "November", "Desember"],
            monthNamesShort: ["Jan", "Feb", "Mrt", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
            dayNames: ["Sondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrydag", "Saterdag"],
            dayNamesShort: ["Son", "Maa", "Din", "Woe", "Don", "Vry", "Sat"],
            dayNamesMin: ["So", "Ma", "Di", "Wo", "Do", "Vr", "Sa"],
            weekHeader: "Wk",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.af)
    }), jQuery(function(a) {
        a.datepicker.regional["ar-DZ"] = {
            closeText: "إغلاق",
            prevText: "&#x3c;السابق",
            nextText: "التالي&#x3e;",
            currentText: "اليوم",
            monthNames: ["جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"],
            monthNamesShort: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
            dayNames: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"],
            dayNamesShort: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"],
            dayNamesMin: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"],
            weekHeader: "أسبوع",
            dateFormat: "dd/mm/yy",
            firstDay: 6,
            isRTL: !0,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["ar-DZ"])
    }), jQuery(function(a) {
        a.datepicker.regional.ar = {
            closeText: "إغلاق",
            prevText: "&#x3c;السابق",
            nextText: "التالي&#x3e;",
            currentText: "اليوم",
            monthNames: ["كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"],
            monthNamesShort: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
            dayNames: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"],
            dayNamesShort: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"],
            dayNamesMin: ["ح", "ن", "ث", "ر", "خ", "ج", "س"],
            weekHeader: "أسبوع",
            dateFormat: "dd/mm/yy",
            firstDay: 6,
            isRTL: !0,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ar)
    }), jQuery(function(a) {
        a.datepicker.regional.az = {
            closeText: "Bağla",
            prevText: "&#x3c;Geri",
            nextText: "İrəli&#x3e;",
            currentText: "Bugün",
            monthNames: ["Yanvar", "Fevral", "Mart", "Aprel", "May", "İyun", "İyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"],
            monthNamesShort: ["Yan", "Fev", "Mar", "Apr", "May", "İyun", "İyul", "Avq", "Sen", "Okt", "Noy", "Dek"],
            dayNames: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"],
            dayNamesShort: ["B", "Be", "Ça", "Ç", "Ca", "C", "Ş"],
            dayNamesMin: ["B", "B", "Ç", "С", "Ç", "C", "Ş"],
            weekHeader: "Hf",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.az)
    }), jQuery(function(a) {
        a.datepicker.regional.bg = {
            closeText: "затвори",
            prevText: "&#x3c;назад",
            nextText: "напред&#x3e;",
            nextBigText: "&#x3e;&#x3e;",
            currentText: "днес",
            monthNames: ["Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"],
            monthNamesShort: ["Яну", "Фев", "Мар", "Апр", "Май", "Юни", "Юли", "Авг", "Сеп", "Окт", "Нов", "Дек"],
            dayNames: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"],
            dayNamesShort: ["Нед", "Пон", "Вто", "Сря", "Чет", "Пет", "Съб"],
            dayNamesMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Съ"],
            weekHeader: "Wk",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.bg)
    }), jQuery(function(a) {
        a.datepicker.regional.bs = {
            closeText: "Zatvori",
            prevText: "&#x3c;",
            nextText: "&#x3e;",
            currentText: "Danas",
            monthNames: ["Januar", "Februar", "Mart", "April", "Maj", "Juni", "Juli", "August", "Septembar", "Oktobar", "Novembar", "Decembar"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
            dayNames: ["Nedelja", "Ponedeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"],
            dayNamesShort: ["Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"],
            dayNamesMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su"],
            weekHeader: "Wk",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.bs)
    }), jQuery(function(a) {
        a.datepicker.regional.ca = {
            closeText: "Tancar",
            prevText: "&#x3c;Ant",
            nextText: "Seg&#x3e;",
            currentText: "Avui",
            monthNames: ["Gener", "Febrer", "Mar&ccedil;", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"],
            monthNamesShort: ["Gen", "Feb", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Oct", "Nov", "Des"],
            dayNames: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"],
            dayNamesShort: ["Dug", "Dln", "Dmt", "Dmc", "Djs", "Dvn", "Dsb"],
            dayNamesMin: ["Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"],
            weekHeader: "Sm",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ca)
    }), jQuery(function(a) {
        a.datepicker.regional.cs = {
            closeText: "Zavřít",
            prevText: "&#x3c;Dříve",
            nextText: "Později&#x3e;",
            currentText: "Nyní",
            monthNames: ["leden", "únor", "březen", "duben", "květen", "červen", "červenec", "srpen", "září", "říjen", "listopad", "prosinec"],
            monthNamesShort: ["led", "úno", "bře", "dub", "kvě", "čer", "čvc", "srp", "zář", "říj", "lis", "pro"],
            dayNames: ["neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"],
            dayNamesShort: ["ne", "po", "út", "st", "čt", "pá", "so"],
            dayNamesMin: ["ne", "po", "út", "st", "čt", "pá", "so"],
            weekHeader: "Týd",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.cs)
    }), jQuery(function(a) {
        a.datepicker.regional["cy-GB"] = {
            closeText: "Done",
            prevText: "Prev",
            nextText: "Next",
            currentText: "Today",
            monthNames: ["Ionawr", "Chwefror", "Mawrth", "Ebrill", "Mai", "Mehefin", "Gorffennaf", "Awst", "Medi", "Hydref", "Tachwedd", "Rhagfyr"],
            monthNamesShort: ["Ion", "Chw", "Maw", "Ebr", "Mai", "Meh", "Gor", "Aws", "Med", "Hyd", "Tac", "Rha"],
            dayNames: ["Dydd Sul", "Dydd Llun", "Dydd Mawrth", "Dydd Mercher", "Dydd Iau", "Dydd Gwener", "Dydd Sadwrn"],
            dayNamesShort: ["Sul", "Llu", "Maw", "Mer", "Iau", "Gwe", "Sad"],
            dayNamesMin: ["Su", "Ll", "Ma", "Me", "Ia", "Gw", "Sa"],
            weekHeader: "Wy",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["cy-GB"])
    }), jQuery(function(a) {
        a.datepicker.regional.da = {
            closeText: "Luk",
            prevText: "&#x3c;Forrige",
            nextText: "Næste&#x3e;",
            currentText: "Idag",
            monthNames: ["Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
            dayNames: ["Søndag", "Mandag", "Tirsdag", "Onsdag", "Torsdag", "Fredag", "Lørdag"],
            dayNamesShort: ["Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"],
            dayNamesMin: ["Sø", "Ma", "Ti", "On", "To", "Fr", "Lø"],
            weekHeader: "Uge",
            dateFormat: "dd-mm-yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.da)
    }), jQuery(function(a) {
        a.datepicker.regional.de = {
            closeText: "schließen",
            prevText: "&#x3c;zurück",
            nextText: "Vor&#x3e;",
            currentText: "heute",
            monthNames: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
            monthNamesShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
            dayNames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"],
            dayNamesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
            dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
            weekHeader: "KW",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.de)
    }), jQuery(function(a) {
        a.datepicker.regional.el = {
            closeText: "Κλείσιμο",
            prevText: "Προηγούμενος",
            nextText: "Επόμενος",
            currentText: "Τρέχων Μήνας",
            monthNames: ["Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"],
            monthNamesShort: ["Ιαν", "Φεβ", "Μαρ", "Απρ", "Μαι", "Ιουν", "Ιουλ", "Αυγ", "Σεπ", "Οκτ", "Νοε", "Δεκ"],
            dayNames: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"],
            dayNamesShort: ["Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"],
            dayNamesMin: ["Κυ", "Δε", "Τρ", "Τε", "Πε", "Πα", "Σα"],
            weekHeader: "Εβδ",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.el)
    }), jQuery(function(a) {
        a.datepicker.regional["en-AU"] = {
            closeText: "Done",
            prevText: "Prev",
            nextText: "Next",
            currentText: "Today",
            monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
            dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
            weekHeader: "Wk",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["en-AU"])
    }), jQuery(function(a) {
        a.datepicker.regional["en-GB"] = {
            closeText: "Done",
            prevText: "Prev",
            nextText: "Next",
            currentText: "Today",
            monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
            dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
            weekHeader: "Wk",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["en-GB"])
    }), jQuery(function(a) {
        a.datepicker.regional["en-NZ"] = {
            closeText: "Done",
            prevText: "Prev",
            nextText: "Next",
            currentText: "Today",
            monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
            dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
            dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
            weekHeader: "Wk",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["en-NZ"])
    }), jQuery(function(a) {
        a.datepicker.regional.eo = {
            closeText: "Fermi",
            prevText: "&lt;Anta",
            nextText: "Sekv&gt;",
            currentText: "Nuna",
            monthNames: ["Januaro", "Februaro", "Marto", "Aprilo", "Majo", "Junio", "Julio", "Aŭgusto", "Septembro", "Oktobro", "Novembro", "Decembro"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aŭg", "Sep", "Okt", "Nov", "Dec"],
            dayNames: ["Dimanĉo", "Lundo", "Mardo", "Merkredo", "Ĵaŭdo", "Vendredo", "Sabato"],
            dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Ĵaŭ", "Ven", "Sab"],
            dayNamesMin: ["Di", "Lu", "Ma", "Me", "Ĵa", "Ve", "Sa"],
            weekHeader: "Sb",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.eo)
    }), jQuery(function(a) {
        a.datepicker.regional.es = {
            closeText: "Cerrar",
            prevText: "&#x3c;Ant",
            nextText: "Sig&#x3e;",
            currentText: "Hoy",
            monthNames: ["Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"],
            monthNamesShort: ["Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"],
            dayNames: ["Domingo", "Lunes", "Martes", "Mi&eacute;rcoles", "Jueves", "Viernes", "S&aacute;bado"],
            dayNamesShort: ["Dom", "Lun", "Mar", "Mi&eacute;", "Juv", "Vie", "S&aacute;b"],
            dayNamesMin: ["Do", "Lu", "Ma", "Mi", "Ju", "Vi", "S&aacute;"],
            weekHeader: "Sm",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.es)
    }), jQuery(function(a) {
        a.datepicker.regional.et = {
            closeText: "Sulge",
            prevText: "Eelnev",
            nextText: "Järgnev",
            currentText: "Täna",
            monthNames: ["Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"],
            monthNamesShort: ["Jaan", "Veebr", "Märts", "Apr", "Mai", "Juuni", "Juuli", "Aug", "Sept", "Okt", "Nov", "Dets"],
            dayNames: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"],
            dayNamesShort: ["Pühap", "Esmasp", "Teisip", "Kolmap", "Neljap", "Reede", "Laup"],
            dayNamesMin: ["P", "E", "T", "K", "N", "R", "L"],
            weekHeader: "näd",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.et)
    }), jQuery(function(a) {
        a.datepicker.regional.eu = {
            closeText: "Egina",
            prevText: "&#x3c;Aur",
            nextText: "Hur&#x3e;",
            currentText: "Gaur",
            monthNames: ["urtarrila", "otsaila", "martxoa", "apirila", "maiatza", "ekaina", "uztaila", "abuztua", "iraila", "urria", "azaroa", "abendua"],
            monthNamesShort: ["urt.", "ots.", "mar.", "api.", "mai.", "eka.", "uzt.", "abu.", "ira.", "urr.", "aza.", "abe."],
            dayNames: ["igandea", "astelehena", "asteartea", "asteazkena", "osteguna", "ostirala", "larunbata"],
            dayNamesShort: ["ig.", "al.", "ar.", "az.", "og.", "ol.", "lr."],
            dayNamesMin: ["ig", "al", "ar", "az", "og", "ol", "lr"],
            weekHeader: "As",
            dateFormat: "yy-mm-dd",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.eu)
    }), jQuery(function(a) {
        a.datepicker.regional.fa = {
            closeText: "بستن",
            prevText: "&#x3C;قبلی",
            nextText: "بعدی&#x3E;",
            currentText: "امروز",
            monthNames: ["فروردين", "ارديبهشت", "خرداد", "تير", "مرداد", "شهريور", "مهر", "آبان", "آذر", "دی", "بهمن", "اسفند"],
            monthNamesShort: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
            dayNames: ["يکشنبه", "دوشنبه", "سه‌شنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه"],
            dayNamesShort: ["ی", "د", "س", "چ", "پ", "ج", "ش"],
            dayNamesMin: ["ی", "د", "س", "چ", "پ", "ج", "ش"],
            weekHeader: "هف",
            dateFormat: "yy/mm/dd",
            firstDay: 6,
            isRTL: !0,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.fa)
    }), jQuery(function(a) {
        a.datepicker.regional.fi = {
            closeText: "Sulje",
            prevText: "&#xAB;Edellinen",
            nextText: "Seuraava&#xBB;",
            currentText: "T&#xE4;n&#xE4;&#xE4;n",
            monthNames: ["Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kes&#xE4;kuu", "Hein&#xE4;kuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"],
            monthNamesShort: ["Tammi", "Helmi", "Maalis", "Huhti", "Touko", "Kes&#xE4;", "Hein&#xE4;", "Elo", "Syys", "Loka", "Marras", "Joulu"],
            dayNamesShort: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"],
            dayNames: ["Sunnuntai", "Maanantai", "Tiistai", "Keskiviikko", "Torstai", "Perjantai", "Lauantai"],
            dayNamesMin: ["Su", "Ma", "Ti", "Ke", "To", "Pe", "La"],
            weekHeader: "Vk",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.fi)
    }), jQuery(function(a) {
        a.datepicker.regional.fo = {
            closeText: "Lat aftur",
            prevText: "&#x3c;Fyrra",
            nextText: "Næsta&#x3e;",
            currentText: "Í dag",
            monthNames: ["Januar", "Februar", "Mars", "Apríl", "Mei", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Des"],
            dayNames: ["Sunnudagur", "Mánadagur", "Týsdagur", "Mikudagur", "Hósdagur", "Fríggjadagur", "Leyardagur"],
            dayNamesShort: ["Sun", "Mán", "Týs", "Mik", "Hós", "Frí", "Ley"],
            dayNamesMin: ["Su", "Má", "Tý", "Mi", "Hó", "Fr", "Le"],
            weekHeader: "Vk",
            dateFormat: "dd-mm-yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.fo)
    }), jQuery(function(a) {
        a.datepicker.regional["fr-CH"] = {
            closeText: "Fermer",
            prevText: "&#x3c;Préc",
            nextText: "Suiv&#x3e;",
            currentText: "Courant",
            monthNames: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
            monthNamesShort: ["Jan", "Fév", "Mar", "Avr", "Mai", "Jun", "Jul", "Aoû", "Sep", "Oct", "Nov", "Déc"],
            dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
            dayNamesShort: ["Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"],
            dayNamesMin: ["Di", "Lu", "Ma", "Me", "Je", "Ve", "Sa"],
            weekHeader: "Sm",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["fr-CH"])
    }), jQuery(function(a) {
        a.datepicker.regional.fr = {
            closeText: "Fermer",
            prevText: "Précédent",
            nextText: "Suivant",
            currentText: "Aujourd'hui",
            monthNames: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"],
            monthNamesShort: ["Janv.", "Févr.", "Mars", "Avril", "Mai", "Juin", "Juil.", "Août", "Sept.", "Oct.", "Nov.", "Déc."],
            dayNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"],
            dayNamesShort: ["Dim.", "Lun.", "Mar.", "Mer.", "Jeu.", "Ven.", "Sam."],
            dayNamesMin: ["D", "L", "M", "M", "J", "V", "S"],
            weekHeader: "Sem.",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.fr)
    }), jQuery(function(a) {
        a.datepicker.regional.gl = {
            closeText: "Pechar",
            prevText: "&#x3c;Ant",
            nextText: "Seg&#x3e;",
            currentText: "Hoxe",
            monthNames: ["Xaneiro", "Febreiro", "Marzo", "Abril", "Maio", "Xuño", "Xullo", "Agosto", "Setembro", "Outubro", "Novembro", "Decembro"],
            monthNamesShort: ["Xan", "Feb", "Mar", "Abr", "Mai", "Xuñ", "Xul", "Ago", "Set", "Out", "Nov", "Dec"],
            dayNames: ["Domingo", "Luns", "Martes", "M&eacute;rcores", "Xoves", "Venres", "S&aacute;bado"],
            dayNamesShort: ["Dom", "Lun", "Mar", "M&eacute;r", "Xov", "Ven", "S&aacute;b"],
            dayNamesMin: ["Do", "Lu", "Ma", "M&eacute;", "Xo", "Ve", "S&aacute;"],
            weekHeader: "Sm",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.gl)
    }), jQuery(function(a) {
        a.datepicker.regional.he = {
            closeText: "סגור",
            prevText: "&#x3c;הקודם",
            nextText: "הבא&#x3e;",
            currentText: "היום",
            monthNames: ["ינואר", "פברואר", "מרץ", "אפריל", "מאי", "יוני", "יולי", "אוגוסט", "ספטמבר", "אוקטובר", "נובמבר", "דצמבר"],
            monthNamesShort: ["ינו", "פבר", "מרץ", "אפר", "מאי", "יוני", "יולי", "אוג", "ספט", "אוק", "נוב", "דצמ"],
            dayNames: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת"],
            dayNamesShort: ["א'", "ב'", "ג'", "ד'", "ה'", "ו'", "שבת"],
            dayNamesMin: ["א'", "ב'", "ג'", "ד'", "ה'", "ו'", "שבת"],
            weekHeader: "Wk",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !0,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.he)
    }), jQuery(function(a) {
        a.datepicker.regional.hi = {
            closeText: "बंद",
            prevText: "पिछला",
            nextText: "अगला",
            currentText: "आज",
            monthNames: ["जनवरी ", "फरवरी", "मार्च", "अप्रेल", "मई", "जून", "जूलाई", "अगस्त ", "सितम्बर", "अक्टूबर", "नवम्बर", "दिसम्बर"],
            monthNamesShort: ["जन", "फर", "मार्च", "अप्रेल", "मई", "जून", "जूलाई", "अग", "सित", "अक्ट", "नव", "दि"],
            dayNames: ["रविवार", "सोमवार", "मंगलवार", "बुधवार", "गुरुवार", "शुक्रवार", "शनिवार"],
            dayNamesShort: ["रवि", "सोम", "मंगल", "बुध", "गुरु", "शुक्र", "शनि"],
            dayNamesMin: ["रवि", "सोम", "मंगल", "बुध", "गुरु", "शुक्र", "शनि"],
            weekHeader: "हफ्ता",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.hi)
    }), jQuery(function(a) {
        a.datepicker.regional.hr = {
            closeText: "Zatvori",
            prevText: "&#x3c;",
            nextText: "&#x3e;",
            currentText: "Danas",
            monthNames: ["Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"],
            monthNamesShort: ["Sij", "Velj", "Ožu", "Tra", "Svi", "Lip", "Srp", "Kol", "Ruj", "Lis", "Stu", "Pro"],
            dayNames: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"],
            dayNamesShort: ["Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"],
            dayNamesMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su"],
            weekHeader: "Tje",
            dateFormat: "dd.mm.yy.",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.hr)
    }), jQuery(function(a) {
        a.datepicker.regional.hu = {
            closeText: "bezár",
            prevText: "vissza",
            nextText: "előre",
            currentText: "ma",
            monthNames: ["Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Már", "Ápr", "Máj", "Jún", "Júl", "Aug", "Szep", "Okt", "Nov", "Dec"],
            dayNames: ["Vasárnap", "Hétfő", "Kedd", "Szerda", "Csütörtök", "Péntek", "Szombat"],
            dayNamesShort: ["Vas", "Hét", "Ked", "Sze", "Csü", "Pén", "Szo"],
            dayNamesMin: ["V", "H", "K", "Sze", "Cs", "P", "Szo"],
            weekHeader: "Hét",
            dateFormat: "yy.mm.dd.",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !0,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.hu)
    }), jQuery(function(a) {
        a.datepicker.regional.hy = {
            closeText: "Փակել",
            prevText: "&#x3c;Նախ.",
            nextText: "Հաջ.&#x3e;",
            currentText: "Այսօր",
            monthNames: ["Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"],
            monthNamesShort: ["Հունվ", "Փետր", "Մարտ", "Ապր", "Մայիս", "Հունիս", "Հուլ", "Օգս", "Սեպ", "Հոկ", "Նոյ", "Դեկ"],
            dayNames: ["կիրակի", "եկուշաբթի", "երեքշաբթի", "չորեքշաբթի", "հինգշաբթի", "ուրբաթ", "շաբաթ"],
            dayNamesShort: ["կիր", "երկ", "երք", "չրք", "հնգ", "ուրբ", "շբթ"],
            dayNamesMin: ["կիր", "երկ", "երք", "չրք", "հնգ", "ուրբ", "շբթ"],
            weekHeader: "ՇԲՏ",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.hy)
    }), jQuery(function(a) {
        a.datepicker.regional.id = {
            closeText: "Tutup",
            prevText: "&#x3c;mundur",
            nextText: "maju&#x3e;",
            currentText: "hari ini",
            monthNames: ["Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "Nopember", "Desember"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Agus", "Sep", "Okt", "Nop", "Des"],
            dayNames: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"],
            dayNamesShort: ["Min", "Sen", "Sel", "Rab", "kam", "Jum", "Sab"],
            dayNamesMin: ["Mg", "Sn", "Sl", "Rb", "Km", "jm", "Sb"],
            weekHeader: "Mg",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.id)
    }), jQuery(function(a) {
        a.datepicker.regional.is = {
            closeText: "Loka",
            prevText: "&#x3c; Fyrri",
            nextText: "N&aelig;sti &#x3e;",
            currentText: "&Iacute; dag",
            monthNames: ["Jan&uacute;ar", "Febr&uacute;ar", "Mars", "Apr&iacute;l", "Ma&iacute", "J&uacute;n&iacute;", "J&uacute;l&iacute;", "&Aacute;g&uacute;st", "September", "Okt&oacute;ber", "N&oacute;vember", "Desember"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Ma&iacute;", "J&uacute;n", "J&uacute;l", "&Aacute;g&uacute;", "Sep", "Okt", "N&oacute;v", "Des"],
            dayNames: ["Sunnudagur", "M&aacute;nudagur", "&THORN;ri&eth;judagur", "Mi&eth;vikudagur", "Fimmtudagur", "F&ouml;studagur", "Laugardagur"],
            dayNamesShort: ["Sun", "M&aacute;n", "&THORN;ri", "Mi&eth;", "Fim", "F&ouml;s", "Lau"],
            dayNamesMin: ["Su", "M&aacute;", "&THORN;r", "Mi", "Fi", "F&ouml;", "La"],
            weekHeader: "Vika",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.is)
    }), jQuery(function(a) {
        a.datepicker.regional.it = {
            closeText: "Chiudi",
            prevText: "&#x3c;Prec",
            nextText: "Succ&#x3e;",
            currentText: "Oggi",
            monthNames: ["Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"],
            monthNamesShort: ["Gen", "Feb", "Mar", "Apr", "Mag", "Giu", "Lug", "Ago", "Set", "Ott", "Nov", "Dic"],
            dayNames: ["Domenica", "Luned&#236", "Marted&#236", "Mercoled&#236", "Gioved&#236", "Venerd&#236", "Sabato"],
            dayNamesShort: ["Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"],
            dayNamesMin: ["Do", "Lu", "Ma", "Me", "Gi", "Ve", "Sa"],
            weekHeader: "Sm",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.it)
    }), jQuery(function(a) {
        a.datepicker.regional.ja = {
            closeText: "閉じる",
            prevText: "&#x3c;前",
            nextText: "次&#x3e;",
            currentText: "今日",
            monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
            monthNamesShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
            dayNames: ["日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日"],
            dayNamesShort: ["日", "月", "火", "水", "木", "金", "土"],
            dayNamesMin: ["日", "月", "火", "水", "木", "金", "土"],
            weekHeader: "週",
            dateFormat: "yy/mm/dd",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !0,
            yearSuffix: "年"
        }, a.datepicker.setDefaults(a.datepicker.regional.ja)
    }), jQuery(function(a) {
        a.datepicker.regional.ka = {
            closeText: "დახურვა",
            prevText: "&#x3c; წინა",
            nextText: "შემდეგი &#x3e;",
            currentText: "დღეს",
            monthNames: ["იანვარი", "თებერვალი", "მარტი", "აპრილი", "მაისი", "ივნისი", "ივლისი", "აგვისტო", "სექტემბერი", "ოქტომბერი", "ნოემბერი", "დეკემბერი"],
            monthNamesShort: ["იან", "თებ", "მარ", "აპრ", "მაი", "ივნ", "ივლ", "აგვ", "სექ", "ოქტ", "ნოე", "დეკ"],
            dayNames: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი"],
            dayNamesShort: ["კვ", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ"],
            dayNamesMin: ["კვ", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ"],
            weekHeader: "კვირა",
            dateFormat: "dd-mm-yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ka)
    }), jQuery(function(a) {
        a.datepicker.regional.kk = {
            closeText: "Жабу",
            prevText: "&#x3c;Алдыңғы",
            nextText: "Келесі&#x3e;",
            currentText: "Бүгін",
            monthNames: ["Қаңтар", "Ақпан", "Наурыз", "Сәуір", "Мамыр", "Маусым", "Шілде", "Тамыз", "Қыркүйек", "Қазан", "Қараша", "Желтоқсан"],
            monthNamesShort: ["Қаң", "Ақп", "Нау", "Сәу", "Мам", "Мау", "Шіл", "Там", "Қыр", "Қаз", "Қар", "Жел"],
            dayNames: ["Жексенбі", "Дүйсенбі", "Сейсенбі", "Сәрсенбі", "Бейсенбі", "Жұма", "Сенбі"],
            dayNamesShort: ["жкс", "дсн", "ссн", "срс", "бсн", "жма", "снб"],
            dayNamesMin: ["Жк", "Дс", "Сс", "Ср", "Бс", "Жм", "Сн"],
            weekHeader: "Не",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.kk)
    }), jQuery(function(a) {
        a.datepicker.regional.km = {
            closeText: "ធ្វើ​រួច",
            prevText: "មុន",
            nextText: "បន្ទាប់",
            currentText: "ថ្ងៃ​នេះ",
            monthNames: ["មករា", "កុម្ភៈ", "មីនា", "មេសា", "ឧសភា", "មិថុនា", "កក្កដា", "សីហា", "កញ្ញា", "តុលា", "វិច្ឆិកា", "ធ្នូ"],
            monthNamesShort: ["មករា", "កុម្ភៈ", "មីនា", "មេសា", "ឧសភា", "មិថុនា", "កក្កដា", "សីហា", "កញ្ញា", "តុលា", "វិច្ឆិកា", "ធ្នូ"],
            dayNames: ["អាទិត្យ", "ចន្ទ", "អង្គារ", "ពុធ", "ព្រហស្បតិ៍", "សុក្រ", "សៅរ៍"],
            dayNamesShort: ["អា", "ច", "អ", "ពុ", "ព្រហ", "សុ", "សៅ"],
            dayNamesMin: ["អា", "ច", "អ", "ពុ", "ព្រហ", "សុ", "សៅ"],
            weekHeader: "សប្ដាហ៍",
            dateFormat: "dd-mm-yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.km)
    }), jQuery(function(a) {
        a.datepicker.regional.ko = {
            closeText: "닫기",
            prevText: "이전달",
            nextText: "다음달",
            currentText: "오늘",
            monthNames: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],
            monthNamesShort: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],
            dayNames: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"],
            dayNamesShort: ["일", "월", "화", "수", "목", "금", "토"],
            dayNamesMin: ["일", "월", "화", "수", "목", "금", "토"],
            weekHeader: "Wk",
            dateFormat: "yy-mm-dd",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !0,
            yearSuffix: "년"
        }, a.datepicker.setDefaults(a.datepicker.regional.ko)
    }), jQuery(function(a) {
        a.datepicker.regional.lb = {
            closeText: "Fäerdeg",
            prevText: "Zréck",
            nextText: "Weider",
            currentText: "Haut",
            monthNames: ["Januar", "Februar", "Mäerz", "Abrëll", "Mee", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
            monthNamesShort: ["Jan", "Feb", "Mäe", "Abr", "Mee", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
            dayNames: ["Sonndeg", "Méindeg", "Dënschdeg", "Mëttwoch", "Donneschdeg", "Freideg", "Samschdeg"],
            dayNamesShort: ["Son", "Méi", "Dën", "Mët", "Don", "Fre", "Sam"],
            dayNamesMin: ["So", "Mé", "Dë", "Më", "Do", "Fr", "Sa"],
            weekHeader: "W",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.lb)
    }), jQuery(function(a) {
        a.datepicker.regional.lt = {
            closeText: "Uždaryti",
            prevText: "&#x3c;Atgal",
            nextText: "Pirmyn&#x3e;",
            currentText: "Šiandien",
            monthNames: ["Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsėjis", "Spalis", "Lapkritis", "Gruodis"],
            monthNamesShort: ["Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rugp", "Rugs", "Spa", "Lap", "Gru"],
            dayNames: ["sekmadienis", "pirmadienis", "antradienis", "trečiadienis", "ketvirtadienis", "penktadienis", "šeštadienis"],
            dayNamesShort: ["sek", "pir", "ant", "tre", "ket", "pen", "šeš"],
            dayNamesMin: ["Se", "Pr", "An", "Tr", "Ke", "Pe", "Še"],
            weekHeader: "Wk",
            dateFormat: "yy-mm-dd",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.lt)
    }), jQuery(function(a) {
        a.datepicker.regional.lv = {
            closeText: "Aizvērt",
            prevText: "Iepr",
            nextText: "Nāka",
            currentText: "Šodien",
            monthNames: ["Janvāris", "Februāris", "Marts", "Aprīlis", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Mai", "Jūn", "Jūl", "Aug", "Sep", "Okt", "Nov", "Dec"],
            dayNames: ["svētdiena", "pirmdiena", "otrdiena", "trešdiena", "ceturtdiena", "piektdiena", "sestdiena"],
            dayNamesShort: ["svt", "prm", "otr", "tre", "ctr", "pkt", "sst"],
            dayNamesMin: ["Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "Ss"],
            weekHeader: "Nav",
            dateFormat: "dd-mm-yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.lv)
    }), jQuery(function(a) {
        a.datepicker.regional.mk = {
            closeText: "Затвори",
            prevText: "&#x3C;",
            nextText: "&#x3E;",
            currentText: "Денес",
            monthNames: ["Јануари", "Февруари", "Март", "Април", "Мај", "Јуни", "Јули", "Август", "Септември", "Октомври", "Ноември", "Декември"],
            monthNamesShort: ["Јан", "Фев", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Ное", "Дек"],
            dayNames: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"],
            dayNamesShort: ["Нед", "Пон", "Вто", "Сре", "Чет", "Пет", "Саб"],
            dayNamesMin: ["Не", "По", "Вт", "Ср", "Че", "Пе", "Са"],
            weekHeader: "Сед",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.mk)
    }), jQuery(function(a) {
        a.datepicker.regional.ml = {
            closeText: "ശരി",
            prevText: "മുന്നത്തെ",
            nextText: "അടുത്തത് ",
            currentText: "ഇന്ന്",
            monthNames: ["ജനുവരി", "ഫെബ്രുവരി", "മാര്‍ച്ച്", "ഏപ്രില്‍", "മേയ്", "ജൂണ്‍", "ജൂലൈ", "ആഗസ്റ്റ്", "സെപ്റ്റംബര്‍", "ഒക്ടോബര്‍", "നവംബര്‍", "ഡിസംബര്‍"],
            monthNamesShort: ["ജനു", "ഫെബ്", "മാര്‍", "ഏപ്രി", "മേയ്", "ജൂണ്‍", "ജൂലാ", "ആഗ", "സെപ്", "ഒക്ടോ", "നവം", "ഡിസ"],
            dayNames: ["ഞായര്‍", "തിങ്കള്‍", "ചൊവ്വ", "ബുധന്‍", "വ്യാഴം", "വെള്ളി", "ശനി"],
            dayNamesShort: ["ഞായ", "തിങ്ക", "ചൊവ്വ", "ബുധ", "വ്യാഴം", "വെള്ളി", "ശനി"],
            dayNamesMin: ["ഞാ", "തി", "ചൊ", "ബു", "വ്യാ", "വെ", "ശ"],
            weekHeader: "ആ",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ml)
    }), jQuery(function(a) {
        a.datepicker.regional.ms = {
            closeText: "Tutup",
            prevText: "&#x3c;Sebelum",
            nextText: "Selepas&#x3e;",
            currentText: "hari ini",
            monthNames: ["Januari", "Februari", "Mac", "April", "Mei", "Jun", "Julai", "Ogos", "September", "Oktober", "November", "Disember"],
            monthNamesShort: ["Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ogo", "Sep", "Okt", "Nov", "Dis"],
            dayNames: ["Ahad", "Isnin", "Selasa", "Rabu", "Khamis", "Jumaat", "Sabtu"],
            dayNamesShort: ["Aha", "Isn", "Sel", "Rab", "kha", "Jum", "Sab"],
            dayNamesMin: ["Ah", "Is", "Se", "Ra", "Kh", "Ju", "Sa"],
            weekHeader: "Mg",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ms)
    }), jQuery(function(a) {
        a.datepicker.regional["nl-BE"] = {
            closeText: "Sluiten",
            prevText: "←",
            nextText: "→",
            currentText: "Vandaag",
            monthNames: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"],
            monthNamesShort: ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"],
            dayNames: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"],
            dayNamesShort: ["zon", "maa", "din", "woe", "don", "vri", "zat"],
            dayNamesMin: ["zo", "ma", "di", "wo", "do", "vr", "za"],
            weekHeader: "Wk",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["nl-BE"])
    }), jQuery(function(a) {
        a.datepicker.regional.nl = {
            closeText: "Sluiten",
            prevText: "←",
            nextText: "→",
            currentText: "Vandaag",
            monthNames: ["januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"],
            monthNamesShort: ["jan", "feb", "mrt", "apr", "mei", "jun", "jul", "aug", "sep", "okt", "nov", "dec"],
            dayNames: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"],
            dayNamesShort: ["zon", "maa", "din", "woe", "don", "vri", "zat"],
            dayNamesMin: ["zo", "ma", "di", "wo", "do", "vr", "za"],
            weekHeader: "Wk",
            dateFormat: "dd-mm-yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.nl)
    }), jQuery(function(a) {
        a.datepicker.regional.no = {
            closeText: "Lukk",
            prevText: "&laquo;Forrige",
            nextText: "Neste&raquo;",
            currentText: "I dag",
            monthNames: ["januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember"],
            monthNamesShort: ["jan", "feb", "mar", "apr", "mai", "jun", "jul", "aug", "sep", "okt", "nov", "des"],
            dayNamesShort: ["søn", "man", "tir", "ons", "tor", "fre", "lør"],
            dayNames: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"],
            dayNamesMin: ["sø", "ma", "ti", "on", "to", "fr", "lø"],
            weekHeader: "Uke",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.no)
    }), jQuery(function(a) {
        a.datepicker.regional.pl = {
            closeText: "Zamknij",
            prevText: "&#x3c;Poprzedni",
            nextText: "Następny&#x3e;",
            currentText: "Dziś",
            monthNames: ["Styczeń", "Luty", "Marzec", "Kwiecień", "Maj", "Czerwiec", "Lipiec", "Sierpień", "Wrzesień", "Październik", "Listopad", "Grudzień"],
            monthNamesShort: ["Sty", "Lu", "Mar", "Kw", "Maj", "Cze", "Lip", "Sie", "Wrz", "Pa", "Lis", "Gru"],
            dayNames: ["Niedziela", "Poniedziałek", "Wtorek", "Środa", "Czwartek", "Piątek", "Sobota"],
            dayNamesShort: ["Nie", "Pn", "Wt", "Śr", "Czw", "Pt", "So"],
            dayNamesMin: ["N", "Pn", "Wt", "Śr", "Cz", "Pt", "So"],
            weekHeader: "Tydz",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.pl)
    }), jQuery(function(a) {
        a.datepicker.regional["pt-BR"] = {
            closeText: "Fechar",
            prevText: "&#x3c;Anterior",
            nextText: "Pr&oacute;ximo&#x3e;",
            currentText: "Hoje",
            monthNames: ["Janeiro", "Fevereiro", "Mar&ccedil;o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
            monthNamesShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
            dayNames: ["Domingo", "Segunda-feira", "Ter&ccedil;a-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "S&aacute;bado"],
            dayNamesShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S&aacute;b"],
            dayNamesMin: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S&aacute;b"],
            weekHeader: "Sm",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["pt-BR"])
    }), jQuery(function(a) {
        a.datepicker.regional.pt = {
            closeText: "Fechar",
            prevText: "&#x3c;Anterior",
            nextText: "Seguinte",
            currentText: "Hoje",
            monthNames: ["Janeiro", "Fevereiro", "Mar&ccedil;o", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
            monthNamesShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
            dayNames: ["Domingo", "Segunda-feira", "Ter&ccedil;a-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "S&aacute;bado"],
            dayNamesShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S&aacute;b"],
            dayNamesMin: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "S&aacute;b"],
            weekHeader: "Sem",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.pt)
    }), jQuery(function(a) {
        a.datepicker.regional.rm = {
            closeText: "Serrar",
            prevText: "&#x3c;Suandant",
            nextText: "Precedent&#x3e;",
            currentText: "Actual",
            monthNames: ["Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December"],
            monthNamesShort: ["Scha", "Fev", "Mar", "Avr", "Matg", "Zer", "Fan", "Avu", "Sett", "Oct", "Nov", "Dec"],
            dayNames: ["Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda"],
            dayNamesShort: ["Dum", "Gli", "Mar", "Mes", "Gie", "Ven", "Som"],
            dayNamesMin: ["Du", "Gl", "Ma", "Me", "Gi", "Ve", "So"],
            weekHeader: "emna",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.rm)
    }), jQuery(function(a) {
        a.datepicker.regional.ro = {
            closeText: "Închide",
            prevText: "&laquo; Luna precedentă",
            nextText: "Luna următoare &raquo;",
            currentText: "Azi",
            monthNames: ["Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"],
            monthNamesShort: ["Ian", "Feb", "Mar", "Apr", "Mai", "Iun", "Iul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            dayNames: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă"],
            dayNamesShort: ["Dum", "Lun", "Mar", "Mie", "Joi", "Vin", "Sâm"],
            dayNamesMin: ["Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ"],
            weekHeader: "Săpt",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ro)
    }), jQuery(function(a) {
        a.datepicker.regional.ru = {
            closeText: "Закрыть",
            prevText: "&#x3c;Пред",
            nextText: "След&#x3e;",
            currentText: "Сегодня",
            monthNames: ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"],
            monthNamesShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],
            dayNames: ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"],
            dayNamesShort: ["вск", "пнд", "втр", "срд", "чтв", "птн", "сбт"],
            dayNamesMin: ["Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"],
            weekHeader: "Нед",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ru)
    }), jQuery(function(a) {
        a.datepicker.regional.sk = {
            closeText: "Zavrieť",
            prevText: "&#x3c;Predchádzajúci",
            nextText: "Nasledujúci&#x3e;",
            currentText: "Dnes",
            monthNames: ["Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Máj", "Jún", "Júl", "Aug", "Sep", "Okt", "Nov", "Dec"],
            dayNames: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"],
            dayNamesShort: ["Ned", "Pon", "Uto", "Str", "Štv", "Pia", "Sob"],
            dayNamesMin: ["Ne", "Po", "Ut", "St", "Št", "Pia", "So"],
            weekHeader: "Ty",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.sk)
    }), jQuery(function(a) {
        a.datepicker.regional.sl = {
            closeText: "Zapri",
            prevText: "&lt;Prej&#x161;nji",
            nextText: "Naslednji&gt;",
            currentText: "Trenutni",
            monthNames: ["Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"],
            dayNames: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "&#x10C;etrtek", "Petek", "Sobota"],
            dayNamesShort: ["Ned", "Pon", "Tor", "Sre", "&#x10C;et", "Pet", "Sob"],
            dayNamesMin: ["Ne", "Po", "To", "Sr", "&#x10C;e", "Pe", "So"],
            weekHeader: "Teden",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.sl)
    }), jQuery(function(a) {
        a.datepicker.regional.sq = {
            closeText: "mbylle",
            prevText: "&#x3c;mbrapa",
            nextText: "Përpara&#x3e;",
            currentText: "sot",
            monthNames: ["Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"],
            monthNamesShort: ["Jan", "Shk", "Mar", "Pri", "Maj", "Qer", "Kor", "Gus", "Sht", "Tet", "Nën", "Dhj"],
            dayNames: ["E Diel", "E Hënë", "E Martë", "E Mërkurë", "E Enjte", "E Premte", "E Shtune"],
            dayNamesShort: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sh"],
            dayNamesMin: ["Di", "Hë", "Ma", "Më", "En", "Pr", "Sh"],
            weekHeader: "Ja",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.sq)
    }), jQuery(function(a) {
        a.datepicker.regional["sr-SR"] = {
            closeText: "Zatvori",
            prevText: "&#x3c;",
            nextText: "&#x3e;",
            currentText: "Danas",
            monthNames: ["Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Avg", "Sep", "Okt", "Nov", "Dec"],
            dayNames: ["Nedelja", "Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota"],
            dayNamesShort: ["Ned", "Pon", "Uto", "Sre", "Čet", "Pet", "Sub"],
            dayNamesMin: ["Ne", "Po", "Ut", "Sr", "Če", "Pe", "Su"],
            weekHeader: "Sed",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional["sr-SR"])
    }), jQuery(function(a) {
        a.datepicker.regional.sr = {
            closeText: "Затвори",
            prevText: "&#x3c;",
            nextText: "&#x3e;",
            currentText: "Данас",
            monthNames: ["Јануар", "Фебруар", "Март", "Април", "Мај", "Јун", "Јул", "Август", "Септембар", "Октобар", "Новембар", "Децембар"],
            monthNamesShort: ["Јан", "Феб", "Мар", "Апр", "Мај", "Јун", "Јул", "Авг", "Сеп", "Окт", "Нов", "Дец"],
            dayNames: ["Недеља", "Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"],
            dayNamesShort: ["Нед", "Пон", "Уто", "Сре", "Чет", "Пет", "Суб"],
            dayNamesMin: ["Не", "По", "Ут", "Ср", "Че", "Пе", "Су"],
            weekHeader: "Сед",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.sr)
    }), jQuery(function(a) {
        a.datepicker.regional.sv = {
            closeText: "Stäng",
            prevText: "&laquo;Förra",
            nextText: "Nästa&raquo;",
            currentText: "Idag",
            monthNames: ["Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"],
            monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "Maj", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dec"],
            dayNamesShort: ["Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"],
            dayNames: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"],
            dayNamesMin: ["Sö", "Må", "Ti", "On", "To", "Fr", "Lö"],
            weekHeader: "Ve",
            dateFormat: "yy-mm-dd",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.sv)
    }), jQuery(function(a) {
        a.datepicker.regional.ta = {
            closeText: "மூடு",
            prevText: "முன்னையது",
            nextText: "அடுத்தது",
            currentText: "இன்று",
            monthNames: ["தை", "மாசி", "பங்குனி", "சித்திரை", "வைகாசி", "ஆனி", "ஆடி", "ஆவணி", "புரட்டாசி", "ஐப்பசி", "கார்த்திகை", "மார்கழி"],
            monthNamesShort: ["தை", "மாசி", "பங்", "சித்", "வைகா", "ஆனி", "ஆடி", "ஆவ", "புர", "ஐப்", "கார்", "மார்"],
            dayNames: ["ஞாயிற்றுக்கிழமை", "திங்கட்கிழமை", "செவ்வாய்க்கிழமை", "புதன்கிழமை", "வியாழக்கிழமை", "வெள்ளிக்கிழமை", "சனிக்கிழமை"],
            dayNamesShort: ["ஞாயிறு", "திங்கள்", "செவ்வாய்", "புதன்", "வியாழன்", "வெள்ளி", "சனி"],
            dayNamesMin: ["ஞா", "தி", "செ", "பு", "வி", "வெ", "ச"],
            weekHeader: "Не",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.ta)
    }), jQuery(function(a) {
        a.datepicker.regional.th = {
            closeText: "ปิด",
            prevText: "&laquo;&nbsp;ย้อน",
            nextText: "ถัดไป&nbsp;&raquo;",
            currentText: "วันนี้",
            monthNames: ["มกราคม", "กุมภาพันธ์", "มีนาคม", "เมษายน", "พฤษภาคม", "มิถุนายน", "กรกฎาคม", "สิงหาคม", "กันยายน", "ตุลาคม", "พฤศจิกายน", "ธันวาคม"],
            monthNamesShort: ["ม.ค.", "ก.พ.", "มี.ค.", "เม.ย.", "พ.ค.", "มิ.ย.", "ก.ค.", "ส.ค.", "ก.ย.", "ต.ค.", "พ.ย.", "ธ.ค."],
            dayNames: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัสบดี", "ศุกร์", "เสาร์"],
            dayNamesShort: ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."],
            dayNamesMin: ["อา.", "จ.", "อ.", "พ.", "พฤ.", "ศ.", "ส."],
            weekHeader: "Wk",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.th)
    }), jQuery(function(a) {
        a.datepicker.regional.tj = {
            closeText: "Идома",
            prevText: "&#x3c;Қафо",
            nextText: "Пеш&#x3e;",
            currentText: "Имрӯз",
            monthNames: ["Январ", "Феврал", "Март", "Апрел", "Май", "Июн", "Июл", "Август", "Сентябр", "Октябр", "Ноябр", "Декабр"],
            monthNamesShort: ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", "Сен", "Окт", "Ноя", "Дек"],
            dayNames: ["якшанбе", "душанбе", "сешанбе", "чоршанбе", "панҷшанбе", "ҷумъа", "шанбе"],
            dayNamesShort: ["якш", "душ", "сеш", "чор", "пан", "ҷум", "шан"],
            dayNamesMin: ["Як", "Дш", "Сш", "Чш", "Пш", "Ҷм", "Шн"],
            weekHeader: "Хф",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.tj)
    }), jQuery(function(a) {
        a.datepicker.regional.tr = {
            closeText: "kapat",
            prevText: "&#x3c;geri",
            nextText: "ileri&#x3e",
            currentText: "bugün",
            monthNames: ["Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"],
            monthNamesShort: ["Oca", "Şub", "Mar", "Nis", "May", "Haz", "Tem", "Ağu", "Eyl", "Eki", "Kas", "Ara"],
            dayNames: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"],
            dayNamesShort: ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"],
            dayNamesMin: ["Pz", "Pt", "Sa", "Ça", "Pe", "Cu", "Ct"],
            weekHeader: "Hf",
            dateFormat: "dd.mm.yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.tr)
    }), jQuery(function(a) {
        a.datepicker.regional.uk = {
            closeText: "Закрити",
            prevText: "&#x3c;",
            nextText: "&#x3e;",
            currentText: "Сьогодні",
            monthNames: ["Січень", "Лютий", "Березень", "Квітень", "Травень", "Червень", "Липень", "Серпень", "Вересень", "Жовтень", "Листопад", "Грудень"],
            monthNamesShort: ["Січ", "Лют", "Бер", "Кві", "Тра", "Чер", "Лип", "Сер", "Вер", "Жов", "Лис", "Гру"],
            dayNames: ["неділя", "понеділок", "вівторок", "середа", "четвер", "п’ятниця", "субота"],
            dayNamesShort: ["нед", "пнд", "вів", "срд", "чтв", "птн", "сбт"],
            dayNamesMin: ["Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"],
            weekHeader: "Тиж",
            dateFormat: "dd/mm/yy",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.uk)
    }), jQuery(function(a) {
        a.datepicker.regional.vi = {
            closeText: "Đóng",
            prevText: "&#x3c;Trước",
            nextText: "Tiếp&#x3e;",
            currentText: "Hôm nay",
            monthNames: ["Tháng Một", "Tháng Hai", "Tháng Ba", "Tháng Tư", "Tháng Năm", "Tháng Sáu", "Tháng Bảy", "Tháng Tám", "Tháng Chín", "Tháng Mười", "Tháng Mười Một", "Tháng Mười Hai"],
            monthNamesShort: ["Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"],
            dayNames: ["Chủ Nhật", "Thứ Hai", "Thứ Ba", "Thứ Tư", "Thứ Năm", "Thứ Sáu", "Thứ Bảy"],
            dayNamesShort: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
            dayNamesMin: ["CN", "T2", "T3", "T4", "T5", "T6", "T7"],
            weekHeader: "Tu",
            dateFormat: "dd/mm/yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !1,
            yearSuffix: ""
        }, a.datepicker.setDefaults(a.datepicker.regional.vi)
    }), jQuery(function(a) {
        a.datepicker.regional["zh-CN"] = {
            closeText: "关闭",
            prevText: "&#x3c;上月",
            nextText: "下月&#x3e;",
            currentText: "今天",
            monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
            dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
            dayNamesMin: ["日", "一", "二", "三", "四", "五", "六"],
            weekHeader: "周",
            dateFormat: "yy-mm-dd",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !0,
            yearSuffix: "年"
        }, a.datepicker.setDefaults(a.datepicker.regional["zh-CN"])
    }), jQuery(function(a) {
        a.datepicker.regional["zh-HK"] = {
            closeText: "關閉",
            prevText: "&#x3c;上月",
            nextText: "下月&#x3e;",
            currentText: "今天",
            monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
            dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
            dayNamesMin: ["日", "一", "二", "三", "四", "五", "六"],
            weekHeader: "周",
            dateFormat: "dd-mm-yy",
            firstDay: 0,
            isRTL: !1,
            showMonthAfterYear: !0,
            yearSuffix: "年"
        }, a.datepicker.setDefaults(a.datepicker.regional["zh-HK"])
    }), jQuery(function(a) {
        a.datepicker.regional["zh-TW"] = {
            closeText: "關閉",
            prevText: "&#x3c;上月",
            nextText: "下月&#x3e;",
            currentText: "今天",
            monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            monthNamesShort: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
            dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
            dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
            dayNamesMin: ["日", "一", "二", "三", "四", "五", "六"],
            weekHeader: "周",
            dateFormat: "yy/mm/dd",
            firstDay: 1,
            isRTL: !1,
            showMonthAfterYear: !0,
            yearSuffix: "年"
        }, a.datepicker.setDefaults(a.datepicker.regional["fr"])
    });
    (function($, undefined) {
        $.extend($.ui, {
            datepicker: {
                version: "@VERSION"
            }
        });
        var datepicker_instActive;

        function datepicker_getZindex(elem) {
            var position, value;
            while (elem.length && elem[0] !== document) {
                position = elem.css("position");
                if (position === "absolute" || position === "relative" || position === "fixed") {
                    value = parseInt(elem.css("zIndex"), 10);
                    if (!isNaN(value) && value !== 0) {
                        return value
                    }
                }
                elem = elem.parent()
            }
            return 0
        }

        function Datepicker() {
            this._curInst = null;
            this._keyEvent = false;
            this._disabledInputs = [];
            this._datepickerShowing = false;
            this._inDialog = false;
            this._mainDivId = "ui-datepicker-div";
            this._inlineClass = "ui-datepicker-inline";
            this._appendClass = "ui-datepicker-append";
            this._triggerClass = "ui-datepicker-trigger";
            this._dialogClass = "ui-datepicker-dialog";
            this._disableClass = "ui-datepicker-disabled";
            this._unselectableClass = "ui-datepicker-unselectable";
            this._currentClass = "ui-datepicker-current-day";
            this._dayOverClass = "ui-datepicker-days-cell-over";
            this.regional = [];
            this.regional[""] = {
                closeText: "Done",
                prevText: "Prev",
                nextText: "Next",
                currentText: "Today",
                monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
                monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
                dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
                dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
                dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
                weekHeader: "Wk",
                dateFormat: "mm/dd/yy",
                firstDay: 0,
                isRTL: false,
                showMonthAfterYear: false,
                yearSuffix: ""
            };
            this._defaults = {
                showOn: "focus",
                showAnim: "fadeIn",
                showOptions: {},
                defaultDate: null,
                appendText: "",
                buttonText: "...",
                buttonImage: "",
                buttonImageOnly: false,
                hideIfNoPrevNext: false,
                navigationAsDateFormat: false,
                gotoCurrent: false,
                changeMonth: false,
                changeYear: false,
                yearRange: "c-10:c+10",
                showOtherMonths: false,
                selectOtherMonths: false,
                showWeek: false,
                calculateWeek: this.iso8601Week,
                shortYearCutoff: "+10",
                minDate: null,
                maxDate: null,
                duration: "fast",
                beforeShowDay: null,
                beforeShow: null,
                onSelect: null,
                onChangeMonthYear: null,
                onClose: null,
                numberOfMonths: 1,
                showCurrentAtPos: 0,
                stepMonths: 1,
                stepBigMonths: 12,
                altField: "",
                altFormat: "",
                constrainInput: true,
                showButtonPanel: false,
                autoSize: false,
                disabled: false
            };
            $.extend(this._defaults, this.regional[""]);
            this.dpDiv = datepicker_bindHover($("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))
        }
        $.extend(Datepicker.prototype, {
            markerClassName: "hasDatepicker",
            maxRows: 4,
            _widgetDatepicker: function() {
                return this.dpDiv
            },
            setDefaults: function(settings) {
                datepicker_extendRemove(this._defaults, settings || {});
                return this
            },
            _attachDatepicker: function(target, settings) {
                var nodeName, inline, inst;
                nodeName = target.nodeName.toLowerCase();
                inline = nodeName === "div" || nodeName === "span";
                if (!target.id) {
                    this.uuid += 1;
                    target.id = "dp" + this.uuid
                }
                inst = this._newInst($(target), inline);
                inst.settings = $.extend({}, settings || {});
                if (nodeName === "input") {
                    this._connectDatepicker(target, inst)
                } else if (inline) {
                    this._inlineDatepicker(target, inst)
                }
            },
            _newInst: function(target, inline) {
                var id = target[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
                return {
                    id: id,
                    input: target,
                    selectedDay: 0,
                    selectedMonth: 0,
                    selectedYear: 0,
                    drawMonth: 0,
                    drawYear: 0,
                    inline: inline,
                    dpDiv: !inline ? this.dpDiv : datepicker_bindHover($("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))
                }
            },
            _connectDatepicker: function(target, inst) {
                var input = $(target);
                inst.append = $([]);
                inst.trigger = $([]);
                if (input.hasClass(this.markerClassName)) {
                    return
                }
                this._attachments(input, inst);
                input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp);
                this._autoSize(inst);
                $.data(target, "datepicker", inst);
                if (inst.settings.disabled) {
                    this._disableDatepicker(target)
                }
            },
            _attachments: function(input, inst) {
                var showOn, buttonText, buttonImage, appendText = this._get(inst, "appendText"),
                    isRTL = this._get(inst, "isRTL");
                if (inst.append) {
                    inst.append.remove()
                }
                if (appendText) {
                    inst.append = $("<span class='" + this._appendClass + "'>" + appendText + "</span>");
                    input[isRTL ? "before" : "after"](inst.append)
                }
                input.unbind("focus", this._showDatepicker);
                if (inst.trigger) {
                    inst.trigger.remove()
                }
                showOn = this._get(inst, "showOn");
                if (showOn === "focus" || showOn === "both") {
                    input.focus(this._showDatepicker)
                }
                if (showOn === "button" || showOn === "both") {
                    buttonText = this._get(inst, "buttonText");
                    buttonImage = this._get(inst, "buttonImage");
                    inst.trigger = $(this._get(inst, "buttonImageOnly") ? $("<img/>").addClass(this._triggerClass).attr({
                        src: buttonImage,
                        alt: buttonText,
                        title: buttonText
                    }) : $("<button type='button'></button>").addClass(this._triggerClass).html(!buttonImage ? buttonText : $("<img/>").attr({
                        src: buttonImage,
                        alt: buttonText,
                        title: buttonText
                    })));
                    input[isRTL ? "before" : "after"](inst.trigger);
                    inst.trigger.click(function() {
                        if ($.datepicker._datepickerShowing && $.datepicker._lastInput === input[0]) {
                            $.datepicker._hideDatepicker()
                        } else if ($.datepicker._datepickerShowing && $.datepicker._lastInput !== input[0]) {
                            $.datepicker._hideDatepicker();
                            $.datepicker._showDatepicker(input[0])
                        } else {
                            $.datepicker._showDatepicker(input[0])
                        }
                        return false
                    })
                }
            },
            _autoSize: function(inst) {
                if (this._get(inst, "autoSize") && !inst.inline) {
                    var findMax, max, maxI, i, date = new Date(2009, 12 - 1, 20),
                        dateFormat = this._get(inst, "dateFormat");
                    if (dateFormat.match(/[DM]/)) {
                        findMax = function(names) {
                            max = 0;
                            maxI = 0;
                            for (i = 0; i < names.length; i++) {
                                if (names[i].length > max) {
                                    max = names[i].length;
                                    maxI = i
                                }
                            }
                            return maxI
                        };
                        date.setMonth(findMax(this._get(inst, dateFormat.match(/MM/) ? "monthNames" : "monthNamesShort")));
                        date.setDate(findMax(this._get(inst, dateFormat.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - date.getDay())
                    }
                    inst.input.attr("size", this._formatDate(inst, date).length)
                }
            },
            _inlineDatepicker: function(target, inst) {
                var divSpan = $(target);
                if (divSpan.hasClass(this.markerClassName)) {
                    return
                }
                divSpan.addClass(this.markerClassName).append(inst.dpDiv);
                $.data(target, "datepicker", inst);
                this._setDate(inst, this._getDefaultDate(inst), true);
                this._updateDatepicker(inst);
                this._updateAlternate(inst);
                if (inst.settings.disabled) {
                    this._disableDatepicker(target)
                }
                inst.dpDiv.css("display", "block")
            },
            _dialogDatepicker: function(input, date, onSelect, settings, pos) {
                var id, browserWidth, browserHeight, scrollX, scrollY, inst = this._dialogInst;
                if (!inst) {
                    this.uuid += 1;
                    id = "dp" + this.uuid;
                    this._dialogInput = $("<input type='text' id='" + id + "' style='position: absolute; top: -100px; width: 0px;'/>");
                    this._dialogInput.keydown(this._doKeyDown);
                    $("body").append(this._dialogInput);
                    inst = this._dialogInst = this._newInst(this._dialogInput, false);
                    inst.settings = {};
                    $.data(this._dialogInput[0], "datepicker", inst)
                }
                datepicker_extendRemove(inst.settings, settings || {});
                date = date && date.constructor === Date ? this._formatDate(inst, date) : date;
                this._dialogInput.val(date);
                this._pos = pos ? pos.length ? pos : [pos.pageX, pos.pageY] : null;
                if (!this._pos) {
                    browserWidth = document.documentElement.clientWidth;
                    browserHeight = document.documentElement.clientHeight;
                    scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
                    scrollY = document.documentElement.scrollTop || document.body.scrollTop;
                    this._pos = [browserWidth / 2 - 100 + scrollX, browserHeight / 2 - 150 + scrollY]
                }
                this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px");
                inst.settings.onSelect = onSelect;
                this._inDialog = true;
                this.dpDiv.addClass(this._dialogClass);
                this._showDatepicker(this._dialogInput[0]);
                if ($.blockUI) {
                    $.blockUI(this.dpDiv)
                }
                $.data(this._dialogInput[0], "datepicker", inst);
                return this
            },
            _destroyDatepicker: function(target) {
                var nodeName, $target = $(target),
                    inst = $.data(target, "datepicker");
                if (!$target.hasClass(this.markerClassName)) {
                    return
                }
                nodeName = target.nodeName.toLowerCase();
                $.removeData(target, "datepicker");
                if (nodeName === "input") {
                    inst.append.remove();
                    inst.trigger.remove();
                    $target.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)
                } else if (nodeName === "div" || nodeName === "span") {
                    $target.removeClass(this.markerClassName).empty()
                }
            },
            _enableDatepicker: function(target) {
                var nodeName, inline, $target = $(target),
                    inst = $.data(target, "datepicker");
                if (!$target.hasClass(this.markerClassName)) {
                    return
                }
                nodeName = target.nodeName.toLowerCase();
                if (nodeName === "input") {
                    target.disabled = false;
                    inst.trigger.filter("button").each(function() {
                        this.disabled = false
                    }).end().filter("img").css({
                        opacity: "1.0",
                        cursor: ""
                    })
                } else if (nodeName === "div" || nodeName === "span") {
                    inline = $target.children("." + this._inlineClass);
                    inline.children().removeClass("ui-state-disabled");
                    inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", false)
                }
                this._disabledInputs = $.map(this._disabledInputs, function(value) {
                    return value === target ? null : value
                })
            },
            _disableDatepicker: function(target) {
                var nodeName, inline, $target = $(target),
                    inst = $.data(target, "datepicker");
                if (!$target.hasClass(this.markerClassName)) {
                    return
                }
                nodeName = target.nodeName.toLowerCase();
                if (nodeName === "input") {
                    target.disabled = true;
                    inst.trigger.filter("button").each(function() {
                        this.disabled = true
                    }).end().filter("img").css({
                        opacity: "0.5",
                        cursor: "default"
                    })
                } else if (nodeName === "div" || nodeName === "span") {
                    inline = $target.children("." + this._inlineClass);
                    inline.children().addClass("ui-state-disabled");
                    inline.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", true)
                }
                this._disabledInputs = $.map(this._disabledInputs, function(value) {
                    return value === target ? null : value
                });
                this._disabledInputs[this._disabledInputs.length] = target
            },
            _isDisabledDatepicker: function(target) {
                if (!target) {
                    return false
                }
                for (var i = 0; i < this._disabledInputs.length; i++) {
                    if (this._disabledInputs[i] === target) {
                        return true
                    }
                }
                return false
            },
            _getInst: function(target) {
                try {
                    return $.data(target, "datepicker")
                } catch (err) {
                    throw "Missing instance data for this datepicker"
                }
            },
            _optionDatepicker: function(target, name, value) {
                var settings, date, minDate, maxDate, inst = this._getInst(target);
                if (arguments.length === 2 && typeof name === "string") {
                    return name === "defaults" ? $.extend({}, $.datepicker._defaults) : inst ? name === "all" ? $.extend({}, inst.settings) : this._get(inst, name) : null
                }
                settings = name || {};
                if (typeof name === "string") {
                    settings = {};
                    settings[name] = value
                }
                if (inst) {
                    if (this._curInst === inst) {
                        this._hideDatepicker()
                    }
                    date = this._getDateDatepicker(target, true);
                    minDate = this._getMinMaxDate(inst, "min");
                    maxDate = this._getMinMaxDate(inst, "max");
                    datepicker_extendRemove(inst.settings, settings);
                    if (minDate !== null && settings.dateFormat !== undefined && settings.minDate === undefined) {
                        inst.settings.minDate = this._formatDate(inst, minDate)
                    }
                    if (maxDate !== null && settings.dateFormat !== undefined && settings.maxDate === undefined) {
                        inst.settings.maxDate = this._formatDate(inst, maxDate)
                    }
                    if ("disabled" in settings) {
                        if (settings.disabled) {
                            this._disableDatepicker(target)
                        } else {
                            this._enableDatepicker(target)
                        }
                    }
                    this._attachments($(target), inst);
                    this._autoSize(inst);
                    this._setDate(inst, date);
                    this._updateAlternate(inst);
                    this._updateDatepicker(inst)
                }
            },
            _changeDatepicker: function(target, name, value) {
                this._optionDatepicker(target, name, value)
            },
            _refreshDatepicker: function(target) {
                var inst = this._getInst(target);
                if (inst) {
                    this._updateDatepicker(inst)
                }
            },
            _setDateDatepicker: function(target, date) {
                var inst = this._getInst(target);
                if (inst) {
                    this._setDate(inst, date);
                    this._updateDatepicker(inst);
                    this._updateAlternate(inst)
                }
            },
            _getDateDatepicker: function(target, noDefault) {
                var inst = this._getInst(target);
                if (inst && !inst.inline) {
                    this._setDateFromField(inst, noDefault)
                }
                return inst ? this._getDate(inst) : null
            },
            _doKeyDown: function(event) {
                var onSelect, dateStr, sel, inst = $.datepicker._getInst(event.target),
                    handled = true,
                    isRTL = inst.dpDiv.is(".ui-datepicker-rtl");
                inst._keyEvent = true;
                if ($.datepicker._datepickerShowing) {
                    switch (event.keyCode) {
                        case 9:
                            $.datepicker._hideDatepicker();
                            handled = false;
                            break;
                        case 13:
                            sel = $("td." + $.datepicker._dayOverClass + ":not(." + $.datepicker._currentClass + ")", inst.dpDiv);
                            if (sel[0]) {
                                $.datepicker._selectDay(event.target, inst.selectedMonth, inst.selectedYear, sel[0])
                            }
                            onSelect = $.datepicker._get(inst, "onSelect");
                            if (onSelect) {
                                dateStr = $.datepicker._formatDate(inst);
                                onSelect.apply(inst.input ? inst.input[0] : null, [dateStr, inst])
                            } else {
                                $.datepicker._hideDatepicker()
                            }
                            return false;
                        case 27:
                            $.datepicker._hideDatepicker();
                            break;
                        case 33:
                            $.datepicker._adjustDate(event.target, event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths"), "M");
                            break;
                        case 34:
                            $.datepicker._adjustDate(event.target, event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths"), "M");
                            break;
                        case 35:
                            if (event.ctrlKey || event.metaKey) {
                                $.datepicker._clearDate(event.target)
                            }
                            handled = event.ctrlKey || event.metaKey;
                            break;
                        case 36:
                            if (event.ctrlKey || event.metaKey) {
                                $.datepicker._gotoToday(event.target)
                            }
                            handled = event.ctrlKey || event.metaKey;
                            break;
                        case 37:
                            if (event.ctrlKey || event.metaKey) {
                                $.datepicker._adjustDate(event.target, isRTL ? +1 : -1, "D")
                            }
                            handled = event.ctrlKey || event.metaKey;
                            if (event.originalEvent.altKey) {
                                $.datepicker._adjustDate(event.target, event.ctrlKey ? -$.datepicker._get(inst, "stepBigMonths") : -$.datepicker._get(inst, "stepMonths"), "M")
                            }
                            break;
                        case 38:
                            if (event.ctrlKey || event.metaKey) {
                                $.datepicker._adjustDate(event.target, -7, "D")
                            }
                            handled = event.ctrlKey || event.metaKey;
                            break;
                        case 39:
                            if (event.ctrlKey || event.metaKey) {
                                $.datepicker._adjustDate(event.target, isRTL ? -1 : +1, "D")
                            }
                            handled = event.ctrlKey || event.metaKey;
                            if (event.originalEvent.altKey) {
                                $.datepicker._adjustDate(event.target, event.ctrlKey ? +$.datepicker._get(inst, "stepBigMonths") : +$.datepicker._get(inst, "stepMonths"), "M")
                            }
                            break;
                        case 40:
                            if (event.ctrlKey || event.metaKey) {
                                $.datepicker._adjustDate(event.target, +7, "D")
                            }
                            handled = event.ctrlKey || event.metaKey;
                            break;
                        default:
                            handled = false
                    }
                } else if (event.keyCode === 36 && event.ctrlKey) {
                    $.datepicker._showDatepicker(this)
                } else {
                    handled = false
                }
                if (handled) {
                    event.preventDefault();
                    event.stopPropagation()
                }
            },
            _doKeyPress: function(event) {
                var chars, chr, inst = $.datepicker._getInst(event.target);
                if ($.datepicker._get(inst, "constrainInput")) {
                    chars = $.datepicker._possibleChars($.datepicker._get(inst, "dateFormat"));
                    chr = String.fromCharCode(event.charCode == null ? event.keyCode : event.charCode);
                    return event.ctrlKey || event.metaKey || (chr < " " || !chars || chars.indexOf(chr) > -1)
                }
            },
            _doKeyUp: function(event) {
                var date, inst = $.datepicker._getInst(event.target);
                if (inst.input.val() !== inst.lastVal) {
                    try {
                        date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), inst.input ? inst.input.val() : null, $.datepicker._getFormatConfig(inst));
                        if (date) {
                            $.datepicker._setDateFromField(inst);
                            $.datepicker._updateAlternate(inst);
                            $.datepicker._updateDatepicker(inst)
                        }
                    } catch (err) {}
                }
                return true
            },
            _showDatepicker: function(input) {
                input = input.target || input;
                if (input.nodeName.toLowerCase() !== "input") {
                    input = $("input", input.parentNode)[0]
                }
                if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput === input) {
                    return
                }
                var inst, beforeShow, beforeShowSettings, isFixed, offset, showAnim, duration;
                inst = $.datepicker._getInst(input);
                if ($.datepicker._curInst && $.datepicker._curInst !== inst) {
                    $.datepicker._curInst.dpDiv.stop(true, true);
                    if (inst && $.datepicker._datepickerShowing) {
                        $.datepicker._hideDatepicker($.datepicker._curInst.input[0])
                    }
                }
                beforeShow = $.datepicker._get(inst, "beforeShow");
                beforeShowSettings = beforeShow ? beforeShow.apply(input, [input, inst]) : {};
                if (beforeShowSettings === false) {
                    return
                }
                datepicker_extendRemove(inst.settings, beforeShowSettings);
                inst.lastVal = null;
                $.datepicker._lastInput = input;
                $.datepicker._setDateFromField(inst);
                if ($.datepicker._inDialog) {
                    input.value = ""
                }
                if (!$.datepicker._pos) {
                    $.datepicker._pos = $.datepicker._findPos(input);
                    $.datepicker._pos[1] += input.offsetHeight
                }
                isFixed = false;
                $(input).parents().each(function() {
                    isFixed |= $(this).css("position") === "fixed";
                    return !isFixed
                });
                offset = {
                    left: $.datepicker._pos[0],
                    top: $.datepicker._pos[1]
                };
                $.datepicker._pos = null;
                inst.dpDiv.empty();
                inst.dpDiv.css({
                    position: "absolute",
                    display: "block",
                    top: "-1000px"
                });
                $.datepicker._updateDatepicker(inst);
                offset = $.datepicker._checkOffset(inst, offset, isFixed);
                inst.dpDiv.css({
                    position: $.datepicker._inDialog && $.blockUI ? "static" : isFixed ? "fixed" : "absolute",
                    display: "none",
                    left: offset.left + "px",
                    top: offset.top + "px"
                });
                if (!inst.inline) {
                    showAnim = $.datepicker._get(inst, "showAnim");
                    duration = $.datepicker._get(inst, "duration");
                    inst.dpDiv.css("z-index", datepicker_getZindex($(input)) + 1);
                    $.datepicker._datepickerShowing = true;
                    if ($.effects && $.effects.effect[showAnim]) {
                        inst.dpDiv.show(showAnim, $.datepicker._get(inst, "showOptions"), duration)
                    } else {
                        inst.dpDiv[showAnim || "show"](showAnim ? duration : null)
                    }
                    if ($.datepicker._shouldFocusInput(inst)) {
                        inst.input.focus()
                    }
                    $.datepicker._curInst = inst
                }
            },
            _updateDatepicker: function(inst) {
                this.maxRows = 4;
                datepicker_instActive = inst;
                inst.dpDiv.empty().append(this._generateHTML(inst));
                this._attachHandlers(inst);
                inst.dpDiv.find("." + this._dayOverClass + " a").mouseover();
                var origyearshtml, numMonths = this._getNumberOfMonths(inst),
                    cols = numMonths[1],
                    width = 17;
                inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");
                if (cols > 1) {
                    inst.dpDiv.addClass("ui-datepicker-multi-" + cols).css("width", width * cols + "em")
                }
                inst.dpDiv[(numMonths[0] !== 1 || numMonths[1] !== 1 ? "add" : "remove") + "Class"]("ui-datepicker-multi");
                inst.dpDiv[(this._get(inst, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl");
                if (inst === $.datepicker._curInst && $.datepicker._datepickerShowing && $.datepicker._shouldFocusInput(inst)) {
                    inst.input.focus()
                }
                if (inst.yearshtml) {
                    origyearshtml = inst.yearshtml;
                    setTimeout(function() {
                        if (origyearshtml === inst.yearshtml && inst.yearshtml) {
                            inst.dpDiv.find("select.ui-datepicker-year:first").replaceWith(inst.yearshtml)
                        }
                        origyearshtml = inst.yearshtml = null
                    }, 0)
                }
            },
            _shouldFocusInput: function(inst) {
                return inst.input && inst.input.is(":visible") && !inst.input.is(":disabled") && !inst.input.is(":focus")
            },
            _checkOffset: function(inst, offset, isFixed) {
                var dpWidth = inst.dpDiv.outerWidth(),
                    dpHeight = inst.dpDiv.outerHeight(),
                    inputWidth = inst.input ? inst.input.outerWidth() : 0,
                    inputHeight = inst.input ? inst.input.outerHeight() : 0,
                    viewWidth = document.documentElement.clientWidth + (isFixed ? 0 : $(document).scrollLeft()),
                    viewHeight = document.documentElement.clientHeight + (isFixed ? 0 : $(document).scrollTop());
                offset.left -= this._get(inst, "isRTL") ? dpWidth - inputWidth : 0;
                offset.left -= isFixed && offset.left === inst.input.offset().left ? $(document).scrollLeft() : 0;
                offset.top -= isFixed && offset.top === inst.input.offset().top + inputHeight ? $(document).scrollTop() : 0;
                offset.left -= Math.min(offset.left, offset.left + dpWidth > viewWidth && viewWidth > dpWidth ? Math.abs(offset.left + dpWidth - viewWidth) : 0);
                offset.top -= Math.min(offset.top, offset.top + dpHeight > viewHeight && viewHeight > dpHeight ? Math.abs(dpHeight + inputHeight) : 0);
                return offset
            },
            _findPos: function(obj) {
                var position, inst = this._getInst(obj),
                    isRTL = this._get(inst, "isRTL");
                while (obj && (obj.type === "hidden" || obj.nodeType !== 1 || $.expr.filters.hidden(obj))) {
                    obj = obj[isRTL ? "previousSibling" : "nextSibling"]
                }
                position = $(obj).offset();
                return [position.left, position.top]
            },
            _hideDatepicker: function(input) {
                var showAnim, duration, postProcess, onClose, inst = this._curInst;
                if (!inst || input && inst !== $.data(input, "datepicker")) {
                    return
                }
                if (this._datepickerShowing) {
                    showAnim = this._get(inst, "showAnim");
                    duration = this._get(inst, "duration");
                    postProcess = function() {
                        $.datepicker._tidyDialog(inst)
                    };
                    if ($.effects && ($.effects.effect[showAnim] || $.effects[showAnim])) {
                        inst.dpDiv.hide(showAnim, $.datepicker._get(inst, "showOptions"), duration, postProcess)
                    } else {
                        inst.dpDiv[showAnim === "slideDown" ? "slideUp" : showAnim === "fadeIn" ? "fadeOut" : "hide"](showAnim ? duration : null, postProcess)
                    }
                    if (!showAnim) {
                        postProcess()
                    }
                    this._datepickerShowing = false;
                    onClose = this._get(inst, "onClose");
                    if (onClose) {
                        onClose.apply(inst.input ? inst.input[0] : null, [inst.input ? inst.input.val() : "", inst])
                    }
                    this._lastInput = null;
                    if (this._inDialog) {
                        this._dialogInput.css({
                            position: "absolute",
                            left: "0",
                            top: "-100px"
                        });
                        if ($.blockUI) {
                            $.unblockUI();
                            $("body").append(this.dpDiv)
                        }
                    }
                    this._inDialog = false
                }
            },
            _tidyDialog: function(inst) {
                inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")
            },
            _checkExternalClick: function(event) {
                if (!$.datepicker._curInst) {
                    return
                }
                var $target = $(event.target),
                    inst = $.datepicker._getInst($target[0]);
                if ($target[0].id !== $.datepicker._mainDivId && $target.parents("#" + $.datepicker._mainDivId).length === 0 && !$target.hasClass($.datepicker.markerClassName) && !$target.closest("." + $.datepicker._triggerClass).length && $.datepicker._datepickerShowing && !($.datepicker._inDialog && $.blockUI) || $target.hasClass($.datepicker.markerClassName) && $.datepicker._curInst !== inst) {
                    $.datepicker._hideDatepicker()
                }
            },
            _adjustDate: function(id, offset, period) {
                var target = $(id),
                    inst = this._getInst(target[0]);
                if (this._isDisabledDatepicker(target[0])) {
                    return
                }
                this._adjustInstDate(inst, offset + (period === "M" ? this._get(inst, "showCurrentAtPos") : 0), period);
                this._updateDatepicker(inst)
            },
            _gotoToday: function(id) {
                var date, target = $(id),
                    inst = this._getInst(target[0]);
                if (this._get(inst, "gotoCurrent") && inst.currentDay) {
                    inst.selectedDay = inst.currentDay;
                    inst.drawMonth = inst.selectedMonth = inst.currentMonth;
                    inst.drawYear = inst.selectedYear = inst.currentYear
                } else {
                    date = new Date;
                    inst.selectedDay = date.getDate();
                    inst.drawMonth = inst.selectedMonth = date.getMonth();
                    inst.drawYear = inst.selectedYear = date.getFullYear()
                }
                this._notifyChange(inst);
                this._adjustDate(target)
            },
            _selectMonthYear: function(id, select, period) {
                var target = $(id),
                    inst = this._getInst(target[0]);
                inst["selected" + (period === "M" ? "Month" : "Year")] = inst["draw" + (period === "M" ? "Month" : "Year")] = parseInt(select.options[select.selectedIndex].value, 10);
                this._notifyChange(inst);
                this._adjustDate(target)
            },
            _selectDay: function(id, month, year, td) {
                var inst, target = $(id);
                if ($(td).hasClass(this._unselectableClass) || this._isDisabledDatepicker(target[0])) {
                    return
                }
                inst = this._getInst(target[0]);
                inst.selectedDay = inst.currentDay = $("a", td).html();
                inst.selectedMonth = inst.currentMonth = month;
                inst.selectedYear = inst.currentYear = year;
                this._selectDate(id, this._formatDate(inst, inst.currentDay, inst.currentMonth, inst.currentYear))
            },
            _clearDate: function(id) {
                var target = $(id);
                this._selectDate(target, "")
            },
            _selectDate: function(id, dateStr) {
                var onSelect, target = $(id),
                    inst = this._getInst(target[0]);
                dateStr = dateStr != null ? dateStr : this._formatDate(inst);
                if (inst.input) {
                    inst.input.val(dateStr)
                }
                this._updateAlternate(inst);
                onSelect = this._get(inst, "onSelect");
                if (onSelect) {
                    onSelect.apply(inst.input ? inst.input[0] : null, [dateStr, inst])
                } else if (inst.input) {
                    inst.input.trigger("change")
                }
                if (inst.inline) {
                    this._updateDatepicker(inst)
                } else {
                    this._hideDatepicker();
                    this._lastInput = inst.input[0];
                    if (typeof inst.input[0] !== "object") {
                        inst.input.focus()
                    }
                    this._lastInput = null
                }
            },
            _updateAlternate: function(inst) {
                var altFormat, date, dateStr, altField = this._get(inst, "altField");
                if (altField) {
                    altFormat = this._get(inst, "altFormat") || this._get(inst, "dateFormat");
                    date = this._getDate(inst);
                    dateStr = this.formatDate(altFormat, date, this._getFormatConfig(inst));
                    $(altField).each(function() {
                        $(this).val(dateStr)
                    })
                }
            },
            noWeekends: function(date) {
                var day = date.getDay();
                return [day > 0 && day < 6, ""]
            },
            iso8601Week: function(date) {
                var time, checkDate = new Date(date.getTime());
                checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
                time = checkDate.getTime();
                checkDate.setMonth(0);
                checkDate.setDate(1);
                return Math.floor(Math.round((time - checkDate) / 864e5) / 7) + 1
            },
            parseDate: function(format, value, settings) {
                if (format == null || value == null) {
                    throw "Invalid arguments"
                }
                value = typeof value === "object" ? value.toString() : value + "";
                if (value === "") {
                    return null
                }
                var iFormat, dim, extra, iValue = 0,
                    shortYearCutoffTemp = (settings ? settings.shortYearCutoff : null) || this._defaults.shortYearCutoff,
                    shortYearCutoff = typeof shortYearCutoffTemp !== "string" ? shortYearCutoffTemp : (new Date).getFullYear() % 100 + parseInt(shortYearCutoffTemp, 10),
                    dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
                    dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
                    monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
                    monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
                    year = -1,
                    month = -1,
                    day = -1,
                    doy = -1,
                    literal = false,
                    date, lookAhead = function(match) {
                        var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
                        if (matches) {
                            iFormat++
                        }
                        return matches
                    },
                    getNumber = function(match) {
                        var isDoubled = lookAhead(match),
                            size = match === "@" ? 14 : match === "!" ? 20 : match === "y" && isDoubled ? 4 : match === "o" ? 3 : 2,
                            digits = new RegExp("^\\d{1," + size + "}"),
                            num = value.substring(iValue).match(digits);
                        if (!num) {
                            throw "Missing number at position " + iValue
                        }
                        iValue += num[0].length;
                        return parseInt(num[0], 10)
                    },
                    getName = function(match, shortNames, longNames) {
                        var index = -1,
                            names = $.map(lookAhead(match) ? longNames : shortNames, function(v, k) {
                                return [
                                    [k, v]
                                ]
                            }).sort(function(a, b) {
                                return -(a[1].length - b[1].length)
                            });
                        $.each(names, function(i, pair) {
                            var name = pair[1];
                            if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
                                index = pair[0];
                                iValue += name.length;
                                return false
                            }
                        });
                        if (index !== -1) {
                            return index + 1
                        } else {
                            throw "Unknown name at position " + iValue
                        }
                    },
                    checkLiteral = function() {
                        if (value.charAt(iValue) !== format.charAt(iFormat)) {
                            throw "Unexpected literal at position " + iValue
                        }
                        iValue++
                    };
                for (iFormat = 0; iFormat < format.length; iFormat++) {
                    if (literal) {
                        if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
                            literal = false
                        } else {
                            checkLiteral()
                        }
                    } else {
                        switch (format.charAt(iFormat)) {
                            case "d":
                                day = getNumber("d");
                                break;
                            case "D":
                                getName("D", dayNamesShort, dayNames);
                                break;
                            case "o":
                                doy = getNumber("o");
                                break;
                            case "m":
                                month = getNumber("m");
                                break;
                            case "M":
                                month = getName("M", monthNamesShort, monthNames);
                                break;
                            case "y":
                                year = getNumber("y");
                                break;
                            case "@":
                                date = new Date(getNumber("@"));
                                year = date.getFullYear();
                                month = date.getMonth() + 1;
                                day = date.getDate();
                                break;
                            case "!":
                                date = new Date((getNumber("!") - this._ticksTo1970) / 1e4);
                                year = date.getFullYear();
                                month = date.getMonth() + 1;
                                day = date.getDate();
                                break;
                            case "'":
                                if (lookAhead("'")) {
                                    checkLiteral()
                                } else {
                                    literal = true
                                }
                                break;
                            default:
                                checkLiteral()
                        }
                    }
                }
                if (iValue < value.length) {
                    extra = value.substr(iValue);
                    if (!/^\s+/.test(extra)) {
                        throw "Extra/unparsed characters found in date: " + extra
                    }
                }
                if (year === -1) {
                    year = (new Date).getFullYear()
                } else if (year < 100) {
                    year += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (year <= shortYearCutoff ? 0 : -100)
                }
                if (doy > -1) {
                    month = 1;
                    day = doy;
                    do {
                        dim = this._getDaysInMonth(year, month - 1);
                        if (day <= dim) {
                            break
                        }
                        month++;
                        day -= dim
                    } while (true)
                }
                date = this._daylightSavingAdjust(new Date(year, month - 1, day));
                if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
                    throw "Invalid date"
                }
                return date
            },
            ATOM: "yy-mm-dd",
            COOKIE: "D, dd M yy",
            ISO_8601: "yy-mm-dd",
            RFC_822: "D, d M y",
            RFC_850: "DD, dd-M-y",
            RFC_1036: "D, d M y",
            RFC_1123: "D, d M yy",
            RFC_2822: "D, d M yy",
            RSS: "D, d M y",
            TICKS: "!",
            TIMESTAMP: "@",
            W3C: "yy-mm-dd",
            _ticksTo1970: ((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 1e7,
            formatDate: function(format, date, settings) {
                if (!date) {
                    return ""
                }
                var iFormat, dayNamesShort = (settings ? settings.dayNamesShort : null) || this._defaults.dayNamesShort,
                    dayNames = (settings ? settings.dayNames : null) || this._defaults.dayNames,
                    monthNamesShort = (settings ? settings.monthNamesShort : null) || this._defaults.monthNamesShort,
                    monthNames = (settings ? settings.monthNames : null) || this._defaults.monthNames,
                    lookAhead = function(match) {
                        var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
                        if (matches) {
                            iFormat++
                        }
                        return matches
                    },
                    formatNumber = function(match, value, len) {
                        var num = "" + value;
                        if (lookAhead(match)) {
                            while (num.length < len) {
                                num = "0" + num
                            }
                        }
                        return num
                    },
                    formatName = function(match, value, shortNames, longNames) {
                        return lookAhead(match) ? longNames[value] : shortNames[value]
                    },
                    output = "",
                    literal = false;
                if (date) {
                    for (iFormat = 0; iFormat < format.length; iFormat++) {
                        if (literal) {
                            if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
                                literal = false
                            } else {
                                output += format.charAt(iFormat)
                            }
                        } else {
                            switch (format.charAt(iFormat)) {
                                case "d":
                                    output += formatNumber("d", date.getDate(), 2);
                                    break;
                                case "D":
                                    output += formatName("D", date.getDay(), dayNamesShort, dayNames);
                                    break;
                                case "o":
                                    output += formatNumber("o", Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() - new Date(date.getFullYear(), 0, 0).getTime()) / 864e5), 3);
                                    break;
                                case "m":
                                    output += formatNumber("m", date.getMonth() + 1, 2);
                                    break;
                                case "M":
                                    output += formatName("M", date.getMonth(), monthNamesShort, monthNames);
                                    break;
                                case "y":
                                    output += lookAhead("y") ? date.getFullYear() : (date.getYear() % 100 < 10 ? "0" : "") + date.getYear() % 100;
                                    break;
                                case "@":
                                    output += date.getTime();
                                    break;
                                case "!":
                                    output += date.getTime() * 1e4 + this._ticksTo1970;
                                    break;
                                case "'":
                                    if (lookAhead("'")) {
                                        output += "'"
                                    } else {
                                        literal = true
                                    }
                                    break;
                                default:
                                    output += format.charAt(iFormat)
                            }
                        }
                    }
                }
                return output
            },
            _possibleChars: function(format) {
                var iFormat, chars = "",
                    literal = false,
                    lookAhead = function(match) {
                        var matches = iFormat + 1 < format.length && format.charAt(iFormat + 1) === match;
                        if (matches) {
                            iFormat++
                        }
                        return matches
                    };
                for (iFormat = 0; iFormat < format.length; iFormat++) {
                    if (literal) {
                        if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
                            literal = false
                        } else {
                            chars += format.charAt(iFormat)
                        }
                    } else {
                        switch (format.charAt(iFormat)) {
                            case "d":
                            case "m":
                            case "y":
                            case "@":
                                chars += "0123456789";
                                break;
                            case "D":
                            case "M":
                                return null;
                            case "'":
                                if (lookAhead("'")) {
                                    chars += "'"
                                } else {
                                    literal = true
                                }
                                break;
                            default:
                                chars += format.charAt(iFormat)
                        }
                    }
                }
                return chars
            },
            _get: function(inst, name) {
                return inst.settings[name] !== undefined ? inst.settings[name] : this._defaults[name]
            },
            _setDateFromField: function(inst, noDefault) {
                if (inst.input.val() === inst.lastVal) {
                    return
                }
                var dateFormat = this._get(inst, "dateFormat"),
                    dates = inst.lastVal = inst.input ? inst.input.val() : null,
                    defaultDate = this._getDefaultDate(inst),
                    date = defaultDate,
                    settings = this._getFormatConfig(inst);
                try {
                    date = this.parseDate(dateFormat, dates, settings) || defaultDate
                } catch (event) {
                    dates = noDefault ? "" : dates
                }
                inst.selectedDay = date.getDate();
                inst.drawMonth = inst.selectedMonth = date.getMonth();
                inst.drawYear = inst.selectedYear = date.getFullYear();
                inst.currentDay = dates ? date.getDate() : 0;
                inst.currentMonth = dates ? date.getMonth() : 0;
                inst.currentYear = dates ? date.getFullYear() : 0;
                this._adjustInstDate(inst)
            },
            _getDefaultDate: function(inst) {
                return this._restrictMinMax(inst, this._determineDate(inst, this._get(inst, "defaultDate"), new Date))
            },
            _determineDate: function(inst, date, defaultDate) {
                var offsetNumeric = function(offset) {
                        var date = new Date;
                        date.setDate(date.getDate() + offset);
                        return date
                    },
                    offsetString = function(offset) {
                        try {
                            return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"), offset, $.datepicker._getFormatConfig(inst))
                        } catch (e) {}
                        var date = (offset.toLowerCase().match(/^c/) ? $.datepicker._getDate(inst) : null) || new Date,
                            year = date.getFullYear(),
                            month = date.getMonth(),
                            day = date.getDate(),
                            pattern = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,
                            matches = pattern.exec(offset);
                        while (matches) {
                            switch (matches[2] || "d") {
                                case "d":
                                case "D":
                                    day += parseInt(matches[1], 10);
                                    break;
                                case "w":
                                case "W":
                                    day += parseInt(matches[1], 10) * 7;
                                    break;
                                case "m":
                                case "M":
                                    month += parseInt(matches[1], 10);
                                    day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
                                    break;
                                case "y":
                                case "Y":
                                    year += parseInt(matches[1], 10);
                                    day = Math.min(day, $.datepicker._getDaysInMonth(year, month));
                                    break
                            }
                            matches = pattern.exec(offset)
                        }
                        return new Date(year, month, day)
                    },
                    newDate = date == null || date === "" ? defaultDate : typeof date === "string" ? offsetString(date) : typeof date === "number" ? isNaN(date) ? defaultDate : offsetNumeric(date) : new Date(date.getTime());
                newDate = newDate && newDate.toString() === "Invalid Date" ? defaultDate : newDate;
                if (newDate) {
                    newDate.setHours(0);
                    newDate.setMinutes(0);
                    newDate.setSeconds(0);
                    newDate.setMilliseconds(0)
                }
                return this._daylightSavingAdjust(newDate)
            },
            _daylightSavingAdjust: function(date) {
                if (!date) {
                    return null
                }
                date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
                return date
            },
            _setDate: function(inst, date, noChange) {
                var clear = !date,
                    origMonth = inst.selectedMonth,
                    origYear = inst.selectedYear,
                    newDate = this._restrictMinMax(inst, this._determineDate(inst, date, new Date));
                inst.selectedDay = inst.currentDay = newDate.getDate();
                inst.drawMonth = inst.selectedMonth = inst.currentMonth = newDate.getMonth();
                inst.drawYear = inst.selectedYear = inst.currentYear = newDate.getFullYear();
                if ((origMonth !== inst.selectedMonth || origYear !== inst.selectedYear) && !noChange) {
                    this._notifyChange(inst)
                }
                this._adjustInstDate(inst);
                if (inst.input) {
                    inst.input.val(clear ? "" : this._formatDate(inst))
                }
            },
            _getDate: function(inst) {
                var startDate = !inst.currentYear || inst.input && inst.input.val() === "" ? null : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
                return startDate
            },
            _attachHandlers: function(inst) {
                var stepMonths = this._get(inst, "stepMonths"),
                    id = "#" + inst.id.replace(/\\\\/g, "\\");
                inst.dpDiv.find("[data-handler]").map(function() {
                    var handler = {
                        prev: function() {
                            $.datepicker._adjustDate(id, -stepMonths, "M")
                        },
                        next: function() {
                            $.datepicker._adjustDate(id, +stepMonths, "M")
                        },
                        hide: function() {
                            $.datepicker._hideDatepicker()
                        },
                        today: function() {
                            $.datepicker._gotoToday(id)
                        },
                        selectDay: function() {
                            $.datepicker._selectDay(id, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this);
                            return false
                        },
                        selectMonth: function() {
                            $.datepicker._selectMonthYear(id, this, "M");
                            return false
                        },
                        selectYear: function() {
                            $.datepicker._selectMonthYear(id, this, "Y");
                            return false
                        }
                    };
                    $(this).bind(this.getAttribute("data-event"), handler[this.getAttribute("data-handler")])
                })
            },
            _generateHTML: function(inst) {
                var maxDraw, prevText, prev, nextText, next, currentText, gotoDate, controls, buttonPanel, firstDay, showWeek, dayNames, dayNamesMin, monthNames, monthNamesShort, beforeShowDay, showOtherMonths, selectOtherMonths, defaultDate, html, dow, row, group, col, selectedDate, cornerClass, calender, thead, day, daysInMonth, leadDays, curRows, numRows, printDate, dRow, tbody, daySettings, otherMonth, unselectable, tempDate = new Date,
                    today = this._daylightSavingAdjust(new Date(tempDate.getFullYear(), tempDate.getMonth(), tempDate.getDate())),
                    isRTL = this._get(inst, "isRTL"),
                    showButtonPanel = this._get(inst, "showButtonPanel"),
                    hideIfNoPrevNext = this._get(inst, "hideIfNoPrevNext"),
                    navigationAsDateFormat = this._get(inst, "navigationAsDateFormat"),
                    numMonths = this._getNumberOfMonths(inst),
                    showCurrentAtPos = this._get(inst, "showCurrentAtPos"),
                    stepMonths = this._get(inst, "stepMonths"),
                    isMultiMonth = numMonths[0] !== 1 || numMonths[1] !== 1,
                    currentDate = this._daylightSavingAdjust(!inst.currentDay ? new Date(9999, 9, 9) : new Date(inst.currentYear, inst.currentMonth, inst.currentDay)),
                    minDate = this._getMinMaxDate(inst, "min"),
                    maxDate = this._getMinMaxDate(inst, "max"),
                    drawMonth = inst.drawMonth - showCurrentAtPos,
                    drawYear = inst.drawYear;
                if (drawMonth < 0) {
                    drawMonth += 12;
                    drawYear--
                }
                if (maxDate) {
                    maxDraw = this._daylightSavingAdjust(new Date(maxDate.getFullYear(), maxDate.getMonth() - numMonths[0] * numMonths[1] + 1, maxDate.getDate()));
                    maxDraw = minDate && maxDraw < minDate ? minDate : maxDraw;
                    while (this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1)) > maxDraw) {
                        drawMonth--;
                        if (drawMonth < 0) {
                            drawMonth = 11;
                            drawYear--
                        }
                    }
                }
                inst.drawMonth = drawMonth;
                inst.drawYear = drawYear;
                prevText = this._get(inst, "prevText");
                prevText = !navigationAsDateFormat ? prevText : this.formatDate(prevText, this._daylightSavingAdjust(new Date(drawYear, drawMonth - stepMonths, 1)), this._getFormatConfig(inst));
                prev = this._canAdjustMonth(inst, -1, drawYear, drawMonth) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" + " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" : hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "e" : "w") + "'>" + prevText + "</span></a>";
                nextText = this._get(inst, "nextText");
                nextText = !navigationAsDateFormat ? nextText : this.formatDate(nextText, this._daylightSavingAdjust(new Date(drawYear, drawMonth + stepMonths, 1)), this._getFormatConfig(inst));
                next = this._canAdjustMonth(inst, +1, drawYear, drawMonth) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" + " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" : hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + (isRTL ? "w" : "e") + "'>" + nextText + "</span></a>";
                currentText = this._get(inst, "currentText");
                gotoDate = this._get(inst, "gotoCurrent") && inst.currentDay ? currentDate : today;
                currentText = !navigationAsDateFormat ? currentText : this.formatDate(currentText, gotoDate, this._getFormatConfig(inst));
                controls = !inst.inline ? "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(inst, "closeText") + "</button>" : "";
                buttonPanel = showButtonPanel ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (isRTL ? controls : "") + (this._isInRange(inst, gotoDate) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'" + ">" + currentText + "</button>" : "") + (isRTL ? "" : controls) + "</div>" : "";
                firstDay = parseInt(this._get(inst, "firstDay"), 10);
                firstDay = isNaN(firstDay) ? 0 : firstDay;
                showWeek = this._get(inst, "showWeek");
                dayNames = this._get(inst, "dayNames");
                dayNamesMin = this._get(inst, "dayNamesMin");
                monthNames = this._get(inst, "monthNames");
                monthNamesShort = this._get(inst, "monthNamesShort");
                beforeShowDay = this._get(inst, "beforeShowDay");
                showOtherMonths = this._get(inst, "showOtherMonths");
                selectOtherMonths = this._get(inst, "selectOtherMonths");
                defaultDate = this._getDefaultDate(inst);
                html = "";
                dow;
                for (row = 0; row < numMonths[0]; row++) {
                    group = "";
                    this.maxRows = 4;
                    for (col = 0; col < numMonths[1]; col++) {
                        selectedDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, inst.selectedDay));
                        cornerClass = " ui-corner-all";
                        calender = "";
                        if (isMultiMonth) {
                            calender += "<div class='ui-datepicker-group";
                            if (numMonths[1] > 1) {
                                switch (col) {
                                    case 0:
                                        calender += " ui-datepicker-group-first";
                                        cornerClass = " ui-corner-" + (isRTL ? "right" : "left");
                                        break;
                                    case numMonths[1] - 1:
                                        calender += " ui-datepicker-group-last";
                                        cornerClass = " ui-corner-" + (isRTL ? "left" : "right");
                                        break;
                                    default:
                                        calender += " ui-datepicker-group-middle";
                                        cornerClass = "";
                                        break
                                }
                            }
                            calender += "'>"
                        }
                        calender += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + cornerClass + "'>" + (/all|left/.test(cornerClass) && row === 0 ? isRTL ? next : prev : "") + (/all|right/.test(cornerClass) && row === 0 ? isRTL ? prev : next : "") + this._generateMonthYearHeader(inst, drawMonth, drawYear, minDate, maxDate, row > 0 || col > 0, monthNames, monthNamesShort) + "</div><table class='ui-datepicker-calendar'><thead>" + "<tr>";
                        thead = showWeek ? "<th class='ui-datepicker-week-col'>" + this._get(inst, "weekHeader") + "</th>" : "";
                        for (dow = 0; dow < 7; dow++) {
                            day = (dow + firstDay) % 7;
                            thead += "<th scope='col'" + ((dow + firstDay + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + ">" + "<span title='" + dayNames[day] + "'>" + dayNamesMin[day] + "</span></th>"
                        }
                        calender += thead + "</tr></thead><tbody>";
                        daysInMonth = this._getDaysInMonth(drawYear, drawMonth);
                        if (drawYear === inst.selectedYear && drawMonth === inst.selectedMonth) {
                            inst.selectedDay = Math.min(inst.selectedDay, daysInMonth)
                        }
                        leadDays = (this._getFirstDayOfMonth(drawYear, drawMonth) - firstDay + 7) % 7;
                        curRows = Math.ceil((leadDays + daysInMonth) / 7);
                        numRows = isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows;
                        this.maxRows = numRows;
                        printDate = this._daylightSavingAdjust(new Date(drawYear, drawMonth, 1 - leadDays));
                        for (dRow = 0; dRow < numRows; dRow++) {
                            calender += "<tr>";
                            tbody = !showWeek ? "" : "<td class='ui-datepicker-week-col'>" + this._get(inst, "calculateWeek")(printDate) + "</td>";
                            for (dow = 0; dow < 7; dow++) {
                                daySettings = beforeShowDay ? beforeShowDay.apply(inst.input ? inst.input[0] : null, [printDate]) : [true, ""];
                                otherMonth = printDate.getMonth() !== drawMonth;
                                unselectable = otherMonth && !selectOtherMonths || !daySettings[0] || minDate && printDate < minDate || maxDate && printDate > maxDate;
                                tbody += "<td class='" + ((dow + firstDay + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (otherMonth ? " ui-datepicker-other-month" : "") + (printDate.getTime() === selectedDate.getTime() && drawMonth === inst.selectedMonth && inst._keyEvent || defaultDate.getTime() === printDate.getTime() && defaultDate.getTime() === selectedDate.getTime() ? " " + this._dayOverClass : "") + (unselectable ? " " + this._unselectableClass + " ui-state-disabled" : "") + (otherMonth && !showOtherMonths ? "" : " " + daySettings[1] + (printDate.getTime() === currentDate.getTime() ? " " + this._currentClass : "") + (printDate.getTime() === today.getTime() ? " ui-datepicker-today" : "")) + "'" + ((!otherMonth || showOtherMonths) && daySettings[2] ? " title='" + daySettings[2].replace(/'/g, "&#39;") + "'" : "") + (unselectable ? "" : " data-handler='selectDay' data-event='click' data-month='" + printDate.getMonth() + "' data-year='" + printDate.getFullYear() + "'") + ">" + (otherMonth && !showOtherMonths ? "&#xa0;" : unselectable ? "<span class='ui-state-default'>" + printDate.getDate() + "</span>" : "<a class='ui-state-default" + (printDate.getTime() === today.getTime() ? " ui-state-highlight" : "") + (printDate.getTime() === currentDate.getTime() ? " ui-state-active" : "") + (otherMonth ? " ui-priority-secondary" : "") + "' href='#'>" + printDate.getDate() + "</a>") + "</td>";
                                printDate.setDate(printDate.getDate() + 1);
                                printDate = this._daylightSavingAdjust(printDate)
                            }
                            calender += tbody + "</tr>"
                        }
                        drawMonth++;
                        if (drawMonth > 11) {
                            drawMonth = 0;
                            drawYear++
                        }
                        calender += "</tbody></table>" + (isMultiMonth ? "</div>" + (numMonths[0] > 0 && col === numMonths[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : "");
                        group += calender
                    }
                    html += group
                }
                html += buttonPanel;
                inst._keyEvent = false;
                return html
            },
            _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate, secondary, monthNames, monthNamesShort) {
                var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, changeMonth = this._get(inst, "changeMonth"),
                    changeYear = this._get(inst, "changeYear"),
                    showMonthAfterYear = this._get(inst, "showMonthAfterYear"),
                    html = "<div class='ui-datepicker-title'>",
                    monthHtml = "";
                if (secondary || !changeMonth) {
                    monthHtml += "<span class='ui-datepicker-month'>" + monthNames[drawMonth] + "</span>"
                } else {
                    inMinYear = minDate && minDate.getFullYear() === drawYear;
                    inMaxYear = maxDate && maxDate.getFullYear() === drawYear;
                    monthHtml += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>";
                    for (month = 0; month < 12; month++) {
                        if ((!inMinYear || month >= minDate.getMonth()) && (!inMaxYear || month <= maxDate.getMonth())) {
                            monthHtml += "<option value='" + month + "'" + (month === drawMonth ? " selected='selected'" : "") + ">" + monthNamesShort[month] + "</option>"
                        }
                    }
                    monthHtml += "</select>"
                }
                if (!showMonthAfterYear) {
                    html += monthHtml + (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "")
                }
                if (!inst.yearshtml) {
                    inst.yearshtml = "";
                    if (secondary || !changeYear) {
                        html += "<span class='ui-datepicker-year'>" + drawYear + "</span>"
                    } else {
                        years = this._get(inst, "yearRange").split(":");
                        thisYear = (new Date).getFullYear();
                        determineYear = function(value) {
                            var year = value.match(/c[+\-].*/) ? drawYear + parseInt(value.substring(1), 10) : value.match(/[+\-].*/) ? thisYear + parseInt(value, 10) : parseInt(value, 10);
                            return isNaN(year) ? thisYear : year
                        };
                        year = determineYear(years[0]);
                        endYear = Math.max(year, determineYear(years[1] || ""));
                        year = minDate ? Math.max(year, minDate.getFullYear()) : year;
                        endYear = maxDate ? Math.min(endYear, maxDate.getFullYear()) : endYear;
                        inst.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";
                        for (; year <= endYear; year++) {
                            inst.yearshtml += "<option value='" + year + "'" + (year === drawYear ? " selected='selected'" : "") + ">" + year + "</option>"
                        }
                        inst.yearshtml += "</select>";
                        html += inst.yearshtml;
                        inst.yearshtml = null
                    }
                }
                html += this._get(inst, "yearSuffix");
                if (showMonthAfterYear) {
                    html += (secondary || !(changeMonth && changeYear) ? "&#xa0;" : "") + monthHtml
                }
                html += "</div>";
                return html
            },
            _adjustInstDate: function(inst, offset, period) {
                var year = inst.drawYear + (period === "Y" ? offset : 0),
                    month = inst.drawMonth + (period === "M" ? offset : 0),
                    day = Math.min(inst.selectedDay, this._getDaysInMonth(year, month)) + (period === "D" ? offset : 0),
                    date = this._restrictMinMax(inst, this._daylightSavingAdjust(new Date(year, month, day)));
                inst.selectedDay = date.getDate();
                inst.drawMonth = inst.selectedMonth = date.getMonth();
                inst.drawYear = inst.selectedYear = date.getFullYear();
                if (period === "M" || period === "Y") {
                    this._notifyChange(inst)
                }
            },
            _restrictMinMax: function(inst, date) {
                var minDate = this._getMinMaxDate(inst, "min"),
                    maxDate = this._getMinMaxDate(inst, "max"),
                    newDate = minDate && date < minDate ? minDate : date;
                return maxDate && newDate > maxDate ? maxDate : newDate
            },
            _notifyChange: function(inst) {
                var onChange = this._get(inst, "onChangeMonthYear");
                if (onChange) {
                    onChange.apply(inst.input ? inst.input[0] : null, [inst.selectedYear, inst.selectedMonth + 1, inst])
                }
            },
            _getNumberOfMonths: function(inst) {
                var numMonths = this._get(inst, "numberOfMonths");
                return numMonths == null ? [1, 1] : typeof numMonths === "number" ? [1, numMonths] : numMonths
            },
            _getMinMaxDate: function(inst, minMax) {
                return this._determineDate(inst, this._get(inst, minMax + "Date"), null)
            },
            _getDaysInMonth: function(year, month) {
                return 32 - this._daylightSavingAdjust(new Date(year, month, 32)).getDate()
            },
            _getFirstDayOfMonth: function(year, month) {
                return new Date(year, month, 1).getDay()
            },
            _canAdjustMonth: function(inst, offset, curYear, curMonth) {
                var numMonths = this._getNumberOfMonths(inst),
                    date = this._daylightSavingAdjust(new Date(curYear, curMonth + (offset < 0 ? offset : numMonths[0] * numMonths[1]), 1));
                if (offset < 0) {
                    date.setDate(this._getDaysInMonth(date.getFullYear(), date.getMonth()))
                }
                return this._isInRange(inst, date)
            },
            _isInRange: function(inst, date) {
                var yearSplit, currentYear, minDate = this._getMinMaxDate(inst, "min"),
                    maxDate = this._getMinMaxDate(inst, "max"),
                    minYear = null,
                    maxYear = null,
                    years = this._get(inst, "yearRange");
                if (years) {
                    yearSplit = years.split(":");
                    currentYear = (new Date).getFullYear();
                    minYear = parseInt(yearSplit[0], 10);
                    maxYear = parseInt(yearSplit[1], 10);
                    if (yearSplit[0].match(/[+\-].*/)) {
                        minYear += currentYear
                    }
                    if (yearSplit[1].match(/[+\-].*/)) {
                        maxYear += currentYear
                    }
                }
                return (!minDate || date.getTime() >= minDate.getTime()) && (!maxDate || date.getTime() <= maxDate.getTime()) && (!minYear || date.getFullYear() >= minYear) && (!maxYear || date.getFullYear() <= maxYear)
            },
            _getFormatConfig: function(inst) {
                var shortYearCutoff = this._get(inst, "shortYearCutoff");
                shortYearCutoff = typeof shortYearCutoff !== "string" ? shortYearCutoff : (new Date).getFullYear() % 100 + parseInt(shortYearCutoff, 10);
                return {
                    shortYearCutoff: shortYearCutoff,
                    dayNamesShort: this._get(inst, "dayNamesShort"),
                    dayNames: this._get(inst, "dayNames"),
                    monthNamesShort: this._get(inst, "monthNamesShort"),
                    monthNames: this._get(inst, "monthNames")
                }
            },
            _formatDate: function(inst, day, month, year) {
                if (!day) {
                    inst.currentDay = inst.selectedDay;
                    inst.currentMonth = inst.selectedMonth;
                    inst.currentYear = inst.selectedYear
                }
                var date = day ? typeof day === "object" ? day : this._daylightSavingAdjust(new Date(year, month, day)) : this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay));
                return this.formatDate(this._get(inst, "dateFormat"), date, this._getFormatConfig(inst))
            }
        });

        function datepicker_bindHover(dpDiv) {
            var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
            return dpDiv.delegate(selector, "mouseout", function() {
                $(this).removeClass("ui-state-hover");
                if (this.className.indexOf("ui-datepicker-prev") !== -1) {
                    $(this).removeClass("ui-datepicker-prev-hover")
                }
                if (this.className.indexOf("ui-datepicker-next") !== -1) {
                    $(this).removeClass("ui-datepicker-next-hover")
                }
            }).delegate(selector, "mouseover", function() {
                if (!$.datepicker._isDisabledDatepicker(datepicker_instActive.inline ? dpDiv.parent()[0] : datepicker_instActive.input[0])) {
                    $(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
                    $(this).addClass("ui-state-hover");
                    if (this.className.indexOf("ui-datepicker-prev") !== -1) {
                        $(this).addClass("ui-datepicker-prev-hover")
                    }
                    if (this.className.indexOf("ui-datepicker-next") !== -1) {
                        $(this).addClass("ui-datepicker-next-hover")
                    }
                }
            })
        }

        function datepicker_extendRemove(target, props) {
            $.extend(target, props);
            for (var name in props) {
                if (props[name] == null) {
                    target[name] = props[name]
                }
            }
            return target
        }
        $.fn.datepicker = function(options) {
            if (!this.length) {
                return this
            }
            if (!$.datepicker.initialized) {
                $(document).mousedown($.datepicker._checkExternalClick);
                $.datepicker.initialized = true
            }
            if ($("#" + $.datepicker._mainDivId).length === 0) {
                $("body").append($.datepicker.dpDiv)
            }
            var otherArgs = Array.prototype.slice.call(arguments, 1);
            if (typeof options === "string" && (options === "isDisabled" || options === "getDate" || options === "widget")) {
                return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs))
            }
            if (options === "option" && arguments.length === 2 && typeof arguments[1] === "string") {
                return $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this[0]].concat(otherArgs))
            }
            return this.each(function() {
                typeof options === "string" ? $.datepicker["_" + options + "Datepicker"].apply($.datepicker, [this].concat(otherArgs)) : $.datepicker._attachDatepicker(this, options)
            })
        };
        $.datepicker = new Datepicker;
        $.datepicker.initialized = false;
        $.datepicker.uuid = (new Date).getTime();
        $.datepicker.version = "@VERSION"
    })(jQuery);
    return jQuery
});
define("jquery.qtip", ["jquery", "require"], function(jQuery, require) {
    var define = null;
    (function(window, document, undefined) {
        (function(factory) {
            "use strict";
            if (typeof define === "function" && define.amd) {
                define(["jquery", "imagesloaded"], factory)
            } else if (jQuery && !jQuery.fn.qtip) {
                factory(jQuery)
            }
        })(function($) {
            var TRUE = true,
                FALSE = false,
                NULL = null,
                X = "x",
                Y = "y",
                WIDTH = "width",
                HEIGHT = "height",
                TOP = "top",
                LEFT = "left",
                BOTTOM = "bottom",
                RIGHT = "right",
                CENTER = "center",
                FLIP = "flip",
                FLIPINVERT = "flipinvert",
                SHIFT = "shift",
                QTIP, PROTOTYPE, CORNER, CHECKS, PLUGINS = {},
                NAMESPACE = "qtip",
                ATTR_HAS = "data-hasqtip",
                ATTR_ID = "data-qtip-id",
                WIDGET = ["ui-widget", "ui-tooltip"],
                SELECTOR = "." + NAMESPACE,
                INACTIVE_EVENTS = "click dblclick mousedown mouseup mousemove mouseleave mouseenter".split(" "),
                CLASS_FIXED = NAMESPACE + "-fixed",
                CLASS_DEFAULT = NAMESPACE + "-default",
                CLASS_FOCUS = NAMESPACE + "-focus",
                CLASS_HOVER = NAMESPACE + "-hover",
                CLASS_DISABLED = NAMESPACE + "-disabled",
                replaceSuffix = "_replacedByqTip",
                oldtitle = "oldtitle",
                trackingBound;
            BROWSER = {
                ie: function() {
                    var v = 3,
                        div = document.createElement("div");
                    while (div.innerHTML = "<!--[if gt IE " + ++v + "]><i></i><![endif]-->") {
                        if (!div.getElementsByTagName("i")[0]) {
                            break
                        }
                    }
                    return v > 4 ? v : NaN
                }(),
                iOS: parseFloat(("" + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0, ""])[1]).replace("undefined", "3_2").replace("_", ".").replace("_", "")) || FALSE
            };

            function QTip(target, options, id, attr) {
                this.id = id;
                this.target = target;
                this.tooltip = NULL;
                this.elements = elements = {
                    target: target
                };
                this._id = NAMESPACE + "-" + id;
                this.timers = {
                    img: {}
                };
                this.options = options;
                this.plugins = {};
                this.cache = cache = {
                    event: {},
                    target: $(),
                    disabled: FALSE,
                    attr: attr,
                    onTooltip: FALSE,
                    lastClass: ""
                };
                this.rendered = this.destroyed = this.disabled = this.waiting = this.hiddenDuringWait = this.positioning = this.triggering = FALSE
            }
            PROTOTYPE = QTip.prototype;
            PROTOTYPE.render = function(show) {
                if (this.rendered || this.destroyed) {
                    return this
                }
                var self = this,
                    options = this.options,
                    cache = this.cache,
                    elements = this.elements,
                    text = options.content.text,
                    title = options.content.title,
                    button = options.content.button,
                    posOptions = options.position,
                    namespace = "." + this._id + " ",
                    deferreds = [];
                $.attr(this.target[0], "aria-describedby", this._id);
                this.tooltip = elements.tooltip = tooltip = $("<div/>", {
                    id: this._id,
                    "class": [NAMESPACE, CLASS_DEFAULT, options.style.classes, NAMESPACE + "-pos-" + options.position.my.abbrev()].join(" "),
                    width: options.style.width || "",
                    height: options.style.height || "",
                    tracking: posOptions.target === "mouse" && posOptions.adjust.mouse,
                    role: "alert",
                    "aria-live": "polite",
                    "aria-atomic": FALSE,
                    "aria-describedby": this._id + "-content",
                    "aria-hidden": TRUE
                }).toggleClass(CLASS_DISABLED, this.disabled).attr(ATTR_ID, this.id).data(NAMESPACE, this).appendTo(posOptions.container).append(elements.content = $("<div />", {
                    "class": NAMESPACE + "-content",
                    id: this._id + "-content",
                    "aria-atomic": TRUE
                }));
                this.rendered = -1;
                this.positioning = TRUE;
                if (title) {
                    this._createTitle();
                    if (!$.isFunction(title)) {
                        deferreds.push(this._updateTitle(title, FALSE))
                    }
                }
                if (button) {
                    this._createButton()
                }
                if (!$.isFunction(text)) {
                    deferreds.push(this._updateContent(text, FALSE))
                }
                this.rendered = TRUE;
                this._setWidget();
                $.each(options.events, function(name, callback) {
                    $.isFunction(callback) && tooltip.bind((name === "toggle" ? ["tooltipshow", "tooltiphide"] : ["tooltip" + name]).join(namespace) + namespace, callback)
                });
                $.each(PLUGINS, function(name) {
                    var instance;
                    if (this.initialize === "render" && (instance = this(self))) {
                        self.plugins[name] = instance
                    }
                });
                this._assignEvents();
                $.when.apply($, deferreds).then(function() {
                    self._trigger("render");
                    self.positioning = FALSE;
                    if (!self.hiddenDuringWait && (options.show.ready || show)) {
                        self.toggle(TRUE, cache.event, FALSE)
                    }
                    self.hiddenDuringWait = FALSE
                });
                QTIP.api[this.id] = this;
                return this
            };
            PROTOTYPE.destroy = function(immediate) {
                if (this.destroyed) {
                    return this.target
                }

                function process() {
                    if (this.destroyed) {
                        return
                    }
                    this.destroyed = TRUE;
                    var target = this.target,
                        title = target.attr(oldtitle);
                    if (this.rendered) {
                        this.tooltip.stop(1, 0).find("*").remove().end().remove()
                    }
                    $.each(this.plugins, function(name) {
                        this.destroy && this.destroy()
                    });
                    clearTimeout(this.timers.show);
                    clearTimeout(this.timers.hide);
                    this._unassignEvents();
                    target.removeData(NAMESPACE).removeAttr(ATTR_ID).removeAttr("aria-describedby");
                    if (this.options.suppress && title) {
                        target.attr("title", title).removeAttr(oldtitle)
                    }
                    this._unbind(target);
                    this.options = this.elements = this.cache = this.timers = this.plugins = this.mouse = NULL;
                    delete QTIP.api[this.id]
                }
                if (immediate !== TRUE && this.rendered) {
                    tooltip.one("tooltiphidden", $.proxy(process, this));
                    !this.triggering && this.hide()
                } else {
                    process.call(this)
                }
                return this.target
            };

            function invalidOpt(a) {
                return a === NULL || $.type(a) !== "object"
            }

            function invalidContent(c) {
                return !($.isFunction(c) || c && c.attr || c.length || $.type(c) === "object" && (c.jquery || c.then))
            }

            function sanitizeOptions(opts) {
                var content, text, ajax, once;
                if (invalidOpt(opts)) {
                    return FALSE
                }
                if (invalidOpt(opts.metadata)) {
                    opts.metadata = {
                        type: opts.metadata
                    }
                }
                if ("content" in opts) {
                    content = opts.content;
                    if (invalidOpt(content) || content.jquery || content.done) {
                        content = opts.content = {
                            text: text = invalidContent(content) ? FALSE : content
                        }
                    } else {
                        text = content.text
                    }
                    if ("ajax" in content) {
                        ajax = content.ajax;
                        once = ajax && ajax.once !== FALSE;
                        delete content.ajax;
                        content.text = function(event, api) {
                            var loading = text || $(this).attr(api.options.content.attr) || "Loading...",
                                deferred = $.ajax($.extend({}, ajax, {
                                    context: api
                                })).then(ajax.success, NULL, ajax.error).then(function(content) {
                                    if (content && once) {
                                        api.set("content.text", content)
                                    }
                                    return content
                                }, function(xhr, status, error) {
                                    if (api.destroyed || xhr.status === 0) {
                                        return
                                    }
                                    api.set("content.text", status + ": " + error)
                                });
                            return !once ? (api.set("content.text", loading), deferred) : loading
                        }
                    }
                    if ("title" in content) {
                        if (!invalidOpt(content.title)) {
                            content.button = content.title.button;
                            content.title = content.title.text
                        }
                        if (invalidContent(content.title || FALSE)) {
                            content.title = FALSE
                        }
                    }
                }
                if ("position" in opts && invalidOpt(opts.position)) {
                    opts.position = {
                        my: opts.position,
                        at: opts.position
                    }
                }
                if ("show" in opts && invalidOpt(opts.show)) {
                    opts.show = opts.show.jquery ? {
                        target: opts.show
                    } : opts.show === TRUE ? {
                        ready: TRUE
                    } : {
                        event: opts.show
                    }
                }
                if ("hide" in opts && invalidOpt(opts.hide)) {
                    opts.hide = opts.hide.jquery ? {
                        target: opts.hide
                    } : {
                        event: opts.hide
                    }
                }
                if ("style" in opts && invalidOpt(opts.style)) {
                    opts.style = {
                        classes: opts.style
                    }
                }
                $.each(PLUGINS, function() {
                    this.sanitize && this.sanitize(opts)
                });
                return opts
            }
            CHECKS = PROTOTYPE.checks = {
                builtin: {
                    "^id$": function(obj, o, v, prev) {
                        var id = v === TRUE ? QTIP.nextid : v,
                            new_id = NAMESPACE + "-" + id;
                        if (id !== FALSE && id.length > 0 && !$("#" + new_id).length) {
                            this._id = new_id;
                            if (this.rendered) {
                                this.tooltip[0].id = this._id;
                                this.elements.content[0].id = this._id + "-content";
                                this.elements.title[0].id = this._id + "-title"
                            }
                        } else {
                            obj[o] = prev
                        }
                    },
                    "^prerender": function(obj, o, v) {
                        v && !this.rendered && this.render(this.options.show.ready)
                    },
                    "^content.text$": function(obj, o, v) {
                        this._updateContent(v)
                    },
                    "^content.attr$": function(obj, o, v, prev) {
                        if (this.options.content.text === this.target.attr(prev)) {
                            this._updateContent(this.target.attr(v))
                        }
                    },
                    "^content.title$": function(obj, o, v) {
                        if (!v) {
                            return this._removeTitle()
                        }
                        v && !this.elements.title && this._createTitle();
                        this._updateTitle(v)
                    },
                    "^content.button$": function(obj, o, v) {
                        this._updateButton(v)
                    },
                    "^content.title.(text|button)$": function(obj, o, v) {
                        this.set("content." + o, v)
                    },
                    "^position.(my|at)$": function(obj, o, v) {
                        "string" === typeof v && (obj[o] = new CORNER(v, o === "at"))
                    },
                    "^position.container$": function(obj, o, v) {
                        this.tooltip.appendTo(v)
                    },
                    "^show.ready$": function(obj, o, v) {
                        v && (!this.rendered && this.render(TRUE) || this.toggle(TRUE))
                    },
                    "^style.classes$": function(obj, o, v, p) {
                        this.tooltip.removeClass(p).addClass(v)
                    },
                    "^style.width|height": function(obj, o, v) {
                        this.tooltip.css(o, v)
                    },
                    "^style.widget|content.title": function() {
                        this._setWidget()
                    },
                    "^style.def": function(obj, o, v) {
                        this.tooltip.toggleClass(CLASS_DEFAULT, !!v)
                    },
                    "^events.(render|show|move|hide|focus|blur)$": function(obj, o, v) {
                        tooltip[($.isFunction(v) ? "" : "un") + "bind"]("tooltip" + o, v)
                    },
                    "^(show|hide|position).(event|target|fixed|inactive|leave|distance|viewport|adjust)": function() {
                        var posOptions = this.options.position;
                        tooltip.attr("tracking", posOptions.target === "mouse" && posOptions.adjust.mouse);
                        this._unassignEvents();
                        this._assignEvents()
                    }
                }
            };

            function convertNotation(options, notation) {
                var i = 0,
                    obj, option = options,
                    levels = notation.split(".");
                while (option = option[levels[i++]]) {
                    if (i < levels.length) {
                        obj = option
                    }
                }
                return [obj || options, levels.pop()]
            }
            PROTOTYPE.get = function(notation) {
                if (this.destroyed) {
                    return this
                }
                var o = convertNotation(this.options, notation.toLowerCase()),
                    result = o[0][o[1]];
                return result.precedance ? result.string() : result
            };

            function setCallback(notation, args) {
                var category, rule, match;
                for (category in this.checks) {
                    for (rule in this.checks[category]) {
                        if (match = new RegExp(rule, "i").exec(notation)) {
                            args.push(match);
                            if (category === "builtin" || this.plugins[category]) {
                                this.checks[category][rule].apply(this.plugins[category] || this, args)
                            }
                        }
                    }
                }
            }
            var rmove = /^position\.(my|at|adjust|target|container|viewport)|style|content|show\.ready/i,
                rrender = /^prerender|show\.ready/i;
            PROTOTYPE.set = function(option, value) {
                if (this.destroyed) {
                    return this
                }
                var rendered = this.rendered,
                    reposition = FALSE,
                    options = this.options,
                    checks = this.checks,
                    name;
                if ("string" === typeof option) {
                    name = option;
                    option = {};
                    option[name] = value
                } else {
                    option = $.extend({}, option)
                }
                $.each(option, function(notation, value) {
                    if (!rendered && !rrender.test(notation)) {
                        delete option[notation];
                        return
                    }
                    var obj = convertNotation(options, notation.toLowerCase()),
                        previous;
                    previous = obj[0][obj[1]];
                    obj[0][obj[1]] = value && value.nodeType ? $(value) : value;
                    reposition = rmove.test(notation) || reposition;
                    option[notation] = [obj[0], obj[1], value, previous]
                });
                sanitizeOptions(options);
                this.positioning = TRUE;
                $.each(option, $.proxy(setCallback, this));
                this.positioning = FALSE;
                if (this.rendered && this.tooltip[0].offsetWidth > 0 && reposition) {
                    this.reposition(options.position.target === "mouse" ? NULL : this.cache.event)
                }
                return this
            };
            PROTOTYPE._update = function(content, element, reposition) {
                var self = this,
                    cache = this.cache;
                if (!this.rendered || !content) {
                    return FALSE
                }
                if ($.isFunction(content)) {
                    content = content.call(this.elements.target, cache.event, this) || ""
                }
                if ($.isFunction(content.then)) {
                    cache.waiting = TRUE;
                    return content.then(function(c) {
                        cache.waiting = FALSE;
                        return self._update(c, element)
                    }, NULL, function(e) {
                        return self._update(e, element)
                    })
                }
                if (content === FALSE || !content && content !== "") {
                    return FALSE
                }
                if (content.jquery && content.length > 0) {
                    element.children().detach().end().append(content.css({
                        display: "block"
                    }))
                } else {
                    element.html(content)
                }
                cache.waiting = TRUE;
                return ($.fn.imagesLoaded ? element.imagesLoaded() : $.Deferred().resolve($([]))).done(function(images) {
                    cache.waiting = FALSE;
                    if (images.length && self.rendered && self.tooltip[0].offsetWidth > 0) {
                        self.reposition(cache.event, !images.length)
                    }
                }).promise()
            };
            PROTOTYPE._updateContent = function(content, reposition) {
                this._update(content, this.elements.content, reposition)
            };
            PROTOTYPE._updateTitle = function(content, reposition) {
                if (this._update(content, this.elements.title, reposition) === FALSE) {
                    this._removeTitle(FALSE)
                }
            };
            PROTOTYPE._createTitle = function() {
                var elements = this.elements,
                    id = this._id + "-title";
                if (elements.titlebar) {
                    this._removeTitle()
                }
                elements.titlebar = $("<div />", {
                    "class": NAMESPACE + "-titlebar " + (this.options.style.widget ? createWidgetClass("header") : "")
                }).append(elements.title = $("<div />", {
                    id: id,
                    "class": NAMESPACE + "-title",
                    "aria-atomic": TRUE
                })).insertBefore(elements.content).delegate(".qtip-close", "mousedown keydown mouseup keyup mouseout", function(event) {
                    $(this).toggleClass("ui-state-active ui-state-focus", event.type.substr(-4) === "down")
                }).delegate(".qtip-close", "mouseover mouseout", function(event) {
                    $(this).toggleClass("ui-state-hover", event.type === "mouseover")
                });
                if (this.options.content.button) {
                    this._createButton()
                }
            };
            PROTOTYPE._removeTitle = function(reposition) {
                var elements = this.elements;
                if (elements.title) {
                    elements.titlebar.remove();
                    elements.titlebar = elements.title = elements.button = NULL;
                    if (reposition !== FALSE) {
                        this.reposition()
                    }
                }
            };
            PROTOTYPE.reposition = function(event, effect) {
                if (!this.rendered || this.positioning || this.destroyed) {
                    return this
                }
                this.positioning = TRUE;
                var cache = this.cache,
                    tooltip = this.tooltip,
                    posOptions = this.options.position,
                    target = posOptions.target,
                    my = posOptions.my,
                    at = posOptions.at,
                    viewport = posOptions.viewport,
                    container = posOptions.container,
                    adjust = posOptions.adjust,
                    method = adjust.method.split(" "),
                    elemWidth = tooltip.outerWidth(FALSE),
                    elemHeight = tooltip.outerHeight(FALSE),
                    targetWidth = 0,
                    targetHeight = 0,
                    type = tooltip.css("position"),
                    position = {
                        left: 0,
                        top: 0
                    },
                    visible = tooltip[0].offsetWidth > 0,
                    isScroll = event && event.type === "scroll",
                    win = $(window),
                    doc = container[0].ownerDocument,
                    mouse = this.mouse,
                    pluginCalculations, offset;
                if ($.isArray(target) && target.length === 2) {
                    at = {
                        x: LEFT,
                        y: TOP
                    };
                    position = {
                        left: target[0],
                        top: target[1]
                    }
                } else if (target === "mouse" && (event && event.pageX || cache.event.pageX)) {
                    at = {
                        x: LEFT,
                        y: TOP
                    };
                    event = mouse && mouse.pageX && (adjust.mouse || !event || !event.pageX) ? mouse : (event && (event.type === "resize" || event.type === "scroll") ? cache.event : event && event.pageX && event.type === "mousemove" ? event : (!adjust.mouse || this.options.show.distance) && cache.origin && cache.origin.pageX ? cache.origin : event) || event || cache.event || mouse || {};
                    if (type !== "static") {
                        position = container.offset()
                    }
                    if (doc.body.offsetWidth !== (window.innerWidth || doc.documentElement.clientWidth)) {
                        offset = $(doc.body).offset()
                    }
                    position = {
                        left: event.pageX - position.left + (offset && offset.left || 0),
                        top: event.pageY - position.top + (offset && offset.top || 0)
                    };
                    if (adjust.mouse && isScroll) {
                        position.left -= mouse.scrollX - win.scrollLeft();
                        position.top -= mouse.scrollY - win.scrollTop()
                    }
                } else {
                    if (target === "event" && event && event.target && event.type !== "scroll" && event.type !== "resize") {
                        cache.target = $(event.target)
                    } else if (target !== "event") {
                        cache.target = $(target.jquery ? target : elements.target)
                    }
                    target = cache.target;
                    target = $(target).eq(0);
                    if (target.length === 0) {
                        return this
                    } else if (target[0] === document || target[0] === window) {
                        targetWidth = BROWSER.iOS ? window.innerWidth : target.width();
                        targetHeight = BROWSER.iOS ? window.innerHeight : target.height();
                        if (target[0] === window) {
                            position = {
                                top: (viewport || target).scrollTop(),
                                left: (viewport || target).scrollLeft()
                            }
                        }
                    } else if (PLUGINS.imagemap && target.is("area")) {
                        pluginCalculations = PLUGINS.imagemap(this, target, at, PLUGINS.viewport ? method : FALSE)
                    } else if (PLUGINS.svg && target[0].ownerSVGElement) {
                        pluginCalculations = PLUGINS.svg(this, target, at, PLUGINS.viewport ? method : FALSE)
                    } else {
                        targetWidth = target.outerWidth(FALSE);
                        targetHeight = target.outerHeight(FALSE);
                        position = target.offset()
                    }
                    if (pluginCalculations) {
                        targetWidth = pluginCalculations.width;
                        targetHeight = pluginCalculations.height;
                        offset = pluginCalculations.offset;
                        position = pluginCalculations.position
                    }
                    position = this.reposition.offset(target, position, container);
                    if (BROWSER.iOS > 3.1 && BROWSER.iOS < 4.1 || BROWSER.iOS >= 4.3 && BROWSER.iOS < 4.33 || !BROWSER.iOS && type === "fixed") {
                        position.left -= win.scrollLeft();
                        position.top -= win.scrollTop()
                    }
                    if (!pluginCalculations || pluginCalculations && pluginCalculations.adjustable !== FALSE) {
                        position.left += at.x === RIGHT ? targetWidth : at.x === CENTER ? targetWidth / 2 : 0;
                        position.top += at.y === BOTTOM ? targetHeight : at.y === CENTER ? targetHeight / 2 : 0
                    }
                }
                position.left += adjust.x + (my.x === RIGHT ? -elemWidth : my.x === CENTER ? -elemWidth / 2 : 0);
                position.top += adjust.y + (my.y === BOTTOM ? -elemHeight : my.y === CENTER ? -elemHeight / 2 : 0);
                if (PLUGINS.viewport) {
                    position.adjusted = PLUGINS.viewport(this, position, posOptions, targetWidth, targetHeight, elemWidth, elemHeight);
                    if (offset && position.adjusted.left) {
                        position.left += offset.left
                    }
                    if (offset && position.adjusted.top) {
                        position.top += offset.top
                    }
                } else {
                    position.adjusted = {
                        left: 0,
                        top: 0
                    }
                }
                if (!this._trigger("move", [position, viewport.elem || viewport], event)) {
                    return this
                }
                delete position.adjusted;
                if (effect === FALSE || !visible || isNaN(position.left) || isNaN(position.top) || target === "mouse" || !$.isFunction(posOptions.effect)) {
                    tooltip.css(position)
                } else if ($.isFunction(posOptions.effect)) {
                    posOptions.effect.call(tooltip, this, $.extend({}, position));
                    tooltip.queue(function(next) {
                        $(this).css({
                            opacity: "",
                            height: ""
                        });
                        if (BROWSER.ie) {
                            this.style.removeAttribute("filter")
                        }
                        next()
                    })
                }
                this.positioning = FALSE;
                return this
            };
            PROTOTYPE.reposition.offset = function(elem, pos, container) {
                if (!container[0]) {
                    return pos
                }
                var ownerDocument = $(elem[0].ownerDocument),
                    quirks = !!BROWSER.ie && document.compatMode !== "CSS1Compat",
                    parent = container[0],
                    scrolled, position, parentOffset, overflow;

                function scroll(e, i) {
                    pos.left += i * e.scrollLeft();
                    pos.top += i * e.scrollTop()
                }
                do {
                    if ((position = $.css(parent, "position")) !== "static") {
                        if (position === "fixed") {
                            parentOffset = parent.getBoundingClientRect();
                            scroll(ownerDocument, -1)
                        } else {
                            parentOffset = $(parent).position();
                            parentOffset.left += parseFloat($.css(parent, "borderLeftWidth")) || 0;
                            parentOffset.top += parseFloat($.css(parent, "borderTopWidth")) || 0
                        }
                        pos.left -= parentOffset.left + (parseFloat($.css(parent, "marginLeft")) || 0);
                        pos.top -= parentOffset.top + (parseFloat($.css(parent, "marginTop")) || 0);
                        if (!scrolled && (overflow = $.css(parent, "overflow")) !== "hidden" && overflow !== "visible") {
                            scrolled = $(parent)
                        }
                    }
                } while (parent = parent.offsetParent);
                if (scrolled && (scrolled[0] !== ownerDocument[0] || quirks)) {
                    scroll(scrolled, 1)
                }
                return pos
            };
            var C = (CORNER = PROTOTYPE.reposition.Corner = function(corner, forceY) {
                corner = ("" + corner).replace(/([A-Z])/, " $1").replace(/middle/gi, CENTER).toLowerCase();
                this.x = (corner.match(/left|right/i) || corner.match(/center/) || ["inherit"])[0].toLowerCase();
                this.y = (corner.match(/top|bottom|center/i) || ["inherit"])[0].toLowerCase();
                this.forceY = !!forceY;
                var f = corner.charAt(0);
                this.precedance = f === "t" || f === "b" ? Y : X
            }).prototype;
            C.invert = function(z, center) {
                this[z] = this[z] === LEFT ? RIGHT : this[z] === RIGHT ? LEFT : center || this[z]
            };
            C.string = function() {
                var x = this.x,
                    y = this.y;
                return x === y ? x : this.precedance === Y || this.forceY && y !== "center" ? y + " " + x : x + " " + y
            };
            C.abbrev = function() {
                var result = this.string().split(" ");
                return result[0].charAt(0) + (result[1] && result[1].charAt(0) || "")
            };
            C.clone = function() {
                return new CORNER(this.string(), this.forceY)
            };
            PROTOTYPE.toggle = function(state, event) {
                var cache = this.cache,
                    options = this.options,
                    tooltip = this.tooltip;
                if (event) {
                    if (/over|enter/.test(event.type) && /out|leave/.test(cache.event.type) && options.show.target.add(event.target).length === options.show.target.length && tooltip.has(event.relatedTarget).length) {
                        return this
                    }
                    cache.event = $.extend({}, event)
                }
                this.waiting && !state && (this.hiddenDuringWait = TRUE);
                if (!this.rendered) {
                    return state ? this.render(1) : this
                } else if (this.destroyed || this.disabled) {
                    return this
                }
                var type = state ? "show" : "hide",
                    opts = this.options[type],
                    otherOpts = this.options[!state ? "show" : "hide"],
                    posOptions = this.options.position,
                    contentOptions = this.options.content,
                    width = this.tooltip.css("width"),
                    visible = this.tooltip[0].offsetWidth > 0,
                    animate = state || opts.target.length === 1,
                    sameTarget = !event || opts.target.length < 2 || cache.target[0] === event.target,
                    identicalState, allow, showEvent, delay;
                if ((typeof state).search("boolean|number")) {
                    state = !visible
                }
                identicalState = !tooltip.is(":animated") && visible === state && sameTarget;
                allow = !identicalState ? !!this._trigger(type, [90]) : NULL;
                if (allow !== FALSE && state) {
                    this.focus(event)
                }
                if (!allow || identicalState) {
                    return this
                }
                $.attr(tooltip[0], "aria-hidden", !!!state);
                if (state) {
                    cache.origin = $.extend({}, this.mouse);
                    if ($.isFunction(contentOptions.text)) {
                        this._updateContent(contentOptions.text, FALSE)
                    }
                    if ($.isFunction(contentOptions.title)) {
                        this._updateTitle(contentOptions.title, FALSE);
                    }
                    if (!trackingBound && posOptions.target === "mouse" && posOptions.adjust.mouse) {
                        $(document).bind("mousemove." + NAMESPACE, this._storeMouse);
                        trackingBound = TRUE
                    }
                    if (!width) {
                        tooltip.css("width", tooltip.outerWidth(FALSE))
                    }
                    this.reposition(event, arguments[2]);
                    if (!width) {
                        tooltip.css("width", "")
                    }
                    if (!!opts.solo) {
                        (typeof opts.solo === "string" ? $(opts.solo) : $(SELECTOR, opts.solo)).not(tooltip).not(opts.target).qtip("hide", $.Event("tooltipsolo"))
                    }
                } else {
                    clearTimeout(this.timers.show);
                    delete cache.origin;
                    if (trackingBound && !$(SELECTOR + '[tracking="true"]:visible', opts.solo).not(tooltip).length) {
                        $(document).unbind("mousemove." + NAMESPACE);
                        trackingBound = FALSE
                    }
                    this.blur(event)
                }
                after = $.proxy(function() {
                    if (state) {
                        if (BROWSER.ie) {
                            tooltip[0].style.removeAttribute("filter")
                        }
                        tooltip.css("overflow", "");
                        if ("string" === typeof opts.autofocus) {
                            $(this.options.show.autofocus, tooltip).focus()
                        }
                        this.options.show.target.trigger("qtip-" + this.id + "-inactive")
                    } else {
                        tooltip.css({
                            display: "",
                            visibility: "",
                            opacity: "",
                            left: "",
                            top: ""
                        })
                    }
                    this._trigger(state ? "visible" : "hidden")
                }, this);
                if (opts.effect === FALSE || animate === FALSE) {
                    tooltip[type]();
                    after()
                } else if ($.isFunction(opts.effect)) {
                    tooltip.stop(1, 1);
                    opts.effect.call(tooltip, this);
                    tooltip.queue("fx", function(n) {
                        after();
                        n()
                    })
                } else {
                    tooltip.fadeTo(90, state ? 1 : 0, after)
                }
                if (state) {
                    opts.target.trigger("qtip-" + this.id + "-inactive")
                }
                return this
            };
            PROTOTYPE.show = function(event) {
                return this.toggle(TRUE, event)
            };
            PROTOTYPE.hide = function(event) {
                return this.toggle(FALSE, event)
            };
            PROTOTYPE.focus = function(event) {
                if (!this.rendered || this.destroyed) {
                    return this
                }
                var qtips = $(SELECTOR),
                    tooltip = this.tooltip,
                    curIndex = parseInt(tooltip[0].style.zIndex, 10),
                    newIndex = QTIP.zindex + qtips.length,
                    focusedElem;
                if (!tooltip.hasClass(CLASS_FOCUS)) {
                    if (this._trigger("focus", [newIndex], event)) {
                        if (curIndex !== newIndex) {
                            qtips.each(function() {
                                if (this.style.zIndex > curIndex) {
                                    this.style.zIndex = this.style.zIndex - 1
                                }
                            });
                            qtips.filter("." + CLASS_FOCUS).qtip("blur", event)
                        }
                        tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex
                    }
                }
                return this
            };
            PROTOTYPE.blur = function(event) {
                if (!this.rendered || this.destroyed) {
                    return this
                }
                this.tooltip.removeClass(CLASS_FOCUS);
                this._trigger("blur", [this.tooltip.css("zIndex")], event);
                return this
            };
            PROTOTYPE.disable = function(state) {
                if (this.destroyed) {
                    return this
                }
                if ("boolean" !== typeof state) {
                    state = !(this.tooltip.hasClass(CLASS_DISABLED) || this.disabled)
                }
                if (this.rendered) {
                    this.tooltip.toggleClass(CLASS_DISABLED, state).attr("aria-disabled", state)
                }
                this.disabled = !!state;
                return this
            };
            PROTOTYPE.enable = function() {
                return this.disable(FALSE)
            };
            PROTOTYPE._createButton = function() {
                var self = this,
                    elements = this.elements,
                    tooltip = elements.tooltip,
                    button = this.options.content.button,
                    isString = typeof button === "string",
                    close = isString ? button : "Close tooltip";
                if (elements.button) {
                    elements.button.remove()
                }
                if (button.jquery) {
                    elements.button = button
                } else {
                    elements.button = $("<a />", {
                        "class": "qtip-close " + (this.options.style.widget ? "" : NAMESPACE + "-icon"),
                        title: close,
                        "aria-label": close
                    }).prepend($("<span />", {
                        "class": "ui-icon ui-icon-close",
                        html: "&times;"
                    }))
                }
                elements.button.appendTo(elements.titlebar || tooltip).attr("role", "button").click(function(event) {
                    if (!tooltip.hasClass(CLASS_DISABLED)) {
                        self.hide(event)
                    }
                    return FALSE
                })
            };
            PROTOTYPE._updateButton = function(button) {
                if (!this.rendered) {
                    return FALSE
                }
                var elem = this.elements.button;
                if (button) {
                    this._createButton()
                } else {
                    elem.remove()
                }
            };

            function createWidgetClass(cls) {
                return WIDGET.concat("").join(cls ? "-" + cls + " " : " ")
            }
            PROTOTYPE._setWidget = function() {
                var on = this.options.style.widget,
                    elements = this.elements,
                    tooltip = elements.tooltip,
                    disabled = tooltip.hasClass(CLASS_DISABLED);
                tooltip.removeClass(CLASS_DISABLED);
                CLASS_DISABLED = on ? "ui-state-disabled" : "qtip-disabled";
                tooltip.toggleClass(CLASS_DISABLED, disabled);
                tooltip.toggleClass("ui-helper-reset " + createWidgetClass(), on).toggleClass(CLASS_DEFAULT, this.options.style.def && !on);
                if (elements.content) {
                    elements.content.toggleClass(createWidgetClass("content"), on)
                }
                if (elements.titlebar) {
                    elements.titlebar.toggleClass(createWidgetClass("header"), on)
                }
                if (elements.button) {
                    elements.button.toggleClass(NAMESPACE + "-icon", !on)
                }
            };

            function showMethod(event) {
                if (this.tooltip.hasClass(CLASS_DISABLED)) {
                    return FALSE
                }
                clearTimeout(this.timers.show);
                clearTimeout(this.timers.hide);
                var callback = $.proxy(function() {
                    this.toggle(TRUE, event)
                }, this);
                if (this.options.show.delay > 0) {
                    this.timers.show = setTimeout(callback, this.options.show.delay)
                } else {
                    callback()
                }
            }

            function hideMethod(event) {
                if (this.tooltip.hasClass(CLASS_DISABLED)) {
                    return FALSE
                }
                var relatedTarget = $(event.relatedTarget),
                    ontoTooltip = relatedTarget.closest(SELECTOR)[0] === this.tooltip[0],
                    ontoTarget = relatedTarget[0] === this.options.show.target[0];
                clearTimeout(this.timers.show);
                clearTimeout(this.timers.hide);
                if (this !== relatedTarget[0] && (this.options.position.target === "mouse" && ontoTooltip) || this.options.hide.fixed && (/mouse(out|leave|move)/.test(event.type) && (ontoTooltip || ontoTarget))) {
                    try {
                        event.preventDefault();
                        event.stopImmediatePropagation()
                    } catch (e) {}
                    return
                }
                var callback = $.proxy(function() {
                    this.toggle(FALSE, event)
                }, this);
                if (this.options.hide.delay > 0) {
                    this.timers.hide = setTimeout(callback, this.options.hide.delay)
                } else {
                    callback()
                }
            }

            function inactiveMethod(event) {
                if (this.tooltip.hasClass(CLASS_DISABLED) || !this.options.hide.inactive) {
                    return FALSE
                }
                clearTimeout(this.timers.inactive);
                this.timers.inactive = setTimeout($.proxy(function() {
                    this.hide(event)
                }, this), this.options.hide.inactive)
            }

            function repositionMethod(event) {
                if (this.rendered && this.tooltip[0].offsetWidth > 0) {
                    this.reposition(event)
                }
            }
            PROTOTYPE._storeMouse = function(event) {
                this.mouse = {
                    pageX: event.pageX,
                    pageY: event.pageY,
                    type: "mousemove",
                    scrollX: window.pageXOffset || document.body.scrollLeft || document.documentElement.scrollLeft,
                    scrollY: window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop
                }
            };
            PROTOTYPE._bind = function(targets, events, method, suffix, context) {
                var ns = "." + this._id + (suffix ? "-" + suffix : "");
                events.length && $(targets).bind((events.split ? events : events.join(ns + " ")) + ns, $.proxy(method, context || this))
            };
            PROTOTYPE._unbind = function(targets, suffix) {
                $(targets).unbind("." + this._id + (suffix ? "-" + suffix : ""))
            };
            var ns = "." + NAMESPACE;

            function delegate(selector, events, method) {
                $(document.body).delegate(selector, (events.split ? events : events.join(ns + " ")) + ns, function() {
                    var api = QTIP.api[$.attr(this, ATTR_ID)];
                    api && !api.disabled && method.apply(api, arguments)
                })
            }
            $(function() {
                delegate(SELECTOR, ["mouseenter", "mouseleave"], function(event) {
                    var state = event.type === "mouseenter",
                        tooltip = $(event.currentTarget),
                        target = $(event.relatedTarget || event.target),
                        options = this.options;
                    if (state) {
                        this.focus(event);
                        tooltip.hasClass(CLASS_FIXED) && !tooltip.hasClass(CLASS_DISABLED) && clearTimeout(this.timers.hide)
                    } else {
                        if (options.position.target === "mouse" && options.hide.event && options.show.target && !target.closest(options.show.target[0]).length) {
                            this.hide(event)
                        }
                    }
                    tooltip.toggleClass(CLASS_HOVER, state)
                });
                delegate("[" + ATTR_ID + "]", INACTIVE_EVENTS, inactiveMethod)
            });
            PROTOTYPE._trigger = function(type, args, event) {
                var callback = $.Event("tooltip" + type);
                callback.originalEvent = event && $.extend({}, event) || this.cache.event || NULL;
                this.triggering = TRUE;
                this.tooltip.trigger(callback, [this].concat(args || []));
                this.triggering = FALSE;
                return !callback.isDefaultPrevented()
            };
            PROTOTYPE._assignEvents = function() {
                var options = this.options,
                    posOptions = options.position,
                    tooltip = this.tooltip,
                    showTarget = options.show.target,
                    hideTarget = options.hide.target,
                    containerTarget = posOptions.container,
                    viewportTarget = posOptions.viewport,
                    documentTarget = $(document),
                    bodyTarget = $(document.body),
                    windowTarget = $(window),
                    showEvents = options.show.event ? $.trim("" + options.show.event).split(" ") : [],
                    hideEvents = options.hide.event ? $.trim("" + options.hide.event).split(" ") : [],
                    toggleEvents = [];
                if (/mouse(out|leave)/i.test(options.hide.event) && options.hide.leave === "window") {
                    this._bind(documentTarget, ["mouseout", "blur"], function(event) {
                        if (!/select|option/.test(event.target.nodeName) && !event.relatedTarget) {
                            this.hide(event)
                        }
                    })
                }
                if (options.hide.fixed) {
                    hideTarget = hideTarget.add(tooltip.addClass(CLASS_FIXED))
                } else if (/mouse(over|enter)/i.test(options.show.event)) {
                    this._bind(hideTarget, "mouseleave", function() {
                        clearTimeout(this.timers.show)
                    })
                }
                if (("" + options.hide.event).indexOf("unfocus") > -1) {
                    this._bind(containerTarget.closest("html"), ["mousedown", "touchstart"], function(event) {
                        var elem = $(event.target),
                            enabled = this.rendered && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0,
                            isAncestor = elem.parents(SELECTOR).filter(this.tooltip[0]).length > 0;
                        if (elem[0] !== this.target[0] && elem[0] !== this.tooltip[0] && !isAncestor && !this.target.has(elem[0]).length && enabled) {
                            this.hide(event)
                        }
                    })
                }
                if ("number" === typeof options.hide.inactive) {
                    this._bind(showTarget, "qtip-" + this.id + "-inactive", inactiveMethod);
                    this._bind(hideTarget.add(tooltip), QTIP.inactiveEvents, inactiveMethod, "-inactive")
                }
                hideEvents = $.map(hideEvents, function(type) {
                    var showIndex = $.inArray(type, showEvents);
                    if (showIndex > -1 && hideTarget.add(showTarget).length === hideTarget.length) {
                        toggleEvents.push(showEvents.splice(showIndex, 1)[0]);
                        return
                    }
                    return type
                });
                this._bind(showTarget, showEvents, showMethod);
                this._bind(hideTarget, hideEvents, hideMethod);
                this._bind(showTarget, toggleEvents, function(event) {
                    (this.tooltip[0].offsetWidth > 0 ? hideMethod : showMethod).call(this, event)
                });
                this._bind(showTarget.add(tooltip), "mousemove", function(event) {
                    if ("number" === typeof options.hide.distance) {
                        var origin = this.cache.origin || {},
                            limit = this.options.hide.distance,
                            abs = Math.abs;
                        if (abs(event.pageX - origin.pageX) >= limit || abs(event.pageY - origin.pageY) >= limit) {
                            this.hide(event)
                        }
                    }
                    this._storeMouse(event)
                });
                if (posOptions.target === "mouse") {
                    if (posOptions.adjust.mouse) {
                        if (options.hide.event) {
                            this._bind(showTarget, ["mouseenter", "mouseleave"], function(event) {
                                this.cache.onTarget = event.type === "mouseenter"
                            })
                        }
                        this._bind(documentTarget, "mousemove", function(event) {
                            if (this.rendered && this.cache.onTarget && !this.tooltip.hasClass(CLASS_DISABLED) && this.tooltip[0].offsetWidth > 0) {
                                this.reposition(event)
                            }
                        })
                    }
                }
                if (posOptions.adjust.resize || viewportTarget.length) {
                    this._bind($.event.special.resize ? viewportTarget : windowTarget, "resize", repositionMethod)
                }
                if (posOptions.adjust.scroll) {
                    this._bind(windowTarget.add(posOptions.container), "scroll", repositionMethod)
                }
            };
            PROTOTYPE._unassignEvents = function() {
                var targets = [this.options.show.target[0], this.options.hide.target[0], this.rendered && this.tooltip[0], this.options.position.container[0], this.options.position.viewport[0], this.options.position.container.closest("html")[0], window, document];
                if (this.rendered) {
                    this._unbind($([]).pushStack($.grep(targets, function(i) {
                        return typeof i === "object"
                    })))
                } else {
                    $(targets[0]).unbind("." + this._id + "-create")
                }
            };

            function init(elem, id, opts) {
                var obj, posOptions, attr, config, title, docBody = $(document.body),
                    newTarget = elem[0] === document ? docBody : elem,
                    metadata = elem.metadata ? elem.metadata(opts.metadata) : NULL,
                    metadata5 = opts.metadata.type === "html5" && metadata ? metadata[opts.metadata.name] : NULL,
                    html5 = elem.data(opts.metadata.name || "qtipopts");
                try {
                    html5 = typeof html5 === "string" ? $.parseJSON(html5) : html5
                } catch (e) {}
                config = $.extend(TRUE, {}, QTIP.defaults, opts, typeof html5 === "object" ? sanitizeOptions(html5) : NULL, sanitizeOptions(metadata5 || metadata));
                posOptions = config.position;
                config.id = id;
                if ("boolean" === typeof config.content.text) {
                    attr = elem.attr(config.content.attr);
                    if (config.content.attr !== FALSE && attr) {
                        config.content.text = attr
                    } else {
                        return FALSE
                    }
                }
                if (!posOptions.container.length) {
                    posOptions.container = docBody
                }
                if (posOptions.target === FALSE) {
                    posOptions.target = newTarget
                }
                if (config.show.target === FALSE) {
                    config.show.target = newTarget
                }
                if (config.show.solo === TRUE) {
                    config.show.solo = posOptions.container.closest("body")
                }
                if (config.hide.target === FALSE) {
                    config.hide.target = newTarget
                }
                if (config.position.viewport === TRUE) {
                    config.position.viewport = posOptions.container
                }
                posOptions.container = posOptions.container.eq(0);
                posOptions.at = new CORNER(posOptions.at, TRUE);
                posOptions.my = new CORNER(posOptions.my);
                if (elem.data(NAMESPACE)) {
                    if (config.overwrite) {
                        elem.qtip("destroy")
                    } else if (config.overwrite === FALSE) {
                        return FALSE
                    }
                }
                elem.attr(ATTR_HAS, id);
                if (config.suppress && (title = elem.attr("title"))) {
                    elem.removeAttr("title").attr(oldtitle, title).attr("title", "")
                }
                obj = new QTip(elem, config, id, !!attr);
                elem.data(NAMESPACE, obj);
                elem.one("remove.qtip-" + id + " removeqtip.qtip-" + id, function() {
                    var api;
                    if (api = $(this).data(NAMESPACE)) {
                        api.destroy()
                    }
                });
                return obj
            }
            QTIP = $.fn.qtip = function(options, notation, newValue) {
                var command = ("" + options).toLowerCase(),
                    returned = NULL,
                    args = $.makeArray(arguments).slice(1),
                    event = args[args.length - 1],
                    opts = this[0] ? $.data(this[0], NAMESPACE) : NULL;
                if (!arguments.length && opts || command === "api") {
                    return opts
                } else if ("string" === typeof options) {
                    this.each(function() {
                        var api = $.data(this, NAMESPACE);
                        if (!api) {
                            return TRUE
                        }
                        if (event && event.timeStamp) {
                            api.cache.event = event
                        }
                        if (notation && (command === "option" || command === "options")) {
                            if (newValue !== undefined || $.isPlainObject(notation)) {
                                api.set(notation, newValue)
                            } else {
                                returned = api.get(notation);
                                return FALSE
                            }
                        } else if (api[command]) {
                            api[command].apply(api, args)
                        }
                    });
                    return returned !== NULL ? returned : this
                } else if ("object" === typeof options || !arguments.length) {
                    opts = sanitizeOptions($.extend(TRUE, {}, options));
                    return QTIP.bind.call(this, opts, event)
                }
            };
            QTIP.bind = function(opts, event) {
                return this.each(function(i) {
                    var options, targets, events, namespace, api, id;
                    id = $.isArray(opts.id) ? opts.id[i] : opts.id;
                    id = !id || id === FALSE || id.length < 1 || QTIP.api[id] ? QTIP.nextid++ : id;
                    namespace = ".qtip-" + id + "-create";
                    api = init($(this), id, opts);
                    if (api === FALSE) {
                        return TRUE
                    } else {
                        QTIP.api[id] = api
                    }
                    options = api.options;
                    $.each(PLUGINS, function() {
                        if (this.initialize === "initialize") {
                            this(api)
                        }
                    });
                    targets = {
                        show: options.show.target,
                        hide: options.hide.target
                    };
                    events = {
                        show: $.trim("" + options.show.event).replace(/ /g, namespace + " ") + namespace,
                        hide: $.trim("" + options.hide.event).replace(/ /g, namespace + " ") + namespace
                    };
                    if (/mouse(over|enter)/i.test(events.show) && !/mouse(out|leave)/i.test(events.hide)) {
                        events.hide += " mouseleave" + namespace
                    }
                    targets.show.bind("mousemove" + namespace, function(event) {
                        api._storeMouse(event);
                        api.cache.onTarget = TRUE
                    });

                    function hoverIntent(event) {
                        function render() {
                            api.render(typeof event === "object" || options.show.ready);
                            targets.show.add(targets.hide).unbind(namespace)
                        }
                        if (api.disabled) {
                            return FALSE
                        }
                        api.cache.event = $.extend({}, event);
                        api.cache.target = event ? $(event.target) : [undefined];
                        if (options.show.delay > 0) {
                            clearTimeout(api.timers.show);
                            api.timers.show = setTimeout(render, options.show.delay);
                            if (events.show !== events.hide) {
                                targets.hide.bind(events.hide, function() {
                                    clearTimeout(api.timers.show)
                                })
                            }
                        } else {
                            render()
                        }
                    }
                    targets.show.bind(events.show, hoverIntent);
                    if (options.show.ready || options.prerender) {
                        hoverIntent(event)
                    }
                })
            };
            QTIP.api = {};
            $.each({
                attr: function(attr, val) {
                    if (this.length) {
                        var self = this[0],
                            title = "title",
                            api = $.data(self, "qtip");
                        if (attr === title && api && "object" === typeof api && api.options.suppress) {
                            if (arguments.length < 2) {
                                return $.attr(self, oldtitle)
                            }
                            if (api && api.options.content.attr === title && api.cache.attr) {
                                api.set("content.text", val)
                            }
                            return this.attr(oldtitle, val)
                        }
                    }
                    return $.fn["attr" + replaceSuffix].apply(this, arguments)
                },
                clone: function(keepData) {
                    var titles = $([]),
                        title = "title",
                        elems = $.fn["clone" + replaceSuffix].apply(this, arguments);
                    if (!keepData) {
                        elems.filter("[" + oldtitle + "]").attr("title", function() {
                            return $.attr(this, oldtitle)
                        }).removeAttr(oldtitle)
                    }
                    return elems
                }
            }, function(name, func) {
                if (!func || $.fn[name + replaceSuffix]) {
                    return TRUE
                }
                var old = $.fn[name + replaceSuffix] = $.fn[name];
                $.fn[name] = function() {
                    return func.apply(this, arguments) || old.apply(this, arguments)
                }
            });
            if (!$.ui) {
                $["cleanData" + replaceSuffix] = $.cleanData;
                $.cleanData = function(elems) {
                    for (var i = 0, elem;
                        (elem = $(elems[i])).length; i++) {
                        if (elem.attr(ATTR_HAS)) {
                            try {
                                elem.triggerHandler("removeqtip")
                            } catch (e) {}
                        }
                    }
                    $["cleanData" + replaceSuffix].apply(this, arguments)
                }
            }
            QTIP.version = "2.1.1";
            QTIP.nextid = 0;
            QTIP.inactiveEvents = INACTIVE_EVENTS;
            QTIP.zindex = 15e3;
            QTIP.defaults = {
                prerender: FALSE,
                id: FALSE,
                overwrite: TRUE,
                suppress: TRUE,
                content: {
                    text: TRUE,
                    attr: "title",
                    title: FALSE,
                    button: FALSE
                },
                position: {
                    my: "top left",
                    at: "bottom right",
                    target: FALSE,
                    container: FALSE,
                    viewport: FALSE,
                    adjust: {
                        x: 0,
                        y: 0,
                        mouse: TRUE,
                        scroll: TRUE,
                        resize: TRUE,
                        method: "flipinvert flipinvert"
                    },
                    effect: function(api, pos, viewport) {
                        $(this).animate(pos, {
                            duration: 200,
                            queue: FALSE
                        })
                    }
                },
                show: {
                    target: FALSE,
                    event: "mouseenter",
                    effect: TRUE,
                    delay: 90,
                    solo: FALSE,
                    ready: FALSE,
                    autofocus: FALSE
                },
                hide: {
                    target: FALSE,
                    event: "mouseleave",
                    effect: TRUE,
                    delay: 0,
                    fixed: FALSE,
                    inactive: FALSE,
                    leave: "window",
                    distance: FALSE
                },
                style: {
                    classes: "",
                    widget: FALSE,
                    width: FALSE,
                    height: FALSE,
                    def: TRUE
                },
                events: {
                    render: NULL,
                    move: NULL,
                    show: NULL,
                    hide: NULL,
                    toggle: NULL,
                    visible: NULL,
                    hidden: NULL,
                    focus: NULL,
                    blur: NULL
                }
            };
            var TIP, TIPNS = ".qtip-tip",
                MARGIN = "margin",
                BORDER = "border",
                COLOR = "color",
                BG_COLOR = "background-color",
                TRANSPARENT = "transparent",
                IMPORTANT = " !important",
                HASCANVAS = !!document.createElement("canvas").getContext,
                INVALID = /rgba?\(0, 0, 0(, 0)?\)|transparent|#123456/i;

            function camel(s) {
                return s.charAt(0).toUpperCase() + s.slice(1)
            }
            var cssProps = {},
                cssPrefixes = ["Webkit", "O", "Moz", "ms"];

            function vendorCss(elem, prop) {
                var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1),
                    props = (prop + " " + cssPrefixes.join(ucProp + " ") + ucProp).split(" "),
                    cur, val, i = 0;
                if (cssProps[prop]) {
                    return elem.css(cssProps[prop])
                }
                while (cur = props[i++]) {
                    if ((val = elem.css(cur)) !== undefined) {
                        return cssProps[prop] = cur, val
                    }
                }
            }

            function intCss(elem, prop) {
                return parseInt(vendorCss(elem, prop), 10)
            }
            if (!HASCANVAS) {
                createVML = function(tag, props, style) {
                    return "<qtipvml:" + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="qtip-vml" ' + (props || "") + ' style="behavior: url(#default#VML); ' + (style || "") + '" />'
                }
            }

            function Tip(qtip, options) {
                this._ns = "tip";
                this.options = options;
                this.offset = options.offset;
                this.size = [options.width, options.height];
                this.init(this.qtip = qtip)
            }
            $.extend(Tip.prototype, {
                init: function(qtip) {
                    var context, tip;
                    tip = this.element = qtip.elements.tip = $("<div />", {
                        "class": NAMESPACE + "-tip"
                    }).prependTo(qtip.tooltip);
                    if (HASCANVAS) {
                        context = $("<canvas />").appendTo(this.element)[0].getContext("2d");
                        context.lineJoin = "miter";
                        context.miterLimit = 100;
                        context.save()
                    } else {
                        context = createVML("shape", 'coordorigin="0,0"', "position:absolute;");
                        this.element.html(context + context);
                        qtip._bind($("*", tip).add(tip), ["click", "mousedown"], function(event) {
                            event.stopPropagation()
                        }, this._ns)
                    }
                    qtip._bind(qtip.tooltip, "tooltipmove", this.reposition, this._ns, this);
                    this.create()
                },
                _swapDimensions: function() {
                    this.size[0] = this.options.height;
                    this.size[1] = this.options.width
                },
                _resetDimensions: function() {
                    this.size[0] = this.options.width;
                    this.size[1] = this.options.height
                },
                _useTitle: function(corner) {
                    var titlebar = this.qtip.elements.titlebar;
                    return titlebar && (corner.y === TOP || corner.y === CENTER && this.element.position().top + this.size[1] / 2 + this.options.offset < titlebar.outerHeight(TRUE))
                },
                _parseCorner: function(corner) {
                    var my = this.qtip.options.position.my;
                    if (corner === FALSE || my === FALSE) {
                        corner = FALSE
                    } else if (corner === TRUE) {
                        corner = new CORNER(my.string())
                    } else if (!corner.string) {
                        corner = new CORNER(corner);
                        corner.fixed = TRUE
                    }
                    return corner
                },
                _parseWidth: function(corner, side, use) {
                    var elements = this.qtip.elements,
                        prop = BORDER + camel(side) + "Width";
                    return (use ? intCss(use, prop) : intCss(elements.content, prop) || intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) || intCss(tooltip, prop)) || 0
                },
                _parseRadius: function(corner) {
                    var elements = this.qtip.elements,
                        prop = BORDER + camel(corner.y) + camel(corner.x) + "Radius";
                    return BROWSER.ie < 9 ? 0 : intCss(this._useTitle(corner) && elements.titlebar || elements.content, prop) || intCss(elements.tooltip, prop) || 0
                },
                _invalidColour: function(elem, prop, compare) {
                    var val = elem.css(prop);
                    return !val || compare && val === elem.css(compare) || INVALID.test(val) ? FALSE : val
                },
                _parseColours: function(corner) {
                    var elements = this.qtip.elements,
                        tip = this.element.css("cssText", ""),
                        borderSide = BORDER + camel(corner[corner.precedance]) + camel(COLOR),
                        colorElem = this._useTitle(corner) && elements.titlebar || elements.content,
                        css = this._invalidColour,
                        color = [];
                    color[0] = css(tip, BG_COLOR) || css(colorElem, BG_COLOR) || css(elements.content, BG_COLOR) || css(tooltip, BG_COLOR) || tip.css(BG_COLOR);
                    color[1] = css(tip, borderSide, COLOR) || css(colorElem, borderSide, COLOR) || css(elements.content, borderSide, COLOR) || css(tooltip, borderSide, COLOR) || tooltip.css(borderSide);
                    $("*", tip).add(tip).css("cssText", BG_COLOR + ":" + TRANSPARENT + IMPORTANT + ";" + BORDER + ":0" + IMPORTANT + ";");
                    return color
                },
                _calculateSize: function(corner) {
                    var y = corner.precedance === Y,
                        width = this.options[y ? "height" : "width"],
                        height = this.options[y ? "width" : "height"],
                        isCenter = corner.abbrev() === "c",
                        base = width * (isCenter ? .5 : 1),
                        pow = Math.pow,
                        round = Math.round,
                        bigHyp, ratio, result, smallHyp = Math.sqrt(pow(base, 2) + pow(height, 2)),
                        hyp = [this.border / base * smallHyp, this.border / height * smallHyp];
                    hyp[2] = Math.sqrt(pow(hyp[0], 2) - pow(this.border, 2));
                    hyp[3] = Math.sqrt(pow(hyp[1], 2) - pow(this.border, 2));
                    bigHyp = smallHyp + hyp[2] + hyp[3] + (isCenter ? 0 : hyp[0]);
                    ratio = bigHyp / smallHyp;
                    result = [round(ratio * width), round(ratio * height)];
                    return y ? result : result.reverse()
                },
                _calculateTip: function(corner) {
                    var width = this.size[0],
                        height = this.size[1],
                        width2 = Math.ceil(width / 2),
                        height2 = Math.ceil(height / 2),
                        tips = {
                            br: [0, 0, width, height, width, 0],
                            bl: [0, 0, width, 0, 0, height],
                            tr: [0, height, width, 0, width, height],
                            tl: [0, 0, 0, height, width, height],
                            tc: [0, height, width2, 0, width, height],
                            bc: [0, 0, width, 0, width2, height],
                            rc: [0, 0, width, height2, 0, height],
                            lc: [width, 0, width, height, 0, height2]
                        };
                    tips.lt = tips.br;
                    tips.rt = tips.bl;
                    tips.lb = tips.tr;
                    tips.rb = tips.tl;
                    return tips[corner.abbrev()]
                },
                create: function() {
                    var c = this.corner = (HASCANVAS || BROWSER.ie) && this._parseCorner(this.options.corner);
                    if (this.enabled = !!this.corner && this.corner.abbrev() !== "c") {
                        this.qtip.cache.corner = c.clone();
                        this.update()
                    }
                    this.element.toggle(this.enabled);
                    return this.corner
                },
                update: function(corner, position) {
                    if (!this.enabled) {
                        return this
                    }
                    var elements = this.qtip.elements,
                        tip = this.element,
                        inner = tip.children(),
                        options = this.options,
                        size = this.size,
                        mimic = options.mimic,
                        round = Math.round,
                        color, precedance, context, coords, translate, newSize, border;
                    if (!corner) {
                        corner = this.qtip.cache.corner || this.corner
                    }
                    if (mimic === FALSE) {
                        mimic = corner
                    } else {
                        mimic = new CORNER(mimic);
                        mimic.precedance = corner.precedance;
                        if (mimic.x === "inherit") {
                            mimic.x = corner.x
                        } else if (mimic.y === "inherit") {
                            mimic.y = corner.y
                        } else if (mimic.x === mimic.y) {
                            mimic[corner.precedance] = corner[corner.precedance]
                        }
                    }
                    precedance = mimic.precedance;
                    if (corner.precedance === X) {
                        this._swapDimensions()
                    } else {
                        this._resetDimensions()
                    }
                    color = this.color = this._parseColours(corner);
                    if (color[1] !== TRANSPARENT) {
                        border = this.border = this._parseWidth(corner, corner[corner.precedance]);
                        if (options.border && border < 1) {
                            color[0] = color[1]
                        }
                        this.border = border = options.border !== TRUE ? options.border : border
                    } else {
                        this.border = border = 0
                    }
                    coords = this._calculateTip(mimic);
                    newSize = this.size = this._calculateSize(corner);
                    tip.css({
                        width: newSize[0],
                        height: newSize[1],
                        lineHeight: newSize[1] + "px"
                    });
                    if (corner.precedance === Y) {
                        translate = [round(mimic.x === LEFT ? border : mimic.x === RIGHT ? newSize[0] - size[0] - border : (newSize[0] - size[0]) / 2), round(mimic.y === TOP ? newSize[1] - size[1] : 0)]
                    } else {
                        translate = [round(mimic.x === LEFT ? newSize[0] - size[0] : 0), round(mimic.y === TOP ? border : mimic.y === BOTTOM ? newSize[1] - size[1] - border : (newSize[1] - size[1]) / 2)]
                    }
                    if (HASCANVAS) {
                        inner.attr(WIDTH, newSize[0]).attr(HEIGHT, newSize[1]);
                        context = inner[0].getContext("2d");
                        context.restore();
                        context.save();
                        context.clearRect(0, 0, 3e3, 3e3);
                        context.fillStyle = color[0];
                        context.strokeStyle = color[1];
                        context.lineWidth = border * 2;
                        context.translate(translate[0], translate[1]);
                        context.beginPath();
                        context.moveTo(coords[0], coords[1]);
                        context.lineTo(coords[2], coords[3]);
                        context.lineTo(coords[4], coords[5]);
                        context.closePath();
                        if (border) {
                            if (tooltip.css("background-clip") === "border-box") {
                                context.strokeStyle = color[0];
                                context.stroke()
                            }
                            context.strokeStyle = color[1];
                            context.stroke()
                        }
                        context.fill()
                    } else {
                        coords = "m" + coords[0] + "," + coords[1] + " l" + coords[2] + "," + coords[3] + " " + coords[4] + "," + coords[5] + " xe";
                        translate[2] = border && /^(r|b)/i.test(corner.string()) ? BROWSER.ie === 8 ? 2 : 1 : 0;
                        inner.css({
                            coordsize: size[0] + border + " " + (size[1] + border),
                            antialias: "" + (mimic.string().indexOf(CENTER) > -1),
                            left: translate[0] - translate[2] * Number(precedance === X),
                            top: translate[1] - translate[2] * Number(precedance === Y),
                            width: size[0] + border,
                            height: size[1] + border
                        }).each(function(i) {
                            var $this = $(this);
                            $this[$this.prop ? "prop" : "attr"]({
                                coordsize: size[0] + border + " " + (size[1] + border),
                                path: coords,
                                fillcolor: color[0],
                                filled: !!i,
                                stroked: !i
                            }).toggle(!!(border || i));
                            !i && $this.html(createVML("stroke", 'weight="' + border * 2 + 'px" color="' + color[1] + '" miterlimit="1000" joinstyle="miter"'))
                        })
                    }
                    if (position !== FALSE) {
                        this.calculate(corner)
                    }
                },
                calculate: function(corner) {
                    if (!this.enabled) {
                        return FALSE
                    }
                    var self = this,
                        elements = this.qtip.elements,
                        tip = this.element,
                        userOffset = this.options.offset,
                        isWidget = this.qtip.tooltip.hasClass("ui-widget"),
                        position = {},
                        precedance, size, corners;
                    corner = corner || this.corner;
                    precedance = corner.precedance;
                    size = this._calculateSize(corner);
                    corners = [corner.x, corner.y];
                    if (precedance === X) {
                        corners.reverse()
                    }
                    $.each(corners, function(i, side) {
                        var b, bc, br;
                        if (side === CENTER) {
                            b = precedance === Y ? LEFT : TOP;
                            position[b] = "50%";
                            position[MARGIN + "-" + b] = -Math.round(size[precedance === Y ? 0 : 1] / 2) + userOffset
                        } else {
                            b = self._parseWidth(corner, side, elements.tooltip);
                            bc = self._parseWidth(corner, side, elements.content);
                            br = self._parseRadius(corner);
                            position[side] = Math.max(-self.border, i ? bc : userOffset + (br > b ? br : -b))
                        }
                    });
                    position[corner[precedance]] -= size[precedance === X ? 0 : 1];
                    tip.css({
                        margin: "",
                        top: "",
                        bottom: "",
                        left: "",
                        right: ""
                    }).css(position);
                    return position
                },
                reposition: function(event, api, pos, viewport) {
                    if (!this.enabled) {
                        return
                    }
                    var cache = api.cache,
                        newCorner = this.corner.clone(),
                        adjust = pos.adjusted,
                        method = api.options.position.adjust.method.split(" "),
                        horizontal = method[0],
                        vertical = method[1] || method[0],
                        shift = {
                            left: FALSE,
                            top: FALSE,
                            x: 0,
                            y: 0
                        },
                        offset, css = {},
                        props;
                    if (this.corner.fixed !== TRUE) {
                        if (horizontal === SHIFT && newCorner.precedance === X && adjust.left && newCorner.y !== CENTER) {
                            newCorner.precedance = newCorner.precedance === X ? Y : X
                        } else if (horizontal !== SHIFT && adjust.left) {
                            newCorner.x = newCorner.x === CENTER ? adjust.left > 0 ? LEFT : RIGHT : newCorner.x === LEFT ? RIGHT : LEFT
                        }
                        if (vertical === SHIFT && newCorner.precedance === Y && adjust.top && newCorner.x !== CENTER) {
                            newCorner.precedance = newCorner.precedance === Y ? X : Y
                        } else if (vertical !== SHIFT && adjust.top) {
                            newCorner.y = newCorner.y === CENTER ? adjust.top > 0 ? TOP : BOTTOM : newCorner.y === TOP ? BOTTOM : TOP
                        }
                        if (newCorner.string() !== cache.corner.string() && (cache.cornerTop !== adjust.top || cache.cornerLeft !== adjust.left)) {
                            this.update(newCorner, FALSE)
                        }
                    }
                    offset = this.calculate(newCorner, adjust);
                    if (offset.right !== undefined) {
                        offset.left = -offset.right
                    }
                    if (offset.bottom !== undefined) {
                        offset.top = -offset.bottom
                    }
                    offset.user = this.offset;
                    if (shift.left = horizontal === SHIFT && !!adjust.left) {
                        if (newCorner.x === CENTER) {
                            css[MARGIN + "-left"] = shift.x = offset[MARGIN + "-left"] - adjust.left
                        } else {
                            props = offset.right !== undefined ? [adjust.left, -offset.left] : [-adjust.left, offset.left];
                            if ((shift.x = Math.max(props[0], props[1])) > props[0]) {
                                pos.left -= adjust.left;
                                shift.left = FALSE
                            }
                            css[offset.right !== undefined ? RIGHT : LEFT] = shift.x
                        }
                    }
                    if (shift.top = vertical === SHIFT && !!adjust.top) {
                        if (newCorner.y === CENTER) {
                            css[MARGIN + "-top"] = shift.y = offset[MARGIN + "-top"] - adjust.top
                        } else {
                            props = offset.bottom !== undefined ? [adjust.top, -offset.top] : [-adjust.top, offset.top];
                            if ((shift.y = Math.max(props[0], props[1])) > props[0]) {
                                pos.top -= adjust.top;
                                shift.top = FALSE
                            }
                            css[offset.bottom !== undefined ? BOTTOM : TOP] = shift.y
                        }
                    }
                    this.element.css(css).toggle(!(shift.x && shift.y || newCorner.x === CENTER && shift.y || newCorner.y === CENTER && shift.x));
                    pos.left -= offset.left.charAt ? offset.user : horizontal !== SHIFT || shift.top || !shift.left && !shift.top ? offset.left : 0;
                    pos.top -= offset.top.charAt ? offset.user : vertical !== SHIFT || shift.left || !shift.left && !shift.top ? offset.top : 0;
                    cache.cornerLeft = adjust.left;
                    cache.cornerTop = adjust.top;
                    cache.corner = newCorner.clone()
                },
                destroy: function() {
                    this.qtip._unbind(this.qtip.tooltip, this._ns);
                    if (this.qtip.elements.tip) {
                        this.qtip.elements.tip.find("*").remove().end().remove()
                    }
                }
            });
            TIP = PLUGINS.tip = function(api) {
                return new Tip(api, api.options.style.tip)
            };
            TIP.initialize = "render";
            TIP.sanitize = function(options) {
                if (options.style && "tip" in options.style) {
                    opts = options.style.tip;
                    if (typeof opts !== "object") {
                        opts = options.style.tip = {
                            corner: opts
                        }
                    }
                    if (!/string|boolean/i.test(typeof opts.corner)) {
                        opts.corner = TRUE
                    }
                }
            };
            CHECKS.tip = {
                "^position.my|style.tip.(corner|mimic|border)$": function() {
                    this.create();
                    this.qtip.reposition()
                },
                "^style.tip.(height|width)$": function(obj) {
                    this.size = size = [obj.width, obj.height];
                    this.update();
                    this.qtip.reposition()
                },
                "^content.title|style.(classes|widget)$": function() {
                    this.update()
                }
            };
            $.extend(TRUE, QTIP.defaults, {
                style: {
                    tip: {
                        corner: TRUE,
                        mimic: FALSE,
                        width: 6,
                        height: 6,
                        border: TRUE,
                        offset: 0
                    }
                }
            });
            var MODAL, OVERLAY, MODALCLASS = "qtip-modal",
                MODALSELECTOR = "." + MODALCLASS;
            OVERLAY = function() {
                var self = this,
                    focusableElems = {},
                    current, onLast, prevState, elem;

                function focusable(element) {
                    if ($.expr[":"].focusable) {
                        return $.expr[":"].focusable
                    }
                    var isTabIndexNotNaN = !isNaN($.attr(element, "tabindex")),
                        nodeName = element.nodeName && element.nodeName.toLowerCase(),
                        map, mapName, img;
                    if ("area" === nodeName) {
                        map = element.parentNode;
                        mapName = map.name;
                        if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") {
                            return false
                        }
                        img = $("img[usemap=#" + mapName + "]")[0];
                        return !!img && img.is(":visible")
                    }
                    return /input|select|textarea|button|object/.test(nodeName) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN
                }

                function focusInputs(blurElems) {
                    if (focusableElems.length < 1 && blurElems.length) {
                        blurElems.not("body").blur()
                    } else {
                        focusableElems.first().focus()
                    }
                }

                function stealFocus(event) {
                    if (!elem.is(":visible")) {
                        return
                    }
                    var target = $(event.target),
                        tooltip = current.tooltip,
                        container = target.closest(SELECTOR),
                        targetOnTop;
                    targetOnTop = container.length < 1 ? FALSE : parseInt(container[0].style.zIndex, 10) > parseInt(tooltip[0].style.zIndex, 10);
                    if (!targetOnTop && target.closest(SELECTOR)[0] !== tooltip[0]) {
                        focusInputs(target)
                    }
                    onLast = event.target === focusableElems[focusableElems.length - 1]
                }
                $.extend(self, {
                    init: function() {
                        elem = self.elem = $("<div />", {
                            id: "qtip-overlay",
                            html: "<div></div>",
                            mousedown: function() {
                                return FALSE
                            }
                        }).hide();

                        function resize() {
                            var win = $(this);
                            elem.css({
                                height: win.height(),
                                width: win.width()
                            })
                        }
                        $(window).bind("resize" + MODALSELECTOR, resize);
                        resize();
                        $(document.body).bind("focusin" + MODALSELECTOR, stealFocus);
                        $(document).bind("keydown" + MODALSELECTOR, function(event) {
                            if (current && current.options.show.modal.escape && event.keyCode === 27) {
                                current.hide(event)
                            }
                        });
                        elem.bind("click" + MODALSELECTOR, function(event) {
                            if (current && current.options.show.modal.blur) {
                                current.hide(event)
                            }
                        });
                        return self
                    },
                    update: function(api) {
                        current = api;
                        if (api.options.show.modal.stealfocus !== FALSE) {
                            focusableElems = api.tooltip.find("*").filter(function() {
                                return focusable(this)
                            })
                        } else {
                            focusableElems = []
                        }
                    },
                    toggle: function(api, state, duration) {
                        var docBody = $(document.body),
                            tooltip = api.tooltip,
                            options = api.options.show.modal,
                            effect = options.effect,
                            type = state ? "show" : "hide",
                            visible = elem.is(":visible"),
                            visibleModals = $(MODALSELECTOR).filter(":visible:not(:animated)").not(tooltip),
                            zindex;
                        self.update(api);
                        if (state && options.stealfocus !== FALSE) {
                            focusInputs($(":focus"))
                        }
                        elem.toggleClass("blurs", options.blur);
                        if (state) {
                            elem.css({
                                left: 0,
                                top: 0
                            }).appendTo(document.body)
                        }
                        if (elem.is(":animated") && visible === state && prevState !== FALSE || !state && visibleModals.length) {
                            return self
                        }
                        elem.stop(TRUE, FALSE);
                        if ($.isFunction(effect)) {
                            effect.call(elem, state)
                        } else if (effect === FALSE) {
                            elem[type]()
                        } else {
                            elem.fadeTo(parseInt(duration, 10) || 90, state ? 1 : 0, function() {
                                if (!state) {
                                    elem.hide()
                                }
                            })
                        }
                        if (!state) {
                            elem.queue(function(next) {
                                elem.css({
                                    left: "",
                                    top: ""
                                });
                                if (!$(MODALSELECTOR).length) {
                                    elem.detach()
                                }
                                next()
                            })
                        }
                        prevState = state;
                        if (current.destroyed) {
                            current = NULL
                        }
                        return self
                    }
                });
                self.init()
            };
            OVERLAY = new OVERLAY;

            function Modal(api, options) {
                this.options = options;
                this._ns = "-modal";
                this.init(this.qtip = api)
            }
            $.extend(Modal.prototype, {
                init: function(qtip) {
                    var tooltip = qtip.tooltip;
                    if (!this.options.on) {
                        return this
                    }
                    qtip.elements.overlay = OVERLAY.elem;
                    tooltip.addClass(MODALCLASS).css("z-index", PLUGINS.modal.zindex + $(MODALSELECTOR).length);
                    qtip._bind(tooltip, ["tooltipshow", "tooltiphide"], function(event, api, duration) {
                        var oEvent = event.originalEvent;
                        if (event.target === tooltip[0]) {
                            if (oEvent && event.type === "tooltiphide" && /mouse(leave|enter)/.test(oEvent.type) && $(oEvent.relatedTarget).closest(overlay[0]).length) {
                                try {
                                    event.preventDefault()
                                } catch (e) {}
                            } else if (!oEvent || oEvent && !oEvent.solo) {
                                this.toggle(event, event.type === "tooltipshow", duration)
                            }
                        }
                    }, this._ns, this);
                    qtip._bind(tooltip, "tooltipfocus", function(event, api) {
                        if (event.isDefaultPrevented() || event.target !== tooltip[0]) {
                            return
                        }
                        var qtips = $(MODALSELECTOR),
                            newIndex = PLUGINS.modal.zindex + qtips.length,
                            curIndex = parseInt(tooltip[0].style.zIndex, 10);
                        OVERLAY.elem[0].style.zIndex = newIndex - 1;
                        qtips.each(function() {
                            if (this.style.zIndex > curIndex) {
                                this.style.zIndex -= 1
                            }
                        });
                        qtips.filter("." + CLASS_FOCUS).qtip("blur", event.originalEvent);
                        tooltip.addClass(CLASS_FOCUS)[0].style.zIndex = newIndex;
                        OVERLAY.update(api);
                        try {
                            event.preventDefault()
                        } catch (e) {}
                    }, this._ns, this);
                    qtip._bind(tooltip, "tooltiphide", function(event) {
                        if (event.target === tooltip[0]) {
                            $(MODALSELECTOR).filter(":visible").not(tooltip).last().qtip("focus", event)
                        }
                    }, this._ns, this)
                },
                toggle: function(event, state, duration) {
                    if (event && event.isDefaultPrevented()) {
                        return this
                    }
                    OVERLAY.toggle(this.qtip, !!state, duration)
                },
                destroy: function() {
                    this.qtip.tooltip.removeClass(MODALCLASS);
                    this.qtip._unbind(this.qtip.tooltip, this._ns);
                    OVERLAY.toggle(this.qtip, FALSE);
                    delete this.qtip.elements.overlay
                }
            });
            MODAL = PLUGINS.modal = function(api) {
                return new Modal(api, api.options.show.modal)
            };
            MODAL.sanitize = function(opts) {
                if (opts.show) {
                    if (typeof opts.show.modal !== "object") {
                        opts.show.modal = {
                            on: !!opts.show.modal
                        }
                    } else if (typeof opts.show.modal.on === "undefined") {
                        opts.show.modal.on = TRUE
                    }
                }
            };
            MODAL.zindex = QTIP.zindex - 200;
            MODAL.initialize = "render";
            CHECKS.modal = {
                "^show.modal.(on|blur)$": function() {
                    this.destroy();
                    this.init();
                    this.qtip.elems.overlay.toggle(this.qtip.tooltip[0].offsetWidth > 0)
                }
            };
            $.extend(TRUE, QTIP.defaults, {
                show: {
                    modal: {
                        on: FALSE,
                        effect: TRUE,
                        blur: TRUE,
                        stealfocus: TRUE,
                        escape: TRUE
                    }
                }
            });
            PLUGINS.viewport = function(api, position, posOptions, targetWidth, targetHeight, elemWidth, elemHeight) {
                var target = posOptions.target,
                    tooltip = api.elements.tooltip,
                    my = posOptions.my,
                    at = posOptions.at,
                    adjust = posOptions.adjust,
                    method = adjust.method.split(" "),
                    methodX = method[0],
                    methodY = method[1] || method[0],
                    viewport = posOptions.viewport,
                    container = posOptions.container,
                    cache = api.cache,
                    tip = api.plugins.tip,
                    adjusted = {
                        left: 0,
                        top: 0
                    },
                    fixed, newMy, newClass;
                if (!viewport.jquery || target[0] === window || target[0] === document.body || adjust.method === "none") {
                    return adjusted
                }
                fixed = tooltip.css("position") === "fixed";
                viewport = {
                    elem: viewport,
                    width: viewport[0] === window ? viewport.width() : viewport.outerWidth(FALSE),
                    height: viewport[0] === window ? viewport.height() : viewport.outerHeight(FALSE),
                    scrollleft: fixed ? 0 : viewport.scrollLeft(),
                    scrolltop: fixed ? 0 : viewport.scrollTop(),
                    offset: viewport.offset() || {
                        left: 0,
                        top: 0
                    }
                };
                container = {
                    elem: container,
                    scrollLeft: container.scrollLeft(),
                    scrollTop: container.scrollTop(),
                    offset: container.offset() || {
                        left: 0,
                        top: 0
                    }
                };

                function calculate(side, otherSide, type, adjust, side1, side2, lengthName, targetLength, elemLength) {
                    var initialPos = position[side1],
                        mySide = my[side],
                        atSide = at[side],
                        isShift = type === SHIFT,
                        viewportScroll = -container.offset[side1] + viewport.offset[side1] + viewport["scroll" + side1],
                        myLength = mySide === side1 ? elemLength : mySide === side2 ? -elemLength : -elemLength / 2,
                        atLength = atSide === side1 ? targetLength : atSide === side2 ? -targetLength : -targetLength / 2,
                        tipLength = tip && tip.size ? tip.size[lengthName] || 0 : 0,
                        tipAdjust = tip && tip.corner && tip.corner.precedance === side && !isShift ? tipLength : 0,
                        overflow1 = viewportScroll - initialPos + tipAdjust,
                        overflow2 = initialPos + elemLength - viewport[lengthName] - viewportScroll + tipAdjust,
                        offset = myLength - (my.precedance === side || mySide === my[otherSide] ? atLength : 0) - (atSide === CENTER ? targetLength / 2 : 0);
                    if (isShift) {
                        tipAdjust = tip && tip.corner && tip.corner.precedance === otherSide ? tipLength : 0;
                        offset = (mySide === side1 ? 1 : -1) * myLength - tipAdjust;
                        position[side1] += overflow1 > 0 ? overflow1 : overflow2 > 0 ? -overflow2 : 0;
                        position[side1] = Math.max(-container.offset[side1] + viewport.offset[side1] + (tipAdjust && tip.corner[side] === CENTER ? tip.offset : 0), initialPos - offset, Math.min(Math.max(-container.offset[side1] + viewport.offset[side1] + viewport[lengthName], initialPos + offset), position[side1]))
                    } else {
                        adjust *= type === FLIPINVERT ? 2 : 0;
                        if (overflow1 > 0 && (mySide !== side1 || overflow2 > 0)) {
                            position[side1] -= offset + adjust;
                            newMy.invert(side, side1)
                        } else if (overflow2 > 0 && (mySide !== side2 || overflow1 > 0)) {
                            position[side1] -= (mySide === CENTER ? -offset : offset) + adjust;
                            newMy.invert(side, side2)
                        }
                        if (position[side1] < viewportScroll && -position[side1] > overflow2) {
                            position[side1] = initialPos;
                            newMy = my.clone()
                        }
                    }
                    return position[side1] - initialPos
                }
                if (methodX !== "shift" || methodY !== "shift") {
                    newMy = my.clone()
                }
                adjusted = {
                    left: methodX !== "none" ? calculate(X, Y, methodX, adjust.x, LEFT, RIGHT, WIDTH, targetWidth, elemWidth) : 0,
                    top: methodY !== "none" ? calculate(Y, X, methodY, adjust.y, TOP, BOTTOM, HEIGHT, targetHeight, elemHeight) : 0
                };
                if (newMy && cache.lastClass !== (newClass = NAMESPACE + "-pos-" + newMy.abbrev())) {
                    tooltip.removeClass(api.cache.lastClass).addClass(api.cache.lastClass = newClass)
                }
                return adjusted
            };
            PLUGINS.polys = {
                polygon: function(baseCoords, corner) {
                    var result = {
                            width: 0,
                            height: 0,
                            position: {
                                top: 1e10,
                                right: 0,
                                bottom: 0,
                                left: 1e10
                            },
                            adjustable: FALSE
                        },
                        i = 0,
                        next, coords = [],
                        compareX = 1,
                        compareY = 1,
                        realX = 0,
                        realY = 0,
                        newWidth, newHeight;
                    i = baseCoords.length;
                    while (i--) {
                        next = [parseInt(baseCoords[--i], 10), parseInt(baseCoords[i + 1], 10)];
                        if (next[0] > result.position.right) {
                            result.position.right = next[0]
                        }
                        if (next[0] < result.position.left) {
                            result.position.left = next[0]
                        }
                        if (next[1] > result.position.bottom) {
                            result.position.bottom = next[1]
                        }
                        if (next[1] < result.position.top) {
                            result.position.top = next[1]
                        }
                        coords.push(next)
                    }
                    newWidth = result.width = Math.abs(result.position.right - result.position.left);
                    newHeight = result.height = Math.abs(result.position.bottom - result.position.top);
                    if (corner.abbrev() === "c") {
                        result.position = {
                            left: result.position.left + result.width / 2,
                            top: result.position.top + result.height / 2
                        }
                    } else {
                        while (newWidth > 0 && newHeight > 0 && compareX > 0 && compareY > 0) {
                            newWidth = Math.floor(newWidth / 2);
                            newHeight = Math.floor(newHeight / 2);
                            if (corner.x === LEFT) {
                                compareX = newWidth
                            } else if (corner.x === RIGHT) {
                                compareX = result.width - newWidth
                            } else {
                                compareX += Math.floor(newWidth / 2)
                            }
                            if (corner.y === TOP) {
                                compareY = newHeight
                            } else if (corner.y === BOTTOM) {
                                compareY = result.height - newHeight
                            } else {
                                compareY += Math.floor(newHeight / 2)
                            }
                            i = coords.length;
                            while (i--) {
                                if (coords.length < 2) {
                                    break
                                }
                                realX = coords[i][0] - result.position.left;
                                realY = coords[i][1] - result.position.top;
                                if (corner.x === LEFT && realX >= compareX || corner.x === RIGHT && realX <= compareX || corner.x === CENTER && (realX < compareX || realX > result.width - compareX) || corner.y === TOP && realY >= compareY || corner.y === BOTTOM && realY <= compareY || corner.y === CENTER && (realY < compareY || realY > result.height - compareY)) {
                                    coords.splice(i, 1)
                                }
                            }
                        }
                        result.position = {
                            left: coords[0][0],
                            top: coords[0][1]
                        }
                    }
                    return result
                },
                rect: function(ax, ay, bx, by, corner) {
                    return {
                        width: Math.abs(bx - ax),
                        height: Math.abs(by - ay),
                        position: {
                            left: Math.min(ax, bx),
                            top: Math.min(ay, by)
                        }
                    }
                },
                _angles: {
                    tc: 3 / 2,
                    tr: 7 / 4,
                    tl: 5 / 4,
                    bc: 1 / 2,
                    br: 1 / 4,
                    bl: 3 / 4,
                    rc: 2,
                    lc: 1,
                    c: 0
                },
                ellipse: function(cx, cy, rx, ry, corner) {
                    var c = PLUGINS.polys._angles[corner.abbrev()],
                        rxc = rx * Math.cos(c * Math.PI),
                        rys = ry * Math.sin(c * Math.PI);
                    return {
                        width: rx * 2 - Math.abs(rxc),
                        height: ry * 2 - Math.abs(rys),
                        position: {
                            left: cx + rxc,
                            top: cy + rys
                        },
                        adjustable: FALSE
                    }
                },
                circle: function(cx, cy, r, corner) {
                    return PLUGINS.polys.ellipse(cx, cy, r, r, corner)
                }
            };
            PLUGINS.svg = function(api, svg, corner, adjustMethod) {
                var doc = $(document),
                    elem = svg[0],
                    result = {},
                    name, box, position, dimensions;
                while (!elem.getBBox) {
                    elem = elem.parentNode
                }
                if (!elem.getBBox || !elem.parentNode) {
                    return FALSE
                }
                switch (elem.nodeName) {
                    case "rect":
                        position = PLUGINS.svg.toPixel(elem, elem.x.baseVal.value, elem.y.baseVal.value);
                        dimensions = PLUGINS.svg.toPixel(elem, elem.x.baseVal.value + elem.width.baseVal.value, elem.y.baseVal.value + elem.height.baseVal.value);
                        result = PLUGINS.polys.rect(position[0], position[1], dimensions[0], dimensions[1], corner);
                        break;
                    case "ellipse":
                    case "circle":
                        position = PLUGINS.svg.toPixel(elem, elem.cx.baseVal.value, elem.cy.baseVal.value);
                        result = PLUGINS.polys.ellipse(position[0], position[1], (elem.rx || elem.r).baseVal.value, (elem.ry || elem.r).baseVal.value, corner);
                        break;
                    case "line":
                    case "polygon":
                    case "polyline":
                        points = elem.points || [{
                            x: elem.x1.baseVal.value,
                            y: elem.y1.baseVal.value
                        }, {
                            x: elem.x2.baseVal.value,
                            y: elem.y2.baseVal.value
                        }];
                        for (result = [], i = -1, len = points.numberOfItems || points.length; ++i < len;) {
                            next = points.getItem ? points.getItem(i) : points[i];
                            result.push.apply(result, PLUGINS.svg.toPixel(elem, next.x, next.y))
                        }
                        result = PLUGINS.polys.polygon(result, corner);
                        break;
                    default:
                        box = elem.getBBox();
                        mtx = elem.getScreenCTM();
                        root = elem.farthestViewportElement || elem;
                        if (!root.createSVGPoint) {
                            return FALSE
                        }
                        point = root.createSVGPoint();
                        point.x = box.x;
                        point.y = box.y;
                        tPoint = point.matrixTransform(mtx);
                        result.position = {
                            left: tPoint.x,
                            top: tPoint.y
                        };
                        point.x += box.width;
                        point.y += box.height;
                        tPoint = point.matrixTransform(mtx);
                        result.width = tPoint.x - result.position.left;
                        result.height = tPoint.y - result.position.top;
                        break
                }
                result.position.left += doc.scrollLeft();
                result.position.top += doc.scrollTop();
                return result
            };
            PLUGINS.svg.toPixel = function(elem, x, y) {
                var mtx = elem.getScreenCTM(),
                    root = elem.farthestViewportElement || elem,
                    result, point;
                if (!root.createSVGPoint) {
                    return FALSE
                }
                point = root.createSVGPoint();
                point.x = x;
                point.y = y;
                result = point.matrixTransform(mtx);
                return [result.x, result.y]
            };
            PLUGINS.imagemap = function(api, area, corner, adjustMethod) {
                if (!area.jquery) {
                    area = $(area)
                }
                var shape = area.attr("shape").toLowerCase().replace("poly", "polygon"),
                    image = $('img[usemap="#' + area.parent("map").attr("name") + '"]'),
                    coordsString = area.attr("coords"),
                    coordsArray = coordsString.split(","),
                    imageOffset, coords, i, next;
                if (!image.length) {
                    return FALSE
                }
                if (shape === "polygon") {
                    result = PLUGINS.polys.polygon(coordsArray, corner)
                } else if (PLUGINS.polys[shape]) {
                    for (i = -1, len = coordsArray.length, coords = []; ++i < len;) {
                        coords.push(parseInt(coordsArray[i], 10))
                    }
                    result = PLUGINS.polys[shape].apply(this, coords.concat(corner))
                } else {
                    return FALSE
                }
                imageOffset = image.offset();
                imageOffset.left += Math.ceil((image.outerWidth(FALSE) - image.width()) / 2);
                imageOffset.top += Math.ceil((image.outerHeight(FALSE) - image.height()) / 2);
                result.position.left += imageOffset.left;
                result.position.top += imageOffset.top;
                return result
            };
            var IE6, BGIFRAME = '<iframe class="qtip-bgiframe" frameborder="0" tabindex="-1" src="javascript:\'\';" ' + ' style="display:block; position:absolute; z-index:-1; filter:alpha(opacity=0); ' + '-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";"></iframe>';

            function Ie6(api, qtip) {
                this._ns = "ie6";
                this.init(this.qtip = api)
            }
            $.extend(Ie6.prototype, {
                _scroll: function() {
                    var overlay = this.qtip.elements.overlay;
                    overlay && (overlay[0].style.top = $(window).scrollTop() + "px")
                },
                init: function(qtip) {
                    var tooltip = qtip.tooltip,
                        scroll;
                    if ($("select, object").length < 1) {
                        this.bgiframe = qtip.elements.bgiframe = $(BGIFRAME).appendTo(tooltip);
                        qtip._bind(tooltip, "tooltipmove", this.adjustBGIFrame, this._ns, this)
                    }
                    this.redrawContainer = $("<div/>", {
                        id: NAMESPACE + "-rcontainer"
                    }).appendTo(document.body);
                    if (qtip.elements.overlay && qtip.elements.overlay.addClass("qtipmodal-ie6fix")) {
                        qtip._bind(window, ["scroll", "resize"], this._scroll, this._ns, this);
                        qtip._bind(tooltip, ["tooltipshow"], this._scroll, this._ns, this)
                    }
                    this.redraw()
                },
                adjustBGIFrame: function() {
                    var tooltip = this.qtip.tooltip,
                        dimensions = {
                            height: tooltip.outerHeight(FALSE),
                            width: tooltip.outerWidth(FALSE)
                        },
                        plugin = this.qtip.plugins.tip,
                        tip = this.qtip.elements.tip,
                        tipAdjust, offset;
                    offset = parseInt(tooltip.css("borderLeftWidth"), 10) || 0;
                    offset = {
                        left: -offset,
                        top: -offset
                    };
                    if (plugin && tip) {
                        tipAdjust = plugin.corner.precedance === "x" ? [WIDTH, LEFT] : [HEIGHT, TOP];
                        offset[tipAdjust[1]] -= tip[tipAdjust[0]]()
                    }
                    this.bgiframe.css(offset).css(dimensions)
                },
                redraw: function() {
                    if (this.qtip.rendered < 1 || this.drawing) {
                        return self
                    }
                    var tooltip = this.qtip.tooltip,
                        style = this.qtip.options.style,
                        container = this.qtip.options.position.container,
                        perc, width, max, min;
                    this.qtip.drawing = 1;
                    if (style.height) {
                        tooltip.css(HEIGHT, style.height)
                    }
                    if (style.width) {
                        tooltip.css(WIDTH, style.width)
                    } else {
                        tooltip.css(WIDTH, "").appendTo(this.redrawContainer);
                        width = tooltip.width();
                        if (width % 2 < 1) {
                            width += 1
                        }
                        max = tooltip.css("maxWidth") || "";
                        min = tooltip.css("minWidth") || "";
                        perc = (max + min).indexOf("%") > -1 ? container.width() / 100 : 0;
                        max = (max.indexOf("%") > -1 ? perc : 1) * parseInt(max, 10) || width;
                        min = (min.indexOf("%") > -1 ? perc : 1) * parseInt(min, 10) || 0;
                        width = max + min ? Math.min(Math.max(width, min), max) : width;
                        tooltip.css(WIDTH, Math.round(width)).appendTo(container)
                    }
                    this.drawing = 0;
                    return self
                },
                destroy: function() {
                    this.bgiframe && this.bgiframe.remove();
                    this.qtip._unbind([window, this.qtip.tooltip], this._ns)
                }
            });
            IE6 = PLUGINS.ie6 = function(api) {
                return BROWSER.ie === 6 ? new Ie6(api) : FALSE
            };
            IE6.initialize = "render";
            CHECKS.ie6 = {
                "^content|style$": function() {
                    this.redraw()
                }
            }
        })
    })(window, document);
    return jQuery
});
define("ckeditor", [], function() {
    CKEDITOR_BASEPATH = STATIC + "/g/thirdparty/ckeditor/";
    (function() {
        if (window.CKEDITOR && window.CKEDITOR.dom) return;
        window.CKEDITOR || (window.CKEDITOR = function() {
            var a = /(^|.*[\\\/])ckeditor\.js(?:\?.*|;.*)?$/i,
                d = {
                    timestamp: "G4CD",
                    version: "4.5.9",
                    revision: "a35abfe",
                    rnd: Math.floor(900 * Math.random()) + 100,
                    _: {
                        pending: [],
                        basePathSrcPattern: a
                    },
                    status: "unloaded",
                    basePath: function() {
                        var b = window.CKEDITOR_BASEPATH || "";
                        if (!b)
                            for (var c = document.getElementsByTagName("script"), d = 0; d < c.length; d++) {
                                var k = c[d].src.match(a);
                                if (k) {
                                    b = k[1];
                                    break
                                }
                            } - 1 == b.indexOf(":/") && "//" != b.slice(0, 2) && (b = 0 === b.indexOf("/") ? location.href.match(/^.*?:\/\/[^\/]*/)[0] + b : location.href.match(/^[^\?]*\/(?:)/)[0] + b);
                        if (!b) throw 'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.';
                        return b
                    }(),
                    getUrl: function(a) {
                        -1 == a.indexOf(":/") && 0 !== a.indexOf("/") && (a = this.basePath + a);
                        this.timestamp && "/" != a.charAt(a.length - 1) && !/[&?]t=/.test(a) && (a += (0 <= a.indexOf("?") ? "&" : "?") + "t=" + this.timestamp);
                        return a
                    },
                    domReady: function() {
                        function a() {
                            try {
                                document.addEventListener ? (document.removeEventListener("DOMContentLoaded", a, !1), b()) : document.attachEvent && "complete" === document.readyState && (document.detachEvent("onreadystatechange", a), b())
                            } catch (c) {}
                        }

                        function b() {
                            for (var a; a = c.shift();) a()
                        }
                        var c = [];
                        return function(b) {
                            function d() {
                                try {
                                    document.documentElement.doScroll("left")
                                } catch (f) {
                                    setTimeout(d, 1);
                                    return
                                }
                                a()
                            }
                            c.push(b);
                            "complete" === document.readyState && setTimeout(a, 1);
                            if (1 == c.length)
                                if (document.addEventListener) document.addEventListener("DOMContentLoaded", a, !1), window.addEventListener("load", a, !1);
                                else if (document.attachEvent) {
                                document.attachEvent("onreadystatechange", a);
                                window.attachEvent("onload", a);
                                b = !1;
                                try {
                                    b = !window.frameElement
                                } catch (w) {}
                                document.documentElement.doScroll && b && d()
                            }
                        }
                    }()
                },
                b = window.CKEDITOR_GETURL;
            if (b) {
                var c = d.getUrl;
                d.getUrl = function(a) {
                    return b.call(d, a) || c.call(d, a)
                }
            }
            return d
        }());
        CKEDITOR.event || (CKEDITOR.event = function() {}, CKEDITOR.event.implementOn = function(a) {
            var d = CKEDITOR.event.prototype,
                b;
            for (b in d) null == a[b] && (a[b] = d[b])
        }, CKEDITOR.event.prototype = function() {
            function a(a) {
                var e = d(this);
                return e[a] || (e[a] = new b(a))
            }
            var d = function(a) {
                    a = a.getPrivate && a.getPrivate() || a._ || (a._ = {});
                    return a.events || (a.events = {})
                },
                b = function(a) {
                    this.name = a;
                    this.listeners = []
                };
            b.prototype = {
                getListenerIndex: function(a) {
                    for (var b = 0, d = this.listeners; b < d.length; b++)
                        if (d[b].fn == a) return b;
                    return -1
                }
            };
            return {
                define: function(b, d) {
                    var g = a.call(this, b);
                    CKEDITOR.tools.extend(g, d, !0)
                },
                on: function(b, d, g, l, k) {
                    function q(a, f, y, k) {
                        a = {
                            name: b,
                            sender: this,
                            editor: a,
                            data: f,
                            listenerData: l,
                            stop: y,
                            cancel: k,
                            removeListener: w
                        };
                        return !1 === d.call(g, a) ? !1 : a.data
                    }

                    function w() {
                        y.removeListener(b, d)
                    }
                    var f = a.call(this, b);
                    if (0 > f.getListenerIndex(d)) {
                        f = f.listeners;
                        g || (g = this);
                        isNaN(k) && (k = 10);
                        var y = this;
                        q.fn = d;
                        q.priority = k;
                        for (var A = f.length - 1; 0 <= A; A--)
                            if (f[A].priority <= k) return f.splice(A + 1, 0, q), {
                                removeListener: w
                            };
                        f.unshift(q)
                    }
                    return {
                        removeListener: w
                    }
                },
                once: function() {
                    var a = Array.prototype.slice.call(arguments),
                        b = a[1];
                    a[1] = function(a) {
                        a.removeListener();
                        return b.apply(this, arguments)
                    };
                    return this.on.apply(this, a)
                },
                capture: function() {
                    CKEDITOR.event.useCapture = 1;
                    var a = this.on.apply(this, arguments);
                    CKEDITOR.event.useCapture = 0;
                    return a
                },
                fire: function() {
                    var a = 0,
                        b = function() {
                            a = 1
                        },
                        g = 0,
                        l = function() {
                            g = 1
                        };
                    return function(k, q, w) {
                        var f = d(this)[k];
                        k = a;
                        var y = g;
                        a = g = 0;
                        if (f) {
                            var A = f.listeners;
                            if (A.length)
                                for (var A = A.slice(0), t, D = 0; D < A.length; D++) {
                                    if (f.errorProof) try {
                                        t = A[D].call(this, w, q, b, l)
                                    } catch (p) {} else t = A[D].call(this, w, q, b, l);
                                    !1 === t ? g = 1 : "undefined" != typeof t && (q = t);
                                    if (a || g) break
                                }
                        }
                        q = g ? !1 : "undefined" == typeof q ? !0 : q;
                        a = k;
                        g = y;
                        return q
                    }
                }(),
                fireOnce: function(a, b, g) {
                    b = this.fire(a, b, g);
                    delete d(this)[a];
                    return b
                },
                removeListener: function(a, b) {
                    var g = d(this)[a];
                    if (g) {
                        var l = g.getListenerIndex(b);
                        0 <= l && g.listeners.splice(l, 1)
                    }
                },
                removeAllListeners: function() {
                    var a = d(this),
                        b;
                    for (b in a) delete a[b]
                },
                hasListeners: function(a) {
                    return (a = d(this)[a]) && 0 < a.listeners.length
                }
            }
        }());
        CKEDITOR.editor || (CKEDITOR.editor = function() {
            CKEDITOR._.pending.push([this, arguments]);
            CKEDITOR.event.call(this)
        }, CKEDITOR.editor.prototype.fire = function(a, d) {
            a in {
                instanceReady: 1,
                loaded: 1
            } && (this[a] = !0);
            return CKEDITOR.event.prototype.fire.call(this, a, d, this)
        }, CKEDITOR.editor.prototype.fireOnce = function(a, d) {
            a in {
                instanceReady: 1,
                loaded: 1
            } && (this[a] = !0);
            return CKEDITOR.event.prototype.fireOnce.call(this, a, d, this)
        }, CKEDITOR.event.implementOn(CKEDITOR.editor.prototype));
        CKEDITOR.env || (CKEDITOR.env = function() {
            var a = navigator.userAgent.toLowerCase(),
                d = a.match(/edge[ \/](\d+.?\d*)/),
                b = -1 < a.indexOf("trident/"),
                b = !(!d && !b),
                b = {
                    ie: b,
                    edge: !!d,
                    webkit: !b && -1 < a.indexOf(" applewebkit/"),
                    air: -1 < a.indexOf(" adobeair/"),
                    mac: -1 < a.indexOf("macintosh"),
                    quirks: "BackCompat" == document.compatMode && (!document.documentMode || 10 > document.documentMode),
                    mobile: -1 < a.indexOf("mobile"),
                    iOS: /(ipad|iphone|ipod)/.test(a),
                    isCustomDomain: function() {
                        if (!this.ie) return !1;
                        var a = document.domain,
                            b = window.location.hostname;
                        return a != b && a != "[" + b + "]"
                    },
                    secure: "https:" == location.protocol
                };
            b.gecko = "Gecko" == navigator.product && !b.webkit && !b.ie;
            b.webkit && (-1 < a.indexOf("chrome") ? b.chrome = !0 : b.safari = !0);
            var c = 0;
            b.ie && (c = d ? parseFloat(d[1]) : b.quirks || !document.documentMode ? parseFloat(a.match(/msie (\d+)/)[1]) : document.documentMode, b.ie9Compat = 9 == c, b.ie8Compat = 8 == c, b.ie7Compat = 7 == c, b.ie6Compat = 7 > c || b.quirks);
            b.gecko && (d = a.match(/rv:([\d\.]+)/)) && (d = d[1].split("."), c = 1e4 * d[0] + 100 * (d[1] || 0) + 1 * (d[2] || 0));
            b.air && (c = parseFloat(a.match(/ adobeair\/(\d+)/)[1]));
            b.webkit && (c = parseFloat(a.match(/ applewebkit\/(\d+)/)[1]));
            b.version = c;
            b.isCompatible = !(b.ie && 7 > c) && !(b.gecko && 4e4 > c) && !(b.webkit && 534 > c);
            b.hidpi = 2 <= window.devicePixelRatio;
            b.needsBrFiller = b.gecko || b.webkit || b.ie && 10 < c;
            b.needsNbspFiller = b.ie && 11 > c;
            b.cssClass = "cke_browser_" + (b.ie ? "ie" : b.gecko ? "gecko" : b.webkit ? "webkit" : "unknown");
            b.quirks && (b.cssClass += " cke_browser_quirks");
            b.ie && (b.cssClass += " cke_browser_ie" + (b.quirks ? "6 cke_browser_iequirks" : b.version));
            b.air && (b.cssClass += " cke_browser_air");
            b.iOS && (b.cssClass += " cke_browser_ios");
            b.hidpi && (b.cssClass += " cke_hidpi");
            return b
        }());
        "unloaded" == CKEDITOR.status && function() {
            CKEDITOR.event.implementOn(CKEDITOR);
            CKEDITOR.loadFullCore = function() {
                if ("basic_ready" != CKEDITOR.status) CKEDITOR.loadFullCore._load = 1;
                else {
                    delete CKEDITOR.loadFullCore;
                    var a = document.createElement("script");
                    a.type = "text/javascript";
                    a.src = CKEDITOR.basePath + "ckeditor.js";
                    document.getElementsByTagName("head")[0].appendChild(a)
                }
            };
            CKEDITOR.loadFullCoreTimeout = 0;
            CKEDITOR.add = function(a) {
                (this._.pending || (this._.pending = [])).push(a)
            };
            (function() {
                CKEDITOR.domReady(function() {
                    var a = CKEDITOR.loadFullCore,
                        d = CKEDITOR.loadFullCoreTimeout;
                    a && (CKEDITOR.status = "basic_ready", a && a._load ? a() : d && setTimeout(function() {
                        CKEDITOR.loadFullCore && CKEDITOR.loadFullCore()
                    }, 1e3 * d))
                })
            })();
            CKEDITOR.status = "basic_loaded"
        }();
        "use strict";
        CKEDITOR.VERBOSITY_WARN = 1;
        CKEDITOR.VERBOSITY_ERROR = 2;
        CKEDITOR.verbosity = CKEDITOR.VERBOSITY_WARN | CKEDITOR.VERBOSITY_ERROR;
        CKEDITOR.warn = function(a, d) {
            CKEDITOR.verbosity & CKEDITOR.VERBOSITY_WARN && CKEDITOR.fire("log", {
                type: "warn",
                errorCode: a,
                additionalData: d
            })
        };
        CKEDITOR.error = function(a, d) {
            CKEDITOR.verbosity & CKEDITOR.VERBOSITY_ERROR && CKEDITOR.fire("log", {
                type: "error",
                errorCode: a,
                additionalData: d
            })
        };
        CKEDITOR.on("log", function(a) {
            if (window.console && window.console.log) {
                var d = console[a.data.type] ? a.data.type : "log",
                    b = a.data.errorCode;
                if (a = a.data.additionalData) console[d]("[CKEDITOR] Error code: " + b + ".", a);
                else console[d]("[CKEDITOR] Error code: " + b + ".");
                console[d]("[CKEDITOR] For more information about this error go to http://docs.ckeditor.com/#!/guide/dev_errors-section-" + b)
            }
        }, null, null, 999);
        CKEDITOR.dom = {};
        (function() {
            var a = [],
                d = CKEDITOR.env.gecko ? "-moz-" : CKEDITOR.env.webkit ? "-webkit-" : CKEDITOR.env.ie ? "-ms-" : "",
                b = /&/g,
                c = />/g,
                e = /</g,
                g = /"/g,
                l = /&(lt|gt|amp|quot|nbsp|shy|#\d{1,5});/g,
                k = {
                    lt: "<",
                    gt: ">",
                    amp: "&",
                    quot: '"',
                    nbsp: " ",
                    shy: "­"
                },
                q = function(a, f) {
                    return "#" == f[0] ? String.fromCharCode(parseInt(f.slice(1), 10)) : k[f]
                };
            CKEDITOR.on("reset", function() {
                a = []
            });
            CKEDITOR.tools = {
                arrayCompare: function(a, f) {
                    if (!a && !f) return !0;
                    if (!a || !f || a.length != f.length) return !1;
                    for (var b = 0; b < a.length; b++)
                        if (a[b] != f[b]) return !1;
                    return !0
                },
                getIndex: function(a, f) {
                    for (var b = 0; b < a.length; ++b)
                        if (f(a[b])) return b;
                    return -1
                },
                clone: function(a) {
                    var f;
                    if (a && a instanceof Array) {
                        f = [];
                        for (var b = 0; b < a.length; b++) f[b] = CKEDITOR.tools.clone(a[b]);
                        return f
                    }
                    if (null === a || "object" != typeof a || a instanceof String || a instanceof Number || a instanceof Boolean || a instanceof Date || a instanceof RegExp || a.nodeType || a.window === a) return a;
                    f = new a.constructor;
                    for (b in a) f[b] = CKEDITOR.tools.clone(a[b]);
                    return f
                },
                capitalize: function(a, f) {
                    return a.charAt(0).toUpperCase() + (f ? a.slice(1) : a.slice(1).toLowerCase())
                },
                extend: function(a) {
                    var f = arguments.length,
                        b, c;
                    "boolean" == typeof(b = arguments[f - 1]) ? f-- : "boolean" == typeof(b = arguments[f - 2]) && (c = arguments[f - 1], f -= 2);
                    for (var k = 1; k < f; k++) {
                        var d = arguments[k],
                            p;
                        for (p in d)
                            if (!0 === b || null == a[p])
                                if (!c || p in c) a[p] = d[p]
                    }
                    return a
                },
                prototypedCopy: function(a) {
                    var f = function() {};
                    f.prototype = a;
                    return new f
                },
                copy: function(a) {
                    var f = {},
                        b;
                    for (b in a) f[b] = a[b];
                    return f
                },
                isArray: function(a) {
                    return "[object Array]" == Object.prototype.toString.call(a)
                },
                isEmpty: function(a) {
                    for (var f in a)
                        if (a.hasOwnProperty(f)) return !1;
                    return !0
                },
                cssVendorPrefix: function(a, f, b) {
                    if (b) return d + a + ":" + f + ";" + a + ":" + f;
                    b = {};
                    b[a] = f;
                    b[d + a] = f;
                    return b
                },
                cssStyleToDomStyle: function() {
                    var a = document.createElement("div").style,
                        f = "undefined" != typeof a.cssFloat ? "cssFloat" : "undefined" != typeof a.styleFloat ? "styleFloat" : "float";
                    return function(a) {
                        return "float" == a ? f : a.replace(/-./g, function(a) {
                            return a.substr(1).toUpperCase()
                        })
                    }
                }(),
                buildStyleHtml: function(a) {
                    a = [].concat(a);
                    for (var f, b = [], c = 0; c < a.length; c++)
                        if (f = a[c]) /@import|[{}]/.test(f) ? b.push("<style>" + f + "</style>") : b.push('<link type="text/css" rel=stylesheet href="' + f + '">');
                    return b.join("")
                },
                htmlEncode: function(a) {
                    return void 0 === a || null === a ? "" : String(a).replace(b, "&amp;").replace(c, "&gt;").replace(e, "&lt;")
                },
                htmlDecode: function(a) {
                    return a.replace(l, q)
                },
                htmlEncodeAttr: function(a) {
                    return CKEDITOR.tools.htmlEncode(a).replace(g, "&quot;")
                },
                htmlDecodeAttr: function(a) {
                    return CKEDITOR.tools.htmlDecode(a)
                },
                transformPlainTextToHtml: function(a, f) {
                    var b = f == CKEDITOR.ENTER_BR,
                        c = this.htmlEncode(a.replace(/\r\n/g, "\n")),
                        c = c.replace(/\t/g, "&nbsp;&nbsp; &nbsp;"),
                        k = f == CKEDITOR.ENTER_P ? "p" : "div";
                    if (!b) {
                        var d = /\n{2}/g;
                        if (d.test(c)) var p = "<" + k + ">",
                            q = "</" + k + ">",
                            c = p + c.replace(d, function() {
                                return q + p
                            }) + q
                    }
                    c = c.replace(/\n/g, "<br>");
                    b || (c = c.replace(new RegExp("<br>(?=</" + k + ">)"), function(a) {
                        return CKEDITOR.tools.repeat(a, 2)
                    }));
                    c = c.replace(/^ | $/g, "&nbsp;");
                    return c = c.replace(/(>|\s) /g, function(a, f) {
                        return f + "&nbsp;"
                    }).replace(/ (?=<)/g, "&nbsp;")
                },
                getNextNumber: function() {
                    var a = 0;
                    return function() {
                        return ++a
                    }
                }(),
                getNextId: function() {
                    return "cke_" + this.getNextNumber()
                },
                getUniqueId: function() {
                    for (var a = "e", f = 0; 8 > f; f++) a += Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
                    return a
                },
                override: function(a, f) {
                    var b = f(a);
                    b.prototype = a.prototype;
                    return b
                },
                setTimeout: function(a, f, b, c, k) {
                    k || (k = window);
                    b || (b = k);
                    return k.setTimeout(function() {
                        c ? a.apply(b, [].concat(c)) : a.apply(b)
                    }, f || 0)
                },
                trim: function() {
                    var a = /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;
                    return function(f) {
                        return f.replace(a, "")
                    }
                }(),
                ltrim: function() {
                    var a = /^[ \t\n\r]+/g;
                    return function(f) {
                        return f.replace(a, "")
                    }
                }(),
                rtrim: function() {
                    var a = /[ \t\n\r]+$/g;
                    return function(f) {
                        return f.replace(a, "")
                    }
                }(),
                indexOf: function(a, f) {
                    if ("function" == typeof f)
                        for (var b = 0, c = a.length; b < c; b++) {
                            if (f(a[b])) return b
                        } else {
                            if (a.indexOf) return a.indexOf(f);
                            b = 0;
                            for (c = a.length; b < c; b++)
                                if (a[b] === f) return b
                        }
                    return -1
                },
                search: function(a, f) {
                    var b = CKEDITOR.tools.indexOf(a, f);
                    return 0 <= b ? a[b] : null
                },
                bind: function(a, f) {
                    return function() {
                        return a.apply(f, arguments)
                    }
                },
                createClass: function(a) {
                    var f = a.$,
                        b = a.base,
                        c = a.privates || a._,
                        k = a.proto;
                    a = a.statics;
                    !f && (f = function() {
                        b && this.base.apply(this, arguments)
                    });
                    if (c) var d = f,
                        f = function() {
                            var a = this._ || (this._ = {}),
                                b;
                            for (b in c) {
                                var f = c[b];
                                a[b] = "function" == typeof f ? CKEDITOR.tools.bind(f, this) : f
                            }
                            d.apply(this, arguments)
                        };
                    b && (f.prototype = this.prototypedCopy(b.prototype), f.prototype.constructor = f, f.base = b, f.baseProto = b.prototype, f.prototype.base = function() {
                        this.base = b.prototype.base;
                        b.apply(this, arguments);
                        this.base = arguments.callee
                    });
                    k && this.extend(f.prototype, k, !0);
                    a && this.extend(f, a, !0);
                    return f
                },
                addFunction: function(b, f) {
                    return a.push(function() {
                        return b.apply(f || this, arguments)
                    }) - 1
                },
                removeFunction: function(b) {
                    a[b] = null
                },
                callFunction: function(b) {
                    var f = a[b];
                    return f && f.apply(window, Array.prototype.slice.call(arguments, 1))
                },
                cssLength: function() {
                    var a = /^-?\d+\.?\d*px$/,
                        b;
                    return function(c) {
                        b = CKEDITOR.tools.trim(c + "") + "px";
                        return a.test(b) ? b : c || ""
                    }
                }(),
                convertToPx: function() {
                    var a;
                    return function(b) {
                        a || (a = CKEDITOR.dom.element.createFromHtml('<div style="position:absolute;left:-9999px;top:-9999px;margin:0px;padding:0px;border:0px;"></div>', CKEDITOR.document), CKEDITOR.document.getBody().append(a));
                        return /%$/.test(b) ? b : (a.setStyle("width", b), a.$.clientWidth)
                    }
                }(),
                repeat: function(a, b) {
                    return Array(b + 1).join(a)
                },
                tryThese: function() {
                    for (var a, b = 0, c = arguments.length; b < c; b++) {
                        var k = arguments[b];
                        try {
                            a = k();
                            break
                        } catch (d) {}
                    }
                    return a
                },
                genKey: function() {
                    return Array.prototype.slice.call(arguments).join("-")
                },
                defer: function(a) {
                    return function() {
                        var b = arguments,
                            c = this;
                        window.setTimeout(function() {
                            a.apply(c, b)
                        }, 0)
                    }
                },
                normalizeCssText: function(a, b) {
                    var c = [],
                        k, d = CKEDITOR.tools.parseCssText(a, !0, b);
                    for (k in d) c.push(k + ":" + d[k]);
                    c.sort();
                    return c.length ? c.join(";") + ";" : ""
                },
                convertRgbToHex: function(a) {
                    return a.replace(/(?:rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\))/gi, function(a, b, c, k) {
                        a = [b, c, k];
                        for (b = 0; 3 > b; b++) a[b] = ("0" + parseInt(a[b], 10).toString(16)).slice(-2);
                        return "#" + a.join("")
                    })
                },
                parseCssText: function(a, b, c) {
                    var k = {};
                    c && (c = new CKEDITOR.dom.element("span"), c.setAttribute("style", a), a = CKEDITOR.tools.convertRgbToHex(c.getAttribute("style") || ""));
                    if (!a || ";" == a) return k;
                    a.replace(/&quot;/g, '"').replace(/\s*([^:;\s]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, c, d) {
                        b && (c = c.toLowerCase(), "font-family" == c && (d = d.toLowerCase().replace(/["']/g, "").replace(/\s*,\s*/g, ",")), d = CKEDITOR.tools.trim(d));
                        k[c] = d
                    });
                    return k
                },
                writeCssText: function(a, b) {
                    var c, k = [];
                    for (c in a) k.push(c + ":" + a[c]);
                    b && k.sort();
                    return k.join("; ")
                },
                objectCompare: function(a, b, c) {
                    var k;
                    if (!a && !b) return !0;
                    if (!a || !b) return !1;
                    for (k in a)
                        if (a[k] != b[k]) return !1;
                    if (!c)
                        for (k in b)
                            if (a[k] != b[k]) return !1;
                    return !0
                },
                objectKeys: function(a) {
                    var b = [],
                        c;
                    for (c in a) b.push(c);
                    return b
                },
                convertArrayToObject: function(a, b) {
                    var c = {};
                    1 == arguments.length && (b = !0);
                    for (var k = 0, d = a.length; k < d; ++k) c[a[k]] = b;
                    return c
                },
                fixDomain: function() {
                    for (var a;;) try {
                        a = window.parent.document.domain;
                        break
                    } catch (b) {
                        a = a ? a.replace(/.+?(?:\.|$)/, "") : document.domain;
                        if (!a) break;
                        document.domain = a
                    }
                    return !!a
                },
                eventsBuffer: function(a, b, c) {
                    function k() {
                        q = (new Date).getTime();
                        d = !1;
                        c ? b.call(c) : b()
                    }
                    var d, q = 0;
                    return {
                        input: function() {
                            if (!d) {
                                var b = (new Date).getTime() - q;
                                b < a ? d = setTimeout(k, a - b) : k()
                            }
                        },
                        reset: function() {
                            d && clearTimeout(d);
                            d = q = 0
                        }
                    }
                },
                enableHtml5Elements: function(a, b) {
                    for (var c = "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video".split(" "), k = c.length, d; k--;) d = a.createElement(c[k]), b && a.appendChild(d)
                },
                checkIfAnyArrayItemMatches: function(a, b) {
                    for (var c = 0, k = a.length; c < k; ++c)
                        if (a[c].match(b)) return !0;
                    return !1
                },
                checkIfAnyObjectPropertyMatches: function(a, b) {
                    for (var c in a)
                        if (c.match(b)) return !0;
                    return !1
                },
                transparentImageData: "data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==",
                getCookie: function(a) {
                    a = a.toLowerCase();
                    for (var b = document.cookie.split(";"), c, k, d = 0; d < b.length; d++)
                        if (c = b[d].split("="), k = decodeURIComponent(CKEDITOR.tools.trim(c[0]).toLowerCase()), k === a) return decodeURIComponent(1 < c.length ? c[1] : "");
                    return null
                },
                setCookie: function(a, b) {
                    document.cookie = encodeURIComponent(a) + "=" + encodeURIComponent(b) + ";path=/"
                },
                getCsrfToken: function() {
                    var a = CKEDITOR.tools.getCookie("ckCsrfToken");
                    if (!a || 40 != a.length) {
                        var a = [],
                            b = "";
                        if (window.crypto && window.crypto.getRandomValues) a = new Uint8Array(40), window.crypto.getRandomValues(a);
                        else
                            for (var c = 0; 40 > c; c++) a.push(Math.floor(256 * Math.random()));
                        for (c = 0; c < a.length; c++) var k = "abcdefghijklmnopqrstuvwxyz0123456789".charAt(a[c] % 36),
                            b = b + (.5 < Math.random() ? k.toUpperCase() : k);
                        a = b;
                        CKEDITOR.tools.setCookie("ckCsrfToken", a)
                    }
                    return a
                }
            }
        })();
        CKEDITOR.dtd = function() {
            var a = CKEDITOR.tools.extend,
                d = function(a, b) {
                    for (var c = CKEDITOR.tools.clone(a), k = 1; k < arguments.length; k++) {
                        b = arguments[k];
                        for (var d in b) delete c[d]
                    }
                    return c
                },
                b = {},
                c = {},
                e = {
                    address: 1,
                    article: 1,
                    aside: 1,
                    blockquote: 1,
                    details: 1,
                    div: 1,
                    dl: 1,
                    fieldset: 1,
                    figure: 1,
                    footer: 1,
                    form: 1,
                    h1: 1,
                    h2: 1,
                    h3: 1,
                    h4: 1,
                    h5: 1,
                    h6: 1,
                    header: 1,
                    hgroup: 1,
                    hr: 1,
                    main: 1,
                    menu: 1,
                    nav: 1,
                    ol: 1,
                    p: 1,
                    pre: 1,
                    section: 1,
                    table: 1,
                    ul: 1
                },
                g = {
                    command: 1,
                    link: 1,
                    meta: 1,
                    noscript: 1,
                    script: 1,
                    style: 1
                },
                l = {},
                k = {
                    "#": 1
                },
                q = {
                    center: 1,
                    dir: 1,
                    noframes: 1
                };
            a(b, {
                a: 1,
                abbr: 1,
                area: 1,
                audio: 1,
                b: 1,
                bdi: 1,
                bdo: 1,
                br: 1,
                button: 1,
                canvas: 1,
                cite: 1,
                code: 1,
                command: 1,
                datalist: 1,
                del: 1,
                dfn: 1,
                em: 1,
                embed: 1,
                i: 1,
                iframe: 1,
                img: 1,
                input: 1,
                ins: 1,
                kbd: 1,
                keygen: 1,
                label: 1,
                map: 1,
                mark: 1,
                meter: 1,
                noscript: 1,
                object: 1,
                output: 1,
                progress: 1,
                q: 1,
                ruby: 1,
                s: 1,
                samp: 1,
                script: 1,
                select: 1,
                small: 1,
                span: 1,
                strong: 1,
                sub: 1,
                sup: 1,
                textarea: 1,
                time: 1,
                u: 1,
                "var": 1,
                video: 1,
                wbr: 1
            }, k, {
                acronym: 1,
                applet: 1,
                basefont: 1,
                big: 1,
                font: 1,
                isindex: 1,
                strike: 1,
                style: 1,
                tt: 1
            });
            a(c, e, b, q);
            d = {
                a: d(b, {
                    a: 1,
                    button: 1
                }),
                abbr: b,
                address: c,
                area: l,
                article: c,
                aside: c,
                audio: a({
                    source: 1,
                    track: 1
                }, c),
                b: b,
                base: l,
                bdi: b,
                bdo: b,
                blockquote: c,
                body: c,
                br: l,
                button: d(b, {
                    a: 1,
                    button: 1
                }),
                canvas: b,
                caption: c,
                cite: b,
                code: b,
                col: l,
                colgroup: {
                    col: 1
                },
                command: l,
                datalist: a({
                    option: 1
                }, b),
                dd: c,
                del: b,
                details: a({
                    summary: 1
                }, c),
                dfn: b,
                div: c,
                dl: {
                    dt: 1,
                    dd: 1
                },
                dt: c,
                em: b,
                embed: l,
                fieldset: a({
                    legend: 1
                }, c),
                figcaption: c,
                figure: a({
                    figcaption: 1
                }, c),
                footer: c,
                form: c,
                h1: b,
                h2: b,
                h3: b,
                h4: b,
                h5: b,
                h6: b,
                head: a({
                    title: 1,
                    base: 1
                }, g),
                header: c,
                hgroup: {
                    h1: 1,
                    h2: 1,
                    h3: 1,
                    h4: 1,
                    h5: 1,
                    h6: 1
                },
                hr: l,
                html: a({
                    head: 1,
                    body: 1
                }, c, g),
                i: b,
                iframe: k,
                img: l,
                input: l,
                ins: b,
                kbd: b,
                keygen: l,
                label: b,
                legend: b,
                li: c,
                link: l,
                main: c,
                map: c,
                mark: b,
                menu: a({
                    li: 1
                }, c),
                meta: l,
                meter: d(b, {
                    meter: 1
                }),
                nav: c,
                noscript: a({
                    link: 1,
                    meta: 1,
                    style: 1
                }, b),
                object: a({
                    param: 1
                }, b),
                ol: {
                    li: 1
                },
                optgroup: {
                    option: 1
                },
                option: k,
                output: b,
                p: b,
                param: l,
                pre: b,
                progress: d(b, {
                    progress: 1
                }),
                q: b,
                rp: b,
                rt: b,
                ruby: a({
                    rp: 1,
                    rt: 1
                }, b),
                s: b,
                samp: b,
                script: k,
                section: c,
                select: {
                    optgroup: 1,
                    option: 1
                },
                small: b,
                source: l,
                span: b,
                strong: b,
                style: k,
                sub: b,
                summary: a({
                    h1: 1,
                    h2: 1,
                    h3: 1,
                    h4: 1,
                    h5: 1,
                    h6: 1
                }, b),
                sup: b,
                table: {
                    caption: 1,
                    colgroup: 1,
                    thead: 1,
                    tfoot: 1,
                    tbody: 1,
                    tr: 1
                },
                tbody: {
                    tr: 1
                },
                td: c,
                textarea: k,
                tfoot: {
                    tr: 1
                },
                th: c,
                thead: {
                    tr: 1
                },
                time: d(b, {
                    time: 1
                }),
                title: k,
                tr: {
                    th: 1,
                    td: 1
                },
                track: l,
                u: b,
                ul: {
                    li: 1
                },
                "var": b,
                video: a({
                    source: 1,
                    track: 1
                }, c),
                wbr: l,
                acronym: b,
                applet: a({
                    param: 1
                }, c),
                basefont: l,
                big: b,
                center: c,
                dialog: l,
                dir: {
                    li: 1
                },
                font: b,
                isindex: l,
                noframes: c,
                strike: b,
                tt: b
            };
            a(d, {
                $block: a({
                    audio: 1,
                    dd: 1,
                    dt: 1,
                    figcaption: 1,
                    li: 1,
                    video: 1
                }, e, q),
                $blockLimit: {
                    article: 1,
                    aside: 1,
                    audio: 1,
                    body: 1,
                    caption: 1,
                    details: 1,
                    dir: 1,
                    div: 1,
                    dl: 1,
                    fieldset: 1,
                    figcaption: 1,
                    figure: 1,
                    footer: 1,
                    form: 1,
                    header: 1,
                    hgroup: 1,
                    main: 1,
                    menu: 1,
                    nav: 1,
                    ol: 1,
                    section: 1,
                    table: 1,
                    td: 1,
                    th: 1,
                    tr: 1,
                    ul: 1,
                    video: 1
                },
                $cdata: {
                    script: 1,
                    style: 1
                },
                $editable: {
                    address: 1,
                    article: 1,
                    aside: 1,
                    blockquote: 1,
                    body: 1,
                    details: 1,
                    div: 1,
                    fieldset: 1,
                    figcaption: 1,
                    footer: 1,
                    form: 1,
                    h1: 1,
                    h2: 1,
                    h3: 1,
                    h4: 1,
                    h5: 1,
                    h6: 1,
                    header: 1,
                    hgroup: 1,
                    main: 1,
                    nav: 1,
                    p: 1,
                    pre: 1,
                    section: 1
                },
                $empty: {
                    area: 1,
                    base: 1,
                    basefont: 1,
                    br: 1,
                    col: 1,
                    command: 1,
                    dialog: 1,
                    embed: 1,
                    hr: 1,
                    img: 1,
                    input: 1,
                    isindex: 1,
                    keygen: 1,
                    link: 1,
                    meta: 1,
                    param: 1,
                    source: 1,
                    track: 1,
                    wbr: 1
                },
                $inline: b,
                $list: {
                    dl: 1,
                    ol: 1,
                    ul: 1
                },
                $listItem: {
                    dd: 1,
                    dt: 1,
                    li: 1
                },
                $nonBodyContent: a({
                    body: 1,
                    head: 1,
                    html: 1
                }, d.head),
                $nonEditable: {
                    applet: 1,
                    audio: 1,
                    button: 1,
                    embed: 1,
                    iframe: 1,
                    map: 1,
                    object: 1,
                    option: 1,
                    param: 1,
                    script: 1,
                    textarea: 1,
                    video: 1
                },
                $object: {
                    applet: 1,
                    audio: 1,
                    button: 1,
                    hr: 1,
                    iframe: 1,
                    img: 1,
                    input: 1,
                    object: 1,
                    select: 1,
                    table: 1,
                    textarea: 1,
                    video: 1
                },
                $removeEmpty: {
                    abbr: 1,
                    acronym: 1,
                    b: 1,
                    bdi: 1,
                    bdo: 1,
                    big: 1,
                    cite: 1,
                    code: 1,
                    del: 1,
                    dfn: 1,
                    em: 1,
                    font: 1,
                    i: 1,
                    ins: 1,
                    label: 1,
                    kbd: 1,
                    mark: 1,
                    meter: 1,
                    output: 1,
                    q: 1,
                    ruby: 1,
                    s: 1,
                    samp: 1,
                    small: 1,
                    span: 1,
                    strike: 1,
                    strong: 1,
                    sub: 1,
                    sup: 1,
                    time: 1,
                    tt: 1,
                    u: 1,
                    "var": 1
                },
                $tabIndex: {
                    a: 1,
                    area: 1,
                    button: 1,
                    input: 1,
                    object: 1,
                    select: 1,
                    textarea: 1
                },
                $tableContent: {
                    caption: 1,
                    col: 1,
                    colgroup: 1,
                    tbody: 1,
                    td: 1,
                    tfoot: 1,
                    th: 1,
                    thead: 1,
                    tr: 1
                },
                $transparent: {
                    a: 1,
                    audio: 1,
                    canvas: 1,
                    del: 1,
                    ins: 1,
                    map: 1,
                    noscript: 1,
                    object: 1,
                    video: 1
                },
                $intermediate: {
                    caption: 1,
                    colgroup: 1,
                    dd: 1,
                    dt: 1,
                    figcaption: 1,
                    legend: 1,
                    li: 1,
                    optgroup: 1,
                    option: 1,
                    rp: 1,
                    rt: 1,
                    summary: 1,
                    tbody: 1,
                    td: 1,
                    tfoot: 1,
                    th: 1,
                    thead: 1,
                    tr: 1
                }
            });
            return d
        }();
        CKEDITOR.dom.event = function(a) {
            this.$ = a
        };
        CKEDITOR.dom.event.prototype = {
            getKey: function() {
                return this.$.keyCode || this.$.which
            },
            getKeystroke: function() {
                var a = this.getKey();
                if (this.$.ctrlKey || this.$.metaKey) a += CKEDITOR.CTRL;
                this.$.shiftKey && (a += CKEDITOR.SHIFT);
                this.$.altKey && (a += CKEDITOR.ALT);
                return a
            },
            preventDefault: function(a) {
                var d = this.$;
                d.preventDefault ? d.preventDefault() : d.returnValue = !1;
                a && this.stopPropagation()
            },
            stopPropagation: function() {
                var a = this.$;
                a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0
            },
            getTarget: function() {
                var a = this.$.target || this.$.srcElement;
                return a ? new CKEDITOR.dom.node(a) : null
            },
            getPhase: function() {
                return this.$.eventPhase || 2
            },
            getPageOffset: function() {
                var a = this.getTarget().getDocument().$;
                return {
                    x: this.$.pageX || this.$.clientX + (a.documentElement.scrollLeft || a.body.scrollLeft),
                    y: this.$.pageY || this.$.clientY + (a.documentElement.scrollTop || a.body.scrollTop)
                }
            }
        };
        CKEDITOR.CTRL = 1114112;
        CKEDITOR.SHIFT = 2228224;
        CKEDITOR.ALT = 4456448;
        CKEDITOR.EVENT_PHASE_CAPTURING = 1;
        CKEDITOR.EVENT_PHASE_AT_TARGET = 2;
        CKEDITOR.EVENT_PHASE_BUBBLING = 3;
        CKEDITOR.dom.domObject = function(a) {
            a && (this.$ = a)
        };
        CKEDITOR.dom.domObject.prototype = function() {
            var a = function(a, b) {
                return function(c) {
                    "undefined" != typeof CKEDITOR && a.fire(b, new CKEDITOR.dom.event(c))
                }
            };
            return {
                getPrivate: function() {
                    var a;
                    (a = this.getCustomData("_")) || this.setCustomData("_", a = {});
                    return a
                },
                on: function(d) {
                    var b = this.getCustomData("_cke_nativeListeners");
                    b || (b = {}, this.setCustomData("_cke_nativeListeners", b));
                    b[d] || (b = b[d] = a(this, d), this.$.addEventListener ? this.$.addEventListener(d, b, !!CKEDITOR.event.useCapture) : this.$.attachEvent && this.$.attachEvent("on" + d, b));
                    return CKEDITOR.event.prototype.on.apply(this, arguments)
                },
                removeListener: function(a) {
                    CKEDITOR.event.prototype.removeListener.apply(this, arguments);
                    if (!this.hasListeners(a)) {
                        var b = this.getCustomData("_cke_nativeListeners"),
                            c = b && b[a];
                        c && (this.$.removeEventListener ? this.$.removeEventListener(a, c, !1) : this.$.detachEvent && this.$.detachEvent("on" + a, c), delete b[a])
                    }
                },
                removeAllListeners: function() {
                    var a = this.getCustomData("_cke_nativeListeners"),
                        b;
                    for (b in a) {
                        var c = a[b];
                        this.$.detachEvent ? this.$.detachEvent("on" + b, c) : this.$.removeEventListener && this.$.removeEventListener(b, c, !1);
                        delete a[b]
                    }
                    CKEDITOR.event.prototype.removeAllListeners.call(this)
                }
            }
        }();
        (function(a) {
            var d = {};
            CKEDITOR.on("reset", function() {
                d = {}
            });
            a.equals = function(a) {
                try {
                    return a && a.$ === this.$
                } catch (c) {
                    return !1
                }
            };
            a.setCustomData = function(a, c) {
                var e = this.getUniqueId();
                (d[e] || (d[e] = {}))[a] = c;
                return this
            };
            a.getCustomData = function(a) {
                var c = this.$["data-cke-expando"];
                return (c = c && d[c]) && a in c ? c[a] : null
            };
            a.removeCustomData = function(a) {
                var c = this.$["data-cke-expando"],
                    c = c && d[c],
                    e, g;
                c && (e = c[a], g = a in c, delete c[a]);
                return g ? e : null
            };
            a.clearCustomData = function() {
                this.removeAllListeners();
                var a = this.$["data-cke-expando"];
                a && delete d[a]
            };
            a.getUniqueId = function() {
                return this.$["data-cke-expando"] || (this.$["data-cke-expando"] = CKEDITOR.tools.getNextNumber())
            };
            CKEDITOR.event.implementOn(a)
        })(CKEDITOR.dom.domObject.prototype);
        CKEDITOR.dom.node = function(a) {
            return a ? new CKEDITOR.dom[a.nodeType == CKEDITOR.NODE_DOCUMENT ? "document" : a.nodeType == CKEDITOR.NODE_ELEMENT ? "element" : a.nodeType == CKEDITOR.NODE_TEXT ? "text" : a.nodeType == CKEDITOR.NODE_COMMENT ? "comment" : a.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT ? "documentFragment" : "domObject"](a) : this
        };
        CKEDITOR.dom.node.prototype = new CKEDITOR.dom.domObject;
        CKEDITOR.NODE_ELEMENT = 1;
        CKEDITOR.NODE_DOCUMENT = 9;
        CKEDITOR.NODE_TEXT = 3;
        CKEDITOR.NODE_COMMENT = 8;
        CKEDITOR.NODE_DOCUMENT_FRAGMENT = 11;
        CKEDITOR.POSITION_IDENTICAL = 0;
        CKEDITOR.POSITION_DISCONNECTED = 1;
        CKEDITOR.POSITION_FOLLOWING = 2;
        CKEDITOR.POSITION_PRECEDING = 4;
        CKEDITOR.POSITION_IS_CONTAINED = 8;
        CKEDITOR.POSITION_CONTAINS = 16;
        CKEDITOR.tools.extend(CKEDITOR.dom.node.prototype, {
            appendTo: function(a, d) {
                a.append(this, d);
                return a
            },
            clone: function(a, d) {
                function b(c) {
                    c["data-cke-expando"] && (c["data-cke-expando"] = !1);
                    if (c.nodeType == CKEDITOR.NODE_ELEMENT || c.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
                        if (d || c.nodeType != CKEDITOR.NODE_ELEMENT || c.removeAttribute("id", !1), a) {
                            c = c.childNodes;
                            for (var e = 0; e < c.length; e++) b(c[e])
                        }
                }

                function c(b) {
                    if (b.type == CKEDITOR.NODE_ELEMENT || b.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
                        if (b.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
                            var d = b.getName();
                            ":" == d[0] && b.renameNode(d.substring(1))
                        }
                        if (a)
                            for (d = 0; d < b.getChildCount(); d++) c(b.getChild(d))
                    }
                }
                var e = this.$.cloneNode(a);
                b(e);
                e = new CKEDITOR.dom.node(e);
                CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (this.type == CKEDITOR.NODE_ELEMENT || this.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT) && c(e);
                return e
            },
            hasPrevious: function() {
                return !!this.$.previousSibling
            },
            hasNext: function() {
                return !!this.$.nextSibling
            },
            insertAfter: function(a) {
                a.$.parentNode.insertBefore(this.$, a.$.nextSibling);
                return a
            },
            insertBefore: function(a) {
                a.$.parentNode.insertBefore(this.$, a.$);
                return a
            },
            insertBeforeMe: function(a) {
                this.$.parentNode.insertBefore(a.$, this.$);
                return a
            },
            getAddress: function(a) {
                for (var d = [], b = this.getDocument().$.documentElement, c = this.$; c && c != b;) {
                    var e = c.parentNode;
                    e && d.unshift(this.getIndex.call({
                        $: c
                    }, a));
                    c = e
                }
                return d
            },
            getDocument: function() {
                return new CKEDITOR.dom.document(this.$.ownerDocument || this.$.parentNode.ownerDocument)
            },
            getIndex: function(a) {
                function d(a, c) {
                    var q = c ? a.nextSibling : a.previousSibling;
                    return q && q.nodeType == CKEDITOR.NODE_TEXT ? b(q) ? d(q, c) : q : null
                }

                function b(a) {
                    return !a.nodeValue || a.nodeValue == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE
                }
                var c = this.$,
                    e = -1,
                    g;
                if (!this.$.parentNode || a && c.nodeType == CKEDITOR.NODE_TEXT && b(c) && !d(c) && !d(c, !0)) return -1;
                do a && c != this.$ && c.nodeType == CKEDITOR.NODE_TEXT && (g || b(c)) || (e++, g = c.nodeType == CKEDITOR.NODE_TEXT); while (c = c.previousSibling);
                return e
            },
            getNextSourceNode: function(a, d, b) {
                if (b && !b.call) {
                    var c = b;
                    b = function(a) {
                        return !a.equals(c)
                    }
                }
                a = !a && this.getFirst && this.getFirst();
                var e;
                if (!a) {
                    if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
                    a = this.getNext()
                }
                for (; !a && (e = (e || this).getParent());) {
                    if (b && !1 === b(e, !0)) return null;
                    a = e.getNext()
                }
                return !a || b && !1 === b(a) ? null : d && d != a.type ? a.getNextSourceNode(!1, d, b) : a
            },
            getPreviousSourceNode: function(a, d, b) {
                if (b && !b.call) {
                    var c = b;
                    b = function(a) {
                        return !a.equals(c)
                    }
                }
                a = !a && this.getLast && this.getLast();
                var e;
                if (!a) {
                    if (this.type == CKEDITOR.NODE_ELEMENT && b && !1 === b(this, !0)) return null;
                    a = this.getPrevious()
                }
                for (; !a && (e = (e || this).getParent());) {
                    if (b && !1 === b(e, !0)) return null;
                    a = e.getPrevious()
                }
                return !a || b && !1 === b(a) ? null : d && a.type != d ? a.getPreviousSourceNode(!1, d, b) : a
            },
            getPrevious: function(a) {
                var d = this.$,
                    b;
                do b = (d = d.previousSibling) && 10 != d.nodeType && new CKEDITOR.dom.node(d); while (b && a && !a(b));
                return b
            },
            getNext: function(a) {
                var d = this.$,
                    b;
                do b = (d = d.nextSibling) && new CKEDITOR.dom.node(d); while (b && a && !a(b));
                return b
            },
            getParent: function(a) {
                var d = this.$.parentNode;
                return d && (d.nodeType == CKEDITOR.NODE_ELEMENT || a && d.nodeType == CKEDITOR.NODE_DOCUMENT_FRAGMENT) ? new CKEDITOR.dom.node(d) : null
            },
            getParents: function(a) {
                var d = this,
                    b = [];
                do b[a ? "push" : "unshift"](d); while (d = d.getParent());
                return b
            },
            getCommonAncestor: function(a) {
                if (a.equals(this)) return this;
                if (a.contains && a.contains(this)) return a;
                var d = this.contains ? this : this.getParent();
                do
                    if (d.contains(a)) return d;
                while (d = d.getParent());
                return null
            },
            getPosition: function(a) {
                var d = this.$,
                    b = a.$;
                if (d.compareDocumentPosition) return d.compareDocumentPosition(b);
                if (d == b) return CKEDITOR.POSITION_IDENTICAL;
                if (this.type == CKEDITOR.NODE_ELEMENT && a.type == CKEDITOR.NODE_ELEMENT) {
                    if (d.contains) {
                        if (d.contains(b)) return CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING;
                        if (b.contains(d)) return CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
                    }
                    if ("sourceIndex" in d) return 0 > d.sourceIndex || 0 > b.sourceIndex ? CKEDITOR.POSITION_DISCONNECTED : d.sourceIndex < b.sourceIndex ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING
                }
                d = this.getAddress();
                a = a.getAddress();
                for (var b = Math.min(d.length, a.length), c = 0; c < b; c++)
                    if (d[c] != a[c]) return d[c] < a[c] ? CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_FOLLOWING;
                return d.length < a.length ? CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_PRECEDING : CKEDITOR.POSITION_IS_CONTAINED + CKEDITOR.POSITION_FOLLOWING
            },
            getAscendant: function(a, d) {
                var b = this.$,
                    c, e;
                d || (b = b.parentNode);
                "function" == typeof a ? (e = !0, c = a) : (e = !1, c = function(b) {
                    b = "string" == typeof b.nodeName ? b.nodeName.toLowerCase() : "";
                    return "string" == typeof a ? b == a : b in a
                });
                for (; b;) {
                    if (c(e ? new CKEDITOR.dom.node(b) : b)) return new CKEDITOR.dom.node(b);
                    try {
                        b = b.parentNode
                    } catch (g) {
                        b = null
                    }
                }
                return null
            },
            hasAscendant: function(a, d) {
                var b = this.$;
                d || (b = b.parentNode);
                for (; b;) {
                    if (b.nodeName && b.nodeName.toLowerCase() == a) return !0;
                    b = b.parentNode
                }
                return !1
            },
            move: function(a, d) {
                a.append(this.remove(), d)
            },
            remove: function(a) {
                var d = this.$,
                    b = d.parentNode;
                if (b) {
                    if (a)
                        for (; a = d.firstChild;) b.insertBefore(d.removeChild(a), d);
                    b.removeChild(d)
                }
                return this
            },
            replace: function(a) {
                this.insertBefore(a);
                a.remove()
            },
            trim: function() {
                this.ltrim();
                this.rtrim()
            },
            ltrim: function() {
                for (var a; this.getFirst && (a = this.getFirst());) {
                    if (a.type == CKEDITOR.NODE_TEXT) {
                        var d = CKEDITOR.tools.ltrim(a.getText()),
                            b = a.getLength();
                        if (d) d.length < b && (a.split(b - d.length), this.$.removeChild(this.$.firstChild));
                        else {
                            a.remove();
                            continue
                        }
                    }
                    break
                }
            },
            rtrim: function() {
                for (var a; this.getLast && (a = this.getLast());) {
                    if (a.type == CKEDITOR.NODE_TEXT) {
                        var d = CKEDITOR.tools.rtrim(a.getText()),
                            b = a.getLength();
                        if (d) d.length < b && (a.split(d.length), this.$.lastChild.parentNode.removeChild(this.$.lastChild));
                        else {
                            a.remove();
                            continue
                        }
                    }
                    break
                }
                CKEDITOR.env.needsBrFiller && (a = this.$.lastChild) && 1 == a.type && "br" == a.nodeName.toLowerCase() && a.parentNode.removeChild(a)
            },
            isReadOnly: function(a) {
                var d = this;
                this.type != CKEDITOR.NODE_ELEMENT && (d = this.getParent());
                CKEDITOR.env.edge && d && d.is("textarea", "input") && (a = !0);
                if (!a && d && "undefined" != typeof d.$.isContentEditable) return !(d.$.isContentEditable || d.data("cke-editable"));
                for (; d;) {
                    if (d.data("cke-editable")) return !1;
                    if (d.hasAttribute("contenteditable")) return "false" == d.getAttribute("contenteditable");
                    d = d.getParent()
                }
                return !0
            }
        });
        CKEDITOR.dom.window = function(a) {
            CKEDITOR.dom.domObject.call(this, a)
        };
        CKEDITOR.dom.window.prototype = new CKEDITOR.dom.domObject;
        CKEDITOR.tools.extend(CKEDITOR.dom.window.prototype, {
            focus: function() {
                this.$.focus()
            },
            getViewPaneSize: function() {
                var a = this.$.document,
                    d = "CSS1Compat" == a.compatMode;
                return {
                    width: (d ? a.documentElement.clientWidth : a.body.clientWidth) || 0,
                    height: (d ? a.documentElement.clientHeight : a.body.clientHeight) || 0
                }
            },
            getScrollPosition: function() {
                var a = this.$;
                if ("pageXOffset" in a) return {
                    x: a.pageXOffset || 0,
                    y: a.pageYOffset || 0
                };
                a = a.document;
                return {
                    x: a.documentElement.scrollLeft || a.body.scrollLeft || 0,
                    y: a.documentElement.scrollTop || a.body.scrollTop || 0
                }
            },
            getFrame: function() {
                var a = this.$.frameElement;
                return a ? new CKEDITOR.dom.element.get(a) : null
            }
        });
        CKEDITOR.dom.document = function(a) {
            CKEDITOR.dom.domObject.call(this, a)
        };
        CKEDITOR.dom.document.prototype = new CKEDITOR.dom.domObject;
        CKEDITOR.tools.extend(CKEDITOR.dom.document.prototype, {
            type: CKEDITOR.NODE_DOCUMENT,
            appendStyleSheet: function(a) {
                if (this.$.createStyleSheet) this.$.createStyleSheet(a);
                else {
                    var d = new CKEDITOR.dom.element("link");
                    d.setAttributes({
                        rel: "stylesheet",
                        type: "text/css",
                        href: a
                    });
                    this.getHead().append(d)
                }
            },
            appendStyleText: function(a) {
                if (this.$.createStyleSheet) {
                    var d = this.$.createStyleSheet("");
                    d.cssText = a
                } else {
                    var b = new CKEDITOR.dom.element("style", this);
                    b.append(new CKEDITOR.dom.text(a, this));
                    this.getHead().append(b)
                }
                return d || b.$.sheet
            },
            createElement: function(a, d) {
                var b = new CKEDITOR.dom.element(a, this);
                d && (d.attributes && b.setAttributes(d.attributes), d.styles && b.setStyles(d.styles));
                return b
            },
            createText: function(a) {
                return new CKEDITOR.dom.text(a, this)
            },
            focus: function() {
                this.getWindow().focus()
            },
            getActive: function() {
                var a;
                try {
                    a = this.$.activeElement
                } catch (d) {
                    return null
                }
                return new CKEDITOR.dom.element(a)
            },
            getById: function(a) {
                return (a = this.$.getElementById(a)) ? new CKEDITOR.dom.element(a) : null
            },
            getByAddress: function(a, d) {
                for (var b = this.$.documentElement, c = 0; b && c < a.length; c++) {
                    var e = a[c];
                    if (d)
                        for (var g = -1, l = 0; l < b.childNodes.length; l++) {
                            var k = b.childNodes[l];
                            if (!0 !== d || 3 != k.nodeType || !k.previousSibling || 3 != k.previousSibling.nodeType)
                                if (g++, g == e) {
                                    b = k;
                                    break
                                }
                        } else b = b.childNodes[e]
                }
                return b ? new CKEDITOR.dom.node(b) : null
            },
            getElementsByTag: function(a, d) {
                CKEDITOR.env.ie && 8 >= document.documentMode || !d || (a = d + ":" + a);
                return new CKEDITOR.dom.nodeList(this.$.getElementsByTagName(a))
            },
            getHead: function() {
                var a = this.$.getElementsByTagName("head")[0];
                return a = a ? new CKEDITOR.dom.element(a) : this.getDocumentElement().append(new CKEDITOR.dom.element("head"), !0)
            },
            getBody: function() {
                return new CKEDITOR.dom.element(this.$.body)
            },
            getDocumentElement: function() {
                return new CKEDITOR.dom.element(this.$.documentElement)
            },
            getWindow: function() {
                return new CKEDITOR.dom.window(this.$.parentWindow || this.$.defaultView)
            },
            write: function(a) {
                this.$.open("text/html", "replace");
                CKEDITOR.env.ie && (a = a.replace(/(?:^\s*<!DOCTYPE[^>]*?>)|^/i, '$&\n<script data-cke-temp="1">(' + CKEDITOR.tools.fixDomain + ")();</script>"));
                this.$.write(a);
                this.$.close()
            },
            find: function(a) {
                return new CKEDITOR.dom.nodeList(this.$.querySelectorAll(a))
            },
            findOne: function(a) {
                return (a = this.$.querySelector(a)) ? new CKEDITOR.dom.element(a) : null
            },
            _getHtml5ShivFrag: function() {
                var a = this.getCustomData("html5ShivFrag");
                a || (a = this.$.createDocumentFragment(), CKEDITOR.tools.enableHtml5Elements(a, !0), this.setCustomData("html5ShivFrag", a));
                return a
            }
        });
        CKEDITOR.dom.nodeList = function(a) {
            this.$ = a
        };
        CKEDITOR.dom.nodeList.prototype = {
            count: function() {
                return this.$.length
            },
            getItem: function(a) {
                return 0 > a || a >= this.$.length ? null : (a = this.$[a]) ? new CKEDITOR.dom.node(a) : null
            }
        };
        CKEDITOR.dom.element = function(a, d) {
            "string" == typeof a && (a = (d ? d.$ : document).createElement(a));
            CKEDITOR.dom.domObject.call(this, a)
        };
        CKEDITOR.dom.element.get = function(a) {
            return (a = "string" == typeof a ? document.getElementById(a) || document.getElementsByName(a)[0] : a) && (a.$ ? a : new CKEDITOR.dom.element(a))
        };
        CKEDITOR.dom.element.prototype = new CKEDITOR.dom.node;
        CKEDITOR.dom.element.createFromHtml = function(a, d) {
            var b = new CKEDITOR.dom.element("div", d);
            b.setHtml(a);
            return b.getFirst().remove()
        };
        CKEDITOR.dom.element.setMarker = function(a, d, b, c) {
            var e = d.getCustomData("list_marker_id") || d.setCustomData("list_marker_id", CKEDITOR.tools.getNextNumber()).getCustomData("list_marker_id"),
                g = d.getCustomData("list_marker_names") || d.setCustomData("list_marker_names", {}).getCustomData("list_marker_names");
            a[e] = d;
            g[b] = 1;
            return d.setCustomData(b, c)
        };
        CKEDITOR.dom.element.clearAllMarkers = function(a) {
            for (var d in a) CKEDITOR.dom.element.clearMarkers(a, a[d], 1)
        };
        CKEDITOR.dom.element.clearMarkers = function(a, d, b) {
            var c = d.getCustomData("list_marker_names"),
                e = d.getCustomData("list_marker_id"),
                g;
            for (g in c) d.removeCustomData(g);
            d.removeCustomData("list_marker_names");
            b && (d.removeCustomData("list_marker_id"), delete a[e])
        };
        (function() {
            function a(a, b) {
                return -1 < (" " + a + " ").replace(g, " ").indexOf(" " + b + " ")
            }

            function d(a) {
                var b = !0;
                a.$.id || (a.$.id = "cke_tmp_" + CKEDITOR.tools.getNextNumber(), b = !1);
                return function() {
                    b || a.removeAttribute("id")
                }
            }

            function b(a, b) {
                return "#" + a.$.id + " " + b.split(/,\s*/).join(", #" + a.$.id + " ")
            }

            function c(a) {
                for (var b = 0, c = 0, f = l[a].length; c < f; c++) b += parseInt(this.getComputedStyle(l[a][c]) || 0, 10) || 0;
                return b
            }
            var e = document.createElement("_").classList,
                e = "undefined" !== typeof e && null !== String(e.add).match(/\[Native code\]/gi),
                g = /[\n\t\r]/g;
            CKEDITOR.tools.extend(CKEDITOR.dom.element.prototype, {
                type: CKEDITOR.NODE_ELEMENT,
                addClass: e ? function(a) {
                    this.$.classList.add(a);
                    return this
                } : function(b) {
                    var c = this.$.className;
                    c && (a(c, b) || (c += " " + b));
                    this.$.className = c || b;
                    return this
                },
                removeClass: e ? function(a) {
                    var b = this.$;
                    b.classList.remove(a);
                    b.className || b.removeAttribute("class");
                    return this
                } : function(b) {
                    var c = this.getAttribute("class");
                    c && a(c, b) && ((c = c.replace(new RegExp("(?:^|\\s+)" + b + "(?=\\s|$)"), "").replace(/^\s+/, "")) ? this.setAttribute("class", c) : this.removeAttribute("class"));
                    return this
                },
                hasClass: function(b) {
                    return a(this.$.className, b)
                },
                append: function(a, b) {
                    "string" == typeof a && (a = this.getDocument().createElement(a));
                    b ? this.$.insertBefore(a.$, this.$.firstChild) : this.$.appendChild(a.$);
                    return a
                },
                appendHtml: function(a) {
                    if (this.$.childNodes.length) {
                        var b = new CKEDITOR.dom.element("div", this.getDocument());
                        b.setHtml(a);
                        b.moveChildren(this)
                    } else this.setHtml(a)
                },
                appendText: function(a) {
                    null != this.$.text && CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? this.$.text += a : this.append(new CKEDITOR.dom.text(a))
                },
                appendBogus: function(a) {
                    if (a || CKEDITOR.env.needsBrFiller) {
                        for (a = this.getLast(); a && a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.rtrim(a.getText());) a = a.getPrevious();
                        a && a.is && a.is("br") || (a = this.getDocument().createElement("br"), CKEDITOR.env.gecko && a.setAttribute("type", "_moz"), this.append(a))
                    }
                },
                breakParent: function(a, b) {
                    var c = new CKEDITOR.dom.range(this.getDocument());
                    c.setStartAfter(this);
                    c.setEndAfter(a);
                    var f = c.extractContents(!1, b || !1);
                    c.insertNode(this.remove());
                    f.insertAfterNode(this)
                },
                contains: document.compareDocumentPosition ? function(a) {
                    return !!(this.$.compareDocumentPosition(a.$) & 16)
                } : function(a) {
                    var b = this.$;
                    return a.type != CKEDITOR.NODE_ELEMENT ? b.contains(a.getParent().$) : b != a.$ && b.contains(a.$)
                },
                focus: function() {
                    function a() {
                        try {
                            this.$.focus()
                        } catch (b) {}
                    }
                    return function(b) {
                        b ? CKEDITOR.tools.setTimeout(a, 100, this) : a.call(this)
                    }
                }(),
                getHtml: function() {
                    var a = this.$.innerHTML;
                    return CKEDITOR.env.ie ? a.replace(/<\?[^>]*>/g, "") : a
                },
                getOuterHtml: function() {
                    if (this.$.outerHTML) return this.$.outerHTML.replace(/<\?[^>]*>/, "");
                    var a = this.$.ownerDocument.createElement("div");
                    a.appendChild(this.$.cloneNode(!0));
                    return a.innerHTML
                },
                getClientRect: function() {
                    var a = CKEDITOR.tools.extend({}, this.$.getBoundingClientRect());
                    !a.width && (a.width = a.right - a.left);
                    !a.height && (a.height = a.bottom - a.top);
                    return a
                },
                setHtml: CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? function(a) {
                    try {
                        var b = this.$;
                        if (this.getParent()) return b.innerHTML = a;
                        var c = this.getDocument()._getHtml5ShivFrag();
                        c.appendChild(b);
                        b.innerHTML = a;
                        c.removeChild(b);
                        return a
                    } catch (f) {
                        this.$.innerHTML = "";
                        b = new CKEDITOR.dom.element("body", this.getDocument());
                        b.$.innerHTML = a;
                        for (b = b.getChildren(); b.count();) this.append(b.getItem(0));
                        return a
                    }
                } : function(a) {
                    return this.$.innerHTML = a
                },
                setText: function() {
                    var a = document.createElement("p");
                    a.innerHTML = "x";
                    a = a.textContent;
                    return function(b) {
                        this.$[a ? "textContent" : "innerText"] = b
                    }
                }(),
                getAttribute: function() {
                    var a = function(a) {
                        return this.$.getAttribute(a, 2)
                    };
                    return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
                        switch (a) {
                            case "class":
                                a = "className";
                                break;
                            case "http-equiv":
                                a = "httpEquiv";
                                break;
                            case "name":
                                return this.$.name;
                            case "tabindex":
                                return a = this.$.getAttribute(a, 2), 0 !== a && 0 === this.$.tabIndex && (a = null), a;
                            case "checked":
                                return a = this.$.attributes.getNamedItem(a), (a.specified ? a.nodeValue : this.$.checked) ? "checked" : null;
                            case "hspace":
                            case "value":
                                return this.$[a];
                            case "style":
                                return this.$.style.cssText;
                            case "contenteditable":
                            case "contentEditable":
                                return this.$.attributes.getNamedItem("contentEditable").specified ? this.$.getAttribute("contentEditable") : null
                        }
                        return this.$.getAttribute(a, 2)
                    } : a
                }(),
                getAttributes: function(a) {
                    var b = {},
                        c = this.$.attributes,
                        f;
                    a = CKEDITOR.tools.isArray(a) ? a : [];
                    for (f = 0; f < c.length; f++) - 1 === CKEDITOR.tools.indexOf(a, c[f].name) && (b[c[f].name] = c[f].value);
                    return b
                },
                getChildren: function() {
                    return new CKEDITOR.dom.nodeList(this.$.childNodes)
                },
                getComputedStyle: document.defaultView && document.defaultView.getComputedStyle ? function(a) {
                    var b = this.getWindow().$.getComputedStyle(this.$, null);
                    return b ? b.getPropertyValue(a) : ""
                } : function(a) {
                    return this.$.currentStyle[CKEDITOR.tools.cssStyleToDomStyle(a)]
                },
                getDtd: function() {
                    var a = CKEDITOR.dtd[this.getName()];
                    this.getDtd = function() {
                        return a
                    };
                    return a
                },
                getElementsByTag: CKEDITOR.dom.document.prototype.getElementsByTag,
                getTabIndex: function() {
                    var a = this.$.tabIndex;
                    return 0 !== a || CKEDITOR.dtd.$tabIndex[this.getName()] || 0 === parseInt(this.getAttribute("tabindex"), 10) ? a : -1
                },
                getText: function() {
                    return this.$.textContent || this.$.innerText || ""
                },
                getWindow: function() {
                    return this.getDocument().getWindow()
                },
                getId: function() {
                    return this.$.id || null
                },
                getNameAtt: function() {
                    return this.$.name || null
                },
                getName: function() {
                    var a = this.$.nodeName.toLowerCase();
                    if (CKEDITOR.env.ie && 8 >= document.documentMode) {
                        var b = this.$.scopeName;
                        "HTML" != b && (a = b.toLowerCase() + ":" + a)
                    }
                    this.getName = function() {
                        return a
                    };
                    return this.getName()
                },
                getValue: function() {
                    return this.$.value
                },
                getFirst: function(a) {
                    var b = this.$.firstChild;
                    (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getNext(a));
                    return b
                },
                getLast: function(a) {
                    var b = this.$.lastChild;
                    (b = b && new CKEDITOR.dom.node(b)) && a && !a(b) && (b = b.getPrevious(a));
                    return b
                },
                getStyle: function(a) {
                    return this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)]
                },
                is: function() {
                    var a = this.getName();
                    if ("object" == typeof arguments[0]) return !!arguments[0][a];
                    for (var b = 0; b < arguments.length; b++)
                        if (arguments[b] == a) return !0;
                    return !1
                },
                isEditable: function(a) {
                    var b = this.getName();
                    return this.isReadOnly() || "none" == this.getComputedStyle("display") || "hidden" == this.getComputedStyle("visibility") || CKEDITOR.dtd.$nonEditable[b] || CKEDITOR.dtd.$empty[b] || this.is("a") && (this.data("cke-saved-name") || this.hasAttribute("name")) && !this.getChildCount() ? !1 : !1 !== a ? (a = CKEDITOR.dtd[b] || CKEDITOR.dtd.span, !(!a || !a["#"])) : !0
                },
                isIdentical: function(a) {
                    var b = this.clone(0, 1);
                    a = a.clone(0, 1);
                    b.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
                    a.removeAttributes(["_moz_dirty", "data-cke-expando", "data-cke-saved-href", "data-cke-saved-name"]);
                    if (b.$.isEqualNode) return b.$.style.cssText = CKEDITOR.tools.normalizeCssText(b.$.style.cssText), a.$.style.cssText = CKEDITOR.tools.normalizeCssText(a.$.style.cssText), b.$.isEqualNode(a.$);
                    b = b.getOuterHtml();
                    a = a.getOuterHtml();
                    if (CKEDITOR.env.ie && 9 > CKEDITOR.env.version && this.is("a")) {
                        var c = this.getParent();
                        c.type == CKEDITOR.NODE_ELEMENT && (c = c.clone(), c.setHtml(b), b = c.getHtml(), c.setHtml(a), a = c.getHtml())
                    }
                    return b == a
                },
                isVisible: function() {
                    var a = (this.$.offsetHeight || this.$.offsetWidth) && "hidden" != this.getComputedStyle("visibility"),
                        b, c;
                    a && CKEDITOR.env.webkit && (b = this.getWindow(), !b.equals(CKEDITOR.document.getWindow()) && (c = b.$.frameElement) && (a = new CKEDITOR.dom.element(c).isVisible()));
                    return !!a
                },
                isEmptyInlineRemoveable: function() {
                    if (!CKEDITOR.dtd.$removeEmpty[this.getName()]) return !1;
                    for (var a = this.getChildren(), b = 0, c = a.count(); b < c; b++) {
                        var f = a.getItem(b);
                        if (f.type != CKEDITOR.NODE_ELEMENT || !f.data("cke-bookmark"))
                            if (f.type == CKEDITOR.NODE_ELEMENT && !f.isEmptyInlineRemoveable() || f.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(f.getText())) return !1
                    }
                    return !0
                },
                hasAttributes: CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function() {
                    for (var a = this.$.attributes, b = 0; b < a.length; b++) {
                        var c = a[b];
                        switch (c.nodeName) {
                            case "class":
                                if (this.getAttribute("class")) return !0;
                            case "data-cke-expando":
                                continue;
                            default:
                                if (c.specified) return !0
                        }
                    }
                    return !1
                } : function() {
                    var a = this.$.attributes,
                        b = a.length,
                        c = {
                            "data-cke-expando": 1,
                            _moz_dirty: 1
                        };
                    return 0 < b && (2 < b || !c[a[0].nodeName] || 2 == b && !c[a[1].nodeName])
                },
                hasAttribute: function() {
                    function a(b) {
                        var c = this.$.attributes.getNamedItem(b);
                        if ("input" == this.getName()) switch (b) {
                            case "class":
                                return 0 < this.$.className.length;
                            case "checked":
                                return !!this.$.checked;
                            case "value":
                                return b = this.getAttribute("type"), "checkbox" == b || "radio" == b ? "on" != this.$.value : !!this.$.value
                        }
                        return c ? c.specified : !1
                    }
                    return CKEDITOR.env.ie ? 8 > CKEDITOR.env.version ? function(b) {
                        return "name" == b ? !!this.$.name : a.call(this, b)
                    } : a : function(a) {
                        return !!this.$.attributes.getNamedItem(a)
                    }
                }(),
                hide: function() {
                    this.setStyle("display", "none")
                },
                moveChildren: function(a, b) {
                    var c = this.$;
                    a = a.$;
                    if (c != a) {
                        var f;
                        if (b)
                            for (; f = c.lastChild;) a.insertBefore(c.removeChild(f), a.firstChild);
                        else
                            for (; f = c.firstChild;) a.appendChild(c.removeChild(f))
                    }
                },
                mergeSiblings: function() {
                    function a(b, c, f) {
                        if (c && c.type == CKEDITOR.NODE_ELEMENT) {
                            for (var d = []; c.data("cke-bookmark") || c.isEmptyInlineRemoveable();)
                                if (d.push(c), c = f ? c.getNext() : c.getPrevious(), !c || c.type != CKEDITOR.NODE_ELEMENT) return;
                            if (b.isIdentical(c)) {
                                for (var k = f ? b.getLast() : b.getFirst(); d.length;) d.shift().move(b, !f);
                                c.moveChildren(b, !f);
                                c.remove();
                                k && k.type == CKEDITOR.NODE_ELEMENT && k.mergeSiblings()
                            }
                        }
                    }
                    return function(b) {
                        if (!1 === b || CKEDITOR.dtd.$removeEmpty[this.getName()] || this.is("a")) a(this, this.getNext(), !0), a(this, this.getPrevious())
                    }
                }(),
                show: function() {
                    this.setStyles({
                        display: "",
                        visibility: ""
                    })
                },
                setAttribute: function() {
                    var a = function(a, b) {
                        this.$.setAttribute(a, b);
                        return this
                    };
                    return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(b, c) {
                        "class" == b ? this.$.className = c : "style" == b ? this.$.style.cssText = c : "tabindex" == b ? this.$.tabIndex = c : "checked" == b ? this.$.checked = c : "contenteditable" == b ? a.call(this, "contentEditable", c) : a.apply(this, arguments);
                        return this
                    } : CKEDITOR.env.ie8Compat && CKEDITOR.env.secure ? function(b, c) {
                        if ("src" == b && c.match(/^http:\/\//)) try {
                            a.apply(this, arguments)
                        } catch (f) {} else a.apply(this, arguments);
                        return this
                    } : a
                }(),
                setAttributes: function(a) {
                    for (var b in a) this.setAttribute(b, a[b]);
                    return this
                },
                setValue: function(a) {
                    this.$.value = a;
                    return this
                },
                removeAttribute: function() {
                    var a = function(a) {
                        this.$.removeAttribute(a)
                    };
                    return CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) ? function(a) {
                        "class" == a ? a = "className" : "tabindex" == a ? a = "tabIndex" : "contenteditable" == a && (a = "contentEditable");
                        this.$.removeAttribute(a)
                    } : a
                }(),
                removeAttributes: function(a) {
                    if (CKEDITOR.tools.isArray(a))
                        for (var b = 0; b < a.length; b++) this.removeAttribute(a[b]);
                    else
                        for (b in a = a || this.getAttributes(), a) a.hasOwnProperty(b) && this.removeAttribute(b)
                },
                removeStyle: function(a) {
                    var b = this.$.style;
                    if (b.removeProperty || "border" != a && "margin" != a && "padding" != a) b.removeProperty ? b.removeProperty(a) : b.removeAttribute(CKEDITOR.tools.cssStyleToDomStyle(a)), this.$.style.cssText || this.removeAttribute("style");
                    else {
                        var c = ["top", "left", "right", "bottom"],
                            f;
                        "border" == a && (f = ["color", "style", "width"]);
                        for (var b = [], d = 0; d < c.length; d++)
                            if (f)
                                for (var e = 0; e < f.length; e++) b.push([a, c[d], f[e]].join("-"));
                            else b.push([a, c[d]].join("-"));
                        for (a = 0; a < b.length; a++) this.removeStyle(b[a])
                    }
                },
                setStyle: function(a, b) {
                    this.$.style[CKEDITOR.tools.cssStyleToDomStyle(a)] = b;
                    return this
                },
                setStyles: function(a) {
                    for (var b in a) this.setStyle(b, a[b]);
                    return this
                },
                setOpacity: function(a) {
                    CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? (a = Math.round(100 * a), this.setStyle("filter", 100 <= a ? "" : "progid:DXImageTransform.Microsoft.Alpha(opacity=" + a + ")")) : this.setStyle("opacity", a)
                },
                unselectable: function() {
                    this.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "none"));
                    if (CKEDITOR.env.ie) {
                        this.setAttribute("unselectable", "on");
                        for (var a, b = this.getElementsByTag("*"), c = 0, f = b.count(); c < f; c++) a = b.getItem(c), a.setAttribute("unselectable", "on")
                    }
                },
                getPositionedAncestor: function() {
                    for (var a = this;
                        "html" != a.getName();) {
                        if ("static" != a.getComputedStyle("position")) return a;
                        a = a.getParent()
                    }
                    return null
                },
                getDocumentPosition: function(a) {
                    var b = 0,
                        c = 0,
                        f = this.getDocument(),
                        d = f.getBody(),
                        e = "BackCompat" == f.$.compatMode;
                    if (document.documentElement.getBoundingClientRect) {
                        var t = this.$.getBoundingClientRect(),
                            g = f.$.documentElement,
                            p = g.clientTop || d.$.clientTop || 0,
                            x = g.clientLeft || d.$.clientLeft || 0,
                            l = !0;
                        CKEDITOR.env.ie && (l = f.getDocumentElement().contains(this), f = f.getBody().contains(this), l = e && f || !e && l);
                        l && (CKEDITOR.env.webkit || CKEDITOR.env.ie && 12 <= CKEDITOR.env.version ? (b = d.$.scrollLeft || g.scrollLeft, c = d.$.scrollTop || g.scrollTop) : (c = e ? d.$ : g, b = c.scrollLeft, c = c.scrollTop), b = t.left + b - x, c = t.top + c - p)
                    } else
                        for (p = this, x = null; p && "body" != p.getName() && "html" != p.getName();) {
                            b += p.$.offsetLeft - p.$.scrollLeft;
                            c += p.$.offsetTop - p.$.scrollTop;
                            p.equals(this) || (b += p.$.clientLeft || 0, c += p.$.clientTop || 0);
                            for (; x && !x.equals(p);) b -= x.$.scrollLeft, c -= x.$.scrollTop, x = x.getParent();
                            x = p;
                            p = (t = p.$.offsetParent) ? new CKEDITOR.dom.element(t) : null
                        }
                    a && (t = this.getWindow(), p = a.getWindow(), !t.equals(p) && t.$.frameElement && (a = new CKEDITOR.dom.element(t.$.frameElement).getDocumentPosition(a), b += a.x, c += a.y));
                    document.documentElement.getBoundingClientRect || !CKEDITOR.env.gecko || e || (b += this.$.clientLeft ? 1 : 0, c += this.$.clientTop ? 1 : 0);
                    return {
                        x: b,
                        y: c
                    }
                },
                scrollIntoView: function(a) {
                    var b = this.getParent();
                    if (b) {
                        do
                            if ((b.$.clientWidth && b.$.clientWidth < b.$.scrollWidth || b.$.clientHeight && b.$.clientHeight < b.$.scrollHeight) && !b.is("body") && this.scrollIntoParent(b, a, 1), b.is("html")) {
                                var c = b.getWindow();
                                try {
                                    var f = c.$.frameElement;
                                    f && (b = new CKEDITOR.dom.element(f))
                                } catch (d) {}
                            }
                        while (b = b.getParent())
                    }
                },
                scrollIntoParent: function(a, b, c) {
                    var f, d, e, t;

                    function g(b, c) {
                        /body|html/.test(a.getName()) ? a.getWindow().$.scrollBy(b, c) : (a.$.scrollLeft += b, a.$.scrollTop += c)
                    }

                    function p(a, b) {
                        var c = {
                            x: 0,
                            y: 0
                        };
                        if (!a.is(l ? "body" : "html")) {
                            var f = a.$.getBoundingClientRect();
                            c.x = f.left;
                            c.y = f.top
                        }
                        f = a.getWindow();
                        f.equals(b) || (f = p(CKEDITOR.dom.element.get(f.$.frameElement), b), c.x += f.x, c.y += f.y);
                        return c
                    }

                    function x(a, b) {
                        return parseInt(a.getComputedStyle("margin-" + b) || 0, 10) || 0
                    }!a && (a = this.getWindow());
                    e = a.getDocument();
                    var l = "BackCompat" == e.$.compatMode;
                    a instanceof CKEDITOR.dom.window && (a = l ? e.getBody() : e.getDocumentElement());
                    e = a.getWindow();
                    d = p(this, e);
                    var u = p(a, e),
                        r = this.$.offsetHeight;
                    f = this.$.offsetWidth;
                    var h = a.$.clientHeight,
                        n = a.$.clientWidth;
                    e = d.x - x(this, "left") - u.x || 0;
                    t = d.y - x(this, "top") - u.y || 0;
                    f = d.x + f + x(this, "right") - (u.x + n) || 0;
                    d = d.y + r + x(this, "bottom") - (u.y + h) || 0;
                    (0 > t || 0 < d) && g(0, !0 === b ? t : !1 === b ? d : 0 > t ? t : d);
                    c && (0 > e || 0 < f) && g(0 > e ? e : f, 0)
                },
                setState: function(a, b, c) {
                    b = b || "cke";
                    switch (a) {
                        case CKEDITOR.TRISTATE_ON:
                            this.addClass(b + "_on");
                            this.removeClass(b + "_off");
                            this.removeClass(b + "_disabled");
                            c && this.setAttribute("aria-pressed", !0);
                            c && this.removeAttribute("aria-disabled");
                            break;
                        case CKEDITOR.TRISTATE_DISABLED:
                            this.addClass(b + "_disabled");
                            this.removeClass(b + "_off");
                            this.removeClass(b + "_on");
                            c && this.setAttribute("aria-disabled", !0);
                            c && this.removeAttribute("aria-pressed");
                            break;
                        default:
                            this.addClass(b + "_off"), this.removeClass(b + "_on"), this.removeClass(b + "_disabled"), c && this.removeAttribute("aria-pressed"), c && this.removeAttribute("aria-disabled")
                    }
                },
                getFrameDocument: function() {
                    var a = this.$;
                    try {
                        a.contentWindow.document
                    } catch (b) {
                        a.src = a.src
                    }
                    return a && new CKEDITOR.dom.document(a.contentWindow.document)
                },
                copyAttributes: function(a, b) {
                    var c = this.$.attributes;
                    b = b || {};
                    for (var f = 0; f < c.length; f++) {
                        var d = c[f],
                            e = d.nodeName.toLowerCase(),
                            t;
                        if (!(e in b))
                            if ("checked" == e && (t = this.getAttribute(e))) a.setAttribute(e, t);
                            else if (!CKEDITOR.env.ie || this.hasAttribute(e)) t = this.getAttribute(e), null === t && (t = d.nodeValue), a.setAttribute(e, t)
                    }
                    "" !== this.$.style.cssText && (a.$.style.cssText = this.$.style.cssText)
                },
                renameNode: function(a) {
                    if (this.getName() != a) {
                        var b = this.getDocument();
                        a = new CKEDITOR.dom.element(a, b);
                        this.copyAttributes(a);
                        this.moveChildren(a);
                        this.getParent(!0) && this.$.parentNode.replaceChild(a.$, this.$);
                        a.$["data-cke-expando"] = this.$["data-cke-expando"];
                        this.$ = a.$;
                        delete this.getName
                    }
                },
                getChild: function() {
                    function a(b, c) {
                        var f = b.childNodes;
                        if (0 <= c && c < f.length) return f[c]
                    }
                    return function(b) {
                        var c = this.$;
                        if (b.slice)
                            for (b = b.slice(); 0 < b.length && c;) c = a(c, b.shift());
                        else c = a(c, b);
                        return c ? new CKEDITOR.dom.node(c) : null
                    }
                }(),
                getChildCount: function() {
                    return this.$.childNodes.length
                },
                disableContextMenu: function() {
                    function a(b) {
                        return b.type == CKEDITOR.NODE_ELEMENT && b.hasClass("cke_enable_context_menu")
                    }
                    this.on("contextmenu", function(b) {
                        b.data.getTarget().getAscendant(a, !0) || b.data.preventDefault()
                    })
                },
                getDirection: function(a) {
                    return a ? this.getComputedStyle("direction") || this.getDirection() || this.getParent() && this.getParent().getDirection(1) || this.getDocument().$.dir || "ltr" : this.getStyle("direction") || this.getAttribute("dir")
                },
                data: function(a, b) {
                    a = "data-" + a;
                    if (void 0 === b) return this.getAttribute(a);
                    !1 === b ? this.removeAttribute(a) : this.setAttribute(a, b);
                    return null
                },
                getEditor: function() {
                    var a = CKEDITOR.instances,
                        b, c;
                    for (b in a)
                        if (c = a[b], c.element.equals(this) && c.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) return c;
                    return null
                },
                find: function(a) {
                    var c = d(this);
                    a = new CKEDITOR.dom.nodeList(this.$.querySelectorAll(b(this, a)));
                    c();
                    return a
                },
                findOne: function(a) {
                    var c = d(this);
                    a = this.$.querySelector(b(this, a));
                    c();
                    return a ? new CKEDITOR.dom.element(a) : null
                },
                forEach: function(a, b, c) {
                    if (!(c || b && this.type != b)) var f = a(this);
                    if (!1 !== f) {
                        c = this.getChildren();
                        for (var d = 0; d < c.count(); d++) f = c.getItem(d), f.type == CKEDITOR.NODE_ELEMENT ? f.forEach(a, b) : b && f.type != b || a(f)
                    }
                }
            });
            var l = {
                width: ["border-left-width", "border-right-width", "padding-left", "padding-right"],
                height: ["border-top-width", "border-bottom-width", "padding-top", "padding-bottom"]
            };
            CKEDITOR.dom.element.prototype.setSize = function(a, b, d) {
                "number" == typeof b && (!d || CKEDITOR.env.ie && CKEDITOR.env.quirks || (b -= c.call(this, a)), this.setStyle(a, b + "px"))
            };
            CKEDITOR.dom.element.prototype.getSize = function(a, b) {
                var d = Math.max(this.$["offset" + CKEDITOR.tools.capitalize(a)], this.$["client" + CKEDITOR.tools.capitalize(a)]) || 0;
                b && (d -= c.call(this, a));
                return d
            }
        })();
        CKEDITOR.dom.documentFragment = function(a) {
            a = a || CKEDITOR.document;
            this.$ = a.type == CKEDITOR.NODE_DOCUMENT ? a.$.createDocumentFragment() : a
        };
        CKEDITOR.tools.extend(CKEDITOR.dom.documentFragment.prototype, CKEDITOR.dom.element.prototype, {
            type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
            insertAfterNode: function(a) {
                a = a.$;
                a.parentNode.insertBefore(this.$, a.nextSibling)
            },
            getHtml: function() {
                var a = new CKEDITOR.dom.element("div");
                this.clone(1, 1).appendTo(a);
                return a.getHtml().replace(/\s*data-cke-expando=".*?"/g, "")
            }
        }, !0, {
            append: 1,
            appendBogus: 1,
            clone: 1,
            getFirst: 1,
            getHtml: 1,
            getLast: 1,
            getParent: 1,
            getNext: 1,
            getPrevious: 1,
            appendTo: 1,
            moveChildren: 1,
            insertBefore: 1,
            insertAfterNode: 1,
            replace: 1,
            trim: 1,
            type: 1,
            ltrim: 1,
            rtrim: 1,
            getDocument: 1,
            getChildCount: 1,
            getChild: 1,
            getChildren: 1
        });
        (function() {
            function a(a, b) {
                var c = this.range;
                if (this._.end) return null;
                if (!this._.start) {
                    this._.start = 1;
                    if (c.collapsed) return this.end(), null;
                    c.optimize()
                }
                var f, d = c.startContainer;
                f = c.endContainer;
                var e = c.startOffset,
                    y = c.endOffset,
                    r, h = this.guard,
                    n = this.type,
                    m = a ? "getPreviousSourceNode" : "getNextSourceNode";
                if (!a && !this._.guardLTR) {
                    var z = f.type == CKEDITOR.NODE_ELEMENT ? f : f.getParent(),
                        B = f.type == CKEDITOR.NODE_ELEMENT ? f.getChild(y) : f.getNext();
                    this._.guardLTR = function(a, b) {
                        return (!b || !z.equals(a)) && (!B || !a.equals(B)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
                    }
                }
                if (a && !this._.guardRTL) {
                    var E = d.type == CKEDITOR.NODE_ELEMENT ? d : d.getParent(),
                        g = d.type == CKEDITOR.NODE_ELEMENT ? e ? d.getChild(e - 1) : null : d.getPrevious();
                    this._.guardRTL = function(a, b) {
                        return (!b || !E.equals(a)) && (!g || !a.equals(g)) && (a.type != CKEDITOR.NODE_ELEMENT || !b || !a.equals(c.root))
                    }
                }
                var l = a ? this._.guardRTL : this._.guardLTR;
                r = h ? function(a, b) {
                    return !1 === l(a, b) ? !1 : h(a, b)
                } : l;
                this.current ? f = this.current[m](!1, n, r) : (a ? f.type == CKEDITOR.NODE_ELEMENT && (f = 0 < y ? f.getChild(y - 1) : !1 === r(f, !0) ? null : f.getPreviousSourceNode(!0, n, r)) : (f = d, f.type == CKEDITOR.NODE_ELEMENT && ((f = f.getChild(e)) || (f = !1 === r(d, !0) ? null : d.getNextSourceNode(!0, n, r)))), f && !1 === r(f) && (f = null));
                for (; f && !this._.end;) {
                    this.current = f;
                    if (!this.evaluator || !1 !== this.evaluator(f)) {
                        if (!b) return f
                    } else if (b && this.evaluator) return !1;
                    f = f[m](!1, n, r)
                }
                this.end();
                return this.current = null
            }

            function d(b) {
                for (var c, f = null; c = a.call(this, b);) f = c;
                return f
            }
            CKEDITOR.dom.walker = CKEDITOR.tools.createClass({
                $: function(a) {
                    this.range = a;
                    this._ = {}
                },
                proto: {
                    end: function() {
                        this._.end = 1
                    },
                    next: function() {
                        return a.call(this)
                    },
                    previous: function() {
                        return a.call(this, 1)
                    },
                    checkForward: function() {
                        return !1 !== a.call(this, 0, 1)
                    },
                    checkBackward: function() {
                        return !1 !== a.call(this, 1, 1)
                    },
                    lastForward: function() {
                        return d.call(this)
                    },
                    lastBackward: function() {
                        return d.call(this, 1)
                    },
                    reset: function() {
                        delete this.current;
                        this._ = {}
                    }
                }
            });
            var b = {
                    block: 1,
                    "list-item": 1,
                    table: 1,
                    "table-row-group": 1,
                    "table-header-group": 1,
                    "table-footer-group": 1,
                    "table-row": 1,
                    "table-column-group": 1,
                    "table-column": 1,
                    "table-cell": 1,
                    "table-caption": 1
                },
                c = {
                    absolute: 1,
                    fixed: 1
                };
            CKEDITOR.dom.element.prototype.isBlockBoundary = function(a) {
                return "none" != this.getComputedStyle("float") || this.getComputedStyle("position") in c || !b[this.getComputedStyle("display")] ? !!(this.is(CKEDITOR.dtd.$block) || a && this.is(a)) : !0
            };
            CKEDITOR.dom.walker.blockBoundary = function(a) {
                return function(b) {
                    return !(b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary(a))
                }
            };
            CKEDITOR.dom.walker.listItemBoundary = function() {
                return this.blockBoundary({
                    br: 1
                })
            };
            CKEDITOR.dom.walker.bookmark = function(a, b) {
                function c(a) {
                    return a && a.getName && "span" == a.getName() && a.data("cke-bookmark")
                }
                return function(f) {
                    var d, e;
                    d = f && f.type != CKEDITOR.NODE_ELEMENT && (e = f.getParent()) && c(e);
                    d = a ? d : d || c(f);
                    return !!(b ^ d)
                }
            };
            CKEDITOR.dom.walker.whitespaces = function(a) {
                return function(b) {
                    var c;
                    b && b.type == CKEDITOR.NODE_TEXT && (c = !CKEDITOR.tools.trim(b.getText()) || CKEDITOR.env.webkit && b.getText() == CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE);
                    return !!(a ^ c)
                }
            };
            CKEDITOR.dom.walker.invisible = function(a) {
                var b = CKEDITOR.dom.walker.whitespaces(),
                    c = CKEDITOR.env.webkit ? 1 : 0;
                return function(f) {
                    b(f) ? f = 1 : (f.type == CKEDITOR.NODE_TEXT && (f = f.getParent()), f = f.$.offsetWidth <= c);
                    return !!(a ^ f)
                }
            };
            CKEDITOR.dom.walker.nodeType = function(a, b) {
                return function(c) {
                    return !!(b ^ c.type == a)
                }
            };
            CKEDITOR.dom.walker.bogus = function(a) {
                function b(a) {
                    return !g(a) && !l(a)
                }
                return function(c) {
                    var f = CKEDITOR.env.needsBrFiller ? c.is && c.is("br") : c.getText && e.test(c.getText());
                    f && (f = c.getParent(), c = c.getNext(b), f = f.isBlockBoundary() && (!c || c.type == CKEDITOR.NODE_ELEMENT && c.isBlockBoundary()));
                    return !!(a ^ f)
                }
            };
            CKEDITOR.dom.walker.temp = function(a) {
                return function(b) {
                    b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
                    b = b && b.hasAttribute("data-cke-temp");
                    return !!(a ^ b)
                }
            };
            var e = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
                g = CKEDITOR.dom.walker.whitespaces(),
                l = CKEDITOR.dom.walker.bookmark(),
                k = CKEDITOR.dom.walker.temp(),
                q = function(a) {
                    return l(a) || g(a) || a.type == CKEDITOR.NODE_ELEMENT && a.is(CKEDITOR.dtd.$inline) && !a.is(CKEDITOR.dtd.$empty)
                };
            CKEDITOR.dom.walker.ignored = function(a) {
                return function(b) {
                    b = g(b) || l(b) || k(b);
                    return !!(a ^ b)
                }
            };
            var w = CKEDITOR.dom.walker.ignored();
            CKEDITOR.dom.walker.empty = function(a) {
                return function(b) {
                    for (var c = 0, f = b.getChildCount(); c < f; ++c)
                        if (!w(b.getChild(c))) return !!a;
                    return !a
                }
            };
            var f = CKEDITOR.dom.walker.empty(),
                y = CKEDITOR.dom.walker.validEmptyBlockContainers = CKEDITOR.tools.extend(function(a) {
                    var b = {},
                        c;
                    for (c in a) CKEDITOR.dtd[c]["#"] && (b[c] = 1);
                    return b
                }(CKEDITOR.dtd.$block), {
                    caption: 1,
                    td: 1,
                    th: 1
                });
            CKEDITOR.dom.walker.editable = function(a) {
                return function(b) {
                    b = w(b) ? !1 : b.type == CKEDITOR.NODE_TEXT || b.type == CKEDITOR.NODE_ELEMENT && (b.is(CKEDITOR.dtd.$inline) || b.is("hr") || "false" == b.getAttribute("contenteditable") || !CKEDITOR.env.needsBrFiller && b.is(y) && f(b)) ? !0 : !1;
                    return !!(a ^ b)
                }
            };
            CKEDITOR.dom.element.prototype.getBogus = function() {
                var a = this;
                do a = a.getPreviousSourceNode(); while (q(a));
                return a && (CKEDITOR.env.needsBrFiller ? a.is && a.is("br") : a.getText && e.test(a.getText())) ? a : !1
            }
        })();
        CKEDITOR.dom.range = function(a) {
            this.endOffset = this.endContainer = this.startOffset = this.startContainer = null;
            this.collapsed = !0;
            var d = a instanceof CKEDITOR.dom.document;
            this.document = d ? a : a.getDocument();
            this.root = d ? a.getBody() : a
        };
        (function() {
            function a(a) {
                a.collapsed = a.startContainer && a.endContainer && a.startContainer.equals(a.endContainer) && a.startOffset == a.endOffset
            }

            function d(a, b, c, d, e) {
                function p(a, b, c, f) {
                    var d = c ? a.getPrevious() : a.getNext();
                    if (f && k) return d;
                    h || f ? b.append(a.clone(!0, e), c) : (a.remove(), r && b.append(a));
                    return d
                }

                function g() {
                    var a, b, c, f = Math.min(v.length, I.length);
                    for (a = 0; a < f; a++)
                        if (b = v[a], c = I[a], !b.equals(c)) return a;
                    return a - 1
                }

                function l() {
                    var b = J - 1,
                        c = H && w && !n.equals(m);
                    b < F - 1 || b < L - 1 || c ? (c ? a.moveToPosition(m, CKEDITOR.POSITION_BEFORE_START) : L == b + 1 && C ? a.moveToPosition(I[b], CKEDITOR.POSITION_BEFORE_END) : a.moveToPosition(I[b + 1], CKEDITOR.POSITION_BEFORE_START), d && (b = v[b + 1]) && b.type == CKEDITOR.NODE_ELEMENT && (c = CKEDITOR.dom.element.createFromHtml('<span data-cke-bookmark="1" style="display:none">&nbsp;</span>', a.document), c.insertAfter(b), b.mergeSiblings(!1), a.moveToBookmark({
                        startNode: c
                    }))) : a.collapse(!0)
                }
                a.optimizeBookmark();
                var k = 0 === b,
                    r = 1 == b,
                    h = 2 == b;
                b = h || r;
                var n = a.startContainer,
                    m = a.endContainer,
                    z = a.startOffset,
                    B = a.endOffset,
                    E, C, H, w, q, Q;
                if (h && m.type == CKEDITOR.NODE_TEXT && n.equals(m)) n = a.document.createText(n.substring(z, B)), c.append(n);
                else {
                    m.type == CKEDITOR.NODE_TEXT ? h ? Q = !0 : m = m.split(B) : 0 < m.getChildCount() ? B >= m.getChildCount() ? (m = m.getChild(B - 1), C = !0) : m = m.getChild(B) : w = C = !0;
                    n.type == CKEDITOR.NODE_TEXT ? h ? q = !0 : n.split(z) : 0 < n.getChildCount() ? 0 === z ? (n = n.getChild(z), E = !0) : n = n.getChild(z - 1) : H = E = !0;
                    for (var v = n.getParents(), I = m.getParents(), J = g(), F = v.length - 1, L = I.length - 1, K = c, ba, Z, V, fa = -1, N = J; N <= F; N++) {
                        Z = v[N];
                        V = Z.getNext();
                        for (N != F || Z.equals(I[N]) && F < L ? b && (ba = K.append(Z.clone(0, e))) : E ? p(Z, K, !1, H) : q && K.append(a.document.createText(Z.substring(z))); V;) {
                            if (V.equals(I[N])) {
                                fa = N;
                                break
                            }
                            V = p(V, K)
                        }
                        K = ba
                    }
                    K = c;
                    for (N = J; N <= L; N++)
                        if (c = I[N], V = c.getPrevious(), c.equals(v[N])) b && (K = K.getChild(0));
                        else {
                            N != L || c.equals(v[N]) && L < F ? b && (ba = K.append(c.clone(0, e))) : C ? p(c, K, !1, w) : Q && K.append(a.document.createText(c.substring(0, B)));
                            if (N > fa)
                                for (; V;) V = p(V, K, !0);
                            K = ba
                        }
                    h || l()
                }
            }

            function b() {
                var a = !1,
                    b = CKEDITOR.dom.walker.whitespaces(),
                    c = CKEDITOR.dom.walker.bookmark(!0),
                    d = CKEDITOR.dom.walker.bogus();
                return function(e) {
                    return c(e) || b(e) ? !0 : d(e) && !a ? a = !0 : e.type == CKEDITOR.NODE_TEXT && (e.hasAscendant("pre") || CKEDITOR.tools.trim(e.getText()).length) || e.type == CKEDITOR.NODE_ELEMENT && !e.is(g) ? !1 : !0
                }
            }

            function c(a) {
                var b = CKEDITOR.dom.walker.whitespaces(),
                    c = CKEDITOR.dom.walker.bookmark(1);
                return function(d) {
                    return c(d) || b(d) ? !0 : !a && l(d) || d.type == CKEDITOR.NODE_ELEMENT && d.is(CKEDITOR.dtd.$removeEmpty)
                }
            }

            function e(a) {
                return function() {
                    var b;
                    return this[a ? "getPreviousNode" : "getNextNode"](function(a) {
                        !b && w(a) && (b = a);
                        return q(a) && !(l(a) && a.equals(b))
                    })
                }
            }
            var g = {
                    abbr: 1,
                    acronym: 1,
                    b: 1,
                    bdo: 1,
                    big: 1,
                    cite: 1,
                    code: 1,
                    del: 1,
                    dfn: 1,
                    em: 1,
                    font: 1,
                    i: 1,
                    ins: 1,
                    label: 1,
                    kbd: 1,
                    q: 1,
                    samp: 1,
                    small: 1,
                    span: 1,
                    strike: 1,
                    strong: 1,
                    sub: 1,
                    sup: 1,
                    tt: 1,
                    u: 1,
                    "var": 1
                },
                l = CKEDITOR.dom.walker.bogus(),
                k = /^[\t\r\n ]*(?:&nbsp;|\xa0)$/,
                q = CKEDITOR.dom.walker.editable(),
                w = CKEDITOR.dom.walker.ignored(!0);
            CKEDITOR.dom.range.prototype = {
                clone: function() {
                    var a = new CKEDITOR.dom.range(this.root);
                    a._setStartContainer(this.startContainer);
                    a.startOffset = this.startOffset;
                    a._setEndContainer(this.endContainer);
                    a.endOffset = this.endOffset;
                    a.collapsed = this.collapsed;
                    return a
                },
                collapse: function(a) {
                    a ? (this._setEndContainer(this.startContainer), this.endOffset = this.startOffset) : (this._setStartContainer(this.endContainer), this.startOffset = this.endOffset);
                    this.collapsed = !0
                },
                cloneContents: function(a) {
                    var b = new CKEDITOR.dom.documentFragment(this.document);
                    this.collapsed || d(this, 2, b, !1, "undefined" == typeof a ? !0 : a);
                    return b
                },
                deleteContents: function(a) {
                    this.collapsed || d(this, 0, null, a)
                },
                extractContents: function(a, b) {
                    var c = new CKEDITOR.dom.documentFragment(this.document);
                    this.collapsed || d(this, 1, c, a, "undefined" == typeof b ? !0 : b);
                    return c
                },
                createBookmark: function(a) {
                    var b, c, d, e, p = this.collapsed;
                    b = this.document.createElement("span");
                    b.data("cke-bookmark", 1);
                    b.setStyle("display", "none");
                    b.setHtml("&nbsp;");
                    a && (d = "cke_bm_" + CKEDITOR.tools.getNextNumber(), b.setAttribute("id", d + (p ? "C" : "S")));
                    p || (c = b.clone(), c.setHtml("&nbsp;"), a && c.setAttribute("id", d + "E"), e = this.clone(), e.collapse(), e.insertNode(c));
                    e = this.clone();
                    e.collapse(!0);
                    e.insertNode(b);
                    c ? (this.setStartAfter(b), this.setEndBefore(c)) : this.moveToPosition(b, CKEDITOR.POSITION_AFTER_END);
                    return {
                        startNode: a ? d + (p ? "C" : "S") : b,
                        endNode: a ? d + "E" : c,
                        serializable: a,
                        collapsed: p
                    }
                },
                createBookmark2: function() {
                    function a(b) {
                        var f = b.container,
                            d = b.offset,
                            e;
                        e = f;
                        var g = d;
                        e = e.type != CKEDITOR.NODE_ELEMENT || 0 === g || g == e.getChildCount() ? 0 : e.getChild(g - 1).type == CKEDITOR.NODE_TEXT && e.getChild(g).type == CKEDITOR.NODE_TEXT;
                        e && (f = f.getChild(d - 1), d = f.getLength());
                        if (f.type == CKEDITOR.NODE_ELEMENT && 0 < d) {
                            a: {
                                for (e = f; d--;)
                                    if (g = e.getChild(d).getIndex(!0), 0 <= g) {
                                        d = g;
                                        break a
                                    }
                                d = -1
                            }
                            d += 1
                        }
                        if (f.type == CKEDITOR.NODE_TEXT) {
                            e = f;
                            for (g = 0;
                                (e = e.getPrevious()) && e.type == CKEDITOR.NODE_TEXT;) g += e.getText().replace(CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE, "").length;
                            e = g;
                            f.getText() ? d += e : (g = f.getPrevious(c), e ? (d = e, f = g ? g.getNext() : f.getParent().getFirst()) : (f = f.getParent(), d = g ? g.getIndex(!0) + 1 : 0))
                        }
                        b.container = f;
                        b.offset = d
                    }

                    function b(a, c) {
                        var f = c.getCustomData("cke-fillingChar");
                        if (f) {
                            var d = a.container;
                            f.equals(d) && (a.offset -= CKEDITOR.dom.selection.FILLING_CHAR_SEQUENCE.length, 0 >= a.offset && (a.offset = d.getIndex(), a.container = d.getParent()))
                        }
                    }
                    var c = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_TEXT, !0);
                    return function(c) {
                        var d = this.collapsed,
                            e = {
                                container: this.startContainer,
                                offset: this.startOffset
                            },
                            g = {
                                container: this.endContainer,
                                offset: this.endOffset
                            };
                        c && (a(e), b(e, this.root), d || (a(g), b(g, this.root)));
                        return {
                            start: e.container.getAddress(c),
                            end: d ? null : g.container.getAddress(c),
                            startOffset: e.offset,
                            endOffset: g.offset,
                            normalized: c,
                            collapsed: d,
                            is2: !0
                        }
                    }
                }(),
                moveToBookmark: function(a) {
                    if (a.is2) {
                        var b = this.document.getByAddress(a.start, a.normalized),
                            c = a.startOffset,
                            d = a.end && this.document.getByAddress(a.end, a.normalized);
                        a = a.endOffset;
                        this.setStart(b, c);
                        d ? this.setEnd(d, a) : this.collapse(!0)
                    } else b = (c = a.serializable) ? this.document.getById(a.startNode) : a.startNode, a = c ? this.document.getById(a.endNode) : a.endNode, this.setStartBefore(b), b.remove(), a ? (this.setEndBefore(a), a.remove()) : this.collapse(!0)
                },
                getBoundaryNodes: function() {
                    var a = this.startContainer,
                        b = this.endContainer,
                        c = this.startOffset,
                        d = this.endOffset,
                        e;
                    if (a.type == CKEDITOR.NODE_ELEMENT)
                        if (e = a.getChildCount(), e > c) a = a.getChild(c);
                        else if (1 > e) a = a.getPreviousSourceNode();
                    else {
                        for (a = a.$; a.lastChild;) a = a.lastChild;
                        a = new CKEDITOR.dom.node(a);
                        a = a.getNextSourceNode() || a
                    }
                    if (b.type == CKEDITOR.NODE_ELEMENT)
                        if (e = b.getChildCount(), e > d) b = b.getChild(d).getPreviousSourceNode(!0);
                        else if (1 > e) b = b.getPreviousSourceNode();
                    else {
                        for (b = b.$; b.lastChild;) b = b.lastChild;
                        b = new CKEDITOR.dom.node(b)
                    }
                    a.getPosition(b) & CKEDITOR.POSITION_FOLLOWING && (a = b);
                    return {
                        startNode: a,
                        endNode: b
                    }
                },
                getCommonAncestor: function(a, b) {
                    var c = this.startContainer,
                        d = this.endContainer,
                        c = c.equals(d) ? a && c.type == CKEDITOR.NODE_ELEMENT && this.startOffset == this.endOffset - 1 ? c.getChild(this.startOffset) : c : c.getCommonAncestor(d);
                    return b && !c.is ? c.getParent() : c
                },
                optimize: function() {
                    var a = this.startContainer,
                        b = this.startOffset;
                    a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setStartAfter(a) : this.setStartBefore(a));
                    a = this.endContainer;
                    b = this.endOffset;
                    a.type != CKEDITOR.NODE_ELEMENT && (b ? b >= a.getLength() && this.setEndAfter(a) : this.setEndBefore(a))
                },
                optimizeBookmark: function() {
                    var a = this.startContainer,
                        b = this.endContainer;
                    a.is && a.is("span") && a.data("cke-bookmark") && this.setStartAt(a, CKEDITOR.POSITION_BEFORE_START);
                    b && b.is && b.is("span") && b.data("cke-bookmark") && this.setEndAt(b, CKEDITOR.POSITION_AFTER_END)
                },
                trim: function(a, b) {
                    var c = this.startContainer,
                        d = this.startOffset,
                        e = this.collapsed;
                    if ((!a || e) && c && c.type == CKEDITOR.NODE_TEXT) {
                        if (d)
                            if (d >= c.getLength()) d = c.getIndex() + 1, c = c.getParent();
                            else {
                                var p = c.split(d),
                                    d = c.getIndex() + 1,
                                    c = c.getParent();
                                this.startContainer.equals(this.endContainer) ? this.setEnd(p, this.endOffset - this.startOffset) : c.equals(this.endContainer) && (this.endOffset += 1)
                            }
                        else d = c.getIndex(), c = c.getParent();
                        this.setStart(c, d);
                        if (e) {
                            this.collapse(!0);
                            return
                        }
                    }
                    c = this.endContainer;
                    d = this.endOffset;
                    b || e || !c || c.type != CKEDITOR.NODE_TEXT || (d ? (d >= c.getLength() || c.split(d), d = c.getIndex() + 1) : d = c.getIndex(), c = c.getParent(), this.setEnd(c, d))
                },
                enlarge: function(a, b) {
                    function c(a) {
                        return a && a.type == CKEDITOR.NODE_ELEMENT && a.hasAttribute("contenteditable") ? null : a
                    }
                    var d = new RegExp(/[^\s\ufeff]/);
                    switch (a) {
                        case CKEDITOR.ENLARGE_INLINE:
                            var e = 1;
                        case CKEDITOR.ENLARGE_ELEMENT:
                            var p = function(a, b) {
                                var c = new CKEDITOR.dom.range(l);
                                c.setStart(a, b);
                                c.setEndAt(l, CKEDITOR.POSITION_BEFORE_END);
                                var c = new CKEDITOR.dom.walker(c),
                                    f;
                                for (c.guard = function(a) {
                                        return !(a.type == CKEDITOR.NODE_ELEMENT && a.isBlockBoundary())
                                    }; f = c.next();) {
                                    if (f.type != CKEDITOR.NODE_TEXT) return !1;
                                    E = f != a ? f.getText() : f.substring(b);
                                    if (d.test(E)) return !1
                                }
                                return !0
                            };
                            if (this.collapsed) break;
                            var g = this.getCommonAncestor(),
                                l = this.root,
                                k, r, h, n, m, z = !1,
                                B, E;
                            B = this.startContainer;
                            var C = this.startOffset;
                            B.type == CKEDITOR.NODE_TEXT ? (C && (B = !CKEDITOR.tools.trim(B.substring(0, C)).length && B, z = !!B), B && ((n = B.getPrevious()) || (h = B.getParent()))) : (C && (n = B.getChild(C - 1) || B.getLast()), n || (h = B));
                            for (h = c(h); h || n;) {
                                if (h && !n) {
                                    !m && h.equals(g) && (m = !0);
                                    if (e ? h.isBlockBoundary() : !l.contains(h)) break;
                                    z && "inline" == h.getComputedStyle("display") || (z = !1, m ? k = h : this.setStartBefore(h));
                                    n = h.getPrevious()
                                }
                                for (; n;)
                                    if (B = !1, n.type == CKEDITOR.NODE_COMMENT) n = n.getPrevious();
                                    else {
                                        if (n.type == CKEDITOR.NODE_TEXT) E = n.getText(), d.test(E) && (n = null), B = /[\s\ufeff]$/.test(E);
                                        else if ((n.$.offsetWidth > (CKEDITOR.env.webkit ? 1 : 0) || b && n.is("br")) && !n.data("cke-bookmark"))
                                            if (z && CKEDITOR.dtd.$removeEmpty[n.getName()]) {
                                                E = n.getText();
                                                if (d.test(E)) n = null;
                                                else
                                                    for (var C = n.$.getElementsByTagName("*"), H = 0, w; w = C[H++];)
                                                        if (!CKEDITOR.dtd.$removeEmpty[w.nodeName.toLowerCase()]) {
                                                            n = null;
                                                            break
                                                        }
                                                n && (B = !!E.length)
                                            } else n = null;
                                        B && (z ? m ? k = h : h && this.setStartBefore(h) : z = !0);
                                        if (n) {
                                            B = n.getPrevious();
                                            if (!h && !B) {
                                                h = n;
                                                n = null;
                                                break
                                            }
                                            n = B
                                        } else h = null
                                    }
                                h && (h = c(h.getParent()))
                            }
                            B = this.endContainer;
                            C = this.endOffset;
                            h = n = null;
                            m = z = !1;
                            B.type == CKEDITOR.NODE_TEXT ? CKEDITOR.tools.trim(B.substring(C)).length ? z = !0 : (z = !B.getLength(), C == B.getLength() ? (n = B.getNext()) || (h = B.getParent()) : p(B, C) && (h = B.getParent())) : (n = B.getChild(C)) || (h = B);
                            for (; h || n;) {
                                if (h && !n) {
                                    !m && h.equals(g) && (m = !0);
                                    if (e ? h.isBlockBoundary() : !l.contains(h)) break;
                                    z && "inline" == h.getComputedStyle("display") || (z = !1, m ? r = h : h && this.setEndAfter(h));
                                    n = h.getNext()
                                }
                                for (; n;) {
                                    B = !1;
                                    if (n.type == CKEDITOR.NODE_TEXT) E = n.getText(), p(n, 0) || (n = null), B = /^[\s\ufeff]/.test(E);
                                    else if (n.type == CKEDITOR.NODE_ELEMENT) {
                                        if ((0 < n.$.offsetWidth || b && n.is("br")) && !n.data("cke-bookmark"))
                                            if (z && CKEDITOR.dtd.$removeEmpty[n.getName()]) {
                                                E = n.getText();
                                                if (d.test(E)) n = null;
                                                else
                                                    for (C = n.$.getElementsByTagName("*"), H = 0; w = C[H++];)
                                                        if (!CKEDITOR.dtd.$removeEmpty[w.nodeName.toLowerCase()]) {
                                                            n = null;
                                                            break
                                                        }
                                                n && (B = !!E.length)
                                            } else n = null
                                    } else B = 1;
                                    B && z && (m ? r = h : this.setEndAfter(h));
                                    if (n) {
                                        B = n.getNext();
                                        if (!h && !B) {
                                            h = n;
                                            n = null;
                                            break
                                        }
                                        n = B
                                    } else h = null
                                }
                                h && (h = c(h.getParent()))
                            }
                            k && r && (g = k.contains(r) ? r : k, this.setStartBefore(g), this.setEndAfter(g));
                            break;
                        case CKEDITOR.ENLARGE_BLOCK_CONTENTS:
                        case CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS:
                            h = new CKEDITOR.dom.range(this.root);
                            l = this.root;
                            h.setStartAt(l, CKEDITOR.POSITION_AFTER_START);
                            h.setEnd(this.startContainer, this.startOffset);
                            h = new CKEDITOR.dom.walker(h);
                            var q, Q, v = CKEDITOR.dom.walker.blockBoundary(a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? {
                                    br: 1
                                } : null),
                                I = null,
                                J = function(a) {
                                    if (a.type == CKEDITOR.NODE_ELEMENT && "false" == a.getAttribute("contenteditable"))
                                        if (I) {
                                            if (I.equals(a)) {
                                                I = null;
                                                return
                                            }
                                        } else I = a;
                                    else if (I) return;
                                    var b = v(a);
                                    b || (q = a);
                                    return b
                                },
                                e = function(a) {
                                    var b = J(a);
                                    !b && a.is && a.is("br") && (Q = a);
                                    return b
                                };
                            h.guard = J;
                            h = h.lastBackward();
                            q = q || l;
                            this.setStartAt(q, !q.is("br") && (!h && this.checkStartOfBlock() || h && q.contains(h)) ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_AFTER_END);
                            if (a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS) {
                                h = this.clone();
                                h = new CKEDITOR.dom.walker(h);
                                var F = CKEDITOR.dom.walker.whitespaces(),
                                    L = CKEDITOR.dom.walker.bookmark();
                                h.evaluator = function(a) {
                                    return !F(a) && !L(a)
                                };
                                if ((h = h.previous()) && h.type == CKEDITOR.NODE_ELEMENT && h.is("br")) break
                            }
                            h = this.clone();
                            h.collapse();
                            h.setEndAt(l, CKEDITOR.POSITION_BEFORE_END);
                            h = new CKEDITOR.dom.walker(h);
                            h.guard = a == CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS ? e : J;
                            q = I = Q = null;
                            h = h.lastForward();
                            q = q || l;
                            this.setEndAt(q, !h && this.checkEndOfBlock() || h && q.contains(h) ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_BEFORE_START);
                            Q && this.setEndAfter(Q)
                    }
                },
                shrink: function(a, b, c) {
                    if (!this.collapsed) {
                        a = a || CKEDITOR.SHRINK_TEXT;
                        var d = this.clone(),
                            e = this.startContainer,
                            p = this.endContainer,
                            g = this.startOffset,
                            l = this.endOffset,
                            k = 1,
                            r = 1;
                        e && e.type == CKEDITOR.NODE_TEXT && (g ? g >= e.getLength() ? d.setStartAfter(e) : (d.setStartBefore(e), k = 0) : d.setStartBefore(e));
                        p && p.type == CKEDITOR.NODE_TEXT && (l ? l >= p.getLength() ? d.setEndAfter(p) : (d.setEndAfter(p), r = 0) : d.setEndBefore(p));
                        var d = new CKEDITOR.dom.walker(d),
                            h = CKEDITOR.dom.walker.bookmark();
                        d.evaluator = function(b) {
                            return b.type == (a == CKEDITOR.SHRINK_ELEMENT ? CKEDITOR.NODE_ELEMENT : CKEDITOR.NODE_TEXT)
                        };
                        var n;
                        d.guard = function(b, d) {
                            if (h(b)) return !0;
                            if (a == CKEDITOR.SHRINK_ELEMENT && b.type == CKEDITOR.NODE_TEXT || d && b.equals(n) || !1 === c && b.type == CKEDITOR.NODE_ELEMENT && b.isBlockBoundary() || b.type == CKEDITOR.NODE_ELEMENT && b.hasAttribute("contenteditable")) return !1;
                            d || b.type != CKEDITOR.NODE_ELEMENT || (n = b);
                            return !0
                        };
                        k && (e = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastForward" : "next"]()) && this.setStartAt(e, b ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_START);
                        r && (d.reset(), (d = d[a == CKEDITOR.SHRINK_ELEMENT ? "lastBackward" : "previous"]()) && this.setEndAt(d, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_END));
                        return !(!k && !r)
                    }
                },
                insertNode: function(a) {
                    this.optimizeBookmark();
                    this.trim(!1, !0);
                    var b = this.startContainer,
                        c = b.getChild(this.startOffset);
                    c ? a.insertBefore(c) : b.append(a);
                    a.getParent() && a.getParent().equals(this.endContainer) && this.endOffset++;
                    this.setStartBefore(a)
                },
                moveToPosition: function(a, b) {
                    this.setStartAt(a, b);
                    this.collapse(!0)
                },
                moveToRange: function(a) {
                    this.setStart(a.startContainer, a.startOffset);
                    this.setEnd(a.endContainer, a.endOffset)
                },
                selectNodeContents: function(a) {
                    this.setStart(a, 0);
                    this.setEnd(a, a.type == CKEDITOR.NODE_TEXT ? a.getLength() : a.getChildCount())
                },
                setStart: function(b, c) {
                    b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex(), b = b.getParent());
                    this._setStartContainer(b);
                    this.startOffset = c;
                    this.endContainer || (this._setEndContainer(b), this.endOffset = c);
                    a(this)
                },
                setEnd: function(b, c) {
                    b.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$empty[b.getName()] && (c = b.getIndex() + 1, b = b.getParent());
                    this._setEndContainer(b);
                    this.endOffset = c;
                    this.startContainer || (this._setStartContainer(b), this.startOffset = c);
                    a(this)
                },
                setStartAfter: function(a) {
                    this.setStart(a.getParent(), a.getIndex() + 1)
                },
                setStartBefore: function(a) {
                    this.setStart(a.getParent(), a.getIndex())
                },
                setEndAfter: function(a) {
                    this.setEnd(a.getParent(), a.getIndex() + 1)
                },
                setEndBefore: function(a) {
                    this.setEnd(a.getParent(), a.getIndex())
                },
                setStartAt: function(b, c) {
                    switch (c) {
                        case CKEDITOR.POSITION_AFTER_START:
                            this.setStart(b, 0);
                            break;
                        case CKEDITOR.POSITION_BEFORE_END:
                            b.type == CKEDITOR.NODE_TEXT ? this.setStart(b, b.getLength()) : this.setStart(b, b.getChildCount());
                            break;
                        case CKEDITOR.POSITION_BEFORE_START:
                            this.setStartBefore(b);
                            break;
                        case CKEDITOR.POSITION_AFTER_END:
                            this.setStartAfter(b)
                    }
                    a(this)
                },
                setEndAt: function(b, c) {
                    switch (c) {
                        case CKEDITOR.POSITION_AFTER_START:
                            this.setEnd(b, 0);
                            break;
                        case CKEDITOR.POSITION_BEFORE_END:
                            b.type == CKEDITOR.NODE_TEXT ? this.setEnd(b, b.getLength()) : this.setEnd(b, b.getChildCount());
                            break;
                        case CKEDITOR.POSITION_BEFORE_START:
                            this.setEndBefore(b);
                            break;
                        case CKEDITOR.POSITION_AFTER_END:
                            this.setEndAfter(b)
                    }
                    a(this)
                },
                fixBlock: function(a, b) {
                    var c = this.createBookmark(),
                        d = this.document.createElement(b);
                    this.collapse(a);
                    this.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS);
                    this.extractContents().appendTo(d);
                    d.trim();
                    this.insertNode(d);
                    var e = d.getBogus();
                    e && e.remove();
                    d.appendBogus();
                    this.moveToBookmark(c);
                    return d
                },
                splitBlock: function(a, b) {
                    var c = new CKEDITOR.dom.elementPath(this.startContainer, this.root),
                        d = new CKEDITOR.dom.elementPath(this.endContainer, this.root),
                        e = c.block,
                        p = d.block,
                        g = null;
                    if (!c.blockLimit.equals(d.blockLimit)) return null;
                    "br" != a && (e || (e = this.fixBlock(!0, a), p = new CKEDITOR.dom.elementPath(this.endContainer, this.root).block), p || (p = this.fixBlock(!1, a)));
                    c = e && this.checkStartOfBlock();
                    d = p && this.checkEndOfBlock();
                    this.deleteContents();
                    e && e.equals(p) && (d ? (g = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(p, CKEDITOR.POSITION_AFTER_END), p = null) : c ? (g = new CKEDITOR.dom.elementPath(this.startContainer, this.root), this.moveToPosition(e, CKEDITOR.POSITION_BEFORE_START), e = null) : (p = this.splitElement(e, b || !1), e.is("ul", "ol") || e.appendBogus()));
                    return {
                        previousBlock: e,
                        nextBlock: p,
                        wasStartOfBlock: c,
                        wasEndOfBlock: d,
                        elementPath: g
                    }
                },
                splitElement: function(a, b) {
                    if (!this.collapsed) return null;
                    this.setEndAt(a, CKEDITOR.POSITION_BEFORE_END);
                    var c = this.extractContents(!1, b || !1),
                        d = a.clone(!1, b || !1);
                    c.appendTo(d);
                    d.insertAfter(a);
                    this.moveToPosition(a, CKEDITOR.POSITION_AFTER_END);
                    return d
                },
                removeEmptyBlocksAtEnd: function() {
                    function a(d) {
                        return function(a) {
                            return b(a) || c(a) || a.type == CKEDITOR.NODE_ELEMENT && a.isEmptyInlineRemoveable() || d.is("table") && a.is("caption") ? !1 : !0
                        }
                    }
                    var b = CKEDITOR.dom.walker.whitespaces(),
                        c = CKEDITOR.dom.walker.bookmark(!1);
                    return function(b) {
                        for (var c = this.createBookmark(), d = this[b ? "endPath" : "startPath"](), e = d.block || d.blockLimit, g; e && !e.equals(d.root) && !e.getFirst(a(e));) g = e.getParent(), this[b ? "setEndAt" : "setStartAt"](e, CKEDITOR.POSITION_AFTER_END), e.remove(1), e = g;
                        this.moveToBookmark(c)
                    }
                }(),
                startPath: function() {
                    return new CKEDITOR.dom.elementPath(this.startContainer, this.root)
                },
                endPath: function() {
                    return new CKEDITOR.dom.elementPath(this.endContainer, this.root)
                },
                checkBoundaryOfElement: function(a, b) {
                    var d = b == CKEDITOR.START,
                        e = this.clone();
                    e.collapse(d);
                    e[d ? "setStartAt" : "setEndAt"](a, d ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END);
                    e = new CKEDITOR.dom.walker(e);
                    e.evaluator = c(d);
                    return e[d ? "checkBackward" : "checkForward"]()
                },
                checkStartOfBlock: function() {
                    var a = this.startContainer,
                        c = this.startOffset;
                    CKEDITOR.env.ie && c && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.ltrim(a.substring(0, c)), k.test(a) && this.trim(0, 1));
                    this.trim();
                    a = new CKEDITOR.dom.elementPath(this.startContainer, this.root);
                    c = this.clone();
                    c.collapse(!0);
                    c.setStartAt(a.block || a.blockLimit, CKEDITOR.POSITION_AFTER_START);
                    a = new CKEDITOR.dom.walker(c);
                    a.evaluator = b();
                    return a.checkBackward()
                },
                checkEndOfBlock: function() {
                    var a = this.endContainer,
                        c = this.endOffset;
                    CKEDITOR.env.ie && a.type == CKEDITOR.NODE_TEXT && (a = CKEDITOR.tools.rtrim(a.substring(c)), k.test(a) && this.trim(1, 0));
                    this.trim();
                    a = new CKEDITOR.dom.elementPath(this.endContainer, this.root);
                    c = this.clone();
                    c.collapse(!1);
                    c.setEndAt(a.block || a.blockLimit, CKEDITOR.POSITION_BEFORE_END);
                    a = new CKEDITOR.dom.walker(c);
                    a.evaluator = b();
                    return a.checkForward()
                },
                getPreviousNode: function(a, b, c) {
                    var d = this.clone();
                    d.collapse(1);
                    d.setStartAt(c || this.root, CKEDITOR.POSITION_AFTER_START);
                    c = new CKEDITOR.dom.walker(d);
                    c.evaluator = a;
                    c.guard = b;
                    return c.previous()
                },
                getNextNode: function(a, b, c) {
                    var d = this.clone();
                    d.collapse();
                    d.setEndAt(c || this.root, CKEDITOR.POSITION_BEFORE_END);
                    c = new CKEDITOR.dom.walker(d);
                    c.evaluator = a;
                    c.guard = b;
                    return c.next()
                },
                checkReadOnly: function() {
                    function a(b, c) {
                        for (; b;) {
                            if (b.type == CKEDITOR.NODE_ELEMENT) {
                                if ("false" == b.getAttribute("contentEditable") && !b.data("cke-editable")) return 0;
                                if (b.is("html") || "true" == b.getAttribute("contentEditable") && (b.contains(c) || b.equals(c))) break
                            }
                            b = b.getParent()
                        }
                        return 1
                    }
                    return function() {
                        var b = this.startContainer,
                            c = this.endContainer;
                        return !(a(b, c) && a(c, b))
                    }
                }(),
                moveToElementEditablePosition: function(a, b) {
                    if (a.type == CKEDITOR.NODE_ELEMENT && !a.isEditable(!1)) return this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START), !0;
                    for (var c = 0; a;) {
                        if (a.type == CKEDITOR.NODE_TEXT) {
                            b && this.endContainer && this.checkEndOfBlock() && k.test(a.getText()) ? this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START) : this.moveToPosition(a, b ? CKEDITOR.POSITION_AFTER_END : CKEDITOR.POSITION_BEFORE_START);
                            c = 1;
                            break
                        }
                        if (a.type == CKEDITOR.NODE_ELEMENT)
                            if (a.isEditable()) this.moveToPosition(a, b ? CKEDITOR.POSITION_BEFORE_END : CKEDITOR.POSITION_AFTER_START), c = 1;
                            else if (b && a.is("br") && this.endContainer && this.checkEndOfBlock()) this.moveToPosition(a, CKEDITOR.POSITION_BEFORE_START);
                        else if ("false" == a.getAttribute("contenteditable") && a.is(CKEDITOR.dtd.$block)) return this.setStartBefore(a), this.setEndAfter(a), !0;
                        var d = a,
                            e = c,
                            p = void 0;
                        d.type == CKEDITOR.NODE_ELEMENT && d.isEditable(!1) && (p = d[b ? "getLast" : "getFirst"](w));
                        e || p || (p = d[b ? "getPrevious" : "getNext"](w));
                        a = p
                    }
                    return !!c
                },
                moveToClosestEditablePosition: function(a, b) {
                    var c, d = 0,
                        e, p, g = [CKEDITOR.POSITION_AFTER_END, CKEDITOR.POSITION_BEFORE_START];
                    a ? (c = new CKEDITOR.dom.range(this.root), c.moveToPosition(a, g[b ? 0 : 1])) : c = this.clone();
                    if (a && !a.is(CKEDITOR.dtd.$block)) d = 1;
                    else if (e = c[b ? "getNextEditableNode" : "getPreviousEditableNode"]()) d = 1, (p = e.type == CKEDITOR.NODE_ELEMENT) && e.is(CKEDITOR.dtd.$block) && "false" == e.getAttribute("contenteditable") ? (c.setStartAt(e, CKEDITOR.POSITION_BEFORE_START), c.setEndAt(e, CKEDITOR.POSITION_AFTER_END)) : !CKEDITOR.env.needsBrFiller && p && e.is(CKEDITOR.dom.walker.validEmptyBlockContainers) ? (c.setEnd(e, 0), c.collapse()) : c.moveToPosition(e, g[b ? 1 : 0]);
                    d && this.moveToRange(c);
                    return !!d
                },
                moveToElementEditStart: function(a) {
                    return this.moveToElementEditablePosition(a)
                },
                moveToElementEditEnd: function(a) {
                    return this.moveToElementEditablePosition(a, !0)
                },
                getEnclosedNode: function() {
                    var a = this.clone();
                    a.optimize();
                    if (a.startContainer.type != CKEDITOR.NODE_ELEMENT || a.endContainer.type != CKEDITOR.NODE_ELEMENT) return null;
                    var a = new CKEDITOR.dom.walker(a),
                        b = CKEDITOR.dom.walker.bookmark(!1, !0),
                        c = CKEDITOR.dom.walker.whitespaces(!0);
                    a.evaluator = function(a) {
                        return c(a) && b(a)
                    };
                    var d = a.next();
                    a.reset();
                    return d && d.equals(a.previous()) ? d : null
                },
                getTouchedStartNode: function() {
                    var a = this.startContainer;
                    return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.startOffset) || a
                },
                getTouchedEndNode: function() {
                    var a = this.endContainer;
                    return this.collapsed || a.type != CKEDITOR.NODE_ELEMENT ? a : a.getChild(this.endOffset - 1) || a
                },
                getNextEditableNode: e(),
                getPreviousEditableNode: e(1),
                scrollIntoView: function() {
                    var a = new CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", this.document),
                        b, c, d, e = this.clone();
                    e.optimize();
                    (d = e.startContainer.type == CKEDITOR.NODE_TEXT) ? (c = e.startContainer.getText(), b = e.startContainer.split(e.startOffset), a.insertAfter(e.startContainer)) : e.insertNode(a);
                    a.scrollIntoView();
                    d && (e.startContainer.setText(c), b.remove());
                    a.remove()
                },
                _setStartContainer: function(a) {
                    this.startContainer = a
                },
                _setEndContainer: function(a) {
                    this.endContainer = a
                }
            }
        })();
        CKEDITOR.POSITION_AFTER_START = 1;
        CKEDITOR.POSITION_BEFORE_END = 2;
        CKEDITOR.POSITION_BEFORE_START = 3;
        CKEDITOR.POSITION_AFTER_END = 4;
        CKEDITOR.ENLARGE_ELEMENT = 1;
        CKEDITOR.ENLARGE_BLOCK_CONTENTS = 2;
        CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS = 3;
        CKEDITOR.ENLARGE_INLINE = 4;
        CKEDITOR.START = 1;
        CKEDITOR.END = 2;
        CKEDITOR.SHRINK_ELEMENT = 1;
        CKEDITOR.SHRINK_TEXT = 2;
        "use strict";
        (function() {
            function a(a) {
                1 > arguments.length || (this.range = a, this.forceBrBreak = 0, this.enlargeBr = 1, this.enforceRealBlocks = 0, this._ || (this._ = {}))
            }

            function d(a) {
                var b = [];
                a.forEach(function(a) {
                    if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
                }, CKEDITOR.NODE_ELEMENT, !0);
                return b
            }

            function b(a, c, e, g) {
                a: {
                    null == g && (g = d(e));
                    for (var l; l = g.shift();)
                        if (l.getDtd().p) {
                            g = {
                                element: l,
                                remaining: g
                            };
                            break a
                        }
                    g = null
                }
                if (!g) return 0;
                if ((l = CKEDITOR.filter.instances[g.element.data("cke-filter")]) && !l.check(c)) return b(a, c, e, g.remaining);c = new CKEDITOR.dom.range(g.element);c.selectNodeContents(g.element);c = c.createIterator();c.enlargeBr = a.enlargeBr;c.enforceRealBlocks = a.enforceRealBlocks;c.activeFilter = c.filter = l;a._.nestedEditable = {
                    element: g.element,
                    container: e,
                    remaining: g.remaining,
                    iterator: c
                };
                return 1
            }

            function c(a, b, c) {
                if (!b) return !1;
                a = a.clone();
                a.collapse(!c);
                return a.checkBoundaryOfElement(b, c ? CKEDITOR.START : CKEDITOR.END)
            }
            var e = /^[\r\n\t ]+$/,
                g = CKEDITOR.dom.walker.bookmark(!1, !0),
                l = CKEDITOR.dom.walker.whitespaces(!0),
                k = function(a) {
                    return g(a) && l(a)
                },
                q = {
                    dd: 1,
                    dt: 1,
                    li: 1
                };
            a.prototype = {
                getNextParagraph: function(a) {
                    var d, l, A, t, D;
                    a = a || "p";
                    if (this._.nestedEditable) {
                        if (d = this._.nestedEditable.iterator.getNextParagraph(a)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter, d;
                        this.activeFilter = this.filter;
                        if (b(this, a, this._.nestedEditable.container, this._.nestedEditable.remaining)) return this.activeFilter = this._.nestedEditable.iterator.activeFilter,
                            this._.nestedEditable.iterator.getNextParagraph(a);
                        this._.nestedEditable = null
                    }
                    if (!this.range.root.getDtd()[a]) return null;
                    if (!this._.started) {
                        var p = this.range.clone();
                        l = p.startPath();
                        var x = p.endPath(),
                            G = !p.collapsed && c(p, l.block),
                            u = !p.collapsed && c(p, x.block, 1);
                        p.shrink(CKEDITOR.SHRINK_ELEMENT, !0);
                        G && p.setStartAt(l.block, CKEDITOR.POSITION_BEFORE_END);
                        u && p.setEndAt(x.block, CKEDITOR.POSITION_AFTER_START);
                        l = p.endContainer.hasAscendant("pre", !0) || p.startContainer.hasAscendant("pre", !0);
                        p.enlarge(this.forceBrBreak && !l || !this.enlargeBr ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
                        p.collapsed || (l = new CKEDITOR.dom.walker(p.clone()), x = CKEDITOR.dom.walker.bookmark(!0, !0), l.evaluator = x, this._.nextNode = l.next(), l = new CKEDITOR.dom.walker(p.clone()), l.evaluator = x, l = l.previous(), this._.lastNode = l.getNextSourceNode(!0, null, p.root), this._.lastNode && this._.lastNode.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(this._.lastNode.getText()) && this._.lastNode.getParent().isBlockBoundary() && (x = this.range.clone(), x.moveToPosition(this._.lastNode, CKEDITOR.POSITION_AFTER_END), x.checkEndOfBlock() && (x = new CKEDITOR.dom.elementPath(x.endContainer, x.root), this._.lastNode = (x.block || x.blockLimit).getNextSourceNode(!0))), this._.lastNode && p.root.contains(this._.lastNode) || (this._.lastNode = this._.docEndMarker = p.document.createText(""), this._.lastNode.insertAfter(l)), p = null);
                        this._.started = 1;
                        l = p
                    }
                    x = this._.nextNode;
                    p = this._.lastNode;
                    for (this._.nextNode = null; x;) {
                        var G = 0,
                            u = x.hasAscendant("pre"),
                            r = x.type != CKEDITOR.NODE_ELEMENT,
                            h = 0;
                        if (r) x.type == CKEDITOR.NODE_TEXT && e.test(x.getText()) && (r = 0);
                        else {
                            var n = x.getName();
                            if (CKEDITOR.dtd.$block[n] && "false" == x.getAttribute("contenteditable")) {
                                d = x;
                                b(this, a, d);
                                break
                            } else if (x.isBlockBoundary(this.forceBrBreak && !u && {
                                    br: 1
                                })) {
                                if ("br" == n) r = 1;
                                else if (!l && !x.getChildCount() && "hr" != n) {
                                    d = x;
                                    A = x.equals(p);
                                    break
                                }
                                l && (l.setEndAt(x, CKEDITOR.POSITION_BEFORE_START), "br" != n && (this._.nextNode = x));
                                G = 1
                            } else {
                                if (x.getFirst()) {
                                    l || (l = this.range.clone(), l.setStartAt(x, CKEDITOR.POSITION_BEFORE_START));
                                    x = x.getFirst();
                                    continue
                                }
                                r = 1
                            }
                        }
                        r && !l && (l = this.range.clone(), l.setStartAt(x, CKEDITOR.POSITION_BEFORE_START));
                        A = (!G || r) && x.equals(p);
                        if (l && !G)
                            for (; !x.getNext(k) && !A;) {
                                n = x.getParent();
                                if (n.isBlockBoundary(this.forceBrBreak && !u && {
                                        br: 1
                                    })) {
                                    G = 1;
                                    r = 0;
                                    A || n.equals(p);
                                    l.setEndAt(n, CKEDITOR.POSITION_BEFORE_END);
                                    break
                                }
                                x = n;
                                r = 1;
                                A = x.equals(p);
                                h = 1
                            }
                        r && l.setEndAt(x, CKEDITOR.POSITION_AFTER_END);
                        x = this._getNextSourceNode(x, h, p);
                        if ((A = !x) || G && l) break
                    }
                    if (!d) {
                        if (!l) return this._.docEndMarker && this._.docEndMarker.remove(), this._.nextNode = null;
                        d = new CKEDITOR.dom.elementPath(l.startContainer, l.root);
                        x = d.blockLimit;
                        G = {
                            div: 1,
                            th: 1,
                            td: 1
                        };
                        d = d.block;
                        !d && x && !this.enforceRealBlocks && G[x.getName()] && l.checkStartOfBlock() && l.checkEndOfBlock() && !x.equals(l.root) ? d = x : !d || this.enforceRealBlocks && d.is(q) ? (d = this.range.document.createElement(a), l.extractContents().appendTo(d), d.trim(), l.insertNode(d), t = D = !0) : "li" != d.getName() ? l.checkStartOfBlock() && l.checkEndOfBlock() || (d = d.clone(!1), l.extractContents().appendTo(d), d.trim(), D = l.splitBlock(), t = !D.wasStartOfBlock, D = !D.wasEndOfBlock, l.insertNode(d)) : A || (this._.nextNode = d.equals(p) ? null : this._getNextSourceNode(l.getBoundaryNodes().endNode, 1, p))
                    }
                    t && (t = d.getPrevious()) && t.type == CKEDITOR.NODE_ELEMENT && ("br" == t.getName() ? t.remove() : t.getLast() && "br" == t.getLast().$.nodeName.toLowerCase() && t.getLast().remove());
                    D && (t = d.getLast()) && t.type == CKEDITOR.NODE_ELEMENT && "br" == t.getName() && (!CKEDITOR.env.needsBrFiller || t.getPrevious(g) || t.getNext(g)) && t.remove();
                    this._.nextNode || (this._.nextNode = A || d.equals(p) || !p ? null : this._getNextSourceNode(d, 1, p));
                    return d
                },
                _getNextSourceNode: function(a, b, c) {
                    function d(a) {
                        return !(a.equals(c) || a.equals(e))
                    }
                    var e = this.range.root;
                    for (a = a.getNextSourceNode(b, null, d); !g(a);) a = a.getNextSourceNode(b, null, d);
                    return a
                }
            };
            CKEDITOR.dom.range.prototype.createIterator = function() {
                return new a(this)
            }
        })();
        CKEDITOR.command = function(a, d) {
            this.uiItems = [];
            this.exec = function(b) {
                if (this.state == CKEDITOR.TRISTATE_DISABLED || !this.checkAllowed()) return !1;
                this.editorFocus && a.focus();
                return !1 === this.fire("exec") ? !0 : !1 !== d.exec.call(this, a, b)
            };
            this.refresh = function(a, b) {
                if (!this.readOnly && a.readOnly) return !0;
                if (this.context && !b.isContextFor(this.context) || !this.checkAllowed(!0)) return this.disable(), !0;
                this.startDisabled || this.enable();
                this.modes && !this.modes[a.mode] && this.disable();
                return !1 === this.fire("refresh", {
                    editor: a,
                    path: b
                }) ? !0 : d.refresh && !1 !== d.refresh.apply(this, arguments)
            };
            var b;
            this.checkAllowed = function(c) {
                return c || "boolean" != typeof b ? b = a.activeFilter.checkFeature(this) : b
            };
            CKEDITOR.tools.extend(this, d, {
                modes: {
                    wysiwyg: 1
                },
                editorFocus: 1,
                contextSensitive: !!d.context,
                state: CKEDITOR.TRISTATE_DISABLED
            });
            CKEDITOR.event.call(this)
        };
        CKEDITOR.command.prototype = {
            enable: function() {
                this.state == CKEDITOR.TRISTATE_DISABLED && this.checkAllowed() && this.setState(this.preserveState && "undefined" != typeof this.previousState ? this.previousState : CKEDITOR.TRISTATE_OFF)
            },
            disable: function() {
                this.setState(CKEDITOR.TRISTATE_DISABLED)
            },
            setState: function(a) {
                if (this.state == a || a != CKEDITOR.TRISTATE_DISABLED && !this.checkAllowed()) return !1;
                this.previousState = this.state;
                this.state = a;
                this.fire("state");
                return !0
            },
            toggleState: function() {
                this.state == CKEDITOR.TRISTATE_OFF ? this.setState(CKEDITOR.TRISTATE_ON) : this.state == CKEDITOR.TRISTATE_ON && this.setState(CKEDITOR.TRISTATE_OFF)
            }
        };
        CKEDITOR.event.implementOn(CKEDITOR.command.prototype);
        CKEDITOR.ENTER_P = 1;
        CKEDITOR.ENTER_BR = 2;
        CKEDITOR.ENTER_DIV = 3;
        CKEDITOR.config = {
            customConfig: "config.js",
            autoUpdateElement: !0,
            language: "",
            defaultLanguage: "en",
            contentsLangDirection: "",
            enterMode: CKEDITOR.ENTER_P,
            forceEnterMode: !1,
            shiftEnterMode: CKEDITOR.ENTER_BR,
            docType: "<!DOCTYPE html>",
            bodyId: "",
            bodyClass: "",
            fullPage: !1,
            height: 200,
            contentsCss: CKEDITOR.getUrl("contents.css"),
            extraPlugins: "",
            removePlugins: "",
            protectedSource: [],
            tabIndex: 0,
            width: "",
            baseFloatZIndex: 1e4,
            blockedKeystrokes: [CKEDITOR.CTRL + 66, CKEDITOR.CTRL + 73, CKEDITOR.CTRL + 85]
        };
        (function() {
            function a(a, b, c, d, e) {
                var h, n;
                a = [];
                for (h in b) {
                    n = b[h];
                    n = "boolean" == typeof n ? {} : "function" == typeof n ? {
                        match: n
                    } : H(n);
                    "$" != h.charAt(0) && (n.elements = h);
                    c && (n.featureName = c.toLowerCase());
                    var m = n;
                    m.elements = l(m.elements, /\s+/) || null;
                    m.propertiesOnly = m.propertiesOnly || !0 === m.elements;
                    var f = /\s*,\s*/,
                        p = void 0;
                    for (p in Q) {
                        m[p] = l(m[p], f) || null;
                        var F = m,
                            r = v[p],
                            g = l(m[v[p]], f),
                            z = m[p],
                            E = [],
                            B = !0,
                            L = void 0;
                        g ? B = !1 : g = {};
                        for (L in z) "!" == L.charAt(0) && (L = L.slice(1), E.push(L), g[L] = !0, B = !1);
                        for (; L = E.pop();) z[L] = z["!" + L], delete z["!" + L];
                        F[r] = (B ? !1 : g) || null
                    }
                    m.match = m.match || null;
                    d.push(n);
                    a.push(n)
                }
                b = e.elements;
                e = e.generic;
                var k;
                c = 0;
                for (d = a.length; c < d; ++c) {
                    h = H(a[c]);
                    n = !0 === h.classes || !0 === h.styles || !0 === h.attributes;
                    m = h;
                    p = r = f = void 0;
                    for (f in Q) m[f] = G(m[f]);
                    F = !0;
                    for (p in v) {
                        f = v[p];
                        r = m[f];
                        g = [];
                        z = void 0;
                        for (z in r) - 1 < z.indexOf("*") ? g.push(new RegExp("^" + z.replace(/\*/g, ".*") + "$")) : g.push(z);
                        r = g;
                        r.length && (m[f] = r, F = !1)
                    }
                    m.nothingRequired = F;
                    m.noProperties = !(m.attributes || m.classes || m.styles);
                    if (!0 === h.elements || null === h.elements) e[n ? "unshift" : "push"](h);
                    else
                        for (k in m = h.elements, delete h.elements, m)
                            if (b[k]) b[k][n ? "unshift" : "push"](h);
                            else b[k] = [h]
                }
            }

            function d(a, c, d, h) {
                if (!a.match || a.match(c))
                    if (h || k(a, c))
                        if (a.propertiesOnly || (d.valid = !0), d.allAttributes || (d.allAttributes = b(a.attributes, c.attributes, d.validAttributes)), d.allStyles || (d.allStyles = b(a.styles, c.styles, d.validStyles)), !d.allClasses) {
                            a = a.classes;
                            c = c.classes;
                            h = d.validClasses;
                            if (a)
                                if (!0 === a) a = !0;
                                else {
                                    for (var n = 0, e = c.length, m; n < e; ++n) m = c[n], h[m] || (h[m] = a(m));
                                    a = !1
                                }
                            else a = !1;
                            d.allClasses = a
                        }
            }

            function b(a, b, c) {
                if (!a) return !1;
                if (!0 === a) return !0;
                for (var d in b) c[d] || (c[d] = a(d));
                return !1
            }

            function c(a, b, c) {
                if (!a.match || a.match(b)) {
                    if (a.noProperties) return !1;
                    c.hadInvalidAttribute = e(a.attributes, b.attributes) || c.hadInvalidAttribute;
                    c.hadInvalidStyle = e(a.styles, b.styles) || c.hadInvalidStyle;
                    a = a.classes;
                    b = b.classes;
                    if (a) {
                        for (var d = !1, h = !0 === a, n = b.length; n--;)
                            if (h || a(b[n])) b.splice(n, 1), d = !0;
                        a = d
                    } else a = !1;
                    c.hadInvalidClass = a || c.hadInvalidClass
                }
            }

            function e(a, b) {
                if (!a) return !1;
                var c = !1,
                    d = !0 === a,
                    h;
                for (h in b)
                    if (d || a(h)) delete b[h], c = !0;
                return c
            }

            function g(a, b, c) {
                if (a.disabled || a.customConfig && !c || !b) return !1;
                a._.cachedChecks = {};
                return !0
            }

            function l(a, b) {
                if (!a) return !1;
                if (!0 === a) return a;
                if ("string" == typeof a) return a = R(a), "*" == a ? !0 : CKEDITOR.tools.convertArrayToObject(a.split(b));
                if (CKEDITOR.tools.isArray(a)) return a.length ? CKEDITOR.tools.convertArrayToObject(a) : !1;
                var c = {},
                    d = 0,
                    h;
                for (h in a) c[h] = a[h], d++;
                return d ? c : !1
            }

            function k(a, b) {
                if (a.nothingRequired) return !0;
                var c, d, h, n;
                if (h = a.requiredClasses)
                    for (n = b.classes, c = 0; c < h.length; ++c)
                        if (d = h[c], "string" == typeof d) {
                            if (-1 == CKEDITOR.tools.indexOf(n, d)) return !1
                        } else if (!CKEDITOR.tools.checkIfAnyArrayItemMatches(n, d)) return !1;
                return q(b.styles, a.requiredStyles) && q(b.attributes, a.requiredAttributes)
            }

            function q(a, b) {
                if (!b) return !0;
                for (var c = 0, d; c < b.length; ++c)
                    if (d = b[c], "string" == typeof d) {
                        if (!(d in a)) return !1
                    } else if (!CKEDITOR.tools.checkIfAnyObjectPropertyMatches(a, d)) return !1;
                return !0
            }

            function w(a) {
                if (!a) return {};
                a = a.split(/\s*,\s*/).sort();
                for (var b = {}; a.length;) b[a.shift()] = "cke-test";
                return b
            }

            function f(a) {
                var b, c, d, h, n = {},
                    e = 1;
                for (a = R(a); b = a.match(I);)(c = b[2]) ? (d = y(c, "styles"), h = y(c, "attrs"), c = y(c, "classes")) : d = h = c = null, n["$" + e++] = {
                    elements: b[1],
                    classes: c,
                    styles: d,
                    attributes: h
                }, a = a.slice(b[0].length);
                return n
            }

            function y(a, b) {
                var c = a.match(J[b]);
                return c ? R(c[1]) : null
            }

            function A(a) {
                var b = a.styleBackup = a.attributes.style,
                    c = a.classBackup = a.attributes["class"];
                a.styles || (a.styles = CKEDITOR.tools.parseCssText(b || "", 1));
                a.classes || (a.classes = c ? c.split(/\s+/) : [])
            }

            function t(a, b, h, e) {
                var m = 0,
                    f;
                e.toHtml && (b.name = b.name.replace(F, "$1"));
                if (e.doCallbacks && a.elementCallbacks) {
                    a: {
                        f = a.elementCallbacks;
                        for (var g = 0, r = f.length, z; g < r; ++g)
                            if (z = f[g](b)) {
                                f = z;
                                break a
                            }
                        f = void 0
                    }
                    if (f) return f
                }
                if (e.doTransform && (f = a._.transformations[b.name])) {
                    A(b);
                    for (g = 0; g < f.length; ++g) n(a, b, f[g]);
                    p(b)
                }
                if (e.doFilter) {
                    a: {
                        g = b.name;r = a._;a = r.allowedRules.elements[g];f = r.allowedRules.generic;g = r.disallowedRules.elements[g];r = r.disallowedRules.generic;z = e.skipRequired;
                        var E = {
                                valid: !1,
                                validAttributes: {},
                                validClasses: {},
                                validStyles: {},
                                allAttributes: !1,
                                allClasses: !1,
                                allStyles: !1,
                                hadInvalidAttribute: !1,
                                hadInvalidClass: !1,
                                hadInvalidStyle: !1
                            },
                            v, l;
                        if (a || f) {
                            A(b);
                            if (g)
                                for (v = 0, l = g.length; v < l; ++v)
                                    if (!1 === c(g[v], b, E)) {
                                        a = null;
                                        break a
                                    }
                            if (r)
                                for (v = 0, l = r.length; v < l; ++v) c(r[v], b, E);
                            if (a)
                                for (v = 0, l = a.length; v < l; ++v) d(a[v], b, E, z);
                            if (f)
                                for (v = 0, l = f.length; v < l; ++v) d(f[v], b, E, z);
                            a = E
                        } else a = null
                    }
                    if (!a || !a.valid) return h.push(b), 1;l = a.validAttributes;
                    var B = a.validStyles;f = a.validClasses;
                    var g = b.attributes,
                        k = b.styles,
                        r = b.classes;z = b.classBackup;
                    var J = b.styleBackup,
                        C, I, K = [],
                        E = [],
                        H = /^data-cke-/;v = !1;delete g.style;delete g["class"];delete b.classBackup;delete b.styleBackup;
                    if (!a.allAttributes)
                        for (C in g) l[C] || (H.test(C) ? C == (I = C.replace(/^data-cke-saved-/, "")) || l[I] || (delete g[C], v = !0) : (delete g[C], v = !0));
                    if (!a.allStyles || a.hadInvalidStyle) {
                        for (C in k) a.allStyles || B[C] ? K.push(C + ":" + k[C]) : v = !0;
                        K.length && (g.style = K.sort().join("; "))
                    } else J && (g.style = J);
                    if (!a.allClasses || a.hadInvalidClass) {
                        for (C = 0; C < r.length; ++C)(a.allClasses || f[r[C]]) && E.push(r[C]);
                        E.length && (g["class"] = E.sort().join(" "));
                        z && E.length < z.split(/\s+/).length && (v = !0)
                    } else z && (g["class"] = z);v && (m = 1);
                    if (!e.skipFinalValidation && !x(b)) return h.push(b), 1
                }
                e.toHtml && (b.name = b.name.replace(L, "cke:$1"));
                return m
            }

            function D(a) {
                var b = [],
                    c;
                for (c in a) - 1 < c.indexOf("*") && b.push(c.replace(/\*/g, ".*"));
                return b.length ? new RegExp("^(?:" + b.join("|") + ")$") : null
            }

            function p(a) {
                var b = a.attributes,
                    c;
                delete b.style;
                delete b["class"];
                if (c = CKEDITOR.tools.writeCssText(a.styles, !0)) b.style = c;
                a.classes.length && (b["class"] = a.classes.sort().join(" "))
            }

            function x(a) {
                switch (a.name) {
                    case "a":
                        if (!(a.children.length || a.attributes.name || a.attributes.id)) return !1;
                        break;
                    case "img":
                        if (!a.attributes.src) return !1
                }
                return !0
            }

            function G(a) {
                if (!a) return !1;
                if (!0 === a) return !0;
                var b = D(a);
                return function(c) {
                    return c in a || b && c.match(b)
                }
            }

            function u() {
                return new CKEDITOR.htmlParser.element("br")
            }

            function r(a) {
                return a.type == CKEDITOR.NODE_ELEMENT && ("br" == a.name || C.$block[a.name])
            }

            function h(a, b, c) {
                var d = a.name;
                if (C.$empty[d] || !a.children.length) "hr" == d && "br" == b ? a.replaceWith(u()) : (a.parent && c.push({
                    check: "it",
                    el: a.parent
                }), a.remove());
                else if (C.$block[d] || "tr" == d)
                    if ("br" == b) a.previous && !r(a.previous) && (b = u(), b.insertBefore(a)), a.next && !r(a.next) && (b = u(), b.insertAfter(a)), a.replaceWithChildren();
                    else {
                        var d = a.children,
                            h;
                        b: {
                            h = C[b];
                            for (var n = 0, e = d.length, m; n < e; ++n)
                                if (m = d[n], m.type == CKEDITOR.NODE_ELEMENT && !h[m.name]) {
                                    h = !1;
                                    break b
                                }
                            h = !0
                        }
                        if (h) a.name = b, a.attributes = {}, c.push({
                            check: "parent-down",
                            el: a
                        });
                        else {
                            h = a.parent;
                            for (var n = h.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || "body" == h.name, f, g, e = d.length; 0 < e;) m = d[--e], n && (m.type == CKEDITOR.NODE_TEXT || m.type == CKEDITOR.NODE_ELEMENT && C.$inline[m.name]) ? (f || (f = new CKEDITOR.htmlParser.element(b), f.insertAfter(a), c.push({
                                check: "parent-down",
                                el: f
                            })), f.add(m, 0)) : (f = null, g = C[h.name] || C.span, m.insertAfter(a), h.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || m.type != CKEDITOR.NODE_ELEMENT || g[m.name] || c.push({
                                check: "el-up",
                                el: m
                            }));
                            a.remove()
                        }
                    }
                else d in {
                    style: 1,
                    script: 1
                } ? a.remove() : (a.parent && c.push({
                    check: "it",
                    el: a.parent
                }), a.replaceWithChildren())
            }

            function n(a, b, c) {
                var d, h;
                for (d = 0; d < c.length; ++d)
                    if (h = c[d], !(h.check && !a.check(h.check, !1) || h.left && !h.left(b))) {
                        h.right(b, K);
                        break
                    }
            }

            function m(a, b) {
                var c = b.getDefinition(),
                    d = c.attributes,
                    h = c.styles,
                    n, e, m, f;
                if (a.name != c.element) return !1;
                for (n in d)
                    if ("class" == n)
                        for (c = d[n].split(/\s+/), m = a.classes.join("|"); f = c.pop();) {
                            if (-1 == m.indexOf(f)) return !1
                        } else if (a.attributes[n] != d[n]) return !1;
                for (e in h)
                    if (a.styles[e] != h[e]) return !1;
                return !0
            }

            function z(a, b) {
                var c, d;
                "string" == typeof a ? c = a : a instanceof CKEDITOR.style ? d = a : (c = a[0], d = a[1]);
                return [{
                    element: c,
                    left: d,
                    right: function(a, c) {
                        c.transform(a, b)
                    }
                }]
            }

            function B(a) {
                return function(b) {
                    return m(b, a)
                }
            }

            function E(a) {
                return function(b, c) {
                    c[a](b)
                }
            }
            var C = CKEDITOR.dtd,
                H = CKEDITOR.tools.copy,
                R = CKEDITOR.tools.trim,
                T = ["", "p", "br", "div"];
            CKEDITOR.FILTER_SKIP_TREE = 2;
            CKEDITOR.filter = function(a) {
                this.allowedContent = [];
                this.disallowedContent = [];
                this.elementCallbacks = null;
                this.disabled = !1;
                this.editor = null;
                this.id = CKEDITOR.tools.getNextNumber();
                this._ = {
                    allowedRules: {
                        elements: {},
                        generic: []
                    },
                    disallowedRules: {
                        elements: {},
                        generic: []
                    },
                    transformations: {},
                    cachedTests: {}
                };
                CKEDITOR.filter.instances[this.id] = this;
                if (a instanceof CKEDITOR.editor) {
                    a = this.editor = a;
                    this.customConfig = !0;
                    var b = a.config.allowedContent;
                    !0 === b ? this.disabled = !0 : (b || (this.customConfig = !1), this.allow(b, "config", 1), this.allow(a.config.extraAllowedContent, "extra", 1), this.allow(T[a.enterMode] + " " + T[a.shiftEnterMode], "default", 1), this.disallow(a.config.disallowedContent))
                } else this.customConfig = !1, this.allow(a, "default", 1)
            };
            CKEDITOR.filter.instances = {};
            CKEDITOR.filter.prototype = {
                allow: function(b, c, d) {
                    if (!g(this, b, d)) return !1;
                    var h, n;
                    if ("string" == typeof b) b = f(b);
                    else if (b instanceof CKEDITOR.style) {
                        if (b.toAllowedContentRules) return this.allow(b.toAllowedContentRules(this.editor), c, d);
                        h = b.getDefinition();
                        b = {};
                        d = h.attributes;
                        b[h.element] = h = {
                            styles: h.styles,
                            requiredStyles: h.styles && CKEDITOR.tools.objectKeys(h.styles)
                        };
                        d && (d = H(d), h.classes = d["class"] ? d["class"].split(/\s+/) : null, h.requiredClasses = h.classes, delete d["class"], h.attributes = d, h.requiredAttributes = d && CKEDITOR.tools.objectKeys(d))
                    } else if (CKEDITOR.tools.isArray(b)) {
                        for (h = 0; h < b.length; ++h) n = this.allow(b[h], c, d);
                        return n
                    }
                    a(this, b, c, this.allowedContent, this._.allowedRules);
                    return !0
                },
                applyTo: function(a, b, c, d) {
                    if (this.disabled) return !1;
                    var n = this,
                        e = [],
                        m = this.editor && this.editor.config.protectedSource,
                        f, g = !1,
                        p = {
                            doFilter: !c,
                            doTransform: !0,
                            doCallbacks: !0,
                            toHtml: b
                        };
                    a.forEach(function(a) {
                        if (a.type == CKEDITOR.NODE_ELEMENT) {
                            if ("off" == a.attributes["data-cke-filter"]) return !1;
                            if (!b || "span" != a.name || !~CKEDITOR.tools.objectKeys(a.attributes).join("|").indexOf("data-cke-"))
                                if (f = t(n, a, e, p), f & 1) g = !0;
                                else if (f & 2) return !1
                        } else if (a.type == CKEDITOR.NODE_COMMENT && a.value.match(/^\{cke_protected\}(?!\{C\})/)) {
                            var c;
                            a: {
                                var d = decodeURIComponent(a.value.replace(/^\{cke_protected\}/, ""));c = [];
                                var h, r, z;
                                if (m)
                                    for (r = 0; r < m.length; ++r)
                                        if ((z = d.match(m[r])) && z[0].length == d.length) {
                                            c = !0;
                                            break a
                                        }
                                d = CKEDITOR.htmlParser.fragment.fromHtml(d);1 == d.children.length && (h = d.children[0]).type == CKEDITOR.NODE_ELEMENT && t(n, h, c, p);c = !c.length
                            }
                            c || e.push(a)
                        }
                    }, null, !0);
                    e.length && (g = !0);
                    var r;
                    a = [];
                    d = T[d || (this.editor ? this.editor.enterMode : CKEDITOR.ENTER_P)];
                    for (var z; c = e.pop();) c.type == CKEDITOR.NODE_ELEMENT ? h(c, d, a) : c.remove();
                    for (; r = a.pop();)
                        if (c = r.el, c.parent) switch (z = C[c.parent.name] || C.span, r.check) {
                            case "it":
                                C.$removeEmpty[c.name] && !c.children.length ? h(c, d, a) : x(c) || h(c, d, a);
                                break;
                            case "el-up":
                                c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || z[c.name] || h(c, d, a);
                                break;
                            case "parent-down":
                                c.parent.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT || z[c.name] || h(c.parent, d, a)
                        }
                        return g
                },
                checkFeature: function(a) {
                    if (this.disabled || !a) return !0;
                    a.toFeature && (a = a.toFeature(this.editor));
                    return !a.requiredContent || this.check(a.requiredContent)
                },
                disable: function() {
                    this.disabled = !0
                },
                disallow: function(b) {
                    if (!g(this, b, !0)) return !1;
                    "string" == typeof b && (b = f(b));
                    a(this, b, null, this.disallowedContent, this._.disallowedRules);
                    return !0
                },
                addContentForms: function(a) {
                    if (!this.disabled && a) {
                        var b, c, d = [],
                            h;
                        for (b = 0; b < a.length && !h; ++b) c = a[b], ("string" == typeof c || c instanceof CKEDITOR.style) && this.check(c) && (h = c);
                        if (h) {
                            for (b = 0; b < a.length; ++b) d.push(z(a[b], h));
                            this.addTransformations(d)
                        }
                    }
                },
                addElementCallback: function(a) {
                    this.elementCallbacks || (this.elementCallbacks = []);
                    this.elementCallbacks.push(a)
                },
                addFeature: function(a) {
                    if (this.disabled || !a) return !0;
                    a.toFeature && (a = a.toFeature(this.editor));
                    this.allow(a.allowedContent, a.name);
                    this.addTransformations(a.contentTransformations);
                    this.addContentForms(a.contentForms);
                    return a.requiredContent && (this.customConfig || this.disallowedContent.length) ? this.check(a.requiredContent) : !0
                },
                addTransformations: function(a) {
                    var b, c;
                    if (!this.disabled && a) {
                        var d = this._.transformations,
                            h;
                        for (h = 0; h < a.length; ++h) {
                            b = a[h];
                            var n = void 0,
                                e = void 0,
                                m = void 0,
                                f = void 0,
                                g = void 0,
                                r = void 0;
                            c = [];
                            for (e = 0; e < b.length; ++e) m = b[e], "string" == typeof m ? (m = m.split(/\s*:\s*/), f = m[0], g = null, r = m[1]) : (f = m.check, g = m.left, r = m.right), n || (n = m, n = n.element ? n.element : f ? f.match(/^([a-z0-9]+)/i)[0] : n.left.getDefinition().element), g instanceof CKEDITOR.style && (g = B(g)), c.push({
                                check: f == n ? null : f,
                                left: g,
                                right: "string" == typeof r ? E(r) : r
                            });
                            b = n;
                            d[b] || (d[b] = []);
                            d[b].push(c)
                        }
                    }
                },
                check: function(a, b, c) {
                    if (this.disabled) return !0;
                    if (CKEDITOR.tools.isArray(a)) {
                        for (var d = a.length; d--;)
                            if (this.check(a[d], b, c)) return !0;
                        return !1
                    }
                    var h, e;
                    if ("string" == typeof a) {
                        e = a + "<" + (!1 === b ? "0" : "1") + (c ? "1" : "0") + ">";
                        if (e in this._.cachedChecks) return this._.cachedChecks[e];
                        d = f(a).$1;
                        h = d.styles;
                        var m = d.classes;
                        d.name = d.elements;
                        d.classes = m = m ? m.split(/\s*,\s*/) : [];
                        d.styles = w(h);
                        d.attributes = w(d.attributes);
                        d.children = [];
                        m.length && (d.attributes["class"] = m.join(" "));
                        h && (d.attributes.style = CKEDITOR.tools.writeCssText(d.styles));
                        h = d
                    } else d = a.getDefinition(), h = d.styles, m = d.attributes || {}, h && !CKEDITOR.tools.isEmpty(h) ? (h = H(h), m.style = CKEDITOR.tools.writeCssText(h, !0)) : h = {}, h = {
                        name: d.element,
                        attributes: m,
                        classes: m["class"] ? m["class"].split(/\s+/) : [],
                        styles: h,
                        children: []
                    };
                    var m = CKEDITOR.tools.clone(h),
                        g = [],
                        r;
                    if (!1 !== b && (r = this._.transformations[h.name])) {
                        for (d = 0; d < r.length; ++d) n(this, h, r[d]);
                        p(h)
                    }
                    t(this, m, g, {
                        doFilter: !0,
                        doTransform: !1 !== b,
                        skipRequired: !c,
                        skipFinalValidation: !c
                    });
                    b = 0 < g.length ? !1 : CKEDITOR.tools.objectCompare(h.attributes, m.attributes, !0) ? !0 : !1;
                    "string" == typeof a && (this._.cachedChecks[e] = b);
                    return b
                },
                getAllowedEnterMode: function() {
                    var a = ["p", "div", "br"],
                        b = {
                            p: CKEDITOR.ENTER_P,
                            div: CKEDITOR.ENTER_DIV,
                            br: CKEDITOR.ENTER_BR
                        };
                    return function(c, d) {
                        var h = a.slice(),
                            n;
                        if (this.check(T[c])) return c;
                        for (d || (h = h.reverse()); n = h.pop();)
                            if (this.check(n)) return b[n];
                        return CKEDITOR.ENTER_BR
                    }
                }(),
                destroy: function() {
                    delete CKEDITOR.filter.instances[this.id];
                    delete this._;
                    delete this.allowedContent;
                    delete this.disallowedContent
                }
            };
            var Q = {
                    styles: 1,
                    attributes: 1,
                    classes: 1
                },
                v = {
                    styles: "requiredStyles",
                    attributes: "requiredAttributes",
                    classes: "requiredClasses"
                },
                I = /^([a-z0-9\-*\s]+)((?:\s*\{[!\w\-,\s\*]+\}\s*|\s*\[[!\w\-,\s\*]+\]\s*|\s*\([!\w\-,\s\*]+\)\s*){0,3})(?:;\s*|$)/i,
                J = {
                    styles: /{([^}]+)}/,
                    attrs: /\[([^\]]+)\]/,
                    classes: /\(([^\)]+)\)/
                },
                F = /^cke:(object|embed|param)$/,
                L = /^(object|embed|param)$/,
                K;
            K = CKEDITOR.filter.transformationsTools = {
                sizeToStyle: function(a) {
                    this.lengthToStyle(a, "width");
                    this.lengthToStyle(a, "height")
                },
                sizeToAttribute: function(a) {
                    this.lengthToAttribute(a, "width");
                    this.lengthToAttribute(a, "height")
                },
                lengthToStyle: function(a, b, c) {
                    c = c || b;
                    if (!(c in a.styles)) {
                        var d = a.attributes[b];
                        d && (/^\d+$/.test(d) && (d += "px"), a.styles[c] = d)
                    }
                    delete a.attributes[b]
                },
                lengthToAttribute: function(a, b, c) {
                    c = c || b;
                    if (!(c in a.attributes)) {
                        var d = a.styles[b],
                            h = d && d.match(/^(\d+)(?:\.\d*)?px$/);
                        h ? a.attributes[c] = h[1] : "cke-test" == d && (a.attributes[c] = "cke-test")
                    }
                    delete a.styles[b]
                },
                alignmentToStyle: function(a) {
                    if (!("float" in a.styles)) {
                        var b = a.attributes.align;
                        if ("left" == b || "right" == b) a.styles["float"] = b
                    }
                    delete a.attributes.align
                },
                alignmentToAttribute: function(a) {
                    if (!("align" in a.attributes)) {
                        var b = a.styles["float"];
                        if ("left" == b || "right" == b) a.attributes.align = b
                    }
                    delete a.styles["float"]
                },
                matchesStyle: m,
                transform: function(a, b) {
                    if ("string" == typeof b) a.name = b;
                    else {
                        var c = b.getDefinition(),
                            d = c.styles,
                            h = c.attributes,
                            n, m, e, f;
                        a.name = c.element;
                        for (n in h)
                            if ("class" == n)
                                for (c = a.classes.join("|"), e = h[n].split(/\s+/); f = e.pop();) - 1 == c.indexOf(f) && a.classes.push(f);
                            else a.attributes[n] = h[n];
                        for (m in d) a.styles[m] = d[m]
                    }
                }
            }
        })();
        (function() {
            CKEDITOR.focusManager = function(a) {
                if (a.focusManager) return a.focusManager;
                this.hasFocus = !1;
                this.currentActive = null;
                this._ = {
                    editor: a
                };
                return this
            };
            CKEDITOR.focusManager._ = {
                blurDelay: 200
            };
            CKEDITOR.focusManager.prototype = {
                focus: function(a) {
                    this._.timer && clearTimeout(this._.timer);
                    a && (this.currentActive = a);
                    this.hasFocus || this._.locked || ((a = CKEDITOR.currentInstance) && a.focusManager.blur(1), this.hasFocus = !0, (a = this._.editor.container) && a.addClass("cke_focus"), this._.editor.fire("focus"))
                },
                lock: function() {
                    this._.locked = 1
                },
                unlock: function() {
                    delete this._.locked
                },
                blur: function(a) {
                    function d() {
                        if (this.hasFocus) {
                            this.hasFocus = !1;
                            var a = this._.editor.container;
                            a && a.removeClass("cke_focus");
                            this._.editor.fire("blur")
                        }
                    }
                    if (!this._.locked) {
                        this._.timer && clearTimeout(this._.timer);
                        var b = CKEDITOR.focusManager._.blurDelay;
                        a || !b ? d.call(this) : this._.timer = CKEDITOR.tools.setTimeout(function() {
                            delete this._.timer;
                            d.call(this)
                        }, b, this)
                    }
                },
                add: function(a, d) {
                    var b = a.getCustomData("focusmanager");
                    if (!b || b != this) {
                        b && b.remove(a);
                        var b = "focus",
                            c = "blur";
                        d && (CKEDITOR.env.ie ? (b = "focusin", c = "focusout") : CKEDITOR.event.useCapture = 1);
                        var e = {
                            blur: function() {
                                a.equals(this.currentActive) && this.blur()
                            },
                            focus: function() {
                                this.focus(a)
                            }
                        };
                        a.on(b, e.focus, this);
                        a.on(c, e.blur, this);
                        d && (CKEDITOR.event.useCapture = 0);
                        a.setCustomData("focusmanager", this);
                        a.setCustomData("focusmanager_handlers", e)
                    }
                },
                remove: function(a) {
                    a.removeCustomData("focusmanager");
                    var d = a.removeCustomData("focusmanager_handlers");
                    a.removeListener("blur", d.blur);
                    a.removeListener("focus", d.focus)
                }
            }
        })();
        CKEDITOR.keystrokeHandler = function(a) {
            if (a.keystrokeHandler) return a.keystrokeHandler;
            this.keystrokes = {};
            this.blockedKeystrokes = {};
            this._ = {
                editor: a
            };
            return this
        };
        (function() {
            var a, d = function(b) {
                    b = b.data;
                    var d = b.getKeystroke(),
                        g = this.keystrokes[d],
                        l = this._.editor;
                    a = !1 === l.fire("key", {
                        keyCode: d,
                        domEvent: b
                    });
                    a || (g && (a = !1 !== l.execCommand(g, {
                        from: "keystrokeHandler"
                    })), a || (a = !!this.blockedKeystrokes[d]));
                    a && b.preventDefault(!0);
                    return !a
                },
                b = function(b) {
                    a && (a = !1, b.data.preventDefault(!0))
                };
            CKEDITOR.keystrokeHandler.prototype = {
                attach: function(a) {
                    a.on("keydown", d, this);
                    if (CKEDITOR.env.gecko && CKEDITOR.env.mac) a.on("keypress", b, this)
                }
            }
        })();
        (function() {
            CKEDITOR.lang = {
                languages: {
                    af: 1,
                    ar: 1,
                    bg: 1,
                    bn: 1,
                    bs: 1,
                    ca: 1,
                    cs: 1,
                    cy: 1,
                    da: 1,
                    de: 1,
                    "de-ch": 1,
                    el: 1,
                    "en-au": 1,
                    "en-ca": 1,
                    "en-gb": 1,
                    en: 1,
                    eo: 1,
                    es: 1,
                    et: 1,
                    eu: 1,
                    fa: 1,
                    fi: 1,
                    fo: 1,
                    "fr-ca": 1,
                    fr: 1,
                    gl: 1,
                    gu: 1,
                    he: 1,
                    hi: 1,
                    hr: 1,
                    hu: 1,
                    id: 1,
                    is: 1,
                    it: 1,
                    ja: 1,
                    ka: 1,
                    km: 1,
                    ko: 1,
                    ku: 1,
                    lt: 1,
                    lv: 1,
                    mk: 1,
                    mn: 1,
                    ms: 1,
                    nb: 1,
                    nl: 1,
                    no: 1,
                    pl: 1,
                    "pt-br": 1,
                    pt: 1,
                    ro: 1,
                    ru: 1,
                    si: 1,
                    sk: 1,
                    sl: 1,
                    sq: 1,
                    "sr-latn": 1,
                    sr: 1,
                    sv: 1,
                    th: 1,
                    tr: 1,
                    tt: 1,
                    ug: 1,
                    uk: 1,
                    vi: 1,
                    "zh-cn": 1,
                    zh: 1
                },
                rtl: {
                    ar: 1,
                    fa: 1,
                    he: 1,
                    ku: 1,
                    ug: 1
                },
                load: function(a, d, b) {
                    a && CKEDITOR.lang.languages[a] || (a = this.detect(d, a));
                    var c = this;
                    d = function() {
                        c[a].dir = c.rtl[a] ? "rtl" : "ltr";
                        b(a, c[a])
                    };
                    this[a] ? d() : CKEDITOR.scriptLoader.load(CKEDITOR.getUrl("lang/" + a + ".js"), d, this)
                },
                detect: function(a, d) {
                    var b = this.languages;
                    d = d || navigator.userLanguage || navigator.language || a;
                    var c = d.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),
                        e = c[1],
                        c = c[2];
                    b[e + "-" + c] ? e = e + "-" + c : b[e] || (e = null);
                    CKEDITOR.lang.detect = e ? function() {
                        return e
                    } : function(a) {
                        return a
                    };
                    return e || a
                }
            }
        })();
        CKEDITOR.scriptLoader = function() {
            var a = {},
                d = {};
            return {
                load: function(b, c, e, g) {
                    var l = "string" == typeof b;
                    l && (b = [b]);
                    e || (e = CKEDITOR);
                    var k = b.length,
                        q = [],
                        w = [],
                        f = function(a) {
                            c && (l ? c.call(e, a) : c.call(e, q, w))
                        };
                    if (0 === k) f(!0);
                    else {
                        var y = function(a, b) {
                                (b ? q : w).push(a);
                                0 >= --k && (g && CKEDITOR.document.getDocumentElement().removeStyle("cursor"), f(b))
                            },
                            A = function(b, c) {
                                a[b] = 1;
                                var e = d[b];
                                delete d[b];
                                for (var f = 0; f < e.length; f++) e[f](b, c)
                            },
                            t = function(b) {
                                if (a[b]) y(b, !0);
                                else {
                                    var e = d[b] || (d[b] = []);
                                    e.push(y);
                                    if (!(1 < e.length)) {
                                        var f = new CKEDITOR.dom.element("script");
                                        f.setAttributes({
                                            type: "text/javascript",
                                            src: b
                                        });
                                        c && (CKEDITOR.env.ie && 11 > CKEDITOR.env.version ? f.$.onreadystatechange = function() {
                                            if ("loaded" == f.$.readyState || "complete" == f.$.readyState) f.$.onreadystatechange = null, A(b, !0)
                                        } : (f.$.onload = function() {
                                            setTimeout(function() {
                                                A(b, !0)
                                            }, 0)
                                        }, f.$.onerror = function() {
                                            A(b, !1)
                                        }));
                                        f.appendTo(CKEDITOR.document.getHead())
                                    }
                                }
                            };
                        g && CKEDITOR.document.getDocumentElement().setStyle("cursor", "wait");
                        for (var D = 0; D < k; D++) t(b[D])
                    }
                },
                queue: function() {
                    function a() {
                        var b;
                        (b = c[0]) && this.load(b.scriptUrl, b.callback, CKEDITOR, 0)
                    }
                    var c = [];
                    return function(d, g) {
                        var l = this;
                        c.push({
                            scriptUrl: d,
                            callback: function() {
                                g && g.apply(this, arguments);
                                c.shift();
                                a.call(l)
                            }
                        });
                        1 == c.length && a.call(this)
                    }
                }()
            }
        }();
        CKEDITOR.resourceManager = function(a, d) {
            this.basePath = a;
            this.fileName = d;
            this.registered = {};
            this.loaded = {};
            this.externals = {};
            this._ = {
                waitingList: {}
            }
        };
        CKEDITOR.resourceManager.prototype = {
            add: function(a, d) {
                if (this.registered[a]) throw Error('[CKEDITOR.resourceManager.add] The resource name "' + a + '" is already registered.');
                var b = this.registered[a] = d || {};
                b.name = a;
                b.path = this.getPath(a);
                CKEDITOR.fire(a + CKEDITOR.tools.capitalize(this.fileName) + "Ready", b);
                return this.get(a)
            },
            get: function(a) {
                return this.registered[a] || null
            },
            getPath: function(a) {
                var d = this.externals[a];
                return CKEDITOR.getUrl(d && d.dir || this.basePath + a + "/")
            },
            getFilePath: function(a) {
                var d = this.externals[a];
                return CKEDITOR.getUrl(this.getPath(a) + (d ? d.file : this.fileName + ".js"))
            },
            addExternal: function(a, d, b) {
                a = a.split(",");
                for (var c = 0; c < a.length; c++) {
                    var e = a[c];
                    b || (d = d.replace(/[^\/]+$/, function(a) {
                        b = a;
                        return ""
                    }));
                    this.externals[e] = {
                        dir: d,
                        file: b || this.fileName + ".js"
                    }
                }
            },
            load: function(a, d, b) {
                CKEDITOR.tools.isArray(a) || (a = a ? [a] : []);
                for (var c = this.loaded, e = this.registered, g = [], l = {}, k = {}, q = 0; q < a.length; q++) {
                    var w = a[q];
                    if (w)
                        if (c[w] || e[w]) k[w] = this.get(w);
                        else {
                            var f = this.getFilePath(w);
                            g.push(f);
                            f in l || (l[f] = []);
                            l[f].push(w)
                        }
                }
                CKEDITOR.scriptLoader.load(g, function(a, e) {
                    if (e.length) throw Error('[CKEDITOR.resourceManager.load] Resource name "' + l[e[0]].join(",") + '" was not found at "' + e[0] + '".');
                    for (var f = 0; f < a.length; f++)
                        for (var g = l[a[f]], p = 0; p < g.length; p++) {
                            var x = g[p];
                            k[x] = this.get(x);
                            c[x] = 1
                        }
                    d.call(b, k)
                }, this)
            }
        };
        CKEDITOR.plugins = new CKEDITOR.resourceManager("plugins/", "plugin");
        CKEDITOR.plugins.load = CKEDITOR.tools.override(CKEDITOR.plugins.load, function(a) {
            var d = {};
            return function(b, c, e) {
                var g = {},
                    l = function(b) {
                        a.call(this, b, function(a) {
                            CKEDITOR.tools.extend(g, a);
                            var b = [],
                                f;
                            for (f in a) {
                                var k = a[f],
                                    A = k && k.requires;
                                if (!d[f]) {
                                    if (k.icons)
                                        for (var t = k.icons.split(","), D = t.length; D--;) CKEDITOR.skin.addIcon(t[D], k.path + "icons/" + (CKEDITOR.env.hidpi && k.hidpi ? "hidpi/" : "") + t[D] + ".png");
                                    d[f] = 1
                                }
                                if (A)
                                    for (A.split && (A = A.split(",")), k = 0; k < A.length; k++) g[A[k]] || b.push(A[k])
                            }
                            if (b.length) l.call(this, b);
                            else {
                                for (f in g) k = g[f], k.onLoad && !k.onLoad._called && (!1 === k.onLoad() && delete g[f], k.onLoad._called = 1);
                                c && c.call(e || window, g)
                            }
                        }, this)
                    };
                l.call(this, b)
            }
        });
        CKEDITOR.plugins.setLang = function(a, d, b) {
            var c = this.get(a);
            a = c.langEntries || (c.langEntries = {});
            c = c.lang || (c.lang = []);
            c.split && (c = c.split(",")); - 1 == CKEDITOR.tools.indexOf(c, d) && c.push(d);
            a[d] = b
        };
        CKEDITOR.ui = function(a) {
            if (a.ui) return a.ui;
            this.items = {};
            this.instances = {};
            this.editor = a;
            this._ = {
                handlers: {}
            };
            return this
        };
        CKEDITOR.ui.prototype = {
            add: function(a, d, b) {
                b.name = a.toLowerCase();
                var c = this.items[a] = {
                    type: d,
                    command: b.command || null,
                    args: Array.prototype.slice.call(arguments, 2)
                };
                CKEDITOR.tools.extend(c, b)
            },
            get: function(a) {
                return this.instances[a]
            },
            create: function(a) {
                var d = this.items[a],
                    b = d && this._.handlers[d.type],
                    c = d && d.command && this.editor.getCommand(d.command),
                    b = b && b.create.apply(this, d.args);
                this.instances[a] = b;
                c && c.uiItems.push(b);
                b && !b.type && (b.type = d.type);
                return b
            },
            addHandler: function(a, d) {
                this._.handlers[a] = d
            },
            space: function(a) {
                return CKEDITOR.document.getById(this.spaceId(a))
            },
            spaceId: function(a) {
                return this.editor.id + "_" + a
            }
        };
        CKEDITOR.event.implementOn(CKEDITOR.ui);
        (function() {
            function a(a, e, f) {
                CKEDITOR.event.call(this);
                a = a && CKEDITOR.tools.clone(a);
                if (void 0 !== e) {
                    if (!(e instanceof CKEDITOR.dom.element)) throw Error("Expect element of type CKEDITOR.dom.element.");
                    if (!f) throw Error("One of the element modes must be specified.");
                    if (CKEDITOR.env.ie && CKEDITOR.env.quirks && f == CKEDITOR.ELEMENT_MODE_INLINE) throw Error("Inline element mode is not supported on IE quirks.");
                    if (!b(e, f)) throw Error('The specified element mode is not supported on element: "' + e.getName() + '".');
                    this.element = e;
                    this.elementMode = f;
                    this.name = this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO && (e.getId() || e.getNameAtt())
                } else this.elementMode = CKEDITOR.ELEMENT_MODE_NONE;
                this._ = {};
                this.commands = {};
                this.templates = {};
                this.name = this.name || d();
                this.id = CKEDITOR.tools.getNextId();
                this.status = "unloaded";
                this.config = CKEDITOR.tools.prototypedCopy(CKEDITOR.config);
                this.ui = new CKEDITOR.ui(this);
                this.focusManager = new CKEDITOR.focusManager(this);
                this.keystrokeHandler = new CKEDITOR.keystrokeHandler(this);
                this.on("readOnly", c);
                this.on("selectionChange", function(a) {
                    g(this, a.data.path)
                });
                this.on("activeFilterChange", function() {
                    g(this, this.elementPath(), !0)
                });
                this.on("mode", c);
                this.on("instanceReady", function() {
                    this.config.startupFocus && this.focus()
                });
                CKEDITOR.fire("instanceCreated", null, this);
                CKEDITOR.add(this);
                CKEDITOR.tools.setTimeout(function() {
                    "destroyed" !== this.status ? k(this, a) : CKEDITOR.warn("editor-incorrect-destroy")
                }, 0, this)
            }

            function d() {
                do var a = "editor" + ++t; while (CKEDITOR.instances[a]);
                return a
            }

            function b(a, b) {
                return b == CKEDITOR.ELEMENT_MODE_INLINE ? a.is(CKEDITOR.dtd.$editable) || a.is("textarea") : b == CKEDITOR.ELEMENT_MODE_REPLACE ? !a.is(CKEDITOR.dtd.$nonBodyContent) : 1
            }

            function c() {
                var a = this.commands,
                    b;
                for (b in a) e(this, a[b])
            }

            function e(a, b) {
                b[b.startDisabled ? "disable" : a.readOnly && !b.readOnly ? "disable" : b.modes[a.mode] ? "enable" : "disable"]()
            }

            function g(a, b, c) {
                if (b) {
                    var d, e, h = a.commands;
                    for (e in h) d = h[e], (c || d.contextSensitive) && d.refresh(a, b)
                }
            }

            function l(a) {
                var b = a.config.customConfig;
                if (!b) return !1;
                var b = CKEDITOR.getUrl(b),
                    c = D[b] || (D[b] = {});
                c.fn ? (c.fn.call(a, a.config), CKEDITOR.getUrl(a.config.customConfig) != b && l(a) || a.fireOnce("customConfigLoaded")) : CKEDITOR.scriptLoader.queue(b, function() {
                    c.fn = CKEDITOR.editorConfig ? CKEDITOR.editorConfig : function() {};
                    l(a)
                });
                return !0
            }

            function k(a, b) {
                a.on("customConfigLoaded", function() {
                    if (b) {
                        if (b.on)
                            for (var c in b.on) a.on(c, b.on[c]);
                        CKEDITOR.tools.extend(a.config, b, !0);
                        delete a.config.on
                    }
                    c = a.config;
                    a.readOnly = c.readOnly ? !0 : a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.is("textarea") ? a.element.hasAttribute("disabled") || a.element.hasAttribute("readonly") : a.element.isReadOnly() : a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.element.hasAttribute("disabled") || a.element.hasAttribute("readonly") : !1;
                    a.blockless = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? !(a.element.is("textarea") || CKEDITOR.dtd[a.element.getName()].p) : !1;
                    a.tabIndex = c.tabIndex || a.element && a.element.getAttribute("tabindex") || 0;
                    a.activeEnterMode = a.enterMode = a.blockless ? CKEDITOR.ENTER_BR : c.enterMode;
                    a.activeShiftEnterMode = a.shiftEnterMode = a.blockless ? CKEDITOR.ENTER_BR : c.shiftEnterMode;
                    c.skin && (CKEDITOR.skinName = c.skin);
                    a.fireOnce("configLoaded");
                    a.dataProcessor = new CKEDITOR.htmlDataProcessor(a);
                    a.filter = a.activeFilter = new CKEDITOR.filter(a);
                    q(a)
                });
                b && null != b.customConfig && (a.config.customConfig = b.customConfig);
                l(a) || a.fireOnce("customConfigLoaded")
            }

            function q(a) {
                CKEDITOR.skin.loadPart("editor", function() {
                    w(a)
                })
            }

            function w(a) {
                CKEDITOR.lang.load(a.config.language, a.config.defaultLanguage, function(b, c) {
                    var d = a.config.title;
                    a.langCode = b;
                    a.lang = CKEDITOR.tools.prototypedCopy(c);
                    a.title = "string" == typeof d || !1 === d ? d : [a.lang.editor, a.name].join(", ");
                    a.config.contentsLangDirection || (a.config.contentsLangDirection = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.element.getDirection(1) : a.lang.dir);
                    a.fire("langLoaded");
                    f(a)
                })
            }

            function f(a) {
                a.getStylesSet(function(b) {
                    a.once("loaded", function() {
                        a.fire("stylesSet", {
                            styles: b
                        })
                    }, null, null, 1);
                    y(a)
                })
            }

            function y(a) {
                var b = a.config,
                    c = b.plugins,
                    d = b.extraPlugins,
                    e = b.removePlugins;
                if (d) var h = new RegExp("(?:^|,)(?:" + d.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
                    c = c.replace(h, ""),
                    c = c + ("," + d);
                if (e) var n = new RegExp("(?:^|,)(?:" + e.replace(/\s*,\s*/g, "|") + ")(?=,|$)", "g"),
                    c = c.replace(n, "");
                CKEDITOR.env.air && (c += ",adobeair");
                CKEDITOR.plugins.load(c.split(","), function(c) {
                    var d = [],
                        h = [],
                        e = [];
                    a.plugins = c;
                    for (var f in c) {
                        var g = c[f],
                            r = g.lang,
                            l = null,
                            k = g.requires,
                            v;
                        CKEDITOR.tools.isArray(k) && (k = k.join(","));
                        if (k && (v = k.match(n)))
                            for (; k = v.pop();) CKEDITOR.error("editor-plugin-required", {
                                plugin: k.replace(",", ""),
                                requiredBy: f
                            });
                        r && !a.lang[f] && (r.split && (r = r.split(",")), 0 <= CKEDITOR.tools.indexOf(r, a.langCode) ? l = a.langCode : (l = a.langCode.replace(/-.*/, ""), l = l != a.langCode && 0 <= CKEDITOR.tools.indexOf(r, l) ? l : 0 <= CKEDITOR.tools.indexOf(r, "en") ? "en" : r[0]), g.langEntries && g.langEntries[l] ? (a.lang[f] = g.langEntries[l], l = null) : e.push(CKEDITOR.getUrl(g.path + "lang/" + l + ".js")));
                        h.push(l);
                        d.push(g)
                    }
                    CKEDITOR.scriptLoader.load(e, function() {
                        for (var c = ["beforeInit", "init", "afterInit"], e = 0; e < c.length; e++)
                            for (var n = 0; n < d.length; n++) {
                                var m = d[n];
                                0 === e && h[n] && m.lang && m.langEntries && (a.lang[m.name] = m.langEntries[h[n]]);
                                if (m[c[e]]) m[c[e]](a)
                            }
                        a.fireOnce("pluginsLoaded");
                        b.keystrokes && a.setKeystroke(a.config.keystrokes);
                        for (n = 0; n < a.config.blockedKeystrokes.length; n++) a.keystrokeHandler.blockedKeystrokes[a.config.blockedKeystrokes[n]] = 1;
                        a.status = "loaded";
                        a.fireOnce("loaded");
                        CKEDITOR.fire("instanceLoaded", null, a)
                    })
                })
            }

            function A() {
                var a = this.element;
                if (a && this.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO) {
                    var b = this.getData();
                    this.config.htmlEncodeOutput && (b = CKEDITOR.tools.htmlEncode(b));
                    a.is("textarea") ? a.setValue(b) : a.setHtml(b);
                    return !0
                }
                return !1
            }
            a.prototype = CKEDITOR.editor.prototype;
            CKEDITOR.editor = a;
            var t = 0,
                D = {};
            CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
                addCommand: function(a, b) {
                    b.name = a.toLowerCase();
                    var c = new CKEDITOR.command(this, b);
                    this.mode && e(this, c);
                    return this.commands[a] = c
                },
                _attachToForm: function() {
                    function a(b) {
                        c.updateElement();
                        c._.required && !d.getValue() && !1 === c.fire("required") && b.data.preventDefault()
                    }

                    function b(a) {
                        return !!(a && a.call && a.apply)
                    }
                    var c = this,
                        d = c.element,
                        e = new CKEDITOR.dom.element(d.$.form);
                    d.is("textarea") && e && (e.on("submit", a), b(e.$.submit) && (e.$.submit = CKEDITOR.tools.override(e.$.submit, function(b) {
                        return function() {
                            a();
                            b.apply ? b.apply(this) : b()
                        }
                    })), c.on("destroy", function() {
                        e.removeListener("submit", a)
                    }))
                },
                destroy: function(a) {
                    this.fire("beforeDestroy");
                    !a && A.call(this);
                    this.editable(null);
                    this.filter && (this.filter.destroy(), delete this.filter);
                    delete this.activeFilter;
                    this.status = "destroyed";
                    this.fire("destroy");
                    this.removeAllListeners();
                    CKEDITOR.remove(this);
                    CKEDITOR.fire("instanceDestroyed", null, this)
                },
                elementPath: function(a) {
                    if (!a) {
                        a = this.getSelection();
                        if (!a) return null;
                        a = a.getStartElement()
                    }
                    return a ? new CKEDITOR.dom.elementPath(a, this.editable()) : null
                },
                createRange: function() {
                    var a = this.editable();
                    return a ? new CKEDITOR.dom.range(a) : null
                },
                execCommand: function(a, b) {
                    var c = this.getCommand(a),
                        d = {
                            name: a,
                            commandData: b,
                            command: c
                        };
                    return c && c.state != CKEDITOR.TRISTATE_DISABLED && !1 !== this.fire("beforeCommandExec", d) && (d.returnValue = c.exec(d.commandData), !c.async && !1 !== this.fire("afterCommandExec", d)) ? d.returnValue : !1
                },
                getCommand: function(a) {
                    return this.commands[a]
                },
                getData: function(a) {
                    !a && this.fire("beforeGetData");
                    var b = this._.data;
                    "string" != typeof b && (b = (b = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? b.is("textarea") ? b.getValue() : b.getHtml() : "");
                    b = {
                        dataValue: b
                    };
                    !a && this.fire("getData", b);
                    return b.dataValue
                },
                getSnapshot: function() {
                    var a = this.fire("getSnapshot");
                    "string" != typeof a && (a = (a = this.element) && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE ? a.is("textarea") ? a.getValue() : a.getHtml() : "");
                    return a
                },
                loadSnapshot: function(a) {
                    this.fire("loadSnapshot", a)
                },
                setData: function(a, b, c) {
                    var d = !0,
                        e = b;
                    b && "object" == typeof b && (c = b.internal, e = b.callback, d = !b.noSnapshot);
                    !c && d && this.fire("saveSnapshot");
                    if (e || !c) this.once("dataReady", function(a) {
                        !c && d && this.fire("saveSnapshot");
                        e && e.call(a.editor)
                    });
                    a = {
                        dataValue: a
                    };
                    !c && this.fire("setData", a);
                    this._.data = a.dataValue;
                    !c && this.fire("afterSetData", a)
                },
                setReadOnly: function(a) {
                    a = null == a || a;
                    this.readOnly != a && (this.readOnly = a, this.keystrokeHandler.blockedKeystrokes[8] = +a, this.editable().setReadOnly(a), this.fire("readOnly"))
                },
                insertHtml: function(a, b, c) {
                    this.fire("insertHtml", {
                        dataValue: a,
                        mode: b,
                        range: c
                    })
                },
                insertText: function(a) {
                    this.fire("insertText", a)
                },
                insertElement: function(a) {
                    this.fire("insertElement", a)
                },
                getSelectedHtml: function(a) {
                    var b = this.editable(),
                        c = this.getSelection(),
                        c = c && c.getRanges();
                    if (!b || !c || 0 === c.length) return null;
                    for (var d = new CKEDITOR.dom.documentFragment, e, h, n, m = 0; m < c.length; m++) {
                        var f = c[m],
                            g = f.startContainer;
                        g.getName && "tr" == g.getName() ? (e || (e = g.getAscendant("table").clone(), e.append(g.getAscendant("tbody").clone()), d.append(e), e = e.findOne("tbody")), h && h.equals(g) || (h = g, n = g.clone(), e.append(n)), n.append(f.cloneContents())) : d.append(f.cloneContents())
                    }
                    b = e ? d : b.getHtmlFromRange(c[0]);
                    return a ? b.getHtml() : b
                },
                extractSelectedHtml: function(a, b) {
                    var c = this.editable(),
                        d = this.getSelection().getRanges();
                    if (!c || 0 === d.length) return null;
                    d = d[0];
                    c = c.extractHtmlFromRange(d, b);
                    b || this.getSelection().selectRanges([d]);
                    return a ? c.getHtml() : c
                },
                focus: function() {
                    this.fire("beforeFocus")
                },
                checkDirty: function() {
                    return "ready" == this.status && this._.previousValue !== this.getSnapshot()
                },
                resetDirty: function() {
                    this._.previousValue = this.getSnapshot()
                },
                updateElement: function() {
                    return A.call(this)
                },
                setKeystroke: function() {
                    for (var a = this.keystrokeHandler.keystrokes, b = CKEDITOR.tools.isArray(arguments[0]) ? arguments[0] : [
                            [].slice.call(arguments, 0)
                        ], c, d, e = b.length; e--;) c = b[e], d = 0, CKEDITOR.tools.isArray(c) && (d = c[1], c = c[0]), d ? a[c] = d : delete a[c]
                },
                addFeature: function(a) {
                    return this.filter.addFeature(a)
                },
                setActiveFilter: function(a) {
                    a || (a = this.filter);
                    this.activeFilter !== a && (this.activeFilter = a, this.fire("activeFilterChange"), a === this.filter ? this.setActiveEnterMode(null, null) : this.setActiveEnterMode(a.getAllowedEnterMode(this.enterMode), a.getAllowedEnterMode(this.shiftEnterMode, !0)))
                },
                setActiveEnterMode: function(a, b) {
                    a = a ? this.blockless ? CKEDITOR.ENTER_BR : a : this.enterMode;
                    b = b ? this.blockless ? CKEDITOR.ENTER_BR : b : this.shiftEnterMode;
                    if (this.activeEnterMode != a || this.activeShiftEnterMode != b) this.activeEnterMode = a, this.activeShiftEnterMode = b, this.fire("activeEnterModeChange")
                },
                showNotification: function(a) {
                    alert(a)
                }
            })
        })();
        CKEDITOR.ELEMENT_MODE_NONE = 0;
        CKEDITOR.ELEMENT_MODE_REPLACE = 1;
        CKEDITOR.ELEMENT_MODE_APPENDTO = 2;
        CKEDITOR.ELEMENT_MODE_INLINE = 3;
        CKEDITOR.htmlParser = function() {
            this._ = {
                htmlPartsRegex: /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\/\s>]+)((?:\s+[\w\-:.]+(?:\s*=\s*?(?:(?:"[^"]*")|(?:'[^']*')|[^\s"'\/>]+))?)*)[\S\s]*?(\/?)>))/g
            }
        };
        (function() {
            var a = /([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,
                d = {
                    checked: 1,
                    compact: 1,
                    declare: 1,
                    defer: 1,
                    disabled: 1,
                    ismap: 1,
                    multiple: 1,
                    nohref: 1,
                    noresize: 1,
                    noshade: 1,
                    nowrap: 1,
                    readonly: 1,
                    selected: 1
                };
            CKEDITOR.htmlParser.prototype = {
                onTagOpen: function() {},
                onTagClose: function() {},
                onText: function() {},
                onCDATA: function() {},
                onComment: function() {},
                parse: function(b) {
                    for (var c, e, g = 0, l; c = this._.htmlPartsRegex.exec(b);) {
                        e = c.index;
                        if (e > g)
                            if (g = b.substring(g, e), l) l.push(g);
                            else this.onText(g);
                        g = this._.htmlPartsRegex.lastIndex;
                        if (e = c[1])
                            if (e = e.toLowerCase(), l && CKEDITOR.dtd.$cdata[e] && (this.onCDATA(l.join("")), l = null), !l) {
                                this.onTagClose(e);
                                continue
                            }
                        if (l) l.push(c[0]);
                        else if (e = c[3]) {
                            if (e = e.toLowerCase(), !/="/.test(e)) {
                                var k = {},
                                    q, w = c[4];
                                c = !!c[5];
                                if (w)
                                    for (; q = a.exec(w);) {
                                        var f = q[1].toLowerCase();
                                        q = q[2] || q[3] || q[4] || "";
                                        k[f] = !q && d[f] ? f : CKEDITOR.tools.htmlDecodeAttr(q)
                                    }
                                this.onTagOpen(e, k, c);
                                !l && CKEDITOR.dtd.$cdata[e] && (l = [])
                            }
                        } else if (e = c[2]) this.onComment(e)
                    }
                    if (b.length > g) this.onText(b.substring(g, b.length))
                }
            }
        })();
        CKEDITOR.htmlParser.basicWriter = CKEDITOR.tools.createClass({
            $: function() {
                this._ = {
                    output: []
                }
            },
            proto: {
                openTag: function(a) {
                    this._.output.push("<", a)
                },
                openTagClose: function(a, d) {
                    d ? this._.output.push(" />") : this._.output.push(">")
                },
                attribute: function(a, d) {
                    "string" == typeof d && (d = CKEDITOR.tools.htmlEncodeAttr(d));
                    this._.output.push(" ", a, '="', d, '"')
                },
                closeTag: function(a) {
                    this._.output.push("</", a, ">")
                },
                text: function(a) {
                    this._.output.push(a)
                },
                comment: function(a) {
                    this._.output.push("<!--", a, "-->")
                },
                write: function(a) {
                    this._.output.push(a)
                },
                reset: function() {
                    this._.output = [];
                    this._.indent = !1
                },
                getHtml: function(a) {
                    var d = this._.output.join("");
                    a && this.reset();
                    return d
                }
            }
        });
        "use strict";
        (function() {
            CKEDITOR.htmlParser.node = function() {};
            CKEDITOR.htmlParser.node.prototype = {
                remove: function() {
                    var a = this.parent.children,
                        d = CKEDITOR.tools.indexOf(a, this),
                        b = this.previous,
                        c = this.next;
                    b && (b.next = c);
                    c && (c.previous = b);
                    a.splice(d, 1);
                    this.parent = null
                },
                replaceWith: function(a) {
                    var d = this.parent.children,
                        b = CKEDITOR.tools.indexOf(d, this),
                        c = a.previous = this.previous,
                        e = a.next = this.next;
                    c && (c.next = a);
                    e && (e.previous = a);
                    d[b] = a;
                    a.parent = this.parent;
                    this.parent = null
                },
                insertAfter: function(a) {
                    var d = a.parent.children,
                        b = CKEDITOR.tools.indexOf(d, a),
                        c = a.next;
                    d.splice(b + 1, 0, this);
                    this.next = a.next;
                    this.previous = a;
                    a.next = this;
                    c && (c.previous = this);
                    this.parent = a.parent
                },
                insertBefore: function(a) {
                    var d = a.parent.children,
                        b = CKEDITOR.tools.indexOf(d, a);
                    d.splice(b, 0, this);
                    this.next = a;
                    (this.previous = a.previous) && (a.previous.next = this);
                    a.previous = this;
                    this.parent = a.parent
                },
                getAscendant: function(a) {
                    var d = "function" == typeof a ? a : "string" == typeof a ? function(b) {
                            return b.name == a
                        } : function(b) {
                            return b.name in a
                        },
                        b = this.parent;
                    for (; b && b.type == CKEDITOR.NODE_ELEMENT;) {
                        if (d(b)) return b;
                        b = b.parent
                    }
                    return null
                },
                wrapWith: function(a) {
                    this.replaceWith(a);
                    a.add(this);
                    return a
                },
                getIndex: function() {
                    return CKEDITOR.tools.indexOf(this.parent.children, this)
                },
                getFilterContext: function(a) {
                    return a || {}
                }
            }
        })();
        "use strict";
        CKEDITOR.htmlParser.comment = function(a) {
            this.value = a;
            this._ = {
                isBlockLike: !1
            }
        };
        CKEDITOR.htmlParser.comment.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
            type: CKEDITOR.NODE_COMMENT,
            filter: function(a, d) {
                var b = this.value;
                if (!(b = a.onComment(d, b, this))) return this.remove(), !1;
                if ("string" != typeof b) return this.replaceWith(b), !1;
                this.value = b;
                return !0
            },
            writeHtml: function(a, d) {
                d && this.filter(d);
                a.comment(this.value)
            }
        });
        "use strict";
        (function() {
            CKEDITOR.htmlParser.text = function(a) {
                this.value = a;
                this._ = {
                    isBlockLike: !1
                }
            };
            CKEDITOR.htmlParser.text.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
                type: CKEDITOR.NODE_TEXT,
                filter: function(a, d) {
                    if (!(this.value = a.onText(d, this.value, this))) return this.remove(), !1
                },
                writeHtml: function(a, d) {
                    d && this.filter(d);
                    a.text(this.value)
                }
            })
        })();
        "use strict";
        (function() {
            CKEDITOR.htmlParser.cdata = function(a) {
                this.value = a
            };
            CKEDITOR.htmlParser.cdata.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
                type: CKEDITOR.NODE_TEXT,
                filter: function() {},
                writeHtml: function(a) {
                    a.write(this.value)
                }
            })
        })();
        "use strict";
        CKEDITOR.htmlParser.fragment = function() {
            this.children = [];
            this.parent = null;
            this._ = {
                isBlockLike: !0,
                hasInlineStarted: !1
            }
        };
        (function() {
            function a(a) {
                return a.attributes["data-cke-survive"] ? !1 : "a" == a.name && a.attributes.href || CKEDITOR.dtd.$removeEmpty[a.name]
            }
            var d = CKEDITOR.tools.extend({
                    table: 1,
                    ul: 1,
                    ol: 1,
                    dl: 1
                }, CKEDITOR.dtd.table, CKEDITOR.dtd.ul, CKEDITOR.dtd.ol, CKEDITOR.dtd.dl),
                b = {
                    ol: 1,
                    ul: 1
                },
                c = CKEDITOR.tools.extend({}, {
                    html: 1
                }, CKEDITOR.dtd.html, CKEDITOR.dtd.body, CKEDITOR.dtd.head, {
                    style: 1,
                    script: 1
                }),
                e = {
                    ul: "li",
                    ol: "li",
                    dl: "dd",
                    table: "tbody",
                    tbody: "tr",
                    thead: "tr",
                    tfoot: "tr",
                    tr: "td"
                };
            CKEDITOR.htmlParser.fragment.fromHtml = function(g, l, k) {
                function q(a) {
                    var b;
                    if (0 < x.length)
                        for (var c = 0; c < x.length; c++) {
                            var d = x[c],
                                h = d.name,
                                e = CKEDITOR.dtd[h],
                                f = u.name && CKEDITOR.dtd[u.name];
                            f && !f[h] || a && e && !e[a] && CKEDITOR.dtd[a] ? h == u.name && (y(u, u.parent, 1), c--) : (b || (w(), b = 1), d = d.clone(), d.parent = u, u = d, x.splice(c, 1), c--)
                        }
                }

                function w() {
                    for (; G.length;) y(G.shift(), u)
                }

                function f(a) {
                    if (a._.isBlockLike && "pre" != a.name && "textarea" != a.name) {
                        var b = a.children.length,
                            c = a.children[b - 1],
                            d;
                        c && c.type == CKEDITOR.NODE_TEXT && ((d = CKEDITOR.tools.rtrim(c.value)) ? c.value = d : a.children.length = b - 1)
                    }
                }

                function y(b, c, d) {
                    c = c || u || p;
                    var e = u;
                    void 0 === b.previous && (A(c, b) && (u = c, D.onTagOpen(k, {}), b.returnPoint = c = u), f(b), a(b) && !b.children.length || c.add(b), "pre" == b.name && (h = !1), "textarea" == b.name && (r = !1));
                    b.returnPoint ? (u = b.returnPoint, delete b.returnPoint) : u = d ? c : e
                }

                function A(a, b) {
                    if ((a == p || "body" == a.name) && k && (!a.name || CKEDITOR.dtd[a.name][k])) {
                        var c, d;
                        return (c = b.attributes && (d = b.attributes["data-cke-real-element-type"]) ? d : b.name) && c in CKEDITOR.dtd.$inline && !(c in CKEDITOR.dtd.head) && !b.isOrphan || b.type == CKEDITOR.NODE_TEXT
                    }
                }

                function t(a, b) {
                    return a in CKEDITOR.dtd.$listItem || a in CKEDITOR.dtd.$tableContent ? a == b || "dt" == a && "dd" == b || "dd" == a && "dt" == b : !1
                }
                var D = new CKEDITOR.htmlParser,
                    p = l instanceof CKEDITOR.htmlParser.element ? l : "string" == typeof l ? new CKEDITOR.htmlParser.element(l) : new CKEDITOR.htmlParser.fragment,
                    x = [],
                    G = [],
                    u = p,
                    r = "textarea" == p.name,
                    h = "pre" == p.name;
                D.onTagOpen = function(e, m, f, g) {
                    m = new CKEDITOR.htmlParser.element(e, m);
                    m.isUnknown && f && (m.isEmpty = !0);
                    m.isOptionalClose = g;
                    if (a(m)) x.push(m);
                    else {
                        if ("pre" == e) h = !0;
                        else {
                            if ("br" == e && h) {
                                u.add(new CKEDITOR.htmlParser.text("\n"));
                                return
                            }
                            "textarea" == e && (r = !0)
                        }
                        if ("br" == e) G.push(m);
                        else {
                            for (; !(g = (f = u.name) ? CKEDITOR.dtd[f] || (u._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c, m.isUnknown || u.isUnknown || g[e]);)
                                if (u.isOptionalClose) D.onTagClose(f);
                                else if (e in b && f in b) f = u.children, (f = f[f.length - 1]) && "li" == f.name || y(f = new CKEDITOR.htmlParser.element("li"), u), !m.returnPoint && (m.returnPoint = u), u = f;
                            else if (e in CKEDITOR.dtd.$listItem && !t(e, f)) D.onTagOpen("li" == e ? "ul" : "dl", {}, 0, 1);
                            else if (f in d && !t(e, f)) !m.returnPoint && (m.returnPoint = u), u = u.parent;
                            else if (f in CKEDITOR.dtd.$inline && x.unshift(u), u.parent) y(u, u.parent, 1);
                            else {
                                m.isOrphan = 1;
                                break
                            }
                            q(e);
                            w();
                            m.parent = u;
                            m.isEmpty ? y(m) : u = m
                        }
                    }
                };
                D.onTagClose = function(a) {
                    for (var b = x.length - 1; 0 <= b; b--)
                        if (a == x[b].name) {
                            x.splice(b, 1);
                            return
                        }
                    for (var c = [], d = [], h = u; h != p && h.name != a;) h._.isBlockLike || d.unshift(h), c.push(h), h = h.returnPoint || h.parent;
                    if (h != p) {
                        for (b = 0; b < c.length; b++) {
                            var e = c[b];
                            y(e, e.parent)
                        }
                        u = h;
                        h._.isBlockLike && w();
                        y(h, h.parent);
                        h == u && (u = u.parent);
                        x = x.concat(d)
                    }
                    "body" == a && (k = !1)
                };
                D.onText = function(a) {
                    if (!(u._.hasInlineStarted && !G.length || h || r) && (a = CKEDITOR.tools.ltrim(a), 0 === a.length)) return;
                    var b = u.name,
                        f = b ? CKEDITOR.dtd[b] || (u._.isBlockLike ? CKEDITOR.dtd.div : CKEDITOR.dtd.span) : c;
                    if (!r && !f["#"] && b in d) D.onTagOpen(e[b] || ""), D.onText(a);
                    else {
                        w();
                        q();
                        h || r || (a = a.replace(/[\t\r\n ]{2,}|[\t\r\n]/g, " "));
                        a = new CKEDITOR.htmlParser.text(a);
                        if (A(u, a)) this.onTagOpen(k, {}, 0, 1);
                        u.add(a)
                    }
                };
                D.onCDATA = function(a) {
                    u.add(new CKEDITOR.htmlParser.cdata(a))
                };
                D.onComment = function(a) {
                    w();
                    q();
                    u.add(new CKEDITOR.htmlParser.comment(a))
                };
                D.parse(g);
                for (w(); u != p;) y(u, u.parent, 1);
                f(p);
                return p
            };
            CKEDITOR.htmlParser.fragment.prototype = {
                type: CKEDITOR.NODE_DOCUMENT_FRAGMENT,
                add: function(a, b) {
                    isNaN(b) && (b = this.children.length);
                    var c = 0 < b ? this.children[b - 1] : null;
                    if (c) {
                        if (a._.isBlockLike && c.type == CKEDITOR.NODE_TEXT && (c.value = CKEDITOR.tools.rtrim(c.value), 0 === c.value.length)) {
                            this.children.pop();
                            this.add(a);
                            return
                        }
                        c.next = a
                    }
                    a.previous = c;
                    a.parent = this;
                    this.children.splice(b, 0, a);
                    this._.hasInlineStarted || (this._.hasInlineStarted = a.type == CKEDITOR.NODE_TEXT || a.type == CKEDITOR.NODE_ELEMENT && !a._.isBlockLike)
                },
                filter: function(a, b) {
                    b = this.getFilterContext(b);
                    a.onRoot(b, this);
                    this.filterChildren(a, !1, b)
                },
                filterChildren: function(a, b, c) {
                    if (this.childrenFilteredBy != a.id) {
                        c = this.getFilterContext(c);
                        if (b && !this.parent) a.onRoot(c, this);
                        this.childrenFilteredBy = a.id;
                        for (b = 0; b < this.children.length; b++) !1 === this.children[b].filter(a, c) && b--
                    }
                },
                writeHtml: function(a, b) {
                    b && this.filter(b);
                    this.writeChildrenHtml(a)
                },
                writeChildrenHtml: function(a, b, c) {
                    var d = this.getFilterContext();
                    if (c && !this.parent && b) b.onRoot(d, this);
                    b && this.filterChildren(b, !1, d);
                    b = 0;
                    c = this.children;
                    for (d = c.length; b < d; b++) c[b].writeHtml(a)
                },
                forEach: function(a, b, c) {
                    if (!(c || b && this.type != b)) var d = a(this);
                    if (!1 !== d) {
                        c = this.children;
                        for (var e = 0; e < c.length; e++) d = c[e], d.type == CKEDITOR.NODE_ELEMENT ? d.forEach(a, b) : b && d.type != b || a(d)
                    }
                },
                getFilterContext: function(a) {
                    return a || {}
                }
            }
        })();
        "use strict";
        (function() {
            function a() {
                this.rules = []
            }

            function d(b, c, d, g) {
                var l, k;
                for (l in c)(k = b[l]) || (k = b[l] = new a), k.add(c[l], d, g)
            }
            CKEDITOR.htmlParser.filter = CKEDITOR.tools.createClass({
                $: function(b) {
                    this.id = CKEDITOR.tools.getNextNumber();
                    this.elementNameRules = new a;
                    this.attributeNameRules = new a;
                    this.elementsRules = {};
                    this.attributesRules = {};
                    this.textRules = new a;
                    this.commentRules = new a;
                    this.rootRules = new a;
                    b && this.addRules(b, 10)
                },
                proto: {
                    addRules: function(a, c) {
                        var e;
                        "number" == typeof c ? e = c : c && "priority" in c && (e = c.priority);
                        "number" != typeof e && (e = 10);
                        "object" != typeof c && (c = {});
                        a.elementNames && this.elementNameRules.addMany(a.elementNames, e, c);
                        a.attributeNames && this.attributeNameRules.addMany(a.attributeNames, e, c);
                        a.elements && d(this.elementsRules, a.elements, e, c);
                        a.attributes && d(this.attributesRules, a.attributes, e, c);
                        a.text && this.textRules.add(a.text, e, c);
                        a.comment && this.commentRules.add(a.comment, e, c);
                        a.root && this.rootRules.add(a.root, e, c)
                    },
                    applyTo: function(a) {
                        a.filter(this)
                    },
                    onElementName: function(a, c) {
                        return this.elementNameRules.execOnName(a, c)
                    },
                    onAttributeName: function(a, c) {
                        return this.attributeNameRules.execOnName(a, c)
                    },
                    onText: function(a, c, d) {
                        return this.textRules.exec(a, c, d)
                    },
                    onComment: function(a, c, d) {
                        return this.commentRules.exec(a, c, d)
                    },
                    onRoot: function(a, c) {
                        return this.rootRules.exec(a, c)
                    },
                    onElement: function(a, c) {
                        for (var d = [this.elementsRules["^"], this.elementsRules[c.name], this.elementsRules.$], g, l = 0; 3 > l; l++)
                            if (g = d[l]) {
                                g = g.exec(a, c, this);
                                if (!1 === g) return null;
                                if (g && g != c) return this.onNode(a, g);
                                if (c.parent && !c.name) break
                            }
                        return c
                    },
                    onNode: function(a, c) {
                        var d = c.type;
                        return d == CKEDITOR.NODE_ELEMENT ? this.onElement(a, c) : d == CKEDITOR.NODE_TEXT ? new CKEDITOR.htmlParser.text(this.onText(a, c.value)) : d == CKEDITOR.NODE_COMMENT ? new CKEDITOR.htmlParser.comment(this.onComment(a, c.value)) : null
                    },
                    onAttribute: function(a, c, d, g) {
                        return (d = this.attributesRules[d]) ? d.exec(a, g, c, this) : g
                    }
                }
            });
            CKEDITOR.htmlParser.filterRulesGroup = a;
            a.prototype = {
                add: function(a, c, d) {
                    this.rules.splice(this.findIndex(c), 0, {
                        value: a,
                        priority: c,
                        options: d
                    })
                },
                addMany: function(a, c, d) {
                    for (var g = [this.findIndex(c), 0], l = 0, k = a.length; l < k; l++) g.push({
                        value: a[l],
                        priority: c,
                        options: d
                    });
                    this.rules.splice.apply(this.rules, g)
                },
                findIndex: function(a) {
                    for (var c = this.rules, d = c.length - 1; 0 <= d && a < c[d].priority;) d--;
                    return d + 1
                },
                exec: function(a, c) {
                    var d = c instanceof CKEDITOR.htmlParser.node || c instanceof CKEDITOR.htmlParser.fragment,
                        g = Array.prototype.slice.call(arguments, 1),
                        l = this.rules,
                        k = l.length,
                        q, w, f, y;
                    for (y = 0; y < k; y++)
                        if (d && (q = c.type, w = c.name), f = l[y], !(a.nonEditable && !f.options.applyToAll || a.nestedEditable && f.options.excludeNestedEditable)) {
                            f = f.value.apply(null, g);
                            if (!1 === f || d && f && (f.name != w || f.type != q)) return f;
                            null != f && (g[0] = c = f)
                        }
                    return c
                },
                execOnName: function(a, c) {
                    for (var d = 0, g = this.rules, l = g.length, k; c && d < l; d++) k = g[d], a.nonEditable && !k.options.applyToAll || a.nestedEditable && k.options.excludeNestedEditable || (c = c.replace(k.value[0], k.value[1]));
                    return c
                }
            }
        })();
        (function() {
            function a(a, d) {
                function m(a) {
                    return a || CKEDITOR.env.needsNbspFiller ? new CKEDITOR.htmlParser.text(" ") : new CKEDITOR.htmlParser.element("br", {
                        "data-cke-bogus": 1
                    })
                }

                function n(a, d) {
                    return function(h) {
                        if (h.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
                            var e = [],
                                n = b(h),
                                r, F;
                            if (n)
                                for (f(n, 1) && e.push(n); n;) g(n) && (r = c(n)) && f(r) && ((F = c(r)) && !g(F) ? e.push(r) : (m(v).insertAfter(r), r.remove())), n = n.previous;
                            for (n = 0; n < e.length; n++) e[n].remove();
                            if (e = !a || !1 !== ("function" == typeof d ? d(h) : d)) v || CKEDITOR.env.needsBrFiller || h.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT ? v || CKEDITOR.env.needsBrFiller || !(7 < document.documentMode || h.name in CKEDITOR.dtd.tr || h.name in CKEDITOR.dtd.$listItem) ? (e = b(h), e = !e || "form" == h.name && "input" == e.name) : e = !1 : e = !1;
                            e && h.add(m(a))
                        }
                    }
                }

                function f(a, b) {
                    if ((!v || CKEDITOR.env.needsBrFiller) && a.type == CKEDITOR.NODE_ELEMENT && "br" == a.name && !a.attributes["data-cke-eol"]) return !0;
                    var c;
                    return a.type == CKEDITOR.NODE_TEXT && (c = a.value.match(x)) && (c.index && (new CKEDITOR.htmlParser.text(a.value.substring(0, c.index)).insertBefore(a), a.value = c[0]), !CKEDITOR.env.needsBrFiller && v && (!b || a.parent.name in z) || !v && ((c = a.previous) && "br" == c.name || !c || g(c))) ? !0 : !1
                }
                var r = {
                        elements: {}
                    },
                    v = "html" == d,
                    z = CKEDITOR.tools.extend({}, h),
                    E;
                for (E in z) "#" in u[E] || delete z[E];
                for (E in z) r.elements[E] = n(v, a.config.fillEmptyBlocks);
                r.root = n(v, !1);
                r.elements.br = function(a) {
                    return function(b) {
                        if (b.parent.type != CKEDITOR.NODE_DOCUMENT_FRAGMENT) {
                            var d = b.attributes;
                            if ("data-cke-bogus" in d || "data-cke-eol" in d) delete d["data-cke-bogus"];
                            else {
                                for (d = b.next; d && e(d);) d = d.next;
                                var h = c(b);
                                !d && g(b.parent) ? l(b.parent, m(a)) : g(d) && h && !g(h) && m(a).insertBefore(d)
                            }
                        }
                    }
                }(v);
                return r
            }

            function d(a, b) {
                return a != CKEDITOR.ENTER_BR && !1 !== b ? a == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
            }

            function b(a) {
                for (a = a.children[a.children.length - 1]; a && e(a);) a = a.previous;
                return a
            }

            function c(a) {
                for (a = a.previous; a && e(a);) a = a.previous;
                return a
            }

            function e(a) {
                return a.type == CKEDITOR.NODE_TEXT && !CKEDITOR.tools.trim(a.value) || a.type == CKEDITOR.NODE_ELEMENT && a.attributes["data-cke-bookmark"]
            }

            function g(a) {
                return a && (a.type == CKEDITOR.NODE_ELEMENT && a.name in h || a.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT)
            }

            function l(a, b) {
                var c = a.children[a.children.length - 1];
                a.children.push(b);
                b.parent = a;
                c && (c.next = b, b.previous = c)
            }

            function k(a) {
                a = a.attributes;
                "false" != a.contenteditable && (a["data-cke-editable"] = a.contenteditable ? "true" : 1);
                a.contenteditable = "false"
            }

            function q(a) {
                a = a.attributes;
                switch (a["data-cke-editable"]) {
                    case "true":
                        a.contenteditable = "true";
                        break;
                    case "1":
                        delete a.contenteditable
                }
            }

            function w(a) {
                return a.replace(E, function(a, b, c) {
                    return "<" + b + c.replace(C, function(a, b) {
                        return H.test(b) && -1 == c.indexOf("data-cke-saved-" + b) ? " data-cke-saved-" + a + " data-cke-" + CKEDITOR.rnd + "-" + a : a
                    }) + ">"
                })
            }

            function f(a, b) {
                return a.replace(b, function(a, b, c) {
                    0 === a.indexOf("<textarea") && (a = b + t(c).replace(/</g, "&lt;").replace(/>/g, "&gt;") + "</textarea>");
                    return "<cke:encoded>" + encodeURIComponent(a) + "</cke:encoded>"
                })
            }

            function y(a) {
                return a.replace(Q, function(a, b) {
                    return decodeURIComponent(b)
                })
            }

            function A(a) {
                return a.replace(/\x3c!--(?!{cke_protected})[\s\S]+?--\x3e/g, function(a) {
                    return "<!--" + G + "{C}" + encodeURIComponent(a).replace(/--/g, "%2D%2D") + "-->"
                })
            }

            function t(a) {
                return a.replace(/\x3c!--\{cke_protected\}\{C\}([\s\S]+?)--\x3e/g, function(a, b) {
                    return decodeURIComponent(b)
                })
            }

            function D(a, b) {
                var c = b._.dataStore;
                return a.replace(/\x3c!--\{cke_protected\}([\s\S]+?)--\x3e/g, function(a, b) {
                    return decodeURIComponent(b)
                }).replace(/\{cke_protected_(\d+)\}/g, function(a, b) {
                    return c && c[b] || ""
                })
            }

            function p(a, b) {
                var c = [],
                    d = b.config.protectedSource,
                    h = b._.dataStore || (b._.dataStore = {
                        id: 1
                    }),
                    e = /<\!--\{cke_temp(comment)?\}(\d*?)--\x3e/g,
                    d = [/<script[\s\S]*?(<\/script>|$)/gi, /<noscript[\s\S]*?<\/noscript>/gi, /<meta[\s\S]*?\/?>/gi].concat(d);
                a = a.replace(/\x3c!--[\s\S]*?--\x3e/g, function(a) {
                    return "<!--{cke_tempcomment}" + (c.push(a) - 1) + "-->"
                });
                for (var m = 0; m < d.length; m++) a = a.replace(d[m], function(a) {
                    a = a.replace(e, function(a, b, d) {
                        return c[d]
                    });
                    return /cke_temp(comment)?/.test(a) ? a : "<!--{cke_temp}" + (c.push(a) - 1) + "-->"
                });
                a = a.replace(e, function(a, b, d) {
                    return "<!--" + G + (b ? "{C}" : "") + encodeURIComponent(c[d]).replace(/--/g, "%2D%2D") + "-->"
                });
                a = a.replace(/<\w+(?:\s+(?:(?:[^\s=>]+\s*=\s*(?:[^'"\s>]+|'[^']*'|"[^"]*"))|[^\s=\/>]+))+\s*\/?>/g, function(a) {
                    return a.replace(/\x3c!--\{cke_protected\}([^>]*)--\x3e/g, function(a, b) {
                        h[h.id] = decodeURIComponent(b);
                        return "{cke_protected_" + h.id++ + "}"
                    })
                });
                return a = a.replace(/<(title|iframe|textarea)([^>]*)>([\s\S]*?)<\/\1>/g, function(a, c, d, h) {
                    return "<" + c + d + ">" + D(t(h), b) + "</" + c + ">"
                })
            }
            CKEDITOR.htmlDataProcessor = function(b) {
                var c, h, e = this;
                this.editor = b;
                this.dataFilter = c = new CKEDITOR.htmlParser.filter;
                this.htmlFilter = h = new CKEDITOR.htmlParser.filter;
                this.writer = new CKEDITOR.htmlParser.basicWriter;
                c.addRules(n);
                c.addRules(m, {
                    applyToAll: !0
                });
                c.addRules(a(b, "data"), {
                    applyToAll: !0
                });
                h.addRules(z);
                h.addRules(B, {
                    applyToAll: !0
                });
                h.addRules(a(b, "html"), {
                    applyToAll: !0
                });
                b.on("toHtml", function(a) {
                    a = a.data;
                    var c = a.dataValue,
                        h, c = p(c, b),
                        c = f(c, T),
                        c = w(c),
                        c = f(c, R),
                        c = c.replace(v, "$1cke:$2"),
                        c = c.replace(J, "<cke:$1$2></cke:$1>"),
                        c = c.replace(/(<pre\b[^>]*>)(\r\n|\n)/g, "$1$2$2"),
                        c = c.replace(/([^a-z0-9<\-])(on\w{3,})(?!>)/gi, "$1data-cke-" + CKEDITOR.rnd + "-$2");
                    h = a.context || b.editable().getName();
                    var e;
                    CKEDITOR.env.ie && 9 > CKEDITOR.env.version && "pre" == h && (h = "div", c = "<pre>" + c + "</pre>", e = 1);
                    h = b.document.createElement(h);
                    h.setHtml("a" + c);
                    c = h.getHtml().substr(1);
                    c = c.replace(new RegExp("data-cke-" + CKEDITOR.rnd + "-", "ig"), "");
                    e && (c = c.replace(/^<pre>|<\/pre>$/gi, ""));
                    c = c.replace(I, "$1$2");
                    c = y(c);
                    c = t(c);
                    h = !1 === a.fixForBody ? !1 : d(a.enterMode, b.config.autoParagraph);
                    c = CKEDITOR.htmlParser.fragment.fromHtml(c, a.context, h);
                    h && (e = c, !e.children.length && CKEDITOR.dtd[e.name][h] && (h = new CKEDITOR.htmlParser.element(h), e.add(h)));
                    a.dataValue = c
                }, null, null, 5);
                b.on("toHtml", function(a) {
                    a.data.filter.applyTo(a.data.dataValue, !0, a.data.dontFilter, a.data.enterMode) && b.fire("dataFiltered")
                }, null, null, 6);
                b.on("toHtml", function(a) {
                    a.data.dataValue.filterChildren(e.dataFilter, !0)
                }, null, null, 10);
                b.on("toHtml", function(a) {
                    a = a.data;
                    var b = a.dataValue,
                        c = new CKEDITOR.htmlParser.basicWriter;
                    b.writeChildrenHtml(c);
                    b = c.getHtml(!0);
                    a.dataValue = A(b)
                }, null, null, 15);
                b.on("toDataFormat", function(a) {
                    var c = a.data.dataValue;
                    a.data.enterMode != CKEDITOR.ENTER_BR && (c = c.replace(/^<br *\/?>/i, ""));
                    a.data.dataValue = CKEDITOR.htmlParser.fragment.fromHtml(c, a.data.context, d(a.data.enterMode, b.config.autoParagraph))
                }, null, null, 5);
                b.on("toDataFormat", function(a) {
                    a.data.dataValue.filterChildren(e.htmlFilter, !0)
                }, null, null, 10);
                b.on("toDataFormat", function(a) {
                    a.data.filter.applyTo(a.data.dataValue, !1, !0)
                }, null, null, 11);
                b.on("toDataFormat", function(a) {
                    var c = a.data.dataValue,
                        d = e.writer;
                    d.reset();
                    c.writeChildrenHtml(d);
                    c = d.getHtml(!0);
                    c = t(c);
                    c = D(c, b);
                    a.data.dataValue = c
                }, null, null, 15)
            };
            CKEDITOR.htmlDataProcessor.prototype = {
                toHtml: function(a, b, c, d) {
                    var h = this.editor,
                        e, m, n, f;
                    b && "object" == typeof b ? (e = b.context, c = b.fixForBody, d = b.dontFilter, m = b.filter, n = b.enterMode, f = b.protectedWhitespaces) : e = b;
                    e || null === e || (e = h.editable().getName());
                    return h.fire("toHtml", {
                        dataValue: a,
                        context: e,
                        fixForBody: c,
                        dontFilter: d,
                        filter: m || h.filter,
                        enterMode: n || h.enterMode,
                        protectedWhitespaces: f
                    }).dataValue
                },
                toDataFormat: function(a, b) {
                    var c, d, h;
                    b && (c = b.context, d = b.filter, h = b.enterMode);
                    c || null === c || (c = this.editor.editable().getName());
                    return this.editor.fire("toDataFormat", {
                        dataValue: a,
                        filter: d || this.editor.filter,
                        context: c,
                        enterMode: h || this.editor.enterMode
                    }).dataValue
                }
            };
            var x = /(?:&nbsp;|\xa0)$/,
                G = "{cke_protected}",
                u = CKEDITOR.dtd,
                r = "caption colgroup col thead tfoot tbody".split(" "),
                h = CKEDITOR.tools.extend({}, u.$blockLimit, u.$block),
                n = {
                    elements: {
                        input: k,
                        textarea: k
                    }
                },
                m = {
                    attributeNames: [
                        [/^on/, "data-cke-pa-on"],
                        [/^data-cke-expando$/, ""]
                    ]
                },
                z = {
                    elements: {
                        embed: function(a) {
                            var b = a.parent;
                            if (b && "object" == b.name) {
                                var c = b.attributes.width,
                                    b = b.attributes.height;
                                c && (a.attributes.width = c);
                                b && (a.attributes.height = b)
                            }
                        },
                        a: function(a) {
                            var b = a.attributes;
                            if (!(a.children.length || b.name || b.id || a.attributes["data-cke-saved-name"])) return !1
                        }
                    }
                },
                B = {
                    elementNames: [
                        [/^cke:/, ""],
                        [/^\?xml:namespace$/, ""]
                    ],
                    attributeNames: [
                        [/^data-cke-(saved|pa)-/, ""],
                        [/^data-cke-.*/, ""],
                        ["hidefocus", ""]
                    ],
                    elements: {
                        $: function(a) {
                            var b = a.attributes;
                            if (b) {
                                if (b["data-cke-temp"]) return !1;
                                for (var c = ["name", "href", "src"], d, h = 0; h < c.length; h++) d = "data-cke-saved-" + c[h], d in b && delete b[c[h]]
                            }
                            return a
                        },
                        table: function(a) {
                            a.children.slice(0).sort(function(a, b) {
                                var c, d;
                                a.type == CKEDITOR.NODE_ELEMENT && b.type == a.type && (c = CKEDITOR.tools.indexOf(r, a.name), d = CKEDITOR.tools.indexOf(r, b.name)); - 1 < c && -1 < d && c != d || (c = a.parent ? a.getIndex() : -1, d = b.parent ? b.getIndex() : -1);
                                return c > d ? 1 : -1
                            })
                        },
                        param: function(a) {
                            a.children = [];
                            a.isEmpty = !0;
                            return a
                        },
                        span: function(a) {
                            "Apple-style-span" == a.attributes["class"] && delete a.name
                        },
                        html: function(a) {
                            delete a.attributes.contenteditable;
                            delete a.attributes["class"]
                        },
                        body: function(a) {
                            delete a.attributes.spellcheck;
                            delete a.attributes.contenteditable
                        },
                        style: function(a) {
                            var b = a.children[0];
                            b && b.value && (b.value = CKEDITOR.tools.trim(b.value));
                            a.attributes.type || (a.attributes.type = "text/css")
                        },
                        title: function(a) {
                            var b = a.children[0];
                            !b && l(a, b = new CKEDITOR.htmlParser.text);
                            b.value = a.attributes["data-cke-title"] || ""
                        },
                        input: q,
                        textarea: q
                    },
                    attributes: {
                        "class": function(a) {
                            return CKEDITOR.tools.ltrim(a.replace(/(?:^|\s+)cke_[^\s]*/g, "")) || !1
                        }
                    }
                };
            CKEDITOR.env.ie && (B.attributes.style = function(a) {
                return a.replace(/(^|;)([^\:]+)/g, function(a) {
                    return a.toLowerCase()
                })
            });
            var E = /<(a|area|img|input|source)\b([^>]*)>/gi,
                C = /([\w-:]+)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+))/gi,
                H = /^(href|src|name)$/i,
                R = /(?:<style(?=[ >])[^>]*>[\s\S]*?<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,
                T = /(<textarea(?=[ >])[^>]*>)([\s\S]*?)(?:<\/textarea>)/gi,
                Q = /<cke:encoded>([^<]*)<\/cke:encoded>/gi,
                v = /(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,
                I = /(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,
                J = /<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi
        })();
        "use strict";
        CKEDITOR.htmlParser.element = function(a, d) {
            this.name = a;
            this.attributes = d || {};
            this.children = [];
            var b = a || "",
                c = b.match(/^cke:(.*)/);
            c && (b = c[1]);
            b = !!(CKEDITOR.dtd.$nonBodyContent[b] || CKEDITOR.dtd.$block[b] || CKEDITOR.dtd.$listItem[b] || CKEDITOR.dtd.$tableContent[b] || CKEDITOR.dtd.$nonEditable[b] || "br" == b);
            this.isEmpty = !!CKEDITOR.dtd.$empty[a];
            this.isUnknown = !CKEDITOR.dtd[a];
            this._ = {
                isBlockLike: b,
                hasInlineStarted: this.isEmpty || !b
            }
        };
        CKEDITOR.htmlParser.cssStyle = function(a) {
            var d = {};
            ((a instanceof CKEDITOR.htmlParser.element ? a.attributes.style : a) || "").replace(/&quot;/g, '"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g, function(a, c, e) {
                "font-family" == c && (e = e.replace(/["']/g, ""));
                d[c.toLowerCase()] = e
            });
            return {
                rules: d,
                populate: function(a) {
                    var c = this.toString();
                    c && (a instanceof CKEDITOR.dom.element ? a.setAttribute("style", c) : a instanceof CKEDITOR.htmlParser.element ? a.attributes.style = c : a.style = c)
                },
                toString: function() {
                    var a = [],
                        c;
                    for (c in d) d[c] && a.push(c, ":", d[c], ";");
                    return a.join("")
                }
            }
        };
        (function() {
            function a(a) {
                return function(b) {
                    return b.type == CKEDITOR.NODE_ELEMENT && ("string" == typeof a ? b.name == a : b.name in a)
                }
            }
            var d = function(a, b) {
                    a = a[0];
                    b = b[0];
                    return a < b ? -1 : a > b ? 1 : 0
                },
                b = CKEDITOR.htmlParser.fragment.prototype;
            CKEDITOR.htmlParser.element.prototype = CKEDITOR.tools.extend(new CKEDITOR.htmlParser.node, {
                type: CKEDITOR.NODE_ELEMENT,
                add: b.add,
                clone: function() {
                    return new CKEDITOR.htmlParser.element(this.name, this.attributes)
                },
                filter: function(a, b) {
                    var d = this,
                        l, k;
                    b = d.getFilterContext(b);
                    if (b.off) return !0;
                    if (!d.parent) a.onRoot(b, d);
                    for (;;) {
                        l = d.name;
                        if (!(k = a.onElementName(b, l))) return this.remove(), !1;
                        d.name = k;
                        if (!(d = a.onElement(b, d))) return this.remove(), !1;
                        if (d !== this) return this.replaceWith(d), !1;
                        if (d.name == l) break;
                        if (d.type != CKEDITOR.NODE_ELEMENT) return this.replaceWith(d), !1;
                        if (!d.name) return this.replaceWithChildren(), !1
                    }
                    l = d.attributes;
                    var q, w;
                    for (q in l) {
                        for (k = l[q];;)
                            if (w = a.onAttributeName(b, q))
                                if (w != q) delete l[q], q = w;
                                else break;
                        else {
                            delete l[q];
                            break
                        }
                        w && (!1 === (k = a.onAttribute(b, d, w, k)) ? delete l[w] : l[w] = k)
                    }
                    d.isEmpty || this.filterChildren(a, !1, b);
                    return !0
                },
                filterChildren: b.filterChildren,
                writeHtml: function(a, b) {
                    b && this.filter(b);
                    var g = this.name,
                        l = [],
                        k = this.attributes,
                        q, w;
                    a.openTag(g, k);
                    for (q in k) l.push([q, k[q]]);
                    a.sortAttributes && l.sort(d);
                    q = 0;
                    for (w = l.length; q < w; q++) k = l[q], a.attribute(k[0], k[1]);
                    a.openTagClose(g, this.isEmpty);
                    this.writeChildrenHtml(a);
                    this.isEmpty || a.closeTag(g)
                },
                writeChildrenHtml: b.writeChildrenHtml,
                replaceWithChildren: function() {
                    for (var a = this.children, b = a.length; b;) a[--b].insertAfter(this);
                    this.remove()
                },
                forEach: b.forEach,
                getFirst: function(b) {
                    if (!b) return this.children.length ? this.children[0] : null;
                    "function" != typeof b && (b = a(b));
                    for (var d = 0, g = this.children.length; d < g; ++d)
                        if (b(this.children[d])) return this.children[d];
                    return null
                },
                getHtml: function() {
                    var a = new CKEDITOR.htmlParser.basicWriter;
                    this.writeChildrenHtml(a);
                    return a.getHtml()
                },
                setHtml: function(a) {
                    a = this.children = CKEDITOR.htmlParser.fragment.fromHtml(a).children;
                    for (var b = 0, d = a.length; b < d; ++b) a[b].parent = this
                },
                getOuterHtml: function() {
                    var a = new CKEDITOR.htmlParser.basicWriter;
                    this.writeHtml(a);
                    return a.getHtml()
                },
                split: function(a) {
                    for (var b = this.children.splice(a, this.children.length - a), d = this.clone(), l = 0; l < b.length; ++l) b[l].parent = d;
                    d.children = b;
                    b[0] && (b[0].previous = null);
                    0 < a && (this.children[a - 1].next = null);
                    this.parent.add(d, this.getIndex() + 1);
                    return d
                },
                addClass: function(a) {
                    if (!this.hasClass(a)) {
                        var b = this.attributes["class"] || "";
                        this.attributes["class"] = b + (b ? " " : "") + a
                    }
                },
                removeClass: function(a) {
                    var b = this.attributes["class"];
                    b && ((b = CKEDITOR.tools.trim(b.replace(new RegExp("(?:\\s+|^)" + a + "(?:\\s+|$)"), " "))) ? this.attributes["class"] = b : delete this.attributes["class"])
                },
                hasClass: function(a) {
                    var b = this.attributes["class"];
                    return b ? new RegExp("(?:^|\\s)" + a + "(?=\\s|$)").test(b) : !1
                },
                getFilterContext: function(a) {
                    var b = [];
                    a || (a = {
                        off: !1,
                        nonEditable: !1,
                        nestedEditable: !1
                    });
                    a.off || "off" != this.attributes["data-cke-processor"] || b.push("off", !0);
                    a.nonEditable || "false" != this.attributes.contenteditable ? a.nonEditable && !a.nestedEditable && "true" == this.attributes.contenteditable && b.push("nestedEditable", !0) : b.push("nonEditable", !0);
                    if (b.length) {
                        a = CKEDITOR.tools.copy(a);
                        for (var d = 0; d < b.length; d += 2) a[b[d]] = b[d + 1]
                    }
                    return a
                }
            }, !0)
        })();
        (function() {
            var a = {},
                d = /{([^}]+)}/g,
                b = /([\\'])/g,
                c = /\n/g,
                e = /\r/g;
            CKEDITOR.template = function(g) {
                if (a[g]) this.output = a[g];
                else {
                    var l = g.replace(b, "\\$1").replace(c, "\\n").replace(e, "\\r").replace(d, function(a, b) {
                        return "',data['" + b + "']==undefined?'{" + b + "}':data['" + b + "'],'"
                    });
                    this.output = a[g] = Function("data", "buffer", "return buffer?buffer.push('" + l + "'):['" + l + "'].join('');")
                }
            }
        })();
        delete CKEDITOR.loadFullCore;
        CKEDITOR.instances = {};
        CKEDITOR.document = new CKEDITOR.dom.document(document);
        CKEDITOR.add = function(a) {
            CKEDITOR.instances[a.name] = a;
            a.on("focus", function() {
                CKEDITOR.currentInstance != a && (CKEDITOR.currentInstance = a, CKEDITOR.fire("currentInstance"))
            });
            a.on("blur", function() {
                CKEDITOR.currentInstance == a && (CKEDITOR.currentInstance = null, CKEDITOR.fire("currentInstance"))
            });
            CKEDITOR.fire("instance", null, a)
        };
        CKEDITOR.remove = function(a) {
            delete CKEDITOR.instances[a.name]
        };
        (function() {
            var a = {};
            CKEDITOR.addTemplate = function(d, b) {
                var c = a[d];
                if (c) return c;
                c = {
                    name: d,
                    source: b
                };
                CKEDITOR.fire("template", c);
                return a[d] = new CKEDITOR.template(c.source)
            };
            CKEDITOR.getTemplate = function(d) {
                return a[d]
            }
        })();
        (function() {
            var a = [];
            CKEDITOR.addCss = function(d) {
                a.push(d)
            };
            CKEDITOR.getCss = function() {
                return a.join("\n")
            }
        })();
        CKEDITOR.on("instanceDestroyed", function() {
            CKEDITOR.tools.isEmpty(this.instances) && CKEDITOR.fire("reset")
        });
        CKEDITOR.TRISTATE_ON = 1;
        CKEDITOR.TRISTATE_OFF = 2;
        CKEDITOR.TRISTATE_DISABLED = 0;
        (function() {
            CKEDITOR.inline = function(a, d) {
                if (!CKEDITOR.env.isCompatible) return null;
                a = CKEDITOR.dom.element.get(a);
                if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
                var b = new CKEDITOR.editor(d, a, CKEDITOR.ELEMENT_MODE_INLINE),
                    c = a.is("textarea") ? a : null;
                c ? (b.setData(c.getValue(), null, !0), a = CKEDITOR.dom.element.createFromHtml('<div contenteditable="' + !!b.readOnly + '" class="cke_textarea_inline">' + c.getValue() + "</div>", CKEDITOR.document), a.insertAfter(c), c.hide(), c.$.form && b._attachToForm()) : b.setData(a.getHtml(), null, !0);
                b.on("loaded", function() {
                    b.fire("uiReady");
                    b.editable(a);
                    b.container = a;
                    b.ui.contentsElement = a;
                    b.setData(b.getData(1));
                    b.resetDirty();
                    b.fire("contentDom");
                    b.mode = "wysiwyg";
                    b.fire("mode");
                    b.status = "ready";
                    b.fireOnce("instanceReady");
                    CKEDITOR.fire("instanceReady", null, b)
                }, null, null, 1e4);
                b.on("destroy", function() {
                    c && (b.container.clearCustomData(), b.container.remove(), c.show());
                    b.element.clearCustomData();
                    delete b.element
                });
                return b
            };
            CKEDITOR.inlineAll = function() {
                var a, d, b;
                for (b in CKEDITOR.dtd.$editable)
                    for (var c = CKEDITOR.document.getElementsByTag(b), e = 0, g = c.count(); e < g; e++) a = c.getItem(e), "true" == a.getAttribute("contenteditable") && (d = {
                        element: a,
                        config: {}
                    }, !1 !== CKEDITOR.fire("inline", d) && CKEDITOR.inline(a, d.config))
            };
            CKEDITOR.domReady(function() {
                !CKEDITOR.disableAutoInline && CKEDITOR.inlineAll()
            })
        })();
        CKEDITOR.replaceClass = "ckeditor";
        (function() {
            function a(a, e, g, l) {
                if (!CKEDITOR.env.isCompatible) return null;
                a = CKEDITOR.dom.element.get(a);
                if (a.getEditor()) throw 'The editor instance "' + a.getEditor().name + '" is already attached to the provided element.';
                var k = new CKEDITOR.editor(e, a, l);
                l == CKEDITOR.ELEMENT_MODE_REPLACE && (a.setStyle("visibility", "hidden"), k._.required = a.hasAttribute("required"), a.removeAttribute("required"));
                g && k.setData(g, null, !0);
                k.on("loaded", function() {
                    b(k);
                    l == CKEDITOR.ELEMENT_MODE_REPLACE && k.config.autoUpdateElement && a.$.form && k._attachToForm();
                    k.setMode(k.config.startupMode, function() {
                        k.resetDirty();
                        k.status = "ready";
                        k.fireOnce("instanceReady");
                        CKEDITOR.fire("instanceReady", null, k)
                    })
                });
                k.on("destroy", d);
                return k
            }

            function d() {
                var a = this.container,
                    b = this.element;
                a && (a.clearCustomData(), a.remove());
                b && (b.clearCustomData(), this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (b.show(), this._.required && b.setAttribute("required", "required")), delete this.element)
            }

            function b(a) {
                var b = a.name,
                    d = a.element,
                    l = a.elementMode,
                    k = a.fire("uiSpace", {
                        space: "top",
                        html: ""
                    }).html,
                    q = a.fire("uiSpace", {
                        space: "bottom",
                        html: ""
                    }).html,
                    w = new CKEDITOR.template('<{outerEl} id="cke_{name}" class="{id} cke cke_reset cke_chrome cke_editor_{name} cke_{langDir} ' + CKEDITOR.env.cssClass + '"  dir="{langDir}" lang="{langCode}" role="application"' + (a.title ? ' aria-labelledby="cke_{name}_arialbl"' : "") + ">" + (a.title ? '<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>' : "") + '<{outerEl} class="cke_inner cke_reset" role="presentation">{topHtml}<{outerEl} id="{contentId}" class="cke_contents cke_reset" role="presentation"></{outerEl}>{bottomHtml}</{outerEl}></{outerEl}>'),
                    b = CKEDITOR.dom.element.createFromHtml(w.output({
                        id: a.id,
                        name: b,
                        langDir: a.lang.dir,
                        langCode: a.langCode,
                        voiceLabel: a.title,
                        topHtml: k ? '<span id="' + a.ui.spaceId("top") + '" class="cke_top cke_reset_all" role="presentation" style="height:auto">' + k + "</span>" : "",
                        contentId: a.ui.spaceId("contents"),
                        bottomHtml: q ? '<span id="' + a.ui.spaceId("bottom") + '" class="cke_bottom cke_reset_all" role="presentation">' + q + "</span>" : "",
                        outerEl: CKEDITOR.env.ie ? "span" : "div"
                    }));
                l == CKEDITOR.ELEMENT_MODE_REPLACE ? (d.hide(), b.insertAfter(d)) : d.append(b);
                a.container = b;
                a.ui.contentsElement = a.ui.space("contents");
                k && a.ui.space("top").unselectable();
                q && a.ui.space("bottom").unselectable();
                d = a.config.width;
                l = a.config.height;
                d && b.setStyle("width", CKEDITOR.tools.cssLength(d));
                l && a.ui.space("contents").setStyle("height", CKEDITOR.tools.cssLength(l));
                b.disableContextMenu();
                CKEDITOR.env.webkit && b.on("focus", function() {
                    a.focus()
                });
                a.fireOnce("uiReady")
            }
            CKEDITOR.replace = function(b, d) {
                return a(b, d, null, CKEDITOR.ELEMENT_MODE_REPLACE)
            };
            CKEDITOR.appendTo = function(b, d, g) {
                return a(b, d, g, CKEDITOR.ELEMENT_MODE_APPENDTO)
            };
            CKEDITOR.replaceAll = function() {
                for (var a = document.getElementsByTagName("textarea"), b = 0; b < a.length; b++) {
                    var d = null,
                        l = a[b];
                    if (l.name || l.id) {
                        if ("string" == typeof arguments[0]) {
                            if (!new RegExp("(?:^|\\s)" + arguments[0] + "(?:$|\\s)").test(l.className)) continue
                        } else if ("function" == typeof arguments[0] && (d = {}, !1 === arguments[0](l, d))) continue;
                        this.replace(l, d)
                    }
                }
            };
            CKEDITOR.editor.prototype.addMode = function(a, b) {
                (this._.modes || (this._.modes = {}))[a] = b
            };
            CKEDITOR.editor.prototype.setMode = function(a, b) {
                var d = this,
                    l = this._.modes;
                if (a != d.mode && l && l[a]) {
                    d.fire("beforeSetMode", a);
                    if (d.mode) {
                        var k = d.checkDirty(),
                            l = d._.previousModeData,
                            q, w = 0;
                        d.fire("beforeModeUnload");
                        d.editable(0);
                        d._.previousMode = d.mode;
                        d._.previousModeData = q = d.getData(1);
                        "source" == d.mode && l == q && (d.fire("lockSnapshot", {
                            forceUpdate: !0
                        }), w = 1);
                        d.ui.space("contents").setHtml("");
                        d.mode = ""
                    } else d._.previousModeData = d.getData(1);
                    this._.modes[a](function() {
                        d.mode = a;
                        void 0 !== k && !k && d.resetDirty();
                        w ? d.fire("unlockSnapshot") : "wysiwyg" == a && d.fire("saveSnapshot");
                        setTimeout(function() {
                            d.fire("mode");
                            b && b.call(d)
                        }, 0)
                    })
                }
            };
            CKEDITOR.editor.prototype.resize = function(a, b, d, l) {
                var k = this.container,
                    q = this.ui.space("contents"),
                    w = CKEDITOR.env.webkit && this.document && this.document.getWindow().$.frameElement;
                l = l ? this.container.getFirst(function(a) {
                    return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
                }) : k;
                l.setSize("width", a, !0);
                w && (w.style.width = "1%");
                var f = (l.$.offsetHeight || 0) - (q.$.clientHeight || 0),
                    k = Math.max(b - (d ? 0 : f), 0);
                b = d ? b + f : b;
                q.setStyle("height", k + "px");
                w && (w.style.width = "100%");
                this.fire("resize", {
                    outerHeight: b,
                    contentsHeight: k,
                    outerWidth: a || l.getSize("width")
                })
            };
            CKEDITOR.editor.prototype.getResizable = function(a) {
                return a ? this.ui.space("contents") : this.container
            };
            CKEDITOR.domReady(function() {
                CKEDITOR.replaceClass && CKEDITOR.replaceAll(CKEDITOR.replaceClass)
            })
        })();
        CKEDITOR.config.startupMode = "wysiwyg";
        (function() {
            function a(a) {
                var b = a.editor,
                    e = a.data.path,
                    m = e.blockLimit,
                    f = a.data.selection,
                    g = f.getRanges()[0],
                    E;
                if (CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller)
                    if (f = d(f, e)) f.appendBogus(), E = CKEDITOR.env.ie;
                l(b, e.block, m) && g.collapsed && !g.getCommonAncestor().isReadOnly() && (e = g.clone(), e.enlarge(CKEDITOR.ENLARGE_BLOCK_CONTENTS), m = new CKEDITOR.dom.walker(e), m.guard = function(a) {
                    return !c(a) || a.type == CKEDITOR.NODE_COMMENT || a.isReadOnly()
                }, !m.checkForward() || e.checkStartOfBlock() && e.checkEndOfBlock()) && (b = g.fixBlock(!0, b.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p"), CKEDITOR.env.needsBrFiller || (b = b.getFirst(c)) && b.type == CKEDITOR.NODE_TEXT && CKEDITOR.tools.trim(b.getText()).match(/^(?:&nbsp;|\xa0)$/) && b.remove(), E = 1, a.cancel());
                E && g.select()
            }

            function d(a, b) {
                if (a.isFake) return 0;
                var d = b.block || b.blockLimit,
                    e = d && d.getLast(c);
                if (!(!d || !d.isBlockBoundary() || e && e.type == CKEDITOR.NODE_ELEMENT && e.isBlockBoundary() || d.is("pre") || d.getBogus())) return d
            }

            function b(a) {
                var b = a.data.getTarget();
                b.is("input") && (b = b.getAttribute("type"), "submit" != b && "reset" != b || a.data.preventDefault())
            }

            function c(a) {
                return f(a) && y(a)
            }

            function e(a, b) {
                return function(c) {
                    var d = c.data.$.toElement || c.data.$.fromElement || c.data.$.relatedTarget;
                    (d = d && d.nodeType == CKEDITOR.NODE_ELEMENT ? new CKEDITOR.dom.element(d) : null) && (b.equals(d) || b.contains(d)) || a.call(this, c)
                }
            }

            function g(a) {
                function b(a) {
                    return function(b, h) {
                        h && b.type == CKEDITOR.NODE_ELEMENT && b.is(f) && (d = b);
                        if (!(h || !c(b) || a && t(b))) return !1
                    }
                }
                var d, e = a.getRanges()[0];
                a = a.root;
                var f = {
                    table: 1,
                    ul: 1,
                    ol: 1,
                    dl: 1
                };
                if (e.startPath().contains(f)) {
                    var g = e.clone();
                    g.collapse(1);
                    g.setStartAt(a, CKEDITOR.POSITION_AFTER_START);
                    a = new CKEDITOR.dom.walker(g);
                    a.guard = b();
                    a.checkBackward();
                    if (d) return g = e.clone(), g.collapse(), g.setEndAt(d, CKEDITOR.POSITION_AFTER_END), a = new CKEDITOR.dom.walker(g), a.guard = b(!0), d = !1, a.checkForward(), d
                }
                return null
            }

            function l(a, b, c) {
                return !1 !== a.config.autoParagraph && a.activeEnterMode != CKEDITOR.ENTER_BR && (a.editable().equals(c) && !b || b && "true" == b.getAttribute("contenteditable"))
            }

            function k(a) {
                return a.activeEnterMode != CKEDITOR.ENTER_BR && !1 !== a.config.autoParagraph ? a.activeEnterMode == CKEDITOR.ENTER_DIV ? "div" : "p" : !1
            }

            function q(a) {
                var b = a.editor;
                b.getSelection().scrollIntoView();
                setTimeout(function() {
                    b.fire("saveSnapshot")
                }, 0)
            }

            function w(a, b, c) {
                var d = a.getCommonAncestor(b);
                for (b = a = c ? b : a;
                    (a = a.getParent()) && !d.equals(a) && 1 == a.getChildCount();) b = a;
                b.remove()
            }
            var f, y, A, t, D, p, x, G, u;
            CKEDITOR.editable = CKEDITOR.tools.createClass({
                base: CKEDITOR.dom.element,
                $: function(a, b) {
                    this.base(b.$ || b);
                    this.editor = a;
                    this.status = "unloaded";
                    this.hasFocus = !1;
                    this.setup()
                },
                proto: {
                    focus: function() {
                        var a;
                        if (CKEDITOR.env.webkit && !this.hasFocus && (a = this.editor._.previousActive || this.getDocument().getActive(), this.contains(a))) {
                            a.focus();
                            return
                        }
                        try {
                            this.$[CKEDITOR.env.ie && this.getDocument().equals(CKEDITOR.document) ? "setActive" : "focus"]()
                        } catch (b) {
                            if (!CKEDITOR.env.ie) throw b
                        }
                        CKEDITOR.env.safari && !this.isInline() && (a = CKEDITOR.document.getActive(), a.equals(this.getWindow().getFrame()) || this.getWindow().focus())
                    },
                    on: function(a, b) {
                        var c = Array.prototype.slice.call(arguments, 0);
                        CKEDITOR.env.ie && /^focus|blur$/.exec(a) && (a = "focus" == a ? "focusin" : "focusout", b = e(b, this), c[0] = a, c[1] = b);
                        return CKEDITOR.dom.element.prototype.on.apply(this, c)
                    },
                    attachListener: function(a) {
                        !this._.listeners && (this._.listeners = []);
                        var b = Array.prototype.slice.call(arguments, 1),
                            b = a.on.apply(a, b);
                        this._.listeners.push(b);
                        return b
                    },
                    clearListeners: function() {
                        var a = this._.listeners;
                        try {
                            for (; a.length;) a.pop().removeListener()
                        } catch (b) {}
                    },
                    restoreAttrs: function() {
                        var a = this._.attrChanges,
                            b, c;
                        for (c in a) a.hasOwnProperty(c) && (b = a[c], null !== b ? this.setAttribute(c, b) : this.removeAttribute(c))
                    },
                    attachClass: function(a) {
                        var b = this.getCustomData("classes");
                        this.hasClass(a) || (!b && (b = []), b.push(a), this.setCustomData("classes", b), this.addClass(a))
                    },
                    changeAttr: function(a, b) {
                        var c = this.getAttribute(a);
                        b !== c && (!this._.attrChanges && (this._.attrChanges = {}), a in this._.attrChanges || (this._.attrChanges[a] = c), this.setAttribute(a, b))
                    },
                    insertText: function(a) {
                        this.editor.focus();
                        this.insertHtml(this.transformPlainTextToHtml(a), "text")
                    },
                    transformPlainTextToHtml: function(a) {
                        var b = this.editor.getSelection().getStartElement().hasAscendant("pre", !0) ? CKEDITOR.ENTER_BR : this.editor.activeEnterMode;
                        return CKEDITOR.tools.transformPlainTextToHtml(a, b)
                    },
                    insertHtml: function(a, b, c) {
                        var d = this.editor;
                        d.focus();
                        d.fire("saveSnapshot");
                        c || (c = d.getSelection().getRanges()[0]);
                        p(this, b || "html", a, c);
                        c.select();
                        q(this);
                        this.editor.fire("afterInsertHtml", {})
                    },
                    insertHtmlIntoRange: function(a, b, c) {
                        p(this, c || "html", a, b);
                        this.editor.fire("afterInsertHtml", {
                            intoRange: b
                        })
                    },
                    insertElement: function(a, b) {
                        var d = this.editor;
                        d.focus();
                        d.fire("saveSnapshot");
                        var e = d.activeEnterMode,
                            d = d.getSelection(),
                            f = a.getName(),
                            f = CKEDITOR.dtd.$block[f];
                        b || (b = d.getRanges()[0]);
                        this.insertElementIntoRange(a, b) && (b.moveToPosition(a, CKEDITOR.POSITION_AFTER_END), f && ((f = a.getNext(function(a) {
                            return c(a) && !t(a)
                        })) && f.type == CKEDITOR.NODE_ELEMENT && f.is(CKEDITOR.dtd.$block) ? f.getDtd()["#"] ? b.moveToElementEditStart(f) : b.moveToElementEditEnd(a) : f || e == CKEDITOR.ENTER_BR || (f = b.fixBlock(!0, e == CKEDITOR.ENTER_DIV ? "div" : "p"), b.moveToElementEditStart(f))));
                        d.selectRanges([b]);
                        q(this)
                    },
                    insertElementIntoSelection: function(a) {
                        this.insertElement(a)
                    },
                    insertElementIntoRange: function(a, b) {
                        var c = this.editor,
                            d = c.config.enterMode,
                            e = a.getName(),
                            f = CKEDITOR.dtd.$block[e];
                        if (b.checkReadOnly()) return !1;
                        b.deleteContents(1);
                        b.startContainer.type == CKEDITOR.NODE_ELEMENT && b.startContainer.is({
                            tr: 1,
                            table: 1,
                            tbody: 1,
                            thead: 1,
                            tfoot: 1
                        }) && x(b);
                        var g, l;
                        if (f)
                            for (;
                                (g = b.getCommonAncestor(0, 1)) && (l = CKEDITOR.dtd[g.getName()]) && (!l || !l[e]);) g.getName() in CKEDITOR.dtd.span ? b.splitElement(g) : b.checkStartOfBlock() && b.checkEndOfBlock() ? (b.setStartBefore(g), b.collapse(!0), g.remove()) : b.splitBlock(d == CKEDITOR.ENTER_DIV ? "div" : "p", c.editable());
                        b.insertNode(a);
                        return !0
                    },
                    setData: function(a, b) {
                        b || (a = this.editor.dataProcessor.toHtml(a));
                        this.setHtml(a);
                        this.fixInitialSelection();
                        "unloaded" == this.status && (this.status = "ready");
                        this.editor.fire("dataReady")
                    },
                    getData: function(a) {
                        var b = this.getHtml();
                        a || (b = this.editor.dataProcessor.toDataFormat(b));
                        return b
                    },
                    setReadOnly: function(a) {
                        this.setAttribute("contenteditable", !a)
                    },
                    detach: function() {
                        this.removeClass("cke_editable");
                        this.status = "detached";
                        var a = this.editor;
                        this._.detach();
                        delete a.document;
                        delete a.window
                    },
                    isInline: function() {
                        return this.getDocument().equals(CKEDITOR.document)
                    },
                    fixInitialSelection: function() {
                        function a() {
                            var b = c.getDocument().$,
                                d = b.getSelection(),
                                h;
                            a: if (d.anchorNode && d.anchorNode == c.$) h = !0;
                                else {
                                    if (CKEDITOR.env.webkit && (h = c.getDocument().getActive()) && h.equals(c) && !d.anchorNode) {
                                        h = !0;
                                        break a
                                    }
                                    h = void 0
                                }
                            h && (h = new CKEDITOR.dom.range(c), h.moveToElementEditStart(c), b = b.createRange(), b.setStart(h.startContainer.$, h.startOffset), b.collapse(!0), d.removeAllRanges(), d.addRange(b))
                        }

                        function b() {
                            var a = c.getDocument().$,
                                d = a.selection,
                                h = c.getDocument().getActive();
                            "None" == d.type && h.equals(c) && (d = new CKEDITOR.dom.range(c), a = a.body.createTextRange(), d.moveToElementEditStart(c), d = d.startContainer, d.type != CKEDITOR.NODE_ELEMENT && (d = d.getParent()), a.moveToElementText(d.$), a.collapse(!0), a.select())
                        }
                        var c = this;
                        if (CKEDITOR.env.ie && (9 > CKEDITOR.env.version || CKEDITOR.env.quirks)) this.hasFocus && (this.focus(), b());
                        else if (this.hasFocus) this.focus(), a();
                        else this.once("focus", function() {
                            a()
                        }, null, null, -999)
                    },
                    getHtmlFromRange: function(a) {
                        if (a.collapsed) return new CKEDITOR.dom.documentFragment(a.document);
                        a = {
                            doc: this.getDocument(),
                            range: a.clone()
                        };
                        G.eol.detect(a, this);
                        G.bogus.exclude(a);
                        G.cell.shrink(a);
                        a.fragment = a.range.cloneContents();
                        G.tree.rebuild(a, this);
                        G.eol.fix(a, this);
                        return new CKEDITOR.dom.documentFragment(a.fragment.$)
                    },
                    extractHtmlFromRange: function(a, b) {
                        var c = u,
                            d = {
                                range: a,
                                doc: a.document
                            },
                            e = this.getHtmlFromRange(a);
                        if (a.collapsed) return a.optimize(), e;
                        a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
                        c.table.detectPurge(d);
                        d.bookmark = a.createBookmark();
                        delete d.range;
                        var f = this.editor.createRange();
                        f.moveToPosition(d.bookmark.startNode, CKEDITOR.POSITION_BEFORE_START);
                        d.targetBookmark = f.createBookmark();
                        c.list.detectMerge(d, this);
                        c.table.detectRanges(d, this);
                        c.block.detectMerge(d, this);
                        d.tableContentsRanges ? (c.table.deleteRanges(d), a.moveToBookmark(d.bookmark), d.range = a) : (a.moveToBookmark(d.bookmark), d.range = a, a.extractContents(c.detectExtractMerge(d)));
                        a.moveToBookmark(d.targetBookmark);
                        a.optimize();
                        c.fixUneditableRangePosition(a);
                        c.list.merge(d, this);
                        c.table.purge(d, this);
                        c.block.merge(d, this);
                        if (b) {
                            c = a.startPath();
                            if (d = a.checkStartOfBlock() && a.checkEndOfBlock() && c.block && !a.root.equals(c.block)) {
                                a: {
                                    var d = c.block.getElementsByTag("span"),
                                        f = 0,
                                        g;
                                    if (d)
                                        for (; g = d.getItem(f++);)
                                            if (!y(g)) {
                                                d = !0;
                                                break a
                                            }
                                    d = !1
                                }
                                d = !d
                            }
                            d && (a.moveToPosition(c.block, CKEDITOR.POSITION_BEFORE_START), c.block.remove())
                        } else c.autoParagraph(this.editor, a), A(a.startContainer) && a.startContainer.appendBogus();
                        a.startContainer.mergeSiblings();
                        return e
                    },
                    setup: function() {
                        var a = this.editor;
                        this.attachListener(a, "beforeGetData", function() {
                            var b = this.getData();
                            this.is("textarea") || !1 !== a.config.ignoreEmptyParagraph && (b = b.replace(D, function(a, b) {
                                return b
                            }));
                            a.setData(b, null, 1)
                        }, this);
                        this.attachListener(a, "getSnapshot", function(a) {
                            a.data = this.getData(1)
                        }, this);
                        this.attachListener(a, "afterSetData", function() {
                            this.setData(a.getData(1))
                        }, this);
                        this.attachListener(a, "loadSnapshot", function(a) {
                            this.setData(a.data, 1)
                        }, this);
                        this.attachListener(a, "beforeFocus", function() {
                            var b = a.getSelection();
                            (b = b && b.getNative()) && "Control" == b.type || this.focus()
                        }, this);
                        this.attachListener(a, "insertHtml", function(a) {
                            this.insertHtml(a.data.dataValue, a.data.mode, a.data.range)
                        }, this);
                        this.attachListener(a, "insertElement", function(a) {
                            this.insertElement(a.data)
                        }, this);
                        this.attachListener(a, "insertText", function(a) {
                            this.insertText(a.data)
                        }, this);
                        this.setReadOnly(a.readOnly);
                        this.attachClass("cke_editable");
                        a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? this.attachClass("cke_editable_inline") : a.elementMode != CKEDITOR.ELEMENT_MODE_REPLACE && a.elementMode != CKEDITOR.ELEMENT_MODE_APPENDTO || this.attachClass("cke_editable_themed");
                        this.attachClass("cke_contents_" + a.config.contentsLangDirection);
                        a.keystrokeHandler.blockedKeystrokes[8] = +a.readOnly;
                        a.keystrokeHandler.attach(this);
                        this.on("blur", function() {
                            this.hasFocus = !1
                        }, null, null, -1);
                        this.on("focus", function() {
                            this.hasFocus = !0
                        }, null, null, -1);
                        a.focusManager.add(this);
                        this.equals(CKEDITOR.document.getActive()) && (this.hasFocus = !0, a.once("contentDom", function() {
                            a.focusManager.focus(this)
                        }, this));
                        this.isInline() && this.changeAttr("tabindex", a.tabIndex);
                        if (!this.is("textarea")) {
                            a.document = this.getDocument();
                            a.window = this.getWindow();
                            var d = a.document;
                            this.changeAttr("spellcheck", !a.config.disableNativeSpellChecker);
                            var e = a.config.contentsLangDirection;
                            this.getDirection(1) != e && this.changeAttr("dir", e);
                            var m = CKEDITOR.getCss();
                            if (m) {
                                var e = d.getHead(),
                                    l = e.getCustomData("stylesheet");
                                l ? m != l.getText() && (CKEDITOR.env.ie && 9 > CKEDITOR.env.version ? l.$.styleSheet.cssText = m : l.setText(m)) : (m = d.appendStyleText(m), m = new CKEDITOR.dom.element(m.ownerNode || m.owningElement), e.setCustomData("stylesheet", m), m.data("cke-temp", 1))
                            }
                            e = d.getCustomData("stylesheet_ref") || 0;
                            d.setCustomData("stylesheet_ref", e + 1);
                            this.setCustomData("cke_includeReadonly", !a.config.disableReadonlyStyling);
                            this.attachListener(this, "click", function(a) {
                                a = a.data;
                                var b = new CKEDITOR.dom.elementPath(a.getTarget(), this).contains("a");
                                b && 2 != a.$.button && b.isReadOnly() && a.preventDefault()
                            });
                            var k = {
                                8: 1,
                                46: 1
                            };
                            this.attachListener(a, "key", function(b) {
                                if (a.readOnly) return !0;
                                var c = b.data.domEvent.getKey(),
                                    d;
                                if (c in k) {
                                    b = a.getSelection();
                                    var h, e = b.getRanges()[0],
                                        m = e.startPath(),
                                        n, l, z, c = 8 == c;
                                    CKEDITOR.env.ie && 11 > CKEDITOR.env.version && (h = b.getSelectedElement()) || (h = g(b)) ? (a.fire("saveSnapshot"), e.moveToPosition(h, CKEDITOR.POSITION_BEFORE_START), h.remove(), e.select(), a.fire("saveSnapshot"), d = 1) : e.collapsed && ((n = m.block) && (z = n[c ? "getPrevious" : "getNext"](f)) && z.type == CKEDITOR.NODE_ELEMENT && z.is("table") && e[c ? "checkStartOfBlock" : "checkEndOfBlock"]() ? (a.fire("saveSnapshot"), e[c ? "checkEndOfBlock" : "checkStartOfBlock"]() && n.remove(), e["moveToElementEdit" + (c ? "End" : "Start")](z), e.select(), a.fire("saveSnapshot"), d = 1) : m.blockLimit && m.blockLimit.is("td") && (l = m.blockLimit.getAscendant("table")) && e.checkBoundaryOfElement(l, c ? CKEDITOR.START : CKEDITOR.END) && (z = l[c ? "getPrevious" : "getNext"](f)) ? (a.fire("saveSnapshot"), e["moveToElementEdit" + (c ? "End" : "Start")](z), e.checkStartOfBlock() && e.checkEndOfBlock() ? z.remove() : e.select(), a.fire("saveSnapshot"), d = 1) : (l = m.contains(["td", "th", "caption"])) && e.checkBoundaryOfElement(l, c ? CKEDITOR.START : CKEDITOR.END) && (d = 1))
                                }
                                return !d
                            });
                            a.blockless && CKEDITOR.env.ie && CKEDITOR.env.needsBrFiller && this.attachListener(this, "keyup", function(b) {
                                b.data.getKeystroke() in k && !this.getFirst(c) && (this.appendBogus(), b = a.createRange(), b.moveToPosition(this, CKEDITOR.POSITION_AFTER_START), b.select())
                            });
                            this.attachListener(this, "dblclick", function(b) {
                                if (a.readOnly) return !1;
                                b = {
                                    element: b.data.getTarget()
                                };
                                a.fire("doubleclick", b)
                            });
                            CKEDITOR.env.ie && this.attachListener(this, "click", b);
                            CKEDITOR.env.ie && !CKEDITOR.env.edge || this.attachListener(this, "mousedown", function(b) {
                                var c = b.data.getTarget();
                                c.is("img", "hr", "input", "textarea", "select") && !c.isReadOnly() && (a.getSelection().selectElement(c), c.is("input", "textarea", "select") && b.data.preventDefault())
                            });
                            CKEDITOR.env.edge && this.attachListener(this, "mouseup", function(b) {
                                (b = b.data.getTarget()) && b.is("img") && a.getSelection().selectElement(b)
                            });
                            CKEDITOR.env.gecko && this.attachListener(this, "mouseup", function(b) {
                                if (2 == b.data.$.button && (b = b.data.getTarget(), !b.getOuterHtml().replace(D, ""))) {
                                    var c = a.createRange();
                                    c.moveToElementEditStart(b);
                                    c.select(!0)
                                }
                            });
                            CKEDITOR.env.webkit && (this.attachListener(this, "click", function(a) {
                                a.data.getTarget().is("input", "select") && a.data.preventDefault()
                            }), this.attachListener(this, "mouseup", function(a) {
                                a.data.getTarget().is("input", "textarea") && a.data.preventDefault()
                            }));
                            CKEDITOR.env.webkit && this.attachListener(a, "key", function(b) {
                                if (a.readOnly) return !0;
                                b = b.data.domEvent.getKey();
                                if (b in k) {
                                    var c = 8 == b,
                                        d = a.getSelection().getRanges()[0];
                                    b = d.startPath();
                                    if (d.collapsed) a: {
                                        var h = b.block;
                                        if (h && d[c ? "checkStartOfBlock" : "checkEndOfBlock"]() && d.moveToClosestEditablePosition(h, !c) && d.collapsed) {
                                            if (d.startContainer.type == CKEDITOR.NODE_ELEMENT) {
                                                var e = d.startContainer.getChild(d.startOffset - (c ? 1 : 0));
                                                if (e && e.type == CKEDITOR.NODE_ELEMENT && e.is("hr")) {
                                                    a.fire("saveSnapshot");
                                                    e.remove();
                                                    b = !0;
                                                    break a
                                                }
                                            }
                                            d = d.startPath().block;
                                            if (!d || d && d.contains(h)) b = void 0;
                                            else {
                                                a.fire("saveSnapshot");
                                                var f;
                                                (f = (c ? d : h).getBogus()) && f.remove();
                                                f = a.getSelection();
                                                e = f.createBookmarks();
                                                (c ? h : d).moveChildren(c ? d : h, !1);
                                                b.lastElement.mergeSiblings();
                                                w(h, d, !c);
                                                f.selectBookmarks(e);
                                                b = !0
                                            }
                                        } else b = !1
                                    }
                                    else c = d, f = b.block, d = c.endPath().block, f && d && !f.equals(d) ? (a.fire("saveSnapshot"), (h = f.getBogus()) && h.remove(), c.enlarge(CKEDITOR.ENLARGE_INLINE), c.deleteContents(), d.getParent() && (d.moveChildren(f, !1), b.lastElement.mergeSiblings(), w(f, d, !0)), c = a.getSelection().getRanges()[0], c.collapse(1), c.optimize(), "" === c.startContainer.getHtml() && c.startContainer.appendBogus(), c.select(), b = !0) : b = !1;
                                    if (!b) return;
                                    a.getSelection().scrollIntoView();
                                    a.fire("saveSnapshot");
                                    return !1
                                }
                            }, this, null, 100)
                        }
                    }
                },
                _: {
                    detach: function() {
                        this.editor.setData(this.editor.getData(), 0, 1);
                        this.clearListeners();
                        this.restoreAttrs();
                        var a;
                        if (a = this.removeCustomData("classes"))
                            for (; a.length;) this.removeClass(a.pop());
                        if (!this.is("textarea")) {
                            a = this.getDocument();
                            var b = a.getHead();
                            if (b.getCustomData("stylesheet")) {
                                var c = a.getCustomData("stylesheet_ref");
                                --c ? a.setCustomData("stylesheet_ref", c) : (a.removeCustomData("stylesheet_ref"), b.removeCustomData("stylesheet").remove())
                            }
                        }
                        this.editor.fire("contentDomUnload");
                        delete this.editor
                    }
                }
            });
            CKEDITOR.editor.prototype.editable = function(a) {
                var b = this._.editable;
                if (b && a) return 0;
                arguments.length && (b = this._.editable = a ? a instanceof CKEDITOR.editable ? a : new CKEDITOR.editable(this, a) : (b && b.detach(), null));
                return b
            };
            CKEDITOR.on("instanceLoaded", function(b) {
                var c = b.editor;
                c.on("insertElement", function(a) {
                    a = a.data;
                    a.type == CKEDITOR.NODE_ELEMENT && (a.is("input") || a.is("textarea")) && ("false" != a.getAttribute("contentEditable") && a.data("cke-editable", a.hasAttribute("contenteditable") ? "true" : "1"), a.setAttribute("contentEditable", !1))
                });
                c.on("selectionChange", function(b) {
                    if (!c.readOnly) {
                        var d = c.getSelection();
                        d && !d.isLocked && (d = c.checkDirty(), c.fire("lockSnapshot"), a(b), c.fire("unlockSnapshot"), !d && c.resetDirty())
                    }
                })
            });
            CKEDITOR.on("instanceCreated", function(a) {
                var b = a.editor;
                b.on("mode", function() {
                    var a = b.editable();
                    if (a && a.isInline()) {
                        var c = b.title;
                        a.changeAttr("role", "textbox");
                        a.changeAttr("aria-label", c);
                        c && a.changeAttr("title", c);
                        var d = b.fire("ariaEditorHelpLabel", {}).label;
                        if (d && (c = this.ui.space(this.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? "top" : "contents"))) {
                            var e = CKEDITOR.tools.getNextId(),
                                d = CKEDITOR.dom.element.createFromHtml('<span id="' + e + '" class="cke_voice_label">' + d + "</span>");
                            c.append(d);
                            a.changeAttr("aria-describedby", e)
                        }
                    }
                })
            });
            CKEDITOR.addCss(".cke_editable{cursor:text}.cke_editable img,.cke_editable input,.cke_editable textarea{cursor:default}");
            f = CKEDITOR.dom.walker.whitespaces(!0);
            y = CKEDITOR.dom.walker.bookmark(!1, !0);
            A = CKEDITOR.dom.walker.empty();
            t = CKEDITOR.dom.walker.bogus();
            D = /(^|<body\b[^>]*>)\s*<(p|div|address|h\d|center|pre)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\2>)?\s*(?=$|<\/body>)/gi;
            p = function() {
                function a(b) {
                    return b.type == CKEDITOR.NODE_ELEMENT
                }

                function b(c, d) {
                    var e, f, m, n, g = [],
                        l = d.range.startContainer;
                    e = d.range.startPath();
                    for (var l = C[l.getName()], z = 0, k = c.getChildren(), E = k.count(), B = -1, p = -1, q = 0, w = e.contains(C.$list); z < E; ++z) e = k.getItem(z), a(e) ? (m = e.getName(), w && m in CKEDITOR.dtd.$list ? g = g.concat(b(e, d)) : (n = !!l[m], "br" != m || !e.data("cke-eol") || z && z != E - 1 || (q = (f = z ? g[z - 1].node : k.getItem(z + 1)) && (!a(f) || !f.is("br")), f = f && a(f) && C.$block[f.getName()]), -1 != B || n || (B = z), n || (p = z), g.push({
                        isElement: 1,
                        isLineBreak: q,
                        isBlock: e.isBlockBoundary(),
                        hasBlockSibling: f,
                        node: e,
                        name: m,
                        allowed: n
                    }), f = q = 0)) : g.push({
                        isElement: 0,
                        node: e,
                        allowed: 1
                    }); - 1 < B && (g[B].firstNotAllowed = 1); - 1 < p && (g[p].lastNotAllowed = 1);
                    return g
                }

                function d(b, c) {
                    var e = [],
                        h = b.getChildren(),
                        f = h.count(),
                        m, g = 0,
                        l = C[c],
                        z = !b.is(C.$inline) || b.is("br");
                    for (z && e.push(" "); g < f; g++) m = h.getItem(g), a(m) && !m.is(l) ? e = e.concat(d(m, c)) : e.push(m);
                    z && e.push(" ");
                    return e
                }

                function e(b) {
                    return a(b.startContainer) && b.startContainer.getChild(b.startOffset - 1)
                }

                function f(b) {
                    return b && a(b) && (b.is(C.$removeEmpty) || b.is("a") && !b.isBlockBoundary())
                }

                function g(b, c, d, e) {
                    var h = b.clone(),
                        f, m;
                    h.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
                    (f = new CKEDITOR.dom.walker(h).next()) && a(f) && p[f.getName()] && (m = f.getPrevious()) && a(m) && !m.getParent().equals(b.startContainer) && d.contains(m) && e.contains(f) && f.isIdentical(m) && (f.moveChildren(m), f.remove(), g(b, c, d, e))
                }

                function E(b, c) {
                    function d(b, c) {
                        if (c.isBlock && c.isElement && !c.node.is("br") && a(b) && b.is("br")) return b.remove(), 1
                    }
                    var e = c.endContainer.getChild(c.endOffset),
                        h = c.endContainer.getChild(c.endOffset - 1);
                    e && d(e, b[b.length - 1]);
                    h && d(h, b[0]) && (c.setEnd(c.endContainer, c.endOffset - 1), c.collapse())
                }
                var C = CKEDITOR.dtd,
                    p = {
                        p: 1,
                        div: 1,
                        h1: 1,
                        h2: 1,
                        h3: 1,
                        h4: 1,
                        h5: 1,
                        h6: 1,
                        ul: 1,
                        ol: 1,
                        li: 1,
                        pre: 1,
                        dl: 1,
                        blockquote: 1
                    },
                    q = {
                        p: 1,
                        div: 1,
                        h1: 1,
                        h2: 1,
                        h3: 1,
                        h4: 1,
                        h5: 1,
                        h6: 1
                    },
                    w = CKEDITOR.tools.extend({}, C.$inline);
                delete w.br;
                return function(p, v, I, J) {
                    var F = p.editor,
                        L = !1;
                    "unfiltered_html" == v && (v = "html", L = !0);
                    if (!J.checkReadOnly()) {
                        var K = new CKEDITOR.dom.elementPath(J.startContainer, J.root).blockLimit || J.root;
                        p = {
                            type: v,
                            dontFilter: L,
                            editable: p,
                            editor: F,
                            range: J,
                            blockLimit: K,
                            mergeCandidates: [],
                            zombies: []
                        };
                        v = p.range;
                        J = p.mergeCandidates;
                        var H, t;
                        "text" == p.type && v.shrink(CKEDITOR.SHRINK_ELEMENT, !0, !1) && (H = CKEDITOR.dom.element.createFromHtml("<span>&nbsp;</span>", v.document), v.insertNode(H), v.setStartAfter(H));
                        L = new CKEDITOR.dom.elementPath(v.startContainer);
                        p.endPath = K = new CKEDITOR.dom.elementPath(v.endContainer);
                        if (!v.collapsed) {
                            var F = K.block || K.blockLimit,
                                x = v.getCommonAncestor();
                            F && !F.equals(x) && !F.contains(x) && v.checkEndOfBlock() && p.zombies.push(F);
                            v.deleteContents()
                        }
                        for (;
                            (t = e(v)) && a(t) && t.isBlockBoundary() && L.contains(t);) v.moveToPosition(t, CKEDITOR.POSITION_BEFORE_END);
                        g(v, p.blockLimit, L, K);
                        H && (v.setEndBefore(H), v.collapse(), H.remove());
                        H = v.startPath();
                        if (F = H.contains(f, !1, 1)) v.splitElement(F), p.inlineStylesRoot = F, p.inlineStylesPeak = H.lastElement;
                        H = v.createBookmark();
                        (F = H.startNode.getPrevious(c)) && a(F) && f(F) && J.push(F);
                        (F = H.startNode.getNext(c)) && a(F) && f(F) && J.push(F);
                        for (F = H.startNode;
                            (F = F.getParent()) && f(F);) J.push(F);
                        v.moveToBookmark(H);
                        if (H = I) {
                            H = p.range;
                            if ("text" == p.type && p.inlineStylesRoot) {
                                t = p.inlineStylesPeak;
                                v = t.getDocument().createText("{cke-peak}");
                                for (J = p.inlineStylesRoot.getParent(); !t.equals(J);) v = v.appendTo(t.clone()), t = t.getParent();
                                I = v.getOuterHtml().split("{cke-peak}").join(I)
                            }
                            t = p.blockLimit.getName();
                            if (/^\s+|\s+$/.test(I) && "span" in CKEDITOR.dtd[t]) {
                                var A = '<span data-cke-marker="1">&nbsp;</span>';
                                I = A + I + A
                            }
                            I = p.editor.dataProcessor.toHtml(I, {
                                context: null,
                                fixForBody: !1,
                                protectedWhitespaces: !!A,
                                dontFilter: p.dontFilter,
                                filter: p.editor.activeFilter,
                                enterMode: p.editor.activeEnterMode
                            });
                            t = H.document.createElement("body");
                            t.setHtml(I);
                            A && (t.getFirst().remove(), t.getLast().remove());
                            if ((A = H.startPath().block) && (1 != A.getChildCount() || !A.getBogus())) a: {
                                var y;
                                if (1 == t.getChildCount() && a(y = t.getFirst()) && y.is(q) && !y.hasAttribute("contenteditable")) {
                                    A = y.getElementsByTag("*");
                                    H = 0;
                                    for (J = A.count(); H < J; H++)
                                        if (v = A.getItem(H), !v.is(w)) break a;
                                    y.moveChildren(y.getParent(1));
                                    y.remove()
                                }
                            }
                            p.dataWrapper = t;
                            H = I
                        }
                        if (H) {
                            y = p.range;
                            H = y.document;
                            var u;
                            t = p.blockLimit;
                            J = 0;
                            var D, A = [],
                                M, G;
                            I = F = 0;
                            var P, W;
                            v = y.startContainer;
                            var L = p.endPath.elements[0],
                                X, K = L.getPosition(v),
                                x = !!L.getCommonAncestor(v) && K != CKEDITOR.POSITION_IDENTICAL && !(K & CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED);
                            v = b(p.dataWrapper, p);
                            for (E(v, y); J < v.length; J++) {
                                K = v[J];
                                if (u = K.isLineBreak) {
                                    u = y;
                                    P = t;
                                    var S = void 0,
                                        aa = void 0;
                                    K.hasBlockSibling ? u = 1 : (S = u.startContainer.getAscendant(C.$block, 1)) && S.is({
                                        div: 1,
                                        p: 1
                                    }) ? (aa = S.getPosition(P), aa == CKEDITOR.POSITION_IDENTICAL || aa == CKEDITOR.POSITION_CONTAINS ? u = 0 : (P = u.splitElement(S), u.moveToPosition(P, CKEDITOR.POSITION_AFTER_START), u = 1)) : u = 0
                                }
                                if (u) I = 0 < J;
                                else {
                                    u = y.startPath();
                                    !K.isBlock && l(p.editor, u.block, u.blockLimit) && (G = k(p.editor)) && (G = H.createElement(G), G.appendBogus(), y.insertNode(G), CKEDITOR.env.needsBrFiller && (D = G.getBogus()) && D.remove(), y.moveToPosition(G, CKEDITOR.POSITION_BEFORE_END));
                                    if ((u = y.startPath().block) && !u.equals(M)) {
                                        if (D = u.getBogus()) D.remove(), A.push(u);
                                        M = u
                                    }
                                    K.firstNotAllowed && (F = 1);
                                    if (F && K.isElement) {
                                        u = y.startContainer;
                                        for (P = null; u && !C[u.getName()][K.name];) {
                                            if (u.equals(t)) {
                                                u = null;
                                                break
                                            }
                                            P = u;
                                            u = u.getParent()
                                        }
                                        if (u) P && (W = y.splitElement(P), p.zombies.push(W), p.zombies.push(P));
                                        else {
                                            P = t.getName();
                                            X = !J;
                                            u = J == v.length - 1;
                                            P = d(K.node, P);
                                            for (var S = [], aa = P.length, ca = 0, ea = void 0, Y = 0, U = -1; ca < aa; ca++) ea = P[ca], " " == ea ? (Y || X && !ca || (S.push(new CKEDITOR.dom.text(" ")), U = S.length), Y = 1) : (S.push(ea), Y = 0);
                                            u && U == S.length && S.pop();
                                            X = S
                                        }
                                    }
                                    if (X) {
                                        for (; u = X.pop();) y.insertNode(u);
                                        X = 0
                                    } else y.insertNode(K.node);
                                    K.lastNotAllowed && J < v.length - 1 && ((W = x ? L : W) && y.setEndAt(W, CKEDITOR.POSITION_AFTER_START), F = 0);
                                    y.collapse()
                                }
                            }
                            1 != v.length ? D = !1 : (D = v[0], D = D.isElement && "false" == D.node.getAttribute("contenteditable"));
                            D && (I = !0, u = v[0].node, y.setStartAt(u, CKEDITOR.POSITION_BEFORE_START), y.setEndAt(u, CKEDITOR.POSITION_AFTER_END));
                            p.dontMoveCaret = I;
                            p.bogusNeededBlocks = A
                        }
                        D = p.range;
                        var O;
                        W = p.bogusNeededBlocks;
                        for (X = D.createBookmark(); M = p.zombies.pop();) M.getParent() && (G = D.clone(), G.moveToElementEditStart(M), G.removeEmptyBlocksAtEnd());
                        if (W)
                            for (; M = W.pop();) CKEDITOR.env.needsBrFiller ? M.appendBogus() : M.append(D.document.createText(" "));
                        for (; M = p.mergeCandidates.pop();) M.mergeSiblings();
                        D.moveToBookmark(X);
                        if (!p.dontMoveCaret) {
                            for (M = e(D); M && a(M) && !M.is(C.$empty);) {
                                if (M.isBlockBoundary()) D.moveToPosition(M, CKEDITOR.POSITION_BEFORE_END);
                                else {
                                    if (f(M) && M.getHtml().match(/(\s|&nbsp;)$/g)) {
                                        O = null;
                                        break
                                    }
                                    O = D.clone();
                                    O.moveToPosition(M, CKEDITOR.POSITION_BEFORE_END)
                                }
                                M = M.getLast(c)
                            }
                            O && D.moveToRange(O)
                        }
                    }
                }
            }();
            x = function() {
                function a(b) {
                    b = new CKEDITOR.dom.walker(b);
                    b.guard = function(a, b) {
                        if (b) return !1;
                        if (a.type == CKEDITOR.NODE_ELEMENT) return a.is(CKEDITOR.dtd.$tableContent)
                    };
                    b.evaluator = function(a) {
                        return a.type == CKEDITOR.NODE_ELEMENT
                    };
                    return b
                }

                function b(a, c, d) {
                    c = a.getDocument().createElement(c);
                    a.append(c, d);
                    return c
                }

                function c(a) {
                    var b = a.count(),
                        d;
                    for (b; 0 < b--;) d = a.getItem(b), CKEDITOR.tools.trim(d.getHtml()) || (d.appendBogus(), CKEDITOR.env.ie && 9 > CKEDITOR.env.version && d.getChildCount() && d.getFirst().remove())
                }
                return function(d) {
                    var e = d.startContainer,
                        f = e.getAscendant("table", 1),
                        g = !1;
                    c(f.getElementsByTag("td"));
                    c(f.getElementsByTag("th"));
                    f = d.clone();
                    f.setStart(e, 0);
                    f = a(f).lastBackward();
                    f || (f = d.clone(), f.setEndAt(e, CKEDITOR.POSITION_BEFORE_END), f = a(f).lastForward(), g = !0);
                    f || (f = e);
                    f.is("table") ? (d.setStartAt(f, CKEDITOR.POSITION_BEFORE_START), d.collapse(!0), f.remove()) : (f.is({
                        tbody: 1,
                        thead: 1,
                        tfoot: 1
                    }) && (f = b(f, "tr", g)), f.is("tr") && (f = b(f, f.getParent().is("thead") ? "th" : "td", g)), (e = f.getBogus()) && e.remove(), d.moveToPosition(f, g ? CKEDITOR.POSITION_AFTER_START : CKEDITOR.POSITION_BEFORE_END))
                }
            }();
            G = {
                eol: {
                    detect: function(a, b) {
                        var c = a.range,
                            d = c.clone(),
                            e = c.clone(),
                            f = new CKEDITOR.dom.elementPath(c.startContainer, b),
                            g = new CKEDITOR.dom.elementPath(c.endContainer, b);
                        d.collapse(1);
                        e.collapse();
                        f.block && d.checkBoundaryOfElement(f.block, CKEDITOR.END) && (c.setStartAfter(f.block), a.prependEolBr = 1);
                        g.block && e.checkBoundaryOfElement(g.block, CKEDITOR.START) && (c.setEndBefore(g.block), a.appendEolBr = 1)
                    },
                    fix: function(a, b) {
                        var c = b.getDocument(),
                            d;
                        a.appendEolBr && (d = this.createEolBr(c), a.fragment.append(d));
                        !a.prependEolBr || d && !d.getPrevious() || a.fragment.append(this.createEolBr(c), 1)
                    },
                    createEolBr: function(a) {
                        return a.createElement("br", {
                            attributes: {
                                "data-cke-eol": 1
                            }
                        })
                    }
                },
                bogus: {
                    exclude: function(a) {
                        var b = a.range.getBoundaryNodes(),
                            c = b.startNode,
                            b = b.endNode;
                        !b || !t(b) || c && c.equals(b) || a.range.setEndBefore(b)
                    }
                },
                tree: {
                    rebuild: function(a, b) {
                        var c = a.range,
                            d = c.getCommonAncestor(),
                            e = new CKEDITOR.dom.elementPath(d, b),
                            f = new CKEDITOR.dom.elementPath(c.startContainer, b),
                            c = new CKEDITOR.dom.elementPath(c.endContainer, b),
                            g;
                        d.type == CKEDITOR.NODE_TEXT && (d = d.getParent());
                        if (e.blockLimit.is({
                                tr: 1,
                                table: 1
                            })) {
                            var l = e.contains("table").getParent();
                            g = function(a) {
                                return !a.equals(l)
                            }
                        } else if (e.block && e.block.is(CKEDITOR.dtd.$listItem) && (f = f.contains(CKEDITOR.dtd.$list), c = c.contains(CKEDITOR.dtd.$list), !f.equals(c))) {
                            var k = e.contains(CKEDITOR.dtd.$list).getParent();
                            g = function(a) {
                                return !a.equals(k)
                            }
                        }
                        g || (g = function(a) {
                            return !a.equals(e.block) && !a.equals(e.blockLimit)
                        });
                        this.rebuildFragment(a, b, d, g)
                    },
                    rebuildFragment: function(a, b, c, d) {
                        for (var e; c && !c.equals(b) && d(c);) e = c.clone(0, 1), a.fragment.appendTo(e), a.fragment = e, c = c.getParent()
                    }
                },
                cell: {
                    shrink: function(a) {
                        a = a.range;
                        var b = a.startContainer,
                            c = a.endContainer,
                            d = a.startOffset,
                            e = a.endOffset;
                        b.type == CKEDITOR.NODE_ELEMENT && b.equals(c) && b.is("tr") && ++d == e && a.shrink(CKEDITOR.SHRINK_TEXT)
                    }
                }
            };
            u = function() {
                function a(b, c) {
                    var d = b.getParent();
                    if (d.is(CKEDITOR.dtd.$inline)) b[c ? "insertBefore" : "insertAfter"](d)
                }

                function b(c, d, e) {
                    a(d);
                    a(e, 1);
                    for (var f; f = e.getNext();) f.insertAfter(d), d = f;
                    A(c) && c.remove()
                }

                function c(a, b) {
                    var d = new CKEDITOR.dom.range(a);
                    d.setStartAfter(b.startNode);
                    d.setEndBefore(b.endNode);
                    return d
                }
                return {
                    list: {
                        detectMerge: function(a, b) {
                            var d = c(b, a.bookmark),
                                e = d.startPath(),
                                f = d.endPath(),
                                h = e.contains(CKEDITOR.dtd.$list),
                                g = f.contains(CKEDITOR.dtd.$list);
                            a.mergeList = h && g && h.getParent().equals(g.getParent()) && !h.equals(g);
                            a.mergeListItems = e.block && f.block && e.block.is(CKEDITOR.dtd.$listItem) && f.block.is(CKEDITOR.dtd.$listItem);
                            if (a.mergeList || a.mergeListItems) d = d.clone(), d.setStartBefore(a.bookmark.startNode), d.setEndAfter(a.bookmark.endNode), a.mergeListBookmark = d.createBookmark()
                        },
                        merge: function(a, c) {
                            if (a.mergeListBookmark) {
                                var d = a.mergeListBookmark.startNode,
                                    e = a.mergeListBookmark.endNode,
                                    f = new CKEDITOR.dom.elementPath(d, c),
                                    g = new CKEDITOR.dom.elementPath(e, c);
                                if (a.mergeList) {
                                    var n = f.contains(CKEDITOR.dtd.$list),
                                        l = g.contains(CKEDITOR.dtd.$list);
                                    n.equals(l) || (l.moveChildren(n), l.remove())
                                }
                                a.mergeListItems && (f = f.contains(CKEDITOR.dtd.$listItem), g = g.contains(CKEDITOR.dtd.$listItem), f.equals(g) || b(g, d, e));
                                d.remove();
                                e.remove()
                            }
                        }
                    },
                    block: {
                        detectMerge: function(a, b) {
                            if (!a.tableContentsRanges && !a.mergeListBookmark) {
                                var c = new CKEDITOR.dom.range(b);
                                c.setStartBefore(a.bookmark.startNode);
                                c.setEndAfter(a.bookmark.endNode);
                                a.mergeBlockBookmark = c.createBookmark()
                            }
                        },
                        merge: function(a, c) {
                            if (a.mergeBlockBookmark && !a.purgeTableBookmark) {
                                var d = a.mergeBlockBookmark.startNode,
                                    e = a.mergeBlockBookmark.endNode,
                                    f = new CKEDITOR.dom.elementPath(d, c),
                                    g = new CKEDITOR.dom.elementPath(e, c),
                                    f = f.block,
                                    g = g.block;
                                f && g && !f.equals(g) && b(g, d, e);
                                d.remove();
                                e.remove()
                            }
                        }
                    },
                    table: function() {
                        function a(c) {
                            var e = [],
                                f, h = new CKEDITOR.dom.walker(c),
                                g = c.startPath().contains(d),
                                m = c.endPath().contains(d),
                                n = {};
                            h.guard = function(a, h) {
                                if (a.type == CKEDITOR.NODE_ELEMENT) {
                                    var l = "visited_" + (h ? "out" : "in");
                                    if (a.getCustomData(l)) return;
                                    CKEDITOR.dom.element.setMarker(n, a, l, 1)
                                }
                                if (h && g && a.equals(g)) f = c.clone(), f.setEndAt(g, CKEDITOR.POSITION_BEFORE_END), e.push(f);
                                else if (!h && m && a.equals(m)) f = c.clone(), f.setStartAt(m, CKEDITOR.POSITION_AFTER_START), e.push(f);
                                else {
                                    if (l = !h) l = a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && (!g || b(a, g)) && (!m || b(a, m));
                                    l && (f = c.clone(), f.selectNodeContents(a), e.push(f))
                                }
                            };
                            h.lastForward();
                            CKEDITOR.dom.element.clearAllMarkers(n);
                            return e
                        }

                        function b(a, c) {
                            var d = CKEDITOR.POSITION_CONTAINS + CKEDITOR.POSITION_IS_CONTAINED,
                                e = a.getPosition(c);
                            return e === CKEDITOR.POSITION_IDENTICAL ? !1 : 0 === (e & d)
                        }
                        var d = {
                            td: 1,
                            th: 1,
                            caption: 1
                        };
                        return {
                            detectPurge: function(a) {
                                var b = a.range,
                                    c = b.clone();
                                c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
                                var c = new CKEDITOR.dom.walker(c),
                                    e = 0;
                                c.evaluator = function(a) {
                                    a.type == CKEDITOR.NODE_ELEMENT && a.is(d) && ++e
                                };
                                c.checkForward();
                                if (1 < e) {
                                    var c = b.startPath().contains("table"),
                                        f = b.endPath().contains("table");
                                    c && f && b.checkBoundaryOfElement(c, CKEDITOR.START) && b.checkBoundaryOfElement(f, CKEDITOR.END) && (b = a.range.clone(), b.setStartBefore(c), b.setEndAfter(f), a.purgeTableBookmark = b.createBookmark())
                                }
                            },
                            detectRanges: function(e, f) {
                                var h = c(f, e.bookmark),
                                    g = h.clone(),
                                    l, k, v = h.getCommonAncestor();
                                v.is(CKEDITOR.dtd.$tableContent) && !v.is(d) && (v = v.getAscendant("table", !0));
                                k = v;
                                v = new CKEDITOR.dom.elementPath(h.startContainer, k);
                                k = new CKEDITOR.dom.elementPath(h.endContainer, k);
                                v = v.contains("table");
                                k = k.contains("table");
                                if (v || k) v && k && b(v, k) ? (e.tableSurroundingRange = g, g.setStartAt(v, CKEDITOR.POSITION_AFTER_END), g.setEndAt(k, CKEDITOR.POSITION_BEFORE_START), g = h.clone(), g.setEndAt(v, CKEDITOR.POSITION_AFTER_END), l = h.clone(), l.setStartAt(k, CKEDITOR.POSITION_BEFORE_START), l = a(g).concat(a(l))) : v ? k || (e.tableSurroundingRange = g, g.setStartAt(v, CKEDITOR.POSITION_AFTER_END), h.setEndAt(v, CKEDITOR.POSITION_AFTER_END)) : (e.tableSurroundingRange = g, g.setEndAt(k, CKEDITOR.POSITION_BEFORE_START), h.setStartAt(k, CKEDITOR.POSITION_AFTER_START)), e.tableContentsRanges = l ? l : a(h)
                            },
                            deleteRanges: function(a) {
                                for (var b; b = a.tableContentsRanges.pop();) b.extractContents(), A(b.startContainer) && b.startContainer.appendBogus();
                                a.tableSurroundingRange && a.tableSurroundingRange.extractContents()
                            },
                            purge: function(a) {
                                if (a.purgeTableBookmark) {
                                    var b = a.doc,
                                        c = a.range.clone(),
                                        b = b.createElement("p");
                                    b.insertBefore(a.purgeTableBookmark.startNode);
                                    c.moveToBookmark(a.purgeTableBookmark);
                                    c.deleteContents();
                                    a.range.moveToPosition(b, CKEDITOR.POSITION_AFTER_START)
                                }
                            }
                        }
                    }(),
                    detectExtractMerge: function(a) {
                        return !(a.range.startPath().contains(CKEDITOR.dtd.$listItem) && a.range.endPath().contains(CKEDITOR.dtd.$listItem))
                    },
                    fixUneditableRangePosition: function(a) {
                        a.startContainer.getDtd()["#"] || a.moveToClosestEditablePosition(null, !0)
                    },
                    autoParagraph: function(a, b) {
                        var c = b.startPath(),
                            d;
                        l(a, c.block, c.blockLimit) && (d = k(a)) && (d = b.document.createElement(d), d.appendBogus(), b.insertNode(d), b.moveToPosition(d, CKEDITOR.POSITION_AFTER_START))
                    }
                }
            }()
        })();
        (function() {
            function a() {
                var a = this._.fakeSelection,
                    b;
                a && (b = this.getSelection(1), b && b.isHidden() || (a.reset(), a = 0));
                if (!a && (a = b || this.getSelection(1), !a || a.getType() == CKEDITOR.SELECTION_NONE)) return;
                this.fire("selectionCheck", a);
                b = this.elementPath();
                b.compare(this._.selectionPreviousPath) || (CKEDITOR.env.webkit && (this._.previousActive = this.document.getActive()), this._.selectionPreviousPath = b, this.fire("selectionChange", {
                    selection: a,
                    path: b
                }))
            }

            function d() {
                A = !0;
                y || (b.call(this), y = CKEDITOR.tools.setTimeout(b, 200, this))
            }

            function b() {
                y = null;
                A && (CKEDITOR.tools.setTimeout(a, 0, this), A = !1)
            }

            function c(a) {
                return t(a) || a.type == CKEDITOR.NODE_ELEMENT && !a.is(CKEDITOR.dtd.$empty) ? !0 : !1
            }

            function e(a) {
                function b(c, d) {
                    return c && c.type != CKEDITOR.NODE_TEXT ? a.clone()["moveToElementEdit" + (d ? "End" : "Start")](c) : !1
                }
                if (!(a.root instanceof CKEDITOR.editable)) return !1;
                var d = a.startContainer,
                    e = a.getPreviousNode(c, null, d),
                    f = a.getNextNode(c, null, d);
                return b(e) || b(f, 1) || !(e || f || d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary() && d.getBogus()) ? !0 : !1
            }

            function g(a) {
                l(a, !1);
                var b = a.getDocument().createText(u);
                a.setCustomData("cke-fillingChar", b);
                return b
            }

            function l(a, b) {
                var c = a && a.removeCustomData("cke-fillingChar");
                if (c) {
                    if (!1 !== b) {
                        var d = a.getDocument().getSelection().getNative(),
                            e = d && "None" != d.type && d.getRangeAt(0),
                            f = u.length;
                        if (c.getLength() > f && e && e.intersectsNode(c.$)) {
                            var g = [{
                                node: d.anchorNode,
                                offset: d.anchorOffset
                            }, {
                                node: d.focusNode,
                                offset: d.focusOffset
                            }];
                            d.anchorNode == c.$ && d.anchorOffset > f && (g[0].offset -= f);
                            d.focusNode == c.$ && d.focusOffset > f && (g[1].offset -= f)
                        }
                    }
                    c.setText(k(c.getText(), 1));
                    g && (c = a.getDocument().$, d = c.getSelection(), c = c.createRange(), c.setStart(g[0].node, g[0].offset), c.collapse(!0), d.removeAllRanges(), d.addRange(c), d.extend(g[1].node, g[1].offset))
                }
            }

            function k(a, b) {
                return b ? a.replace(r, function(a, b) {
                    return b ? " " : ""
                }) : a.replace(u, "")
            }

            function q(a) {
                var b = CKEDITOR.dom.element.createFromHtml('<div data-cke-hidden-sel="1" data-cke-temp="1" style="' + (CKEDITOR.env.ie ? "display:none" : "position:fixed;top:0;left:-1000px") + '">&nbsp;</div>', a.document);
                a.fire("lockSnapshot");
                a.editable().append(b);
                var c = a.getSelection(1),
                    d = a.createRange(),
                    e = c.root.on("selectionchange", function(a) {
                        a.cancel()
                    }, null, null, 0);
                d.setStartAt(b, CKEDITOR.POSITION_AFTER_START);
                d.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
                c.selectRanges([d]);
                e.removeListener();
                a.fire("unlockSnapshot");
                a._.hiddenSelectionContainer = b
            }

            function w(a) {
                var b = {
                    37: 1,
                    39: 1,
                    8: 1,
                    46: 1
                };
                return function(c) {
                    var d = c.data.getKeystroke();
                    if (b[d]) {
                        var e = a.getSelection().getRanges(),
                            f = e[0];
                        1 == e.length && f.collapsed && (d = f[38 > d ? "getPreviousEditableNode" : "getNextEditableNode"]()) && d.type == CKEDITOR.NODE_ELEMENT && "false" == d.getAttribute("contenteditable") && (a.getSelection().fake(d), c.data.preventDefault(), c.cancel())
                    }
                }
            }

            function f(a) {
                for (var b = 0; b < a.length; b++) {
                    var c = a[b];
                    c.getCommonAncestor().isReadOnly() && a.splice(b, 1);
                    if (!c.collapsed) {
                        if (c.startContainer.isReadOnly())
                            for (var d = c.startContainer, e; d && !((e = d.type == CKEDITOR.NODE_ELEMENT) && d.is("body") || !d.isReadOnly());) e && "false" == d.getAttribute("contentEditable") && c.setStartAfter(d), d = d.getParent();
                        d = c.startContainer;
                        e = c.endContainer;
                        var f = c.startOffset,
                            g = c.endOffset,
                            l = c.clone();
                        d && d.type == CKEDITOR.NODE_TEXT && (f >= d.getLength() ? l.setStartAfter(d) : l.setStartBefore(d));
                        e && e.type == CKEDITOR.NODE_TEXT && (g ? l.setEndAfter(e) : l.setEndBefore(e));
                        d = new CKEDITOR.dom.walker(l);
                        d.evaluator = function(d) {
                            if (d.type == CKEDITOR.NODE_ELEMENT && d.isReadOnly()) {
                                var e = c.clone();
                                c.setEndBefore(d);
                                c.collapsed && a.splice(b--, 1);
                                d.getPosition(l.endContainer) & CKEDITOR.POSITION_CONTAINS || (e.setStartAfter(d), e.collapsed || a.splice(b + 1, 0, e));
                                return !0
                            }
                            return !1
                        };
                        d.next()
                    }
                }
                return a
            }
            var y, A, t = CKEDITOR.dom.walker.invisible(1),
                D = function() {
                    function a(b) {
                        return function(a) {
                            var c = a.editor.createRange();
                            c.moveToClosestEditablePosition(a.selected, b) && a.editor.getSelection().selectRanges([c]);
                            return !1
                        }
                    }

                    function b(a) {
                        return function(b) {
                            var c = b.editor,
                                d = c.createRange(),
                                e;
                            (e = d.moveToClosestEditablePosition(b.selected, a)) || (e = d.moveToClosestEditablePosition(b.selected, !a));
                            e && c.getSelection().selectRanges([d]);
                            c.fire("saveSnapshot");
                            b.selected.remove();
                            e || (d.moveToElementEditablePosition(c.editable()), c.getSelection().selectRanges([d]));
                            c.fire("saveSnapshot");
                            return !1
                        }
                    }
                    var c = a(),
                        d = a(1);
                    return {
                        37: c,
                        38: c,
                        39: d,
                        40: d,
                        8: b(),
                        46: b(1)
                    }
                }();
            CKEDITOR.on("instanceCreated", function(b) {
                function c() {
                    var a = e.getSelection();
                    a && a.removeAllRanges()
                }
                var e = b.editor;
                e.on("contentDom", function() {
                    function b() {
                        I = new CKEDITOR.dom.selection(e.getSelection());
                        I.lock()
                    }

                    function c() {
                        h.removeListener("mouseup", c);
                        k.removeListener("mouseup", c);
                        var a = CKEDITOR.document.$.selection,
                            b = a.createRange();
                        "None" != a.type && b.parentElement().ownerDocument == f.$ && b.select()
                    }
                    var f = e.document,
                        h = CKEDITOR.document,
                        g = e.editable(),
                        n = f.getBody(),
                        k = f.getDocumentElement(),
                        q = g.isInline(),
                        v, I;
                    CKEDITOR.env.gecko && g.attachListener(g, "focus", function(a) {
                        a.removeListener();
                        0 !== v && (a = e.getSelection().getNative()) && a.isCollapsed && a.anchorNode == g.$ && (a = e.createRange(), a.moveToElementEditStart(g), a.select())
                    }, null, null, -2);
                    g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
                        v && CKEDITOR.env.webkit && (v = e._.previousActive && e._.previousActive.equals(f.getActive()));
                        e.unlockSelection(v);
                        v = 0
                    }, null, null, -1);
                    g.attachListener(g, "mousedown", function() {
                        v = 0
                    });
                    if (CKEDITOR.env.ie || q) p ? g.attachListener(g, "beforedeactivate", b, null, null, -1) : g.attachListener(e, "selectionCheck", b, null, null, -1), g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusOut" : "blur", function() {
                        e.lockSelection(I);
                        v = 1
                    }, null, null, -1), g.attachListener(g, "mousedown", function() {
                        v = 0
                    });
                    if (CKEDITOR.env.ie && !q) {
                        var J;
                        g.attachListener(g, "mousedown", function(a) {
                            2 == a.data.$.button && ((a = e.document.getSelection()) && a.getType() != CKEDITOR.SELECTION_NONE || (J = e.window.getScrollPosition()))
                        });
                        g.attachListener(g, "mouseup", function(a) {
                            2 == a.data.$.button && J && (e.document.$.documentElement.scrollLeft = J.x, e.document.$.documentElement.scrollTop = J.y);
                            J = null
                        });
                        if ("BackCompat" != f.$.compatMode) {
                            if (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) k.on("mousedown", function(a) {
                                function b(a) {
                                    a = a.data.$;
                                    if (d) {
                                        var c = n.$.createTextRange();
                                        try {
                                            c.moveToPoint(a.clientX, a.clientY)
                                        } catch (e) {}
                                        d.setEndPoint(0 > f.compareEndPoints("StartToStart", c) ? "EndToEnd" : "StartToStart", c);
                                        d.select()
                                    }
                                }

                                function c() {
                                    k.removeListener("mousemove", b);
                                    h.removeListener("mouseup", c);
                                    k.removeListener("mouseup", c);
                                    d.select()
                                }
                                a = a.data;
                                if (a.getTarget().is("html") && a.$.y < k.$.clientHeight && a.$.x < k.$.clientWidth) {
                                    var d = n.$.createTextRange();
                                    try {
                                        d.moveToPoint(a.$.clientX, a.$.clientY)
                                    } catch (e) {}
                                    var f = d.duplicate();
                                    k.on("mousemove", b);
                                    h.on("mouseup", c);
                                    k.on("mouseup", c)
                                }
                            });
                            if (7 < CKEDITOR.env.version && 11 > CKEDITOR.env.version) k.on("mousedown", function(a) {
                                a.data.getTarget().is("html") && (h.on("mouseup", c), k.on("mouseup", c))
                            })
                        }
                    }
                    g.attachListener(g, "selectionchange", a, e);
                    g.attachListener(g, "keyup", d, e);
                    g.attachListener(g, CKEDITOR.env.webkit ? "DOMFocusIn" : "focus", function() {
                        e.forceNextSelectionCheck();
                        e.selectionChange(1)
                    });
                    if (q && (CKEDITOR.env.webkit || CKEDITOR.env.gecko)) {
                        var F;
                        g.attachListener(g, "mousedown", function() {
                            F = 1
                        });
                        g.attachListener(f.getDocumentElement(), "mouseup", function() {
                            F && d.call(e);
                            F = 0
                        })
                    } else g.attachListener(CKEDITOR.env.ie ? g : f.getDocumentElement(), "mouseup", d, e);
                    CKEDITOR.env.webkit && g.attachListener(f, "keydown", function(a) {
                        switch (a.data.getKey()) {
                            case 13:
                            case 33:
                            case 34:
                            case 35:
                            case 36:
                            case 37:
                            case 39:
                            case 8:
                            case 45:
                            case 46:
                                l(g)
                        }
                    }, null, null, -1);
                    g.attachListener(g, "keydown", w(e), null, null, -1)
                });
                e.on("setData", function() {
                    e.unlockSelection();
                    CKEDITOR.env.webkit && c()
                });
                e.on("contentDomUnload", function() {
                    e.unlockSelection()
                });
                if (CKEDITOR.env.ie9Compat) e.on("beforeDestroy", c, null, null, 9);
                e.on("dataReady", function() {
                    delete e._.fakeSelection;
                    delete e._.hiddenSelectionContainer;
                    e.selectionChange(1)
                });
                e.on("loadSnapshot", function() {
                    var a = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT),
                        b = e.editable().getLast(a);
                    b && b.hasAttribute("data-cke-hidden-sel") && (b.remove(), CKEDITOR.env.gecko && (a = e.editable().getFirst(a)) && a.is("br") && a.getAttribute("_moz_editor_bogus_node") && a.remove())
                }, null, null, 100);
                e.on("key", function(a) {
                    if ("wysiwyg" == e.mode) {
                        var b = e.getSelection();
                        if (b.isFake) {
                            var c = D[a.data.keyCode];
                            if (c) return c({
                                editor: e,
                                selected: b.getSelectedElement(),
                                selection: b,
                                keyEvent: a
                            })
                        }
                    }
                })
            });
            if (CKEDITOR.env.webkit) CKEDITOR.on("instanceReady", function(a) {
                var b = a.editor;
                b.on("selectionChange", function() {
                    var a = b.editable(),
                        c = a.getCustomData("cke-fillingChar");
                    c && (c.getCustomData("ready") ? l(a) : c.setCustomData("ready", 1))
                }, null, null, -1);
                b.on("beforeSetMode", function() {
                    l(b.editable())
                }, null, null, -1);
                b.on("getSnapshot", function(a) {
                    a.data && (a.data = k(a.data))
                }, b, null, 20);
                b.on("toDataFormat", function(a) {
                    a.data.dataValue = k(a.data.dataValue)
                }, null, null, 0)
            });
            CKEDITOR.editor.prototype.selectionChange = function(b) {
                (b ? a : d).call(this)
            };
            CKEDITOR.editor.prototype.getSelection = function(a) {
                return !this._.savedSelection && !this._.fakeSelection || a ? (a = this.editable()) && "wysiwyg" == this.mode ? new CKEDITOR.dom.selection(a) : null : this._.savedSelection || this._.fakeSelection
            };
            CKEDITOR.editor.prototype.lockSelection = function(a) {
                a = a || this.getSelection(1);
                return a.getType() != CKEDITOR.SELECTION_NONE ? (!a.isLocked && a.lock(), this._.savedSelection = a, !0) : !1
            };
            CKEDITOR.editor.prototype.unlockSelection = function(a) {
                var b = this._.savedSelection;
                return b ? (b.unlock(a), delete this._.savedSelection, !0) : !1
            };
            CKEDITOR.editor.prototype.forceNextSelectionCheck = function() {
                delete this._.selectionPreviousPath
            };
            CKEDITOR.dom.document.prototype.getSelection = function() {
                return new CKEDITOR.dom.selection(this)
            };
            CKEDITOR.dom.range.prototype.select = function() {
                var a = this.root instanceof CKEDITOR.editable ? this.root.editor.getSelection() : new CKEDITOR.dom.selection(this.root);
                a.selectRanges([this]);
                return a
            };
            CKEDITOR.SELECTION_NONE = 1;
            CKEDITOR.SELECTION_TEXT = 2;
            CKEDITOR.SELECTION_ELEMENT = 3;
            var p = "function" != typeof window.getSelection,
                x = 1;
            CKEDITOR.dom.selection = function(a) {
                if (a instanceof CKEDITOR.dom.selection) {
                    var b = a;
                    a = a.root
                }
                var c = a instanceof CKEDITOR.dom.element;
                this.rev = b ? b.rev : x++;
                this.document = a instanceof CKEDITOR.dom.document ? a : a.getDocument();
                this.root = c ? a : this.document.getBody();
                this.isLocked = 0;
                this._ = {
                    cache: {}
                };
                if (b) return CKEDITOR.tools.extend(this._.cache, b._.cache), this.isFake = b.isFake, this.isLocked = b.isLocked, this;
                a = this.getNative();
                var d, e;
                if (a)
                    if (a.getRangeAt) d = (e = a.rangeCount && a.getRangeAt(0)) && new CKEDITOR.dom.node(e.commonAncestorContainer);
                    else {
                        try {
                            e = a.createRange()
                        } catch (f) {}
                        d = e && CKEDITOR.dom.element.get(e.item && e.item(0) || e.parentElement())
                    }
                if (!d || d.type != CKEDITOR.NODE_ELEMENT && d.type != CKEDITOR.NODE_TEXT || !this.root.equals(d) && !this.root.contains(d)) this._.cache.type = CKEDITOR.SELECTION_NONE, this._.cache.startElement = null, this._.cache.selectedElement = null, this._.cache.selectedText = "", this._.cache.ranges = new CKEDITOR.dom.rangeList;
                return this
            };
            var G = {
                    img: 1,
                    hr: 1,
                    li: 1,
                    table: 1,
                    tr: 1,
                    td: 1,
                    th: 1,
                    embed: 1,
                    object: 1,
                    ol: 1,
                    ul: 1,
                    a: 1,
                    input: 1,
                    form: 1,
                    select: 1,
                    textarea: 1,
                    button: 1,
                    fieldset: 1,
                    thead: 1,
                    tfoot: 1
                },
                u = CKEDITOR.tools.repeat("​", 7),
                r = new RegExp(u + "( )?", "g");
            CKEDITOR.tools.extend(CKEDITOR.dom.selection, {
                _removeFillingCharSequenceString: k,
                _createFillingCharSequenceNode: g,
                FILLING_CHAR_SEQUENCE: u
            });
            CKEDITOR.dom.selection.prototype = {
                getNative: function() {
                    return void 0 !== this._.cache.nativeSel ? this._.cache.nativeSel : this._.cache.nativeSel = p ? this.document.$.selection : this.document.getWindow().$.getSelection()
                },
                getType: p ? function() {
                    var a = this._.cache;
                    if (a.type) return a.type;
                    var b = CKEDITOR.SELECTION_NONE;
                    try {
                        var c = this.getNative(),
                            d = c.type;
                        "Text" == d && (b = CKEDITOR.SELECTION_TEXT);
                        "Control" == d && (b = CKEDITOR.SELECTION_ELEMENT);
                        c.createRange().parentElement() && (b = CKEDITOR.SELECTION_TEXT)
                    } catch (e) {}
                    return a.type = b
                } : function() {
                    var a = this._.cache;
                    if (a.type) return a.type;
                    var b = CKEDITOR.SELECTION_TEXT,
                        c = this.getNative();
                    if (!c || !c.rangeCount) b = CKEDITOR.SELECTION_NONE;
                    else if (1 == c.rangeCount) {
                        var c = c.getRangeAt(0),
                            d = c.startContainer;
                        d == c.endContainer && 1 == d.nodeType && 1 == c.endOffset - c.startOffset && G[d.childNodes[c.startOffset].nodeName.toLowerCase()] && (b = CKEDITOR.SELECTION_ELEMENT)
                    }
                    return a.type = b
                },
                getRanges: function() {
                    var a = p ? function() {
                        function a(b) {
                            return new CKEDITOR.dom.node(b).getIndex()
                        }
                        var b = function(b, c) {
                            b = b.duplicate();
                            b.collapse(c);
                            var d = b.parentElement();
                            if (!d.hasChildNodes()) return {
                                container: d,
                                offset: 0
                            };
                            for (var e = d.children, f, h, g = b.duplicate(), l = 0, v = e.length - 1, k = -1, m, p; l <= v;)
                                if (k = Math.floor((l + v) / 2), f = e[k], g.moveToElementText(f), m = g.compareEndPoints("StartToStart", b), 0 < m) v = k - 1;
                                else if (0 > m) l = k + 1;
                            else return {
                                container: d,
                                offset: a(f)
                            };
                            if (-1 == k || k == e.length - 1 && 0 > m) {
                                g.moveToElementText(d);
                                g.setEndPoint("StartToStart", b);
                                g = g.text.replace(/(\r\n|\r)/g, "\n").length;
                                e = d.childNodes;
                                if (!g) return f = e[e.length - 1], f.nodeType != CKEDITOR.NODE_TEXT ? {
                                    container: d,
                                    offset: e.length
                                } : {
                                    container: f,
                                    offset: f.nodeValue.length
                                };
                                for (d = e.length; 0 < g && 0 < d;) h = e[--d], h.nodeType == CKEDITOR.NODE_TEXT && (p = h, g -= h.nodeValue.length);
                                return {
                                    container: p,
                                    offset: -g
                                }
                            }
                            g.collapse(0 < m ? !0 : !1);
                            g.setEndPoint(0 < m ? "StartToStart" : "EndToStart", b);
                            g = g.text.replace(/(\r\n|\r)/g, "\n").length;
                            if (!g) return {
                                container: d,
                                offset: a(f) + (0 < m ? 0 : 1)
                            };
                            for (; 0 < g;) try {
                                h = f[0 < m ? "previousSibling" : "nextSibling"], h.nodeType == CKEDITOR.NODE_TEXT && (g -= h.nodeValue.length, p = h), f = h
                            } catch (q) {
                                return {
                                    container: d,
                                    offset: a(f)
                                }
                            }
                            return {
                                container: p,
                                offset: 0 < m ? -g : p.nodeValue.length + g
                            }
                        };
                        return function() {
                            var a = this.getNative(),
                                c = a && a.createRange(),
                                d = this.getType();
                            if (!a) return [];
                            if (d == CKEDITOR.SELECTION_TEXT) return a = new CKEDITOR.dom.range(this.root), d = b(c, !0), a.setStart(new CKEDITOR.dom.node(d.container), d.offset), d = b(c), a.setEnd(new CKEDITOR.dom.node(d.container), d.offset), a.endContainer.getPosition(a.startContainer) & CKEDITOR.POSITION_PRECEDING && a.endOffset <= a.startContainer.getIndex() && a.collapse(), [a];
                            if (d == CKEDITOR.SELECTION_ELEMENT) {
                                for (var d = [], e = 0; e < c.length; e++) {
                                    for (var f = c.item(e), h = f.parentNode, g = 0, a = new CKEDITOR.dom.range(this.root); g < h.childNodes.length && h.childNodes[g] != f; g++);
                                    a.setStart(new CKEDITOR.dom.node(h), g);
                                    a.setEnd(new CKEDITOR.dom.node(h), g + 1);
                                    d.push(a)
                                }
                                return d
                            }
                            return []
                        }
                    }() : function() {
                        var a = [],
                            b, c = this.getNative();
                        if (!c) return a;
                        for (var d = 0; d < c.rangeCount; d++) {
                            var e = c.getRangeAt(d);
                            b = new CKEDITOR.dom.range(this.root);
                            b.setStart(new CKEDITOR.dom.node(e.startContainer), e.startOffset);
                            b.setEnd(new CKEDITOR.dom.node(e.endContainer), e.endOffset);
                            a.push(b)
                        }
                        return a
                    };
                    return function(b) {
                        var c = this._.cache,
                            d = c.ranges;
                        d || (c.ranges = d = new CKEDITOR.dom.rangeList(a.call(this)));
                        return b ? f(new CKEDITOR.dom.rangeList(d.slice())) : d
                    }
                }(),
                getStartElement: function() {
                    var a = this._.cache;
                    if (void 0 !== a.startElement) return a.startElement;
                    var b;
                    switch (this.getType()) {
                        case CKEDITOR.SELECTION_ELEMENT:
                            return this.getSelectedElement();
                        case CKEDITOR.SELECTION_TEXT:
                            var c = this.getRanges()[0];
                            if (c) {
                                if (c.collapsed) b = c.startContainer, b.type != CKEDITOR.NODE_ELEMENT && (b = b.getParent());
                                else {
                                    for (c.optimize(); b = c.startContainer, c.startOffset == (b.getChildCount ? b.getChildCount() : b.getLength()) && !b.isBlockBoundary();) c.setStartAfter(b);
                                    b = c.startContainer;
                                    if (b.type != CKEDITOR.NODE_ELEMENT) return b.getParent();
                                    if ((b = b.getChild(c.startOffset)) && b.type == CKEDITOR.NODE_ELEMENT)
                                        for (c = b.getFirst(); c && c.type == CKEDITOR.NODE_ELEMENT;) b = c, c = c.getFirst();
                                    else b = c.startContainer
                                }
                                b = b.$
                            }
                    }
                    return a.startElement = b ? new CKEDITOR.dom.element(b) : null
                },
                getSelectedElement: function() {
                    var a = this._.cache;
                    if (void 0 !== a.selectedElement) return a.selectedElement;
                    var b = this,
                        c = CKEDITOR.tools.tryThese(function() {
                            return b.getNative().createRange().item(0)
                        }, function() {
                            for (var a = b.getRanges()[0].clone(), c, d, e = 2; e && !((c = a.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && G[c.getName()] && (d = c)); e--) a.shrink(CKEDITOR.SHRINK_ELEMENT);
                            return d && d.$
                        });
                    return a.selectedElement = c ? new CKEDITOR.dom.element(c) : null
                },
                getSelectedText: function() {
                    var a = this._.cache;
                    if (void 0 !== a.selectedText) return a.selectedText;
                    var b = this.getNative(),
                        b = p ? "Control" == b.type ? "" : b.createRange().text : b.toString();
                    return a.selectedText = b
                },
                lock: function() {
                    this.getRanges();
                    this.getStartElement();
                    this.getSelectedElement();
                    this.getSelectedText();
                    this._.cache.nativeSel = null;
                    this.isLocked = 1
                },
                unlock: function(a) {
                    if (this.isLocked) {
                        if (a) var b = this.getSelectedElement(),
                            c = !b && this.getRanges(),
                            d = this.isFake;
                        this.isLocked = 0;
                        this.reset();
                        a && (a = b || c[0] && c[0].getCommonAncestor()) && a.getAscendant("body", 1) && (d ? this.fake(b) : b ? this.selectElement(b) : this.selectRanges(c))
                    }
                },
                reset: function() {
                    this._.cache = {};
                    this.isFake = 0;
                    var a = this.root.editor;
                    if (a && a._.fakeSelection)
                        if (this.rev == a._.fakeSelection.rev) {
                            delete a._.fakeSelection;
                            var b = a._.hiddenSelectionContainer;
                            if (b) {
                                var c = a.checkDirty();
                                a.fire("lockSnapshot");
                                b.remove();
                                a.fire("unlockSnapshot");
                                !c && a.resetDirty()
                            }
                            delete a._.hiddenSelectionContainer
                        } else CKEDITOR.warn("selection-fake-reset");
                    this.rev = x++
                },
                selectElement: function(a) {
                    var b = new CKEDITOR.dom.range(this.root);
                    b.setStartBefore(a);
                    b.setEndAfter(a);
                    this.selectRanges([b])
                },
                selectRanges: function(a) {
                    var b = this.root.editor,
                        b = b && b._.hiddenSelectionContainer;
                    this.reset();
                    if (b)
                        for (var b = this.root, c, d = 0; d < a.length; ++d) c = a[d], c.endContainer.equals(b) && (c.endOffset = Math.min(c.endOffset, b.getChildCount()));
                    if (a.length)
                        if (this.isLocked) {
                            var f = CKEDITOR.document.getActive();
                            this.unlock();
                            this.selectRanges(a);
                            this.lock();
                            f && !f.equals(this.root) && f.focus()
                        } else {
                            var k;
                            a: {
                                var q, w;
                                if (1 == a.length && !(w = a[0]).collapsed && (k = w.getEnclosedNode()) && k.type == CKEDITOR.NODE_ELEMENT && (w = w.clone(), w.shrink(CKEDITOR.SHRINK_ELEMENT, !0), (q = w.getEnclosedNode()) && q.type == CKEDITOR.NODE_ELEMENT && (k = q), "false" == k.getAttribute("contenteditable"))) break a;k = void 0
                            }
                            if (k) this.fake(k);
                            else {
                                if (p) {
                                    w = CKEDITOR.dom.walker.whitespaces(!0);
                                    q = /\ufeff|\u00a0/;
                                    b = {
                                        table: 1,
                                        tbody: 1,
                                        tr: 1
                                    };
                                    1 < a.length && (k = a[a.length - 1], a[0].setEnd(k.endContainer, k.endOffset));
                                    k = a[0];
                                    a = k.collapsed;
                                    var t, u, r;
                                    if ((c = k.getEnclosedNode()) && c.type == CKEDITOR.NODE_ELEMENT && c.getName() in G && (!c.is("a") || !c.getText())) try {
                                        r = c.$.createControlRange();
                                        r.addElement(c.$);
                                        r.select();
                                        return
                                    } catch (v) {}
                                    if (k.startContainer.type == CKEDITOR.NODE_ELEMENT && k.startContainer.getName() in b || k.endContainer.type == CKEDITOR.NODE_ELEMENT && k.endContainer.getName() in b) k.shrink(CKEDITOR.NODE_ELEMENT, !0), a = k.collapsed;
                                    r = k.createBookmark();
                                    b = r.startNode;
                                    a || (f = r.endNode);
                                    r = k.document.$.body.createTextRange();
                                    r.moveToElementText(b.$);
                                    r.moveStart("character", 1);
                                    f ? (q = k.document.$.body.createTextRange(), q.moveToElementText(f.$), r.setEndPoint("EndToEnd", q), r.moveEnd("character", -1)) : (t = b.getNext(w), u = b.hasAscendant("pre"), t = !(t && t.getText && t.getText().match(q)) && (u || !b.hasPrevious() || b.getPrevious().is && b.getPrevious().is("br")), u = k.document.createElement("span"), u.setHtml("&#65279;"), u.insertBefore(b), t && k.document.createText("\ufeff").insertBefore(b));
                                    k.setStartBefore(b);
                                    b.remove();
                                    a ? (t ? (r.moveStart("character", -1), r.select(), k.document.$.selection.clear()) : r.select(), k.moveToPosition(u, CKEDITOR.POSITION_BEFORE_START), u.remove()) : (k.setEndBefore(f), f.remove(), r.select())
                                } else {
                                    f = this.getNative();
                                    if (!f) return;
                                    this.removeAllRanges();
                                    for (r = 0; r < a.length; r++) {
                                        if (r < a.length - 1 && (t = a[r], u = a[r + 1], q = t.clone(), q.setStart(t.endContainer, t.endOffset), q.setEnd(u.startContainer, u.startOffset), !q.collapsed && (q.shrink(CKEDITOR.NODE_ELEMENT, !0), k = q.getCommonAncestor(), q = q.getEnclosedNode(), k.isReadOnly() || q && q.isReadOnly()))) {
                                            u.setStart(t.startContainer, t.startOffset);
                                            a.splice(r--, 1);
                                            continue
                                        }
                                        k = a[r];
                                        u = this.document.$.createRange();
                                        k.collapsed && CKEDITOR.env.webkit && e(k) && (q = g(this.root), k.insertNode(q), (t = q.getNext()) && !q.getPrevious() && t.type == CKEDITOR.NODE_ELEMENT && "br" == t.getName() ? (l(this.root), k.moveToPosition(t, CKEDITOR.POSITION_BEFORE_START)) : k.moveToPosition(q, CKEDITOR.POSITION_AFTER_END));
                                        u.setStart(k.startContainer.$, k.startOffset);
                                        try {
                                            u.setEnd(k.endContainer.$, k.endOffset)
                                        } catch (I) {
                                            if (0 <= I.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")) k.collapse(1), u.setEnd(k.endContainer.$, k.endOffset);
                                            else throw I
                                        }
                                        f.addRange(u)
                                    }
                                }
                                this.reset();
                                this.root.fire("selectionchange")
                            }
                        }
                },
                fake: function(a) {
                    var b = this.root.editor;
                    this.reset();
                    q(b);
                    var c = this._.cache,
                        d = new CKEDITOR.dom.range(this.root);
                    d.setStartBefore(a);
                    d.setEndAfter(a);
                    c.ranges = new CKEDITOR.dom.rangeList(d);
                    c.selectedElement = c.startElement = a;
                    c.type = CKEDITOR.SELECTION_ELEMENT;
                    c.selectedText = c.nativeSel = null;
                    this.isFake = 1;
                    this.rev = x++;
                    b._.fakeSelection = this;
                    this.root.fire("selectionchange")
                },
                isHidden: function() {
                    var a = this.getCommonAncestor();
                    a && a.type == CKEDITOR.NODE_TEXT && (a = a.getParent());
                    return !(!a || !a.data("cke-hidden-sel"))
                },
                createBookmarks: function(a) {
                    a = this.getRanges().createBookmarks(a);
                    this.isFake && (a.isFake = 1);
                    return a
                },
                createBookmarks2: function(a) {
                    a = this.getRanges().createBookmarks2(a);
                    this.isFake && (a.isFake = 1);
                    return a
                },
                selectBookmarks: function(a) {
                    for (var b = [], c, d = 0; d < a.length; d++) {
                        var e = new CKEDITOR.dom.range(this.root);
                        e.moveToBookmark(a[d]);
                        b.push(e)
                    }
                    a.isFake && (c = b[0].getEnclosedNode(), c && c.type == CKEDITOR.NODE_ELEMENT || (CKEDITOR.warn("selection-not-fake"), a.isFake = 0));
                    a.isFake ? this.fake(c) : this.selectRanges(b);
                    return this
                },
                getCommonAncestor: function() {
                    var a = this.getRanges();
                    return a.length ? a[0].startContainer.getCommonAncestor(a[a.length - 1].endContainer) : null
                },
                scrollIntoView: function() {
                    this.type != CKEDITOR.SELECTION_NONE && this.getRanges()[0].scrollIntoView()
                },
                removeAllRanges: function() {
                    if (this.getType() != CKEDITOR.SELECTION_NONE) {
                        var a = this.getNative();
                        try {
                            a && a[p ? "empty" : "removeAllRanges"]()
                        } catch (b) {}
                        this.reset()
                    }
                }
            }
        })();
        "use strict";
        CKEDITOR.STYLE_BLOCK = 1;
        CKEDITOR.STYLE_INLINE = 2;
        CKEDITOR.STYLE_OBJECT = 3;
        (function() {
            function a(a, b) {
                for (var c, d;
                    (a = a.getParent()) && !a.equals(b);)
                    if (a.getAttribute("data-nostyle")) c = a;
                    else if (!d) {
                    var e = a.getAttribute("contentEditable");
                    "false" == e ? c = a : "true" == e && (d = 1)
                }
                return c
            }

            function d(a, b, c, d) {
                return (a.getPosition(b) | d) == d && (!c.childRule || c.childRule(a))
            }

            function b(c) {
                var f = c.document;
                if (c.collapsed) f = G(this, f), c.insertNode(f), c.moveToPosition(f, CKEDITOR.POSITION_BEFORE_END);
                else {
                    var g = this.element,
                        h = this._.definition,
                        l, k = h.ignoreReadonly,
                        m = k || h.includeReadonly;
                    null == m && (m = c.root.getCustomData("cke_includeReadonly"));
                    var n = CKEDITOR.dtd[g];
                    n || (l = !0, n = CKEDITOR.dtd.span);
                    c.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
                    c.trim();
                    var p = c.createBookmark(),
                        q = p.startNode,
                        w = p.endNode,
                        t = q,
                        r;
                    if (!k) {
                        var u = c.getCommonAncestor(),
                            k = a(q, u),
                            u = a(w, u);
                        k && (t = k.getNextSourceNode(!0));
                        u && (w = u)
                    }
                    for (t.getPosition(w) == CKEDITOR.POSITION_FOLLOWING && (t = 0); t;) {
                        k = !1;
                        if (t.equals(w)) t = null, k = !0;
                        else {
                            var y = t.type == CKEDITOR.NODE_ELEMENT ? t.getName() : null,
                                u = y && "false" == t.getAttribute("contentEditable"),
                                x = y && t.getAttribute("data-nostyle");
                            if (y && t.data("cke-bookmark")) {
                                t = t.getNextSourceNode(!0);
                                continue
                            }
                            if (u && m && CKEDITOR.dtd.$block[y])
                                for (var A = t, z = e(A), B = void 0, C = z.length, E = 0, A = C && new CKEDITOR.dom.range(A.getDocument()); E < C; ++E) {
                                    var B = z[E],
                                        R = CKEDITOR.filter.instances[B.data("cke-filter")];
                                    if (R ? R.check(this) : 1) A.selectNodeContents(B), b.call(this, A)
                                }
                            z = y ? !n[y] || x ? 0 : u && !m ? 0 : d(t, w, h, T) : 1;
                            if (z)
                                if (B = t.getParent(),
                                    z = h, C = g, E = l, !B || !(B.getDtd() || CKEDITOR.dtd.span)[C] && !E || z.parentRule && !z.parentRule(B)) k = !0;
                                else {
                                    if (r || y && CKEDITOR.dtd.$removeEmpty[y] && (t.getPosition(w) | T) != T || (r = c.clone(), r.setStartBefore(t)), y = t.type, y == CKEDITOR.NODE_TEXT || u || y == CKEDITOR.NODE_ELEMENT && !t.getChildCount()) {
                                        for (var y = t, Y;
                                            (k = !y.getNext(H)) && (Y = y.getParent(), n[Y.getName()]) && d(Y, q, h, Q);) y = Y;
                                        r.setEndAfter(y)
                                    }
                                }
                            else k = !0;
                            t = t.getNextSourceNode(x || u)
                        }
                        if (k && r && !r.collapsed) {
                            for (var k = G(this, f), u = k.hasAttributes(), x = r.getCommonAncestor(), y = {}, z = {}, B = {}, C = {}, U, O, da; k && x;) {
                                if (x.getName() == g) {
                                    for (U in h.attributes) !C[U] && (da = x.getAttribute(O)) && (k.getAttribute(U) == da ? z[U] = 1 : C[U] = 1);
                                    for (O in h.styles) !B[O] && (da = x.getStyle(O)) && (k.getStyle(O) == da ? y[O] = 1 : B[O] = 1)
                                }
                                x = x.getParent()
                            }
                            for (U in z) k.removeAttribute(U);
                            for (O in y) k.removeStyle(O);
                            u && !k.hasAttributes() && (k = null);
                            k ? (r.extractContents().appendTo(k), r.insertNode(k), D.call(this, k), k.mergeSiblings(), CKEDITOR.env.ie || k.$.normalize()) : (k = new CKEDITOR.dom.element("span"), r.extractContents().appendTo(k), r.insertNode(k), D.call(this, k), k.remove(!0));
                            r = null
                        }
                    }
                    c.moveToBookmark(p);
                    c.shrink(CKEDITOR.SHRINK_TEXT);
                    c.shrink(CKEDITOR.NODE_ELEMENT, !0)
                }
            }

            function c(a) {
                function b() {
                    for (var a = new CKEDITOR.dom.elementPath(d.getParent()), c = new CKEDITOR.dom.elementPath(m.getParent()), e = null, f = null, g = 0; g < a.elements.length; g++) {
                        var h = a.elements[g];
                        if (h == a.block || h == a.blockLimit) break;
                        n.checkElementRemovable(h, !0) && (e = h)
                    }
                    for (g = 0; g < c.elements.length; g++) {
                        h = c.elements[g];
                        if (h == c.block || h == c.blockLimit) break;
                        n.checkElementRemovable(h, !0) && (f = h)
                    }
                    f && m.breakParent(f);
                    e && d.breakParent(e)
                }
                a.enlarge(CKEDITOR.ENLARGE_INLINE, 1);
                var c = a.createBookmark(),
                    d = c.startNode;
                if (a.collapsed) {
                    for (var e = new CKEDITOR.dom.elementPath(d.getParent(), a.root), f, g = 0, k; g < e.elements.length && (k = e.elements[g]) && k != e.block && k != e.blockLimit; g++)
                        if (this.checkElementRemovable(k)) {
                            var l;
                            a.collapsed && (a.checkBoundaryOfElement(k, CKEDITOR.END) || (l = a.checkBoundaryOfElement(k, CKEDITOR.START))) ? (f = k, f.match = l ? "start" : "end") : (k.mergeSiblings(), k.is(this.element) ? t.call(this, k) : p(k, h(this)[k.getName()]))
                        }
                    if (f) {
                        k = d;
                        for (g = 0;; g++) {
                            l = e.elements[g];
                            if (l.equals(f)) break;
                            else if (l.match) continue;
                            else l = l.clone();
                            l.append(k);
                            k = l
                        }
                        k["start" == f.match ? "insertBefore" : "insertAfter"](f)
                    }
                } else {
                    var m = c.endNode,
                        n = this;
                    b();
                    for (e = d; !e.equals(m);) f = e.getNextSourceNode(), e.type == CKEDITOR.NODE_ELEMENT && this.checkElementRemovable(e) && (e.getName() == this.element ? t.call(this, e) : p(e, h(this)[e.getName()]), f.type == CKEDITOR.NODE_ELEMENT && f.contains(d) && (b(), f = d.getNext())), e = f
                }
                a.moveToBookmark(c);
                a.shrink(CKEDITOR.NODE_ELEMENT, !0)
            }

            function e(a) {
                var b = [];
                a.forEach(function(a) {
                    if ("true" == a.getAttribute("contenteditable")) return b.push(a), !1
                }, CKEDITOR.NODE_ELEMENT, !0);
                return b
            }

            function g(a) {
                var b = a.getEnclosedNode() || a.getCommonAncestor(!1, !0);
                (a = new CKEDITOR.dom.elementPath(b, a.root).contains(this.element, 1)) && !a.isReadOnly() && u(a, this)
            }

            function l(a) {
                var b = a.getCommonAncestor(!0, !0);
                if (a = new CKEDITOR.dom.elementPath(b, a.root).contains(this.element, 1)) {
                    var b = this._.definition,
                        c = b.attributes;
                    if (c)
                        for (var d in c) a.removeAttribute(d, c[d]);
                    if (b.styles)
                        for (var e in b.styles) b.styles.hasOwnProperty(e) && a.removeStyle(e)
                }
            }

            function k(a) {
                var b = a.createBookmark(!0),
                    c = a.createIterator();
                c.enforceRealBlocks = !0;
                this._.enterMode && (c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR);
                for (var d, e = a.document, f; d = c.getNextParagraph();) !d.isReadOnly() && (c.activeFilter ? c.activeFilter.check(this) : 1) && (f = G(this, e, d), w(d, f));
                a.moveToBookmark(b)
            }

            function q(a) {
                var b = a.createBookmark(1),
                    c = a.createIterator();
                c.enforceRealBlocks = !0;
                c.enlargeBr = this._.enterMode != CKEDITOR.ENTER_BR;
                for (var d, e; d = c.getNextParagraph();) this.checkElementRemovable(d) && (d.is("pre") ? ((e = this._.enterMode == CKEDITOR.ENTER_BR ? null : a.document.createElement(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div")) && d.copyAttributes(e), w(d, e)) : t.call(this, d));
                a.moveToBookmark(b)
            }

            function w(a, b) {
                var c = !b;
                c && (b = a.getDocument().createElement("div"), a.copyAttributes(b));
                var d = b && b.is("pre"),
                    e = a.is("pre"),
                    g = !d && e;
                if (d && !e) {
                    e = b;
                    (g = a.getBogus()) && g.remove();
                    g = a.getHtml();
                    g = y(g, /(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g, "");
                    g = g.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, "$1");
                    g = g.replace(/([ \t\n\r]+|&nbsp;)/g, " ");
                    g = g.replace(/<br\b[^>]*>/gi, "\n");
                    if (CKEDITOR.env.ie) {
                        var h = a.getDocument().createElement("div");
                        h.append(e);
                        e.$.outerHTML = "<pre>" + g + "</pre>";
                        e.copyAttributes(h.getFirst());
                        e = h.getFirst().remove()
                    } else e.setHtml(g);
                    b = e
                } else g ? b = A(c ? [a.getHtml()] : f(a), b) : a.moveChildren(b);
                b.replace(a);
                if (d) {
                    var c = b,
                        k;
                    (k = c.getPrevious(R)) && k.type == CKEDITOR.NODE_ELEMENT && k.is("pre") && (d = y(k.getHtml(), /\n$/, "") + "\n\n" + y(c.getHtml(), /^\n/, ""), CKEDITOR.env.ie ? c.$.outerHTML = "<pre>" + d + "</pre>" : c.setHtml(d), k.remove())
                } else c && x(b)
            }

            function f(a) {
                var b = [];
                y(a.getOuterHtml(), /(\S\s*)\n(?:\s|(<span[^>]+data-cke-bookmark.*?\/span>))*\n(?!$)/gi, function(a, b, c) {
                    return b + "</pre>" + c + "<pre>"
                }).replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi, function(a, c) {
                    b.push(c)
                });
                return b
            }

            function y(a, b, c) {
                var d = "",
                    e = "";
                a = a.replace(/(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi, function(a, b, c) {
                    b && (d = b);
                    c && (e = c);
                    return ""
                });
                return d + a.replace(b, c) + e
            }

            function A(a, b) {
                var c;
                1 < a.length && (c = new CKEDITOR.dom.documentFragment(b.getDocument()));
                for (var d = 0; d < a.length; d++) {
                    var e = a[d],
                        e = e.replace(/(\r\n|\r)/g, "\n"),
                        e = y(e, /^[ \t]*\n/, ""),
                        e = y(e, /\n$/, ""),
                        e = y(e, /^[ \t]+|[ \t]+$/g, function(a, b) {
                            return 1 == a.length ? "&nbsp;" : b ? " " + CKEDITOR.tools.repeat("&nbsp;", a.length - 1) : CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " "
                        }),
                        e = e.replace(/\n/g, "<br>"),
                        e = e.replace(/[ \t]{2,}/g, function(a) {
                            return CKEDITOR.tools.repeat("&nbsp;", a.length - 1) + " "
                        });
                    if (c) {
                        var f = b.clone();
                        f.setHtml(e);
                        c.append(f)
                    } else b.setHtml(e)
                }
                return c || b
            }

            function t(a, b) {
                var c = this._.definition,
                    d = c.attributes,
                    c = c.styles,
                    e = h(this)[a.getName()],
                    f = CKEDITOR.tools.isEmpty(d) && CKEDITOR.tools.isEmpty(c),
                    g;
                for (g in d)
                    if ("class" != g && !this._.definition.fullMatch || a.getAttribute(g) == n(g, d[g])) b && "data-" == g.slice(0, 5) || (f = a.hasAttribute(g), a.removeAttribute(g));
                for (var k in c) this._.definition.fullMatch && a.getStyle(k) != n(k, c[k], !0) || (f = f || !!a.getStyle(k), a.removeStyle(k));
                p(a, e, z[a.getName()]);
                f && (this._.definition.alwaysRemoveElement ? x(a, 1) : !CKEDITOR.dtd.$block[a.getName()] || this._.enterMode == CKEDITOR.ENTER_BR && !a.hasAttributes() ? x(a) : a.renameNode(this._.enterMode == CKEDITOR.ENTER_P ? "p" : "div"))
            }

            function D(a) {
                for (var b = h(this), c = a.getElementsByTag(this.element), d, e = c.count(); 0 <= --e;) d = c.getItem(e), d.isReadOnly() || t.call(this, d, !0);
                for (var f in b)
                    if (f != this.element)
                        for (c = a.getElementsByTag(f), e = c.count() - 1; 0 <= e; e--) d = c.getItem(e), d.isReadOnly() || p(d, b[f])
            }

            function p(a, b, c) {
                if (b = b && b.attributes)
                    for (var d = 0; d < b.length; d++) {
                        var e = b[d][0],
                            f;
                        if (f = a.getAttribute(e)) {
                            var g = b[d][1];
                            (null === g || g.test && g.test(f) || "string" == typeof g && f == g) && a.removeAttribute(e)
                        }
                    }
                c || x(a)
            }

            function x(a, b) {
                if (!a.hasAttributes() || b)
                    if (CKEDITOR.dtd.$block[a.getName()]) {
                        var c = a.getPrevious(R),
                            d = a.getNext(R);
                        !c || c.type != CKEDITOR.NODE_TEXT && c.isBlockBoundary({
                            br: 1
                        }) || a.append("br", 1);
                        !d || d.type != CKEDITOR.NODE_TEXT && d.isBlockBoundary({
                            br: 1
                        }) || a.append("br");
                        a.remove(!0)
                    } else c = a.getFirst(), d = a.getLast(), a.remove(!0), c && (c.type == CKEDITOR.NODE_ELEMENT && c.mergeSiblings(), d && !c.equals(d) && d.type == CKEDITOR.NODE_ELEMENT && d.mergeSiblings())
            }

            function G(a, b, c) {
                var d;
                d = a.element;
                "*" == d && (d = "span");
                d = new CKEDITOR.dom.element(d, b);
                c && c.copyAttributes(d);
                d = u(d, a);
                b.getCustomData("doc_processing_style") && d.hasAttribute("id") ? d.removeAttribute("id") : b.setCustomData("doc_processing_style", 1);
                return d
            }

            function u(a, b) {
                var c = b._.definition,
                    d = c.attributes,
                    c = CKEDITOR.style.getStyleText(c);
                if (d)
                    for (var e in d) a.setAttribute(e, d[e]);
                c && a.setAttribute("style", c);
                return a
            }

            function r(a, b) {
                for (var c in a) a[c] = a[c].replace(C, function(a, c) {
                    return b[c]
                })
            }

            function h(a) {
                if (a._.overrides) return a._.overrides;
                var b = a._.overrides = {},
                    c = a._.definition.overrides;
                if (c) {
                    CKEDITOR.tools.isArray(c) || (c = [c]);
                    for (var d = 0; d < c.length; d++) {
                        var e = c[d],
                            f, g;
                        "string" == typeof e ? f = e.toLowerCase() : (f = e.element ? e.element.toLowerCase() : a.element, g = e.attributes);
                        e = b[f] || (b[f] = {});
                        if (g) {
                            var e = e.attributes = e.attributes || [],
                                h;
                            for (h in g) e.push([h.toLowerCase(), g[h]])
                        }
                    }
                }
                return b
            }

            function n(a, b, c) {
                var d = new CKEDITOR.dom.element("span");
                d[c ? "setStyle" : "setAttribute"](a, b);
                return d[c ? "getStyle" : "getAttribute"](a)
            }

            function m(a, b, c) {
                var d = a.document,
                    e = a.getRanges();
                b = b ? this.removeFromRange : this.applyToRange;
                for (var f, g = e.createIterator(); f = g.getNextRange();) b.call(this, f, c);
                a.selectRanges(e);
                d.removeCustomData("doc_processing_style")
            }
            var z = {
                    address: 1,
                    div: 1,
                    h1: 1,
                    h2: 1,
                    h3: 1,
                    h4: 1,
                    h5: 1,
                    h6: 1,
                    p: 1,
                    pre: 1,
                    section: 1,
                    header: 1,
                    footer: 1,
                    nav: 1,
                    article: 1,
                    aside: 1,
                    figure: 1,
                    dialog: 1,
                    hgroup: 1,
                    time: 1,
                    meter: 1,
                    menu: 1,
                    command: 1,
                    keygen: 1,
                    output: 1,
                    progress: 1,
                    details: 1,
                    datagrid: 1,
                    datalist: 1
                },
                B = {
                    a: 1,
                    blockquote: 1,
                    embed: 1,
                    hr: 1,
                    img: 1,
                    li: 1,
                    object: 1,
                    ol: 1,
                    table: 1,
                    td: 1,
                    tr: 1,
                    th: 1,
                    ul: 1,
                    dl: 1,
                    dt: 1,
                    dd: 1,
                    form: 1,
                    audio: 1,
                    video: 1
                },
                E = /\s*(?:;\s*|$)/,
                C = /#\((.+?)\)/g,
                H = CKEDITOR.dom.walker.bookmark(0, 1),
                R = CKEDITOR.dom.walker.whitespaces(1);
            CKEDITOR.style = function(a, b) {
                if ("string" == typeof a.type) return new CKEDITOR.style.customHandlers[a.type](a);
                var c = a.attributes;
                c && c.style && (a.styles = CKEDITOR.tools.extend({}, a.styles, CKEDITOR.tools.parseCssText(c.style)), delete c.style);
                b && (a = CKEDITOR.tools.clone(a), r(a.attributes, b), r(a.styles, b));
                c = this.element = a.element ? "string" == typeof a.element ? a.element.toLowerCase() : a.element : "*";
                this.type = a.type || (z[c] ? CKEDITOR.STYLE_BLOCK : B[c] ? CKEDITOR.STYLE_OBJECT : CKEDITOR.STYLE_INLINE);
                "object" == typeof this.element && (this.type = CKEDITOR.STYLE_OBJECT);
                this._ = {
                    definition: a
                }
            };
            CKEDITOR.style.prototype = {
                apply: function(a) {
                    if (a instanceof CKEDITOR.dom.document) return m.call(this, a.getSelection());
                    if (this.checkApplicable(a.elementPath(), a)) {
                        var b = this._.enterMode;
                        b || (this._.enterMode = a.activeEnterMode);
                        m.call(this, a.getSelection(), 0, a);
                        this._.enterMode = b
                    }
                },
                remove: function(a) {
                    if (a instanceof CKEDITOR.dom.document) return m.call(this, a.getSelection(), 1);
                    if (this.checkApplicable(a.elementPath(), a)) {
                        var b = this._.enterMode;
                        b || (this._.enterMode = a.activeEnterMode);
                        m.call(this, a.getSelection(), 1, a);
                        this._.enterMode = b
                    }
                },
                applyToRange: function(a) {
                    this.applyToRange = this.type == CKEDITOR.STYLE_INLINE ? b : this.type == CKEDITOR.STYLE_BLOCK ? k : this.type == CKEDITOR.STYLE_OBJECT ? g : null;
                    return this.applyToRange(a)
                },
                removeFromRange: function(a) {
                    this.removeFromRange = this.type == CKEDITOR.STYLE_INLINE ? c : this.type == CKEDITOR.STYLE_BLOCK ? q : this.type == CKEDITOR.STYLE_OBJECT ? l : null;
                    return this.removeFromRange(a)
                },
                applyToObject: function(a) {
                    u(a, this)
                },
                checkActive: function(a, b) {
                    switch (this.type) {
                        case CKEDITOR.STYLE_BLOCK:
                            return this.checkElementRemovable(a.block || a.blockLimit, !0, b);
                        case CKEDITOR.STYLE_OBJECT:
                        case CKEDITOR.STYLE_INLINE:
                            for (var c = a.elements, d = 0, e; d < c.length; d++)
                                if (e = c[d], this.type != CKEDITOR.STYLE_INLINE || e != a.block && e != a.blockLimit) {
                                    if (this.type == CKEDITOR.STYLE_OBJECT) {
                                        var f = e.getName();
                                        if (!("string" == typeof this.element ? f == this.element : f in this.element)) continue
                                    }
                                    if (this.checkElementRemovable(e, !0, b)) return !0
                                }
                    }
                    return !1
                },
                checkApplicable: function(a, b, c) {
                    b && b instanceof CKEDITOR.filter && (c = b);
                    if (c && !c.check(this)) return !1;
                    switch (this.type) {
                        case CKEDITOR.STYLE_OBJECT:
                            return !!a.contains(this.element);
                        case CKEDITOR.STYLE_BLOCK:
                            return !!a.blockLimit.getDtd()[this.element]
                    }
                    return !0
                },
                checkElementMatch: function(a, b) {
                    var c = this._.definition;
                    if (!a || !c.ignoreReadonly && a.isReadOnly()) return !1;
                    var d = a.getName();
                    if ("string" == typeof this.element ? d == this.element : d in this.element) {
                        if (!b && !a.hasAttributes()) return !0;
                        if (d = c._AC) c = d;
                        else {
                            var d = {},
                                e = 0,
                                f = c.attributes;
                            if (f)
                                for (var g in f) e++, d[g] = f[g];
                            if (g = CKEDITOR.style.getStyleText(c)) d.style || e++, d.style = g;
                            d._length = e;
                            c = c._AC = d
                        }
                        if (c._length) {
                            for (var h in c)
                                if ("_length" != h) {
                                    e = a.getAttribute(h) || "";
                                    if ("style" == h) a: {
                                        d = c[h];
                                        "string" == typeof d && (d = CKEDITOR.tools.parseCssText(d));
                                        "string" == typeof e && (e = CKEDITOR.tools.parseCssText(e, !0));g = void 0;
                                        for (g in d)
                                            if (!(g in e) || e[g] != d[g] && "inherit" != d[g] && "inherit" != e[g]) {
                                                d = !1;
                                                break a
                                            }
                                        d = !0
                                    }
                                    else d = c[h] == e;
                                    if (d) {
                                        if (!b) return !0
                                    } else if (b) return !1
                                }
                            if (b) return !0
                        } else return !0
                    }
                    return !1
                },
                checkElementRemovable: function(a, b, c) {
                    if (this.checkElementMatch(a, b, c)) return !0;
                    if (b = h(this)[a.getName()]) {
                        var d;
                        if (!(b = b.attributes)) return !0;
                        for (c = 0; c < b.length; c++)
                            if (d = b[c][0], d = a.getAttribute(d)) {
                                var e = b[c][1];
                                if (null === e) return !0;
                                if ("string" == typeof e) {
                                    if (d == e) return !0
                                } else if (e.test(d)) return !0
                            }
                    }
                    return !1
                },
                buildPreview: function(a) {
                    var b = this._.definition,
                        c = [],
                        d = b.element;
                    "bdo" == d && (d = "span");
                    var c = ["<", d],
                        e = b.attributes;
                    if (e)
                        for (var f in e) c.push(" ", f, '="', e[f], '"');
                    (e = CKEDITOR.style.getStyleText(b)) && c.push(' style="', e, '"');
                    c.push(">", a || b.name, "</", d, ">");
                    return c.join("")
                },
                getDefinition: function() {
                    return this._.definition
                }
            };
            CKEDITOR.style.getStyleText = function(a) {
                var b = a._ST;
                if (b) return b;
                var b = a.styles,
                    c = a.attributes && a.attributes.style || "",
                    d = "";
                c.length && (c = c.replace(E, ";"));
                for (var e in b) {
                    var f = b[e],
                        g = (e + ":" + f).replace(E, ";");
                    "inherit" == f ? d += g : c += g
                }
                c.length && (c = CKEDITOR.tools.normalizeCssText(c, !0));
                return a._ST = c + d
            };
            CKEDITOR.style.customHandlers = {};
            CKEDITOR.style.addCustomHandler = function(a) {
                var b = function(a) {
                    this._ = {
                        definition: a
                    };
                    this.setup && this.setup(a)
                };
                b.prototype = CKEDITOR.tools.extend(CKEDITOR.tools.prototypedCopy(CKEDITOR.style.prototype), {
                    assignedTo: CKEDITOR.STYLE_OBJECT
                }, a, !0);
                return this.customHandlers[a.type] = b
            };
            var T = CKEDITOR.POSITION_PRECEDING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED,
                Q = CKEDITOR.POSITION_FOLLOWING | CKEDITOR.POSITION_IDENTICAL | CKEDITOR.POSITION_IS_CONTAINED
        })();
        CKEDITOR.styleCommand = function(a, d) {
            this.requiredContent = this.allowedContent = this.style = a;
            CKEDITOR.tools.extend(this, d, !0)
        };
        CKEDITOR.styleCommand.prototype.exec = function(a) {
            a.focus();
            this.state == CKEDITOR.TRISTATE_OFF ? a.applyStyle(this.style) : this.state == CKEDITOR.TRISTATE_ON && a.removeStyle(this.style)
        };
        CKEDITOR.stylesSet = new CKEDITOR.resourceManager("", "stylesSet");
        CKEDITOR.addStylesSet = CKEDITOR.tools.bind(CKEDITOR.stylesSet.add, CKEDITOR.stylesSet);
        CKEDITOR.loadStylesSet = function(a, d, b) {
            CKEDITOR.stylesSet.addExternal(a, d, "");
            CKEDITOR.stylesSet.load(a, b)
        };
        CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
            attachStyleStateChange: function(a, d) {
                var b = this._.styleStateChangeCallbacks;
                b || (b = this._.styleStateChangeCallbacks = [], this.on("selectionChange", function(a) {
                    for (var d = 0; d < b.length; d++) {
                        var g = b[d],
                            l = g.style.checkActive(a.data.path, this) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF;
                        g.fn.call(this, l)
                    }
                }));
                b.push({
                    style: a,
                    fn: d
                })
            },
            applyStyle: function(a) {
                a.apply(this)
            },
            removeStyle: function(a) {
                a.remove(this)
            },
            getStylesSet: function(a) {
                if (this._.stylesDefinitions) a(this._.stylesDefinitions);
                else {
                    var d = this,
                        b = d.config.stylesCombo_stylesSet || d.config.stylesSet;
                    if (!1 === b) a(null);
                    else if (b instanceof Array) d._.stylesDefinitions = b, a(b);
                    else {
                        b || (b = "default");
                        var b = b.split(":"),
                            c = b[0];
                        CKEDITOR.stylesSet.addExternal(c, b[1] ? b.slice(1).join(":") : CKEDITOR.getUrl("styles.js"), "");
                        CKEDITOR.stylesSet.load(c, function(b) {
                            d._.stylesDefinitions = b[c];
                            a(d._.stylesDefinitions)
                        })
                    }
                }
            }
        });
        CKEDITOR.dom.comment = function(a, d) {
            "string" == typeof a && (a = (d ? d.$ : document).createComment(a));
            CKEDITOR.dom.domObject.call(this, a)
        };
        CKEDITOR.dom.comment.prototype = new CKEDITOR.dom.node;
        CKEDITOR.tools.extend(CKEDITOR.dom.comment.prototype, {
            type: CKEDITOR.NODE_COMMENT,
            getOuterHtml: function() {
                return "<!--" + this.$.nodeValue + "-->"
            }
        });
        "use strict";
        (function() {
            var a = {},
                d = {},
                b;
            for (b in CKEDITOR.dtd.$blockLimit) b in CKEDITOR.dtd.$list || (a[b] = 1);
            for (b in CKEDITOR.dtd.$block) b in CKEDITOR.dtd.$blockLimit || b in CKEDITOR.dtd.$empty || (d[b] = 1);
            CKEDITOR.dom.elementPath = function(b, e) {
                var g = null,
                    l = null,
                    k = [],
                    q = b,
                    w;
                e = e || b.getDocument().getBody();
                do
                    if (q.type == CKEDITOR.NODE_ELEMENT) {
                        k.push(q);
                        if (!this.lastElement && (this.lastElement = q, q.is(CKEDITOR.dtd.$object) || "false" == q.getAttribute("contenteditable"))) continue;
                        if (q.equals(e)) break;
                        if (!l && (w = q.getName(), "true" == q.getAttribute("contenteditable") ? l = q : !g && d[w] && (g = q), a[w])) {
                            if (w = !g && "div" == w) {
                                a: {
                                    w = q.getChildren();
                                    for (var f = 0, y = w.count(); f < y; f++) {
                                        var A = w.getItem(f);
                                        if (A.type == CKEDITOR.NODE_ELEMENT && CKEDITOR.dtd.$block[A.getName()]) {
                                            w = !0;
                                            break a
                                        }
                                    }
                                    w = !1
                                }
                                w = !w
                            }
                            w ? g = q : l = q
                        }
                    }
                while (q = q.getParent());
                l || (l = e);
                this.block = g;
                this.blockLimit = l;
                this.root = e;
                this.elements = k
            }
        })();
        CKEDITOR.dom.elementPath.prototype = {
            compare: function(a) {
                var d = this.elements;
                a = a && a.elements;
                if (!a || d.length != a.length) return !1;
                for (var b = 0; b < d.length; b++)
                    if (!d[b].equals(a[b])) return !1;
                return !0
            },
            contains: function(a, d, b) {
                var c;
                "string" == typeof a && (c = function(b) {
                    return b.getName() == a
                });
                a instanceof CKEDITOR.dom.element ? c = function(b) {
                    return b.equals(a)
                } : CKEDITOR.tools.isArray(a) ? c = function(b) {
                    return -1 < CKEDITOR.tools.indexOf(a, b.getName())
                } : "function" == typeof a ? c = a : "object" == typeof a && (c = function(b) {
                    return b.getName() in a
                });
                var e = this.elements,
                    g = e.length;
                d && g--;
                b && (e = Array.prototype.slice.call(e, 0), e.reverse());
                for (d = 0; d < g; d++)
                    if (c(e[d])) return e[d];
                return null
            },
            isContextFor: function(a) {
                var d;
                return a in CKEDITOR.dtd.$block ? (d = this.contains(CKEDITOR.dtd.$intermediate) || this.root.equals(this.block) && this.block || this.blockLimit, !!d.getDtd()[a]) : !0
            },
            direction: function() {
                return (this.block || this.blockLimit || this.root).getDirection(1)
            }
        };
        CKEDITOR.dom.text = function(a, d) {
            "string" == typeof a && (a = (d ? d.$ : document).createTextNode(a));
            this.$ = a
        };
        CKEDITOR.dom.text.prototype = new CKEDITOR.dom.node;
        CKEDITOR.tools.extend(CKEDITOR.dom.text.prototype, {
            type: CKEDITOR.NODE_TEXT,
            getLength: function() {
                return this.$.nodeValue.length
            },
            getText: function() {
                return this.$.nodeValue
            },
            setText: function(a) {
                this.$.nodeValue = a
            },
            split: function(a) {
                var d = this.$.parentNode,
                    b = d.childNodes.length,
                    c = this.getLength(),
                    e = this.getDocument(),
                    g = new CKEDITOR.dom.text(this.$.splitText(a), e);
                d.childNodes.length == b && (a >= c ? (g = e.createText(""), g.insertAfter(this)) : (a = e.createText(""), a.insertAfter(g), a.remove()));
                return g
            },
            substring: function(a, d) {
                return "number" != typeof d ? this.$.nodeValue.substr(a) : this.$.nodeValue.substring(a, d)
            }
        });
        (function() {
            function a(a, c, d) {
                var g = a.serializable,
                    l = c[d ? "endContainer" : "startContainer"],
                    k = d ? "endOffset" : "startOffset",
                    q = g ? c.document.getById(a.startNode) : a.startNode;
                a = g ? c.document.getById(a.endNode) : a.endNode;
                l.equals(q.getPrevious()) ? (c.startOffset = c.startOffset - l.getLength() - a.getPrevious().getLength(), l = a.getNext()) : l.equals(a.getPrevious()) && (c.startOffset -= l.getLength(), l = a.getNext());
                l.equals(q.getParent()) && c[k]++;
                l.equals(a.getParent()) && c[k]++;
                c[d ? "endContainer" : "startContainer"] = l;
                return c
            }
            CKEDITOR.dom.rangeList = function(a) {
                if (a instanceof CKEDITOR.dom.rangeList) return a;
                a ? a instanceof CKEDITOR.dom.range && (a = [a]) : a = [];
                return CKEDITOR.tools.extend(a, d)
            };
            var d = {
                createIterator: function() {
                    var a = this,
                        c = CKEDITOR.dom.walker.bookmark(),
                        d = [],
                        g;
                    return {
                        getNextRange: function(l) {
                            g = void 0 === g ? 0 : g + 1;
                            var k = a[g];
                            if (k && 1 < a.length) {
                                if (!g)
                                    for (var q = a.length - 1; 0 <= q; q--) d.unshift(a[q].createBookmark(!0));
                                if (l)
                                    for (var w = 0; a[g + w + 1];) {
                                        var f = k.document;
                                        l = 0;
                                        q = f.getById(d[w].endNode);
                                        for (f = f.getById(d[w + 1].startNode);;) {
                                            q = q.getNextSourceNode(!1);
                                            if (f.equals(q)) l = 1;
                                            else if (c(q) || q.type == CKEDITOR.NODE_ELEMENT && q.isBlockBoundary()) continue;
                                            break
                                        }
                                        if (!l) break;
                                        w++
                                    }
                                for (k.moveToBookmark(d.shift()); w--;) q = a[++g], q.moveToBookmark(d.shift()), k.setEnd(q.endContainer, q.endOffset)
                            }
                            return k
                        }
                    }
                },
                createBookmarks: function(b) {
                    for (var c = [], d, g = 0; g < this.length; g++) {
                        c.push(d = this[g].createBookmark(b, !0));
                        for (var l = g + 1; l < this.length; l++) this[l] = a(d, this[l]), this[l] = a(d, this[l], !0)
                    }
                    return c
                },
                createBookmarks2: function(a) {
                    for (var c = [], d = 0; d < this.length; d++) c.push(this[d].createBookmark2(a));
                    return c
                },
                moveToBookmarks: function(a) {
                    for (var c = 0; c < this.length; c++) this[c].moveToBookmark(a[c])
                }
            }
        })();
        (function() {
            function a() {
                return CKEDITOR.getUrl(CKEDITOR.skinName.split(",")[1] || "skins/" + CKEDITOR.skinName.split(",")[0] + "/")
            }

            function d(b) {
                var c = CKEDITOR.skin["ua_" + b],
                    d = CKEDITOR.env;
                if (c)
                    for (var c = c.split(",").sort(function(a, b) {
                            return a > b ? -1 : 1
                        }), e = 0, g; e < c.length; e++)
                        if (g = c[e], d.ie && (g.replace(/^ie/, "") == d.version || d.quirks && "iequirks" == g) && (g = "ie"), d[g]) {
                            b += "_" + c[e];
                            break
                        }
                return CKEDITOR.getUrl(a() + b + ".css")
            }

            function b(a, b) {
                g[a] || (CKEDITOR.document.appendStyleSheet(d(a)), g[a] = 1);
                b && b()
            }

            function c(a) {
                var b = a.getById(l);
                b || (b = a.getHead().append("style"), b.setAttribute("id", l), b.setAttribute("type", "text/css"));
                return b
            }

            function e(a, b, c) {
                var d, e, g;
                if (CKEDITOR.env.webkit)
                    for (b = b.split("}").slice(0, -1), e = 0; e < b.length; e++) b[e] = b[e].split("{");
                for (var k = 0; k < a.length; k++)
                    if (CKEDITOR.env.webkit)
                        for (e = 0; e < b.length; e++) {
                            g = b[e][1];
                            for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
                            a[k].$.sheet.addRule(b[e][0], g)
                        } else {
                            g = b;
                            for (d = 0; d < c.length; d++) g = g.replace(c[d][0], c[d][1]);
                            CKEDITOR.env.ie && 11 > CKEDITOR.env.version ? a[k].$.styleSheet.cssText += g : a[k].$.innerHTML += g
                        }
            }
            var g = {};
            CKEDITOR.skin = {
                path: a,
                loadPart: function(c, d) {
                    CKEDITOR.skin.name != CKEDITOR.skinName.split(",")[0] ? CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(a() + "skin.js"), function() {
                        b(c, d)
                    }) : b(c, d)
                },
                getPath: function(a) {
                    return CKEDITOR.getUrl(d(a))
                },
                icons: {},
                addIcon: function(a, b, c, d) {
                    a = a.toLowerCase();
                    this.icons[a] || (this.icons[a] = {
                        path: b,
                        offset: c || 0,
                        bgsize: d || "16px"
                    })
                },
                getIconStyle: function(a, b, c, d, e) {
                    var g;
                    a && (a = a.toLowerCase(), b && (g = this.icons[a + "-rtl"]), g || (g = this.icons[a]));
                    a = c || g && g.path || "";
                    d = d || g && g.offset;
                    e = e || g && g.bgsize || "16px";
                    a && (a = a.replace(/'/g, "\\'"));
                    return a && "background-image:url('" + CKEDITOR.getUrl(a) + "');background-position:0 " + d + "px;background-size:" + e + ";"
                }
            };
            CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
                getUiColor: function() {
                    return this.uiColor
                },
                setUiColor: function(a) {
                    var b = c(CKEDITOR.document);
                    return (this.setUiColor = function(a) {
                        this.uiColor = a;
                        var c = CKEDITOR.skin.chameleon,
                            d = "",
                            g = "";
                        "function" == typeof c && (d = c(this, "editor"), g = c(this, "panel"));
                        a = [
                            [q, a]
                        ];
                        e([b], d, a);
                        e(k, g, a)
                    }).call(this, a)
                }
            });
            var l = "cke_ui_color",
                k = [],
                q = /\$color/g;
            CKEDITOR.on("instanceLoaded", function(a) {
                if (!CKEDITOR.env.ie || !CKEDITOR.env.quirks) {
                    var b = a.editor;
                    a = function(a) {
                        a = (a.data[0] || a.data).element.getElementsByTag("iframe").getItem(0).getFrameDocument();
                        if (!a.getById("cke_ui_color")) {
                            a = c(a);
                            k.push(a);
                            var d = b.getUiColor();
                            d && e([a], CKEDITOR.skin.chameleon(b, "panel"), [
                                [q, d]
                            ])
                        }
                    };
                    b.on("panelShow", a);
                    b.on("menuShow", a);
                    b.config.uiColor && b.setUiColor(b.config.uiColor)
                }
            })
        })();
        (function() {
            if (CKEDITOR.env.webkit) CKEDITOR.env.hc = !1;
            else {
                var a = CKEDITOR.dom.element.createFromHtml('<div style="width:0;height:0;position:absolute;left:-10000px;border:1px solid;border-color:red blue"></div>', CKEDITOR.document);
                a.appendTo(CKEDITOR.document.getHead());
                try {
                    var d = a.getComputedStyle("border-top-color"),
                        b = a.getComputedStyle("border-right-color");
                    CKEDITOR.env.hc = !(!d || d != b)
                } catch (c) {
                    CKEDITOR.env.hc = !1
                }
                a.remove()
            }
            CKEDITOR.env.hc && (CKEDITOR.env.cssClass += " cke_hc");
            CKEDITOR.document.appendStyleText(".cke{visibility:hidden;}");
            CKEDITOR.status = "loaded";
            CKEDITOR.fireOnce("loaded");
            if (a = CKEDITOR._.pending)
                for (delete CKEDITOR._.pending, d = 0; d < a.length; d++) CKEDITOR.editor.prototype.constructor.apply(a[d][0], a[d][1]), CKEDITOR.add(a[d][0])
        })();
        CKEDITOR.skin.name = "moono";
        CKEDITOR.skin.ua_editor = "ie,iequirks,ie7,ie8,gecko";
        CKEDITOR.skin.ua_dialog = "ie,iequirks,ie7,ie8";
        CKEDITOR.skin.chameleon = function() {
            var b = function() {
                    return function(b, e) {
                        for (var a = b.match(/[^#]./g), c = 0; 3 > c; c++) {
                            var f = c,
                                d;
                            d = parseInt(a[c], 16);
                            d = ("0" + (0 > e ? 0 | d * (1 + e) : 0 | d + (255 - d) * e).toString(16)).slice(-2);
                            a[f] = d
                        }
                        return "#" + a.join("")
                    }
                }(),
                c = function() {
                    var b = new CKEDITOR.template("background:#{to};background-image:linear-gradient(to bottom,{from},{to});filter:progid:DXImageTransform.Microsoft.gradient(gradientType=0,startColorstr='{from}',endColorstr='{to}');");
                    return function(c, a) {
                        return b.output({
                            from: c,
                            to: a
                        })
                    }
                }(),
                f = {
                    editor: new CKEDITOR.template("{id}.cke_chrome [border-color:{defaultBorder};] {id} .cke_top [ {defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_bottom [{defaultGradient}border-top-color:{defaultBorder};] {id} .cke_resizer [border-right-color:{ckeResizer}] {id} .cke_dialog_title [{defaultGradient}border-bottom-color:{defaultBorder};] {id} .cke_dialog_footer [{defaultGradient}outline-color:{defaultBorder};border-top-color:{defaultBorder};] {id} .cke_dialog_tab [{lightGradient}border-color:{defaultBorder};] {id} .cke_dialog_tab:hover [{mediumGradient}] {id} .cke_dialog_contents [border-top-color:{defaultBorder};] {id} .cke_dialog_tab_selected, {id} .cke_dialog_tab_selected:hover [background:{dialogTabSelected};border-bottom-color:{dialogTabSelectedBorder};] {id} .cke_dialog_body [background:{dialogBody};border-color:{defaultBorder};] {id} .cke_toolgroup [{lightGradient}border-color:{defaultBorder};] {id} a.cke_button_off:hover, {id} a.cke_button_off:focus, {id} a.cke_button_off:active [{mediumGradient}] {id} .cke_button_on [{ckeButtonOn}] {id} .cke_toolbar_separator [background-color: {ckeToolbarSeparator};] {id} .cke_combo_button [border-color:{defaultBorder};{lightGradient}] {id} a.cke_combo_button:hover, {id} a.cke_combo_button:focus, {id} .cke_combo_on a.cke_combo_button [border-color:{defaultBorder};{mediumGradient}] {id} .cke_path_item [color:{elementsPathColor};] {id} a.cke_path_item:hover, {id} a.cke_path_item:focus, {id} a.cke_path_item:active [background-color:{elementsPathBg};] {id}.cke_panel [border-color:{defaultBorder};] "),
                    panel: new CKEDITOR.template(".cke_panel_grouptitle [{lightGradient}border-color:{defaultBorder};] .cke_menubutton_icon [background-color:{menubuttonIcon};] .cke_menubutton:hover .cke_menubutton_icon, .cke_menubutton:focus .cke_menubutton_icon, .cke_menubutton:active .cke_menubutton_icon [background-color:{menubuttonIconHover};] .cke_menuseparator [background-color:{menubuttonIcon};] a:hover.cke_colorbox, a:focus.cke_colorbox, a:active.cke_colorbox [border-color:{defaultBorder};] a:hover.cke_colorauto, a:hover.cke_colormore, a:focus.cke_colorauto, a:focus.cke_colormore, a:active.cke_colorauto, a:active.cke_colormore [background-color:{ckeColorauto};border-color:{defaultBorder};] ")
                };
            return function(g, e) {
                var a = g.uiColor,
                    a = {
                        id: "." + g.id,
                        defaultBorder: b(a, -.1),
                        defaultGradient: c(b(a, .9), a),
                        lightGradient: c(b(a, 1), b(a, .7)),
                        mediumGradient: c(b(a, .8), b(a, .5)),
                        ckeButtonOn: c(b(a, .6), b(a, .7)),
                        ckeResizer: b(a, -.4),
                        ckeToolbarSeparator: b(a, .5),
                        ckeColorauto: b(a, .8),
                        dialogBody: b(a, .7),
                        dialogTabSelected: c("#FFFFFF", "#FFFFFF"),
                        dialogTabSelectedBorder: "#FFF",
                        elementsPathColor: b(a, -.6),
                        elementsPathBg: a,
                        menubuttonIcon: b(a, .5),
                        menubuttonIconHover: b(a, .3)
                    };
                return f[e].output(a).replace(/\[/g, "{").replace(/\]/g, "}")
            }
        }();
        CKEDITOR.plugins.add("dialogui", {
            onLoad: function() {
                var h = function(b) {
                        this._ || (this._ = {});
                        this._["default"] = this._.initValue = b["default"] || "";
                        this._.required = b.required || !1;
                        for (var a = [this._], d = 1; d < arguments.length; d++) a.push(arguments[d]);
                        a.push(!0);
                        CKEDITOR.tools.extend.apply(CKEDITOR.tools, a);
                        return this._
                    },
                    v = {
                        build: function(b, a, d) {
                            return new CKEDITOR.ui.dialog.textInput(b, a, d)
                        }
                    },
                    n = {
                        build: function(b, a, d) {
                            return new CKEDITOR.ui.dialog[a.type](b, a, d)
                        }
                    },
                    q = {
                        isChanged: function() {
                            return this.getValue() != this.getInitValue()
                        },
                        reset: function(b) {
                            this.setValue(this.getInitValue(), b)
                        },
                        setInitValue: function() {
                            this._.initValue = this.getValue()
                        },
                        resetInitValue: function() {
                            this._.initValue = this._["default"]
                        },
                        getInitValue: function() {
                            return this._.initValue
                        }
                    },
                    r = CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
                        onChange: function(b, a) {
                            this._.domOnChangeRegistered || (b.on("load", function() {
                                this.getInputElement().on("change", function() {
                                    b.parts.dialog.isVisible() && this.fire("change", {
                                        value: this.getValue()
                                    })
                                }, this)
                            }, this), this._.domOnChangeRegistered = !0);
                            this.on("change", a)
                        }
                    }, !0),
                    x = /^on([A-Z]\w+)/,
                    t = function(b) {
                        for (var a in b)(x.test(a) || "title" == a || "type" == a) && delete b[a];
                        return b
                    },
                    w = function(b) {
                        b = b.data.getKeystroke();
                        b == CKEDITOR.SHIFT + CKEDITOR.ALT + 36 ? this.setDirectionMarker("ltr") : b == CKEDITOR.SHIFT + CKEDITOR.ALT + 35 && this.setDirectionMarker("rtl")
                    };
                CKEDITOR.tools.extend(CKEDITOR.ui.dialog, {
                    labeledElement: function(b, a, d, f) {
                        if (!(4 > arguments.length)) {
                            var c = h.call(this, a);
                            c.labelId = CKEDITOR.tools.getNextId() + "_label";
                            this._.children = [];
                            var e = {
                                role: a.role || "presentation"
                            };
                            a.includeLabel && (e["aria-labelledby"] = c.labelId);
                            CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "div", null, e, function() {
                                var e = [],
                                    g = a.required ? " cke_required" : "";
                                "horizontal" != a.labelLayout ? e.push('<label class="cke_dialog_ui_labeled_label' + g + '" ', ' id="' + c.labelId + '"', c.inputId ? ' for="' + c.inputId + '"' : "", (a.labelStyle ? ' style="' + a.labelStyle + '"' : "") + ">", a.label, "</label>", '<div class="cke_dialog_ui_labeled_content"', a.controlStyle ? ' style="' + a.controlStyle + '"' : "", ' role="presentation">', f.call(this, b, a), "</div>") : (g = {
                                    type: "hbox",
                                    widths: a.widths,
                                    padding: 0,
                                    children: [{
                                        type: "html",
                                        html: '<label class="cke_dialog_ui_labeled_label' + g + '" id="' + c.labelId + '" for="' + c.inputId + '"' + (a.labelStyle ? ' style="' + a.labelStyle + '"' : "") + ">" + CKEDITOR.tools.htmlEncode(a.label) + "</label>"
                                    }, {
                                        type: "html",
                                        html: '<span class="cke_dialog_ui_labeled_content"' + (a.controlStyle ? ' style="' + a.controlStyle + '"' : "") + ">" + f.call(this, b, a) + "</span>"
                                    }]
                                }, CKEDITOR.dialog._.uiElementBuilders.hbox.build(b, g, e));
                                return e.join("")
                            })
                        }
                    },
                    textInput: function(b, a, d) {
                        if (!(3 > arguments.length)) {
                            h.call(this, a);
                            var f = this._.inputId = CKEDITOR.tools.getNextId() + "_textInput",
                                c = {
                                    "class": "cke_dialog_ui_input_" + a.type,
                                    id: f,
                                    type: a.type
                                };
                            a.validate && (this.validate = a.validate);
                            a.maxLength && (c.maxlength = a.maxLength);
                            a.size && (c.size = a.size);
                            a.inputStyle && (c.style = a.inputStyle);
                            var e = this,
                                m = !1;
                            b.on("load", function() {
                                e.getInputElement().on("keydown", function(a) {
                                    13 == a.data.getKeystroke() && (m = !0)
                                });
                                e.getInputElement().on("keyup", function(a) {
                                    13 == a.data.getKeystroke() && m && (b.getButton("ok") && setTimeout(function() {
                                        b.getButton("ok").click()
                                    }, 0), m = !1);
                                    e.bidi && w.call(e, a)
                                }, null, null, 1e3)
                            });
                            CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
                                var b = ['<div class="cke_dialog_ui_input_', a.type, '" role="presentation"'];
                                a.width && b.push('style="width:' + a.width + '" ');
                                b.push("><input ");
                                c["aria-labelledby"] = this._.labelId;
                                this._.required && (c["aria-required"] = this._.required);
                                for (var e in c) b.push(e + '="' + c[e] + '" ');
                                b.push(" /></div>");
                                return b.join("")
                            })
                        }
                    },
                    textarea: function(b, a, d) {
                        if (!(3 > arguments.length)) {
                            h.call(this, a);
                            var f = this,
                                c = this._.inputId = CKEDITOR.tools.getNextId() + "_textarea",
                                e = {};
                            a.validate && (this.validate = a.validate);
                            e.rows = a.rows || 5;
                            e.cols = a.cols || 20;
                            e["class"] = "cke_dialog_ui_input_textarea " + (a["class"] || "");
                            "undefined" != typeof a.inputStyle && (e.style = a.inputStyle);
                            a.dir && (e.dir = a.dir);
                            if (f.bidi) b.on("load", function() {
                                f.getInputElement().on("keyup", w)
                            }, f);
                            CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
                                e["aria-labelledby"] = this._.labelId;
                                this._.required && (e["aria-required"] = this._.required);
                                var a = ['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea id="', c, '" '],
                                    b;
                                for (b in e) a.push(b + '="' + CKEDITOR.tools.htmlEncode(e[b]) + '" ');
                                a.push(">", CKEDITOR.tools.htmlEncode(f._["default"]), "</textarea></div>");
                                return a.join("")
                            })
                        }
                    },
                    checkbox: function(b, a, d) {
                        if (!(3 > arguments.length)) {
                            var f = h.call(this, a, {
                                "default": !!a["default"]
                            });
                            a.validate && (this.validate = a.validate);
                            CKEDITOR.ui.dialog.uiElement.call(this, b, a, d, "span", null, null, function() {
                                var c = CKEDITOR.tools.extend({}, a, {
                                        id: a.id ? a.id + "_checkbox" : CKEDITOR.tools.getNextId() + "_checkbox"
                                    }, !0),
                                    e = [],
                                    d = CKEDITOR.tools.getNextId() + "_label",
                                    g = {
                                        "class": "cke_dialog_ui_checkbox_input",
                                        type: "checkbox",
                                        "aria-labelledby": d
                                    };
                                t(c);
                                a["default"] && (g.checked = "checked");
                                "undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
                                f.checkbox = new CKEDITOR.ui.dialog.uiElement(b, c, e, "input", null, g);
                                e.push(' <label id="', d, '" for="', g.id, '"' + (a.labelStyle ? ' style="' + a.labelStyle + '"' : "") + ">", CKEDITOR.tools.htmlEncode(a.label), "</label>");
                                return e.join("")
                            })
                        }
                    },
                    radio: function(b, a, d) {
                        if (!(3 > arguments.length)) {
                            h.call(this, a);
                            this._["default"] || (this._["default"] = this._.initValue = a.items[0][1]);
                            a.validate && (this.validate = a.validate);
                            var f = [],
                                c = this;
                            a.role = "radiogroup";
                            a.includeLabel = !0;
                            CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
                                for (var e = [], d = [], g = (a.id ? a.id : CKEDITOR.tools.getNextId()) + "_radio", k = 0; k < a.items.length; k++) {
                                    var l = a.items[k],
                                        h = void 0 !== l[2] ? l[2] : l[0],
                                        n = void 0 !== l[1] ? l[1] : l[0],
                                        p = CKEDITOR.tools.getNextId() + "_radio_input",
                                        q = p + "_label",
                                        p = CKEDITOR.tools.extend({}, a, {
                                            id: p,
                                            title: null,
                                            type: null
                                        }, !0),
                                        h = CKEDITOR.tools.extend({}, p, {
                                            title: h
                                        }, !0),
                                        r = {
                                            type: "radio",
                                            "class": "cke_dialog_ui_radio_input",
                                            name: g,
                                            value: n,
                                            "aria-labelledby": q
                                        },
                                        u = [];
                                    c._["default"] == n && (r.checked = "checked");
                                    t(p);
                                    t(h);
                                    "undefined" != typeof p.inputStyle && (p.style = p.inputStyle);
                                    p.keyboardFocusable = !0;
                                    f.push(new CKEDITOR.ui.dialog.uiElement(b, p, u, "input", null, r));
                                    u.push(" ");
                                    new CKEDITOR.ui.dialog.uiElement(b, h, u, "label", null, {
                                        id: q,
                                        "for": r.id
                                    }, l[0]);
                                    e.push(u.join(""))
                                }
                                new CKEDITOR.ui.dialog.hbox(b, f, e, d);
                                return d.join("")
                            });
                            this._.children = f
                        }
                    },
                    button: function(b, a, d) {
                        if (arguments.length) {
                            "function" == typeof a && (a = a(b.getParentEditor()));
                            h.call(this, a, {
                                disabled: a.disabled || !1
                            });
                            CKEDITOR.event.implementOn(this);
                            var f = this;
                            b.on("load", function() {
                                var a = this.getElement();
                                (function() {
                                    a.on("click", function(a) {
                                        f.click();
                                        a.data.preventDefault()
                                    });
                                    a.on("keydown", function(a) {
                                        a.data.getKeystroke() in {
                                            32: 1
                                        } && (f.click(), a.data.preventDefault())
                                    })
                                })();
                                a.unselectable()
                            }, this);
                            var c = CKEDITOR.tools.extend({}, a);
                            delete c.style;
                            var e = CKEDITOR.tools.getNextId() + "_label";
                            CKEDITOR.ui.dialog.uiElement.call(this, b, c, d, "a", null, {
                                style: a.style,
                                href: "javascript:void(0)",
                                title: a.label,
                                hidefocus: "true",
                                "class": a["class"],
                                role: "button",
                                "aria-labelledby": e
                            }, '<span id="' + e + '" class="cke_dialog_ui_button">' + CKEDITOR.tools.htmlEncode(a.label) + "</span>")
                        }
                    },
                    select: function(b, a, d) {
                        if (!(3 > arguments.length)) {
                            var f = h.call(this, a);
                            a.validate && (this.validate = a.validate);
                            f.inputId = CKEDITOR.tools.getNextId() + "_select";
                            CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
                                var c = CKEDITOR.tools.extend({}, a, {
                                        id: a.id ? a.id + "_select" : CKEDITOR.tools.getNextId() + "_select"
                                    }, !0),
                                    e = [],
                                    d = [],
                                    g = {
                                        id: f.inputId,
                                        "class": "cke_dialog_ui_input_select",
                                        "aria-labelledby": this._.labelId
                                    };
                                e.push('<div class="cke_dialog_ui_input_', a.type, '" role="presentation"');
                                a.width && e.push('style="width:' + a.width + '" ');
                                e.push(">");
                                void 0 !== a.size && (g.size = a.size);
                                void 0 !== a.multiple && (g.multiple = a.multiple);
                                t(c);
                                for (var k = 0, l; k < a.items.length && (l = a.items[k]); k++) d.push('<option value="', CKEDITOR.tools.htmlEncode(void 0 !== l[1] ? l[1] : l[0]).replace(/"/g, "&quot;"), '" /> ', CKEDITOR.tools.htmlEncode(l[0]));
                                "undefined" != typeof c.inputStyle && (c.style = c.inputStyle);
                                f.select = new CKEDITOR.ui.dialog.uiElement(b, c, e, "select", null, g, d.join(""));
                                e.push("</div>");
                                return e.join("")
                            })
                        }
                    },
                    file: function(b, a, d) {
                        if (!(3 > arguments.length)) {
                            void 0 === a["default"] && (a["default"] = "");
                            var f = CKEDITOR.tools.extend(h.call(this, a), {
                                definition: a,
                                buttons: []
                            });
                            a.validate && (this.validate = a.validate);
                            b.on("load", function() {
                                CKEDITOR.document.getById(f.frameId).getParent().addClass("cke_dialog_ui_input_file")
                            });
                            CKEDITOR.ui.dialog.labeledElement.call(this, b, a, d, function() {
                                f.frameId = CKEDITOR.tools.getNextId() + "_fileInput";
                                var b = ['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" role="presentation" id="', f.frameId, '" title="', a.label, '" src="javascript:void('];
                                b.push(CKEDITOR.env.ie ? "(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "})()" : "0");
                                b.push(')"></iframe>');
                                return b.join("")
                            })
                        }
                    },
                    fileButton: function(b, a, d) {
                        var f = this;
                        if (!(3 > arguments.length)) {
                            h.call(this, a);
                            a.validate && (this.validate = a.validate);
                            var c = CKEDITOR.tools.extend({}, a),
                                e = c.onClick;
                            c.className = (c.className ? c.className + " " : "") + "cke_dialog_ui_button";
                            c.onClick = function(c) {
                                var d = a["for"];
                                e && !1 === e.call(this, c) || (b.getContentElement(d[0], d[1]).submit(), this.disable())
                            };
                            b.on("load", function() {
                                b.getContentElement(a["for"][0], a["for"][1])._.buttons.push(f)
                            });
                            CKEDITOR.ui.dialog.button.call(this, b, c, d)
                        }
                    },
                    html: function() {
                        var b = /^\s*<[\w:]+\s+([^>]*)?>/,
                            a = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
                            d = /\/$/;
                        return function(f, c, e) {
                            if (!(3 > arguments.length)) {
                                var m = [],
                                    g = c.html;
                                "<" != g.charAt(0) && (g = "<span>" + g + "</span>");
                                var k = c.focus;
                                if (k) {
                                    var l = this.focus;
                                    this.focus = function() {
                                        ("function" == typeof k ? k : l).call(this);
                                        this.fire("focus")
                                    };
                                    c.isFocusable && (this.isFocusable = this.isFocusable);
                                    this.keyboardFocusable = !0
                                }
                                CKEDITOR.ui.dialog.uiElement.call(this, f, c, m, "span", null, null, "");
                                m = m.join("").match(b);
                                g = g.match(a) || ["", "", ""];
                                d.test(g[1]) && (g[1] = g[1].slice(0, -1), g[2] = "/" + g[2]);
                                e.push([g[1], " ", m[1] || "", g[2]].join(""))
                            }
                        }
                    }(),
                    fieldset: function(b, a, d, f, c) {
                        var e = c.label;
                        this._ = {
                            children: a
                        };
                        CKEDITOR.ui.dialog.uiElement.call(this, b, c, f, "fieldset", null, null, function() {
                            var a = [];
                            e && a.push("<legend" + (c.labelStyle ? ' style="' + c.labelStyle + '"' : "") + ">" + e + "</legend>");
                            for (var b = 0; b < d.length; b++) a.push(d[b]);
                            return a.join("")
                        })
                    }
                }, !0);
                CKEDITOR.ui.dialog.html.prototype = new CKEDITOR.ui.dialog.uiElement;
                CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
                    setLabel: function(b) {
                        var a = CKEDITOR.document.getById(this._.labelId);
                        1 > a.getChildCount() ? new CKEDITOR.dom.text(b, CKEDITOR.document).appendTo(a) : a.getChild(0).$.nodeValue = b;
                        return this
                    },
                    getLabel: function() {
                        var b = CKEDITOR.document.getById(this._.labelId);
                        return !b || 1 > b.getChildCount() ? "" : b.getChild(0).getText()
                    },
                    eventProcessors: r
                }, !0);
                CKEDITOR.ui.dialog.button.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
                    click: function() {
                        return this._.disabled ? !1 : this.fire("click", {
                            dialog: this._.dialog
                        })
                    },
                    enable: function() {
                        this._.disabled = !1;
                        var b = this.getElement();
                        b && b.removeClass("cke_disabled")
                    },
                    disable: function() {
                        this._.disabled = !0;
                        this.getElement().addClass("cke_disabled")
                    },
                    isVisible: function() {
                        return this.getElement().getFirst().isVisible()
                    },
                    isEnabled: function() {
                        return !this._.disabled
                    },
                    eventProcessors: CKEDITOR.tools.extend({}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors, {
                        onClick: function(b, a) {
                            this.on("click", function() {
                                a.apply(this, arguments)
                            })
                        }
                    }, !0),
                    accessKeyUp: function() {
                        this.click()
                    },
                    accessKeyDown: function() {
                        this.focus()
                    },
                    keyboardFocusable: !0
                }, !0);
                CKEDITOR.ui.dialog.textInput.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
                    getInputElement: function() {
                        return CKEDITOR.document.getById(this._.inputId)
                    },
                    focus: function() {
                        var b = this.selectParentTab();
                        setTimeout(function() {
                            var a = b.getInputElement();
                            a && a.$.focus()
                        }, 0)
                    },
                    select: function() {
                        var b = this.selectParentTab();
                        setTimeout(function() {
                            var a = b.getInputElement();
                            a && (a.$.focus(), a.$.select())
                        }, 0)
                    },
                    accessKeyUp: function() {
                        this.select()
                    },
                    setValue: function(b) {
                        if (this.bidi) {
                            var a = b && b.charAt(0);
                            (a = "‪" == a ? "ltr" : "‫" == a ? "rtl" : null) && (b = b.slice(1));
                            this.setDirectionMarker(a)
                        }
                        b || (b = "");
                        return CKEDITOR.ui.dialog.uiElement.prototype.setValue.apply(this, arguments)
                    },
                    getValue: function() {
                        var b = CKEDITOR.ui.dialog.uiElement.prototype.getValue.call(this);
                        if (this.bidi && b) {
                            var a = this.getDirectionMarker();
                            a && (b = ("ltr" == a ? "‪" : "‫") + b)
                        }
                        return b
                    },
                    setDirectionMarker: function(b) {
                        var a = this.getInputElement();
                        b ? a.setAttributes({
                            dir: b,
                            "data-cke-dir-marker": b
                        }) : this.getDirectionMarker() && a.removeAttributes(["dir", "data-cke-dir-marker"])
                    },
                    getDirectionMarker: function() {
                        return this.getInputElement().data("cke-dir-marker")
                    },
                    keyboardFocusable: !0
                }, q, !0);
                CKEDITOR.ui.dialog.textarea.prototype = new CKEDITOR.ui.dialog.textInput;
                CKEDITOR.ui.dialog.select.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, {
                    getInputElement: function() {
                        return this._.select.getElement()
                    },
                    add: function(b, a, d) {
                        var f = new CKEDITOR.dom.element("option", this.getDialog().getParentEditor().document),
                            c = this.getInputElement().$;
                        f.$.text = b;
                        f.$.value = void 0 === a || null === a ? b : a;
                        void 0 === d || null === d ? CKEDITOR.env.ie ? c.add(f.$) : c.add(f.$, null) : c.add(f.$, d);
                        return this
                    },
                    remove: function(b) {
                        this.getInputElement().$.remove(b);
                        return this
                    },
                    clear: function() {
                        for (var b = this.getInputElement().$; 0 < b.length;) b.remove(0);
                        return this
                    },
                    keyboardFocusable: !0
                }, q, !0);
                CKEDITOR.ui.dialog.checkbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
                    getInputElement: function() {
                        return this._.checkbox.getElement()
                    },
                    setValue: function(b, a) {
                        this.getInputElement().$.checked = b;
                        !a && this.fire("change", {
                            value: b
                        })
                    },
                    getValue: function() {
                        return this.getInputElement().$.checked
                    },
                    accessKeyUp: function() {
                        this.setValue(!this.getValue())
                    },
                    eventProcessors: {
                        onChange: function(b, a) {
                            if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return r.onChange.apply(this, arguments);
                            b.on("load", function() {
                                var a = this._.checkbox.getElement();
                                a.on("propertychange", function(b) {
                                    b = b.data.$;
                                    "checked" == b.propertyName && this.fire("change", {
                                        value: a.$.checked
                                    })
                                }, this)
                            }, this);
                            this.on("change", a);
                            return null
                        }
                    },
                    keyboardFocusable: !0
                }, q, !0);
                CKEDITOR.ui.dialog.radio.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
                    setValue: function(b, a) {
                        for (var d = this._.children, f, c = 0; c < d.length && (f = d[c]); c++) f.getElement().$.checked = f.getValue() == b;
                        !a && this.fire("change", {
                            value: b
                        })
                    },
                    getValue: function() {
                        for (var b = this._.children, a = 0; a < b.length; a++)
                            if (b[a].getElement().$.checked) return b[a].getValue();
                        return null
                    },
                    accessKeyUp: function() {
                        var b = this._.children,
                            a;
                        for (a = 0; a < b.length; a++)
                            if (b[a].getElement().$.checked) {
                                b[a].getElement().focus();
                                return
                            }
                        b[0].getElement().focus()
                    },
                    eventProcessors: {
                        onChange: function(b, a) {
                            if (!CKEDITOR.env.ie || 8 < CKEDITOR.env.version) return r.onChange.apply(this, arguments);
                            b.on("load", function() {
                                for (var a = this._.children, b = this, c = 0; c < a.length; c++) a[c].getElement().on("propertychange", function(a) {
                                    a = a.data.$;
                                    "checked" == a.propertyName && this.$.checked && b.fire("change", {
                                        value: this.getAttribute("value")
                                    })
                                })
                            }, this);
                            this.on("change", a);
                            return null
                        }
                    }
                }, q, !0);
                CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.labeledElement, q, {
                    getInputElement: function() {
                        var b = CKEDITOR.document.getById(this._.frameId).getFrameDocument();
                        return 0 < b.$.forms.length ? new CKEDITOR.dom.element(b.$.forms[0].elements[0]) : this.getElement()
                    },
                    submit: function() {
                        this.getInputElement().getParent().$.submit();
                        return this
                    },
                    getAction: function() {
                        return this.getInputElement().getParent().$.action
                    },
                    registerEvents: function(b) {
                        var a = /^on([A-Z]\w+)/,
                            d, f = function(a, b, c, d) {
                                a.on("formLoaded", function() {
                                    a.getInputElement().on(c, d, a)
                                })
                            },
                            c;
                        for (c in b)
                            if (d = c.match(a)) this.eventProcessors[c] ? this.eventProcessors[c].call(this, this._.dialog, b[c]) : f(this, this._.dialog, d[1].toLowerCase(), b[c]);
                        return this
                    },
                    reset: function() {
                        function b() {
                            d.$.open();
                            var b = "";
                            f.size && (b = f.size - (CKEDITOR.env.ie ? 7 : 0));
                            var h = a.frameId + "_input";
                            d.$.write(['<html dir="' + g + '" lang="' + k + '"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">', '<form enctype="multipart/form-data" method="POST" dir="' + g + '" lang="' + k + '" action="', CKEDITOR.tools.htmlEncode(f.action), '"><label id="', a.labelId, '" for="', h, '" style="display:none">', CKEDITOR.tools.htmlEncode(f.label), '</label><input style="width:100%" id="', h, '" aria-labelledby="', a.labelId, '" type="file" name="', CKEDITOR.tools.htmlEncode(f.id || "cke_upload"), '" size="', CKEDITOR.tools.htmlEncode(0 < b ? b : ""), '" /></form></body></html><script>', CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "", "window.parent.CKEDITOR.tools.callFunction(" + e + ");", "window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction(" + m + ")}", "</script>"].join(""));
                            d.$.close();
                            for (b = 0; b < c.length; b++) c[b].enable()
                        }
                        var a = this._,
                            d = CKEDITOR.document.getById(a.frameId).getFrameDocument(),
                            f = a.definition,
                            c = a.buttons,
                            e = this.formLoadedNumber,
                            m = this.formUnloadNumber,
                            g = a.dialog._.editor.lang.dir,
                            k = a.dialog._.editor.langCode;
                        e || (e = this.formLoadedNumber = CKEDITOR.tools.addFunction(function() {
                            this.fire("formLoaded")
                        }, this), m = this.formUnloadNumber = CKEDITOR.tools.addFunction(function() {
                            this.getInputElement().clearCustomData()
                        }, this), this.getDialog()._.editor.on("destroy", function() {
                            CKEDITOR.tools.removeFunction(e);
                            CKEDITOR.tools.removeFunction(m)
                        }));
                        CKEDITOR.env.gecko ? setTimeout(b, 500) : b()
                    },
                    getValue: function() {
                        return this.getInputElement().$.value || ""
                    },
                    setInitValue: function() {
                        this._.initValue = ""
                    },
                    eventProcessors: {
                        onChange: function(b, a) {
                            this._.domOnChangeRegistered || (this.on("formLoaded", function() {
                                this.getInputElement().on("change", function() {
                                    this.fire("change", {
                                        value: this.getValue()
                                    })
                                }, this)
                            }, this), this._.domOnChangeRegistered = !0);
                            this.on("change", a)
                        }
                    },
                    keyboardFocusable: !0
                }, !0);
                CKEDITOR.ui.dialog.fileButton.prototype = new CKEDITOR.ui.dialog.button;
                CKEDITOR.ui.dialog.fieldset.prototype = CKEDITOR.tools.clone(CKEDITOR.ui.dialog.hbox.prototype);
                CKEDITOR.dialog.addUIElement("text", v);
                CKEDITOR.dialog.addUIElement("password", v);
                CKEDITOR.dialog.addUIElement("textarea", n);
                CKEDITOR.dialog.addUIElement("checkbox", n);
                CKEDITOR.dialog.addUIElement("radio", n);
                CKEDITOR.dialog.addUIElement("button", n);
                CKEDITOR.dialog.addUIElement("select", n);
                CKEDITOR.dialog.addUIElement("file", n);
                CKEDITOR.dialog.addUIElement("fileButton", n);
                CKEDITOR.dialog.addUIElement("html", n);
                CKEDITOR.dialog.addUIElement("fieldset", {
                    build: function(b, a, d) {
                        for (var f = a.children, c, e = [], h = [], g = 0; g < f.length && (c = f[g]); g++) {
                            var k = [];
                            e.push(k);
                            h.push(CKEDITOR.dialog._.uiElementBuilders[c.type].build(b, c, k))
                        }
                        return new CKEDITOR.ui.dialog[a.type](b, h, e, d, a)
                    }
                })
            }
        });
        CKEDITOR.DIALOG_RESIZE_NONE = 0;
        CKEDITOR.DIALOG_RESIZE_WIDTH = 1;
        CKEDITOR.DIALOG_RESIZE_HEIGHT = 2;
        CKEDITOR.DIALOG_RESIZE_BOTH = 3;
        CKEDITOR.DIALOG_STATE_IDLE = 1;
        CKEDITOR.DIALOG_STATE_BUSY = 2;
        (function() {
            function x() {
                for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId) + a, c = b - 1; c > b - a; c--)
                    if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
                return null
            }

            function A() {
                for (var a = this._.tabIdList.length, b = CKEDITOR.tools.indexOf(this._.tabIdList, this._.currentTabId), c = b + 1; c < b + a; c++)
                    if (this._.tabs[this._.tabIdList[c % a]][0].$.offsetHeight) return this._.tabIdList[c % a];
                return null
            }

            function K(a, b) {
                for (var c = a.$.getElementsByTagName("input"), d = 0, e = c.length; d < e; d++) {
                    var f = new CKEDITOR.dom.element(c[d]);
                    "text" == f.getAttribute("type").toLowerCase() && (b ? (f.setAttribute("value", f.getCustomData("fake_value") || ""), f.removeCustomData("fake_value")) : (f.setCustomData("fake_value", f.getAttribute("value")), f.setAttribute("value", "")))
                }
            }

            function T(a, b) {
                var c = this.getInputElement();
                c && (a ? c.removeAttribute("aria-invalid") : c.setAttribute("aria-invalid", !0));
                a || (this.select ? this.select() : this.focus());
                b && alert(b);
                this.fire("validated", {
                    valid: a,
                    msg: b
                })
            }

            function U() {
                var a = this.getInputElement();
                a && a.removeAttribute("aria-invalid")
            }

            function V(a) {
                var b = CKEDITOR.dom.element.createFromHtml(CKEDITOR.addTemplate("dialog", W).output({
                        id: CKEDITOR.tools.getNextNumber(),
                        editorId: a.id,
                        langDir: a.lang.dir,
                        langCode: a.langCode,
                        editorDialogClass: "cke_editor_" + a.name.replace(/\./g, "\\.") + "_dialog",
                        closeTitle: a.lang.common.close,
                        hidpi: CKEDITOR.env.hidpi ? "cke_hidpi" : ""
                    })),
                    c = b.getChild([0, 0, 0, 0, 0]),
                    d = c.getChild(0),
                    e = c.getChild(1);
                a.plugins.clipboard && CKEDITOR.plugins.clipboard.preventDefaultDropOnElement(c);
                !CKEDITOR.env.ie || CKEDITOR.env.quirks || CKEDITOR.env.edge || (a = "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())", CKEDITOR.dom.element.createFromHtml('<iframe frameBorder="0" class="cke_iframe_shim" src="' + a + '" tabIndex="-1"></iframe>').appendTo(c.getParent()));
                d.unselectable();
                e.unselectable();
                return {
                    element: b,
                    parts: {
                        dialog: b.getChild(0),
                        title: d,
                        close: e,
                        tabs: c.getChild(2),
                        contents: c.getChild([3, 0, 0, 0]),
                        footer: c.getChild([3, 0, 1, 0])
                    }
                }
            }

            function L(a, b, c) {
                this.element = b;
                this.focusIndex = c;
                this.tabIndex = 0;
                this.isFocusable = function() {
                    return !b.getAttribute("disabled") && b.isVisible()
                };
                this.focus = function() {
                    a._.currentFocusIndex = this.focusIndex;
                    this.element.focus()
                };
                b.on("keydown", function(a) {
                    a.data.getKeystroke() in {
                        32: 1,
                        13: 1
                    } && this.fire("click")
                });
                b.on("focus", function() {
                    this.fire("mouseover")
                });
                b.on("blur", function() {
                    this.fire("mouseout")
                })
            }

            function X(a) {
                function b() {
                    a.layout()
                }
                var c = CKEDITOR.document.getWindow();
                c.on("resize", b);
                a.on("hide", function() {
                    c.removeListener("resize", b)
                })
            }

            function M(a, b) {
                this._ = {
                    dialog: a
                };
                CKEDITOR.tools.extend(this, b)
            }

            function Y(a) {
                function b(b) {
                    var c = a.getSize(),
                        k = CKEDITOR.document.getWindow().getViewPaneSize(),
                        q = b.data.$.screenX,
                        n = b.data.$.screenY,
                        r = q - d.x,
                        l = n - d.y;
                    d = {
                        x: q,
                        y: n
                    };
                    e.x += r;
                    e.y += l;
                    a.move(e.x + h[3] < g ? -h[3] : e.x - h[1] > k.width - c.width - g ? k.width - c.width + ("rtl" == f.lang.dir ? 0 : h[1]) : e.x, e.y + h[0] < g ? -h[0] : e.y - h[2] > k.height - c.height - g ? k.height - c.height + h[2] : e.y, 1);
                    b.data.preventDefault()
                }

                function c() {
                    CKEDITOR.document.removeListener("mousemove", b);
                    CKEDITOR.document.removeListener("mouseup", c);
                    if (CKEDITOR.env.ie6Compat) {
                        var a = u.getChild(0).getFrameDocument();
                        a.removeListener("mousemove", b);
                        a.removeListener("mouseup", c)
                    }
                }
                var d = null,
                    e = null,
                    f = a.getParentEditor(),
                    g = f.config.dialog_magnetDistance,
                    h = CKEDITOR.skin.margins || [0, 0, 0, 0];
                "undefined" == typeof g && (g = 20);
                a.parts.title.on("mousedown", function(g) {
                    d = {
                        x: g.data.$.screenX,
                        y: g.data.$.screenY
                    };
                    CKEDITOR.document.on("mousemove", b);
                    CKEDITOR.document.on("mouseup", c);
                    e = a.getPosition();
                    if (CKEDITOR.env.ie6Compat) {
                        var f = u.getChild(0).getFrameDocument();
                        f.on("mousemove", b);
                        f.on("mouseup", c)
                    }
                    g.data.preventDefault()
                }, a)
            }

            function Z(a) {
                function b(b) {
                    var c = "rtl" == f.lang.dir,
                        n = k.width,
                        q = k.height,
                        G = n + (b.data.$.screenX - m.x) * (c ? -1 : 1) * (a._.moved ? 1 : 2),
                        H = q + (b.data.$.screenY - m.y) * (a._.moved ? 1 : 2),
                        B = a._.element.getFirst(),
                        B = c && B.getComputedStyle("right"),
                        C = a.getPosition();
                    C.y + H > p.height && (H = p.height - C.y);
                    (c ? B : C.x) + G > p.width && (G = p.width - (c ? B : C.x));
                    if (e == CKEDITOR.DIALOG_RESIZE_WIDTH || e == CKEDITOR.DIALOG_RESIZE_BOTH) n = Math.max(d.minWidth || 0, G - g);
                    if (e == CKEDITOR.DIALOG_RESIZE_HEIGHT || e == CKEDITOR.DIALOG_RESIZE_BOTH) q = Math.max(d.minHeight || 0, H - h);
                    a.resize(n, q);
                    a._.moved || a.layout();
                    b.data.preventDefault()
                }

                function c() {
                    CKEDITOR.document.removeListener("mouseup", c);
                    CKEDITOR.document.removeListener("mousemove", b);
                    q && (q.remove(), q = null);
                    if (CKEDITOR.env.ie6Compat) {
                        var a = u.getChild(0).getFrameDocument();
                        a.removeListener("mouseup", c);
                        a.removeListener("mousemove", b)
                    }
                }
                var d = a.definition,
                    e = d.resizable;
                if (e != CKEDITOR.DIALOG_RESIZE_NONE) {
                    var f = a.getParentEditor(),
                        g, h, p, m, k, q, n = CKEDITOR.tools.addFunction(function(e) {
                            k = a.getSize();
                            var d = a.parts.contents;
                            d.$.getElementsByTagName("iframe").length && (q = CKEDITOR.dom.element.createFromHtml('<div class="cke_dialog_resize_cover" style="height: 100%; position: absolute; width: 100%;"></div>'), d.append(q));
                            h = k.height - a.parts.contents.getSize("height", !(CKEDITOR.env.gecko || CKEDITOR.env.ie && CKEDITOR.env.quirks));
                            g = k.width - a.parts.contents.getSize("width", 1);
                            m = {
                                x: e.screenX,
                                y: e.screenY
                            };
                            p = CKEDITOR.document.getWindow().getViewPaneSize();
                            CKEDITOR.document.on("mousemove", b);
                            CKEDITOR.document.on("mouseup", c);
                            CKEDITOR.env.ie6Compat && (d = u.getChild(0).getFrameDocument(), d.on("mousemove", b), d.on("mouseup", c));
                            e.preventDefault && e.preventDefault()
                        });
                    a.on("load", function() {
                        var b = "";
                        e == CKEDITOR.DIALOG_RESIZE_WIDTH ? b = " cke_resizer_horizontal" : e == CKEDITOR.DIALOG_RESIZE_HEIGHT && (b = " cke_resizer_vertical");
                        b = CKEDITOR.dom.element.createFromHtml('<div class="cke_resizer' + b + " cke_resizer_" + f.lang.dir + '" title="' + CKEDITOR.tools.htmlEncode(f.lang.common.resize) + '" onmousedown="CKEDITOR.tools.callFunction(' + n + ', event )">' + ("ltr" == f.lang.dir ? "◢" : "◣") + "</div>");
                        a.parts.footer.append(b, 1)
                    });
                    f.on("destroy", function() {
                        CKEDITOR.tools.removeFunction(n)
                    })
                }
            }

            function I(a) {
                a.data.preventDefault(1)
            }

            function N(a) {
                var b = CKEDITOR.document.getWindow(),
                    c = a.config,
                    d = c.dialog_backgroundCoverColor || "white",
                    e = c.dialog_backgroundCoverOpacity,
                    f = c.baseFloatZIndex,
                    c = CKEDITOR.tools.genKey(d, e, f),
                    g = z[c];
                g ? g.show() : (f = ['<div tabIndex="-1" style="position: ', CKEDITOR.env.ie6Compat ? "absolute" : "fixed", "; z-index: ", f, "; top: 0px; left: 0px; ", CKEDITOR.env.ie6Compat ? "" : "background-color: " + d, '" class="cke_dialog_background_cover">'], CKEDITOR.env.ie6Compat && (d = "<html><body style=\\'background-color:" + d + ";\\'></body></html>", f.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:'), f.push("void((function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.write( '" + d + "' );document.close();") + "})())"), f.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')), f.push("</div>"), g = CKEDITOR.dom.element.createFromHtml(f.join("")), g.setOpacity(void 0 !== e ? e : .5), g.on("keydown", I), g.on("keypress", I), g.on("keyup", I), g.appendTo(CKEDITOR.document.getBody()), z[c] = g);
                a.focusManager.add(g);
                u = g;
                a = function() {
                    var a = b.getViewPaneSize();
                    g.setStyles({
                        width: a.width + "px",
                        height: a.height + "px"
                    })
                };
                var h = function() {
                    var a = b.getScrollPosition(),
                        c = CKEDITOR.dialog._.currentTop;
                    g.setStyles({
                        left: a.x + "px",
                        top: a.y + "px"
                    });
                    if (c) {
                        do a = c.getPosition(), c.move(a.x, a.y); while (c = c._.parentDialog)
                    }
                };
                J = a;
                b.on("resize", a);
                a();
                CKEDITOR.env.mac && CKEDITOR.env.webkit || g.focus();
                if (CKEDITOR.env.ie6Compat) {
                    var p = function() {
                        h();
                        arguments.callee.prevScrollHandler.apply(this, arguments)
                    };
                    b.$.setTimeout(function() {
                        p.prevScrollHandler = window.onscroll || function() {};
                        window.onscroll = p
                    }, 0);
                    h()
                }
            }

            function O(a) {
                u && (a.focusManager.remove(u), a = CKEDITOR.document.getWindow(), u.hide(), a.removeListener("resize", J), CKEDITOR.env.ie6Compat && a.$.setTimeout(function() {
                    window.onscroll = window.onscroll && window.onscroll.prevScrollHandler || null
                }, 0), J = null)
            }
            var v = CKEDITOR.tools.cssLength,
                W = '<div class="cke_reset_all {editorId} {editorDialogClass} {hidpi}" dir="{langDir}" lang="{langCode}" role="dialog" aria-labelledby="cke_dialog_title_{id}"><table class="cke_dialog ' + CKEDITOR.env.cssClass + ' cke_{langDir}" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="cke_dialog_body" role="presentation"><div id="cke_dialog_title_{id}" class="cke_dialog_title" role="presentation"></div><a id="cke_dialog_close_button_{id}" class="cke_dialog_close_button" href="javascript:void(0)" title="{closeTitle}" role="button"><span class="cke_label">X</span></a><div id="cke_dialog_tabs_{id}" class="cke_dialog_tabs" role="tablist"></div><table class="cke_dialog_contents" role="presentation"><tr><td id="cke_dialog_contents_{id}" class="cke_dialog_contents_body" role="presentation"></td></tr><tr><td id="cke_dialog_footer_{id}" class="cke_dialog_footer" role="presentation"></td></tr></table></div></td></tr></table></div>';
            CKEDITOR.dialog = function(a, b) {
                function c() {
                    var a = l._.focusList;
                    a.sort(function(a, b) {
                        return a.tabIndex != b.tabIndex ? b.tabIndex - a.tabIndex : a.focusIndex - b.focusIndex
                    });
                    for (var b = a.length, c = 0; c < b; c++) a[c].focusIndex = c
                }

                function d(a) {
                    var b = l._.focusList;
                    a = a || 0;
                    if (!(1 > b.length)) {
                        var c = l._.currentFocusIndex;
                        l._.tabBarMode && 0 > a && (c = 0);
                        try {
                            b[c].getInputElement().$.blur()
                        } catch (e) {}
                        var d = c,
                            g = 1 < l._.pageCount;
                        do {
                            d += a;
                            if (g && !l._.tabBarMode && (d == b.length || -1 == d)) {
                                l._.tabBarMode = !0;
                                l._.tabs[l._.currentTabId][0].focus();
                                l._.currentFocusIndex = -1;
                                return
                            }
                            d = (d + b.length) % b.length;
                            if (d == c) break
                        } while (a && !b[d].isFocusable());
                        b[d].focus();
                        "text" == b[d].type && b[d].select()
                    }
                }

                function e(b) {
                    if (l == CKEDITOR.dialog._.currentTop) {
                        var c = b.data.getKeystroke(),
                            e = "rtl" == a.lang.dir,
                            g = [37, 38, 39, 40];
                        q = n = 0;
                        if (9 == c || c == CKEDITOR.SHIFT + 9) d(c == CKEDITOR.SHIFT + 9 ? -1 : 1), q = 1;
                        else if (c == CKEDITOR.ALT + 121 && !l._.tabBarMode && 1 < l.getPageCount()) l._.tabBarMode = !0, l._.tabs[l._.currentTabId][0].focus(), l._.currentFocusIndex = -1, q = 1;
                        else if (-1 != CKEDITOR.tools.indexOf(g, c) && l._.tabBarMode) c = -1 != CKEDITOR.tools.indexOf([e ? 39 : 37, 38], c) ? x.call(l) : A.call(l), l.selectPage(c), l._.tabs[c][0].focus(), q = 1;
                        else if (13 != c && 32 != c || !l._.tabBarMode)
                            if (13 == c) c = b.data.getTarget(), c.is("a", "button", "select", "textarea") || c.is("input") && "button" == c.$.type || ((c = this.getButton("ok")) && CKEDITOR.tools.setTimeout(c.click, 0, c), q = 1), n = 1;
                            else if (27 == c)(c = this.getButton("cancel")) ? CKEDITOR.tools.setTimeout(c.click, 0, c) : !1 !== this.fire("cancel", {
                            hide: !0
                        }).hide && this.hide(), n = 1;
                        else return;
                        else this.selectPage(this._.currentTabId), this._.tabBarMode = !1, this._.currentFocusIndex = -1, d(1), q = 1;
                        f(b)
                    }
                }

                function f(a) {
                    q ? a.data.preventDefault(1) : n && a.data.stopPropagation()
                }
                var g = CKEDITOR.dialog._.dialogDefinitions[b],
                    h = CKEDITOR.tools.clone(aa),
                    p = a.config.dialog_buttonsOrder || "OS",
                    m = a.lang.dir,
                    k = {},
                    q, n;
                ("OS" == p && CKEDITOR.env.mac || "rtl" == p && "ltr" == m || "ltr" == p && "rtl" == m) && h.buttons.reverse();
                g = CKEDITOR.tools.extend(g(a), h);
                g = CKEDITOR.tools.clone(g);
                g = new P(this, g);
                h = V(a);
                this._ = {
                    editor: a,
                    element: h.element,
                    name: b,
                    contentSize: {
                        width: 0,
                        height: 0
                    },
                    size: {
                        width: 0,
                        height: 0
                    },
                    contents: {},
                    buttons: {},
                    accessKeyMap: {},
                    tabs: {},
                    tabIdList: [],
                    currentTabId: null,
                    currentTabIndex: null,
                    pageCount: 0,
                    lastTab: null,
                    tabBarMode: !1,
                    focusList: [],
                    currentFocusIndex: 0,
                    hasFocus: !1
                };
                this.parts = h.parts;
                CKEDITOR.tools.setTimeout(function() {
                    a.fire("ariaWidget", this.parts.contents)
                }, 0, this);
                h = {
                    position: CKEDITOR.env.ie6Compat ? "absolute" : "fixed",
                    top: 0,
                    visibility: "hidden"
                };
                h["rtl" == m ? "right" : "left"] = 0;
                this.parts.dialog.setStyles(h);
                CKEDITOR.event.call(this);
                this.definition = g = CKEDITOR.fire("dialogDefinition", {
                    name: b,
                    definition: g
                }, a).definition;
                if (!("removeDialogTabs" in a._) && a.config.removeDialogTabs) {
                    h = a.config.removeDialogTabs.split(";");
                    for (m = 0; m < h.length; m++)
                        if (p = h[m].split(":"), 2 == p.length) {
                            var r = p[0];
                            k[r] || (k[r] = []);
                            k[r].push(p[1])
                        }
                    a._.removeDialogTabs = k
                }
                if (a._.removeDialogTabs && (k = a._.removeDialogTabs[b]))
                    for (m = 0; m < k.length; m++) g.removeContents(k[m]);
                if (g.onLoad) this.on("load", g.onLoad);
                if (g.onShow) this.on("show", g.onShow);
                if (g.onHide) this.on("hide", g.onHide);
                if (g.onOk) this.on("ok", function(b) {
                    a.fire("saveSnapshot");
                    setTimeout(function() {
                        a.fire("saveSnapshot")
                    }, 0);
                    !1 === g.onOk.call(this, b) && (b.data.hide = !1)
                });
                this.state = CKEDITOR.DIALOG_STATE_IDLE;
                if (g.onCancel) this.on("cancel", function(a) {
                    !1 === g.onCancel.call(this, a) && (a.data.hide = !1)
                });
                var l = this,
                    t = function(a) {
                        var b = l._.contents,
                            c = !1,
                            d;
                        for (d in b)
                            for (var e in b[d])
                                if (c = a.call(this, b[d][e])) return
                    };
                this.on("ok", function(a) {
                    t(function(b) {
                        if (b.validate) {
                            var c = b.validate(this),
                                d = "string" == typeof c || !1 === c;
                            d && (a.data.hide = !1, a.stop());
                            T.call(b, !d, "string" == typeof c ? c : void 0);
                            return d
                        }
                    })
                }, this, null, 0);
                this.on("cancel", function(b) {
                    t(function(c) {
                        if (c.isChanged()) return a.config.dialog_noConfirmCancel || confirm(a.lang.common.confirmCancel) || (b.data.hide = !1), !0
                    })
                }, this, null, 0);
                this.parts.close.on("click", function(a) {
                    !1 !== this.fire("cancel", {
                        hide: !0
                    }).hide && this.hide();
                    a.data.preventDefault()
                }, this);
                this.changeFocus = d;
                var y = this._.element;
                a.focusManager.add(y, 1);
                this.on("show", function() {
                    y.on("keydown", e, this);
                    if (CKEDITOR.env.gecko) y.on("keypress", f, this)
                });
                this.on("hide", function() {
                    y.removeListener("keydown", e);
                    CKEDITOR.env.gecko && y.removeListener("keypress", f);
                    t(function(a) {
                        U.apply(a)
                    })
                });
                this.on("iframeAdded", function(a) {
                    new CKEDITOR.dom.document(a.data.iframe.$.contentWindow.document).on("keydown", e, this, null, 0)
                });
                this.on("show", function() {
                    c();
                    var b = 1 < l._.pageCount;
                    a.config.dialog_startupFocusTab && b ? (l._.tabBarMode = !0, l._.tabs[l._.currentTabId][0].focus(), l._.currentFocusIndex = -1) : this._.hasFocus || (this._.currentFocusIndex = b ? -1 : this._.focusList.length - 1, g.onFocus ? (b = g.onFocus.call(this)) && b.focus() : d(1))
                }, this, null, 4294967295);
                if (CKEDITOR.env.ie6Compat) this.on("load", function() {
                    var a = this.getElement(),
                        b = a.getFirst();
                    b.remove();
                    b.appendTo(a)
                }, this);
                Y(this);
                Z(this);
                new CKEDITOR.dom.text(g.title, CKEDITOR.document).appendTo(this.parts.title);
                for (m = 0; m < g.contents.length; m++)(k = g.contents[m]) && this.addPage(k);
                this.parts.tabs.on("click", function(a) {
                    var b = a.data.getTarget();
                    b.hasClass("cke_dialog_tab") && (b = b.$.id, this.selectPage(b.substring(4, b.lastIndexOf("_"))), this._.tabBarMode && (this._.tabBarMode = !1, this._.currentFocusIndex = -1, d(1)), a.data.preventDefault())
                }, this);
                m = [];
                k = CKEDITOR.dialog._.uiElementBuilders.hbox.build(this, {
                    type: "hbox",
                    className: "cke_dialog_footer_buttons",
                    widths: [],
                    children: g.buttons
                }, m).getChild();
                this.parts.footer.setHtml(m.join(""));
                for (m = 0; m < k.length; m++) this._.buttons[k[m].id] = k[m]
            };
            CKEDITOR.dialog.prototype = {
                destroy: function() {
                    this.hide();
                    this._.element.remove()
                },
                resize: function() {
                    return function(a, b) {
                        this._.contentSize && this._.contentSize.width == a && this._.contentSize.height == b || (CKEDITOR.dialog.fire("resize", {
                            dialog: this,
                            width: a,
                            height: b
                        }, this._.editor), this.fire("resize", {
                            width: a,
                            height: b
                        }, this._.editor), this.parts.contents.setStyles({
                            width: a + "px",
                            height: b + "px"
                        }), "rtl" == this._.editor.lang.dir && this._.position && (this._.position.x = CKEDITOR.document.getWindow().getViewPaneSize().width - this._.contentSize.width - parseInt(this._.element.getFirst().getStyle("right"), 10)), this._.contentSize = {
                            width: a,
                            height: b
                        })
                    }
                }(),
                getSize: function() {
                    var a = this._.element.getFirst();
                    return {
                        width: a.$.offsetWidth || 0,
                        height: a.$.offsetHeight || 0
                    }
                },
                move: function(a, b, c) {
                    var d = this._.element.getFirst(),
                        e = "rtl" == this._.editor.lang.dir,
                        f = "fixed" == d.getComputedStyle("position");
                    CKEDITOR.env.ie && d.setStyle("zoom", "100%");
                    f && this._.position && this._.position.x == a && this._.position.y == b || (this._.position = {
                        x: a,
                        y: b
                    }, f || (f = CKEDITOR.document.getWindow().getScrollPosition(), a += f.x, b += f.y), e && (f = this.getSize(), a = CKEDITOR.document.getWindow().getViewPaneSize().width - f.width - a), b = {
                        top: (0 < b ? b : 0) + "px"
                    }, b[e ? "right" : "left"] = (0 < a ? a : 0) + "px", d.setStyles(b), c && (this._.moved = 1))
                },
                getPosition: function() {
                    return CKEDITOR.tools.extend({}, this._.position)
                },
                show: function() {
                    var a = this._.element,
                        b = this.definition;
                    a.getParent() && a.getParent().equals(CKEDITOR.document.getBody()) ? a.setStyle("display", "block") : a.appendTo(CKEDITOR.document.getBody());
                    this.resize(this._.contentSize && this._.contentSize.width || b.width || b.minWidth, this._.contentSize && this._.contentSize.height || b.height || b.minHeight);
                    this.reset();
                    this.selectPage(this.definition.contents[0].id);
                    null === CKEDITOR.dialog._.currentZIndex && (CKEDITOR.dialog._.currentZIndex = this._.editor.config.baseFloatZIndex);
                    this._.element.getFirst().setStyle("z-index", CKEDITOR.dialog._.currentZIndex += 10);
                    null === CKEDITOR.dialog._.currentTop ? (CKEDITOR.dialog._.currentTop = this, this._.parentDialog = null, N(this._.editor)) : (this._.parentDialog = CKEDITOR.dialog._.currentTop, this._.parentDialog.getElement().getFirst().$.style.zIndex -= Math.floor(this._.editor.config.baseFloatZIndex / 2), CKEDITOR.dialog._.currentTop = this);
                    a.on("keydown", Q);
                    a.on("keyup", R);
                    this._.hasFocus = !1;
                    for (var c in b.contents)
                        if (b.contents[c]) {
                            var a = b.contents[c],
                                d = this._.tabs[a.id],
                                e = a.requiredContent,
                                f = 0;
                            if (d) {
                                for (var g in this._.contents[a.id]) {
                                    var h = this._.contents[a.id][g];
                                    "hbox" != h.type && "vbox" != h.type && h.getInputElement() && (h.requiredContent && !this._.editor.activeFilter.check(h.requiredContent) ? h.disable() : (h.enable(), f++))
                                }!f || e && !this._.editor.activeFilter.check(e) ? d[0].addClass("cke_dialog_tab_disabled") : d[0].removeClass("cke_dialog_tab_disabled")
                            }
                        }
                    CKEDITOR.tools.setTimeout(function() {
                        this.layout();
                        X(this);
                        this.parts.dialog.setStyle("visibility", "");
                        this.fireOnce("load", {});
                        CKEDITOR.ui.fire("ready", this);
                        this.fire("show", {});
                        this._.editor.fire("dialogShow", this);
                        this._.parentDialog || this._.editor.focusManager.lock();
                        this.foreach(function(a) {
                            a.setInitValue && a.setInitValue()
                        })
                    }, 100, this)
                },
                layout: function() {
                    var a = this.parts.dialog,
                        b = this.getSize(),
                        c = CKEDITOR.document.getWindow().getViewPaneSize(),
                        d = (c.width - b.width) / 2,
                        e = (c.height - b.height) / 2;
                    CKEDITOR.env.ie6Compat || (b.height + (0 < e ? e : 0) > c.height || b.width + (0 < d ? d : 0) > c.width ? a.setStyle("position", "absolute") : a.setStyle("position", "fixed"));
                    this.move(this._.moved ? this._.position.x : d, this._.moved ? this._.position.y : e)
                },
                foreach: function(a) {
                    for (var b in this._.contents)
                        for (var c in this._.contents[b]) a.call(this, this._.contents[b][c]);
                    return this
                },
                reset: function() {
                    var a = function(a) {
                        a.reset && a.reset(1)
                    };
                    return function() {
                        this.foreach(a);
                        return this
                    }
                }(),
                setupContent: function() {
                    var a = arguments;
                    this.foreach(function(b) {
                        b.setup && b.setup.apply(b, a)
                    })
                },
                commitContent: function() {
                    var a = arguments;
                    this.foreach(function(b) {
                        CKEDITOR.env.ie && this._.currentFocusIndex == b.focusIndex && b.getInputElement().$.blur();
                        b.commit && b.commit.apply(b, a)
                    })
                },
                hide: function() {
                    if (this.parts.dialog.isVisible()) {
                        this.fire("hide", {});
                        this._.editor.fire("dialogHide", this);
                        this.selectPage(this._.tabIdList[0]);
                        var a = this._.element;
                        a.setStyle("display", "none");
                        this.parts.dialog.setStyle("visibility", "hidden");
                        for (ba(this); CKEDITOR.dialog._.currentTop != this;) CKEDITOR.dialog._.currentTop.hide();
                        if (this._.parentDialog) {
                            var b = this._.parentDialog.getElement().getFirst();
                            b.setStyle("z-index", parseInt(b.$.style.zIndex, 10) + Math.floor(this._.editor.config.baseFloatZIndex / 2))
                        } else O(this._.editor);
                        if (CKEDITOR.dialog._.currentTop = this._.parentDialog) CKEDITOR.dialog._.currentZIndex -= 10;
                        else {
                            CKEDITOR.dialog._.currentZIndex = null;
                            a.removeListener("keydown", Q);
                            a.removeListener("keyup", R);
                            var c = this._.editor;
                            c.focus();
                            setTimeout(function() {
                                c.focusManager.unlock();
                                CKEDITOR.env.iOS && c.window.focus()
                            }, 0)
                        }
                        delete this._.parentDialog;
                        this.foreach(function(a) {
                            a.resetInitValue && a.resetInitValue()
                        });
                        this.setState(CKEDITOR.DIALOG_STATE_IDLE)
                    }
                },
                addPage: function(a) {
                    if (!a.requiredContent || this._.editor.filter.check(a.requiredContent)) {
                        for (var b = [], c = a.label ? ' title="' + CKEDITOR.tools.htmlEncode(a.label) + '"' : "", d = CKEDITOR.dialog._.uiElementBuilders.vbox.build(this, {
                                type: "vbox",
                                className: "cke_dialog_page_contents",
                                children: a.elements,
                                expand: !!a.expand,
                                padding: a.padding,
                                style: a.style || "width: 100%;"
                            }, b), e = this._.contents[a.id] = {}, f = d.getChild(), g = 0; d = f.shift();) d.notAllowed || "hbox" == d.type || "vbox" == d.type || g++, e[d.id] = d, "function" == typeof d.getChild && f.push.apply(f, d.getChild());
                        g || (a.hidden = !0);
                        b = CKEDITOR.dom.element.createFromHtml(b.join(""));
                        b.setAttribute("role", "tabpanel");
                        d = CKEDITOR.env;
                        e = "cke_" + a.id + "_" + CKEDITOR.tools.getNextNumber();
                        c = CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"', 0 < this._.pageCount ? " cke_last" : "cke_first", c, a.hidden ? ' style="display:none"' : "", ' id="', e, '"', d.gecko && !d.hc ? "" : ' href="javascript:void(0)"', ' tabIndex="-1" hidefocus="true" role="tab">', a.label, "</a>"].join(""));
                        b.setAttribute("aria-labelledby", e);
                        this._.tabs[a.id] = [c, b];
                        this._.tabIdList.push(a.id);
                        !a.hidden && this._.pageCount++;
                        this._.lastTab = c;
                        this.updateStyle();
                        b.setAttribute("name", a.id);
                        b.appendTo(this.parts.contents);
                        c.unselectable();
                        this.parts.tabs.append(c);
                        a.accessKey && (S(this, this, "CTRL+" + a.accessKey, ca, da), this._.accessKeyMap["CTRL+" + a.accessKey] = a.id)
                    }
                },
                selectPage: function(a) {
                    if (this._.currentTabId != a && !this._.tabs[a][0].hasClass("cke_dialog_tab_disabled") && !1 !== this.fire("selectPage", {
                            page: a,
                            currentPage: this._.currentTabId
                        })) {
                        for (var b in this._.tabs) {
                            var c = this._.tabs[b][0],
                                d = this._.tabs[b][1];
                            b != a && (c.removeClass("cke_dialog_tab_selected"), d.hide());
                            d.setAttribute("aria-hidden", b != a)
                        }
                        var e = this._.tabs[a];
                        e[0].addClass("cke_dialog_tab_selected");
                        CKEDITOR.env.ie6Compat || CKEDITOR.env.ie7Compat ? (K(e[1]), e[1].show(), setTimeout(function() {
                            K(e[1], 1)
                        }, 0)) : e[1].show();
                        this._.currentTabId = a;
                        this._.currentTabIndex = CKEDITOR.tools.indexOf(this._.tabIdList, a)
                    }
                },
                updateStyle: function() {
                    this.parts.dialog[(1 === this._.pageCount ? "add" : "remove") + "Class"]("cke_single_page")
                },
                hidePage: function(a) {
                    var b = this._.tabs[a] && this._.tabs[a][0];
                    b && 1 != this._.pageCount && b.isVisible() && (a == this._.currentTabId && this.selectPage(x.call(this)), b.hide(), this._.pageCount--, this.updateStyle())
                },
                showPage: function(a) {
                    if (a = this._.tabs[a] && this._.tabs[a][0]) a.show(), this._.pageCount++, this.updateStyle()
                },
                getElement: function() {
                    return this._.element
                },
                getName: function() {
                    return this._.name
                },
                getContentElement: function(a, b) {
                    var c = this._.contents[a];
                    return c && c[b]
                },
                getValueOf: function(a, b) {
                    return this.getContentElement(a, b).getValue()
                },
                setValueOf: function(a, b, c) {
                    return this.getContentElement(a, b).setValue(c)
                },
                getButton: function(a) {
                    return this._.buttons[a]
                },
                click: function(a) {
                    return this._.buttons[a].click()
                },
                disableButton: function(a) {
                    return this._.buttons[a].disable()
                },
                enableButton: function(a) {
                    return this._.buttons[a].enable()
                },
                getPageCount: function() {
                    return this._.pageCount
                },
                getParentEditor: function() {
                    return this._.editor
                },
                getSelectedElement: function() {
                    return this.getParentEditor().getSelection().getSelectedElement()
                },
                addFocusable: function(a, b) {
                    if ("undefined" == typeof b) b = this._.focusList.length, this._.focusList.push(new L(this, a, b));
                    else {
                        this._.focusList.splice(b, 0, new L(this, a, b));
                        for (var c = b + 1; c < this._.focusList.length; c++) this._.focusList[c].focusIndex++
                    }
                },
                setState: function(a) {
                    if (this.state != a) {
                        this.state = a;
                        if (a == CKEDITOR.DIALOG_STATE_BUSY) {
                            if (!this.parts.spinner) {
                                var b = this.getParentEditor().lang.dir,
                                    c = {
                                        attributes: {
                                            "class": "cke_dialog_spinner"
                                        },
                                        styles: {
                                            "float": "rtl" == b ? "right" : "left"
                                        }
                                    };
                                c.styles["margin-" + ("rtl" == b ? "left" : "right")] = "8px";
                                this.parts.spinner = CKEDITOR.document.createElement("div", c);
                                this.parts.spinner.setHtml("&#8987;");
                                this.parts.spinner.appendTo(this.parts.title, 1)
                            }
                            this.parts.spinner.show();
                            this.getButton("ok").disable()
                        } else a == CKEDITOR.DIALOG_STATE_IDLE && (this.parts.spinner && this.parts.spinner.hide(), this.getButton("ok").enable());
                        this.fire("state", a)
                    }
                }
            };
            CKEDITOR.tools.extend(CKEDITOR.dialog, {
                add: function(a, b) {
                    this._.dialogDefinitions[a] && "function" != typeof b || (this._.dialogDefinitions[a] = b)
                },
                exists: function(a) {
                    return !!this._.dialogDefinitions[a]
                },
                getCurrent: function() {
                    return CKEDITOR.dialog._.currentTop
                },
                isTabEnabled: function(a, b, c) {
                    a = a.config.removeDialogTabs;
                    return !(a && a.match(new RegExp("(?:^|;)" + b + ":" + c + "(?:$|;)", "i")))
                },
                okButton: function() {
                    var a = function(a, c) {
                        c = c || {};
                        return CKEDITOR.tools.extend({
                            id: "ok",
                            type: "button",
                            label: a.lang.common.ok,
                            "class": "cke_dialog_ui_button_ok",
                            onClick: function(a) {
                                a = a.data.dialog;
                                !1 !== a.fire("ok", {
                                    hide: !0
                                }).hide && a.hide()
                            }
                        }, c, !0)
                    };
                    a.type = "button";
                    a.override = function(b) {
                        return CKEDITOR.tools.extend(function(c) {
                            return a(c, b)
                        }, {
                            type: "button"
                        }, !0)
                    };
                    return a
                }(),
                cancelButton: function() {
                    var a = function(a, c) {
                        c = c || {};
                        return CKEDITOR.tools.extend({
                            id: "cancel",
                            type: "button",
                            label: a.lang.common.cancel,
                            "class": "cke_dialog_ui_button_cancel",
                            onClick: function(a) {
                                a = a.data.dialog;
                                !1 !== a.fire("cancel", {
                                    hide: !0
                                }).hide && a.hide()
                            }
                        }, c, !0)
                    };
                    a.type = "button";
                    a.override = function(b) {
                        return CKEDITOR.tools.extend(function(c) {
                            return a(c, b)
                        }, {
                            type: "button"
                        }, !0)
                    };
                    return a
                }(),
                addUIElement: function(a, b) {
                    this._.uiElementBuilders[a] = b
                }
            });
            CKEDITOR.dialog._ = {
                uiElementBuilders: {},
                dialogDefinitions: {},
                currentTop: null,
                currentZIndex: null
            };
            CKEDITOR.event.implementOn(CKEDITOR.dialog);
            CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype);
            var aa = {
                    resizable: CKEDITOR.DIALOG_RESIZE_BOTH,
                    minWidth: 600,
                    minHeight: 400,
                    buttons: [CKEDITOR.dialog.okButton, CKEDITOR.dialog.cancelButton]
                },
                D = function(a, b, c) {
                    for (var d = 0, e; e = a[d]; d++)
                        if (e.id == b || c && e[c] && (e = D(e[c], b, c))) return e;
                    return null
                },
                E = function(a, b, c, d, e) {
                    if (c) {
                        for (var f = 0, g; g = a[f]; f++) {
                            if (g.id == c) return a.splice(f, 0, b), b;
                            if (d && g[d] && (g = E(g[d], b, c, d, !0))) return g
                        }
                        if (e) return null
                    }
                    a.push(b);
                    return b
                },
                F = function(a, b, c) {
                    for (var d = 0, e; e = a[d]; d++) {
                        if (e.id == b) return a.splice(d, 1);
                        if (c && e[c] && (e = F(e[c], b, c))) return e
                    }
                    return null
                },
                P = function(a, b) {
                    this.dialog = a;
                    for (var c = b.contents, d = 0, e; e = c[d]; d++) c[d] = e && new M(a, e);
                    CKEDITOR.tools.extend(this, b)
                };
            P.prototype = {
                getContents: function(a) {
                    return D(this.contents, a)
                },
                getButton: function(a) {
                    return D(this.buttons, a)
                },
                addContents: function(a, b) {
                    return E(this.contents, a, b)
                },
                addButton: function(a, b) {
                    return E(this.buttons, a, b)
                },
                removeContents: function(a) {
                    F(this.contents, a)
                },
                removeButton: function(a) {
                    F(this.buttons, a)
                }
            };
            M.prototype = {
                get: function(a) {
                    return D(this.elements, a, "children")
                },
                add: function(a, b) {
                    return E(this.elements, a, b, "children")
                },
                remove: function(a) {
                    F(this.elements, a, "children")
                }
            };
            var J, z = {},
                u, w = {},
                Q = function(a) {
                    var b = a.data.$.ctrlKey || a.data.$.metaKey,
                        c = a.data.$.altKey,
                        d = a.data.$.shiftKey,
                        e = String.fromCharCode(a.data.$.keyCode);
                    (b = w[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + e]) && b.length && (b = b[b.length - 1], b.keydown && b.keydown.call(b.uiElement, b.dialog, b.key), a.data.preventDefault())
                },
                R = function(a) {
                    var b = a.data.$.ctrlKey || a.data.$.metaKey,
                        c = a.data.$.altKey,
                        d = a.data.$.shiftKey,
                        e = String.fromCharCode(a.data.$.keyCode);
                    (b = w[(b ? "CTRL+" : "") + (c ? "ALT+" : "") + (d ? "SHIFT+" : "") + e]) && b.length && (b = b[b.length - 1], b.keyup && (b.keyup.call(b.uiElement, b.dialog, b.key), a.data.preventDefault()))
                },
                S = function(a, b, c, d, e) {
                    (w[c] || (w[c] = [])).push({
                        uiElement: a,
                        dialog: b,
                        key: c,
                        keyup: e || a.accessKeyUp,
                        keydown: d || a.accessKeyDown
                    })
                },
                ba = function(a) {
                    for (var b in w) {
                        for (var c = w[b], d = c.length - 1; 0 <= d; d--) c[d].dialog != a && c[d].uiElement != a || c.splice(d, 1);
                        0 === c.length && delete w[b]
                    }
                },
                da = function(a, b) {
                    a._.accessKeyMap[b] && a.selectPage(a._.accessKeyMap[b])
                },
                ca = function() {};
            (function() {
                CKEDITOR.ui.dialog = {
                    uiElement: function(a, b, c, d, e, f, g) {
                        if (!(4 > arguments.length)) {
                            var h = (d.call ? d(b) : d) || "div",
                                p = ["<", h, " "],
                                m = (e && e.call ? e(b) : e) || {},
                                k = (f && f.call ? f(b) : f) || {},
                                q = (g && g.call ? g.call(this, a, b) : g) || "",
                                n = this.domId = k.id || CKEDITOR.tools.getNextId() + "_uiElement";
                            b.requiredContent && !a.getParentEditor().filter.check(b.requiredContent) && (m.display = "none", this.notAllowed = !0);
                            k.id = n;
                            var r = {};
                            b.type && (r["cke_dialog_ui_" + b.type] = 1);
                            b.className && (r[b.className] = 1);
                            b.disabled && (r.cke_disabled = 1);
                            for (var l = k["class"] && k["class"].split ? k["class"].split(" ") : [], n = 0; n < l.length; n++) l[n] && (r[l[n]] = 1);
                            l = [];
                            for (n in r) l.push(n);
                            k["class"] = l.join(" ");
                            b.title && (k.title = b.title);
                            r = (b.style || "").split(";");
                            b.align && (l = b.align, m["margin-left"] = "left" == l ? 0 : "auto", m["margin-right"] = "right" == l ? 0 : "auto");
                            for (n in m) r.push(n + ":" + m[n]);
                            b.hidden && r.push("display:none");
                            for (n = r.length - 1; 0 <= n; n--) "" === r[n] && r.splice(n, 1);
                            0 < r.length && (k.style = (k.style ? k.style + "; " : "") + r.join("; "));
                            for (n in k) p.push(n + '="' + CKEDITOR.tools.htmlEncode(k[n]) + '" ');
                            p.push(">", q, "</", h, ">");
                            c.push(p.join(""));
                            (this._ || (this._ = {})).dialog = a;
                            "boolean" == typeof b.isChanged && (this.isChanged = function() {
                                return b.isChanged
                            });
                            "function" == typeof b.isChanged && (this.isChanged = b.isChanged);
                            "function" == typeof b.setValue && (this.setValue = CKEDITOR.tools.override(this.setValue, function(a) {
                                return function(c) {
                                    a.call(this, b.setValue.call(this, c))
                                }
                            }));
                            "function" == typeof b.getValue && (this.getValue = CKEDITOR.tools.override(this.getValue, function(a) {
                                return function() {
                                    return b.getValue.call(this, a.call(this))
                                }
                            }));
                            CKEDITOR.event.implementOn(this);
                            this.registerEvents(b);
                            this.accessKeyUp && this.accessKeyDown && b.accessKey && S(this, a, "CTRL+" + b.accessKey);
                            var t = this;
                            a.on("load", function() {
                                var b = t.getInputElement();
                                if (b) {
                                    var c = t.type in {
                                        checkbox: 1,
                                        ratio: 1
                                    } && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? "cke_dialog_ui_focused" : "";
                                    b.on("focus", function() {
                                        a._.tabBarMode = !1;
                                        a._.hasFocus = !0;
                                        t.fire("focus");
                                        c && this.addClass(c)
                                    });
                                    b.on("blur", function() {
                                        t.fire("blur");
                                        c && this.removeClass(c)
                                    })
                                }
                            });
                            CKEDITOR.tools.extend(this, b);
                            this.keyboardFocusable && (this.tabIndex = b.tabIndex || 0, this.focusIndex = a._.focusList.push(this) - 1, this.on("focus", function() {
                                a._.currentFocusIndex = t.focusIndex
                            }))
                        }
                    },
                    hbox: function(a, b, c, d, e) {
                        if (!(4 > arguments.length)) {
                            this._ || (this._ = {});
                            var f = this._.children = b,
                                g = e && e.widths || null,
                                h = e && e.height || null,
                                p, m = {
                                    role: "presentation"
                                };
                            e && e.align && (m.align = e.align);
                            CKEDITOR.ui.dialog.uiElement.call(this, a, e || {
                                type: "hbox"
                            }, d, "table", {}, m, function() {
                                var a = ['<tbody><tr class="cke_dialog_ui_hbox">'];
                                for (p = 0; p < c.length; p++) {
                                    var b = "cke_dialog_ui_hbox_child",
                                        d = [];
                                    0 === p && (b = "cke_dialog_ui_hbox_first");
                                    p == c.length - 1 && (b = "cke_dialog_ui_hbox_last");
                                    a.push('<td class="', b, '" role="presentation" ');
                                    g ? g[p] && d.push("width:" + v(g[p])) : d.push("width:" + Math.floor(100 / c.length) + "%");
                                    h && d.push("height:" + v(h));
                                    e && void 0 !== e.padding && d.push("padding:" + v(e.padding));
                                    CKEDITOR.env.ie && CKEDITOR.env.quirks && f[p].align && d.push("text-align:" + f[p].align);
                                    0 < d.length && a.push('style="' + d.join("; ") + '" ');
                                    a.push(">", c[p], "</td>")
                                }
                                a.push("</tr></tbody>");
                                return a.join("")
                            })
                        }
                    },
                    vbox: function(a, b, c, d, e) {
                        if (!(3 > arguments.length)) {
                            this._ || (this._ = {});
                            var f = this._.children = b,
                                g = e && e.width || null,
                                h = e && e.heights || null;
                            CKEDITOR.ui.dialog.uiElement.call(this, a, e || {
                                type: "vbox"
                            }, d, "div", null, {
                                role: "presentation"
                            }, function() {
                                var b = ['<table role="presentation" cellspacing="0" border="0" '];
                                b.push('style="');
                                e && e.expand && b.push("height:100%;");
                                b.push("width:" + v(g || "100%"), ";");
                                CKEDITOR.env.webkit && b.push("float:none;");
                                b.push('"');
                                b.push('align="', CKEDITOR.tools.htmlEncode(e && e.align || ("ltr" == a.getParentEditor().lang.dir ? "left" : "right")), '" ');
                                b.push("><tbody>");
                                for (var d = 0; d < c.length; d++) {
                                    var k = [];
                                    b.push('<tr><td role="presentation" ');
                                    g && k.push("width:" + v(g || "100%"));
                                    h ? k.push("height:" + v(h[d])) : e && e.expand && k.push("height:" + Math.floor(100 / c.length) + "%");
                                    e && void 0 !== e.padding && k.push("padding:" + v(e.padding));
                                    CKEDITOR.env.ie && CKEDITOR.env.quirks && f[d].align && k.push("text-align:" + f[d].align);
                                    0 < k.length && b.push('style="', k.join("; "), '" ');
                                    b.push(' class="cke_dialog_ui_vbox_child">', c[d], "</td></tr>")
                                }
                                b.push("</tbody></table>");
                                return b.join("")
                            })
                        }
                    }
                }
            })();
            CKEDITOR.ui.dialog.uiElement.prototype = {
                getElement: function() {
                    return CKEDITOR.document.getById(this.domId)
                },
                getInputElement: function() {
                    return this.getElement()
                },
                getDialog: function() {
                    return this._.dialog
                },
                setValue: function(a, b) {
                    this.getInputElement().setValue(a);
                    !b && this.fire("change", {
                        value: a
                    });
                    return this
                },
                getValue: function() {
                    return this.getInputElement().getValue()
                },
                isChanged: function() {
                    return !1
                },
                selectParentTab: function() {
                    for (var a = this.getInputElement();
                        (a = a.getParent()) && -1 == a.$.className.search("cke_dialog_page_contents"););
                    if (!a) return this;
                    a = a.getAttribute("name");
                    this._.dialog._.currentTabId != a && this._.dialog.selectPage(a);
                    return this
                },
                focus: function() {
                    this.selectParentTab().getInputElement().focus();
                    return this
                },
                registerEvents: function(a) {
                    var b = /^on([A-Z]\w+)/,
                        c, d = function(a, b, c, d) {
                            b.on("load", function() {
                                a.getInputElement().on(c, d, a)
                            })
                        },
                        e;
                    for (e in a)
                        if (c = e.match(b)) this.eventProcessors[e] ? this.eventProcessors[e].call(this, this._.dialog, a[e]) : d(this, this._.dialog, c[1].toLowerCase(), a[e]);
                    return this
                },
                eventProcessors: {
                    onLoad: function(a, b) {
                        a.on("load", b, this)
                    },
                    onShow: function(a, b) {
                        a.on("show", b, this)
                    },
                    onHide: function(a, b) {
                        a.on("hide", b, this)
                    }
                },
                accessKeyDown: function() {
                    this.focus()
                },
                accessKeyUp: function() {},
                disable: function() {
                    var a = this.getElement();
                    this.getInputElement().setAttribute("disabled", "true");
                    a.addClass("cke_disabled")
                },
                enable: function() {
                    var a = this.getElement();
                    this.getInputElement().removeAttribute("disabled");
                    a.removeClass("cke_disabled")
                },
                isEnabled: function() {
                    return !this.getElement().hasClass("cke_disabled")
                },
                isVisible: function() {
                    return this.getInputElement().isVisible()
                },
                isFocusable: function() {
                    return this.isEnabled() && this.isVisible() ? !0 : !1
                }
            };
            CKEDITOR.ui.dialog.hbox.prototype = CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement, {
                getChild: function(a) {
                    if (1 > arguments.length) return this._.children.concat();
                    a.splice || (a = [a]);
                    return 2 > a.length ? this._.children[a[0]] : this._.children[a[0]] && this._.children[a[0]].getChild ? this._.children[a[0]].getChild(a.slice(1, a.length)) : null
                }
            }, !0);
            CKEDITOR.ui.dialog.vbox.prototype = new CKEDITOR.ui.dialog.hbox;
            (function() {
                var a = {
                    build: function(a, c, d) {
                        for (var e = c.children, f, g = [], h = [], p = 0; p < e.length && (f = e[p]); p++) {
                            var m = [];
                            g.push(m);
                            h.push(CKEDITOR.dialog._.uiElementBuilders[f.type].build(a, f, m))
                        }
                        return new CKEDITOR.ui.dialog[c.type](a, h, g, d, c)
                    }
                };
                CKEDITOR.dialog.addUIElement("hbox", a);
                CKEDITOR.dialog.addUIElement("vbox", a)
            })();
            CKEDITOR.dialogCommand = function(a, b) {
                this.dialogName = a;
                CKEDITOR.tools.extend(this, b, !0)
            };
            CKEDITOR.dialogCommand.prototype = {
                exec: function(a) {
                    a.openDialog(this.dialogName)
                },
                canUndo: !1,
                editorFocus: 1
            };
            (function() {
                var a = /^([a]|[^a])+$/,
                    b = /^\d*$/,
                    c = /^\d*(?:\.\d+)?$/,
                    d = /^(((\d*(\.\d+))|(\d*))(px|\%)?)?$/,
                    e = /^(((\d*(\.\d+))|(\d*))(px|em|ex|in|cm|mm|pt|pc|\%)?)?$/i,
                    f = /^(\s*[\w-]+\s*:\s*[^:;]+(?:;|$))*$/;
                CKEDITOR.VALIDATE_OR = 1;
                CKEDITOR.VALIDATE_AND = 2;
                CKEDITOR.dialog.validate = {
                    functions: function() {
                        var a = arguments;
                        return function() {
                            var b = this && this.getValue ? this.getValue() : a[0],
                                c, d = CKEDITOR.VALIDATE_AND,
                                e = [],
                                f;
                            for (f = 0; f < a.length; f++)
                                if ("function" == typeof a[f]) e.push(a[f]);
                                else break;
                            f < a.length && "string" == typeof a[f] && (c = a[f], f++);
                            f < a.length && "number" == typeof a[f] && (d = a[f]);
                            var n = d == CKEDITOR.VALIDATE_AND ? !0 : !1;
                            for (f = 0; f < e.length; f++) n = d == CKEDITOR.VALIDATE_AND ? n && e[f](b) : n || e[f](b);
                            return n ? !0 : c
                        }
                    },
                    regex: function(a, b) {
                        return function(c) {
                            c = this && this.getValue ? this.getValue() : c;
                            return a.test(c) ? !0 : b
                        }
                    },
                    notEmpty: function(b) {
                        return this.regex(a, b)
                    },
                    integer: function(a) {
                        return this.regex(b, a)
                    },
                    number: function(a) {
                        return this.regex(c, a)
                    },
                    cssLength: function(a) {
                        return this.functions(function(a) {
                            return e.test(CKEDITOR.tools.trim(a))
                        }, a)
                    },
                    htmlLength: function(a) {
                        return this.functions(function(a) {
                            return d.test(CKEDITOR.tools.trim(a))
                        }, a)
                    },
                    inlineStyle: function(a) {
                        return this.functions(function(a) {
                            return f.test(CKEDITOR.tools.trim(a))
                        }, a)
                    },
                    equals: function(a, b) {
                        return this.functions(function(b) {
                            return b == a
                        }, b)
                    },
                    notEqual: function(a, b) {
                        return this.functions(function(b) {
                            return b != a
                        }, b)
                    }
                };
                CKEDITOR.on("instanceDestroyed", function(a) {
                    if (CKEDITOR.tools.isEmpty(CKEDITOR.instances)) {
                        for (var b; b = CKEDITOR.dialog._.currentTop;) b.hide();
                        for (var c in z) z[c].remove();
                        z = {}
                    }
                    a = a.editor._.storedDialogs;
                    for (var d in a) a[d].destroy()
                })
            })();
            CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
                openDialog: function(a, b) {
                    var c = null,
                        d = CKEDITOR.dialog._.dialogDefinitions[a];
                    null === CKEDITOR.dialog._.currentTop && N(this);
                    if ("function" == typeof d) c = this._.storedDialogs || (this._.storedDialogs = {}), c = c[a] || (c[a] = new CKEDITOR.dialog(this, a)), b && b.call(c, c), c.show();
                    else {
                        if ("failed" == d) throw O(this), Error('[CKEDITOR.dialog.openDialog] Dialog "' + a + '" failed when loading definition.');
                        "string" == typeof d && CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(d), function() {
                            "function" != typeof CKEDITOR.dialog._.dialogDefinitions[a] && (CKEDITOR.dialog._.dialogDefinitions[a] = "failed");
                            this.openDialog(a, b)
                        }, this, 0, 1)
                    }
                    CKEDITOR.skin.loadPart("dialog");
                    return c
                }
            })
        })();
        CKEDITOR.plugins.add("dialog", {
            requires: "dialogui",
            init: function(x) {
                x.on("doubleclick", function(A) {
                    A.data.dialog && x.openDialog(A.data.dialog)
                }, null, null, 999)
            }
        });
        CKEDITOR.plugins.add("about", {
            requires: "dialog",
            init: function(a) {
                var b = a.addCommand("about", new CKEDITOR.dialogCommand("about"));
                b.modes = {
                    wysiwyg: 1,
                    source: 1
                };
                b.canUndo = !1;
                b.readOnly = 1;
                a.ui.addButton && a.ui.addButton("About", {
                    label: a.lang.about.title,
                    command: "about",
                    toolbar: "about"
                });
                CKEDITOR.dialog.add("about", this.path + "dialogs/about.js")
            }
        });
        (function() {
            CKEDITOR.plugins.add("a11yhelp", {
                requires: "dialog",
                availableLangs: {
                    af: 1,
                    ar: 1,
                    bg: 1,
                    ca: 1,
                    cs: 1,
                    cy: 1,
                    da: 1,
                    de: 1,
                    "de-ch": 1,
                    el: 1,
                    en: 1,
                    "en-gb": 1,
                    eo: 1,
                    es: 1,
                    et: 1,
                    eu: 1,
                    fa: 1,
                    fi: 1,
                    fo: 1,
                    fr: 1,
                    "fr-ca": 1,
                    gl: 1,
                    gu: 1,
                    he: 1,
                    hi: 1,
                    hr: 1,
                    hu: 1,
                    id: 1,
                    it: 1,
                    ja: 1,
                    km: 1,
                    ko: 1,
                    ku: 1,
                    lt: 1,
                    lv: 1,
                    mk: 1,
                    mn: 1,
                    nb: 1,
                    nl: 1,
                    no: 1,
                    pl: 1,
                    pt: 1,
                    "pt-br": 1,
                    ro: 1,
                    ru: 1,
                    si: 1,
                    sk: 1,
                    sl: 1,
                    sq: 1,
                    sr: 1,
                    "sr-latn": 1,
                    sv: 1,
                    th: 1,
                    tr: 1,
                    tt: 1,
                    ug: 1,
                    uk: 1,
                    vi: 1,
                    zh: 1,
                    "zh-cn": 1
                },
                init: function(b) {
                    var c = this;
                    b.addCommand("a11yHelp", {
                        exec: function() {
                            var a = b.langCode,
                                a = c.availableLangs[a] ? a : c.availableLangs[a.replace(/-.*/, "")] ? a.replace(/-.*/, "") : "en";
                            CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + a + ".js"), function() {
                                b.lang.a11yhelp = c.langEntries[a];
                                b.openDialog("a11yHelp")
                            })
                        },
                        modes: {
                            wysiwyg: 1,
                            source: 1
                        },
                        readOnly: 1,
                        canUndo: !1
                    });
                    b.setKeystroke(CKEDITOR.ALT + 48, "a11yHelp");
                    CKEDITOR.dialog.add("a11yHelp", this.path + "dialogs/a11yhelp.js");
                    b.on("ariaEditorHelpLabel", function(a) {
                        a.data.label = b.lang.common.editorHelp
                    })
                }
            })
        })();
        (function() {
            function f(c) {
                var a = this.att;
                c = c && c.hasAttribute(a) && c.getAttribute(a) || "";
                void 0 !== c && this.setValue(c)
            }

            function g() {
                for (var c, a = 0; a < arguments.length; a++)
                    if (arguments[a] instanceof CKEDITOR.dom.element) {
                        c = arguments[a];
                        break
                    }
                if (c) {
                    var a = this.att,
                        b = this.getValue();
                    b ? c.setAttribute(a, b) : c.removeAttribute(a, b)
                }
            }
            var k = {
                id: 1,
                dir: 1,
                classes: 1,
                styles: 1
            };
            CKEDITOR.plugins.add("dialogadvtab", {
                requires: "dialog",
                allowedContent: function(c) {
                    c || (c = k);
                    var a = [];
                    c.id && a.push("id");
                    c.dir && a.push("dir");
                    var b = "";
                    a.length && (b += "[" + a.join(",") + "]");
                    c.classes && (b += "(*)");
                    c.styles && (b += "{*}");
                    return b
                },
                createAdvancedTab: function(c, a, b) {
                    a || (a = k);
                    var d = c.lang.common,
                        h = {
                            id: "advanced",
                            label: d.advancedTab,
                            title: d.advancedTab,
                            elements: [{
                                type: "vbox",
                                padding: 1,
                                children: []
                            }]
                        },
                        e = [];
                    if (a.id || a.dir) a.id && e.push({
                        id: "advId",
                        att: "id",
                        type: "text",
                        requiredContent: b ? b + "[id]" : null,
                        label: d.id,
                        setup: f,
                        commit: g
                    }), a.dir && e.push({
                        id: "advLangDir",
                        att: "dir",
                        type: "select",
                        requiredContent: b ? b + "[dir]" : null,
                        label: d.langDir,
                        "default": "",
                        style: "width:100%",
                        items: [
                            [d.notSet, ""],
                            [d.langDirLTR, "ltr"],
                            [d.langDirRTL, "rtl"]
                        ],
                        setup: f,
                        commit: g
                    }), h.elements[0].children.push({
                        type: "hbox",
                        widths: ["50%", "50%"],
                        children: [].concat(e)
                    });
                    if (a.styles || a.classes) e = [], a.styles && e.push({
                        id: "advStyles",
                        att: "style",
                        type: "text",
                        requiredContent: b ? b + "{cke-xyz}" : null,
                        label: d.styles,
                        "default": "",
                        validate: CKEDITOR.dialog.validate.inlineStyle(d.invalidInlineStyle),
                        onChange: function() {},
                        getStyle: function(a, c) {
                            var b = this.getValue().match(new RegExp("(?:^|;)\\s*" + a + "\\s*:\\s*([^;]*)", "i"));
                            return b ? b[1] : c
                        },
                        updateStyle: function(a, b) {
                            var d = this.getValue(),
                                e = c.document.createElement("span");
                            e.setAttribute("style", d);
                            e.setStyle(a, b);
                            d = CKEDITOR.tools.normalizeCssText(e.getAttribute("style"));
                            this.setValue(d, 1)
                        },
                        setup: f,
                        commit: g
                    }), a.classes && e.push({
                        type: "hbox",
                        widths: ["45%", "55%"],
                        children: [{
                            id: "advCSSClasses",
                            att: "class",
                            type: "text",
                            requiredContent: b ? b + "(cke-xyz)" : null,
                            label: d.cssClasses,
                            "default": "",
                            setup: f,
                            commit: g
                        }]
                    }), h.elements[0].children.push({
                        type: "hbox",
                        widths: ["50%", "50%"],
                        children: [].concat(e)
                    });
                    return h
                }
            })
        })();
        CKEDITOR.plugins.add("basicstyles", {
            init: function(c) {
                var e = 0,
                    d = function(g, d, b, a) {
                        if (a) {
                            a = new CKEDITOR.style(a);
                            var f = h[b];
                            f.unshift(a);
                            c.attachStyleStateChange(a, function(a) {
                                !c.readOnly && c.getCommand(b).setState(a)
                            });
                            c.addCommand(b, new CKEDITOR.styleCommand(a, {
                                contentForms: f
                            }));
                            c.ui.addButton && c.ui.addButton(g, {
                                label: d,
                                command: b,
                                toolbar: "basicstyles," + (e += 10)
                            })
                        }
                    },
                    h = {
                        bold: ["strong", "b", ["span", function(a) {
                            a = a.styles["font-weight"];
                            return "bold" == a || 700 <= +a
                        }]],
                        italic: ["em", "i", ["span", function(a) {
                            return "italic" == a.styles["font-style"]
                        }]],
                        underline: ["u", ["span", function(a) {
                            return "underline" == a.styles["text-decoration"]
                        }]],
                        strike: ["s", "strike", ["span", function(a) {
                            return "line-through" == a.styles["text-decoration"]
                        }]],
                        subscript: ["sub"],
                        superscript: ["sup"]
                    },
                    b = c.config,
                    a = c.lang.basicstyles;
                d("Bold", a.bold, "bold", b.coreStyles_bold);
                d("Italic", a.italic, "italic", b.coreStyles_italic);
                d("Underline", a.underline, "underline", b.coreStyles_underline);
                d("Strike", a.strike, "strike", b.coreStyles_strike);
                d("Subscript", a.subscript, "subscript", b.coreStyles_subscript);
                d("Superscript", a.superscript, "superscript", b.coreStyles_superscript);
                c.setKeystroke([
                    [CKEDITOR.CTRL + 66, "bold"],
                    [CKEDITOR.CTRL + 73, "italic"],
                    [CKEDITOR.CTRL + 85, "underline"]
                ])
            }
        });
        CKEDITOR.config.coreStyles_bold = {
            element: "strong",
            overrides: "b"
        };
        CKEDITOR.config.coreStyles_italic = {
            element: "em",
            overrides: "i"
        };
        CKEDITOR.config.coreStyles_underline = {
            element: "u"
        };
        CKEDITOR.config.coreStyles_strike = {
            element: "s",
            overrides: "strike"
        };
        CKEDITOR.config.coreStyles_subscript = {
            element: "sub"
        };
        CKEDITOR.config.coreStyles_superscript = {
            element: "sup"
        };
        (function() {
            function q(a, f, d, b) {
                if (!a.isReadOnly() && !a.equals(d.editable())) {
                    CKEDITOR.dom.element.setMarker(b, a, "bidi_processed", 1);
                    b = a;
                    for (var c = d.editable();
                        (b = b.getParent()) && !b.equals(c);)
                        if (b.getCustomData("bidi_processed")) {
                            a.removeStyle("direction");
                            a.removeAttribute("dir");
                            return
                        }
                    b = "useComputedState" in d.config ? d.config.useComputedState : 1;
                    (b ? a.getComputedStyle("direction") : a.getStyle("direction") || a.hasAttribute("dir")) != f && (a.removeStyle("direction"), b ? (a.removeAttribute("dir"), f != a.getComputedStyle("direction") && a.setAttribute("dir", f)) : a.setAttribute("dir", f), d.forceNextSelectionCheck())
                }
            }

            function v(a, f, d) {
                var b = a.getCommonAncestor(!1, !0);
                a = a.clone();
                a.enlarge(d == CKEDITOR.ENTER_BR ? CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS : CKEDITOR.ENLARGE_BLOCK_CONTENTS);
                if (a.checkBoundaryOfElement(b, CKEDITOR.START) && a.checkBoundaryOfElement(b, CKEDITOR.END)) {
                    for (var c; b && b.type == CKEDITOR.NODE_ELEMENT && (c = b.getParent()) && 1 == c.getChildCount() && !(b.getName() in f);) b = c;
                    return b.type == CKEDITOR.NODE_ELEMENT && b.getName() in f && b
                }
            }

            function p(a) {
                return {
                    context: "p",
                    allowedContent: {
                        "h1 h2 h3 h4 h5 h6 table ul ol blockquote div tr p div li td": {
                            propertiesOnly: !0,
                            attributes: "dir"
                        }
                    },
                    requiredContent: "p[dir]",
                    refresh: function(a, d) {
                        var b = a.config.useComputedState,
                            c, b = void 0 === b || b;
                        if (!b) {
                            c = d.lastElement;
                            for (var h = a.editable(); c && !(c.getName() in u || c.equals(h));) {
                                var e = c.getParent();
                                if (!e) break;
                                c = e
                            }
                        }
                        c = c || d.block || d.blockLimit;
                        c.equals(a.editable()) && (h = a.getSelection().getRanges()[0].getEnclosedNode()) && h.type == CKEDITOR.NODE_ELEMENT && (c = h);
                        c && (b = b ? c.getComputedStyle("direction") : c.getStyle("direction") || c.getAttribute("dir"), a.getCommand("bidirtl").setState("rtl" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF), a.getCommand("bidiltr").setState("ltr" == b ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF));
                        b = (d.block || d.blockLimit || a.editable()).getDirection(1);
                        b != (a._.selDir || a.lang.dir) && (a._.selDir = b, a.fire("contentDirChanged", b))
                    },
                    exec: function(f) {
                        var d = f.getSelection(),
                            b = f.config.enterMode,
                            c = d.getRanges();
                        if (c && c.length) {
                            for (var h = {}, e = d.createBookmarks(), c = c.createIterator(), g, l = 0; g = c.getNextRange(1);) {
                                var k = g.getEnclosedNode();
                                k && (!k || k.type == CKEDITOR.NODE_ELEMENT && k.getName() in r) || (k = v(g, t, b));
                                k && q(k, a, f, h);
                                var m = new CKEDITOR.dom.walker(g),
                                    n = e[l].startNode,
                                    p = e[l++].endNode;
                                m.evaluator = function(a) {
                                    var c = b == CKEDITOR.ENTER_P ? "p" : "div",
                                        d;
                                    if (d = (a ? a.type == CKEDITOR.NODE_ELEMENT : !1) && a.getName() in t) {
                                        if (c = a.is(c)) c = (c = a.getParent()) ? c.type == CKEDITOR.NODE_ELEMENT : !1;
                                        d = !(c && a.getParent().is("blockquote"))
                                    }
                                    return !!(d && a.getPosition(n) & CKEDITOR.POSITION_FOLLOWING && (a.getPosition(p) & CKEDITOR.POSITION_PRECEDING + CKEDITOR.POSITION_CONTAINS) == CKEDITOR.POSITION_PRECEDING)
                                };
                                for (; k = m.next();) q(k, a, f, h);
                                g = g.createIterator();
                                for (g.enlargeBr = b != CKEDITOR.ENTER_BR; k = g.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");) q(k, a, f, h)
                            }
                            CKEDITOR.dom.element.clearAllMarkers(h);
                            f.forceNextSelectionCheck();
                            d.selectBookmarks(e);
                            f.focus()
                        }
                    }
                }
            }

            function w(a) {
                var f = a == l.setAttribute,
                    d = a == l.removeAttribute,
                    b = /\bdirection\s*:\s*(.*?)\s*(:?$|;)/;
                return function(c, h) {
                    if (!this.isReadOnly()) {
                        var e;
                        if (e = c == (f || d ? "dir" : "direction") || "style" == c && (d || b.test(h))) {
                            a: {
                                e = this;
                                for (var g = e.getDocument().getBody().getParent(); e;) {
                                    if (e.equals(g)) {
                                        e = !1;
                                        break a
                                    }
                                    e = e.getParent()
                                }
                                e = !0
                            }
                            e = !e
                        }
                        if (e && (e = this.getDirection(1), g = a.apply(this, arguments), e != this.getDirection(1))) return this.getDocument().fire("dirChanged", this), g
                    }
                    return a.apply(this, arguments)
                }
            }
            var t = {
                    table: 1,
                    ul: 1,
                    ol: 1,
                    blockquote: 1,
                    div: 1
                },
                r = {},
                u = {};
            CKEDITOR.tools.extend(r, t, {
                tr: 1,
                p: 1,
                div: 1,
                li: 1
            });
            CKEDITOR.tools.extend(u, r, {
                td: 1
            });
            CKEDITOR.plugins.add("bidi", {
                init: function(a) {
                    function f(b, c, d, e, f) {
                        a.addCommand(d, new CKEDITOR.command(a, e));
                        a.ui.addButton && a.ui.addButton(b, {
                            label: c,
                            command: d,
                            toolbar: "bidi," + f
                        })
                    }
                    if (!a.blockless) {
                        var d = a.lang.bidi;
                        f("BidiLtr", d.ltr, "bidiltr", p("ltr"), 10);
                        f("BidiRtl", d.rtl, "bidirtl", p("rtl"), 20);
                        a.on("contentDom", function() {
                            a.document.on("dirChanged", function(b) {
                                a.fire("dirChanged", {
                                    node: b.data,
                                    dir: b.data.getDirection(1)
                                })
                            })
                        });
                        a.on("contentDirChanged", function(b) {
                            b = (a.lang.dir != b.data ? "add" : "remove") + "Class";
                            var c = a.ui.space(a.config.toolbarLocation);
                            if (c) c[b]("cke_mixed_dir_content")
                        })
                    }
                }
            });
            for (var l = CKEDITOR.dom.element.prototype, n = ["setStyle", "removeStyle", "setAttribute", "removeAttribute"], m = 0; m < n.length; m++) l[n[m]] = CKEDITOR.tools.override(l[n[m]], w)
        })();
        (function() {
            var m = {
                exec: function(g) {
                    var a = g.getCommand("blockquote").state,
                        k = g.getSelection(),
                        c = k && k.getRanges()[0];
                    if (c) {
                        var h = k.createBookmarks();
                        if (CKEDITOR.env.ie) {
                            var e = h[0].startNode,
                                b = h[0].endNode,
                                d;
                            if (e && "blockquote" == e.getParent().getName())
                                for (d = e; d = d.getNext();)
                                    if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
                                        e.move(d, !0);
                                        break
                                    }
                            if (b && "blockquote" == b.getParent().getName())
                                for (d = b; d = d.getPrevious();)
                                    if (d.type == CKEDITOR.NODE_ELEMENT && d.isBlockBoundary()) {
                                        b.move(d);
                                        break
                                    }
                        }
                        var f = c.createIterator();
                        f.enlargeBr = g.config.enterMode != CKEDITOR.ENTER_BR;
                        if (a == CKEDITOR.TRISTATE_OFF) {
                            for (e = []; a = f.getNextParagraph();) e.push(a);
                            1 > e.length && (a = g.document.createElement(g.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), b = h.shift(), c.insertNode(a), a.append(new CKEDITOR.dom.text("\ufeff", g.document)), c.moveToBookmark(b), c.selectNodeContents(a), c.collapse(!0), b = c.createBookmark(), e.push(a), h.unshift(b));
                            d = e[0].getParent();
                            c = [];
                            for (b = 0; b < e.length; b++) a = e[b], d = d.getCommonAncestor(a.getParent());
                            for (a = {
                                    table: 1,
                                    tbody: 1,
                                    tr: 1,
                                    ol: 1,
                                    ul: 1
                                }; a[d.getName()];) d = d.getParent();
                            for (b = null; 0 < e.length;) {
                                for (a = e.shift(); !a.getParent().equals(d);) a = a.getParent();
                                a.equals(b) || c.push(a);
                                b = a
                            }
                            for (; 0 < c.length;)
                                if (a = c.shift(), "blockquote" == a.getName()) {
                                    for (b = new CKEDITOR.dom.documentFragment(g.document); a.getFirst();) b.append(a.getFirst().remove()), e.push(b.getLast());
                                    b.replace(a)
                                } else e.push(a);
                            c = g.document.createElement("blockquote");
                            for (c.insertBefore(e[0]); 0 < e.length;) a = e.shift(), c.append(a)
                        } else if (a == CKEDITOR.TRISTATE_ON) {
                            b = [];
                            for (d = {}; a = f.getNextParagraph();) {
                                for (e = c = null; a.getParent();) {
                                    if ("blockquote" == a.getParent().getName()) {
                                        c = a.getParent();
                                        e = a;
                                        break
                                    }
                                    a = a.getParent()
                                }
                                c && e && !e.getCustomData("blockquote_moveout") && (b.push(e), CKEDITOR.dom.element.setMarker(d, e, "blockquote_moveout", !0))
                            }
                            CKEDITOR.dom.element.clearAllMarkers(d);
                            a = [];
                            e = [];
                            for (d = {}; 0 < b.length;) f = b.shift(), c = f.getParent(), f.getPrevious() ? f.getNext() ? (f.breakParent(f.getParent()), e.push(f.getNext())) : f.remove().insertAfter(c) : f.remove().insertBefore(c), c.getCustomData("blockquote_processed") || (e.push(c), CKEDITOR.dom.element.setMarker(d, c, "blockquote_processed", !0)), a.push(f);
                            CKEDITOR.dom.element.clearAllMarkers(d);
                            for (b = e.length - 1; 0 <= b; b--) {
                                c = e[b];
                                a: {
                                    d = c;
                                    for (var f = 0, m = d.getChildCount(), l = void 0; f < m && (l = d.getChild(f)); f++)
                                        if (l.type == CKEDITOR.NODE_ELEMENT && l.isBlockBoundary()) {
                                            d = !1;
                                            break a
                                        }
                                    d = !0
                                }
                                d && c.remove()
                            }
                            if (g.config.enterMode == CKEDITOR.ENTER_BR)
                                for (c = !0; a.length;)
                                    if (f = a.shift(), "div" == f.getName()) {
                                        b = new CKEDITOR.dom.documentFragment(g.document);
                                        !c || !f.getPrevious() || f.getPrevious().type == CKEDITOR.NODE_ELEMENT && f.getPrevious().isBlockBoundary() || b.append(g.document.createElement("br"));
                                        for (c = f.getNext() && !(f.getNext().type == CKEDITOR.NODE_ELEMENT && f.getNext().isBlockBoundary()); f.getFirst();) f.getFirst().remove().appendTo(b);
                                        c && b.append(g.document.createElement("br"));
                                        b.replace(f);
                                        c = !1
                                    }
                        }
                        k.selectBookmarks(h);
                        g.focus()
                    }
                },
                refresh: function(g, a) {
                    this.setState(g.elementPath(a.block || a.blockLimit).contains("blockquote", 1) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
                },
                context: "blockquote",
                allowedContent: "blockquote",
                requiredContent: "blockquote"
            };
            CKEDITOR.plugins.add("blockquote", {
                init: function(g) {
                    g.blockless || (g.addCommand("blockquote", m), g.ui.addButton && g.ui.addButton("Blockquote", {
                        label: g.lang.blockquote.toolbar,
                        command: "blockquote",
                        toolbar: "blocks,10"
                    }))
                }
            })
        })();
        (function() {
            function r(b, a, c) {
                a.type || (a.type = "auto");
                if (c && !1 === b.fire("beforePaste", a) || !a.dataValue && a.dataTransfer.isEmpty()) return !1;
                a.dataValue || (a.dataValue = "");
                if (CKEDITOR.env.gecko && "drop" == a.method && b.toolbox) b.once("afterPaste", function() {
                    b.toolbox.focus()
                });
                return b.fire("paste", a)
            }

            function y(b) {
                function a() {
                    var a = b.editable();
                    if (CKEDITOR.plugins.clipboard.isCustomCopyCutSupported) {
                        var d = function(a) {
                            b.readOnly && "cut" == a.name || n.initPasteDataTransfer(a, b);
                            a.data.preventDefault()
                        };
                        a.on("copy", d);
                        a.on("cut", d);
                        a.on("cut", function() {
                            b.readOnly || b.extractSelectedHtml()
                        }, null, null, 999)
                    }
                    a.on(n.mainPasteEvent, function(b) {
                        "beforepaste" == n.mainPasteEvent && p || k(b)
                    });
                    "beforepaste" == n.mainPasteEvent && (a.on("paste", function(a) {
                        v || (e(), a.data.preventDefault(), k(a), f("paste") || b.openDialog("paste"))
                    }), a.on("contextmenu", g, null, null, 0), a.on("beforepaste", function(b) {
                        !b.data || b.data.$.ctrlKey || b.data.$.shiftKey || g()
                    }, null, null, 0));
                    a.on("beforecut", function() {
                        !p && h(b)
                    });
                    var c;
                    a.attachListener(CKEDITOR.env.ie ? a : b.document.getDocumentElement(), "mouseup", function() {
                        c = setTimeout(function() {
                            t()
                        }, 0)
                    });
                    b.on("destroy", function() {
                        clearTimeout(c)
                    });
                    a.on("keyup", t)
                }

                function c(a) {
                    return {
                        type: a,
                        canUndo: "cut" == a,
                        startDisabled: !0,
                        exec: function() {
                            "cut" == this.type && h();
                            var a;
                            var d = this.type;
                            if (CKEDITOR.env.ie) a = f(d);
                            else try {
                                a = b.document.$.execCommand(d, !1, null)
                            } catch (c) {
                                a = !1
                            }
                            a || b.showNotification(b.lang.clipboard[this.type + "Error"]);
                            return a
                        }
                    }
                }

                function d() {
                    return {
                        canUndo: !1,
                        async: !0,
                        exec: function(b, a) {
                            var d = this,
                                c = function(a, c) {
                                    a && r(b, a, !!c);
                                    b.fire("afterCommandExec", {
                                        name: "paste",
                                        command: d,
                                        returnValue: !!a
                                    })
                                };
                            "string" == typeof a ? c({
                                dataValue: a,
                                method: "paste",
                                dataTransfer: n.initPasteDataTransfer()
                            }, 1) : b.getClipboardData(c)
                        }
                    }
                }

                function e() {
                    v = 1;
                    setTimeout(function() {
                        v = 0
                    }, 100)
                }

                function g() {
                    p = 1;
                    setTimeout(function() {
                        p = 0
                    }, 10)
                }

                function f(a) {
                    var d = b.document,
                        c = d.getBody(),
                        e = !1,
                        f = function() {
                            e = !0
                        };
                    c.on(a, f);
                    7 < CKEDITOR.env.version ? d.$.execCommand(a) : d.$.selection.createRange().execCommand(a);
                    c.removeListener(a, f);
                    return e
                }

                function h() {
                    if (CKEDITOR.env.ie && !CKEDITOR.env.quirks) {
                        var a = b.getSelection(),
                            d, c, e;
                        a.getType() == CKEDITOR.SELECTION_ELEMENT && (d = a.getSelectedElement()) && (c = a.getRanges()[0], e = b.document.createText(""), e.insertBefore(d), c.setStartBefore(e), c.setEndAfter(d),
                            a.selectRanges([c]), setTimeout(function() {
                                d.getParent() && (e.remove(), a.selectElement(d))
                            }, 0))
                    }
                }

                function l(a, d) {
                    var c = b.document,
                        e = b.editable(),
                        f = function(b) {
                            b.cancel()
                        },
                        q;
                    if (!c.getById("cke_pastebin")) {
                        var g = b.getSelection(),
                            h = g.createBookmarks();
                        CKEDITOR.env.ie && g.root.fire("selectionchange");
                        var m = new CKEDITOR.dom.element(!CKEDITOR.env.webkit && !e.is("body") || CKEDITOR.env.ie ? "div" : "body", c);
                        m.setAttributes({
                            id: "cke_pastebin",
                            "data-cke-temp": "1"
                        });
                        var k = 0,
                            c = c.getWindow();
                        CKEDITOR.env.webkit ? (e.append(m), m.addClass("cke_editable"), e.is("body") || (k = "static" != e.getComputedStyle("position") ? e : CKEDITOR.dom.element.get(e.$.offsetParent), k = k.getDocumentPosition().y)) : e.getAscendant(CKEDITOR.env.ie ? "body" : "html", 1).append(m);
                        m.setStyles({
                            position: "absolute",
                            top: c.getScrollPosition().y - k + 10 + "px",
                            width: "1px",
                            height: Math.max(1, c.getViewPaneSize().height - 20) + "px",
                            overflow: "hidden",
                            margin: 0,
                            padding: 0
                        });
                        CKEDITOR.env.safari && m.setStyles(CKEDITOR.tools.cssVendorPrefix("user-select", "text"));
                        (k = m.getParent().isReadOnly()) ? (m.setOpacity(0), m.setAttribute("contenteditable", !0)) : m.setStyle("ltr" == b.config.contentsLangDirection ? "left" : "right", "-10000px");
                        b.on("selectionChange", f, null, null, 0);
                        if (CKEDITOR.env.webkit || CKEDITOR.env.gecko) q = e.once("blur", f, null, null, -100);
                        k && m.focus();
                        k = new CKEDITOR.dom.range(m);
                        k.selectNodeContents(m);
                        var t = k.select();
                        CKEDITOR.env.ie && (q = e.once("blur", function() {
                            b.lockSelection(t)
                        }));
                        var l = CKEDITOR.document.getWindow().getScrollPosition().y;
                        setTimeout(function() {
                            CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = l);
                            q && q.removeListener();
                            CKEDITOR.env.ie && e.focus();
                            g.selectBookmarks(h);
                            m.remove();
                            var a;
                            CKEDITOR.env.webkit && (a = m.getFirst()) && a.is && a.hasClass("Apple-style-span") && (m = a);
                            b.removeListener("selectionChange", f);
                            d(m.getHtml())
                        }, 0)
                    }
                }

                function z() {
                    if ("paste" == n.mainPasteEvent) return b.fire("beforePaste", {
                        type: "auto",
                        method: "paste"
                    }), !1;
                    b.focus();
                    e();
                    var a = b.focusManager;
                    a.lock();
                    if (b.editable().fire(n.mainPasteEvent) && !f("paste")) return a.unlock(), !1;
                    a.unlock();
                    return !0
                }

                function q(a) {
                    if ("wysiwyg" == b.mode) switch (a.data.keyCode) {
                        case CKEDITOR.CTRL + 86:
                        case CKEDITOR.SHIFT + 45:
                            a = b.editable();
                            e();
                            "paste" == n.mainPasteEvent && a.fire("beforepaste");
                            break;
                        case CKEDITOR.CTRL + 88:
                        case CKEDITOR.SHIFT + 46:
                            b.fire("saveSnapshot"), setTimeout(function() {
                                b.fire("saveSnapshot")
                            }, 50)
                    }
                }

                function k(a) {
                    var d = {
                        type: "auto",
                        method: "paste",
                        dataTransfer: n.initPasteDataTransfer(a)
                    };
                    d.dataTransfer.cacheData();
                    var c = !1 !== b.fire("beforePaste", d);
                    c && n.canClipboardApiBeTrusted(d.dataTransfer, b) ? (a.data.preventDefault(), setTimeout(function() {
                        r(b, d)
                    }, 0)) : l(a, function(a) {
                        d.dataValue = a.replace(/<span[^>]+data-cke-bookmark[^<]*?<\/span>/gi, "");
                        c && r(b, d)
                    })
                }

                function t() {
                    if ("wysiwyg" == b.mode) {
                        var a = u("paste");
                        b.getCommand("cut").setState(u("cut"));
                        b.getCommand("copy").setState(u("copy"));
                        b.getCommand("paste").setState(a);
                        b.fire("pasteState", a)
                    }
                }

                function u(a) {
                    if (w && a in {
                            paste: 1,
                            cut: 1
                        }) return CKEDITOR.TRISTATE_DISABLED;
                    if ("paste" == a) return CKEDITOR.TRISTATE_OFF;
                    a = b.getSelection();
                    var d = a.getRanges();
                    return a.getType() == CKEDITOR.SELECTION_NONE || 1 == d.length && d[0].collapsed ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF
                }
                var n = CKEDITOR.plugins.clipboard,
                    p = 0,
                    v = 0,
                    w = 0;
                (function() {
                    b.on("key", q);
                    b.on("contentDom", a);
                    b.on("selectionChange", function(b) {
                        w = b.data.selection.getRanges()[0].checkReadOnly();
                        t()
                    });
                    b.contextMenu && b.contextMenu.addListener(function(b, a) {
                        w = a.getRanges()[0].checkReadOnly();
                        return {
                            cut: u("cut"),
                            copy: u("copy"),
                            paste: u("paste")
                        }
                    })
                })();
                (function() {
                    function a(d, c, e, f, q) {
                        var g = b.lang.clipboard[c];
                        b.addCommand(c, e);
                        b.ui.addButton && b.ui.addButton(d, {
                            label: g,
                            command: c,
                            toolbar: "clipboard," + f
                        });
                        b.addMenuItems && b.addMenuItem(c, {
                            label: g,
                            command: c,
                            group: "clipboard",
                            order: q
                        })
                    }
                    a("Cut", "cut", c("cut"), 10, 1);
                    a("Copy", "copy", c("copy"), 20, 4);
                    a("Paste", "paste", d(), 30, 8)
                })();
                b.getClipboardData = function(a, d) {
                    function c(a) {
                        a.removeListener();
                        a.cancel();
                        d(a.data)
                    }

                    function e(a) {
                        a.removeListener();
                        a.cancel();
                        k = !0;
                        d({
                            type: g,
                            dataValue: a.data.dataValue,
                            dataTransfer: a.data.dataTransfer,
                            method: "paste"
                        })
                    }

                    function f() {
                        this.customTitle = a && a.title
                    }
                    var q = !1,
                        g = "auto",
                        k = !1;
                    d || (d = a, a = null);
                    b.on("paste", c, null, null, 0);
                    b.on("beforePaste", function(a) {
                        a.removeListener();
                        q = !0;
                        g = a.data.type
                    }, null, null, 1e3);
                    !1 === z() && (b.removeListener("paste", c), q && b.fire("pasteDialog", f) ? (b.on("pasteDialogCommit", e), b.on("dialogHide", function(a) {
                        a.removeListener();
                        a.data.removeListener("pasteDialogCommit", e);
                        setTimeout(function() {
                            k || d(null)
                        }, 10)
                    })) : d(null))
                }
            }

            function A(b) {
                if (CKEDITOR.env.webkit) {
                    if (!b.match(/^[^<]*$/g) && !b.match(/^(<div><br( ?\/)?><\/div>|<div>[^<]*<\/div>)*$/gi)) return "html"
                } else if (CKEDITOR.env.ie) {
                    if (!b.match(/^([^<]|<br( ?\/)?>)*$/gi) && !b.match(/^(<p>([^<]|<br( ?\/)?>)*<\/p>|(\r\n))*$/gi)) return "html"
                } else if (CKEDITOR.env.gecko) {
                    if (!b.match(/^([^<]|<br( ?\/)?>)*$/gi)) return "html"
                } else return "html";
                return "htmlifiedtext"
            }

            function B(b, a) {
                function c(a) {
                    return CKEDITOR.tools.repeat("</p><p>", ~~(a / 2)) + (1 == a % 2 ? "<br>" : "")
                }
                a = a.replace(/\s+/g, " ").replace(/> +</g, "><").replace(/<br ?\/>/gi, "<br>");
                a = a.replace(/<\/?[A-Z]+>/g, function(a) {
                    return a.toLowerCase()
                });
                if (a.match(/^[^<]$/)) return a;
                CKEDITOR.env.webkit && -1 < a.indexOf("<div>") && (a = a.replace(/^(<div>(<br>|)<\/div>)(?!$|(<div>(<br>|)<\/div>))/g, "<br>").replace(/^(<div>(<br>|)<\/div>){2}(?!$)/g, "<div></div>"), a.match(/<div>(<br>|)<\/div>/) && (a = "<p>" + a.replace(/(<div>(<br>|)<\/div>)+/g, function(a) {
                    return c(a.split("</div><div>").length + 1)
                }) + "</p>"), a = a.replace(/<\/div><div>/g, "<br>"), a = a.replace(/<\/?div>/g, ""));
                CKEDITOR.env.gecko && b.enterMode != CKEDITOR.ENTER_BR && (CKEDITOR.env.gecko && (a = a.replace(/^<br><br>$/, "<br>")), -1 < a.indexOf("<br><br>") && (a = "<p>" + a.replace(/(<br>){2,}/g, function(a) {
                    return c(a.length / 4)
                }) + "</p>"));
                return C(b, a)
            }

            function D() {
                function b() {
                    var a = {},
                        b;
                    for (b in CKEDITOR.dtd) "$" != b.charAt(0) && "div" != b && "span" != b && (a[b] = 1);
                    return a
                }
                var a = {};
                return {
                    get: function(c) {
                        return "plain-text" == c ? a.plainText || (a.plainText = new CKEDITOR.filter("br")) : "semantic-content" == c ? ((c = a.semanticContent) || (c = new CKEDITOR.filter, c.allow({
                            $1: {
                                elements: b(),
                                attributes: !0,
                                styles: !1,
                                classes: !1
                            }
                        }), c = a.semanticContent = c), c) : c ? new CKEDITOR.filter(c) : null
                    }
                }
            }

            function x(b, a, c) {
                a = CKEDITOR.htmlParser.fragment.fromHtml(a);
                var d = new CKEDITOR.htmlParser.basicWriter;
                c.applyTo(a, !0, !1, b.activeEnterMode);
                a.writeHtml(d);
                return d.getHtml()
            }

            function C(b, a) {
                b.enterMode == CKEDITOR.ENTER_BR ? a = a.replace(/(<\/p><p>)+/g, function(a) {
                    return CKEDITOR.tools.repeat("<br>", a.length / 7 * 2)
                }).replace(/<\/?p>/g, "") : b.enterMode == CKEDITOR.ENTER_DIV && (a = a.replace(/<(\/)?p>/g, "<$1div>"));
                return a
            }

            function E(b) {
                b.data.preventDefault();
                b.data.$.dataTransfer.dropEffect = "none"
            }

            function F(b) {
                var a = CKEDITOR.plugins.clipboard;
                b.on("contentDom", function() {
                    function c(a, d, c) {
                        d.select();
                        r(b, {
                            dataTransfer: c,
                            method: "drop"
                        }, 1);
                        c.sourceEditor.fire("saveSnapshot");
                        c.sourceEditor.editable().extractHtmlFromRange(a);
                        c.sourceEditor.getSelection().selectRanges([a]);
                        c.sourceEditor.fire("saveSnapshot")
                    }

                    function d(d, c) {
                        d.select();
                        r(b, {
                            dataTransfer: c,
                            method: "drop"
                        }, 1);
                        a.resetDragDataTransfer()
                    }

                    function e(a, d, c) {
                        var e = {
                            $: a.data.$,
                            target: a.data.getTarget()
                        };
                        d && (e.dragRange = d);
                        c && (e.dropRange = c);
                        !1 === b.fire(a.name, e) && a.data.preventDefault()
                    }

                    function g(a) {
                        a.type != CKEDITOR.NODE_ELEMENT && (a = a.getParent());
                        return a.getChildCount()
                    }
                    var f = b.editable(),
                        h = CKEDITOR.plugins.clipboard.getDropTarget(b),
                        l = b.ui.space("top"),
                        p = b.ui.space("bottom");
                    a.preventDefaultDropOnElement(l);
                    a.preventDefaultDropOnElement(p);
                    f.attachListener(h, "dragstart", e);
                    f.attachListener(b, "dragstart", a.resetDragDataTransfer, a, null, 1);
                    f.attachListener(b, "dragstart", function(d) {
                        a.initDragDataTransfer(d, b)
                    }, null, null, 2);
                    f.attachListener(b, "dragstart", function() {
                        var d = a.dragRange = b.getSelection().getRanges()[0];
                        CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (a.dragStartContainerChildCount = d ? g(d.startContainer) : null, a.dragEndContainerChildCount = d ? g(d.endContainer) : null)
                    }, null, null, 100);
                    f.attachListener(h, "dragend", e);
                    f.attachListener(b, "dragend", a.initDragDataTransfer, a, null, 1);
                    f.attachListener(b, "dragend", a.resetDragDataTransfer, a, null, 100);
                    f.attachListener(h, "dragover", function(a) {
                        var b = a.data.getTarget();
                        b && b.is && b.is("html") ? a.data.preventDefault() : CKEDITOR.env.ie && CKEDITOR.plugins.clipboard.isFileApiSupported && a.data.$.dataTransfer.types.contains("Files") && a.data.preventDefault()
                    });
                    f.attachListener(h, "drop", function(d) {
                        if (!d.data.$.defaultPrevented) {
                            d.data.preventDefault();
                            var c = d.data.getTarget();
                            if (!c.isReadOnly() || c.type == CKEDITOR.NODE_ELEMENT && c.is("html")) {
                                var c = a.getRangeAtDropPosition(d, b),
                                    f = a.dragRange;
                                c && e(d, f, c)
                            }
                        }
                    }, null, null, 9999);
                    f.attachListener(b, "drop", a.initDragDataTransfer, a, null, 1);
                    f.attachListener(b, "drop", function(e) {
                        if (e = e.data) {
                            var f = e.dropRange,
                                g = e.dragRange,
                                h = e.dataTransfer;
                            h.getTransferType(b) == CKEDITOR.DATA_TRANSFER_INTERNAL ? setTimeout(function() {
                                a.internalDrop(g, f, h, b)
                            }, 0) : h.getTransferType(b) == CKEDITOR.DATA_TRANSFER_CROSS_EDITORS ? c(g, f, h) : d(f, h)
                        }
                    }, null, null, 9999)
                })
            }
            CKEDITOR.plugins.add("clipboard", {
                requires: "dialog",
                init: function(b) {
                    var a, c = D();
                    b.config.forcePasteAsPlainText ? a = "plain-text" : b.config.pasteFilter ? a = b.config.pasteFilter : !CKEDITOR.env.webkit || "pasteFilter" in b.config || (a = "semantic-content");
                    b.pasteFilter = c.get(a);
                    y(b);
                    F(b);
                    CKEDITOR.dialog.add("paste", CKEDITOR.getUrl(this.path + "dialogs/paste.js"));
                    b.on("paste", function(a) {
                        a.data.dataTransfer || (a.data.dataTransfer = new CKEDITOR.plugins.clipboard.dataTransfer);
                        if (!a.data.dataValue) {
                            var c = a.data.dataTransfer,
                                g = c.getData("text/html");
                            if (g) a.data.dataValue = g, a.data.type = "html";
                            else if (g = c.getData("text/plain")) a.data.dataValue = b.editable().transformPlainTextToHtml(g), a.data.type = "text"
                        }
                    }, null, null, 1);
                    b.on("paste", function(a) {
                        var b = a.data.dataValue,
                            c = CKEDITOR.dtd.$block; - 1 < b.indexOf("Apple-") && (b = b.replace(/<span class="Apple-converted-space">&nbsp;<\/span>/gi, " "), "html" != a.data.type && (b = b.replace(/<span class="Apple-tab-span"[^>]*>([^<]*)<\/span>/gi, function(a, b) {
                            return b.replace(/\t/g, "&nbsp;&nbsp; &nbsp;")
                        })), -1 < b.indexOf('<br class="Apple-interchange-newline">') && (a.data.startsWithEOL = 1, a.data.preSniffing = "html", b = b.replace(/<br class="Apple-interchange-newline">/, "")), b = b.replace(/(<[^>]+) class="Apple-[^"]*"/gi, "$1"));
                        if (b.match(/^<[^<]+cke_(editable|contents)/i)) {
                            var f, h, l = new CKEDITOR.dom.element("div");
                            for (l.setHtml(b); 1 == l.getChildCount() && (f = l.getFirst()) && f.type == CKEDITOR.NODE_ELEMENT && (f.hasClass("cke_editable") || f.hasClass("cke_contents"));) l = h = f;
                            h && (b = h.getHtml().replace(/<br>$/i, ""))
                        }
                        CKEDITOR.env.ie ? b = b.replace(/^&nbsp;(?: |\r\n)?<(\w+)/g, function(b, f) {
                            return f.toLowerCase() in c ? (a.data.preSniffing = "html", "<" + f) : b
                        }) : CKEDITOR.env.webkit ? b = b.replace(/<\/(\w+)><div><br><\/div>$/, function(b, f) {
                            return f in c ? (a.data.endsWithEOL = 1, "</" + f + ">") : b
                        }) : CKEDITOR.env.gecko && (b = b.replace(/(\s)<br>$/, "$1"));
                        a.data.dataValue = b
                    }, null, null, 3);
                    b.on("paste", function(a) {
                        a = a.data;
                        var e = a.type,
                            g = a.dataValue,
                            f, h = b.config.clipboard_defaultContentType || "html",
                            l = a.dataTransfer.getTransferType(b);
                        f = "html" == e || "html" == a.preSniffing ? "html" : A(g);
                        "htmlifiedtext" == f && (g = B(b.config, g));
                        "text" == e && "html" == f ? g = x(b, g, c.get("plain-text")) : l == CKEDITOR.DATA_TRANSFER_EXTERNAL && b.pasteFilter && !a.dontFilter && (g = x(b, g, b.pasteFilter));
                        a.startsWithEOL && (g = '<br data-cke-eol="1">' + g);
                        a.endsWithEOL && (g += '<br data-cke-eol="1">');
                        "auto" == e && (e = "html" == f || "html" == h ? "html" : "text");
                        a.type = e;
                        a.dataValue = g;
                        delete a.preSniffing;
                        delete a.startsWithEOL;
                        delete a.endsWithEOL
                    }, null, null, 6);
                    b.on("paste", function(a) {
                        a = a.data;
                        a.dataValue && (b.insertHtml(a.dataValue, a.type, a.range), setTimeout(function() {
                            b.fire("afterPaste")
                        }, 0))
                    }, null, null, 1e3);
                    b.on("pasteDialog", function(a) {
                        setTimeout(function() {
                            b.openDialog("paste", a.data)
                        }, 0)
                    })
                }
            });
            CKEDITOR.plugins.clipboard = {
                isCustomCopyCutSupported: !CKEDITOR.env.ie && !CKEDITOR.env.iOS,
                isCustomDataTypesSupported: !CKEDITOR.env.ie,
                isFileApiSupported: !CKEDITOR.env.ie || 9 < CKEDITOR.env.version,
                mainPasteEvent: CKEDITOR.env.ie && !CKEDITOR.env.edge ? "beforepaste" : "paste",
                canClipboardApiBeTrusted: function(b, a) {
                    return b.getTransferType(a) != CKEDITOR.DATA_TRANSFER_EXTERNAL || CKEDITOR.env.chrome && !b.isEmpty() || CKEDITOR.env.gecko && (b.getData("text/html") || b.getFilesCount()) ? !0 : !1
                },
                getDropTarget: function(b) {
                    var a = b.editable();
                    return CKEDITOR.env.ie && 9 > CKEDITOR.env.version || a.isInline() ? a : b.document
                },
                fixSplitNodesAfterDrop: function(b, a, c, d) {
                    function e(b, c, d) {
                        var e = b;
                        e.type == CKEDITOR.NODE_TEXT && (e = b.getParent());
                        if (e.equals(c) && d != c.getChildCount()) return b = a.startContainer.getChild(a.startOffset - 1), c = a.startContainer.getChild(a.startOffset), b && b.type == CKEDITOR.NODE_TEXT && c && c.type == CKEDITOR.NODE_TEXT && (d = b.getLength(), b.setText(b.getText() + c.getText()), c.remove(), a.setStart(b, d), a.collapse(!0)), !0
                    }
                    var g = a.startContainer;
                    "number" == typeof d && "number" == typeof c && g.type == CKEDITOR.NODE_ELEMENT && (e(b.startContainer, g, c) || e(b.endContainer, g, d))
                },
                isDropRangeAffectedByDragRange: function(b, a) {
                    var c = a.startContainer,
                        d = a.endOffset;
                    return b.endContainer.equals(c) && b.endOffset <= d || b.startContainer.getParent().equals(c) && b.startContainer.getIndex() < d || b.endContainer.getParent().equals(c) && b.endContainer.getIndex() < d ? !0 : !1
                },
                internalDrop: function(b, a, c, d) {
                    var e = CKEDITOR.plugins.clipboard,
                        g = d.editable(),
                        f, h;
                    d.fire("saveSnapshot");
                    d.fire("lockSnapshot", {
                        dontUpdate: 1
                    });
                    CKEDITOR.env.ie && 10 > CKEDITOR.env.version && this.fixSplitNodesAfterDrop(b, a, e.dragStartContainerChildCount, e.dragEndContainerChildCount);
                    (h = this.isDropRangeAffectedByDragRange(b, a)) || (f = b.createBookmark(!1));
                    e = a.clone().createBookmark(!1);
                    h && (f = b.createBookmark(!1));
                    b = f.startNode;
                    a = f.endNode;
                    h = e.startNode;
                    a && b.getPosition(h) & CKEDITOR.POSITION_PRECEDING && a.getPosition(h) & CKEDITOR.POSITION_FOLLOWING && h.insertBefore(b);
                    b = d.createRange();
                    b.moveToBookmark(f);
                    g.extractHtmlFromRange(b, 1);
                    a = d.createRange();
                    a.moveToBookmark(e);
                    r(d, {
                        dataTransfer: c,
                        method: "drop",
                        range: a
                    }, 1);
                    d.fire("unlockSnapshot")
                },
                getRangeAtDropPosition: function(b, a) {
                    var c = b.data.$,
                        d = c.clientX,
                        e = c.clientY,
                        g = a.getSelection(!0).getRanges()[0],
                        f = a.createRange();
                    if (b.data.testRange) return b.data.testRange;
                    if (document.caretRangeFromPoint) c = a.document.$.caretRangeFromPoint(d, e), f.setStart(CKEDITOR.dom.node(c.startContainer), c.startOffset), f.collapse(!0);
                    else if (c.rangeParent) f.setStart(CKEDITOR.dom.node(c.rangeParent), c.rangeOffset), f.collapse(!0);
                    else {
                        if (CKEDITOR.env.ie && 8 < CKEDITOR.env.version && g && a.editable().hasFocus) return g;
                        if (document.body.createTextRange) {
                            a.focus();
                            c = a.document.getBody().$.createTextRange();
                            try {
                                for (var h = !1, l = 0; 20 > l && !h; l++) {
                                    if (!h) try {
                                        c.moveToPoint(d, e - l), h = !0
                                    } catch (p) {}
                                    if (!h) try {
                                        c.moveToPoint(d, e + l), h = !0
                                    } catch (q) {}
                                }
                                if (h) {
                                    var k = "cke-temp-" + (new Date).getTime();
                                    c.pasteHTML('<span id="' + k + '">​</span>');
                                    var t = a.document.getById(k);
                                    f.moveToPosition(t, CKEDITOR.POSITION_BEFORE_START);
                                    t.remove()
                                } else {
                                    var u = a.document.$.elementFromPoint(d, e),
                                        n = new CKEDITOR.dom.element(u),
                                        r;
                                    if (n.equals(a.editable()) || "html" == n.getName()) return g && g.startContainer && !g.startContainer.equals(a.editable()) ? g : null;
                                    r = n.getClientRect();
                                    d < r.left ? f.setStartAt(n, CKEDITOR.POSITION_AFTER_START) : f.setStartAt(n, CKEDITOR.POSITION_BEFORE_END);
                                    f.collapse(!0)
                                }
                            } catch (v) {
                                return null
                            }
                        } else return null
                    }
                    return f
                },
                initDragDataTransfer: function(b, a) {
                    var c = b.data.$ ? b.data.$.dataTransfer : null,
                        d = new this.dataTransfer(c, a);
                    c ? this.dragData && d.id == this.dragData.id ? d = this.dragData : this.dragData = d : this.dragData ? d = this.dragData : this.dragData = d;
                    b.data.dataTransfer = d
                },
                resetDragDataTransfer: function() {
                    this.dragData = null
                },
                initPasteDataTransfer: function(b, a) {
                    if (this.isCustomCopyCutSupported && b && b.data && b.data.$) {
                        var c = new this.dataTransfer(b.data.$.clipboardData, a);
                        this.copyCutData && c.id == this.copyCutData.id ? (c = this.copyCutData, c.$ = b.data.$.clipboardData) : this.copyCutData = c;
                        return c
                    }
                    return new this.dataTransfer(null, a)
                },
                preventDefaultDropOnElement: function(b) {
                    b && b.on("dragover", E)
                }
            };
            var p = CKEDITOR.plugins.clipboard.isCustomDataTypesSupported ? "cke/id" : "Text";
            CKEDITOR.plugins.clipboard.dataTransfer = function(b, a) {
                b && (this.$ = b);
                this._ = {
                    metaRegExp: /^<meta.*?>/i,
                    bodyRegExp: /<body(?:[\s\S]*?)>([\s\S]*)<\/body>/i,
                    fragmentRegExp: /\x3c!--(?:Start|End)Fragment--\x3e/g,
                    data: {},
                    files: [],
                    normalizeType: function(a) {
                        a = a.toLowerCase();
                        return "text" == a || "text/plain" == a ? "Text" : "url" == a ? "URL" : a
                    }
                };
                this.id = this.getData(p);
                this.id || (this.id = "Text" == p ? "" : "cke-" + CKEDITOR.tools.getUniqueId());
                if ("Text" != p) try {
                    this.$.setData(p, this.id)
                } catch (c) {}
                a && (this.sourceEditor = a, this.setData("text/html", a.getSelectedHtml(1)), "Text" == p || this.getData("text/plain") || this.setData("text/plain", a.getSelection().getSelectedText()))
            };
            CKEDITOR.DATA_TRANSFER_INTERNAL = 1;
            CKEDITOR.DATA_TRANSFER_CROSS_EDITORS = 2;
            CKEDITOR.DATA_TRANSFER_EXTERNAL = 3;
            CKEDITOR.plugins.clipboard.dataTransfer.prototype = {
                getData: function(b) {
                    b = this._.normalizeType(b);
                    var a = this._.data[b];
                    if (void 0 === a || null === a || "" === a) try {
                        a = this.$.getData(b)
                    } catch (c) {}
                    if (void 0 === a || null === a || "" === a) a = "";
                    "text/html" == b ? (a = a.replace(this._.metaRegExp, ""), (b = this._.bodyRegExp.exec(a)) && b.length && (a = b[1], a = a.replace(this._.fragmentRegExp, ""))) : "Text" == b && CKEDITOR.env.gecko && this.getFilesCount() && "file://" == a.substring(0, 7) && (a = "");
                    return a
                },
                setData: function(b, a) {
                    b = this._.normalizeType(b);
                    this._.data[b] = a;
                    if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported || "URL" == b || "Text" == b) {
                        "Text" == p && "Text" == b && (this.id = a);
                        try {
                            this.$.setData(b, a)
                        } catch (c) {}
                    }
                },
                getTransferType: function(b) {
                    return this.sourceEditor ? this.sourceEditor == b ? CKEDITOR.DATA_TRANSFER_INTERNAL : CKEDITOR.DATA_TRANSFER_CROSS_EDITORS : CKEDITOR.DATA_TRANSFER_EXTERNAL
                },
                cacheData: function() {
                    function b(b) {
                        b = a._.normalizeType(b);
                        var c = a.getData(b);
                        c && (a._.data[b] = c)
                    }
                    if (this.$) {
                        var a = this,
                            c, d;
                        if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
                            if (this.$.types)
                                for (c = 0; c < this.$.types.length; c++) b(this.$.types[c])
                        } else b("Text"), b("URL");
                        d = this._getImageFromClipboard();
                        if (this.$ && this.$.files || d) {
                            this._.files = [];
                            for (c = 0; c < this.$.files.length; c++) this._.files.push(this.$.files[c]);
                            0 === this._.files.length && d && this._.files.push(d)
                        }
                    }
                },
                getFilesCount: function() {
                    return this._.files.length ? this._.files.length : this.$ && this.$.files && this.$.files.length ? this.$.files.length : this._getImageFromClipboard() ? 1 : 0
                },
                getFile: function(b) {
                    return this._.files.length ? this._.files[b] : this.$ && this.$.files && this.$.files.length ? this.$.files[b] : 0 === b ? this._getImageFromClipboard() : void 0
                },
                isEmpty: function() {
                    var b = {},
                        a;
                    if (this.getFilesCount()) return !1;
                    for (a in this._.data) b[a] = 1;
                    if (this.$)
                        if (CKEDITOR.plugins.clipboard.isCustomDataTypesSupported) {
                            if (this.$.types)
                                for (var c = 0; c < this.$.types.length; c++) b[this.$.types[c]] = 1
                        } else b.Text = 1, b.URL = 1;
                        "Text" != p && (b[p] = 0);
                    for (a in b)
                        if (b[a] && "" !== this.getData(a)) return !1;
                    return !0
                },
                _getImageFromClipboard: function() {
                    var b;
                    if (this.$ && this.$.items && this.$.items[0]) try {
                        if ((b = this.$.items[0].getAsFile()) && b.type) return b
                    } catch (a) {}
                }
            }
        })();
        (function() {
            var c = '<a id="{id}" class="cke_button cke_button__{name} cke_button_{state} {cls}"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href=\"javascript:void('{titleJs}')\"") + ' title="{title}" tabindex="-1" hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="{hasArrow}" aria-disabled="{ariaDisabled}"';
            CKEDITOR.env.gecko && CKEDITOR.env.mac && (c += ' onkeypress="return false;"');
            CKEDITOR.env.gecko && (c += ' onblur="this.style.cssText = this.style.cssText;"');
            var c = c + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span class="cke_button_icon cke_button__{iconName}_icon" style="{style}"'),
                c = c + '>&nbsp;</span><span id="{id}_label" class="cke_button_label cke_button__{name}_label" aria-hidden="false">{label}</span>{arrowHtml}</a>',
                r = CKEDITOR.addTemplate("buttonArrow", '<span class="cke_button_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : "") + "</span>"),
                t = CKEDITOR.addTemplate("button", c);
            CKEDITOR.plugins.add("button", {
                beforeInit: function(a) {
                    a.ui.addHandler(CKEDITOR.UI_BUTTON, CKEDITOR.ui.button.handler)
                }
            });
            CKEDITOR.UI_BUTTON = "button";
            CKEDITOR.ui.button = function(a) {
                CKEDITOR.tools.extend(this, a, {
                    title: a.label,
                    click: a.click || function(b) {
                        b.execCommand(a.command)
                    }
                });
                this._ = {}
            };
            CKEDITOR.ui.button.handler = {
                create: function(a) {
                    return new CKEDITOR.ui.button(a)
                }
            };
            CKEDITOR.ui.button.prototype = {
                render: function(a, b) {
                    function c() {
                        var e = a.mode;
                        e && (e = this.modes[e] ? void 0 !== k[e] ? k[e] : CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED, e = a.readOnly && !this.readOnly ? CKEDITOR.TRISTATE_DISABLED : e, this.setState(e), this.refresh && this.refresh())
                    }
                    var l = CKEDITOR.env,
                        m = this._.id = CKEDITOR.tools.getNextId(),
                        f = "",
                        g = this.command,
                        n;
                    this._.editor = a;
                    var d = {
                            id: m,
                            button: this,
                            editor: a,
                            focus: function() {
                                CKEDITOR.document.getById(m).focus()
                            },
                            execute: function() {
                                this.button.click(a)
                            },
                            attach: function(a) {
                                this.button.attach(a)
                            }
                        },
                        u = CKEDITOR.tools.addFunction(function(a) {
                            if (d.onkey) return a = new CKEDITOR.dom.event(a), !1 !== d.onkey(d, a.getKeystroke())
                        }),
                        v = CKEDITOR.tools.addFunction(function(a) {
                            var b;
                            d.onfocus && (b = !1 !== d.onfocus(d, new CKEDITOR.dom.event(a)));
                            return b
                        }),
                        p = 0;
                    d.clickFn = n = CKEDITOR.tools.addFunction(function() {
                        p && (a.unlockSelection(1), p = 0);
                        d.execute();
                        l.iOS && a.focus()
                    });
                    if (this.modes) {
                        var k = {};
                        a.on("beforeModeUnload", function() {
                            a.mode && this._.state != CKEDITOR.TRISTATE_DISABLED && (k[a.mode] = this._.state)
                        }, this);
                        a.on("activeFilterChange", c, this);
                        a.on("mode", c, this);
                        !this.readOnly && a.on("readOnly", c, this)
                    } else g && (g = a.getCommand(g)) && (g.on("state", function() {
                        this.setState(g.state)
                    }, this), f += g.state == CKEDITOR.TRISTATE_ON ? "on" : g.state == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off");
                    if (this.directional) a.on("contentDirChanged", function(b) {
                        var c = CKEDITOR.document.getById(this._.id),
                            d = c.getFirst();
                        b = b.data;
                        b != a.lang.dir ? c.addClass("cke_" + b) : c.removeClass("cke_ltr").removeClass("cke_rtl");
                        d.setAttribute("style", CKEDITOR.skin.getIconStyle(h, "rtl" == b, this.icon, this.iconOffset))
                    }, this);
                    g || (f += "off");
                    var q = this.name || this.command,
                        h = q;
                    this.icon && !/\./.test(this.icon) && (h = this.icon, this.icon = null);
                    f = {
                        id: m,
                        name: q,
                        iconName: h,
                        label: this.label,
                        cls: this.className || "",
                        state: f,
                        ariaDisabled: "disabled" == f ? "true" : "false",
                        title: this.title,
                        titleJs: l.gecko && !l.hc ? "" : (this.title || "").replace("'", ""),
                        hasArrow: this.hasArrow ? "true" : "false",
                        keydownFn: u,
                        focusFn: v,
                        clickFn: n,
                        style: CKEDITOR.skin.getIconStyle(h, "rtl" == a.lang.dir, this.icon, this.iconOffset),
                        arrowHtml: this.hasArrow ? r.output() : ""
                    };
                    t.output(f, b);
                    if (this.onRender) this.onRender();
                    return d
                },
                setState: function(a) {
                    if (this._.state == a) return !1;
                    this._.state = a;
                    var b = CKEDITOR.document.getById(this._.id);
                    return b ? (b.setState(a, "cke_button"), a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled"), this.hasArrow ? (a = a == CKEDITOR.TRISTATE_ON ? this._.editor.lang.button.selectedLabel.replace(/%1/g, this.label) : this.label, CKEDITOR.document.getById(this._.id + "_label").setText(a)) : a == CKEDITOR.TRISTATE_ON ? b.setAttribute("aria-pressed", !0) : b.removeAttribute("aria-pressed"), !0) : !1
                },
                getState: function() {
                    return this._.state
                },
                toFeature: function(a) {
                    if (this._.feature) return this._.feature;
                    var b = this;
                    this.allowedContent || this.requiredContent || !this.command || (b = a.getCommand(this.command) || b);
                    return this._.feature = b
                }
            };
            CKEDITOR.ui.prototype.addButton = function(a, b) {
                this.add(a, CKEDITOR.UI_BUTTON, b)
            }
        })();
        CKEDITOR.plugins.add("panelbutton", {
            requires: "button",
            onLoad: function() {
                function e(c) {
                    var a = this._;
                    a.state != CKEDITOR.TRISTATE_DISABLED && (this.createPanel(c), a.on ? a.panel.hide() : a.panel.showBlock(this._.id, this.document.getById(this._.id), 4))
                }
                CKEDITOR.ui.panelButton = CKEDITOR.tools.createClass({
                    base: CKEDITOR.ui.button,
                    $: function(c) {
                        var a = c.panel || {};
                        delete c.panel;
                        this.base(c);
                        this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
                        a.block = {
                            attributes: a.attributes
                        };
                        this.hasArrow = a.toolbarRelated = !0;
                        this.click = e;
                        this._ = {
                            panelDefinition: a
                        }
                    },
                    statics: {
                        handler: {
                            create: function(c) {
                                return new CKEDITOR.ui.panelButton(c)
                            }
                        }
                    },
                    proto: {
                        createPanel: function(c) {
                            var a = this._;
                            if (!a.panel) {
                                var f = this._.panelDefinition,
                                    e = this._.panelDefinition.block,
                                    g = f.parent || CKEDITOR.document.getBody(),
                                    d = this._.panel = new CKEDITOR.ui.floatPanel(c, g, f),
                                    f = d.addBlock(a.id, e),
                                    b = this;
                                d.onShow = function() {
                                    b.className && this.element.addClass(b.className + "_panel");
                                    b.setState(CKEDITOR.TRISTATE_ON);
                                    a.on = 1;
                                    b.editorFocus && c.focus();
                                    if (b.onOpen) b.onOpen()
                                };
                                d.onHide = function(d) {
                                    b.className && this.element.getFirst().removeClass(b.className + "_panel");
                                    b.setState(b.modes && b.modes[c.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
                                    a.on = 0;
                                    if (!d && b.onClose) b.onClose()
                                };
                                d.onEscape = function() {
                                    d.hide(1);
                                    b.document.getById(a.id).focus()
                                };
                                if (this.onBlock) this.onBlock(d, f);
                                f.onHide = function() {
                                    a.on = 0;
                                    b.setState(CKEDITOR.TRISTATE_OFF)
                                }
                            }
                        }
                    }
                })
            },
            beforeInit: function(e) {
                e.ui.addHandler(CKEDITOR.UI_PANELBUTTON, CKEDITOR.ui.panelButton.handler)
            }
        });
        CKEDITOR.UI_PANELBUTTON = "panelbutton";
        (function() {
            CKEDITOR.plugins.add("panel", {
                beforeInit: function(a) {
                    a.ui.addHandler(CKEDITOR.UI_PANEL, CKEDITOR.ui.panel.handler)
                }
            });
            CKEDITOR.UI_PANEL = "panel";
            CKEDITOR.ui.panel = function(a, b) {
                b && CKEDITOR.tools.extend(this, b);
                CKEDITOR.tools.extend(this, {
                    className: "",
                    css: []
                });
                this.id = CKEDITOR.tools.getNextId();
                this.document = a;
                this.isFramed = this.forceIFrame || this.css.length;
                this._ = {
                    blocks: {}
                }
            };
            CKEDITOR.ui.panel.handler = {
                create: function(a) {
                    return new CKEDITOR.ui.panel(a)
                }
            };
            var f = CKEDITOR.addTemplate("panel", '<div lang="{langCode}" id="{id}" dir={dir} class="cke cke_reset_all {editorId} cke_panel cke_panel {cls} cke_{dir}" style="z-index:{z-index}" role="presentation">{frame}</div>'),
                g = CKEDITOR.addTemplate("panel-frame", '<iframe id="{id}" class="cke_panel_frame" role="presentation" frameborder="0" src="{src}"></iframe>'),
                h = CKEDITOR.addTemplate("panel-frame-inner", '<!DOCTYPE html><html class="cke_panel_container {env}" dir="{dir}" lang="{langCode}"><head>{css}</head><body class="cke_{dir}" style="margin:0;padding:0" onload="{onload}"></body></html>');
            CKEDITOR.ui.panel.prototype = {
                render: function(a, b) {
                    this.getHolderElement = function() {
                        var a = this._.holder;
                        if (!a) {
                            if (this.isFramed) {
                                var a = this.document.getById(this.id + "_frame"),
                                    b = a.getParent(),
                                    a = a.getFrameDocument();
                                CKEDITOR.env.iOS && b.setStyles({
                                    overflow: "scroll",
                                    "-webkit-overflow-scrolling": "touch"
                                });
                                b = CKEDITOR.tools.addFunction(CKEDITOR.tools.bind(function() {
                                    this.isLoaded = !0;
                                    if (this.onLoad) this.onLoad()
                                }, this));
                                a.write(h.output(CKEDITOR.tools.extend({
                                    css: CKEDITOR.tools.buildStyleHtml(this.css),
                                    onload: "window.parent.CKEDITOR.tools.callFunction(" + b + ");"
                                }, d)));
                                a.getWindow().$.CKEDITOR = CKEDITOR;
                                a.on("keydown", function(a) {
                                    var b = a.data.getKeystroke(),
                                        c = this.document.getById(this.id).getAttribute("dir");
                                    this._.onKeyDown && !1 === this._.onKeyDown(b) ? a.data.preventDefault() : (27 == b || b == ("rtl" == c ? 39 : 37)) && this.onEscape && !1 === this.onEscape(b) && a.data.preventDefault()
                                }, this);
                                a = a.getBody();
                                a.unselectable();
                                CKEDITOR.env.air && CKEDITOR.tools.callFunction(b)
                            } else a = this.document.getById(this.id);
                            this._.holder = a
                        }
                        return a
                    };
                    var d = {
                        editorId: a.id,
                        id: this.id,
                        langCode: a.langCode,
                        dir: a.lang.dir,
                        cls: this.className,
                        frame: "",
                        env: CKEDITOR.env.cssClass,
                        "z-index": a.config.baseFloatZIndex + 1
                    };
                    if (this.isFramed) {
                        var e = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie ? "javascript:void(function(){" + encodeURIComponent("document.open();(" + CKEDITOR.tools.fixDomain + ")();document.close();") + "}())" : "";
                        d.frame = g.output({
                            id: this.id + "_frame",
                            src: e
                        })
                    }
                    e = f.output(d);
                    b && b.push(e);
                    return e
                },
                addBlock: function(a, b) {
                    b = this._.blocks[a] = b instanceof CKEDITOR.ui.panel.block ? b : new CKEDITOR.ui.panel.block(this.getHolderElement(), b);
                    this._.currentBlock || this.showBlock(a);
                    return b
                },
                getBlock: function(a) {
                    return this._.blocks[a]
                },
                showBlock: function(a) {
                    a = this._.blocks[a];
                    var b = this._.currentBlock,
                        d = !this.forceIFrame || CKEDITOR.env.ie ? this._.holder : this.document.getById(this.id + "_frame");
                    b && b.hide();
                    this._.currentBlock = a;
                    CKEDITOR.fire("ariaWidget", d);
                    a._.focusIndex = -1;
                    this._.onKeyDown = a.onKeyDown && CKEDITOR.tools.bind(a.onKeyDown, a);
                    a.show();
                    return a
                },
                destroy: function() {
                    this.element && this.element.remove()
                }
            };
            CKEDITOR.ui.panel.block = CKEDITOR.tools.createClass({
                $: function(a, b) {
                    this.element = a.append(a.getDocument().createElement("div", {
                        attributes: {
                            tabindex: -1,
                            "class": "cke_panel_block"
                        },
                        styles: {
                            display: "none"
                        }
                    }));
                    b && CKEDITOR.tools.extend(this, b);
                    this.element.setAttributes({
                        role: this.attributes.role || "presentation",
                        "aria-label": this.attributes["aria-label"],
                        title: this.attributes.title || this.attributes["aria-label"]
                    });
                    this.keys = {};
                    this._.focusIndex = -1;
                    this.element.disableContextMenu()
                },
                _: {
                    markItem: function(a) {
                        -1 != a && (a = this.element.getElementsByTag("a").getItem(this._.focusIndex = a), CKEDITOR.env.webkit && a.getDocument().getWindow().focus(), a.focus(), this.onMark && this.onMark(a))
                    }
                },
                proto: {
                    show: function() {
                        this.element.setStyle("display", "")
                    },
                    hide: function() {
                        this.onHide && !0 === this.onHide.call(this) || this.element.setStyle("display", "none")
                    },
                    onKeyDown: function(a, b) {
                        var d = this.keys[a];
                        switch (d) {
                            case "next":
                                for (var e = this._.focusIndex, d = this.element.getElementsByTag("a"), c; c = d.getItem(++e);)
                                    if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
                                        this._.focusIndex = e;
                                        c.focus();
                                        break
                                    }
                                return c || b ? !1 : (this._.focusIndex = -1, this.onKeyDown(a, 1));
                            case "prev":
                                e = this._.focusIndex;
                                for (d = this.element.getElementsByTag("a"); 0 < e && (c = d.getItem(--e));) {
                                    if (c.getAttribute("_cke_focus") && c.$.offsetWidth) {
                                        this._.focusIndex = e;
                                        c.focus();
                                        break
                                    }
                                    c = null
                                }
                                return c || b ? !1 : (this._.focusIndex = d.count(), this.onKeyDown(a, 1));
                            case "click":
                            case "mouseup":
                                return e = this._.focusIndex, (c = 0 <= e && this.element.getElementsByTag("a").getItem(e)) && (c.$[d] ? c.$[d]() : c.$["on" + d]()), !1
                        }
                        return !0
                    }
                }
            })
        })();
        CKEDITOR.plugins.add("floatpanel", {
            requires: "panel"
        });
        (function() {
            function v(a, b, c, l, h) {
                h = CKEDITOR.tools.genKey(b.getUniqueId(), c.getUniqueId(), a.lang.dir, a.uiColor || "", l.css || "", h || "");
                var g = f[h];
                g || (g = f[h] = new CKEDITOR.ui.panel(b, l), g.element = c.append(CKEDITOR.dom.element.createFromHtml(g.render(a), b)), g.element.setStyles({
                    display: "none",
                    position: "absolute"
                }));
                return g
            }
            var f = {};
            CKEDITOR.ui.floatPanel = CKEDITOR.tools.createClass({
                $: function(a, b, c, l) {
                    function h() {
                        e.hide()
                    }
                    c.forceIFrame = 1;
                    c.toolbarRelated && a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (b = CKEDITOR.document.getById("cke_" + a.name));
                    var g = b.getDocument();
                    l = v(a, g, b, c, l || 0);
                    var m = l.element,
                        p = m.getFirst(),
                        e = this;
                    m.disableContextMenu();
                    this.element = m;
                    this._ = {
                        editor: a,
                        panel: l,
                        parentElement: b,
                        definition: c,
                        document: g,
                        iframe: p,
                        children: [],
                        dir: a.lang.dir,
                        showBlockParams: null
                    };
                    a.on("mode", h);
                    a.on("resize", h);
                    g.getWindow().on("resize", function() {
                        this.reposition()
                    }, this)
                },
                proto: {
                    addBlock: function(a, b) {
                        return this._.panel.addBlock(a, b)
                    },
                    addListBlock: function(a, b) {
                        return this._.panel.addListBlock(a, b)
                    },
                    getBlock: function(a) {
                        return this._.panel.getBlock(a)
                    },
                    showBlock: function(a, b, c, l, h, g) {
                        var m = this._.panel,
                            p = m.showBlock(a);
                        this._.showBlockParams = [].slice.call(arguments);
                        this.allowBlur(!1);
                        var e = this._.editor.editable();
                        this._.returnFocus = e.hasFocus ? e : new CKEDITOR.dom.element(CKEDITOR.document.$.activeElement);
                        this._.hideTimeout = 0;
                        var k = this.element,
                            e = this._.iframe,
                            e = CKEDITOR.env.ie && !CKEDITOR.env.edge ? e : new CKEDITOR.dom.window(e.$.contentWindow),
                            f = k.getDocument(),
                            r = this._.parentElement.getPositionedAncestor(),
                            t = b.getDocumentPosition(f),
                            f = r ? r.getDocumentPosition(f) : {
                                x: 0,
                                y: 0
                            },
                            q = "rtl" == this._.dir,
                            d = t.x + (l || 0) - f.x,
                            n = t.y + (h || 0) - f.y;
                        !q || 1 != c && 4 != c ? q || 2 != c && 3 != c || (d += b.$.offsetWidth - 1) : d += b.$.offsetWidth;
                        if (3 == c || 4 == c) n += b.$.offsetHeight - 1;
                        this._.panel._.offsetParentId = b.getId();
                        k.setStyles({
                            top: n + "px",
                            left: 0,
                            display: ""
                        });
                        k.setOpacity(0);
                        k.getFirst().removeStyle("width");
                        this._.editor.focusManager.add(e);
                        this._.blurSet || (CKEDITOR.event.useCapture = !0, e.on("blur", function(a) {
                                function u() {
                                    delete this._.returnFocus;
                                    this.hide()
                                }
                                this.allowBlur() && a.data.getPhase() == CKEDITOR.EVENT_PHASE_AT_TARGET && this.visible && !this._.activeChild && (CKEDITOR.env.iOS ? this._.hideTimeout || (this._.hideTimeout = CKEDITOR.tools.setTimeout(u, 0, this)) : u.call(this))
                            }, this), e.on("focus", function() {
                                this._.focused = !0;
                                this.hideChild();
                                this.allowBlur(!0)
                            }, this), CKEDITOR.env.iOS && (e.on("touchstart", function() {
                                clearTimeout(this._.hideTimeout)
                            }, this), e.on("touchend", function() {
                                this._.hideTimeout = 0;
                                this.focus()
                            }, this)), CKEDITOR.event.useCapture = !1,
                            this._.blurSet = 1);
                        m.onEscape = CKEDITOR.tools.bind(function(a) {
                            if (this.onEscape && !1 === this.onEscape(a)) return !1
                        }, this);
                        CKEDITOR.tools.setTimeout(function() {
                            var a = CKEDITOR.tools.bind(function() {
                                var a = k;
                                a.removeStyle("width");
                                if (p.autoSize) {
                                    var b = p.element.getDocument(),
                                        b = (CKEDITOR.env.webkit || CKEDITOR.env.edge ? p.element : b.getBody()).$.scrollWidth;
                                    CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetWidth || 0) - (a.$.clientWidth || 0) + 3);
                                    a.setStyle("width", b + 10 + "px");
                                    b = p.element.$.scrollHeight;
                                    CKEDITOR.env.ie && CKEDITOR.env.quirks && 0 < b && (b += (a.$.offsetHeight || 0) - (a.$.clientHeight || 0) + 3);
                                    a.setStyle("height", b + "px");
                                    m._.currentBlock.element.setStyle("display", "none").removeStyle("display")
                                } else a.removeStyle("height");
                                q && (d -= k.$.offsetWidth);
                                k.setStyle("left", d + "px");
                                var b = m.element.getWindow(),
                                    a = k.$.getBoundingClientRect(),
                                    b = b.getViewPaneSize(),
                                    c = a.width || a.right - a.left,
                                    e = a.height || a.bottom - a.top,
                                    l = q ? a.right : b.width - a.left,
                                    h = q ? b.width - a.right : a.left;
                                q ? l < c && (d = h > c ? d + c : b.width > c ? d - a.left : d - a.right + b.width) : l < c && (d = h > c ? d - c : b.width > c ? d - a.right + b.width : d - a.left);
                                c = a.top;
                                b.height - a.top < e && (n = c > e ? n - e : b.height > e ? n - a.bottom + b.height : n - a.top);
                                CKEDITOR.env.ie && (b = a = new CKEDITOR.dom.element(k.$.offsetParent), "html" == b.getName() && (b = b.getDocument().getBody()), "rtl" == b.getComputedStyle("direction") && (d = CKEDITOR.env.ie8Compat ? d - 2 * k.getDocument().getDocumentElement().$.scrollLeft : d - (a.$.scrollWidth - a.$.clientWidth)));
                                var a = k.getFirst(),
                                    f;
                                (f = a.getCustomData("activePanel")) && f.onHide && f.onHide.call(this, 1);
                                a.setCustomData("activePanel", this);
                                k.setStyles({
                                    top: n + "px",
                                    left: d + "px"
                                });
                                k.setOpacity(1);
                                g && g()
                            }, this);
                            m.isLoaded ? a() : m.onLoad = a;
                            CKEDITOR.tools.setTimeout(function() {
                                var a = CKEDITOR.env.webkit && CKEDITOR.document.getWindow().getScrollPosition().y;
                                this.focus();
                                p.element.focus();
                                CKEDITOR.env.webkit && (CKEDITOR.document.getBody().$.scrollTop = a);
                                this.allowBlur(!0);
                                this._.editor.fire("panelShow", this)
                            }, 0, this)
                        }, CKEDITOR.env.air ? 200 : 0, this);
                        this.visible = 1;
                        this.onShow && this.onShow.call(this)
                    },
                    reposition: function() {
                        var a = this._.showBlockParams;
                        this.visible && this._.showBlockParams && (this.hide(), this.showBlock.apply(this, a))
                    },
                    focus: function() {
                        if (CKEDITOR.env.webkit) {
                            var a = CKEDITOR.document.getActive();
                            a && !a.equals(this._.iframe) && a.$.blur()
                        }(this._.lastFocused || this._.iframe.getFrameDocument().getWindow()).focus()
                    },
                    blur: function() {
                        var a = this._.iframe.getFrameDocument().getActive();
                        a && a.is("a") && (this._.lastFocused = a)
                    },
                    hide: function(a) {
                        if (this.visible && (!this.onHide || !0 !== this.onHide.call(this))) {
                            this.hideChild();
                            CKEDITOR.env.gecko && this._.iframe.getFrameDocument().$.activeElement.blur();
                            this.element.setStyle("display", "none");
                            this.visible = 0;
                            this.element.getFirst().removeCustomData("activePanel");
                            if (a = a && this._.returnFocus) CKEDITOR.env.webkit && a.type && a.getWindow().$.focus(), a.focus();
                            delete this._.lastFocused;
                            this._.showBlockParams = null;
                            this._.editor.fire("panelHide", this)
                        }
                    },
                    allowBlur: function(a) {
                        var b = this._.panel;
                        void 0 !== a && (b.allowBlur = a);
                        return b.allowBlur
                    },
                    showAsChild: function(a, b, c, f, h, g) {
                        if (this._.activeChild != a || a._.panel._.offsetParentId != c.getId()) this.hideChild(), a.onHide = CKEDITOR.tools.bind(function() {
                            CKEDITOR.tools.setTimeout(function() {
                                this._.focused || this.hide()
                            }, 0, this)
                        }, this), this._.activeChild = a, this._.focused = !1, a.showBlock(b, c, f, h, g), this.blur(), (CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat) && setTimeout(function() {
                            a.element.getChild(0).$.style.cssText += ""
                        }, 100)
                    },
                    hideChild: function(a) {
                        var b = this._.activeChild;
                        b && (delete b.onHide, delete this._.activeChild, b.hide(), a && this.focus())
                    }
                }
            });
            CKEDITOR.on("instanceDestroyed", function() {
                var a = CKEDITOR.tools.isEmpty(CKEDITOR.instances),
                    b;
                for (b in f) {
                    var c = f[b];
                    a ? c.destroy() : c.element.hide()
                }
                a && (f = {})
            })
        })();
        CKEDITOR.plugins.add("colorbutton", {
            requires: "panelbutton,floatpanel",
            init: function(c) {
                function r(p, h, e, f) {
                    var l = new CKEDITOR.style(k["colorButton_" + h + "Style"]),
                        m = CKEDITOR.tools.getNextId() + "_colorBox";
                    c.ui.add(p, CKEDITOR.UI_PANELBUTTON, {
                        label: e,
                        title: e,
                        modes: {
                            wysiwyg: 1
                        },
                        editorFocus: 0,
                        toolbar: "colors," + f,
                        allowedContent: l,
                        requiredContent: l,
                        panel: {
                            css: CKEDITOR.skin.getPath("editor"),
                            attributes: {
                                role: "listbox",
                                "aria-label": g.panelTitle
                            }
                        },
                        onBlock: function(a, b) {
                            b.autoSize = !0;
                            b.element.addClass("cke_colorblock");
                            b.element.setHtml(u(a, h, m));
                            b.element.getDocument().getBody().setStyle("overflow", "hidden");
                            CKEDITOR.ui.fire("ready", this);
                            var d = b.keys,
                                e = "rtl" == c.lang.dir;
                            d[e ? 37 : 39] = "next";
                            d[40] = "next";
                            d[9] = "next";
                            d[e ? 39 : 37] = "prev";
                            d[38] = "prev";
                            d[CKEDITOR.SHIFT + 9] = "prev";
                            d[32] = "click"
                        },
                        refresh: function() {
                            c.activeFilter.check(l) || this.setState(CKEDITOR.TRISTATE_DISABLED)
                        },
                        onOpen: function() {
                            var a = c.getSelection(),
                                a = a && a.getStartElement(),
                                a = c.elementPath(a),
                                b;
                            if (a) {
                                a = a.block || a.blockLimit || c.document.getBody();
                                do b = a && a.getComputedStyle("back" == h ? "background-color" : "color") || "transparent"; while ("back" == h && "transparent" == b && a && (a = a.getParent()));
                                b && "transparent" != b || (b = "#ffffff");
                                !1 !== k.colorButton_enableAutomatic && this._.panel._.iframe.getFrameDocument().getById(m).setStyle("background-color", b);
                                return b
                            }
                        }
                    })
                }

                function u(p, h, e) {
                    var f = [],
                        l = k.colorButton_colors.split(","),
                        m = c.plugins.colordialog && !1 !== k.colorButton_enableMore,
                        a = l.length + (m ? 2 : 1),
                        b = CKEDITOR.tools.addFunction(function(a, b) {
                            function d(a) {
                                this.removeListener("ok", d);
                                this.removeListener("cancel", d);
                                "ok" == a.name && e(this.getContentElement("picker", "selectedColor").getValue(), b)
                            }
                            var e = arguments.callee;
                            if ("?" == a) c.openDialog("colordialog", function() {
                                this.on("ok", d);
                                this.on("cancel", d)
                            });
                            else {
                                c.focus();
                                p.hide();
                                c.fire("saveSnapshot");
                                c.removeStyle(new CKEDITOR.style(k["colorButton_" + b + "Style"], {
                                    color: "inherit"
                                }));
                                if (a) {
                                    var f = k["colorButton_" + b + "Style"];
                                    f.childRule = "back" == b ? function(a) {
                                        return t(a)
                                    } : function(a) {
                                        return !(a.is("a") || a.getElementsByTag("a").count()) || t(a)
                                    };
                                    c.applyStyle(new CKEDITOR.style(f, {
                                        color: a
                                    }))
                                }
                                c.fire("saveSnapshot")
                            }
                        });
                    !1 !== k.colorButton_enableAutomatic && f.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="', g.auto, '" onclick="CKEDITOR.tools.callFunction(', b, ",null,'", h, "');return false;\" href=\"javascript:void('", g.auto, '\')" role="option" aria-posinset="1" aria-setsize="', a, '"><table role="presentation" cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" id="', e, '"></span></td><td colspan=7 align=center>', g.auto, "</td></tr></table></a>");
                    f.push('<table role="presentation" cellspacing=0 cellpadding=0 width="100%">');
                    for (e = 0; e < l.length; e++) {
                        0 === e % 8 && f.push("</tr><tr>");
                        var d = l[e].split("/"),
                            n = d[0],
                            q = d[1] || n;
                        d[1] || (n = "#" + n.replace(/^(.)(.)(.)$/, "$1$1$2$2$3$3"));
                        d = c.lang.colorbutton.colors[q] || q;
                        f.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="', d, '" onclick="CKEDITOR.tools.callFunction(', b, ",'", n, "','", h, "'); return false;\" href=\"javascript:void('", d, '\')" role="option" aria-posinset="', e + 2, '" aria-setsize="', a, '"><span class="cke_colorbox" style="background-color:#', q, '"></span></a></td>')
                    }
                    m && f.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="', g.more, '" onclick="CKEDITOR.tools.callFunction(', b, ",'?','", h, "');return false;\" href=\"javascript:void('", g.more, "')\"", ' role="option" aria-posinset="', a, '" aria-setsize="', a, '">', g.more, "</a></td>");
                    f.push("</tr></table>");
                    return f.join("")
                }

                function t(c) {
                    return "false" == c.getAttribute("contentEditable") || c.getAttribute("data-nostyle")
                }
                var k = c.config,
                    g = c.lang.colorbutton;
                CKEDITOR.env.hc || (r("TextColor", "fore", g.textColorTitle, 10), r("BGColor", "back", g.bgColorTitle, 20))
            }
        });
        CKEDITOR.config.colorButton_colors = "000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF";
        CKEDITOR.config.colorButton_foreStyle = {
            element: "span",
            styles: {
                color: "#(color)"
            },
            overrides: [{
                element: "font",
                attributes: {
                    color: null
                }
            }]
        };
        CKEDITOR.config.colorButton_backStyle = {
            element: "span",
            styles: {
                "background-color": "#(color)"
            }
        };
        CKEDITOR.plugins.colordialog = {
            requires: "dialog",
            init: function(b) {
                var c = new CKEDITOR.dialogCommand("colordialog");
                c.editorFocus = !1;
                b.addCommand("colordialog", c);
                CKEDITOR.dialog.add("colordialog", this.path + "dialogs/colordialog.js");
                b.getColorFromDialog = function(c, f) {
                    var d = function(a) {
                            this.removeListener("ok", d);
                            this.removeListener("cancel", d);
                            a = "ok" == a.name ? this.getValueOf("picker", "selectedColor") : null;
                            c.call(f, a)
                        },
                        e = function(a) {
                            a.on("ok", d);
                            a.on("cancel", d)
                        };
                    b.execCommand("colordialog");
                    if (b._.storedDialogs && b._.storedDialogs.colordialog) e(b._.storedDialogs.colordialog);
                    else CKEDITOR.on("dialogDefinition", function(a) {
                        if ("colordialog" == a.data.name) {
                            var b = a.data.definition;
                            a.removeListener();
                            b.onLoad = CKEDITOR.tools.override(b.onLoad, function(a) {
                                return function() {
                                    e(this);
                                    b.onLoad = a;
                                    "function" == typeof a && a.call(this)
                                }
                            })
                        }
                    })
                }
            }
        };
        CKEDITOR.plugins.add("colordialog", CKEDITOR.plugins.colordialog);
        (function() {
            CKEDITOR.plugins.add("templates", {
                requires: "dialog",
                init: function(a) {
                    CKEDITOR.dialog.add("templates", CKEDITOR.getUrl(this.path + "dialogs/templates.js"));
                    a.addCommand("templates", new CKEDITOR.dialogCommand("templates"));
                    a.ui.addButton && a.ui.addButton("Templates", {
                        label: a.lang.templates.button,
                        command: "templates",
                        toolbar: "doctools,10"
                    })
                }
            });
            var c = {},
                f = {};
            CKEDITOR.addTemplates = function(a, d) {
                c[a] = d
            };
            CKEDITOR.getTemplates = function(a) {
                return c[a]
            };
            CKEDITOR.loadTemplates = function(a, d) {
                for (var e = [], b = 0, c = a.length; b < c; b++) f[a[b]] || (e.push(a[b]), f[a[b]] = 1);
                e.length ? CKEDITOR.scriptLoader.load(e, d) : setTimeout(d, 0)
            }
        })();
        CKEDITOR.config.templates_files = [CKEDITOR.getUrl("plugins/templates/templates/default.js")];
        CKEDITOR.config.templates_replaceContent = !0;
        CKEDITOR.plugins.add("menu", {
            requires: "floatpanel",
            beforeInit: function(g) {
                for (var h = g.config.menu_groups.split(","), p = g._.menuGroups = {}, n = g._.menuItems = {}, a = 0; a < h.length; a++) p[h[a]] = a + 1;
                g.addMenuGroup = function(b, a) {
                    p[b] = a || 100
                };
                g.addMenuItem = function(a, c) {
                    p[c.group] && (n[a] = new CKEDITOR.menuItem(this, a, c))
                };
                g.addMenuItems = function(a) {
                    for (var c in a) this.addMenuItem(c, a[c])
                };
                g.getMenuItem = function(a) {
                    return n[a]
                };
                g.removeMenuItem = function(a) {
                    delete n[a]
                }
            }
        });
        (function() {
            function g(a) {
                a.sort(function(a, c) {
                    return a.group < c.group ? -1 : a.group > c.group ? 1 : a.order < c.order ? -1 : a.order > c.order ? 1 : 0
                })
            }
            var h = '<span class="cke_menuitem"><a id="{id}" class="cke_menubutton cke_menubutton__{name} cke_menubutton_{state} {cls}" href="{href}" title="{title}" tabindex="-1"_cke_focus=1 hidefocus="true" role="{role}" aria-haspopup="{hasPopup}" aria-disabled="{disabled}" {ariaChecked}';
            CKEDITOR.env.gecko && CKEDITOR.env.mac && (h += ' onkeypress="return false;"');
            CKEDITOR.env.gecko && (h += ' onblur="this.style.cssText = this.style.cssText;"');
            var h = h + (' onmouseover="CKEDITOR.tools.callFunction({hoverFn},{index});" onmouseout="CKEDITOR.tools.callFunction({moveOutFn},{index});" ' + (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},{index}); return false;">'),
                p = CKEDITOR.addTemplate("menuItem", h + '<span class="cke_menubutton_inner"><span class="cke_menubutton_icon"><span class="cke_button_icon cke_button__{iconName}_icon" style="{iconStyle}"></span></span><span class="cke_menubutton_label">{label}</span>{arrowHtml}</span></a></span>'),
                n = CKEDITOR.addTemplate("menuArrow", '<span class="cke_menuarrow"><span>{label}</span></span>');
            CKEDITOR.menu = CKEDITOR.tools.createClass({
                $: function(a, b) {
                    b = this._.definition = b || {};
                    this.id = CKEDITOR.tools.getNextId();
                    this.editor = a;
                    this.items = [];
                    this._.listeners = [];
                    this._.level = b.level || 1;
                    var c = CKEDITOR.tools.extend({}, b.panel, {
                            css: [CKEDITOR.skin.getPath("editor")],
                            level: this._.level - 1,
                            block: {}
                        }),
                        m = c.block.attributes = c.attributes || {};
                    !m.role && (m.role = "menu");
                    this._.panelDefinition = c
                },
                _: {
                    onShow: function() {
                        var a = this.editor.getSelection(),
                            b = a && a.getStartElement(),
                            c = this.editor.elementPath(),
                            m = this._.listeners;
                        this.removeAll();
                        for (var e = 0; e < m.length; e++) {
                            var l = m[e](b, a, c);
                            if (l)
                                for (var k in l) {
                                    var f = this.editor.getMenuItem(k);
                                    !f || f.command && !this.editor.getCommand(f.command).state || (f.state = l[k], this.add(f))
                                }
                        }
                    },
                    onClick: function(a) {
                        this.hide();
                        if (a.onClick) a.onClick();
                        else a.command && this.editor.execCommand(a.command)
                    },
                    onEscape: function(a) {
                        var b = this.parent;
                        b ? b._.panel.hideChild(1) : 27 == a && this.hide(1);
                        return !1
                    },
                    onHide: function() {
                        this.onHide && this.onHide()
                    },
                    showSubMenu: function(a) {
                        var b = this._.subMenu,
                            c = this.items[a];
                        if (c = c.getItems && c.getItems()) {
                            b ? b.removeAll() : (b = this._.subMenu = new CKEDITOR.menu(this.editor, CKEDITOR.tools.extend({}, this._.definition, {
                                level: this._.level + 1
                            }, !0)), b.parent = this, b._.onClick = CKEDITOR.tools.bind(this._.onClick, this));
                            for (var m in c) {
                                var e = this.editor.getMenuItem(m);
                                e && (e.state = c[m], b.add(e))
                            }
                            var l = this._.panel.getBlock(this.id).element.getDocument().getById(this.id + String(a));
                            setTimeout(function() {
                                b.show(l, 2)
                            }, 0)
                        } else this._.panel.hideChild(1)
                    }
                },
                proto: {
                    add: function(a) {
                        a.order || (a.order = this.items.length);
                        this.items.push(a)
                    },
                    removeAll: function() {
                        this.items = []
                    },
                    show: function(a, b, c, m) {
                        if (!this.parent && (this._.onShow(), !this.items.length)) return;
                        b = b || ("rtl" == this.editor.lang.dir ? 2 : 1);
                        var e = this.items,
                            l = this.editor,
                            k = this._.panel,
                            f = this._.element;
                        if (!k) {
                            k = this._.panel = new CKEDITOR.ui.floatPanel(this.editor, CKEDITOR.document.getBody(), this._.panelDefinition, this._.level);
                            k.onEscape = CKEDITOR.tools.bind(function(a) {
                                if (!1 === this._.onEscape(a)) return !1
                            }, this);
                            k.onShow = function() {
                                k._.panel.getHolderElement().getParent().addClass("cke").addClass("cke_reset_all")
                            };
                            k.onHide = CKEDITOR.tools.bind(function() {
                                this._.onHide && this._.onHide()
                            }, this);
                            f = k.addBlock(this.id, this._.panelDefinition.block);
                            f.autoSize = !0;
                            var d = f.keys;
                            d[40] = "next";
                            d[9] = "next";
                            d[38] = "prev";
                            d[CKEDITOR.SHIFT + 9] = "prev";
                            d["rtl" == l.lang.dir ? 37 : 39] = CKEDITOR.env.ie ? "mouseup" : "click";
                            d[32] = CKEDITOR.env.ie ? "mouseup" : "click";
                            CKEDITOR.env.ie && (d[13] = "mouseup");
                            f = this._.element = f.element;
                            d = f.getDocument();
                            d.getBody().setStyle("overflow", "hidden");
                            d.getElementsByTag("html").getItem(0).setStyle("overflow", "hidden");
                            this._.itemOverFn = CKEDITOR.tools.addFunction(function(a) {
                                clearTimeout(this._.showSubTimeout);
                                this._.showSubTimeout = CKEDITOR.tools.setTimeout(this._.showSubMenu, l.config.menu_subMenuDelay || 400, this, [a])
                            }, this);
                            this._.itemOutFn = CKEDITOR.tools.addFunction(function() {
                                clearTimeout(this._.showSubTimeout)
                            }, this);
                            this._.itemClickFn = CKEDITOR.tools.addFunction(function(a) {
                                var b = this.items[a];
                                if (b.state == CKEDITOR.TRISTATE_DISABLED) this.hide(1);
                                else if (b.getItems) this._.showSubMenu(a);
                                else this._.onClick(b)
                            }, this)
                        }
                        g(e);
                        for (var d = l.elementPath(), d = ['<div class="cke_menu' + (d && d.direction() != l.lang.dir ? " cke_mixed_dir_content" : "") + '" role="presentation">'], h = e.length, p = h && e[0].group, n = 0; n < h; n++) {
                            var q = e[n];
                            p != q.group && (d.push('<div class="cke_menuseparator" role="separator"></div>'), p = q.group);
                            q.render(this, n, d)
                        }
                        d.push("</div>");
                        f.setHtml(d.join(""));
                        CKEDITOR.ui.fire("ready", this);
                        this.parent ? this.parent._.panel.showAsChild(k, this.id, a, b, c, m) : k.showBlock(this.id, a, b, c, m);
                        l.fire("menuShow", [k])
                    },
                    addListener: function(a) {
                        this._.listeners.push(a)
                    },
                    hide: function(a) {
                        this._.onHide && this._.onHide();
                        this._.panel && this._.panel.hide(a)
                    }
                }
            });
            CKEDITOR.menuItem = CKEDITOR.tools.createClass({
                $: function(a, b, c) {
                    CKEDITOR.tools.extend(this, c, {
                        order: 0,
                        className: "cke_menubutton__" + b
                    });
                    this.group = a._.menuGroups[this.group];
                    this.editor = a;
                    this.name = b
                },
                proto: {
                    render: function(a, b, c) {
                        var h = a.id + String(b),
                            e = "undefined" == typeof this.state ? CKEDITOR.TRISTATE_OFF : this.state,
                            l = "",
                            k = e == CKEDITOR.TRISTATE_ON ? "on" : e == CKEDITOR.TRISTATE_DISABLED ? "disabled" : "off";
                        this.role in {
                            menuitemcheckbox: 1,
                            menuitemradio: 1
                        } && (l = ' aria-checked="' + (e == CKEDITOR.TRISTATE_ON ? "true" : "false") + '"');
                        var f = this.getItems,
                            d = "&#" + ("rtl" == this.editor.lang.dir ? "9668" : "9658") + ";",
                            g = this.name;
                        this.icon && !/\./.test(this.icon) && (g = this.icon);
                        a = {
                            id: h,
                            name: this.name,
                            iconName: g,
                            label: this.label,
                            cls: this.className || "",
                            state: k,
                            hasPopup: f ? "true" : "false",
                            disabled: e == CKEDITOR.TRISTATE_DISABLED,
                            title: this.label,
                            href: "javascript:void('" + (this.label || "").replace("'") + "')",
                            hoverFn: a._.itemOverFn,
                            moveOutFn: a._.itemOutFn,
                            clickFn: a._.itemClickFn,
                            index: b,
                            iconStyle: CKEDITOR.skin.getIconStyle(g, "rtl" == this.editor.lang.dir, g == this.icon ? null : this.icon, this.iconOffset),
                            arrowHtml: f ? n.output({
                                label: d
                            }) : "",
                            role: this.role ? this.role : "menuitem",
                            ariaChecked: l
                        };
                        p.output(a, c)
                    }
                }
            })
        })();
        CKEDITOR.config.menu_groups = "clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea,div";
        CKEDITOR.plugins.add("contextmenu", {
            requires: "menu",
            onLoad: function() {
                CKEDITOR.plugins.contextMenu = CKEDITOR.tools.createClass({
                    base: CKEDITOR.menu,
                    $: function(a) {
                        this.base.call(this, a, {
                            panel: {
                                className: "cke_menu_panel",
                                attributes: {
                                    "aria-label": a.lang.contextmenu.options
                                }
                            }
                        })
                    },
                    proto: {
                        addTarget: function(a, e) {
                            a.on("contextmenu", function(a) {
                                a = a.data;
                                var c = CKEDITOR.env.webkit ? f : CKEDITOR.env.mac ? a.$.metaKey : a.$.ctrlKey;
                                if (!e || !c) {
                                    a.preventDefault();
                                    if (CKEDITOR.env.mac && CKEDITOR.env.webkit) {
                                        var c = this.editor,
                                            b = new CKEDITOR.dom.elementPath(a.getTarget(), c.editable()).contains(function(a) {
                                                return a.hasAttribute("contenteditable")
                                            }, !0);
                                        b && "false" == b.getAttribute("contenteditable") && c.getSelection().fake(b)
                                    }
                                    var b = a.getTarget().getDocument(),
                                        d = a.getTarget().getDocument().getDocumentElement(),
                                        c = !b.equals(CKEDITOR.document),
                                        b = b.getWindow().getScrollPosition(),
                                        g = c ? a.$.clientX : a.$.pageX || b.x + a.$.clientX,
                                        h = c ? a.$.clientY : a.$.pageY || b.y + a.$.clientY;
                                    CKEDITOR.tools.setTimeout(function() {
                                        this.open(d, null, g, h)
                                    }, CKEDITOR.env.ie ? 200 : 0, this)
                                }
                            }, this);
                            if (CKEDITOR.env.webkit) {
                                var f, d = function() {
                                    f = 0
                                };
                                a.on("keydown", function(a) {
                                    f = CKEDITOR.env.mac ? a.data.$.metaKey : a.data.$.ctrlKey
                                });
                                a.on("keyup", d);
                                a.on("contextmenu", d)
                            }
                        },
                        open: function(a, e, f, d) {
                            this.editor.focus();
                            a = a || CKEDITOR.document.getDocumentElement();
                            this.editor.selectionChange(1);
                            this.show(a, e, f, d)
                        }
                    }
                })
            },
            beforeInit: function(a) {
                var e = a.contextMenu = new CKEDITOR.plugins.contextMenu(a);
                a.on("contentDom", function() {
                    e.addTarget(a.editable(), !1 !== a.config.browserContextMenuOnCtrl)
                });
                a.addCommand("contextMenu", {
                    exec: function() {
                        a.contextMenu.open(a.document.getBody())
                    }
                });
                a.setKeystroke(CKEDITOR.SHIFT + 121, "contextMenu");
                a.setKeystroke(CKEDITOR.CTRL + CKEDITOR.SHIFT + 121, "contextMenu")
            }
        });
        (function() {
            CKEDITOR.plugins.add("div", {
                requires: "dialog",
                init: function(a) {
                    if (!a.blockless) {
                        var c = a.lang.div,
                            b = "div(*)";
                        CKEDITOR.dialog.isTabEnabled(a, "editdiv", "advanced") && (b += ";div[dir,id,lang,title]{*}");
                        a.addCommand("creatediv", new CKEDITOR.dialogCommand("creatediv", {
                            allowedContent: b,
                            requiredContent: "div",
                            contextSensitive: !0,
                            refresh: function(a, c) {
                                this.setState("div" in (a.config.div_wrapTable ? c.root : c.blockLimit).getDtd() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
                            }
                        }));
                        a.addCommand("editdiv", new CKEDITOR.dialogCommand("editdiv", {
                            requiredContent: "div"
                        }));
                        a.addCommand("removediv", {
                            requiredContent: "div",
                            exec: function(a) {
                                function c(b) {
                                    (b = CKEDITOR.plugins.div.getSurroundDiv(a, b)) && !b.data("cke-div-added") && (f.push(b), b.data("cke-div-added"))
                                }
                                for (var b = a.getSelection(), g = b && b.getRanges(), e, h = b.createBookmarks(), f = [], d = 0; d < g.length; d++) e = g[d], e.collapsed ? c(b.getStartElement()) : (e = new CKEDITOR.dom.walker(e), e.evaluator = c, e.lastForward());
                                for (d = 0; d < f.length; d++) f[d].remove(!0);
                                b.selectBookmarks(h)
                            }
                        });
                        a.ui.addButton && a.ui.addButton("CreateDiv", {
                            label: c.toolbar,
                            command: "creatediv",
                            toolbar: "blocks,50"
                        });
                        a.addMenuItems && (a.addMenuItems({
                            editdiv: {
                                label: c.edit,
                                command: "editdiv",
                                group: "div",
                                order: 1
                            },
                            removediv: {
                                label: c.remove,
                                command: "removediv",
                                group: "div",
                                order: 5
                            }
                        }), a.contextMenu && a.contextMenu.addListener(function(b) {
                            return !b || b.isReadOnly() ? null : CKEDITOR.plugins.div.getSurroundDiv(a) ? {
                                editdiv: CKEDITOR.TRISTATE_OFF,
                                removediv: CKEDITOR.TRISTATE_OFF
                            } : null
                        }));
                        CKEDITOR.dialog.add("creatediv", this.path + "dialogs/div.js");
                        CKEDITOR.dialog.add("editdiv", this.path + "dialogs/div.js")
                    }
                }
            });
            CKEDITOR.plugins.div = {
                getSurroundDiv: function(a, c) {
                    var b = a.elementPath(c);
                    return a.elementPath(b.blockLimit).contains(function(a) {
                        return a.is("div") && !a.isReadOnly()
                    }, 1)
                }
            }
        })();
        CKEDITOR.plugins.add("resize", {
            init: function(b) {
                function f(d) {
                    var e = c.width,
                        m = c.height,
                        f = e + (d.data.$.screenX - n.x) * ("rtl" == g ? -1 : 1);
                    d = m + (d.data.$.screenY - n.y);
                    h && (e = Math.max(a.resize_minWidth, Math.min(f, a.resize_maxWidth)));
                    p && (m = Math.max(a.resize_minHeight, Math.min(d, a.resize_maxHeight)));
                    b.resize(h ? e : null, m)
                }

                function k() {
                    CKEDITOR.document.removeListener("mousemove", f);
                    CKEDITOR.document.removeListener("mouseup", k);
                    b.document && (b.document.removeListener("mousemove", f), b.document.removeListener("mouseup", k))
                }
                var a = b.config,
                    r = b.ui.spaceId("resizer"),
                    g = b.element ? b.element.getDirection(1) : "ltr";
                !a.resize_dir && (a.resize_dir = "vertical");
                void 0 === a.resize_maxWidth && (a.resize_maxWidth = 3e3);
                void 0 === a.resize_maxHeight && (a.resize_maxHeight = 3e3);
                void 0 === a.resize_minWidth && (a.resize_minWidth = 750);
                void 0 === a.resize_minHeight && (a.resize_minHeight = 250);
                if (!1 !== a.resize_enabled) {
                    var l = null,
                        n, c, h = ("both" == a.resize_dir || "horizontal" == a.resize_dir) && a.resize_minWidth != a.resize_maxWidth,
                        p = ("both" == a.resize_dir || "vertical" == a.resize_dir) && a.resize_minHeight != a.resize_maxHeight,
                        q = CKEDITOR.tools.addFunction(function(d) {
                            l || (l = b.getResizable());
                            c = {
                                width: l.$.offsetWidth || 0,
                                height: l.$.offsetHeight || 0
                            };
                            n = {
                                x: d.screenX,
                                y: d.screenY
                            };
                            a.resize_minWidth > c.width && (a.resize_minWidth = c.width);
                            a.resize_minHeight > c.height && (a.resize_minHeight = c.height);
                            CKEDITOR.document.on("mousemove", f);
                            CKEDITOR.document.on("mouseup", k);
                            b.document && (b.document.on("mousemove", f), b.document.on("mouseup", k));
                            d.preventDefault && d.preventDefault()
                        });
                    b.on("destroy", function() {
                        CKEDITOR.tools.removeFunction(q)
                    });
                    b.on("uiSpace", function(a) {
                        if ("bottom" == a.data.space) {
                            var e = "";
                            h && !p && (e = " cke_resizer_horizontal");
                            !h && p && (e = " cke_resizer_vertical");
                            var c = '<span id="' + r + '" class="cke_resizer' + e + " cke_resizer_" + g + '" title="' + CKEDITOR.tools.htmlEncode(b.lang.common.resize) + '" onmousedown="CKEDITOR.tools.callFunction(' + q + ', event)">' + ("ltr" == g ? "◢" : "◣") + "</span>";
                            "ltr" == g && "ltr" == e ? a.data.html += c : a.data.html = c + a.data.html
                        }
                    }, b, null, 100);
                    b.on("maximize", function(a) {
                        b.ui.space("resizer")[a.data == CKEDITOR.TRISTATE_ON ? "hide" : "show"]()
                    })
                }
            }
        });
        (function() {
            function B(a) {
                function d() {
                    for (var b = g(), e = CKEDITOR.tools.clone(a.config.toolbarGroups) || q(a), f = 0; f < e.length; f++) {
                        var l = e[f];
                        if ("/" != l) {
                            "string" == typeof l && (l = e[f] = {
                                name: l
                            });
                            var m, d = l.groups;
                            if (d)
                                for (var h = 0; h < d.length; h++) m = d[h], (m = b[m]) && c(l, m);
                            (m = b[l.name]) && c(l, m)
                        }
                    }
                    return e
                }

                function g() {
                    var b = {},
                        c, f, e;
                    for (c in a.ui.items) f = a.ui.items[c], e = f.toolbar || "others", e = e.split(","), f = e[0], e = parseInt(e[1] || -1, 10), b[f] || (b[f] = []), b[f].push({
                        name: c,
                        order: e
                    });
                    for (f in b) b[f] = b[f].sort(function(b, a) {
                        return b.order == a.order ? 0 : 0 > a.order ? -1 : 0 > b.order ? 1 : b.order < a.order ? -1 : 1
                    });
                    return b
                }

                function c(c, e) {
                    if (e.length) {
                        c.items ? c.items.push(a.ui.create("-")) : c.items = [];
                        for (var f; f = e.shift();) f = "string" == typeof f ? f : f.name, b && -1 != CKEDITOR.tools.indexOf(b, f) || (f = a.ui.create(f)) && a.addFeature(f) && c.items.push(f)
                    }
                }

                function h(b) {
                    var a = [],
                        e, d, h;
                    for (e = 0; e < b.length; ++e) d = b[e], h = {}, "/" == d ? a.push(d) : CKEDITOR.tools.isArray(d) ? (c(h, CKEDITOR.tools.clone(d)), a.push(h)) : d.items && (c(h, CKEDITOR.tools.clone(d.items)), h.name = d.name, a.push(h));
                    return a
                }
                var b = a.config.removeButtons,
                    b = b && b.split(","),
                    e = a.config.toolbar;
                "string" == typeof e && (e = a.config["toolbar_" + e]);
                return a.toolbar = e ? h(e) : d()
            }

            function q(a) {
                return a._.toolbarGroups || (a._.toolbarGroups = [{
                    name: "document",
                    groups: ["mode", "document", "doctools"]
                }, {
                    name: "clipboard",
                    groups: ["clipboard", "undo"]
                }, {
                    name: "editing",
                    groups: ["find", "selection", "spellchecker"]
                }, {
                    name: "forms"
                }, "/", {
                    name: "basicstyles",
                    groups: ["basicstyles", "cleanup"]
                }, {
                    name: "paragraph",
                    groups: ["list", "indent", "blocks", "align", "bidi"]
                }, {
                    name: "links"
                }, {
                    name: "insert"
                }, "/", {
                    name: "styles"
                }, {
                    name: "colors"
                }, {
                    name: "tools"
                }, {
                    name: "others"
                }, {
                    name: "about"
                }])
            }
            var y = function() {
                this.toolbars = [];
                this.focusCommandExecuted = !1
            };
            y.prototype.focus = function() {
                for (var a = 0, d; d = this.toolbars[a++];)
                    for (var g = 0, c; c = d.items[g++];)
                        if (c.focus) {
                            c.focus();
                            return
                        }
            };
            var C = {
                modes: {
                    wysiwyg: 1,
                    source: 1
                },
                readOnly: 1,
                exec: function(a) {
                    a.toolbox && (a.toolbox.focusCommandExecuted = !0, CKEDITOR.env.ie || CKEDITOR.env.air ? setTimeout(function() {
                        a.toolbox.focus()
                    }, 100) : a.toolbox.focus())
                }
            };
            CKEDITOR.plugins.add("toolbar", {
                requires: "button",
                init: function(a) {
                    var d, g = function(c, h) {
                        var b, e = "rtl" == a.lang.dir,
                            k = a.config.toolbarGroupCycling,
                            r = e ? 37 : 39,
                            e = e ? 39 : 37,
                            k = void 0 === k || k;
                        switch (h) {
                            case 9:
                            case CKEDITOR.SHIFT + 9:
                                for (; !b || !b.items.length;)
                                    if (b = 9 == h ? (b ? b.next : c.toolbar.next) || a.toolbox.toolbars[0] : (b ? b.previous : c.toolbar.previous) || a.toolbox.toolbars[a.toolbox.toolbars.length - 1], b.items.length)
                                        for (c = b.items[d ? b.items.length - 1 : 0]; c && !c.focus;)(c = d ? c.previous : c.next) || (b = 0);
                                c && c.focus();
                                return !1;
                            case r:
                                b = c;
                                do b = b.next, !b && k && (b = c.toolbar.items[0]); while (b && !b.focus);
                                b ? b.focus() : g(c, 9);
                                return !1;
                            case 40:
                                return c.button && c.button.hasArrow ? (a.once("panelShow", function(b) {
                                    b.data._.panel._.currentBlock.onKeyDown(40)
                                }), c.execute()) : g(c, 40 == h ? r : e), !1;
                            case e:
                            case 38:
                                b = c;
                                do b = b.previous, !b && k && (b = c.toolbar.items[c.toolbar.items.length - 1]); while (b && !b.focus);
                                b ? b.focus() : (d = 1, g(c, CKEDITOR.SHIFT + 9), d = 0);
                                return !1;
                            case 27:
                                return a.focus(), !1;
                            case 13:
                            case 32:
                                return c.execute(), !1
                        }
                        return !0
                    };
                    a.on("uiSpace", function(c) {
                        if (c.data.space == a.config.toolbarLocation) {
                            c.removeListener();
                            a.toolbox = new y;
                            var d = CKEDITOR.tools.getNextId(),
                                b = ['<span id="', d, '" class="cke_voice_label">', a.lang.toolbar.toolbars, "</span>", '<span id="' + a.ui.spaceId("toolbox") + '" class="cke_toolbox" role="group" aria-labelledby="', d, '" onmousedown="return false;">'],
                                d = !1 !== a.config.toolbarStartupExpanded,
                                e, k;
                            a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && b.push('<span class="cke_toolbox_main"' + (d ? ">" : ' style="display:none">'));
                            for (var r = a.toolbox.toolbars, f = B(a), l = 0; l < f.length; l++) {
                                var m, n = 0,
                                    v, p = f[l],
                                    w;
                                if (p)
                                    if (e && (b.push("</span>"), k = e = 0), "/" === p) b.push('<span class="cke_toolbar_break"></span>');
                                    else {
                                        w = p.items || p;
                                        for (var x = 0; x < w.length; x++) {
                                            var t = w[x],
                                                q;
                                            if (t) {
                                                var z = function(c) {
                                                    c = c.render(a, b);
                                                    u = n.items.push(c) - 1;
                                                    0 < u && (c.previous = n.items[u - 1], c.previous.next = c);
                                                    c.toolbar = n;
                                                    c.onkey = g;
                                                    c.onfocus = function() {
                                                        a.toolbox.focusCommandExecuted || a.focus()
                                                    }
                                                };
                                                if (t.type == CKEDITOR.UI_SEPARATOR) k = e && t;
                                                else {
                                                    q = !1 !== t.canGroup;
                                                    if (!n) {
                                                        m = CKEDITOR.tools.getNextId();
                                                        n = {
                                                            id: m,
                                                            items: []
                                                        };
                                                        v = p.name && (a.lang.toolbar.toolbarGroups[p.name] || p.name);
                                                        b.push('<span id="', m, '" class="cke_toolbar"', v ? ' aria-labelledby="' + m + '_label"' : "", ' role="toolbar">');
                                                        v && b.push('<span id="', m, '_label" class="cke_voice_label">', v, "</span>");
                                                        b.push('<span class="cke_toolbar_start"></span>');
                                                        var u = r.push(n) - 1;
                                                        0 < u && (n.previous = r[u - 1], n.previous.next = n)
                                                    }
                                                    q ? e || (b.push('<span class="cke_toolgroup" role="presentation">'), e = 1) : e && (b.push("</span>"), e = 0);
                                                    k && (z(k), k = 0);
                                                    z(t)
                                                }
                                            }
                                        }
                                        e && (b.push("</span>"), k = e = 0);
                                        n && b.push('<span class="cke_toolbar_end"></span></span>')
                                    }
                            }
                            a.config.toolbarCanCollapse && b.push("</span>");
                            if (a.config.toolbarCanCollapse && a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
                                var A = CKEDITOR.tools.addFunction(function() {
                                    a.execCommand("toolbarCollapse")
                                });
                                a.on("destroy", function() {
                                    CKEDITOR.tools.removeFunction(A)
                                });
                                a.addCommand("toolbarCollapse", {
                                    readOnly: 1,
                                    exec: function(b) {
                                        var a = b.ui.space("toolbar_collapser"),
                                            c = a.getPrevious(),
                                            e = b.ui.space("contents"),
                                            d = c.getParent(),
                                            f = parseInt(e.$.style.height, 10),
                                            h = d.$.offsetHeight,
                                            g = a.hasClass("cke_toolbox_collapser_min");
                                        g ? (c.show(), a.removeClass("cke_toolbox_collapser_min"), a.setAttribute("title", b.lang.toolbar.toolbarCollapse)) : (c.hide(), a.addClass("cke_toolbox_collapser_min"), a.setAttribute("title", b.lang.toolbar.toolbarExpand));
                                        a.getFirst().setText(g ? "▲" : "◀");
                                        e.setStyle("height", f - (d.$.offsetHeight - h) + "px");
                                        b.fire("resize", {
                                            outerHeight: b.container.$.offsetHeight,
                                            contentsHeight: e.$.offsetHeight,
                                            outerWidth: b.container.$.offsetWidth
                                        })
                                    },
                                    modes: {
                                        wysiwyg: 1,
                                        source: 1
                                    }
                                });
                                a.setKeystroke(CKEDITOR.ALT + (CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109), "toolbarCollapse");
                                b.push('<a title="' + (d ? a.lang.toolbar.toolbarCollapse : a.lang.toolbar.toolbarExpand) + '" id="' + a.ui.spaceId("toolbar_collapser") + '" tabIndex="-1" class="cke_toolbox_collapser');
                                d || b.push(" cke_toolbox_collapser_min");
                                b.push('" onclick="CKEDITOR.tools.callFunction(' + A + ')">', '<span class="cke_arrow">&#9650;</span>', "</a>")
                            }
                            b.push("</span>");
                            c.data.html += b.join("")
                        }
                    });
                    a.on("destroy", function() {
                        if (this.toolbox) {
                            var a, d = 0,
                                b, e, g;
                            for (a = this.toolbox.toolbars; d < a.length; d++)
                                for (e = a[d].items, b = 0; b < e.length; b++) g = e[b], g.clickFn && CKEDITOR.tools.removeFunction(g.clickFn), g.keyDownFn && CKEDITOR.tools.removeFunction(g.keyDownFn)
                        }
                    });
                    a.on("uiReady", function() {
                        var c = a.ui.space("toolbox");
                        c && a.focusManager.add(c, 1)
                    });
                    a.addCommand("toolbarFocus", C);
                    a.setKeystroke(CKEDITOR.ALT + 121, "toolbarFocus");
                    a.ui.add("-", CKEDITOR.UI_SEPARATOR, {});
                    a.ui.addHandler(CKEDITOR.UI_SEPARATOR, {
                        create: function() {
                            return {
                                render: function(a, d) {
                                    d.push('<span class="cke_toolbar_separator" role="separator"></span>');
                                    return {}
                                }
                            }
                        }
                    })
                }
            });
            CKEDITOR.ui.prototype.addToolbarGroup = function(a, d, g) {
                var c = q(this.editor),
                    h = 0 === d,
                    b = {
                        name: a
                    };
                if (g) {
                    if (g = CKEDITOR.tools.search(c, function(a) {
                            return a.name == g
                        })) {
                        !g.groups && (g.groups = []);
                        if (d && (d = CKEDITOR.tools.indexOf(g.groups, d), 0 <= d)) {
                            g.groups.splice(d + 1, 0, a);
                            return
                        }
                        h ? g.groups.splice(0, 0, a) : g.groups.push(a);
                        return
                    }
                    d = null
                }
                d && (d = CKEDITOR.tools.indexOf(c, function(a) {
                    return a.name == d
                }));
                h ? c.splice(0, 0, a) : "number" == typeof d ? c.splice(d + 1, 0, b) : c.push(a)
            }
        })();
        CKEDITOR.UI_SEPARATOR = "separator";
        CKEDITOR.config.toolbarLocation = "top";
        (function() {
            function q(a, d) {
                function l(c) {
                    c = k.list[c];
                    if (c.equals(a.editable()) || "true" == c.getAttribute("contenteditable")) {
                        var e = a.createRange();
                        e.selectNodeContents(c);
                        e.select()
                    } else a.getSelection().selectElement(c);
                    a.focus()
                }

                function m() {
                    n && n.setHtml('<span class="cke_path_empty">&nbsp;</span>');
                    delete k.list
                }
                var p = a.ui.spaceId("path"),
                    n, k = a._.elementsPath,
                    q = k.idBase;
                d.html += '<span id="' + p + '_label" class="cke_voice_label">' + a.lang.elementspath.eleLabel + '</span><span id="' + p + '" class="cke_path" role="group" aria-labelledby="' + p + '_label"><span class="cke_path_empty">&nbsp;</span></span>';
                a.on("uiReady", function() {
                    var c = a.ui.space("path");
                    c && a.focusManager.add(c, 1)
                });
                k.onClick = l;
                var v = CKEDITOR.tools.addFunction(l),
                    w = CKEDITOR.tools.addFunction(function(c, e) {
                        var g = k.idBase,
                            b;
                        e = new CKEDITOR.dom.event(e);
                        b = "rtl" == a.lang.dir;
                        switch (e.getKeystroke()) {
                            case b ? 39:
                                37:
                                    case 9:
                                return (b = CKEDITOR.document.getById(g + (c + 1))) || (b = CKEDITOR.document.getById(g + "0")), b.focus(), !1;
                            case b ? 37:
                                39:
                                    case CKEDITOR.SHIFT + 9:
                                return (b = CKEDITOR.document.getById(g + (c - 1))) || (b = CKEDITOR.document.getById(g + (k.list.length - 1))), b.focus(), !1;
                            case 27:
                                return a.focus(), !1;
                            case 13:
                            case 32:
                                return l(c), !1
                        }
                        return !0
                    });
                a.on("selectionChange", function() {
                    for (var c = [], e = k.list = [], g = [], b = k.filters, d = !0, l = a.elementPath().elements, f, u = l.length; u--;) {
                        var h = l[u],
                            r = 0;
                        f = h.data("cke-display-name") ? h.data("cke-display-name") : h.data("cke-real-element-type") ? h.data("cke-real-element-type") : h.getName();
                        (d = h.hasAttribute("contenteditable") ? "true" == h.getAttribute("contenteditable") : d) || h.hasAttribute("contenteditable") || (r = 1);
                        for (var t = 0; t < b.length; t++) {
                            var m = b[t](h, f);
                            if (!1 === m) {
                                r = 1;
                                break
                            }
                            f = m || f
                        }
                        r || (e.unshift(h), g.unshift(f))
                    }
                    e = e.length;
                    for (b = 0; b < e; b++) f = g[b], d = a.lang.elementspath.eleTitle.replace(/%1/, f), f = x.output({
                        id: q + b,
                        label: d,
                        text: f,
                        jsTitle: "javascript:void('" + f + "')",
                        index: b,
                        keyDownFn: w,
                        clickFn: v
                    }), c.unshift(f);
                    n || (n = CKEDITOR.document.getById(p));
                    g = n;
                    g.setHtml(c.join("") + '<span class="cke_path_empty">&nbsp;</span>');
                    a.fire("elementsPathUpdate", {
                        space: g
                    })
                });
                a.on("readOnly", m);
                a.on("contentDomUnload", m);
                a.addCommand("elementsPathFocus", y.toolbarFocus);
                a.setKeystroke(CKEDITOR.ALT + 122, "elementsPathFocus")
            }
            var y = {
                    toolbarFocus: {
                        editorFocus: !1,
                        readOnly: 1,
                        exec: function(a) {
                            (a = CKEDITOR.document.getById(a._.elementsPath.idBase + "0")) && a.focus(CKEDITOR.env.ie || CKEDITOR.env.air)
                        }
                    }
                },
                d = "";
            CKEDITOR.env.gecko && CKEDITOR.env.mac && (d += ' onkeypress="return false;"');
            CKEDITOR.env.gecko && (d += ' onblur="this.style.cssText = this.style.cssText;"');
            var x = CKEDITOR.addTemplate("pathItem", '<a id="{id}" href="{jsTitle}" tabindex="-1" class="cke_path_item" title="{label}"' + d + ' hidefocus="true"  onkeydown="return CKEDITOR.tools.callFunction({keyDownFn},{index}, event );" onclick="CKEDITOR.tools.callFunction({clickFn},{index}); return false;" role="button" aria-label="{label}">{text}</a>');
            CKEDITOR.plugins.add("elementspath", {
                init: function(a) {
                    a._.elementsPath = {
                        idBase: "cke_elementspath_" + CKEDITOR.tools.getNextNumber() + "_",
                        filters: []
                    };
                    a.on("uiSpace", function(d) {
                        "bottom" == d.data.space && q(a, d.data)
                    })
                }
            })
        })();
        (function() {
            function q(b, d, a) {
                a = b.config.forceEnterMode || a;
                "wysiwyg" == b.mode && (d || (d = b.activeEnterMode), b.elementPath().isContextFor("p") || (d = CKEDITOR.ENTER_BR, a = 1), b.fire("saveSnapshot"), d == CKEDITOR.ENTER_BR ? t(b, d, null, a) : u(b, d, null, a), b.fire("saveSnapshot"))
            }

            function v(b) {
                b = b.getSelection().getRanges(!0);
                for (var d = b.length - 1; 0 < d; d--) b[d].deleteContents();
                return b[0]
            }

            function y(b) {
                var d = b.startContainer.getAscendant(function(a) {
                    return a.type == CKEDITOR.NODE_ELEMENT && "true" == a.getAttribute("contenteditable")
                }, !0);
                if (b.root.equals(d)) return b;
                d = new CKEDITOR.dom.range(d);
                d.moveToRange(b);
                return d
            }
            CKEDITOR.plugins.add("enterkey", {
                init: function(b) {
                    b.addCommand("enter", {
                        modes: {
                            wysiwyg: 1
                        },
                        editorFocus: !1,
                        exec: function(b) {
                            q(b)
                        }
                    });
                    b.addCommand("shiftEnter", {
                        modes: {
                            wysiwyg: 1
                        },
                        editorFocus: !1,
                        exec: function(b) {
                            q(b, b.activeShiftEnterMode, 1)
                        }
                    });
                    b.setKeystroke([
                        [13, "enter"],
                        [CKEDITOR.SHIFT + 13, "shiftEnter"]
                    ])
                }
            });
            var z = CKEDITOR.dom.walker.whitespaces(),
                A = CKEDITOR.dom.walker.bookmark();
            CKEDITOR.plugins.enterkey = {
                enterBlock: function(b, d, a, h) {
                    if (a = a || v(b)) {
                        a = y(a);
                        var f = a.document,
                            k = a.checkStartOfBlock(),
                            m = a.checkEndOfBlock(),
                            l = b.elementPath(a.startContainer),
                            c = l.block,
                            n = d == CKEDITOR.ENTER_DIV ? "div" : "p",
                            e;
                        if (k && m) {
                            if (c && (c.is("li") || c.getParent().is("li"))) {
                                c.is("li") || (c = c.getParent());
                                a = c.getParent();
                                e = a.getParent();
                                h = !c.hasPrevious();
                                var p = !c.hasNext(),
                                    n = b.getSelection(),
                                    g = n.createBookmarks(),
                                    k = c.getDirection(1),
                                    m = c.getAttribute("class"),
                                    r = c.getAttribute("style"),
                                    q = e.getDirection(1) != k;
                                b = b.enterMode != CKEDITOR.ENTER_BR || q || r || m;
                                if (e.is("li")) h || p ? (h && p && a.remove(), c[p ? "insertAfter" : "insertBefore"](e)) : c.breakParent(e);
                                else {
                                    if (b)
                                        if (l.block.is("li") ? (e = f.createElement(d == CKEDITOR.ENTER_P ? "p" : "div"), q && e.setAttribute("dir", k), r && e.setAttribute("style", r), m && e.setAttribute("class", m), c.moveChildren(e)) : e = l.block, h || p) e[h ? "insertBefore" : "insertAfter"](a);
                                        else c.breakParent(a), e.insertAfter(a);
                                    else if (c.appendBogus(!0), h || p)
                                        for (; f = c[h ? "getFirst" : "getLast"]();) f[h ? "insertBefore" : "insertAfter"](a);
                                    else
                                        for (c.breakParent(a); f = c.getLast();) f.insertAfter(a);
                                    c.remove()
                                }
                                n.selectBookmarks(g);
                                return
                            }
                            if (c && c.getParent().is("blockquote")) {
                                c.breakParent(c.getParent());
                                c.getPrevious().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getPrevious().remove();
                                c.getNext().getFirst(CKEDITOR.dom.walker.invisible(1)) || c.getNext().remove();
                                a.moveToElementEditStart(c);
                                a.select();
                                return
                            }
                        } else if (c && c.is("pre") && !m) {
                            t(b, d, a, h);
                            return
                        }
                        if (k = a.splitBlock(n)) {
                            d = k.previousBlock;
                            c = k.nextBlock;
                            l = k.wasStartOfBlock;
                            b = k.wasEndOfBlock;
                            c ? (g = c.getParent(), g.is("li") && (c.breakParent(g), c.move(c.getNext(), 1))) : d && (g = d.getParent()) && g.is("li") && (d.breakParent(g), g = d.getNext(), a.moveToElementEditStart(g), d.move(d.getPrevious()));
                            if (l || b) {
                                if (d) {
                                    if (d.is("li") || !w.test(d.getName()) && !d.is("pre")) e = d.clone()
                                } else c && (e = c.clone());
                                e ? h && !e.is("li") && e.renameNode(n) : g && g.is("li") ? e = g : (e = f.createElement(n), d && (p = d.getDirection()) && e.setAttribute("dir", p));
                                if (f = k.elementPath)
                                    for (h = 0, n = f.elements.length; h < n; h++) {
                                        g = f.elements[h];
                                        if (g.equals(f.block) || g.equals(f.blockLimit)) break;
                                        CKEDITOR.dtd.$removeEmpty[g.getName()] && (g = g.clone(), e.moveChildren(g), e.append(g))
                                    }
                                e.appendBogus();
                                e.getParent() || a.insertNode(e);
                                e.is("li") && e.removeAttribute("value");
                                !CKEDITOR.env.ie || !l || b && d.getChildCount() || (a.moveToElementEditStart(b ? d : e), a.select());
                                a.moveToElementEditStart(l && !b ? c : e)
                            } else c.is("li") && (e = a.clone(), e.selectNodeContents(c), e = new CKEDITOR.dom.walker(e), e.evaluator = function(a) {
                                return !(A(a) || z(a) || a.type == CKEDITOR.NODE_ELEMENT && a.getName() in CKEDITOR.dtd.$inline && !(a.getName() in CKEDITOR.dtd.$empty))
                            }, (g = e.next()) && g.type == CKEDITOR.NODE_ELEMENT && g.is("ul", "ol") && (CKEDITOR.env.needsBrFiller ? f.createElement("br") : f.createText(" ")).insertBefore(g)), c && a.moveToElementEditStart(c);
                            a.select();
                            a.scrollIntoView()
                        }
                    }
                },
                enterBr: function(b, d, a, h) {
                    if (a = a || v(b)) {
                        var f = a.document,
                            k = a.checkEndOfBlock(),
                            m = new CKEDITOR.dom.elementPath(b.getSelection().getStartElement()),
                            l = m.block,
                            c = l && m.block.getName();
                        h || "li" != c ? (!h && k && w.test(c) ? (k = l.getDirection()) ? (f = f.createElement("div"), f.setAttribute("dir", k), f.insertAfter(l), a.setStart(f, 0)) : (f.createElement("br").insertAfter(l), CKEDITOR.env.gecko && f.createText("").insertAfter(l), a.setStartAt(l.getNext(), CKEDITOR.env.ie ? CKEDITOR.POSITION_BEFORE_START : CKEDITOR.POSITION_AFTER_START)) : (b = "pre" == c && CKEDITOR.env.ie && 8 > CKEDITOR.env.version ? f.createText("\r") : f.createElement("br"), a.deleteContents(), a.insertNode(b), CKEDITOR.env.needsBrFiller ? (f.createText("\ufeff").insertAfter(b), k && (l || m.blockLimit).appendBogus(), b.getNext().$.nodeValue = "", a.setStartAt(b.getNext(), CKEDITOR.POSITION_AFTER_START)) : a.setStartAt(b, CKEDITOR.POSITION_AFTER_END)), a.collapse(!0), a.select(), a.scrollIntoView()) : u(b, d, a, h)
                    }
                }
            };
            var x = CKEDITOR.plugins.enterkey,
                t = x.enterBr,
                u = x.enterBlock,
                w = /^h[1-6]$/
        })();
        (function() {
            function k(b, f) {
                var g = {},
                    c = [],
                    e = {
                        nbsp: " ",
                        shy: "­",
                        gt: ">",
                        lt: "<",
                        amp: "&",
                        apos: "'",
                        quot: '"'
                    };
                b = b.replace(/\b(nbsp|shy|gt|lt|amp|apos|quot)(?:,|$)/g, function(b, a) {
                    var d = f ? "&" + a + ";" : e[a];
                    g[d] = f ? e[a] : "&" + a + ";";
                    c.push(d);
                    return ""
                });
                if (!f && b) {
                    b = b.split(",");
                    var a = document.createElement("div"),
                        d;
                    a.innerHTML = "&" + b.join(";&") + ";";
                    d = a.innerHTML;
                    a = null;
                    for (a = 0; a < d.length; a++) {
                        var h = d.charAt(a);
                        g[h] = "&" + b[a] + ";";
                        c.push(h)
                    }
                }
                g.regex = c.join(f ? "|" : "");
                return g
            }
            CKEDITOR.plugins.add("entities", {
                afterInit: function(b) {
                    function f(a) {
                        return h[a]
                    }

                    function g(b) {
                        return "force" != c.entities_processNumerical && a[b] ? a[b] : "&#" + b.charCodeAt(0) + ";"
                    }
                    var c = b.config;
                    if (b = (b = b.dataProcessor) && b.htmlFilter) {
                        var e = [];
                        !1 !== c.basicEntities && e.push("nbsp,gt,lt,amp");
                        c.entities && (e.length && e.push("quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro"), c.entities_latin && e.push("Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml"), c.entities_greek && e.push("Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv"), c.entities_additional && e.push(c.entities_additional));
                        var a = k(e.join(",")),
                            d = a.regex ? "[" + a.regex + "]" : "a^";
                        delete a.regex;
                        c.entities && c.entities_processNumerical && (d = "[^ -~]|" + d);
                        var d = new RegExp(d, "g"),
                            h = k("nbsp,gt,lt,amp,shy", !0),
                            l = new RegExp(h.regex, "g");
                        b.addRules({
                            text: function(a) {
                                return a.replace(l, f).replace(d, g)
                            }
                        }, {
                            applyToAll: !0,
                            excludeNestedEditable: !0
                        })
                    }
                }
            })
        })();
        CKEDITOR.config.basicEntities = !0;
        CKEDITOR.config.entities = !0;
        CKEDITOR.config.entities_latin = !0;
        CKEDITOR.config.entities_greek = !0;
        CKEDITOR.config.entities_additional = "#39";
        CKEDITOR.plugins.add("popup");
        CKEDITOR.tools.extend(CKEDITOR.editor.prototype, {
            popup: function(e, a, b, d) {
                a = a || "80%";
                b = b || "70%";
                "string" == typeof a && 1 < a.length && "%" == a.substr(a.length - 1, 1) && (a = parseInt(window.screen.width * parseInt(a, 10) / 100, 10));
                "string" == typeof b && 1 < b.length && "%" == b.substr(b.length - 1, 1) && (b = parseInt(window.screen.height * parseInt(b, 10) / 100, 10));
                640 > a && (a = 640);
                420 > b && (b = 420);
                var f = parseInt((window.screen.height - b) / 2, 10),
                    g = parseInt((window.screen.width - a) / 2, 10);
                d = (d || "location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,scrollbars=yes") + ",width=" + a + ",height=" + b + ",top=" + f + ",left=" + g;
                var c = window.open("", null, d, !0);
                if (!c) return !1;
                try {
                    -1 == navigator.userAgent.toLowerCase().indexOf(" chrome/") && (c.moveTo(g, f), c.resizeTo(a, b)), c.focus(), c.location.href = e
                } catch (h) {
                    window.open(e, null, d, !0)
                }
                return !0
            }
        });
        (function() {
            function g(a, c) {
                var d = [];
                if (c)
                    for (var b in c) d.push(b + "=" + encodeURIComponent(c[b]));
                else return a;
                return a + (-1 != a.indexOf("?") ? "&" : "?") + d.join("&")
            }

            function k(a) {
                a += "";
                return a.charAt(0).toUpperCase() + a.substr(1)
            }

            function m() {
                var a = this.getDialog(),
                    c = a.getParentEditor();
                c._.filebrowserSe = this;
                var d = c.config["filebrowser" + k(a.getName()) + "WindowWidth"] || c.config.filebrowserWindowWidth || "80%",
                    a = c.config["filebrowser" + k(a.getName()) + "WindowHeight"] || c.config.filebrowserWindowHeight || "70%",
                    b = this.filebrowser.params || {};
                b.CKEditor = c.name;
                b.CKEditorFuncNum = c._.filebrowserFn;
                b.langCode || (b.langCode = c.langCode);
                b = g(this.filebrowser.url, b);
                c.popup(b, d, a, c.config.filebrowserWindowFeatures || c.config.fileBrowserWindowFeatures)
            }

            function n() {
                var a = this.getDialog();
                a.getParentEditor()._.filebrowserSe = this;
                return a.getContentElement(this["for"][0], this["for"][1]).getInputElement().$.value && a.getContentElement(this["for"][0], this["for"][1]).getAction() ? !0 : !1
            }

            function p(a, c, d) {
                var b = d.params || {};
                b.CKEditor = a.name;
                b.CKEditorFuncNum = a._.filebrowserFn;
                b.langCode || (b.langCode = a.langCode);
                c.action = g(d.url, b);
                c.filebrowser = d
            }

            function l(a, c, d, b) {
                if (b && b.length)
                    for (var e, g = b.length; g--;)
                        if (e = b[g], "hbox" != e.type && "vbox" != e.type && "fieldset" != e.type || l(a, c, d, e.children), e.filebrowser)
                            if ("string" == typeof e.filebrowser && (e.filebrowser = {
                                    action: "fileButton" == e.type ? "QuickUpload" : "Browse",
                                    target: e.filebrowser
                                }), "Browse" == e.filebrowser.action) {
                                var f = e.filebrowser.url;
                                void 0 === f && (f = a.config["filebrowser" + k(c) + "BrowseUrl"], void 0 === f && (f = a.config.filebrowserBrowseUrl));
                                f && (e.onClick = m, e.filebrowser.url = f, e.hidden = !1)
                            } else if ("QuickUpload" == e.filebrowser.action && e["for"] && (f = e.filebrowser.url, void 0 === f && (f = a.config["filebrowser" + k(c) + "UploadUrl"], void 0 === f && (f = a.config.filebrowserUploadUrl)), f)) {
                    var h = e.onClick;
                    e.onClick = function(a) {
                        var b = a.sender;
                        if (h && !1 === h.call(b, a)) return !1;
                        if (n.call(b, a)) {
                            a = b.getDialog().getContentElement(this["for"][0], this["for"][1]).getInputElement();
                            if (b = new CKEDITOR.dom.element(a.$.form))(a = b.$.elements.ckCsrfToken) ? a = new CKEDITOR.dom.element(a) : (a = new CKEDITOR.dom.element("input"), a.setAttributes({
                                name: "ckCsrfToken",
                                type: "hidden"
                            }), b.append(a)), a.setAttribute("value", CKEDITOR.tools.getCsrfToken());
                            return !0
                        }
                        return !1
                    };
                    e.filebrowser.url = f;
                    e.hidden = !1;
                    p(a, d.getContents(e["for"][0]).get(e["for"][1]), e.filebrowser)
                }
            }

            function h(a, c, d) {
                if (-1 !== d.indexOf(";")) {
                    d = d.split(";");
                    for (var b = 0; b < d.length; b++)
                        if (h(a, c, d[b])) return !0;
                    return !1
                }
                return (a = a.getContents(c).get(d).filebrowser) && a.url
            }

            function q(a, c) {
                var d = this._.filebrowserSe.getDialog(),
                    b = this._.filebrowserSe["for"],
                    e = this._.filebrowserSe.filebrowser.onSelect;
                b && d.getContentElement(b[0], b[1]).reset();
                if ("function" != typeof c || !1 !== c.call(this._.filebrowserSe))
                    if (!e || !1 !== e.call(this._.filebrowserSe, a, c))
                        if ("string" == typeof c && c && alert(c), a && (b = this._.filebrowserSe, d = b.getDialog(), b = b.filebrowser.target || null))
                            if (b = b.split(":"), e = d.getContentElement(b[0], b[1])) e.setValue(a), d.selectPage(b[0])
            }
            CKEDITOR.plugins.add("filebrowser", {
                requires: "popup",
                init: function(a) {
                    a._.filebrowserFn = CKEDITOR.tools.addFunction(q, a);
                    a.on("destroy", function() {
                        CKEDITOR.tools.removeFunction(this._.filebrowserFn)
                    })
                }
            });
            CKEDITOR.on("dialogDefinition", function(a) {
                if (a.editor.plugins.filebrowser)
                    for (var c = a.data.definition, d, b = 0; b < c.contents.length; ++b)
                        if (d = c.contents[b]) l(a.editor, a.data.name, c, d.elements), d.hidden && d.filebrowser && (d.hidden = !h(c, d.id, d.filebrowser))
            })
        })();
        CKEDITOR.plugins.add("find", {
            requires: "dialog",
            init: function(a) {
                var b = a.addCommand("find", new CKEDITOR.dialogCommand("find"));
                b.canUndo = !1;
                b.readOnly = 1;
                a.addCommand("replace", new CKEDITOR.dialogCommand("replace")).canUndo = !1;
                a.ui.addButton && (a.ui.addButton("Find", {
                    label: a.lang.find.find,
                    command: "find",
                    toolbar: "find,10"
                }), a.ui.addButton("Replace", {
                    label: a.lang.find.replace,
                    command: "replace",
                    toolbar: "find,20"
                }));
                CKEDITOR.dialog.add("find", this.path + "dialogs/find.js");
                CKEDITOR.dialog.add("replace", this.path + "dialogs/find.js")
            }
        });
        CKEDITOR.config.find_highlight = {
            element: "span",
            styles: {
                "background-color": "#004",
                color: "#fff"
            }
        };
        (function() {
            function g(a, b) {
                var c = l.exec(a),
                    d = l.exec(b);
                if (c) {
                    if (!c[2] && "px" == d[2]) return d[1];
                    if ("px" == c[2] && !d[2]) return d[1] + "px"
                }
                return b
            }
            var k = CKEDITOR.htmlParser.cssStyle,
                h = CKEDITOR.tools.cssLength,
                l = /^((?:\d*(?:\.\d+))|(?:\d+))(.*)?$/i,
                m = {
                    elements: {
                        $: function(a) {
                            var b = a.attributes;
                            if ((b = (b = (b = b && b["data-cke-realelement"]) && new CKEDITOR.htmlParser.fragment.fromHtml(decodeURIComponent(b))) && b.children[0]) && a.attributes["data-cke-resizable"]) {
                                var c = new k(a).rules;
                                a = b.attributes;
                                var d = c.width,
                                    c = c.height;
                                d && (a.width = g(a.width, d));
                                c && (a.height = g(a.height, c))
                            }
                            return b
                        }
                    }
                };
            CKEDITOR.plugins.add("fakeobjects", {
                init: function(a) {
                    a.filter.allow("img[!data-cke-realelement,src,alt,title](*){*}", "fakeobjects")
                },
                afterInit: function(a) {
                    (a = (a = a.dataProcessor) && a.htmlFilter) && a.addRules(m, {
                        applyToAll: !0
                    })
                }
            });
            CKEDITOR.editor.prototype.createFakeElement = function(a, b, c, d) {
                var e = this.lang.fakeobjects,
                    e = e[c] || e.unknown;
                b = {
                    "class": b,
                    "data-cke-realelement": encodeURIComponent(a.getOuterHtml()),
                    "data-cke-real-node-type": a.type,
                    alt: e,
                    title: e,
                    align: a.getAttribute("align") || ""
                };
                CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData);
                c && (b["data-cke-real-element-type"] = c);
                d && (b["data-cke-resizable"] = d, c = new k, d = a.getAttribute("width"), a = a.getAttribute("height"), d && (c.rules.width = h(d)), a && (c.rules.height = h(a)), c.populate(b));
                return this.document.createElement("img", {
                    attributes: b
                })
            };
            CKEDITOR.editor.prototype.createFakeParserElement = function(a, b, c, d) {
                var e = this.lang.fakeobjects,
                    e = e[c] || e.unknown,
                    f;
                f = new CKEDITOR.htmlParser.basicWriter;
                a.writeHtml(f);
                f = f.getHtml();
                b = {
                    "class": b,
                    "data-cke-realelement": encodeURIComponent(f),
                    "data-cke-real-node-type": a.type,
                    alt: e,
                    title: e,
                    align: a.attributes.align || ""
                };
                CKEDITOR.env.hc || (b.src = CKEDITOR.tools.transparentImageData);
                c && (b["data-cke-real-element-type"] = c);
                d && (b["data-cke-resizable"] = d, d = a.attributes, a = new k, c = d.width, d = d.height, void 0 !== c && (a.rules.width = h(c)), void 0 !== d && (a.rules.height = h(d)), a.populate(b));
                return new CKEDITOR.htmlParser.element("img", b)
            };
            CKEDITOR.editor.prototype.restoreRealElement = function(a) {
                if (a.data("cke-real-node-type") != CKEDITOR.NODE_ELEMENT) return null;
                var b = CKEDITOR.dom.element.createFromHtml(decodeURIComponent(a.data("cke-realelement")), this.document);
                if (a.data("cke-resizable")) {
                    var c = a.getStyle("width");
                    a = a.getStyle("height");
                    c && b.setAttribute("width", g(b.getAttribute("width"), c));
                    a && b.setAttribute("height", g(b.getAttribute("height"), a))
                }
                return b
            }
        })();
        (function() {
            function d(a) {
                a = a.attributes;
                return "application/x-shockwave-flash" == a.type || f.test(a.src || "")
            }

            function e(a, b) {
                return a.createFakeParserElement(b, "cke_flash", "flash", !0)
            }
            var f = /\.swf(?:$|\?)/i;
            CKEDITOR.plugins.add("flash", {
                requires: "dialog,fakeobjects",
                onLoad: function() {
                    CKEDITOR.addCss("img.cke_flash{background-image: url(" + CKEDITOR.getUrl(this.path + "images/placeholder.png") + ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")
                },
                init: function(a) {
                    var b = "object[classid,codebase,height,hspace,vspace,width];param[name,value];embed[height,hspace,pluginspage,src,type,vspace,width]";
                    CKEDITOR.dialog.isTabEnabled(a, "flash", "properties") && (b += ";object[align]; embed[allowscriptaccess,quality,scale,wmode]");
                    CKEDITOR.dialog.isTabEnabled(a, "flash", "advanced") && (b += ";object[id]{*}; embed[bgcolor]{*}(*)");
                    a.addCommand("flash", new CKEDITOR.dialogCommand("flash", {
                        allowedContent: b,
                        requiredContent: "embed"
                    }));
                    a.ui.addButton && a.ui.addButton("Flash", {
                        label: a.lang.common.flash,
                        command: "flash",
                        toolbar: "insert,20"
                    });
                    CKEDITOR.dialog.add("flash", this.path + "dialogs/flash.js");
                    a.addMenuItems && a.addMenuItems({
                        flash: {
                            label: a.lang.flash.properties,
                            command: "flash",
                            group: "flash"
                        }
                    });
                    a.on("doubleclick", function(a) {
                        var b = a.data.element;
                        b.is("img") && "flash" == b.data("cke-real-element-type") && (a.data.dialog = "flash")
                    });
                    a.contextMenu && a.contextMenu.addListener(function(a) {
                        if (a && a.is("img") && !a.isReadOnly() && "flash" == a.data("cke-real-element-type")) return {
                            flash: CKEDITOR.TRISTATE_OFF
                        }
                    })
                },
                afterInit: function(a) {
                    var b = a.dataProcessor;
                    (b = b && b.dataFilter) && b.addRules({
                        elements: {
                            "cke:object": function(b) {
                                var c = b.attributes;
                                if (!(c.classid && String(c.classid).toLowerCase() || d(b))) {
                                    for (c = 0; c < b.children.length; c++)
                                        if ("cke:embed" == b.children[c].name) {
                                            if (!d(b.children[c])) break;
                                            return e(a, b)
                                        }
                                    return null
                                }
                                return e(a, b)
                            },
                            "cke:embed": function(b) {
                                return d(b) ? e(a, b) : null
                            }
                        }
                    }, 5)
                }
            })
        })();
        CKEDITOR.tools.extend(CKEDITOR.config, {
            flashEmbedTagOnly: !1,
            flashAddEmbedTag: !0,
            flashConvertOnEdit: !1
        });
        (function() {
            function k(a) {
                var l = a.config,
                    p = a.fire("uiSpace", {
                        space: "top",
                        html: ""
                    }).html,
                    t = function() {
                        function f(a, c, e) {
                            b.setStyle(c, w(e));
                            b.setStyle("position", a)
                        }

                        function e(a) {
                            var b = k.getDocumentPosition();
                            switch (a) {
                                case "top":
                                    f("absolute", "top", b.y - q - r);
                                    break;
                                case "pin":
                                    f("fixed", "top", x);
                                    break;
                                case "bottom":
                                    f("absolute", "top", b.y + (c.height || c.bottom - c.top) + r)
                            }
                            m = a
                        }
                        var m, k, n, c, h, q, v, p = l.floatSpaceDockedOffsetX || 0,
                            r = l.floatSpaceDockedOffsetY || 0,
                            u = l.floatSpacePinnedOffsetX || 0,
                            x = l.floatSpacePinnedOffsetY || 0;
                        return function(d) {
                            if (k = a.editable()) {
                                var f = d && "focus" == d.name;
                                f && b.show();
                                a.fire("floatingSpaceLayout", {
                                    show: f
                                });
                                b.removeStyle("left");
                                b.removeStyle("right");
                                n = b.getClientRect();
                                c = k.getClientRect();
                                h = g.getViewPaneSize();
                                q = n.height;
                                v = "pageXOffset" in g.$ ? g.$.pageXOffset : CKEDITOR.document.$.documentElement.scrollLeft;
                                m ? (q + r <= c.top ? e("top") : q + r > h.height - c.bottom ? e("pin") : e("bottom"), d = h.width / 2, d = l.floatSpacePreferRight ? "right" : 0 < c.left && c.right < h.width && c.width > n.width ? "rtl" == l.contentsLangDirection ? "right" : "left" : d - c.left > c.right - d ? "left" : "right", n.width > h.width ? (d = "left", f = 0) : (f = "left" == d ? 0 < c.left ? c.left : 0 : c.right < h.width ? h.width - c.right : 0, f + n.width > h.width && (d = "left" == d ? "right" : "left", f = 0)), b.setStyle(d, w(("pin" == m ? u : p) + f + ("pin" == m ? 0 : "left" == d ? v : -v)))) : (m = "pin", e("pin"), t(d))
                            }
                        }
                    }();
                if (p) {
                    var k = new CKEDITOR.template('<div id="cke_{name}" class="cke {id} cke_reset_all cke_chrome cke_editor_{name} cke_float cke_{langDir} ' + CKEDITOR.env.cssClass + '" dir="{langDir}" title="' + (CKEDITOR.env.gecko ? " " : "") + '" lang="{langCode}" role="application" style="{style}"' + (a.title ? ' aria-labelledby="cke_{name}_arialbl"' : " ") + ">" + (a.title ? '<span id="cke_{name}_arialbl" class="cke_voice_label">{voiceLabel}</span>' : " ") + '<div class="cke_inner"><div id="{topId}" class="cke_top" role="presentation">{content}</div></div></div>'),
                        b = CKEDITOR.document.getBody().append(CKEDITOR.dom.element.createFromHtml(k.output({
                            content: p,
                            id: a.id,
                            langDir: a.lang.dir,
                            langCode: a.langCode,
                            name: a.name,
                            style: "display:none;z-index:" + (l.baseFloatZIndex - 1),
                            topId: a.ui.spaceId("top"),
                            voiceLabel: a.title
                        }))),
                        u = CKEDITOR.tools.eventsBuffer(500, t),
                        e = CKEDITOR.tools.eventsBuffer(100, t);
                    b.unselectable();
                    b.on("mousedown", function(a) {
                        a = a.data;
                        a.getTarget().hasAscendant("a", 1) || a.preventDefault()
                    });
                    a.on("focus", function(b) {
                        t(b);
                        a.on("change", u.input);
                        g.on("scroll", e.input);
                        g.on("resize", e.input)
                    });
                    a.on("blur", function() {
                        b.hide();
                        a.removeListener("change", u.input);
                        g.removeListener("scroll", e.input);
                        g.removeListener("resize", e.input)
                    });
                    a.on("destroy", function() {
                        g.removeListener("scroll", e.input);
                        g.removeListener("resize", e.input);
                        b.clearCustomData();
                        b.remove()
                    });
                    a.focusManager.hasFocus && b.show();
                    a.focusManager.add(b, 1)
                }
            }
            var g = CKEDITOR.document.getWindow(),
                w = CKEDITOR.tools.cssLength;
            CKEDITOR.plugins.add("floatingspace", {
                init: function(a) {
                    a.on("loaded", function() {
                        k(this)
                    }, null, null, 20)
                }
            })
        })();
        CKEDITOR.plugins.add("listblock", {
            requires: "panel",
            onLoad: function() {
                var f = CKEDITOR.addTemplate("panel-list", '<ul role="presentation" class="cke_panel_list">{items}</ul>'),
                    g = CKEDITOR.addTemplate("panel-list-item", '<li id="{id}" class="cke_panel_listItem" role=presentation><a id="{id}_option" _cke_focus=1 hidefocus=true title="{title}" href="javascript:void(\'{val}\')"  {onclick}="CKEDITOR.tools.callFunction({clickFn},\'{val}\'); return false;" role="option">{text}</a></li>'),
                    h = CKEDITOR.addTemplate("panel-list-group", '<h1 id="{id}" class="cke_panel_grouptitle" role="presentation" >{label}</h1>'),
                    k = /\'/g;
                CKEDITOR.ui.panel.prototype.addListBlock = function(a, b) {
                    return this.addBlock(a, new CKEDITOR.ui.listBlock(this.getHolderElement(), b))
                };
                CKEDITOR.ui.listBlock = CKEDITOR.tools.createClass({
                    base: CKEDITOR.ui.panel.block,
                    $: function(a, b) {
                        b = b || {};
                        var c = b.attributes || (b.attributes = {});
                        (this.multiSelect = !!b.multiSelect) && (c["aria-multiselectable"] = !0);
                        !c.role && (c.role = "listbox");
                        this.base.apply(this, arguments);
                        this.element.setAttribute("role", c.role);
                        c = this.keys;
                        c[40] = "next";
                        c[9] = "next";
                        c[38] = "prev";
                        c[CKEDITOR.SHIFT + 9] = "prev";
                        c[32] = CKEDITOR.env.ie ? "mouseup" : "click";
                        CKEDITOR.env.ie && (c[13] = "mouseup");
                        this._.pendingHtml = [];
                        this._.pendingList = [];
                        this._.items = {};
                        this._.groups = {}
                    },
                    _: {
                        close: function() {
                            if (this._.started) {
                                var a = f.output({
                                    items: this._.pendingList.join("")
                                });
                                this._.pendingList = [];
                                this._.pendingHtml.push(a);
                                delete this._.started
                            }
                        },
                        getClick: function() {
                            this._.click || (this._.click = CKEDITOR.tools.addFunction(function(a) {
                                var b = this.toggle(a);
                                if (this.onClick) this.onClick(a, b)
                            }, this));
                            return this._.click
                        }
                    },
                    proto: {
                        add: function(a, b, c) {
                            var d = CKEDITOR.tools.getNextId();
                            this._.started || (this._.started = 1, this._.size = this._.size || 0);
                            this._.items[a] = d;
                            var e;
                            e = CKEDITOR.tools.htmlEncodeAttr(a).replace(k, "\\'");
                            a = {
                                id: d,
                                val: e,
                                onclick: CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick",
                                clickFn: this._.getClick(),
                                title: CKEDITOR.tools.htmlEncodeAttr(c || a),
                                text: b || a
                            };
                            this._.pendingList.push(g.output(a))
                        },
                        startGroup: function(a) {
                            this._.close();
                            var b = CKEDITOR.tools.getNextId();
                            this._.groups[a] = b;
                            this._.pendingHtml.push(h.output({
                                id: b,
                                label: a
                            }))
                        },
                        commit: function() {
                            this._.close();
                            this.element.appendHtml(this._.pendingHtml.join(""));
                            delete this._.size;
                            this._.pendingHtml = []
                        },
                        toggle: function(a) {
                            var b = this.isMarked(a);
                            b ? this.unmark(a) : this.mark(a);
                            return !b
                        },
                        hideGroup: function(a) {
                            var b = (a = this.element.getDocument().getById(this._.groups[a])) && a.getNext();
                            a && (a.setStyle("display", "none"), b && "ul" == b.getName() && b.setStyle("display", "none"))
                        },
                        hideItem: function(a) {
                            this.element.getDocument().getById(this._.items[a]).setStyle("display", "none")
                        },
                        showAll: function() {
                            var a = this._.items,
                                b = this._.groups,
                                c = this.element.getDocument(),
                                d;
                            for (d in a) c.getById(a[d]).setStyle("display", "");
                            for (var e in b) a = c.getById(b[e]), d = a.getNext(), a.setStyle("display", ""), d && "ul" == d.getName() && d.setStyle("display", "")
                        },
                        mark: function(a) {
                            this.multiSelect || this.unmarkAll();
                            a = this._.items[a];
                            var b = this.element.getDocument().getById(a);
                            b.addClass("cke_selected");
                            this.element.getDocument().getById(a + "_option").setAttribute("aria-selected", !0);
                            this.onMark && this.onMark(b)
                        },
                        unmark: function(a) {
                            var b = this.element.getDocument();
                            a = this._.items[a];
                            var c = b.getById(a);
                            c.removeClass("cke_selected");
                            b.getById(a + "_option").removeAttribute("aria-selected");
                            this.onUnmark && this.onUnmark(c)
                        },
                        unmarkAll: function() {
                            var a = this._.items,
                                b = this.element.getDocument(),
                                c;
                            for (c in a) {
                                var d = a[c];
                                b.getById(d).removeClass("cke_selected");
                                b.getById(d + "_option").removeAttribute("aria-selected")
                            }
                            this.onUnmark && this.onUnmark()
                        },
                        isMarked: function(a) {
                            return this.element.getDocument().getById(this._.items[a]).hasClass("cke_selected")
                        },
                        focus: function(a) {
                            this._.focusIndex = -1;
                            var b = this.element.getElementsByTag("a"),
                                c, d = -1;
                            if (a)
                                for (c = this.element.getDocument().getById(this._.items[a]).getFirst(); a = b.getItem(++d);) {
                                    if (a.equals(c)) {
                                        this._.focusIndex = d;
                                        break
                                    }
                                } else this.element.focus();
                            c && setTimeout(function() {
                                c.focus()
                            }, 0)
                        }
                    }
                })
            }
        });
        CKEDITOR.plugins.add("richcombo", {
            requires: "floatpanel,listblock,button",
            beforeInit: function(d) {
                d.ui.addHandler(CKEDITOR.UI_RICHCOMBO, CKEDITOR.ui.richCombo.handler)
            }
        });
        (function() {
            var d = '<span id="{id}" class="cke_combo cke_combo__{name} {cls}" role="presentation"><span id="{id}_label" class="cke_combo_label">{label}</span><a class="cke_combo_button" title="{title}" tabindex="-1"' + (CKEDITOR.env.gecko && !CKEDITOR.env.hc ? "" : " href=\"javascript:void('{titleJs}')\"") + ' hidefocus="true" role="button" aria-labelledby="{id}_label" aria-haspopup="true"';
            CKEDITOR.env.gecko && CKEDITOR.env.mac && (d += ' onkeypress="return false;"');
            CKEDITOR.env.gecko && (d += ' onblur="this.style.cssText = this.style.cssText;"');
            var d = d + (' onkeydown="return CKEDITOR.tools.callFunction({keydownFn},event,this);" onfocus="return CKEDITOR.tools.callFunction({focusFn},event);" ' + (CKEDITOR.env.ie ? 'onclick="return false;" onmouseup' : "onclick") + '="CKEDITOR.tools.callFunction({clickFn},this);return false;"><span id="{id}_text" class="cke_combo_text cke_combo_inlinelabel">{label}</span><span class="cke_combo_open"><span class="cke_combo_arrow">' + (CKEDITOR.env.hc ? "&#9660;" : CKEDITOR.env.air ? "&nbsp;" : "") + "</span></span></a></span>"),
                k = CKEDITOR.addTemplate("combo", d);
            CKEDITOR.UI_RICHCOMBO = "richcombo";
            CKEDITOR.ui.richCombo = CKEDITOR.tools.createClass({
                $: function(a) {
                    CKEDITOR.tools.extend(this, a, {
                        canGroup: !1,
                        title: a.label,
                        modes: {
                            wysiwyg: 1
                        },
                        editorFocus: 1
                    });
                    a = this.panel || {};
                    delete this.panel;
                    this.id = CKEDITOR.tools.getNextNumber();
                    this.document = a.parent && a.parent.getDocument() || CKEDITOR.document;
                    a.className = "cke_combopanel";
                    a.block = {
                        multiSelect: a.multiSelect,
                        attributes: a.attributes
                    };
                    a.toolbarRelated = !0;
                    this._ = {
                        panelDefinition: a,
                        items: {}
                    }
                },
                proto: {
                    renderHtml: function(a) {
                        var b = [];
                        this.render(a, b);
                        return b.join("")
                    },
                    render: function(a, b) {
                        function g() {
                            if (this.getState() != CKEDITOR.TRISTATE_ON) {
                                var c = this.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
                                a.readOnly && !this.readOnly && (c = CKEDITOR.TRISTATE_DISABLED);
                                this.setState(c);
                                this.setValue("");
                                c != CKEDITOR.TRISTATE_DISABLED && this.refresh && this.refresh()
                            }
                        }
                        var d = CKEDITOR.env,
                            h = "cke_" + this.id,
                            e = CKEDITOR.tools.addFunction(function(b) {
                                l && (a.unlockSelection(1), l = 0);
                                c.execute(b)
                            }, this),
                            f = this,
                            c = {
                                id: h,
                                combo: this,
                                focus: function() {
                                    CKEDITOR.document.getById(h).getChild(1).focus()
                                },
                                execute: function(c) {
                                    var b = f._;
                                    if (b.state != CKEDITOR.TRISTATE_DISABLED)
                                        if (f.createPanel(a), b.on) b.panel.hide();
                                        else {
                                            f.commit();
                                            var d = f.getValue();
                                            d ? b.list.mark(d) : b.list.unmarkAll();
                                            b.panel.showBlock(f.id, new CKEDITOR.dom.element(c), 4)
                                        }
                                },
                                clickFn: e
                            };
                        a.on("activeFilterChange", g, this);
                        a.on("mode", g, this);
                        a.on("selectionChange", g, this);
                        !this.readOnly && a.on("readOnly", g, this);
                        var m = CKEDITOR.tools.addFunction(function(b, d) {
                                b = new CKEDITOR.dom.event(b);
                                var g = b.getKeystroke();
                                if (40 == g) a.once("panelShow", function(a) {
                                    a.data._.panel._.currentBlock.onKeyDown(40)
                                });
                                switch (g) {
                                    case 13:
                                    case 32:
                                    case 40:
                                        CKEDITOR.tools.callFunction(e, d);
                                        break;
                                    default:
                                        c.onkey(c, g)
                                }
                                b.preventDefault()
                            }),
                            n = CKEDITOR.tools.addFunction(function() {
                                c.onfocus && c.onfocus()
                            }),
                            l = 0;
                        c.keyDownFn = m;
                        d = {
                            id: h,
                            name: this.name || this.command,
                            label: this.label,
                            title: this.title,
                            cls: this.className || "",
                            titleJs: d.gecko && !d.hc ? "" : (this.title || "").replace("'", ""),
                            keydownFn: m,
                            focusFn: n,
                            clickFn: e
                        };
                        k.output(d, b);
                        if (this.onRender) this.onRender();
                        return c
                    },
                    createPanel: function(a) {
                        if (!this._.panel) {
                            var b = this._.panelDefinition,
                                d = this._.panelDefinition.block,
                                k = b.parent || CKEDITOR.document.getBody(),
                                h = "cke_combopanel__" + this.name,
                                e = new CKEDITOR.ui.floatPanel(a, k, b),
                                f = e.addListBlock(this.id, d),
                                c = this;
                            e.onShow = function() {
                                this.element.addClass(h);
                                c.setState(CKEDITOR.TRISTATE_ON);
                                c._.on = 1;
                                c.editorFocus && !a.focusManager.hasFocus && a.focus();
                                if (c.onOpen) c.onOpen();
                                a.once("panelShow", function() {
                                    f.focus(!f.multiSelect && c.getValue())
                                })
                            };
                            e.onHide = function(b) {
                                this.element.removeClass(h);
                                c.setState(c.modes && c.modes[a.mode] ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
                                c._.on = 0;
                                if (!b && c.onClose) c.onClose()
                            };
                            e.onEscape = function() {
                                e.hide(1)
                            };
                            f.onClick = function(a, b) {
                                c.onClick && c.onClick.call(c, a, b);
                                e.hide()
                            };
                            this._.panel = e;
                            this._.list = f;
                            e.getBlock(this.id).onHide = function() {
                                c._.on = 0;
                                c.setState(CKEDITOR.TRISTATE_OFF)
                            };
                            this.init && this.init()
                        }
                    },
                    setValue: function(a, b) {
                        this._.value = a;
                        var d = this.document.getById("cke_" + this.id + "_text");
                        d && (a || b ? d.removeClass("cke_combo_inlinelabel") : (b = this.label, d.addClass("cke_combo_inlinelabel")), d.setText("undefined" != typeof b ? b : a))
                    },
                    getValue: function() {
                        return this._.value || ""
                    },
                    unmarkAll: function() {
                        this._.list.unmarkAll()
                    },
                    mark: function(a) {
                        this._.list.mark(a)
                    },
                    hideItem: function(a) {
                        this._.list.hideItem(a)
                    },
                    hideGroup: function(a) {
                        this._.list.hideGroup(a)
                    },
                    showAll: function() {
                        this._.list.showAll()
                    },
                    add: function(a, b, d) {
                        this._.items[a] = d || a;
                        this._.list.add(a, b, d)
                    },
                    startGroup: function(a) {
                        this._.list.startGroup(a)
                    },
                    commit: function() {
                        this._.committed || (this._.list.commit(), this._.committed = 1, CKEDITOR.ui.fire("ready", this));
                        this._.committed = 1
                    },
                    setState: function(a) {
                        if (this._.state != a) {
                            var b = this.document.getById("cke_" + this.id);
                            b.setState(a, "cke_combo");
                            a == CKEDITOR.TRISTATE_DISABLED ? b.setAttribute("aria-disabled", !0) : b.removeAttribute("aria-disabled");
                            this._.state = a
                        }
                    },
                    getState: function() {
                        return this._.state
                    },
                    enable: function() {
                        this._.state == CKEDITOR.TRISTATE_DISABLED && this.setState(this._.lastState)
                    },
                    disable: function() {
                        this._.state != CKEDITOR.TRISTATE_DISABLED && (this._.lastState = this._.state, this.setState(CKEDITOR.TRISTATE_DISABLED))
                    }
                },
                statics: {
                    handler: {
                        create: function(a) {
                            return new CKEDITOR.ui.richCombo(a)
                        }
                    }
                }
            });
            CKEDITOR.ui.prototype.addRichCombo = function(a, b) {
                this.add(a, CKEDITOR.UI_RICHCOMBO, b)
            }
        })();
        (function() {
            function l(a, b, c, f, p, l, t, v) {
                var w = a.config,
                    q = new CKEDITOR.style(t),
                    k = p.split(";");
                p = [];
                for (var m = {}, d = 0; d < k.length; d++) {
                    var h = k[d];
                    if (h) {
                        var h = h.split("/"),
                            u = {},
                            n = k[d] = h[0];
                        u[c] = p[d] = h[1] || n;
                        m[n] = new CKEDITOR.style(t, u);
                        m[n]._.definition.name = n
                    } else k.splice(d--, 1)
                }
                a.ui.addRichCombo(b, {
                    label: f.label,
                    title: f.panelTitle,
                    toolbar: "styles," + v,
                    allowedContent: q,
                    requiredContent: q,
                    panel: {
                        css: [CKEDITOR.skin.getPath("editor")].concat(w.contentsCss),
                        multiSelect: !1,
                        attributes: {
                            "aria-label": f.panelTitle
                        }
                    },
                    init: function() {
                        this.startGroup(f.panelTitle);
                        for (var a = 0; a < k.length; a++) {
                            var b = k[a];
                            this.add(b, m[b].buildPreview(), b)
                        }
                    },
                    onClick: function(b) {
                        a.focus();
                        a.fire("saveSnapshot");
                        var c = this.getValue(),
                            f = m[b];
                        if (c && b != c) {
                            var k = m[c],
                                e = a.getSelection().getRanges()[0];
                            if (e.collapsed) {
                                var d = a.elementPath(),
                                    g = d.contains(function(a) {
                                        return k.checkElementRemovable(a)
                                    });
                                if (g) {
                                    var h = e.checkBoundaryOfElement(g, CKEDITOR.START),
                                        l = e.checkBoundaryOfElement(g, CKEDITOR.END);
                                    if (h && l) {
                                        for (h = e.createBookmark(); d = g.getFirst();) d.insertBefore(g);
                                        g.remove();
                                        e.moveToBookmark(h)
                                    } else h ? e.moveToPosition(g, CKEDITOR.POSITION_BEFORE_START) : l ? e.moveToPosition(g, CKEDITOR.POSITION_AFTER_END) : (e.splitElement(g), e.moveToPosition(g, CKEDITOR.POSITION_AFTER_END), r(e, d.elements.slice(), g));
                                    a.getSelection().selectRanges([e])
                                }
                            } else a.removeStyle(k)
                        }
                        a[c == b ? "removeStyle" : "applyStyle"](f);
                        a.fire("saveSnapshot")
                    },
                    onRender: function() {
                        a.on("selectionChange", function(b) {
                            var c = this.getValue();
                            b = b.data.path.elements;
                            for (var d = 0, f; d < b.length; d++) {
                                f = b[d];
                                for (var e in m)
                                    if (m[e].checkElementMatch(f, !0, a)) {
                                        e != c && this.setValue(e);
                                        return
                                    }
                            }
                            this.setValue("", l)
                        }, this)
                    },
                    refresh: function() {
                        a.activeFilter.check(q) || this.setState(CKEDITOR.TRISTATE_DISABLED)
                    }
                })
            }

            function r(a, b, c) {
                var f = b.pop();
                if (f) {
                    if (c) return r(a, b, f.equals(c) ? null : c);
                    c = f.clone();
                    a.insertNode(c);
                    a.moveToPosition(c, CKEDITOR.POSITION_AFTER_START);
                    r(a, b)
                }
            }
            CKEDITOR.plugins.add("font", {
                requires: "richcombo",
                init: function(a) {
                    var b = a.config;
                    l(a, "Font", "family", a.lang.font, b.font_names, b.font_defaultLabel, b.font_style, 30);
                    l(a, "FontSize", "size", a.lang.font.fontSize, b.fontSize_sizes, b.fontSize_defaultLabel, b.fontSize_style, 40)
                }
            })
        })();
        CKEDITOR.config.font_names = "Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif";
        CKEDITOR.config.font_defaultLabel = "";
        CKEDITOR.config.font_style = {
            element: "span",
            styles: {
                "font-family": "#(family)"
            },
            overrides: [{
                element: "font",
                attributes: {
                    face: null
                }
            }]
        };
        CKEDITOR.config.fontSize_sizes = "8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px";
        CKEDITOR.config.fontSize_defaultLabel = "";
        CKEDITOR.config.fontSize_style = {
            element: "span",
            styles: {
                "font-size": "#(size)"
            },
            overrides: [{
                element: "font",
                attributes: {
                    size: null
                }
            }]
        };
        CKEDITOR.plugins.add("forms", {
            requires: "dialog,fakeobjects",
            onLoad: function() {
                CKEDITOR.addCss(".cke_editable form{border: 1px dotted #FF0000;padding: 2px;}\n");
                CKEDITOR.addCss("img.cke_hidden{background-image: url(" + CKEDITOR.getUrl(this.path + "images/hiddenfield.gif") + ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}")
            },
            init: function(a) {
                var b = a.lang,
                    g = 0,
                    h = {
                        email: 1,
                        password: 1,
                        search: 1,
                        tel: 1,
                        text: 1,
                        url: 1
                    },
                    l = {
                        checkbox: "input[type,name,checked,required]",
                        radio: "input[type,name,checked,required]",
                        textfield: "input[type,name,value,size,maxlength,required]",
                        textarea: "textarea[cols,rows,name,required]",
                        select: "select[name,size,multiple,required]; option[value,selected]",
                        button: "input[type,name,value]",
                        form: "form[action,name,id,enctype,target,method]",
                        hiddenfield: "input[type,name,value]",
                        imagebutton: "input[type,alt,src]{width,height,border,border-width,border-style,margin,float}"
                    },
                    m = {
                        checkbox: "input",
                        radio: "input",
                        textfield: "input",
                        textarea: "textarea",
                        select: "select",
                        button: "input",
                        form: "form",
                        hiddenfield: "input",
                        imagebutton: "input"
                    },
                    e = function(d, c, e) {
                        var h = {
                            allowedContent: l[c],
                            requiredContent: m[c]
                        };
                        "form" == c && (h.context = "form");
                        a.addCommand(c, new CKEDITOR.dialogCommand(c, h));
                        a.ui.addButton && a.ui.addButton(d, {
                            label: b.common[d.charAt(0).toLowerCase() + d.slice(1)],
                            command: c,
                            toolbar: "forms," + (g += 10)
                        });
                        CKEDITOR.dialog.add(c, e)
                    },
                    f = this.path + "dialogs/";
                !a.blockless && e("Form", "form", f + "form.js");
                e("Checkbox", "checkbox", f + "checkbox.js");
                e("Radio", "radio", f + "radio.js");
                e("TextField", "textfield", f + "textfield.js");
                e("Textarea", "textarea", f + "textarea.js");
                e("Select", "select", f + "select.js");
                e("Button", "button", f + "button.js");
                var k = a.plugins.image;
                k && !a.plugins.image2 && e("ImageButton", "imagebutton", CKEDITOR.plugins.getPath("image") + "dialogs/image.js");
                e("HiddenField", "hiddenfield", f + "hiddenfield.js");
                a.addMenuItems && (e = {
                    checkbox: {
                        label: b.forms.checkboxAndRadio.checkboxTitle,
                        command: "checkbox",
                        group: "checkbox"
                    },
                    radio: {
                        label: b.forms.checkboxAndRadio.radioTitle,
                        command: "radio",
                        group: "radio"
                    },
                    textfield: {
                        label: b.forms.textfield.title,
                        command: "textfield",
                        group: "textfield"
                    },
                    hiddenfield: {
                        label: b.forms.hidden.title,
                        command: "hiddenfield",
                        group: "hiddenfield"
                    },
                    button: {
                        label: b.forms.button.title,
                        command: "button",
                        group: "button"
                    },
                    select: {
                        label: b.forms.select.title,
                        command: "select",
                        group: "select"
                    },
                    textarea: {
                        label: b.forms.textarea.title,
                        command: "textarea",
                        group: "textarea"
                    }
                }, k && (e.imagebutton = {
                    label: b.image.titleButton,
                    command: "imagebutton",
                    group: "imagebutton"
                }), !a.blockless && (e.form = {
                    label: b.forms.form.menu,
                    command: "form",
                    group: "form"
                }), a.addMenuItems(e));
                a.contextMenu && (!a.blockless && a.contextMenu.addListener(function(d, c, a) {
                    if ((d = a.contains("form", 1)) && !d.isReadOnly()) return {
                        form: CKEDITOR.TRISTATE_OFF
                    }
                }), a.contextMenu.addListener(function(d) {
                    if (d && !d.isReadOnly()) {
                        var c = d.getName();
                        if ("select" == c) return {
                            select: CKEDITOR.TRISTATE_OFF
                        };
                        if ("textarea" == c) return {
                            textarea: CKEDITOR.TRISTATE_OFF
                        };
                        if ("input" == c) {
                            var a = d.getAttribute("type") || "text";
                            switch (a) {
                                case "button":
                                case "submit":
                                case "reset":
                                    return {
                                        button: CKEDITOR.TRISTATE_OFF
                                    };
                                case "checkbox":
                                    return {
                                        checkbox: CKEDITOR.TRISTATE_OFF
                                    };
                                case "radio":
                                    return {
                                        radio: CKEDITOR.TRISTATE_OFF
                                    };
                                case "image":
                                    return k ? {
                                        imagebutton: CKEDITOR.TRISTATE_OFF
                                    } : null
                            }
                            if (h[a]) return {
                                textfield: CKEDITOR.TRISTATE_OFF
                            }
                        }
                        if ("img" == c && "hiddenfield" == d.data("cke-real-element-type")) return {
                            hiddenfield: CKEDITOR.TRISTATE_OFF
                        }
                    }
                }));
                a.on("doubleclick", function(d) {
                    var c = d.data.element;
                    if (!a.blockless && c.is("form")) d.data.dialog = "form";
                    else if (c.is("select")) d.data.dialog = "select";
                    else if (c.is("textarea")) d.data.dialog = "textarea";
                    else if (c.is("img") && "hiddenfield" == c.data("cke-real-element-type")) d.data.dialog = "hiddenfield";
                    else if (c.is("input")) {
                        c = c.getAttribute("type") || "text";
                        switch (c) {
                            case "button":
                            case "submit":
                            case "reset":
                                d.data.dialog = "button";
                                break;
                            case "checkbox":
                                d.data.dialog = "checkbox";
                                break;
                            case "radio":
                                d.data.dialog = "radio";
                                break;
                            case "image":
                                d.data.dialog = "imagebutton"
                        }
                        h[c] && (d.data.dialog = "textfield")
                    }
                })
            },
            afterInit: function(a) {
                var b = a.dataProcessor,
                    g = b && b.htmlFilter,
                    b = b && b.dataFilter;
                CKEDITOR.env.ie && g && g.addRules({
                    elements: {
                        input: function(a) {
                            a = a.attributes;
                            var b = a.type;
                            b || (a.type = "text");
                            "checkbox" != b && "radio" != b || "on" != a.value || delete a.value
                        }
                    }
                }, {
                    applyToAll: !0
                });
                b && b.addRules({
                    elements: {
                        input: function(b) {
                            if ("hidden" == b.attributes.type) return a.createFakeParserElement(b, "cke_hidden", "hiddenfield")
                        }
                    }
                }, {
                    applyToAll: !0
                })
            }
        });
        CKEDITOR.plugins.add("format", {
            requires: "richcombo",
            init: function(a) {
                if (!a.blockless) {
                    for (var f = a.config, c = a.lang.format, l = f.format_tags.split(";"), d = {}, m = 0, n = [], g = 0; g < l.length; g++) {
                        var h = l[g],
                            k = new CKEDITOR.style(f["format_" + h]);
                        if (!a.filter.customConfig || a.filter.check(k)) m++, d[h] = k, d[h]._.enterMode = a.config.enterMode, n.push(k)
                    }
                    0 !== m && a.ui.addRichCombo("Format", {
                        label: c.label,
                        title: c.panelTitle,
                        toolbar: "styles,20",
                        allowedContent: n,
                        panel: {
                            css: [CKEDITOR.skin.getPath("editor")].concat(f.contentsCss),
                            multiSelect: !1,
                            attributes: {
                                "aria-label": c.panelTitle
                            }
                        },
                        init: function() {
                            this.startGroup(c.panelTitle);
                            for (var a in d) {
                                var e = c["tag_" + a];
                                this.add(a, d[a].buildPreview(e), e)
                            }
                        },
                        onClick: function(b) {
                            a.focus();
                            a.fire("saveSnapshot");
                            b = d[b];
                            var e = a.elementPath();
                            a[b.checkActive(e, a) ? "removeStyle" : "applyStyle"](b);
                            setTimeout(function() {
                                a.fire("saveSnapshot")
                            }, 0)
                        },
                        onRender: function() {
                            a.on("selectionChange", function(b) {
                                var e = this.getValue();
                                b = b.data.path;
                                this.refresh();
                                for (var c in d)
                                    if (d[c].checkActive(b, a)) {
                                        c != e && this.setValue(c, a.lang.format["tag_" + c]);
                                        return
                                    }
                                this.setValue("")
                            }, this)
                        },
                        onOpen: function() {
                            this.showAll();
                            for (var b in d) a.activeFilter.check(d[b]) || this.hideItem(b)
                        },
                        refresh: function() {
                            var b = a.elementPath();
                            if (b) {
                                if (b.isContextFor("p"))
                                    for (var c in d)
                                        if (a.activeFilter.check(d[c])) return;
                                this.setState(CKEDITOR.TRISTATE_DISABLED)
                            }
                        }
                    })
                }
            }
        });
        CKEDITOR.config.format_tags = "p;h1;h2;h3;h4;h5;h6;pre;address;div";
        CKEDITOR.config.format_p = {
            element: "p"
        };
        CKEDITOR.config.format_div = {
            element: "div"
        };
        CKEDITOR.config.format_pre = {
            element: "pre"
        };
        CKEDITOR.config.format_address = {
            element: "address"
        };
        CKEDITOR.config.format_h1 = {
            element: "h1"
        };
        CKEDITOR.config.format_h2 = {
            element: "h2"
        };
        CKEDITOR.config.format_h3 = {
            element: "h3"
        };
        CKEDITOR.config.format_h4 = {
            element: "h4"
        };
        CKEDITOR.config.format_h5 = {
            element: "h5"
        };
        CKEDITOR.config.format_h6 = {
            element: "h6"
        };
        (function() {
            var b = {
                canUndo: !1,
                exec: function(a) {
                    var b = a.document.createElement("hr");
                    a.insertElement(b)
                },
                allowedContent: "hr",
                requiredContent: "hr"
            };
            CKEDITOR.plugins.add("horizontalrule", {
                init: function(a) {
                    a.blockless || (a.addCommand("horizontalrule", b), a.ui.addButton && a.ui.addButton("HorizontalRule", {
                        label: a.lang.horizontalrule.toolbar,
                        command: "horizontalrule",
                        toolbar: "insert,40"
                    }))
                }
            })
        })();
        CKEDITOR.plugins.add("htmlwriter", {
            init: function(b) {
                var a = new CKEDITOR.htmlWriter;
                a.forceSimpleAmpersand = b.config.forceSimpleAmpersand;
                a.indentationChars = b.config.dataIndentationChars || "	";
                b.dataProcessor.writer = a
            }
        });
        CKEDITOR.htmlWriter = CKEDITOR.tools.createClass({
            base: CKEDITOR.htmlParser.basicWriter,
            $: function() {
                this.base();
                this.indentationChars = "	";
                this.selfClosingEnd = " />";
                this.lineBreakChars = "\n";
                this.sortAttributes = 1;
                this._.indent = 0;
                this._.indentation = "";
                this._.inPre = 0;
                this._.rules = {};
                var b = CKEDITOR.dtd,
                    a;
                for (a in CKEDITOR.tools.extend({}, b.$nonBodyContent, b.$block, b.$listItem, b.$tableContent)) this.setRules(a, {
                    indent: !b[a]["#"],
                    breakBeforeOpen: 1,
                    breakBeforeClose: !b[a]["#"],
                    breakAfterClose: 1,
                    needsSpace: a in b.$block && !(a in {
                        li: 1,
                        dt: 1,
                        dd: 1
                    })
                });
                this.setRules("br", {
                    breakAfterOpen: 1
                });
                this.setRules("title", {
                    indent: 0,
                    breakAfterOpen: 0
                });
                this.setRules("style", {
                    indent: 0,
                    breakBeforeClose: 1
                });
                this.setRules("pre", {
                    breakAfterOpen: 1,
                    indent: 0
                })
            },
            proto: {
                openTag: function(b) {
                    var a = this._.rules[b];
                    this._.afterCloser && a && a.needsSpace && this._.needsSpace && this._.output.push("\n");
                    this._.indent ? this.indentation() : a && a.breakBeforeOpen && (this.lineBreak(), this.indentation());
                    this._.output.push("<", b);
                    this._.afterCloser = 0
                },
                openTagClose: function(b, a) {
                    var c = this._.rules[b];
                    a ? (this._.output.push(this.selfClosingEnd), c && c.breakAfterClose && (this._.needsSpace = c.needsSpace)) : (this._.output.push(">"), c && c.indent && (this._.indentation += this.indentationChars));
                    c && c.breakAfterOpen && this.lineBreak();
                    "pre" == b && (this._.inPre = 1)
                },
                attribute: function(b, a) {
                    "string" == typeof a && (this.forceSimpleAmpersand && (a = a.replace(/&amp;/g, "&")), a = CKEDITOR.tools.htmlEncodeAttr(a));
                    this._.output.push(" ", b, '="', a, '"')
                },
                closeTag: function(b) {
                    var a = this._.rules[b];
                    a && a.indent && (this._.indentation = this._.indentation.substr(this.indentationChars.length));
                    this._.indent ? this.indentation() : a && a.breakBeforeClose && (this.lineBreak(), this.indentation());
                    this._.output.push("</", b, ">");
                    "pre" == b && (this._.inPre = 0);
                    a && a.breakAfterClose && (this.lineBreak(), this._.needsSpace = a.needsSpace);
                    this._.afterCloser = 1
                },
                text: function(b) {
                    this._.indent && (this.indentation(), !this._.inPre && (b = CKEDITOR.tools.ltrim(b)));
                    this._.output.push(b)
                },
                comment: function(b) {
                    this._.indent && this.indentation();
                    this._.output.push("<!--", b, "-->")
                },
                lineBreak: function() {
                    !this._.inPre && 0 < this._.output.length && this._.output.push(this.lineBreakChars);
                    this._.indent = 1
                },
                indentation: function() {
                    !this._.inPre && this._.indentation && this._.output.push(this._.indentation);
                    this._.indent = 0
                },
                reset: function() {
                    this._.output = [];
                    this._.indent = 0;
                    this._.indentation = "";
                    this._.afterCloser = 0;
                    this._.inPre = 0
                },
                setRules: function(b, a) {
                    var c = this._.rules[b];
                    c ? CKEDITOR.tools.extend(c, a, !0) : this._.rules[b] = a
                }
            }
        });
        (function() {
            CKEDITOR.plugins.add("iframe", {
                requires: "dialog,fakeobjects",
                onLoad: function() {
                    CKEDITOR.addCss("img.cke_iframe{background-image: url(" + CKEDITOR.getUrl(this.path + "images/placeholder.png") + ");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}")
                },
                init: function(a) {
                    var b = a.lang.iframe,
                        c = "iframe[align,longdesc,frameborder,height,name,scrolling,src,title,width]";
                    a.plugins.dialogadvtab && (c += ";iframe" + a.plugins.dialogadvtab.allowedContent({
                        id: 1,
                        classes: 1,
                        styles: 1
                    }));
                    CKEDITOR.dialog.add("iframe", this.path + "dialogs/iframe.js");
                    a.addCommand("iframe", new CKEDITOR.dialogCommand("iframe", {
                        allowedContent: c,
                        requiredContent: "iframe"
                    }));
                    a.ui.addButton && a.ui.addButton("Iframe", {
                        label: b.toolbar,
                        command: "iframe",
                        toolbar: "insert,80"
                    });
                    a.on("doubleclick", function(a) {
                        var b = a.data.element;
                        b.is("img") && "iframe" == b.data("cke-real-element-type") && (a.data.dialog = "iframe")
                    });
                    a.addMenuItems && a.addMenuItems({
                        iframe: {
                            label: b.title,
                            command: "iframe",
                            group: "image"
                        }
                    });
                    a.contextMenu && a.contextMenu.addListener(function(a) {
                        if (a && a.is("img") && "iframe" == a.data("cke-real-element-type")) return {
                            iframe: CKEDITOR.TRISTATE_OFF
                        }
                    })
                },
                afterInit: function(a) {
                    var b = a.dataProcessor;
                    (b = b && b.dataFilter) && b.addRules({
                        elements: {
                            iframe: function(b) {
                                return a.createFakeParserElement(b, "cke_iframe", "iframe", !0)
                            }
                        }
                    })
                }
            })
        })();
        (function() {
            function m(a) {
                function f(a) {
                    var b = !1;
                    g.attachListener(g, "keydown", function() {
                        var d = c.getBody().getElementsByTag(a);
                        if (!b) {
                            for (var e = 0; e < d.count(); e++) d.getItem(e).setCustomData("retain", !0);
                            b = !0
                        }
                    }, null, null, 1);
                    g.attachListener(g, "keyup", function() {
                        var d = c.getElementsByTag(a);
                        b && (1 != d.count() || d.getItem(0).getCustomData("retain") || d.getItem(0).remove(1), b = !1)
                    })
                }
                var b = this.editor,
                    c = a.document,
                    d = c.body,
                    e = c.getElementById("cke_actscrpt");
                e && e.parentNode.removeChild(e);
                (e = c.getElementById("cke_shimscrpt")) && e.parentNode.removeChild(e);
                (e = c.getElementById("cke_basetagscrpt")) && e.parentNode.removeChild(e);
                d.contentEditable = !0;
                CKEDITOR.env.ie && (d.hideFocus = !0, d.disabled = !0, d.removeAttribute("disabled"));
                delete this._.isLoadingData;
                this.$ = d;
                c = new CKEDITOR.dom.document(c);
                this.setup();
                this.fixInitialSelection();
                var g = this;
                CKEDITOR.env.ie && !CKEDITOR.env.edge && c.getDocumentElement().addClass(c.$.compatMode);
                CKEDITOR.env.ie && !CKEDITOR.env.edge && b.enterMode != CKEDITOR.ENTER_P ? f("p") : CKEDITOR.env.edge && b.enterMode != CKEDITOR.ENTER_DIV && f("div");
                if (CKEDITOR.env.webkit || CKEDITOR.env.ie && 10 < CKEDITOR.env.version) c.getDocumentElement().on("mousedown", function(a) {
                    a.data.getTarget().is("html") && setTimeout(function() {
                        b.editable().focus()
                    })
                });
                n(b);
                try {
                    b.document.$.execCommand("2D-position", !1, !0)
                } catch (h) {}(CKEDITOR.env.gecko || CKEDITOR.env.ie && "CSS1Compat" == b.document.$.compatMode) && this.attachListener(this, "keydown", function(a) {
                    var c = a.data.getKeystroke();
                    if (33 == c || 34 == c)
                        if (CKEDITOR.env.ie) setTimeout(function() {
                            b.getSelection().scrollIntoView()
                        }, 0);
                        else if (b.window.$.innerHeight > this.$.offsetHeight) {
                        var d = b.createRange();
                        d[33 == c ? "moveToElementEditStart" : "moveToElementEditEnd"](this);
                        d.select();
                        a.data.preventDefault()
                    }
                });
                CKEDITOR.env.ie && this.attachListener(c, "blur", function() {
                    try {
                        c.$.selection.empty()
                    } catch (a) {}
                });
                CKEDITOR.env.iOS && this.attachListener(c, "touchend", function() {
                    a.focus()
                });
                d = b.document.getElementsByTag("title").getItem(0);
                d.data("cke-title", d.getText());
                CKEDITOR.env.ie && (b.document.$.title = this._.docTitle);
                CKEDITOR.tools.setTimeout(function() {
                    "unloaded" == this.status && (this.status = "ready");
                    b.fire("contentDom");
                    this._.isPendingFocus && (b.focus(), this._.isPendingFocus = !1);
                    setTimeout(function() {
                        b.fire("dataReady")
                    }, 0)
                }, 0, this)
            }

            function n(a) {
                function f() {
                    var c;
                    a.editable().attachListener(a, "selectionChange", function() {
                        var d = a.getSelection().getSelectedElement();
                        d && (c && (c.detachEvent("onresizestart", b), c = null), d.$.attachEvent("onresizestart", b), c = d.$)
                    })
                }

                function b(a) {
                    a.returnValue = !1
                }
                if (CKEDITOR.env.gecko) try {
                    var c = a.document.$;
                    c.execCommand("enableObjectResizing", !1, !a.config.disableObjectResizing);
                    c.execCommand("enableInlineTableEditing", !1, !a.config.disableNativeTableHandles)
                } catch (d) {} else CKEDITOR.env.ie && 11 > CKEDITOR.env.version && a.config.disableObjectResizing && f(a)
            }

            function p() {
                var a = [];
                if (8 <= CKEDITOR.document.$.documentMode) {
                    a.push("html.CSS1Compat [contenteditable=false]{min-height:0 !important}");
                    var f = [],
                        b;
                    for (b in CKEDITOR.dtd.$removeEmpty) f.push("html.CSS1Compat " + b + "[contenteditable=false]");
                    a.push(f.join(",") + "{display:inline-block}")
                } else CKEDITOR.env.gecko && (a.push("html{height:100% !important}"), a.push("img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}"));
                a.push("html{cursor:text;*cursor:auto}");
                a.push("img,input,textarea{cursor:default}");
                return a.join("\n")
            }
            CKEDITOR.plugins.add("wysiwygarea", {
                init: function(a) {
                    a.config.fullPage && a.addFeature({
                        allowedContent: "html head title; style [media,type]; body (*)[id]; meta link [*]",
                        requiredContent: "body"
                    });
                    a.addMode("wysiwyg", function(f) {
                        function b(b) {
                            b && b.removeListener();
                            a.editable(new l(a, d.$.contentWindow.document.body));
                            a.setData(a.getData(1), f)
                        }
                        var c = "document.open();" + (CKEDITOR.env.ie ? "(" + CKEDITOR.tools.fixDomain + ")();" : "") + "document.close();",
                            c = CKEDITOR.env.air ? "javascript:void(0)" : CKEDITOR.env.ie && !CKEDITOR.env.edge ? "javascript:void(function(){" + encodeURIComponent(c) + "}())" : "",
                            d = CKEDITOR.dom.element.createFromHtml('<iframe src="' + c + '" frameBorder="0"></iframe>');
                        d.setStyles({
                            width: "100%",
                            height: "100%"
                        });
                        d.addClass("cke_wysiwyg_frame").addClass("cke_reset");
                        c = a.ui.space("contents");
                        c.append(d);
                        var e = CKEDITOR.env.ie && !CKEDITOR.env.edge || CKEDITOR.env.gecko;
                        if (e) d.on("load", b);
                        var g = a.title,
                            h = a.fire("ariaEditorHelpLabel", {}).label;
                        g && (CKEDITOR.env.ie && h && (g += ", " + h), d.setAttribute("title", g));
                        if (h) {
                            var g = CKEDITOR.tools.getNextId(),
                                k = CKEDITOR.dom.element.createFromHtml('<span id="' + g + '" class="cke_voice_label">' + h + "</span>");
                            c.append(k, 1);
                            d.setAttribute("aria-describedby", g)
                        }
                        a.on("beforeModeUnload", function(a) {
                            a.removeListener();
                            k && k.remove()
                        });
                        d.setAttributes({
                            tabIndex: a.tabIndex,
                            allowTransparency: "true"
                        });
                        !e && b();
                        a.fire("ariaWidget", d)
                    })
                }
            });
            CKEDITOR.editor.prototype.addContentsCss = function(a) {
                var f = this.config,
                    b = f.contentsCss;
                CKEDITOR.tools.isArray(b) || (f.contentsCss = b ? [b] : []);
                f.contentsCss.push(a)
            };
            var l = CKEDITOR.tools.createClass({
                $: function() {
                    this.base.apply(this, arguments);
                    this._.frameLoadedHandler = CKEDITOR.tools.addFunction(function(a) {
                        CKEDITOR.tools.setTimeout(m, 0, this, a)
                    }, this);
                    this._.docTitle = this.getWindow().getFrame().getAttribute("title")
                },
                base: CKEDITOR.editable,
                proto: {
                    setData: function(a, f) {
                        var b = this.editor;
                        if (f) this.setHtml(a), this.fixInitialSelection(), b.fire("dataReady");
                        else {
                            this._.isLoadingData = !0;
                            b._.dataStore = {
                                id: 1
                            };
                            var c = b.config,
                                d = c.fullPage,
                                e = c.docType,
                                g = CKEDITOR.tools.buildStyleHtml(p()).replace(/<style>/, '<style data-cke-temp="1">');
                            d || (g += CKEDITOR.tools.buildStyleHtml(b.config.contentsCss));
                            var h = c.baseHref ? '<base href="' + c.baseHref + '" data-cke-temp="1" />' : "";
                            d && (a = a.replace(/<!DOCTYPE[^>]*>/i, function(a) {
                                b.docType = e = a;
                                return ""
                            }).replace(/<\?xml\s[^\?]*\?>/i, function(a) {
                                b.xmlDeclaration = a;
                                return ""
                            }));
                            a = b.dataProcessor.toHtml(a);
                            d ? (/<body[\s|>]/.test(a) || (a = "<body>" + a), /<html[\s|>]/.test(a) || (a = "<html>" + a + "</html>"), /<head[\s|>]/.test(a) ? /<title[\s|>]/.test(a) || (a = a.replace(/<head[^>]*>/, "$&<title></title>")) : a = a.replace(/<html[^>]*>/, "$&<head><title></title></head>"), h && (a = a.replace(/<head[^>]*?>/, "$&" + h)), a = a.replace(/<\/head\s*>/, g + "$&"), a = e + a) : a = c.docType + '<html dir="' + c.contentsLangDirection + '" lang="' + (c.contentsLanguage || b.langCode) + '"><head><title>' + this._.docTitle + "</title>" + h + g + "</head><body" + (c.bodyId ? ' id="' + c.bodyId + '"' : "") + (c.bodyClass ? ' class="' + c.bodyClass + '"' : "") + ">" + a + "</body></html>";
                            CKEDITOR.env.gecko && (a = a.replace(/<body/, '<body contenteditable="true" '), 2e4 > CKEDITOR.env.version && (a = a.replace(/<body[^>]*>/, "$&<!-- cke-content-start -->")));
                            c = '<script id="cke_actscrpt" type="text/javascript"' + (CKEDITOR.env.ie ? ' defer="defer" ' : "") + ">var wasLoaded=0;function onload(){if(!wasLoaded)window.parent.CKEDITOR.tools.callFunction(" + this._.frameLoadedHandler + ",window);wasLoaded=1;}" + (CKEDITOR.env.ie ? "onload();" : 'document.addEventListener("DOMContentLoaded", onload, false );') + "</script>";
                            CKEDITOR.env.ie && 9 > CKEDITOR.env.version && (c += '<script id="cke_shimscrpt">window.parent.CKEDITOR.tools.enableHtml5Elements(document)</script>');
                            h && CKEDITOR.env.ie && 10 > CKEDITOR.env.version && (c += '<script id="cke_basetagscrpt">var baseTag = document.querySelector( "base" );baseTag.href = baseTag.href;</script>');
                            a = a.replace(/(?=\s*<\/(:?head)>)/, c);
                            this.clearCustomData();
                            this.clearListeners();
                            b.fire("contentDomUnload");
                            var k = this.getDocument();
                            try {
                                k.write(a)
                            } catch (l) {
                                setTimeout(function() {
                                    k.write(a)
                                }, 0)
                            }
                        }
                    },
                    getData: function(a) {
                        if (a) return this.getHtml();
                        a = this.editor;
                        var f = a.config,
                            b = f.fullPage,
                            c = b && a.docType,
                            d = b && a.xmlDeclaration,
                            e = this.getDocument(),
                            b = b ? e.getDocumentElement().getOuterHtml() : e.getBody().getHtml();
                        CKEDITOR.env.gecko && f.enterMode != CKEDITOR.ENTER_BR && (b = b.replace(/<br>(?=\s*(:?$|<\/body>))/, ""));
                        b = a.dataProcessor.toDataFormat(b);
                        d && (b = d + "\n" + b);
                        c && (b = c + "\n" + b);
                        return b
                    },
                    focus: function() {
                        this._.isLoadingData ? this._.isPendingFocus = !0 : l.baseProto.focus.call(this)
                    },
                    detach: function() {
                        var a = this.editor,
                            f = a.document,
                            b;
                        try {
                            b = a.window.getFrame()
                        } catch (c) {}
                        l.baseProto.detach.call(this);
                        this.clearCustomData();
                        f.getDocumentElement().clearCustomData();
                        CKEDITOR.tools.removeFunction(this._.frameLoadedHandler);
                        b && b.getParent() ? (b.clearCustomData(), (a = b.removeCustomData("onResize")) && a.removeListener(), b.remove()) : CKEDITOR.warn("editor-destroy-iframe")
                    }
                }
            })
        })();
        CKEDITOR.config.disableObjectResizing = !1;
        CKEDITOR.config.disableNativeTableHandles = !0;
        CKEDITOR.config.disableNativeSpellChecker = !0;
        (function() {
            function e(b, a) {
                a || (a = b.getSelection().getSelectedElement());
                if (a && a.is("img") && !a.data("cke-realelement") && !a.isReadOnly()) return a
            }

            function f(b) {
                var a = b.getStyle("float");
                if ("inherit" == a || "none" == a) a = 0;
                a || (a = b.getAttribute("align"));
                return a
            }
            CKEDITOR.plugins.add("image", {
                requires: "dialog",
                init: function(b) {
                    if (!b.plugins.image2) {
                        CKEDITOR.dialog.add("image", this.path + "dialogs/image.js");
                        var a = "img[alt,!src]{border-style,border-width,float,height,margin,margin-bottom,margin-left,margin-right,margin-top,width}";
                        CKEDITOR.dialog.isTabEnabled(b, "image", "advanced") && (a = "img[alt,dir,id,lang,longdesc,!src,title]{*}(*)");
                        b.addCommand("image", new CKEDITOR.dialogCommand("image", {
                            allowedContent: a,
                            requiredContent: "img[alt,src]",
                            contentTransformations: [
                                ["img{width}: sizeToStyle", "img[width]: sizeToAttribute"],
                                ["img{float}: alignmentToStyle", "img[align]: alignmentToAttribute"]
                            ]
                        }));
                        b.ui.addButton && b.ui.addButton("Image", {
                            label: b.lang.common.image,
                            command: "image",
                            toolbar: "insert,10"
                        });
                        b.on("doubleclick", function(b) {
                            var a = b.data.element;
                            !a.is("img") || a.data("cke-realelement") || a.isReadOnly() || (b.data.dialog = "image")
                        });
                        b.addMenuItems && b.addMenuItems({
                            image: {
                                label: b.lang.image.menu,
                                command: "image",
                                group: "image"
                            }
                        });
                        b.contextMenu && b.contextMenu.addListener(function(a) {
                            if (e(b, a)) return {
                                image: CKEDITOR.TRISTATE_OFF
                            }
                        })
                    }
                },
                afterInit: function(b) {
                    function a(a) {
                        var d = b.getCommand("justify" + a);
                        if (d) {
                            if ("left" == a || "right" == a) d.on("exec", function(d) {
                                var c = e(b),
                                    g;
                                c && (g = f(c), g == a ? (c.removeStyle("float"), a == f(c) && c.removeAttribute("align")) : c.setStyle("float", a), d.cancel())
                            });
                            d.on("refresh", function(d) {
                                var c = e(b);
                                c && (c = f(c), this.setState(c == a ? CKEDITOR.TRISTATE_ON : "right" == a || "left" == a ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED), d.cancel())
                            })
                        }
                    }
                    b.plugins.image2 || (a("left"), a("right"), a("center"), a("block"))
                }
            })
        })();
        CKEDITOR.config.image_removeLinkByEmptyURL = !0;
        (function() {
            function m(a, b) {
                var e, f;
                b.on("refresh", function(a) {
                    var b = [k],
                        c;
                    for (c in a.data.states) b.push(a.data.states[c]);
                    this.setState(CKEDITOR.tools.search(b, p) ? p : k)
                }, b, null, 100);
                b.on("exec", function(b) {
                    e = a.getSelection();
                    f = e.createBookmarks(1);
                    b.data || (b.data = {});
                    b.data.done = !1
                }, b, null, 0);
                b.on("exec", function() {
                    a.forceNextSelectionCheck();
                    e.selectBookmarks(f)
                }, b, null, 100)
            }
            var k = CKEDITOR.TRISTATE_DISABLED,
                p = CKEDITOR.TRISTATE_OFF;
            CKEDITOR.plugins.add("indent", {
                init: function(a) {
                    var b = CKEDITOR.plugins.indent.genericDefinition;
                    m(a, a.addCommand("indent", new b(!0)));
                    m(a, a.addCommand("outdent", new b));
                    a.ui.addButton && (a.ui.addButton("Indent", {
                        label: a.lang.indent.indent,
                        command: "indent",
                        directional: !0,
                        toolbar: "indent,20"
                    }), a.ui.addButton("Outdent", {
                        label: a.lang.indent.outdent,
                        command: "outdent",
                        directional: !0,
                        toolbar: "indent,10"
                    }));
                    a.on("dirChanged", function(b) {
                        var f = a.createRange(),
                            l = b.data.node;
                        f.setStartBefore(l);
                        f.setEndAfter(l);
                        for (var n = new CKEDITOR.dom.walker(f), c; c = n.next();)
                            if (c.type == CKEDITOR.NODE_ELEMENT)
                                if (!c.equals(l) && c.getDirection()) f.setStartAfter(c), n = new CKEDITOR.dom.walker(f);
                                else {
                                    var d = a.config.indentClasses;
                                    if (d)
                                        for (var g = "ltr" == b.data.dir ? ["_rtl", ""] : ["", "_rtl"], h = 0; h < d.length; h++) c.hasClass(d[h] + g[0]) && (c.removeClass(d[h] + g[0]), c.addClass(d[h] + g[1]));
                                    d = c.getStyle("margin-right");
                                    g = c.getStyle("margin-left");
                                    d ? c.setStyle("margin-left", d) : c.removeStyle("margin-left");
                                    g ? c.setStyle("margin-right", g) : c.removeStyle("margin-right")
                                }
                    })
                }
            });
            CKEDITOR.plugins.indent = {
                genericDefinition: function(a) {
                    this.isIndent = !!a;
                    this.startDisabled = !this.isIndent
                },
                specificDefinition: function(a, b, e) {
                    this.name = b;
                    this.editor = a;
                    this.jobs = {};
                    this.enterBr = a.config.enterMode == CKEDITOR.ENTER_BR;
                    this.isIndent = !!e;
                    this.relatedGlobal = e ? "indent" : "outdent";
                    this.indentKey = e ? 9 : CKEDITOR.SHIFT + 9;
                    this.database = {}
                },
                registerCommands: function(a, b) {
                    a.on("pluginsLoaded", function() {
                        for (var a in b)(function(a, b) {
                            var e = a.getCommand(b.relatedGlobal),
                                c;
                            for (c in b.jobs) e.on("exec", function(d) {
                                d.data.done || (a.fire("lockSnapshot"), b.execJob(a, c) && (d.data.done = !0), a.fire("unlockSnapshot"), CKEDITOR.dom.element.clearAllMarkers(b.database))
                            }, this, null, c), e.on("refresh", function(d) {
                                d.data.states || (d.data.states = {});
                                d.data.states[b.name + "@" + c] = b.refreshJob(a, c, d.data.path)
                            }, this, null, c);
                            a.addFeature(b)
                        })(this, b[a])
                    })
                }
            };
            CKEDITOR.plugins.indent.genericDefinition.prototype = {
                context: "p",
                exec: function() {}
            };
            CKEDITOR.plugins.indent.specificDefinition.prototype = {
                execJob: function(a, b) {
                    var e = this.jobs[b];
                    if (e.state != k) return e.exec.call(this, a)
                },
                refreshJob: function(a, b, e) {
                    b = this.jobs[b];
                    a.activeFilter.checkFeature(this) ? b.state = b.refresh.call(this, a, e) : b.state = k;
                    return b.state
                },
                getContext: function(a) {
                    return a.contains(this.context)
                }
            }
        })();
        (function() {
            function f(b, c, a) {
                if (!b.getCustomData("indent_processed")) {
                    var d = this.editor,
                        l = this.isIndent;
                    if (c) {
                        d = b.$.className.match(this.classNameRegex);
                        a = 0;
                        d && (d = d[1], a = CKEDITOR.tools.indexOf(c, d) + 1);
                        if (0 > (a += l ? 1 : -1)) return;
                        a = Math.min(a, c.length);
                        a = Math.max(a, 0);
                        b.$.className = CKEDITOR.tools.ltrim(b.$.className.replace(this.classNameRegex, ""));
                        0 < a && b.addClass(c[a - 1])
                    } else {
                        c = m(b, a);
                        a = parseInt(b.getStyle(c), 10);
                        var g = d.config.indentOffset || 40;
                        isNaN(a) && (a = 0);
                        a += (l ? 1 : -1) * g;
                        if (0 > a) return;
                        a = Math.max(a, 0);
                        a = Math.ceil(a / g) * g;
                        b.setStyle(c, a ? a + (d.config.indentUnit || "px") : "");
                        "" === b.getAttribute("style") && b.removeAttribute("style")
                    }
                    CKEDITOR.dom.element.setMarker(this.database, b, "indent_processed", 1)
                }
            }

            function m(b, c) {
                return "ltr" == (c || b.getComputedStyle("direction")) ? "margin-left" : "margin-right"
            }
            var h = CKEDITOR.dtd.$listItem,
                p = CKEDITOR.dtd.$list,
                k = CKEDITOR.TRISTATE_DISABLED,
                n = CKEDITOR.TRISTATE_OFF;
            CKEDITOR.plugins.add("indentblock", {
                requires: "indent",
                init: function(b) {
                    function c() {
                        a.specificDefinition.apply(this, arguments);
                        this.allowedContent = {
                            "div h1 h2 h3 h4 h5 h6 ol p pre ul": {
                                propertiesOnly: !0,
                                styles: d ? null : "margin-left,margin-right",
                                classes: d || null
                            }
                        };
                        this.enterBr && (this.allowedContent.div = !0);
                        this.requiredContent = (this.enterBr ? "div" : "p") + (d ? "(" + d.join(",") + ")" : "{margin-left}");
                        this.jobs = {
                            20: {
                                refresh: function(a, b) {
                                    var e = b.block || b.blockLimit;
                                    if (!e.is(h)) var c = e.getAscendant(h),
                                        e = c && b.contains(c) || e;
                                    e.is(h) && (e = e.getParent());
                                    if (this.enterBr || this.getContext(b)) {
                                        if (d) {
                                            var c = d,
                                                e = e.$.className.match(this.classNameRegex),
                                                f = this.isIndent,
                                                c = e ? f ? e[1] != c.slice(-1) : !0 : f;
                                            return c ? n : k
                                        }
                                        return this.isIndent ? n : e ? CKEDITOR[0 >= (parseInt(e.getStyle(m(e)), 10) || 0) ? "TRISTATE_DISABLED" : "TRISTATE_OFF"] : k
                                    }
                                    return k
                                },
                                exec: function(a) {
                                    var b = a.getSelection(),
                                        b = b && b.getRanges()[0],
                                        c;
                                    if (c = a.elementPath().contains(p)) f.call(this, c, d);
                                    else
                                        for (b = b.createIterator(), a = a.config.enterMode, b.enforceRealBlocks = !0, b.enlargeBr = a != CKEDITOR.ENTER_BR; c = b.getNextParagraph(a == CKEDITOR.ENTER_P ? "p" : "div");) c.isReadOnly() || f.call(this, c, d);
                                    return !0
                                }
                            }
                        }
                    }
                    var a = CKEDITOR.plugins.indent,
                        d = b.config.indentClasses;
                    a.registerCommands(b, {
                        indentblock: new c(b, "indentblock", !0),
                        outdentblock: new c(b, "outdentblock")
                    });
                    CKEDITOR.tools.extend(c.prototype, a.specificDefinition.prototype, {
                        context: {
                            div: 1,
                            dl: 1,
                            h1: 1,
                            h2: 1,
                            h3: 1,
                            h4: 1,
                            h5: 1,
                            h6: 1,
                            ul: 1,
                            ol: 1,
                            p: 1,
                            pre: 1,
                            table: 1
                        },
                        classNameRegex: d ? new RegExp("(?:^|\\s+)(" + d.join("|") + ")(?=$|\\s)") : null
                    })
                }
            })
        })();
        (function() {
            function w(c) {
                function f(b) {
                    for (var e = d.startContainer, a = d.endContainer; e && !e.getParent().equals(b);) e = e.getParent();
                    for (; a && !a.getParent().equals(b);) a = a.getParent();
                    if (!e || !a) return !1;
                    for (var g = e, e = [], k = !1; !k;) g.equals(a) && (k = !0), e.push(g), g = g.getNext();
                    if (1 > e.length) return !1;
                    g = b.getParents(!0);
                    for (a = 0; a < g.length; a++)
                        if (g[a].getName && p[g[a].getName()]) {
                            b = g[a];
                            break
                        }
                    for (var g = l.isIndent ? 1 : -1, a = e[0], e = e[e.length - 1], k = CKEDITOR.plugins.list.listToArray(b, q), n = k[e.getCustomData("listarray_index")].indent, a = a.getCustomData("listarray_index"); a <= e.getCustomData("listarray_index"); a++)
                        if (k[a].indent += g, 0 < g) {
                            var h = k[a].parent;
                            k[a].parent = new CKEDITOR.dom.element(h.getName(), h.getDocument())
                        }
                    for (a = e.getCustomData("listarray_index") + 1; a < k.length && k[a].indent > n; a++) k[a].indent += g;
                    e = CKEDITOR.plugins.list.arrayToList(k, q, null, c.config.enterMode, b.getDirection());
                    if (!l.isIndent) {
                        var f;
                        if ((f = b.getParent()) && f.is("li"))
                            for (var g = e.listNode.getChildren(), r = [], m, a = g.count() - 1; 0 <= a; a--)(m = g.getItem(a)) && m.is && m.is("li") && r.push(m)
                    }
                    e && e.listNode.replace(b);
                    if (r && r.length)
                        for (a = 0; a < r.length; a++) {
                            for (m = b = r[a];
                                (m = m.getNext()) && m.is && m.getName() in p;) CKEDITOR.env.needsNbspFiller && !b.getFirst(x) && b.append(d.document.createText(" ")), b.append(m);
                            b.insertAfter(f)
                        }
                    e && c.fire("contentDomInvalidated");
                    return !0
                }
                for (var l = this, q = this.database, p = this.context, n = c.getSelection(), n = (n && n.getRanges()).createIterator(), d; d = n.getNextRange();) {
                    for (var b = d.getCommonAncestor(); b && (b.type != CKEDITOR.NODE_ELEMENT || !p[b.getName()]);) {
                        if (c.editable().equals(b)) {
                            b = !1;
                            break
                        }
                        b = b.getParent()
                    }
                    b || (b = d.startPath().contains(p)) && d.setEndAt(b, CKEDITOR.POSITION_BEFORE_END);
                    if (!b) {
                        var h = d.getEnclosedNode();
                        h && h.type == CKEDITOR.NODE_ELEMENT && h.getName() in p && (d.setStartAt(h, CKEDITOR.POSITION_AFTER_START), d.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), b = h)
                    }
                    b && d.startContainer.type == CKEDITOR.NODE_ELEMENT && d.startContainer.getName() in p && (h = new CKEDITOR.dom.walker(d), h.evaluator = t, d.startContainer = h.next());
                    b && d.endContainer.type == CKEDITOR.NODE_ELEMENT && d.endContainer.getName() in p && (h = new CKEDITOR.dom.walker(d), h.evaluator = t, d.endContainer = h.previous());
                    if (b) return f(b)
                }
                return 0
            }

            function t(c) {
                return c.type == CKEDITOR.NODE_ELEMENT && c.is("li")
            }

            function x(c) {
                return y(c) && z(c)
            }
            var y = CKEDITOR.dom.walker.whitespaces(!0),
                z = CKEDITOR.dom.walker.bookmark(!1, !0),
                u = CKEDITOR.TRISTATE_DISABLED,
                v = CKEDITOR.TRISTATE_OFF;
            CKEDITOR.plugins.add("indentlist", {
                requires: "indent",
                init: function(c) {
                    function f(c) {
                        l.specificDefinition.apply(this, arguments);
                        this.requiredContent = ["ul", "ol"];
                        c.on("key", function(f) {
                            if ("wysiwyg" == c.mode && f.data.keyCode == this.indentKey) {
                                var n = this.getContext(c.elementPath());
                                !n || this.isIndent && CKEDITOR.plugins.indentList.firstItemInPath(this.context, c.elementPath(), n) || (c.execCommand(this.relatedGlobal), f.cancel())
                            }
                        }, this);
                        this.jobs[this.isIndent ? 10 : 30] = {
                            refresh: this.isIndent ? function(c, f) {
                                var d = this.getContext(f),
                                    b = CKEDITOR.plugins.indentList.firstItemInPath(this.context, f, d);
                                return d && this.isIndent && !b ? v : u
                            } : function(c, f) {
                                return !this.getContext(f) || this.isIndent ? u : v
                            },
                            exec: CKEDITOR.tools.bind(w, this)
                        }
                    }
                    var l = CKEDITOR.plugins.indent;
                    l.registerCommands(c, {
                        indentlist: new f(c, "indentlist", !0),
                        outdentlist: new f(c, "outdentlist")
                    });
                    CKEDITOR.tools.extend(f.prototype, l.specificDefinition.prototype, {
                        context: {
                            ol: 1,
                            ul: 1
                        }
                    })
                }
            });
            CKEDITOR.plugins.indentList = {};
            CKEDITOR.plugins.indentList.firstItemInPath = function(c, f, l) {
                var q = f.contains(t);
                l || (l = f.contains(c));
                return l && q && q.equals(l.getFirst(t))
            }
        })();
        CKEDITOR.plugins.add("smiley", {
            requires: "dialog",
            init: function(a) {
                a.config.smiley_path = a.config.smiley_path || this.path + "images/";
                a.addCommand("smiley", new CKEDITOR.dialogCommand("smiley", {
                    allowedContent: "img[alt,height,!src,title,width]",
                    requiredContent: "img"
                }));
                a.ui.addButton && a.ui.addButton("Smiley", {
                    label: a.lang.smiley.toolbar,
                    command: "smiley",
                    toolbar: "insert,50"
                });
                CKEDITOR.dialog.add("smiley", this.path + "dialogs/smiley.js")
            }
        });
        CKEDITOR.config.smiley_images = "regular_smile.png sad_smile.png wink_smile.png teeth_smile.png confused_smile.png tongue_smile.png embarrassed_smile.png omg_smile.png whatchutalkingabout_smile.png angry_smile.png angel_smile.png shades_smile.png devil_smile.png cry_smile.png lightbulb.png thumbs_down.png thumbs_up.png heart.png broken_heart.png kiss.png envelope.png".split(" ");
        CKEDITOR.config.smiley_descriptions = "smiley;sad;wink;laugh;frown;cheeky;blush;surprise;indecision;angry;angel;cool;devil;crying;enlightened;no;yes;heart;broken heart;kiss;mail".split(";");
        (function() {
            function n(a, c) {
                c = void 0 === c || c;
                var b;
                if (c) b = a.getComputedStyle("text-align");
                else {
                    for (; !a.hasAttribute || !a.hasAttribute("align") && !a.getStyle("text-align");) {
                        b = a.getParent();
                        if (!b) break;
                        a = b
                    }
                    b = a.getStyle("text-align") || a.getAttribute("align") || ""
                }
                b && (b = b.replace(/(?:-(?:moz|webkit)-)?(?:start|auto)/i, ""));
                !b && c && (b = "rtl" == a.getComputedStyle("direction") ? "right" : "left");
                return b
            }

            function g(a, c, b) {
                this.editor = a;
                this.name = c;
                this.value = b;
                this.context = "p";
                c = a.config.justifyClasses;
                var h = a.config.enterMode == CKEDITOR.ENTER_P ? "p" : "div";
                if (c) {
                    switch (b) {
                        case "left":
                            this.cssClassName = c[0];
                            break;
                        case "center":
                            this.cssClassName = c[1];
                            break;
                        case "right":
                            this.cssClassName = c[2];
                            break;
                        case "justify":
                            this.cssClassName = c[3]
                    }
                    this.cssClassRegex = new RegExp("(?:^|\\s+)(?:" + c.join("|") + ")(?=$|\\s)");
                    this.requiredContent = h + "(" + this.cssClassName + ")"
                } else this.requiredContent = h + "{text-align}";
                this.allowedContent = {
                    "caption div h1 h2 h3 h4 h5 h6 p pre td th li": {
                        propertiesOnly: !0,
                        styles: this.cssClassName ? null : "text-align",
                        classes: this.cssClassName || null
                    }
                };
                a.config.enterMode == CKEDITOR.ENTER_BR && (this.allowedContent.div = !0)
            }

            function l(a) {
                var c = a.editor,
                    b = c.createRange();
                b.setStartBefore(a.data.node);
                b.setEndAfter(a.data.node);
                for (var h = new CKEDITOR.dom.walker(b), d; d = h.next();)
                    if (d.type == CKEDITOR.NODE_ELEMENT)
                        if (!d.equals(a.data.node) && d.getDirection()) b.setStartAfter(d), h = new CKEDITOR.dom.walker(b);
                        else {
                            var e = c.config.justifyClasses;
                            e && (d.hasClass(e[0]) ? (d.removeClass(e[0]), d.addClass(e[2])) : d.hasClass(e[2]) && (d.removeClass(e[2]), d.addClass(e[0])));
                            e = d.getStyle("text-align");
                            "left" == e ? d.setStyle("text-align", "right") : "right" == e && d.setStyle("text-align", "left")
                        }
            }
            g.prototype = {
                exec: function(a) {
                    var c = a.getSelection(),
                        b = a.config.enterMode;
                    if (c) {
                        for (var h = c.createBookmarks(), d = c.getRanges(), e = this.cssClassName, g, f, k = a.config.useComputedState, k = void 0 === k || k, m = d.length - 1; 0 <= m; m--)
                            for (g = d[m].createIterator(), g.enlargeBr = b != CKEDITOR.ENTER_BR; f = g.getNextParagraph(b == CKEDITOR.ENTER_P ? "p" : "div");)
                                if (!f.isReadOnly()) {
                                    f.removeAttribute("align");
                                    f.removeStyle("text-align");
                                    var l = e && (f.$.className = CKEDITOR.tools.ltrim(f.$.className.replace(this.cssClassRegex, ""))),
                                        p = this.state == CKEDITOR.TRISTATE_OFF && (!k || n(f, !0) != this.value);
                                    e ? p ? f.addClass(e) : l || f.removeAttribute("class") : p && f.setStyle("text-align", this.value)
                                }
                        a.focus();
                        a.forceNextSelectionCheck();
                        c.selectBookmarks(h)
                    }
                },
                refresh: function(a, c) {
                    var b = c.block || c.blockLimit;
                    this.setState("body" != b.getName() && n(b, this.editor.config.useComputedState) == this.value ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
                }
            };
            CKEDITOR.plugins.add("justify", {
                init: function(a) {
                    if (!a.blockless) {
                        var c = new g(a, "justifyleft", "left"),
                            b = new g(a, "justifycenter", "center"),
                            h = new g(a, "justifyright", "right"),
                            d = new g(a, "justifyblock", "justify");
                        a.addCommand("justifyleft", c);
                        a.addCommand("justifycenter", b);
                        a.addCommand("justifyright", h);
                        a.addCommand("justifyblock", d);
                        a.ui.addButton && (a.ui.addButton("JustifyLeft", {
                            label: a.lang.justify.left,
                            command: "justifyleft",
                            toolbar: "align,10"
                        }), a.ui.addButton("JustifyCenter", {
                            label: a.lang.justify.center,
                            command: "justifycenter",
                            toolbar: "align,20"
                        }), a.ui.addButton("JustifyRight", {
                            label: a.lang.justify.right,
                            command: "justifyright",
                            toolbar: "align,30"
                        }), a.ui.addButton("JustifyBlock", {
                            label: a.lang.justify.block,
                            command: "justifyblock",
                            toolbar: "align,40"
                        }));
                        a.on("dirChanged", l)
                    }
                }
            })
        })();
        CKEDITOR.plugins.add("menubutton", {
            requires: "button,menu",
            onLoad: function() {
                var d = function(c) {
                    var a = this._,
                        b = a.menu;
                    a.state !== CKEDITOR.TRISTATE_DISABLED && (a.on && b ? b.hide() : (a.previousState = a.state, b || (b = a.menu = new CKEDITOR.menu(c, {
                        panel: {
                            className: "cke_menu_panel",
                            attributes: {
                                "aria-label": c.lang.common.options
                            }
                        }
                    }), b.onHide = CKEDITOR.tools.bind(function() {
                        var b = this.command ? c.getCommand(this.command).modes : this.modes;
                        this.setState(!b || b[c.mode] ? a.previousState : CKEDITOR.TRISTATE_DISABLED);
                        a.on = 0
                    }, this), this.onMenu && b.addListener(this.onMenu)), this.setState(CKEDITOR.TRISTATE_ON), a.on = 1, setTimeout(function() {
                        b.show(CKEDITOR.document.getById(a.id), 4)
                    }, 0)))
                };
                CKEDITOR.ui.menuButton = CKEDITOR.tools.createClass({
                    base: CKEDITOR.ui.button,
                    $: function(c) {
                        delete c.panel;
                        this.base(c);
                        this.hasArrow = !0;
                        this.click = d
                    },
                    statics: {
                        handler: {
                            create: function(c) {
                                return new CKEDITOR.ui.menuButton(c)
                            }
                        }
                    }
                })
            },
            beforeInit: function(d) {
                d.ui.addHandler(CKEDITOR.UI_MENUBUTTON, CKEDITOR.ui.menuButton.handler)
            }
        });
        CKEDITOR.UI_MENUBUTTON = "menubutton";
        (function() {
            CKEDITOR.plugins.add("language", {
                requires: "menubutton",
                init: function(a) {
                    var b = a.config.language_list || ["ar:Arabic:rtl", "fr:French", "es:Spanish"],
                        c = this,
                        d = a.lang.language,
                        e = {},
                        g, h, k, f;
                    a.addCommand("language", {
                        allowedContent: "span[!lang,!dir]",
                        requiredContent: "span[lang,dir]",
                        contextSensitive: !0,
                        exec: function(a, b) {
                            var c = e["language_" + b];
                            if (c) a[c.style.checkActive(a.elementPath(), a) ? "removeStyle" : "applyStyle"](c.style)
                        },
                        refresh: function(a) {
                            this.setState(c.getCurrentLangElement(a) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
                        }
                    });
                    for (f = 0; f < b.length; f++) g = b[f].split(":"), h = g[0], k = "language_" + h, e[k] = {
                        label: g[1],
                        langId: h,
                        group: "language",
                        order: f,
                        ltr: "rtl" != ("" + g[2]).toLowerCase(),
                        onClick: function() {
                            a.execCommand("language", this.langId)
                        },
                        role: "menuitemcheckbox"
                    }, e[k].style = new CKEDITOR.style({
                        element: "span",
                        attributes: {
                            lang: h,
                            dir: e[k].ltr ? "ltr" : "rtl"
                        }
                    });
                    e.language_remove = {
                        label: d.remove,
                        group: "language_remove",
                        state: CKEDITOR.TRISTATE_DISABLED,
                        order: e.length,
                        onClick: function() {
                            var b = c.getCurrentLangElement(a);
                            b && a.execCommand("language", b.getAttribute("lang"))
                        }
                    };
                    a.addMenuGroup("language", 1);
                    a.addMenuGroup("language_remove");
                    a.addMenuItems(e);
                    a.ui.add("Language", CKEDITOR.UI_MENUBUTTON, {
                        label: d.button,
                        allowedContent: "span[!lang,!dir]",
                        requiredContent: "span[lang,dir]",
                        toolbar: "bidi,30",
                        command: "language",
                        onMenu: function() {
                            var b = {},
                                d = c.getCurrentLangElement(a),
                                f;
                            for (f in e) b[f] = CKEDITOR.TRISTATE_OFF;
                            b.language_remove = d ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
                            d && (b["language_" + d.getAttribute("lang")] = CKEDITOR.TRISTATE_ON);
                            return b
                        }
                    })
                },
                getCurrentLangElement: function(a) {
                    var b = a.elementPath();
                    a = b && b.elements;
                    var c;
                    if (b)
                        for (var d = 0; d < a.length; d++) b = a[d], !c && "span" == b.getName() && b.hasAttribute("dir") && b.hasAttribute("lang") && (c = b);
                    return c
                }
            })
        })();
        (function() {
            function p(c) {
                return c.replace(/'/g, "\\$&")
            }

            function q(c) {
                for (var b, a = c.length, f = [], e = 0; e < a; e++) b = c.charCodeAt(e), f.push(b);
                return "String.fromCharCode(" + f.join(",") + ")"
            }

            function r(c, b) {
                var a = c.plugins.link,
                    f = a.compiledProtectionFunction.params,
                    e, d;
                d = [a.compiledProtectionFunction.name, "("];
                for (var g = 0; g < f.length; g++) a = f[g].toLowerCase(), e = b[a], 0 < g && d.push(","), d.push("'", e ? p(encodeURIComponent(b[a])) : "", "'");
                d.push(")");
                return d.join("")
            }

            function n(c) {
                c = c.config.emailProtection || "";
                var b;
                c && "encode" != c && (b = {}, c.replace(/^([^(]+)\(([^)]+)\)$/, function(a, c, e) {
                    b.name = c;
                    b.params = [];
                    e.replace(/[^,\s]+/g, function(a) {
                        b.params.push(a)
                    })
                }));
                return b
            }
            CKEDITOR.plugins.add("link", {
                requires: "dialog,fakeobjects",
                onLoad: function() {
                    function c(b) {
                        return a.replace(/%1/g, "rtl" == b ? "right" : "left").replace(/%2/g, "cke_contents_" + b)
                    }
                    var b = "background:url(" + CKEDITOR.getUrl(this.path + "images" + (CKEDITOR.env.hidpi ? "/hidpi" : "") + "/anchor.png") + ") no-repeat %1 center;border:1px dotted #00f;background-size:16px;",
                        a = ".%2 a.cke_anchor,.%2 a.cke_anchor_empty,.cke_editable.%2 a[name],.cke_editable.%2 a[data-cke-saved-name]{" + b + "padding-%1:18px;cursor:auto;}.%2 img.cke_anchor{" + b + "width:16px;min-height:15px;height:1.15em;vertical-align:text-bottom;}";
                    CKEDITOR.addCss(c("ltr") + c("rtl"))
                },
                init: function(c) {
                    var b = "a[!href]";
                    CKEDITOR.dialog.isTabEnabled(c, "link", "advanced") && (b = b.replace("]", ",accesskey,charset,dir,id,lang,name,rel,tabindex,title,type]{*}(*)"));
                    CKEDITOR.dialog.isTabEnabled(c, "link", "target") && (b = b.replace("]", ",target,onclick]"));
                    c.addCommand("link", new CKEDITOR.dialogCommand("link", {
                        allowedContent: b,
                        requiredContent: "a[href]"
                    }));
                    c.addCommand("anchor", new CKEDITOR.dialogCommand("anchor", {
                        allowedContent: "a[!name,id]",
                        requiredContent: "a[name]"
                    }));
                    c.addCommand("unlink", new CKEDITOR.unlinkCommand);
                    c.addCommand("removeAnchor", new CKEDITOR.removeAnchorCommand);
                    c.setKeystroke(CKEDITOR.CTRL + 76, "link");
                    c.ui.addButton && (c.ui.addButton("Link", {
                        label: c.lang.link.toolbar,
                        command: "link",
                        toolbar: "links,10"
                    }), c.ui.addButton("Unlink", {
                        label: c.lang.link.unlink,
                        command: "unlink",
                        toolbar: "links,20"
                    }), c.ui.addButton("Anchor", {
                        label: c.lang.link.anchor.toolbar,
                        command: "anchor",
                        toolbar: "links,30"
                    }));
                    CKEDITOR.dialog.add("link", this.path + "dialogs/link.js");
                    CKEDITOR.dialog.add("anchor", this.path + "dialogs/anchor.js");
                    c.on("doubleclick", function(a) {
                        var b = CKEDITOR.plugins.link.getSelectedLink(c) || a.data.element;
                        b.isReadOnly() || (b.is("a") ? (a.data.dialog = !b.getAttribute("name") || b.getAttribute("href") && b.getChildCount() ? "link" : "anchor", a.data.link = b) : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, b) && (a.data.dialog = "anchor"))
                    }, null, null, 0);
                    c.on("doubleclick", function(a) {
                        a.data.dialog in {
                            link: 1,
                            anchor: 1
                        } && a.data.link && c.getSelection().selectElement(a.data.link)
                    }, null, null, 20);
                    c.addMenuItems && c.addMenuItems({
                        anchor: {
                            label: c.lang.link.anchor.menu,
                            command: "anchor",
                            group: "anchor",
                            order: 1
                        },
                        removeAnchor: {
                            label: c.lang.link.anchor.remove,
                            command: "removeAnchor",
                            group: "anchor",
                            order: 5
                        },
                        link: {
                            label: c.lang.link.menu,
                            command: "link",
                            group: "link",
                            order: 1
                        },
                        unlink: {
                            label: c.lang.link.unlink,
                            command: "unlink",
                            group: "link",
                            order: 5
                        }
                    });
                    c.contextMenu && c.contextMenu.addListener(function(a) {
                        if (!a || a.isReadOnly()) return null;
                        a = CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a);
                        if (!a && !(a = CKEDITOR.plugins.link.getSelectedLink(c))) return null;
                        var b = {};
                        a.getAttribute("href") && a.getChildCount() && (b = {
                            link: CKEDITOR.TRISTATE_OFF,
                            unlink: CKEDITOR.TRISTATE_OFF
                        });
                        a && a.hasAttribute("name") && (b.anchor = b.removeAnchor = CKEDITOR.TRISTATE_OFF);
                        return b
                    });
                    this.compiledProtectionFunction = n(c)
                },
                afterInit: function(c) {
                    c.dataProcessor.dataFilter.addRules({
                        elements: {
                            a: function(a) {
                                return a.attributes.name ? a.children.length ? null : c.createFakeParserElement(a, "cke_anchor", "anchor") : null
                            }
                        }
                    });
                    var b = c._.elementsPath && c._.elementsPath.filters;
                    b && b.push(function(a, b) {
                        if ("a" == b && (CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, a) || a.getAttribute("name") && (!a.getAttribute("href") || !a.getChildCount()))) return "anchor"
                    })
                }
            });
            var t = /^javascript:/,
                u = /^mailto:([^?]+)(?:\?(.+))?$/,
                v = /subject=([^;?:@&=$,\/]*)/i,
                w = /body=([^;?:@&=$,\/]*)/i,
                x = /^#(.*)$/,
                y = /^((?:http|https|ftp|news):\/\/)?(.*)$/,
                z = /^(_(?:self|top|parent|blank))$/,
                A = /^javascript:void\(location\.href='mailto:'\+String\.fromCharCode\(([^)]+)\)(?:\+'(.*)')?\)$/,
                B = /^javascript:([^(]+)\(([^)]+)\)$/,
                C = /\s*window.open\(\s*this\.href\s*,\s*(?:'([^']*)'|null)\s*,\s*'([^']*)'\s*\)\s*;\s*return\s*false;*\s*/,
                D = /(?:^|,)([^=]+)=(\d+|yes|no)/gi,
                m = {
                    id: "advId",
                    dir: "advLangDir",
                    accessKey: "advAccessKey",
                    name: "advName",
                    lang: "advLangCode",
                    tabindex: "advTabIndex",
                    title: "advTitle",
                    type: "advContentType",
                    "class": "advCSSClasses",
                    charset: "advCharset",
                    style: "advStyles",
                    rel: "advRel"
                };
            CKEDITOR.plugins.link = {
                getSelectedLink: function(c) {
                    var b = c.getSelection(),
                        a = b.getSelectedElement();
                    return a && a.is("a") ? a : (b = b.getRanges()[0]) ? (b.shrink(CKEDITOR.SHRINK_TEXT), c.elementPath(b.getCommonAncestor()).contains("a", 1)) : null
                },
                getEditorAnchors: function(c) {
                    for (var b = c.editable(), a = b.isInline() && !c.plugins.divarea ? c.document : b, b = a.getElementsByTag("a"), a = a.getElementsByTag("img"), f = [], e = 0, d; d = b.getItem(e++);)(d.data("cke-saved-name") || d.hasAttribute("name")) && f.push({
                        name: d.data("cke-saved-name") || d.getAttribute("name"),
                        id: d.getAttribute("id")
                    });
                    for (e = 0; d = a.getItem(e++);)(d = this.tryRestoreFakeAnchor(c, d)) && f.push({
                        name: d.getAttribute("name"),
                        id: d.getAttribute("id")
                    });
                    return f
                },
                fakeAnchor: !0,
                tryRestoreFakeAnchor: function(c, b) {
                    if (b && b.data("cke-real-element-type") && "anchor" == b.data("cke-real-element-type")) {
                        var a = c.restoreRealElement(b);
                        if (a.data("cke-saved-name")) return a
                    }
                },
                parseLinkAttributes: function(c, b) {
                    var a = b && (b.data("cke-saved-href") || b.getAttribute("href")) || "",
                        f = c.plugins.link.compiledProtectionFunction,
                        e = c.config.emailProtection,
                        d, g = {};
                    a.match(t) && ("encode" == e ? a = a.replace(A, function(a, b, c) {
                        c = c || "";
                        return "mailto:" + String.fromCharCode.apply(String, b.split(",")) + c.replace(/\\'/g, "'")
                    }) : e && a.replace(B, function(a, b, c) {
                        if (b == f.name) {
                            g.type = "email";
                            a = g.email = {};
                            b = /(^')|('$)/g;
                            c = c.match(/[^,\s]+/g);
                            for (var d = c.length, e, h, k = 0; k < d; k++) e = decodeURIComponent, h = c[k].replace(b, "").replace(/\\'/g, "'"), h = e(h), e = f.params[k].toLowerCase(), a[e] = h;
                            a.address = [a.name, a.domain].join("@")
                        }
                    }));
                    if (!g.type)
                        if (e = a.match(x)) g.type = "anchor", g.anchor = {}, g.anchor.name = g.anchor.id = e[1];
                        else if (e = a.match(u)) {
                        d = a.match(v);
                        a = a.match(w);
                        g.type = "email";
                        var k = g.email = {};
                        k.address = e[1];
                        d && (k.subject = decodeURIComponent(d[1]));
                        a && (k.body = decodeURIComponent(a[1]))
                    } else a && (d = a.match(y)) && (g.type = "url", g.url = {}, g.url.protocol = d[1], g.url.url = d[2]);
                    if (b) {
                        if (a = b.getAttribute("target")) g.target = {
                            type: a.match(z) ? a : "frame",
                            name: a
                        };
                        else if (a = (a = b.data("cke-pa-onclick") || b.getAttribute("onclick")) && a.match(C))
                            for (g.target = {
                                    type: "popup",
                                    name: a[1]
                                }; e = D.exec(a[2]);) "yes" != e[2] && "1" != e[2] || e[1] in {
                                height: 1,
                                width: 1,
                                top: 1,
                                left: 1
                            } ? isFinite(e[2]) && (g.target[e[1]] = e[2]) : g.target[e[1]] = !0;
                        var a = {},
                            h;
                        for (h in m)(e = b.getAttribute(h)) && (a[m[h]] = e);
                        if (h = b.data("cke-saved-name") || a.advName) a.advName = h;
                        CKEDITOR.tools.isEmpty(a) || (g.advanced = a)
                    }
                    return g
                },
                getLinkAttributes: function(c, b) {
                    var a = c.config.emailProtection || "",
                        f = {};
                    switch (b.type) {
                        case "url":
                            var a = b.url && void 0 !== b.url.protocol ? b.url.protocol : "http://",
                                e = b.url && CKEDITOR.tools.trim(b.url.url) || "";
                            f["data-cke-saved-href"] = 0 === e.indexOf("/") ? e : a + e;
                            break;
                        case "anchor":
                            a = b.anchor && b.anchor.id;
                            f["data-cke-saved-href"] = "#" + (b.anchor && b.anchor.name || a || "");
                            break;
                        case "email":
                            var d = b.email,
                                e = d.address;
                            switch (a) {
                                case "":
                                case "encode":
                                    var g = encodeURIComponent(d.subject || ""),
                                        k = encodeURIComponent(d.body || ""),
                                        d = [];
                                    g && d.push("subject=" + g);
                                    k && d.push("body=" + k);
                                    d = d.length ? "?" + d.join("&") : "";
                                    "encode" == a ? (a = ["javascript:void(location.href='mailto:'+", q(e)], d && a.push("+'", p(d), "'"), a.push(")")) : a = ["mailto:", e, d];
                                    break;
                                default:
                                    a = e.split("@", 2), d.name = a[0], d.domain = a[1], a = ["javascript:", r(c, d)]
                            }
                            f["data-cke-saved-href"] = a.join("")
                    }
                    if (b.target)
                        if ("popup" == b.target.type) {
                            for (var a = ["window.open(this.href, '", b.target.name || "", "', '"], h = "resizable status location toolbar menubar fullscreen scrollbars dependent".split(" "), e = h.length, g = function(a) {
                                    b.target[a] && h.push(a + "=" + b.target[a])
                                }, d = 0; d < e; d++) h[d] += b.target[h[d]] ? "=yes" : "=no";
                            g("width");
                            g("left");
                            g("height");
                            g("top");
                            a.push(h.join(","), "'); return false;");
                            f["data-cke-pa-onclick"] = a.join("")
                        } else "notSet" != b.target.type && b.target.name && (f.target = b.target.name);
                    if (b.advanced) {
                        for (var l in m)(a = b.advanced[m[l]]) && (f[l] = a);
                        f.name && (f["data-cke-saved-name"] = f.name)
                    }
                    f["data-cke-saved-href"] && (f.href = f["data-cke-saved-href"]);
                    l = {
                        target: 1,
                        onclick: 1,
                        "data-cke-pa-onclick": 1,
                        "data-cke-saved-name": 1
                    };
                    b.advanced && CKEDITOR.tools.extend(l, m);
                    for (var n in f) delete l[n];
                    return {
                        set: f,
                        removed: CKEDITOR.tools.objectKeys(l)
                    }
                }
            };
            CKEDITOR.unlinkCommand = function() {};
            CKEDITOR.unlinkCommand.prototype = {
                exec: function(c) {
                    var b = new CKEDITOR.style({
                        element: "a",
                        type: CKEDITOR.STYLE_INLINE,
                        alwaysRemoveElement: 1
                    });
                    c.removeStyle(b)
                },
                refresh: function(c, b) {
                    var a = b.lastElement && b.lastElement.getAscendant("a", !0);
                    a && "a" == a.getName() && a.getAttribute("href") && a.getChildCount() ? this.setState(CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_DISABLED)
                },
                contextSensitive: 1,
                startDisabled: 1,
                requiredContent: "a[href]"
            };
            CKEDITOR.removeAnchorCommand = function() {};
            CKEDITOR.removeAnchorCommand.prototype = {
                exec: function(c) {
                    var b = c.getSelection(),
                        a = b.createBookmarks(),
                        f;
                    if (b && (f = b.getSelectedElement()) && (f.getChildCount() ? f.is("a") : CKEDITOR.plugins.link.tryRestoreFakeAnchor(c, f))) f.remove(1);
                    else if (f = CKEDITOR.plugins.link.getSelectedLink(c)) f.hasAttribute("href") ? (f.removeAttributes({
                        name: 1,
                        "data-cke-saved-name": 1
                    }), f.removeClass("cke_anchor")) : f.remove(1);
                    b.selectBookmarks(a)
                },
                requiredContent: "a[name]"
            };
            CKEDITOR.tools.extend(CKEDITOR.config, {
                linkShowAdvancedTab: !0,
                linkShowTargetTab: !0
            })
        })();
        (function() {
            function I(b, m, e) {
                function c(c) {
                    if (!(!(a = d[c ? "getFirst" : "getLast"]()) || a.is && a.isBlockBoundary() || !(p = m.root[c ? "getPrevious" : "getNext"](CKEDITOR.dom.walker.invisible(!0))) || p.is && p.isBlockBoundary({
                            br: 1
                        }))) b.document.createElement("br")[c ? "insertBefore" : "insertAfter"](a)
                }
                for (var f = CKEDITOR.plugins.list.listToArray(m.root, e), g = [], k = 0; k < m.contents.length; k++) {
                    var h = m.contents[k];
                    (h = h.getAscendant("li", !0)) && !h.getCustomData("list_item_processed") && (g.push(h), CKEDITOR.dom.element.setMarker(e, h, "list_item_processed", !0))
                }
                h = null;
                for (k = 0; k < g.length; k++) h = g[k].getCustomData("listarray_index"), f[h].indent = -1;
                for (k = h + 1; k < f.length; k++)
                    if (f[k].indent > f[k - 1].indent + 1) {
                        g = f[k - 1].indent + 1 - f[k].indent;
                        for (h = f[k].indent; f[k] && f[k].indent >= h;) f[k].indent += g, k++;
                        k--
                    }
                var d = CKEDITOR.plugins.list.arrayToList(f, e, null, b.config.enterMode, m.root.getAttribute("dir")).listNode,
                    a, p;
                c(!0);
                c();
                d.replace(m.root);
                b.fire("contentDomInvalidated")
            }

            function B(b, m) {
                this.name = b;
                this.context = this.type = m;
                this.allowedContent = m + " li";
                this.requiredContent = m
            }

            function E(b, m, e, c) {
                for (var f, g; f = b[c ? "getLast" : "getFirst"](J);)(g = f.getDirection(1)) !== m.getDirection(1) && f.setAttribute("dir", g), f.remove(), e ? f[c ? "insertBefore" : "insertAfter"](e) : m.append(f, c)
            }

            function F(b) {
                function m(e) {
                    var c = b[e ? "getPrevious" : "getNext"](u);
                    c && c.type == CKEDITOR.NODE_ELEMENT && c.is(b.getName()) && (E(b, c, null, !e), b.remove(), b = c)
                }
                m();
                m(1)
            }

            function G(b) {
                return b.type == CKEDITOR.NODE_ELEMENT && (b.getName() in CKEDITOR.dtd.$block || b.getName() in CKEDITOR.dtd.$listItem) && CKEDITOR.dtd[b.getName()]["#"]
            }

            function C(b, m, e) {
                b.fire("saveSnapshot");
                e.enlarge(CKEDITOR.ENLARGE_LIST_ITEM_CONTENTS);
                var c = e.extractContents();
                m.trim(!1, !0);
                var f = m.createBookmark(),
                    g = new CKEDITOR.dom.elementPath(m.startContainer),
                    k = g.block,
                    g = g.lastElement.getAscendant("li", 1) || k,
                    h = new CKEDITOR.dom.elementPath(e.startContainer),
                    d = h.contains(CKEDITOR.dtd.$listItem),
                    h = h.contains(CKEDITOR.dtd.$list);
                k ? (k = k.getBogus()) && k.remove() : h && (k = h.getPrevious(u)) && z(k) && k.remove();
                (k = c.getLast()) && k.type == CKEDITOR.NODE_ELEMENT && k.is("br") && k.remove();
                (k = m.startContainer.getChild(m.startOffset)) ? c.insertBefore(k): m.startContainer.append(c);
                d && (c = A(d)) && (g.contains(d) ? (E(c, d.getParent(), d), c.remove()) : g.append(c));
                for (; e.checkStartOfBlock() && e.checkEndOfBlock();) {
                    h = e.startPath();
                    c = h.block;
                    if (!c) break;
                    c.is("li") && (g = c.getParent(), c.equals(g.getLast(u)) && c.equals(g.getFirst(u)) && (c = g));
                    e.moveToPosition(c, CKEDITOR.POSITION_BEFORE_START);
                    c.remove()
                }
                e = e.clone();
                c = b.editable();
                e.setEndAt(c, CKEDITOR.POSITION_BEFORE_END);
                e = new CKEDITOR.dom.walker(e);
                e.evaluator = function(a) {
                    return u(a) && !z(a)
                };
                (e = e.next()) && e.type == CKEDITOR.NODE_ELEMENT && e.getName() in CKEDITOR.dtd.$list && F(e);
                m.moveToBookmark(f);
                m.select();
                b.fire("saveSnapshot")
            }

            function A(b) {
                return (b = b.getLast(u)) && b.type == CKEDITOR.NODE_ELEMENT && b.getName() in v ? b : null
            }
            var v = {
                    ol: 1,
                    ul: 1
                },
                K = CKEDITOR.dom.walker.whitespaces(),
                H = CKEDITOR.dom.walker.bookmark(),
                u = function(b) {
                    return !(K(b) || H(b))
                },
                z = CKEDITOR.dom.walker.bogus();
            CKEDITOR.plugins.list = {
                listToArray: function(b, m, e, c, f) {
                    if (!v[b.getName()]) return [];
                    c || (c = 0);
                    e || (e = []);
                    for (var g = 0, k = b.getChildCount(); g < k; g++) {
                        var h = b.getChild(g);
                        h.type == CKEDITOR.NODE_ELEMENT && h.getName() in CKEDITOR.dtd.$list && CKEDITOR.plugins.list.listToArray(h, m, e, c + 1);
                        if ("li" == h.$.nodeName.toLowerCase()) {
                            var d = {
                                parent: b,
                                indent: c,
                                element: h,
                                contents: []
                            };
                            f ? d.grandparent = f : (d.grandparent = b.getParent(), d.grandparent && "li" == d.grandparent.$.nodeName.toLowerCase() && (d.grandparent = d.grandparent.getParent()));
                            m && CKEDITOR.dom.element.setMarker(m, h, "listarray_index", e.length);
                            e.push(d);
                            for (var a = 0, p = h.getChildCount(), l; a < p; a++) l = h.getChild(a), l.type == CKEDITOR.NODE_ELEMENT && v[l.getName()] ? CKEDITOR.plugins.list.listToArray(l, m, e, c + 1, d.grandparent) : d.contents.push(l)
                        }
                    }
                    return e
                },
                arrayToList: function(b, m, e, c, f) {
                    e || (e = 0);
                    if (!b || b.length < e + 1) return null;
                    for (var g, k = b[e].parent.getDocument(), h = new CKEDITOR.dom.documentFragment(k), d = null, a = e, p = Math.max(b[e].indent, 0), l = null, q, n, t = c == CKEDITOR.ENTER_P ? "p" : "div";;) {
                        var r = b[a];
                        g = r.grandparent;
                        q = r.element.getDirection(1);
                        if (r.indent == p) {
                            d && b[a].parent.getName() == d.getName() || (d = b[a].parent.clone(!1, 1), f && d.setAttribute("dir", f), h.append(d));
                            l = d.append(r.element.clone(0, 1));
                            q != d.getDirection(1) && l.setAttribute("dir", q);
                            for (g = 0; g < r.contents.length; g++) l.append(r.contents[g].clone(1, 1));
                            a++
                        } else if (r.indent == Math.max(p, 0) + 1) r = b[a - 1].element.getDirection(1), a = CKEDITOR.plugins.list.arrayToList(b, null, a, c, r != q ? q : null), !l.getChildCount() && CKEDITOR.env.needsNbspFiller && 7 >= k.$.documentMode && l.append(k.createText(" ")), l.append(a.listNode), a = a.nextIndex;
                        else if (-1 == r.indent && !e && g) {
                            v[g.getName()] ? (l = r.element.clone(!1, !0), q != g.getDirection(1) && l.setAttribute("dir", q)) : l = new CKEDITOR.dom.documentFragment(k);
                            var d = g.getDirection(1) != q,
                                y = r.element,
                                D = y.getAttribute("class"),
                                z = y.getAttribute("style"),
                                A = l.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && (c != CKEDITOR.ENTER_BR || d || z || D),
                                w, B = r.contents.length,
                                x;
                            for (g = 0; g < B; g++)
                                if (w = r.contents[g], H(w) && 1 < B) A ? x = w.clone(1, 1) : l.append(w.clone(1, 1));
                                else if (w.type == CKEDITOR.NODE_ELEMENT && w.isBlockBoundary()) {
                                d && !w.getDirection() && w.setAttribute("dir", q);
                                n = w;
                                var C = y.getAttribute("style");
                                C && n.setAttribute("style", C.replace(/([^;])$/, "$1;") + (n.getAttribute("style") || ""));
                                D && w.addClass(D);
                                n = null;
                                x && (l.append(x), x = null);
                                l.append(w.clone(1, 1))
                            } else A ? (n || (n = k.createElement(t), l.append(n), d && n.setAttribute("dir", q)), z && n.setAttribute("style", z), D && n.setAttribute("class", D), x && (n.append(x), x = null), n.append(w.clone(1, 1))) : l.append(w.clone(1, 1));
                            x && ((n || l).append(x), x = null);
                            l.type == CKEDITOR.NODE_DOCUMENT_FRAGMENT && a != b.length - 1 && (CKEDITOR.env.needsBrFiller && (q = l.getLast()) && q.type == CKEDITOR.NODE_ELEMENT && q.is("br") && q.remove(), (q = l.getLast(u)) && q.type == CKEDITOR.NODE_ELEMENT && q.is(CKEDITOR.dtd.$block) || l.append(k.createElement("br")));
                            q = l.$.nodeName.toLowerCase();
                            "div" != q && "p" != q || l.appendBogus();
                            h.append(l);
                            d = null;
                            a++
                        } else return null;
                        n = null;
                        if (b.length <= a || Math.max(b[a].indent, 0) < p) break
                    }
                    if (m)
                        for (b = h.getFirst(); b;) {
                            if (b.type == CKEDITOR.NODE_ELEMENT && (CKEDITOR.dom.element.clearMarkers(m, b), b.getName() in CKEDITOR.dtd.$listItem && (e = b, k = f = c = void 0, c = e.getDirection()))) {
                                for (f = e.getParent(); f && !(k = f.getDirection());) f = f.getParent();
                                c == k && e.removeAttribute("dir")
                            }
                            b = b.getNextSourceNode()
                        }
                    return {
                        listNode: h,
                        nextIndex: a
                    }
                }
            };
            var L = /^h[1-6]$/,
                J = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_ELEMENT);
            B.prototype = {
                exec: function(b) {
                    this.refresh(b, b.elementPath());
                    var m = b.config,
                        e = b.getSelection(),
                        c = e && e.getRanges();
                    if (this.state == CKEDITOR.TRISTATE_OFF) {
                        var f = b.editable();
                        if (f.getFirst(u)) {
                            var g = 1 == c.length && c[0];
                            (m = g && g.getEnclosedNode()) && m.is && this.type == m.getName() && this.setState(CKEDITOR.TRISTATE_ON)
                        } else m.enterMode == CKEDITOR.ENTER_BR ? f.appendBogus() : c[0].fixBlock(1, m.enterMode == CKEDITOR.ENTER_P ? "p" : "div"), e.selectRanges(c)
                    }
                    for (var m = e.createBookmarks(!0), f = [], k = {}, c = c.createIterator(), h = 0;
                        (g = c.getNextRange()) && ++h;) {
                        var d = g.getBoundaryNodes(),
                            a = d.startNode,
                            p = d.endNode;
                        a.type == CKEDITOR.NODE_ELEMENT && "td" == a.getName() && g.setStartAt(d.startNode, CKEDITOR.POSITION_AFTER_START);
                        p.type == CKEDITOR.NODE_ELEMENT && "td" == p.getName() && g.setEndAt(d.endNode, CKEDITOR.POSITION_BEFORE_END);
                        g = g.createIterator();
                        for (g.forceBrBreak = this.state == CKEDITOR.TRISTATE_OFF; d = g.getNextParagraph();)
                            if (!d.getCustomData("list_block")) {
                                CKEDITOR.dom.element.setMarker(k, d, "list_block", 1);
                                for (var l = b.elementPath(d), a = l.elements, p = 0, l = l.blockLimit, q, n = a.length - 1; 0 <= n && (q = a[n]); n--)
                                    if (v[q.getName()] && l.contains(q)) {
                                        l.removeCustomData("list_group_object_" + h);
                                        (a = q.getCustomData("list_group_object")) ? a.contents.push(d): (a = {
                                            root: q,
                                            contents: [d]
                                        }, f.push(a), CKEDITOR.dom.element.setMarker(k, q, "list_group_object", a));
                                        p = 1;
                                        break
                                    }
                                p || (p = l, p.getCustomData("list_group_object_" + h) ? p.getCustomData("list_group_object_" + h).contents.push(d) : (a = {
                                    root: p,
                                    contents: [d]
                                }, CKEDITOR.dom.element.setMarker(k, p, "list_group_object_" + h, a), f.push(a)))
                            }
                    }
                    for (q = []; 0 < f.length;)
                        if (a = f.shift(), this.state == CKEDITOR.TRISTATE_OFF)
                            if (v[a.root.getName()]) {
                                c = b;
                                h = a;
                                a = k;
                                g = q;
                                p = CKEDITOR.plugins.list.listToArray(h.root, a);
                                l = [];
                                for (d = 0; d < h.contents.length; d++) n = h.contents[d], (n = n.getAscendant("li", !0)) && !n.getCustomData("list_item_processed") && (l.push(n), CKEDITOR.dom.element.setMarker(a, n, "list_item_processed", !0));
                                for (var n = h.root.getDocument(), t = void 0, r = void 0, d = 0; d < l.length; d++) {
                                    var y = l[d].getCustomData("listarray_index"),
                                        t = p[y].parent;
                                    t.is(this.type) || (r = n.createElement(this.type), t.copyAttributes(r, {
                                        start: 1,
                                        type: 1
                                    }), r.removeStyle("list-style-type"), p[y].parent = r)
                                }
                                a = CKEDITOR.plugins.list.arrayToList(p, a, null, c.config.enterMode);
                                p = void 0;
                                l = a.listNode.getChildCount();
                                for (d = 0; d < l && (p = a.listNode.getChild(d)); d++) p.getName() == this.type && g.push(p);
                                a.listNode.replace(h.root);
                                c.fire("contentDomInvalidated")
                            } else {
                                p = b;
                                g = a;
                                d = q;
                                l = g.contents;
                                c = g.root.getDocument();
                                h = [];
                                1 == l.length && l[0].equals(g.root) && (a = c.createElement("div"), l[0].moveChildren && l[0].moveChildren(a), l[0].append(a), l[0] = a);
                                g = g.contents[0].getParent();
                                for (n = 0; n < l.length; n++) g = g.getCommonAncestor(l[n].getParent());
                                t = p.config.useComputedState;
                                p = a = void 0;
                                t = void 0 === t || t;
                                for (n = 0; n < l.length; n++)
                                    for (r = l[n]; y = r.getParent();) {
                                        if (y.equals(g)) {
                                            h.push(r);
                                            !p && r.getDirection() && (p = 1);
                                            r = r.getDirection(t);
                                            null !== a && (a = a && a != r ? null : r);
                                            break
                                        }
                                        r = y
                                    }
                                if (!(1 > h.length)) {
                                    l = h[h.length - 1].getNext();
                                    n = c.createElement(this.type);
                                    d.push(n);
                                    for (t = d = void 0; h.length;) d = h.shift(), t = c.createElement("li"), r = d, r.is("pre") || L.test(r.getName()) || "false" == r.getAttribute("contenteditable") ? d.appendTo(t) : (d.copyAttributes(t), a && d.getDirection() && (t.removeStyle("direction"), t.removeAttribute("dir")), d.moveChildren(t), d.remove()), t.appendTo(n);
                                    a && p && n.setAttribute("dir", a);
                                    l ? n.insertBefore(l) : n.appendTo(g)
                                }
                            }
                    else this.state == CKEDITOR.TRISTATE_ON && v[a.root.getName()] && I.call(this, b, a, k);
                    for (n = 0; n < q.length; n++) F(q[n]);
                    CKEDITOR.dom.element.clearAllMarkers(k);
                    e.selectBookmarks(m);
                    b.focus()
                },
                refresh: function(b, m) {
                    var e = m.contains(v, 1),
                        c = m.blockLimit || m.root;
                    e && c.contains(e) ? this.setState(e.is(this.type) ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF) : this.setState(CKEDITOR.TRISTATE_OFF)
                }
            };
            CKEDITOR.plugins.add("list", {
                requires: "indentlist",
                init: function(b) {
                    b.blockless || (b.addCommand("numberedlist", new B("numberedlist", "ol")), b.addCommand("bulletedlist", new B("bulletedlist", "ul")), b.ui.addButton && (b.ui.addButton("NumberedList", {
                        label: b.lang.list.numberedlist,
                        command: "numberedlist",
                        directional: !0,
                        toolbar: "list,10"
                    }), b.ui.addButton("BulletedList", {
                        label: b.lang.list.bulletedlist,
                        command: "bulletedlist",
                        directional: !0,
                        toolbar: "list,20"
                    })), b.on("key", function(m) {
                        var e = m.data.domEvent.getKey(),
                            c;
                        if ("wysiwyg" == b.mode && e in {
                                8: 1,
                                46: 1
                            }) {
                            var f = b.getSelection().getRanges()[0],
                                g = f && f.startPath();
                            if (f && f.collapsed) {
                                var k = 8 == e,
                                    h = b.editable(),
                                    d = new CKEDITOR.dom.walker(f.clone());
                                d.evaluator = function(a) {
                                    return u(a) && !z(a)
                                };
                                d.guard = function(a, b) {
                                    return !(b && a.type == CKEDITOR.NODE_ELEMENT && a.is("table"))
                                };
                                e = f.clone();
                                if (k) {
                                    var a;
                                    (a = g.contains(v)) && f.checkBoundaryOfElement(a, CKEDITOR.START) && (a = a.getParent()) && a.is("li") && (a = A(a)) ? (c = a, a = a.getPrevious(u), e.moveToPosition(a && z(a) ? a : c, CKEDITOR.POSITION_BEFORE_START)) : (d.range.setStartAt(h, CKEDITOR.POSITION_AFTER_START), d.range.setEnd(f.startContainer, f.startOffset), (a = d.previous()) && a.type == CKEDITOR.NODE_ELEMENT && (a.getName() in v || a.is("li")) && (a.is("li") || (d.range.selectNodeContents(a), d.reset(), d.evaluator = G, a = d.previous()), c = a, e.moveToElementEditEnd(c), e.moveToPosition(e.endPath().block, CKEDITOR.POSITION_BEFORE_END)));
                                    if (c) C(b, e, f), m.cancel();
                                    else {
                                        var p = g.contains(v);
                                        p && f.checkBoundaryOfElement(p, CKEDITOR.START) && (c = p.getFirst(u), f.checkBoundaryOfElement(c, CKEDITOR.START) && (a = p.getPrevious(u), A(c) ? a && (f.moveToElementEditEnd(a), f.select()) : b.execCommand("outdent"), m.cancel()))
                                    }
                                } else if (c = g.contains("li")) {
                                    if (d.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), k = (h = c.getLast(u)) && G(h) ? h : c, g = 0, (a = d.next()) && a.type == CKEDITOR.NODE_ELEMENT && a.getName() in v && a.equals(h) ? (g = 1, a = d.next()) : f.checkBoundaryOfElement(k, CKEDITOR.END) && (g = 2), g && a) {
                                        f = f.clone();
                                        f.moveToElementEditStart(a);
                                        if (1 == g && (e.optimize(), !e.startContainer.equals(c))) {
                                            for (c = e.startContainer; c.is(CKEDITOR.dtd.$inline);) p = c, c = c.getParent();
                                            p && e.moveToPosition(p, CKEDITOR.POSITION_AFTER_END)
                                        }
                                        2 == g && (e.moveToPosition(e.endPath().block, CKEDITOR.POSITION_BEFORE_END), f.endPath().block && f.moveToPosition(f.endPath().block, CKEDITOR.POSITION_AFTER_START));
                                        C(b, e, f);
                                        m.cancel()
                                    }
                                } else d.range.setEndAt(h, CKEDITOR.POSITION_BEFORE_END), (a = d.next()) && a.type == CKEDITOR.NODE_ELEMENT && a.is(v) && (a = a.getFirst(u), g.block && f.checkStartOfBlock() && f.checkEndOfBlock() ? (g.block.remove(), f.moveToElementEditStart(a), f.select()) : A(a) ? (f.moveToElementEditStart(a), f.select()) : (f = f.clone(), f.moveToElementEditStart(a), C(b, e, f)), m.cancel());
                                setTimeout(function() {
                                    b.selectionChange(1)
                                })
                            }
                        }
                    }))
                }
            })
        })();
        (function() {
            CKEDITOR.plugins.liststyle = {
                requires: "dialog,contextmenu",
                init: function(a) {
                    if (!a.blockless) {
                        var b;
                        b = new CKEDITOR.dialogCommand("numberedListStyle", {
                            requiredContent: "ol",
                            allowedContent: "ol{list-style-type}[start]"
                        });
                        b = a.addCommand("numberedListStyle", b);
                        a.addFeature(b);
                        CKEDITOR.dialog.add("numberedListStyle", this.path + "dialogs/liststyle.js");
                        b = new CKEDITOR.dialogCommand("bulletedListStyle", {
                            requiredContent: "ul",
                            allowedContent: "ul{list-style-type}"
                        });
                        b = a.addCommand("bulletedListStyle", b);
                        a.addFeature(b);
                        CKEDITOR.dialog.add("bulletedListStyle", this.path + "dialogs/liststyle.js");
                        a.addMenuGroup("list", 108);
                        a.addMenuItems({
                            numberedlist: {
                                label: a.lang.liststyle.numberedTitle,
                                group: "list",
                                command: "numberedListStyle"
                            },
                            bulletedlist: {
                                label: a.lang.liststyle.bulletedTitle,
                                group: "list",
                                command: "bulletedListStyle"
                            }
                        });
                        a.contextMenu.addListener(function(a) {
                            if (!a || a.isReadOnly()) return null;
                            for (; a;) {
                                var b = a.getName();
                                if ("ol" == b) return {
                                    numberedlist: CKEDITOR.TRISTATE_OFF
                                };
                                if ("ul" == b) return {
                                    bulletedlist: CKEDITOR.TRISTATE_OFF
                                };
                                a = a.getParent()
                            }
                            return null
                        })
                    }
                }
            };
            CKEDITOR.plugins.add("liststyle", CKEDITOR.plugins.liststyle)
        })();
        (function() {
            function V(a, c, d) {
                return n(c) && n(d) && d.equals(c.getNext(function(a) {
                    return !(E(a) || F(a) || u(a))
                }))
            }

            function z(a) {
                this.upper = a[0];
                this.lower = a[1];
                this.set.apply(this, a.slice(2))
            }

            function O(a) {
                var c = a.element;
                if (c && n(c) && (c = c.getAscendant(a.triggers, !0)) && a.editable.contains(c)) {
                    var d = P(c);
                    if ("true" == d.getAttribute("contenteditable")) return c;
                    if (d.is(a.triggers)) return d
                }
                return null
            }

            function ka(a, c, d) {
                r(a, c);
                r(a, d);
                a = c.size.bottom;
                d = d.size.top;
                return a && d ? 0 | (a + d) / 2 : a || d
            }

            function w(a, c, d) {
                return c = c[d ? "getPrevious" : "getNext"](function(b) {
                    return b && b.type == CKEDITOR.NODE_TEXT && !E(b) || n(b) && !u(b) && !A(a, b)
                })
            }

            function q(a, c, d) {
                return a > c && a < d
            }

            function P(a, c) {
                if (a.data("cke-editable")) return null;
                for (c || (a = a.getParent()); a && !a.data("cke-editable");) {
                    if (a.hasAttribute("contenteditable")) return a;
                    a = a.getParent()
                }
                return null
            }

            function la(a) {
                var c = a.doc,
                    d = G('<span contenteditable="false" style="' + Q + "position:absolute;border-top:1px dashed " + a.boxColor + '"></span>', c),
                    b = CKEDITOR.getUrl(this.path + "images/" + (t.hidpi ? "hidpi/" : "") + "icon" + (a.rtl ? "-rtl" : "") + ".png");
                v(d, {
                    attach: function() {
                        this.wrap.getParent() || this.wrap.appendTo(a.editable, !0);
                        return this
                    },
                    lineChildren: [v(G('<span title="' + a.editor.lang.magicline.title + '" contenteditable="false">&#8629;</span>', c), {
                        base: Q + "height:17px;width:17px;" + (a.rtl ? "left" : "right") + ":17px;background:url(" + b + ") center no-repeat " + a.boxColor + ";cursor:pointer;" + (t.hc ? "font-size: 15px;line-height:14px;border:1px solid #fff;text-align:center;" : "") + (t.hidpi ? "background-size: 9px 10px;" : ""),
                        looks: ["top:-8px; border-radius: 2px;", "top:-17px; border-radius: 2px 2px 0px 0px;", "top:-1px; border-radius: 0px 0px 2px 2px;"]
                    }), v(G(W, c), {
                        base: X + "left:0px;border-left-color:" + a.boxColor + ";",
                        looks: ["border-width:8px 0 8px 8px;top:-8px", "border-width:8px 0 0 8px;top:-8px", "border-width:0 0 8px 8px;top:0px"]
                    }), v(G(W, c), {
                        base: X + "right:0px;border-right-color:" + a.boxColor + ";",
                        looks: ["border-width:8px 8px 8px 0;top:-8px", "border-width:8px 8px 0 0;top:-8px", "border-width:0 8px 8px 0;top:0px"]
                    })],
                    detach: function() {
                        this.wrap.getParent() && this.wrap.remove();
                        return this
                    },
                    mouseNear: function() {
                        r(a, this);
                        var b = a.holdDistance,
                            c = this.size;
                        return c && q(a.mouse.y, c.top - b, c.bottom + b) && q(a.mouse.x, c.left - b, c.right + b) ? !0 : !1
                    },
                    place: function() {
                        var b = a.view,
                            c = a.editable,
                            d = a.trigger,
                            h = d.upper,
                            g = d.lower,
                            l = h || g,
                            p = l.getParent(),
                            m = {};
                        this.trigger = d;
                        h && r(a, h, !0);
                        g && r(a, g, !0);
                        r(a, p, !0);
                        a.inInlineMode && H(a, !0);
                        p.equals(c) ? (m.left = b.scroll.x, m.right = -b.scroll.x, m.width = "") : (m.left = l.size.left - l.size.margin.left + b.scroll.x - (a.inInlineMode ? b.editable.left + b.editable.border.left : 0), m.width = l.size.outerWidth + l.size.margin.left + l.size.margin.right + b.scroll.x, m.right = "");
                        h && g ? m.top = h.size.margin.bottom === g.size.margin.top ? 0 | h.size.bottom + h.size.margin.bottom / 2 : h.size.margin.bottom < g.size.margin.top ? h.size.bottom + h.size.margin.bottom : h.size.bottom + h.size.margin.bottom - g.size.margin.top : h ? g || (m.top = h.size.bottom + h.size.margin.bottom) : m.top = g.size.top - g.size.margin.top;
                        d.is(C) || q(m.top, b.scroll.y - 15, b.scroll.y + 5) ? (m.top = a.inInlineMode ? 0 : b.scroll.y, this.look(C)) : d.is(D) || q(m.top, b.pane.bottom - 5, b.pane.bottom + 15) ? (m.top = a.inInlineMode ? b.editable.height + b.editable.padding.top + b.editable.padding.bottom : b.pane.bottom - 1,
                            this.look(D)) : (a.inInlineMode && (m.top -= b.editable.top + b.editable.border.top), this.look(x));
                        a.inInlineMode && (m.top--, m.top += b.editable.scroll.top, m.left += b.editable.scroll.left);
                        for (var n in m) m[n] = CKEDITOR.tools.cssLength(m[n]);
                        this.setStyles(m)
                    },
                    look: function(a) {
                        if (this.oldLook != a) {
                            for (var b = this.lineChildren.length, c; b--;)(c = this.lineChildren[b]).setAttribute("style", c.base + c.looks[0 | a / 2]);
                            this.oldLook = a
                        }
                    },
                    wrap: new R("span", a.doc)
                });
                for (c = d.lineChildren.length; c--;) d.lineChildren[c].appendTo(d);
                d.look(x);
                d.appendTo(d.wrap);
                d.unselectable();
                d.lineChildren[0].on("mouseup", function(b) {
                    d.detach();
                    S(a, function(b) {
                        var c = a.line.trigger;
                        b[c.is(I) ? "insertBefore" : "insertAfter"](c.is(I) ? c.lower : c.upper)
                    }, !0);
                    a.editor.focus();
                    t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
                    b.data.preventDefault(!0)
                });
                d.on("mousedown", function(a) {
                    a.data.preventDefault(!0)
                });
                a.line = d
            }

            function S(a, c, d) {
                var b = new CKEDITOR.dom.range(a.doc),
                    e = a.editor,
                    f;
                t.ie && a.enterMode == CKEDITOR.ENTER_BR ? f = a.doc.createText(J) : (f = (f = P(a.element, !0)) && f.data("cke-enter-mode") || a.enterMode, f = new R(K[f], a.doc), f.is("br") || a.doc.createText(J).appendTo(f));
                d && e.fire("saveSnapshot");
                c(f);
                b.moveToPosition(f, CKEDITOR.POSITION_AFTER_START);
                e.getSelection().selectRanges([b]);
                a.hotNode = f;
                d && e.fire("saveSnapshot")
            }

            function Y(a, c) {
                return {
                    canUndo: !0,
                    modes: {
                        wysiwyg: 1
                    },
                    exec: function() {
                        function d(b) {
                            var d = t.ie && 9 > t.version ? " " : J,
                                f = a.hotNode && a.hotNode.getText() == d && a.element.equals(a.hotNode) && a.lastCmdDirection === !!c;
                            S(a, function(d) {
                                f && a.hotNode && a.hotNode.remove();
                                d[c ? "insertAfter" : "insertBefore"](b);
                                d.setAttributes({
                                    "data-cke-magicline-hot": 1,
                                    "data-cke-magicline-dir": !!c
                                });
                                a.lastCmdDirection = !!c
                            });
                            t.ie || a.enterMode == CKEDITOR.ENTER_BR || a.hotNode.scrollIntoView();
                            a.line.detach()
                        }
                        return function(b) {
                            b = b.getSelection().getStartElement();
                            var e;
                            b = b.getAscendant(Z, 1);
                            if (!aa(a, b) && b && !b.equals(a.editable) && !b.contains(a.editable)) {
                                (e = P(b)) && "false" == e.getAttribute("contenteditable") && (b = e);
                                a.element = b;
                                e = w(a, b, !c);
                                var f;
                                n(e) && e.is(a.triggers) && e.is(ma) && (!w(a, e, !c) || (f = w(a, e, !c)) && n(f) && f.is(a.triggers)) ? d(e) : (f = O(a, b), n(f) && (w(a, f, !c) ? (b = w(a, f, !c)) && n(b) && b.is(a.triggers) && d(f) : d(f)))
                            }
                        }
                    }()
                }
            }

            function A(a, c) {
                if (!c || c.type != CKEDITOR.NODE_ELEMENT || !c.$) return !1;
                var d = a.line;
                return d.wrap.equals(c) || d.wrap.contains(c)
            }

            function n(a) {
                return a && a.type == CKEDITOR.NODE_ELEMENT && a.$
            }

            function u(a) {
                if (!n(a)) return !1;
                var c;
                (c = ba(a)) || (n(a) ? (c = {
                    left: 1,
                    right: 1,
                    center: 1
                }, c = !(!c[a.getComputedStyle("float")] && !c[a.getAttribute("align")])) : c = !1);
                return c
            }

            function ba(a) {
                return !!{
                    absolute: 1,
                    fixed: 1
                }[a.getComputedStyle("position")]
            }

            function L(a, c) {
                return n(c) ? c.is(a.triggers) : null
            }

            function aa(a, c) {
                if (!c) return !1;
                for (var d = c.getParents(1), b = d.length; b--;)
                    for (var e = a.tabuList.length; e--;)
                        if (d[b].hasAttribute(a.tabuList[e])) return !0;
                return !1
            }

            function na(a, c, d) {
                c = c[d ? "getLast" : "getFirst"](function(b) {
                    return a.isRelevant(b) && !b.is(oa)
                });
                if (!c) return !1;
                r(a, c);
                return d ? c.size.top > a.mouse.y : c.size.bottom < a.mouse.y
            }

            function ca(a) {
                var c = a.editable,
                    d = a.mouse,
                    b = a.view,
                    e = a.triggerOffset;
                H(a);
                var f = d.y > (a.inInlineMode ? b.editable.top + b.editable.height / 2 : Math.min(b.editable.height, b.pane.height) / 2),
                    c = c[f ? "getLast" : "getFirst"](function(a) {
                        return !(E(a) || F(a))
                    });
                if (!c) return null;
                A(a, c) && (c = a.line.wrap[f ? "getPrevious" : "getNext"](function(a) {
                    return !(E(a) || F(a))
                }));
                if (!n(c) || u(c) || !L(a, c)) return null;
                r(a, c);
                return !f && 0 <= c.size.top && q(d.y, 0, c.size.top + e) ? (a = a.inInlineMode || 0 === b.scroll.y ? C : x, new z([null, c, I, M, a])) : f && c.size.bottom <= b.pane.height && q(d.y, c.size.bottom - e, b.pane.height) ? (a = a.inInlineMode || q(c.size.bottom, b.pane.height - e, b.pane.height) ? D : x, new z([c, null, da, M, a])) : null
            }

            function ea(a) {
                var c = a.mouse,
                    d = a.view,
                    b = a.triggerOffset,
                    e = O(a);
                if (!e) return null;
                r(a, e);
                var b = Math.min(b, 0 | e.size.outerHeight / 2),
                    f = [],
                    k, h;
                if (q(c.y, e.size.top - 1, e.size.top + b)) h = !1;
                else if (q(c.y, e.size.bottom - b, e.size.bottom + 1)) h = !0;
                else return null;
                if (u(e) || na(a, e, h) || e.getParent().is(fa)) return null;
                var g = w(a, e, !h);
                if (g) {
                    if (g && g.type == CKEDITOR.NODE_TEXT) return null;
                    if (n(g)) {
                        if (u(g) || !L(a, g) || g.getParent().is(fa)) return null;
                        f = [g, e][h ? "reverse" : "concat"]().concat([T, M])
                    }
                } else e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? (H(a), h && q(c.y, e.size.bottom - b, d.pane.height) && q(e.size.bottom, d.pane.height - b, d.pane.height) ? k = D : q(c.y, 0, e.size.top + b) && (k = C)) : k = x, f = [null, e][h ? "reverse" : "concat"]().concat([h ? da : I, M, k, e.equals(a.editable[h ? "getLast" : "getFirst"](a.isRelevant)) ? h ? D : C : x]);
                return 0 in f ? new z(f) : null
            }

            function U(a, c, d, b) {
                for (var e = c.getDocumentPosition(), f = {}, k = {}, h = {}, g = {}, l = y.length; l--;) f[y[l]] = parseInt(c.getComputedStyle.call(c, "border-" + y[l] + "-width"), 10) || 0, h[y[l]] = parseInt(c.getComputedStyle.call(c, "padding-" + y[l]), 10) || 0, k[y[l]] = parseInt(c.getComputedStyle.call(c, "margin-" + y[l]), 10) || 0;
                d && !b || N(a, b);
                g.top = e.y - (d ? 0 : a.view.scroll.y);
                g.left = e.x - (d ? 0 : a.view.scroll.x);
                g.outerWidth = c.$.offsetWidth;
                g.outerHeight = c.$.offsetHeight;
                g.height = g.outerHeight - (h.top + h.bottom + f.top + f.bottom);
                g.width = g.outerWidth - (h.left + h.right + f.left + f.right);
                g.bottom = g.top + g.outerHeight;
                g.right = g.left + g.outerWidth;
                a.inInlineMode && (g.scroll = {
                    top: c.$.scrollTop,
                    left: c.$.scrollLeft
                });
                return v({
                    border: f,
                    padding: h,
                    margin: k,
                    ignoreScroll: d
                }, g, !0)
            }

            function r(a, c, d) {
                if (!n(c)) return c.size = null;
                if (!c.size) c.size = {};
                else if (c.size.ignoreScroll == d && c.size.date > new Date - ga) return null;
                return v(c.size, U(a, c, d), {
                    date: +new Date
                }, !0)
            }

            function H(a, c) {
                a.view.editable = U(a, a.editable, c, !0)
            }

            function N(a, c) {
                a.view || (a.view = {});
                var d = a.view;
                if (!(!c && d && d.date > new Date - ga)) {
                    var b = a.win,
                        d = b.getScrollPosition(),
                        b = b.getViewPaneSize();
                    v(a.view, {
                        scroll: {
                            x: d.x,
                            y: d.y,
                            width: a.doc.$.documentElement.scrollWidth - b.width,
                            height: a.doc.$.documentElement.scrollHeight - b.height
                        },
                        pane: {
                            width: b.width,
                            height: b.height,
                            bottom: b.height + d.y
                        },
                        date: +new Date
                    }, !0)
                }
            }

            function pa(a, c, d, b) {
                for (var e = b, f = b, k = 0, h = !1, g = !1, l = a.view.pane.height, p = a.mouse; p.y + k < l && 0 < p.y - k;) {
                    h || (h = c(e, b));
                    g || (g = c(f, b));
                    !h && 0 < p.y - k && (e = d(a, {
                        x: p.x,
                        y: p.y - k
                    }));
                    !g && p.y + k < l && (f = d(a, {
                        x: p.x,
                        y: p.y + k
                    }));
                    if (h && g) break;
                    k += 2
                }
                return new z([e, f, null, null])
            }
            CKEDITOR.plugins.add("magicline", {
                init: function(a) {
                    var c = a.config,
                        d = c.magicline_triggerOffset || 30,
                        b = {
                            editor: a,
                            enterMode: c.enterMode,
                            triggerOffset: d,
                            holdDistance: 0 | d * (c.magicline_holdDistance || .5),
                            boxColor: c.magicline_color || "#ff0000",
                            rtl: "rtl" == c.contentsLangDirection,
                            tabuList: ["data-cke-hidden-sel"].concat(c.magicline_tabuList || []),
                            triggers: c.magicline_everywhere ? Z : {
                                table: 1,
                                hr: 1,
                                div: 1,
                                ul: 1,
                                ol: 1,
                                dl: 1,
                                form: 1,
                                blockquote: 1
                            }
                        },
                        e, f, k;
                    b.isRelevant = function(a) {
                        return n(a) && !A(b, a) && !u(a)
                    };
                    a.on("contentDom", function() {
                        var d = a.editable(),
                            g = a.document,
                            l = a.window;
                        v(b, {
                            editable: d,
                            inInlineMode: d.isInline(),
                            doc: g,
                            win: l,
                            hotNode: null
                        }, !0);
                        b.boundary = b.inInlineMode ? b.editable : b.doc.getDocumentElement();
                        d.is(B.$inline) || (b.inInlineMode && !ba(d) && d.setStyles({
                            position: "relative",
                            top: null,
                            left: null
                        }), la.call(this, b), N(b), d.attachListener(a, "beforeUndoImage", function() {
                            b.line.detach()
                        }), d.attachListener(a, "beforeGetData", function() {
                            b.line.wrap.getParent() && (b.line.detach(), a.once("getData", function() {
                                b.line.attach()
                            }, null, null, 1e3))
                        }, null, null, 0), d.attachListener(b.inInlineMode ? g : g.getWindow().getFrame(), "mouseout", function(c) {
                            if ("wysiwyg" == a.mode)
                                if (b.inInlineMode) {
                                    var d = c.data.$.clientX;
                                    c = c.data.$.clientY;
                                    N(b);
                                    H(b, !0);
                                    var e = b.view.editable,
                                        f = b.view.scroll;
                                    d > e.left - f.x && d < e.right - f.x && c > e.top - f.y && c < e.bottom - f.y || (clearTimeout(k), k = null, b.line.detach())
                                } else clearTimeout(k), k = null, b.line.detach()
                        }), d.attachListener(d, "keyup", function() {
                            b.hiddenMode = 0
                        }), d.attachListener(d, "keydown", function(c) {
                            if ("wysiwyg" == a.mode) switch (c.data.getKeystroke()) {
                                case 2228240:
                                case 16:
                                    b.hiddenMode = 1, b.line.detach()
                            }
                        }), d.attachListener(b.inInlineMode ? d : g, "mousemove", function(c) {
                            f = !0;
                            if ("wysiwyg" == a.mode && !a.readOnly && !k) {
                                var d = {
                                    x: c.data.$.clientX,
                                    y: c.data.$.clientY
                                };
                                k = setTimeout(function() {
                                    b.mouse = d;
                                    k = b.trigger = null;
                                    N(b);
                                    f && !b.hiddenMode && a.focusManager.hasFocus && !b.line.mouseNear() && (b.element = ha(b, !0)) && ((b.trigger = ca(b) || ea(b) || ia(b)) && !aa(b, b.trigger.upper || b.trigger.lower) ? b.line.attach().place() : (b.trigger = null, b.line.detach()), f = !1)
                                }, 30)
                            }
                        }), d.attachListener(l, "scroll", function() {
                            "wysiwyg" == a.mode && (b.line.detach(), t.webkit && (b.hiddenMode = 1, clearTimeout(e), e = setTimeout(function() {
                                b.mouseDown || (b.hiddenMode = 0)
                            }, 50)))
                        }), d.attachListener(ja ? g : l, "mousedown", function() {
                            "wysiwyg" == a.mode && (b.line.detach(), b.hiddenMode = 1, b.mouseDown = 1)
                        }), d.attachListener(ja ? g : l, "mouseup", function() {
                            b.hiddenMode = 0;
                            b.mouseDown = 0
                        }), a.addCommand("accessPreviousSpace", Y(b)), a.addCommand("accessNextSpace", Y(b, !0)), a.setKeystroke([
                            [c.magicline_keystrokePrevious, "accessPreviousSpace"],
                            [c.magicline_keystrokeNext, "accessNextSpace"]
                        ]), a.on("loadSnapshot", function() {
                            var c, d, e, f;
                            for (f in {
                                    p: 1,
                                    br: 1,
                                    div: 1
                                })
                                for (c = a.document.getElementsByTag(f), e = c.count(); e--;)
                                    if ((d = c.getItem(e)).data("cke-magicline-hot")) {
                                        b.hotNode = d;
                                        b.lastCmdDirection = "true" === d.data("cke-magicline-dir") ? !0 : !1;
                                        return
                                    }
                        }), this.backdoor = {
                            accessFocusSpace: S,
                            boxTrigger: z,
                            isLine: A,
                            getAscendantTrigger: O,
                            getNonEmptyNeighbour: w,
                            getSize: U,
                            that: b,
                            triggerEdge: ea,
                            triggerEditable: ca,
                            triggerExpand: ia
                        })
                    }, this)
                }
            });
            var v = CKEDITOR.tools.extend,
                R = CKEDITOR.dom.element,
                G = R.createFromHtml,
                t = CKEDITOR.env,
                ja = CKEDITOR.env.ie && 9 > CKEDITOR.env.version,
                B = CKEDITOR.dtd,
                K = {},
                I = 128,
                da = 64,
                T = 32,
                M = 16,
                C = 4,
                D = 2,
                x = 1,
                J = " ",
                fa = B.$listItem,
                oa = B.$tableContent,
                ma = v({}, B.$nonEditable, B.$empty),
                Z = B.$block,
                ga = 100,
                Q = "width:0px;height:0px;padding:0px;margin:0px;display:block;z-index:9999;color:#fff;position:absolute;font-size: 0px;line-height:0px;",
                X = Q + "border-color:transparent;display:block;border-style:solid;",
                W = "<span>" + J + "</span>";
            K[CKEDITOR.ENTER_BR] = "br";
            K[CKEDITOR.ENTER_P] = "p";
            K[CKEDITOR.ENTER_DIV] = "div";
            z.prototype = {
                set: function(a, c, d) {
                    this.properties = a + c + (d || x);
                    return this
                },
                is: function(a) {
                    return (this.properties & a) == a
                }
            };
            var ha = function() {
                    function a(a, d) {
                        var b = a.$.elementFromPoint(d.x, d.y);
                        return b && b.nodeType ? new CKEDITOR.dom.element(b) : null
                    }
                    return function(c, d, b) {
                        if (!c.mouse) return null;
                        var e = c.doc,
                            f = c.line.wrap;
                        b = b || c.mouse;
                        var k = a(e, b);
                        d && A(c, k) && (f.hide(), k = a(e, b), f.show());
                        return !k || k.type != CKEDITOR.NODE_ELEMENT || !k.$ || t.ie && 9 > t.version && !c.boundary.equals(k) && !c.boundary.contains(k) ? null : k
                    }
                }(),
                E = CKEDITOR.dom.walker.whitespaces(),
                F = CKEDITOR.dom.walker.nodeType(CKEDITOR.NODE_COMMENT),
                ia = function() {
                    function a(a) {
                        var b = a.element,
                            e, f, k;
                        if (!n(b) || b.contains(a.editable) || b.isReadOnly()) return null;
                        k = pa(a, function(a, b) {
                            return !b.equals(a)
                        }, function(a, b) {
                            return ha(a, !0, b)
                        }, b);
                        e = k.upper;
                        f = k.lower;
                        if (V(a, e, f)) return k.set(T, 8);
                        if (e && b.contains(e))
                            for (; !e.getParent().equals(b);) e = e.getParent();
                        else e = b.getFirst(function(b) {
                            return c(a, b)
                        });
                        if (f && b.contains(f))
                            for (; !f.getParent().equals(b);) f = f.getParent();
                        else f = b.getLast(function(b) {
                            return c(a, b)
                        });
                        if (!e || !f) return null;
                        r(a, e);
                        r(a, f);
                        if (!q(a.mouse.y, e.size.top, f.size.bottom)) return null;
                        for (var b = Number.MAX_VALUE, h, g, l, p; f && !f.equals(e) && (g = e.getNext(a.isRelevant));) h = Math.abs(ka(a, e, g) - a.mouse.y), h < b && (b = h, l = e, p = g), e = g, r(a, e);
                        if (!l || !p || !q(a.mouse.y, l.size.top, p.size.bottom)) return null;
                        k.upper = l;
                        k.lower = p;
                        return k.set(T, 8)
                    }

                    function c(a, b) {
                        return !(b && b.type == CKEDITOR.NODE_TEXT || F(b) || u(b) || A(a, b) || b.type == CKEDITOR.NODE_ELEMENT && b.$ && b.is("br"))
                    }
                    return function(c) {
                        var b = a(c),
                            e;
                        if (e = b) {
                            e = b.upper;
                            var f = b.lower;
                            e = !e || !f || u(f) || u(e) || f.equals(e) || e.equals(f) || f.contains(e) || e.contains(f) ? !1 : L(c, e) && L(c, f) && V(c, e, f) ? !0 : !1
                        }
                        return e ? b : null
                    }
                }(),
                y = ["top", "left", "right", "bottom"]
        })();
        CKEDITOR.config.magicline_keystrokePrevious = CKEDITOR.CTRL + CKEDITOR.SHIFT + 51;
        CKEDITOR.config.magicline_keystrokeNext = CKEDITOR.CTRL + CKEDITOR.SHIFT + 52;
        (function() {
            function n(a) {
                if (!a || a.type != CKEDITOR.NODE_ELEMENT || "form" != a.getName()) return [];
                for (var e = [], f = ["style", "className"], b = 0; b < f.length; b++) {
                    var c = a.$.elements.namedItem(f[b]);
                    c && (c = new CKEDITOR.dom.element(c), e.push([c, c.nextSibling]), c.remove())
                }
                return e
            }

            function t(a, e) {
                if (a && a.type == CKEDITOR.NODE_ELEMENT && "form" == a.getName() && 0 < e.length)
                    for (var f = e.length - 1; 0 <= f; f--) {
                        var b = e[f][0],
                            c = e[f][1];
                        c ? b.insertBefore(c) : b.appendTo(a)
                    }
            }

            function r(a, e) {
                var f = n(a),
                    b = {},
                    c = a.$;
                e || (b["class"] = c.className || "", c.className = "");
                b.inline = c.style.cssText || "";
                e || (c.style.cssText = "position: static; overflow: visible");
                t(f);
                return b
            }

            function u(a, e) {
                var f = n(a),
                    b = a.$;
                "class" in e && (b.className = e["class"]);
                "inline" in e && (b.style.cssText = e.inline);
                t(f)
            }

            function v(a) {
                if (!a.editable().isInline()) {
                    var e = CKEDITOR.instances,
                        f;
                    for (f in e) {
                        var b = e[f];
                        "wysiwyg" != b.mode || b.readOnly || (b = b.document.getBody(), b.setAttribute("contentEditable", !1), b.setAttribute("contentEditable", !0))
                    }
                    a.editable().hasFocus && (a.toolbox.focus(), a.focus())
                }
            }
            CKEDITOR.plugins.add("maximize", {
                init: function(a) {
                    function e() {
                        var b = c.getViewPaneSize();
                        a.resize(b.width, b.height, null, !0)
                    }
                    if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
                        var f = a.lang,
                            b = CKEDITOR.document,
                            c = b.getWindow(),
                            l, m, p, n = CKEDITOR.TRISTATE_OFF;
                        a.addCommand("maximize", {
                            modes: {
                                wysiwyg: !CKEDITOR.env.iOS,
                                source: !CKEDITOR.env.iOS
                            },
                            readOnly: 1,
                            editorFocus: !1,
                            exec: function() {
                                var h = a.container.getFirst(function(a) {
                                        return a.type == CKEDITOR.NODE_ELEMENT && a.hasClass("cke_inner")
                                    }),
                                    g = a.ui.space("contents");
                                if ("wysiwyg" == a.mode) {
                                    var d = a.getSelection();
                                    l = d && d.getRanges();
                                    m = c.getScrollPosition()
                                } else {
                                    var k = a.editable().$;
                                    l = !CKEDITOR.env.ie && [k.selectionStart, k.selectionEnd];
                                    m = [k.scrollLeft, k.scrollTop]
                                }
                                if (this.state == CKEDITOR.TRISTATE_OFF) {
                                    c.on("resize", e);
                                    p = c.getScrollPosition();
                                    for (d = a.container; d = d.getParent();) d.setCustomData("maximize_saved_styles", r(d)), d.setStyle("z-index", a.config.baseFloatZIndex - 5);
                                    g.setCustomData("maximize_saved_styles", r(g, !0));
                                    h.setCustomData("maximize_saved_styles", r(h, !0));
                                    g = {
                                        overflow: CKEDITOR.env.webkit ? "" : "hidden",
                                        width: 0,
                                        height: 0
                                    };
                                    b.getDocumentElement().setStyles(g);
                                    !CKEDITOR.env.gecko && b.getDocumentElement().setStyle("position", "fixed");
                                    CKEDITOR.env.gecko && CKEDITOR.env.quirks || b.getBody().setStyles(g);
                                    CKEDITOR.env.ie ? setTimeout(function() {
                                        c.$.scrollTo(0, 0)
                                    }, 0) : c.$.scrollTo(0, 0);
                                    h.setStyle("position", CKEDITOR.env.gecko && CKEDITOR.env.quirks ? "fixed" : "absolute");
                                    h.$.offsetLeft;
                                    h.setStyles({
                                        "z-index": a.config.baseFloatZIndex - 5,
                                        left: "0px",
                                        top: "0px"
                                    });
                                    h.addClass("cke_maximized");
                                    e();
                                    g = h.getDocumentPosition();
                                    h.setStyles({
                                        left: -1 * g.x + "px",
                                        top: -1 * g.y + "px"
                                    });
                                    CKEDITOR.env.gecko && v(a)
                                } else if (this.state == CKEDITOR.TRISTATE_ON) {
                                    c.removeListener("resize", e);
                                    for (var d = [g, h], q = 0; q < d.length; q++) u(d[q], d[q].getCustomData("maximize_saved_styles")), d[q].removeCustomData("maximize_saved_styles");
                                    for (d = a.container; d = d.getParent();) u(d, d.getCustomData("maximize_saved_styles")), d.removeCustomData("maximize_saved_styles");
                                    CKEDITOR.env.ie ? setTimeout(function() {
                                        c.$.scrollTo(p.x, p.y)
                                    }, 0) : c.$.scrollTo(p.x, p.y);
                                    h.removeClass("cke_maximized");
                                    CKEDITOR.env.webkit && (h.setStyle("display", "inline"), setTimeout(function() {
                                        h.setStyle("display", "block")
                                    }, 0));
                                    a.fire("resize", {
                                        outerHeight: a.container.$.offsetHeight,
                                        contentsHeight: g.$.offsetHeight,
                                        outerWidth: a.container.$.offsetWidth
                                    })
                                }
                                this.toggleState();
                                if (d = this.uiItems[0]) g = this.state == CKEDITOR.TRISTATE_OFF ? f.maximize.maximize : f.maximize.minimize, d = CKEDITOR.document.getById(d._.id), d.getChild(1).setHtml(g), d.setAttribute("title", g), d.setAttribute("href", 'javascript:void("' + g + '");');
                                "wysiwyg" == a.mode ? l ? (CKEDITOR.env.gecko && v(a), a.getSelection().selectRanges(l), (k = a.getSelection().getStartElement()) && k.scrollIntoView(!0)) : c.$.scrollTo(m.x, m.y) : (l && (k.selectionStart = l[0], k.selectionEnd = l[1]), k.scrollLeft = m[0], k.scrollTop = m[1]);
                                l = m = null;
                                n = this.state;
                                a.fire("maximize", this.state)
                            },
                            canUndo: !1
                        });
                        a.ui.addButton && a.ui.addButton("Maximize", {
                            label: f.maximize.maximize,
                            command: "maximize",
                            toolbar: "tools,10"
                        });
                        a.on("mode", function() {
                            var b = a.getCommand("maximize");
                            b.setState(b.state == CKEDITOR.TRISTATE_DISABLED ? CKEDITOR.TRISTATE_DISABLED : n)
                        }, null, null, 100)
                    }
                }
            })
        })();
        CKEDITOR.plugins.add("newpage", {
            init: function(a) {
                a.addCommand("newpage", {
                    modes: {
                        wysiwyg: 1,
                        source: 1
                    },
                    exec: function(b) {
                        var a = this;
                        b.setData(b.config.newpage_html || "", function() {
                            b.focus();
                            setTimeout(function() {
                                b.fire("afterCommandExec", {
                                    name: "newpage",
                                    command: a
                                });
                                b.selectionChange()
                            }, 200)
                        })
                    },
                    async: !0
                });
                a.ui.addButton && a.ui.addButton("NewPage", {
                    label: a.lang.newpage.toolbar,
                    command: "newpage",
                    toolbar: "document,20"
                })
            }
        });
        (function() {
            function e(a) {
                return {
                    "aria-label": a,
                    "class": "cke_pagebreak",
                    contenteditable: "false",
                    "data-cke-display-name": "pagebreak",
                    "data-cke-pagebreak": 1,
                    style: "page-break-after: always",
                    title: a
                }
            }
            CKEDITOR.plugins.add("pagebreak", {
                requires: "fakeobjects",
                onLoad: function() {
                    var a = ("background:url(" + CKEDITOR.getUrl(this.path + "images/pagebreak.gif") + ") no-repeat center center;clear:both;width:100%;border-top:#999 1px dotted;border-bottom:#999 1px dotted;padding:0;height:7px;cursor:default;").replace(/;/g, " !important;");
                    CKEDITOR.addCss("div.cke_pagebreak{" + a + "}")
                },
                init: function(a) {
                    a.blockless || (a.addCommand("pagebreak", CKEDITOR.plugins.pagebreakCmd), a.ui.addButton && a.ui.addButton("PageBreak", {
                        label: a.lang.pagebreak.toolbar,
                        command: "pagebreak",
                        toolbar: "insert,70"
                    }), CKEDITOR.env.webkit && a.on("contentDom", function() {
                        a.document.on("click", function(b) {
                            b = b.data.getTarget();
                            b.is("div") && b.hasClass("cke_pagebreak") && a.getSelection().selectElement(b)
                        })
                    }))
                },
                afterInit: function(a) {
                    function b(f) {
                        CKEDITOR.tools.extend(f.attributes, e(a.lang.pagebreak.alt), !0);
                        f.children.length = 0
                    }
                    var c = a.dataProcessor,
                        g = c && c.dataFilter,
                        c = c && c.htmlFilter,
                        h = /page-break-after\s*:\s*always/i,
                        k = /display\s*:\s*none/i;
                    c && c.addRules({
                        attributes: {
                            "class": function(a, b) {
                                var c = a.replace("cke_pagebreak", "");
                                if (c != a) {
                                    var d = CKEDITOR.htmlParser.fragment.fromHtml('<span style="display: none;">&nbsp;</span>').children[0];
                                    b.children.length = 0;
                                    b.add(d);
                                    d = b.attributes;
                                    delete d["aria-label"];
                                    delete d.contenteditable;
                                    delete d.title
                                }
                                return c
                            }
                        }
                    }, {
                        applyToAll: !0,
                        priority: 5
                    });
                    g && g.addRules({
                        elements: {
                            div: function(a) {
                                if (a.attributes["data-cke-pagebreak"]) b(a);
                                else if (h.test(a.attributes.style)) {
                                    var c = a.children[0];
                                    c && "span" == c.name && k.test(c.attributes.style) && b(a)
                                }
                            }
                        }
                    })
                }
            });
            CKEDITOR.plugins.pagebreakCmd = {
                exec: function(a) {
                    var b = a.document.createElement("div", {
                        attributes: e(a.lang.pagebreak.alt)
                    });
                    a.insertElement(b)
                },
                context: "div",
                allowedContent: {
                    div: {
                        styles: "!page-break-after"
                    },
                    span: {
                        match: function(a) {
                            return (a = a.parent) && "div" == a.name && a.styles && a.styles["page-break-after"]
                        },
                        styles: "display"
                    }
                },
                requiredContent: "div{page-break-after}"
            }
        })();
        (function() {
            var c = {
                canUndo: !1,
                async: !0,
                exec: function(a) {
                    a.getClipboardData({
                        title: a.lang.pastetext.title
                    }, function(b) {
                        b && a.fire("paste", {
                            type: "text",
                            dataValue: b.dataValue,
                            method: "paste",
                            dataTransfer: CKEDITOR.plugins.clipboard.initPasteDataTransfer()
                        });
                        a.fire("afterCommandExec", {
                            name: "pastetext",
                            command: c,
                            returnValue: !!b
                        })
                    })
                }
            };
            CKEDITOR.plugins.add("pastetext", {
                requires: "clipboard",
                init: function(a) {
                    a.addCommand("pastetext", c);
                    a.ui.addButton && a.ui.addButton("PasteText", {
                        label: a.lang.pastetext.button,
                        command: "pastetext",
                        toolbar: "clipboard,40"
                    });
                    if (a.config.forcePasteAsPlainText) a.on("beforePaste", function(a) {
                        "html" != a.data.type && (a.data.type = "text")
                    });
                    a.on("pasteState", function(b) {
                        a.getCommand("pastetext").setState(b.data)
                    })
                }
            })
        })();
        (function() {
            function h(a, d, f) {
                var b = CKEDITOR.cleanWord;
                b ? f() : (a = CKEDITOR.getUrl(a.config.pasteFromWordCleanupFile || d + "filter/default.js"), CKEDITOR.scriptLoader.load(a, f, null, !0));
                return !b
            }

            function k(a) {
                a.data.type = "html"
            }
            CKEDITOR.plugins.add("pastefromword", {
                requires: "clipboard",
                init: function(a) {
                    var d = 0,
                        f = this.path;
                    a.addCommand("pastefromword", {
                        canUndo: !1,
                        async: !0,
                        exec: function(a) {
                            var e = this;
                            d = 1;
                            a.once("beforePaste", k);
                            a.getClipboardData({
                                title: a.lang.pastefromword.title
                            }, function(c) {
                                c && a.fire("paste", {
                                    type: "html",
                                    dataValue: c.dataValue,
                                    method: "paste",
                                    dataTransfer: CKEDITOR.plugins.clipboard.initPasteDataTransfer()
                                });
                                a.fire("afterCommandExec", {
                                    name: "pastefromword",
                                    command: e,
                                    returnValue: !!c
                                })
                            })
                        }
                    });
                    a.ui.addButton && a.ui.addButton("PasteFromWord", {
                        label: a.lang.pastefromword.toolbar,
                        command: "pastefromword",
                        toolbar: "clipboard,50"
                    });
                    a.on("pasteState", function(b) {
                        a.getCommand("pastefromword").setState(b.data)
                    });
                    a.on("paste", function(b) {
                        var e = b.data,
                            c = e.dataValue;
                        if (c && (d || /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(c))) {
                            e.dontFilter = !0;
                            var g = h(a, f, function() {
                                if (g) a.fire("paste", e);
                                else if (!a.config.pasteFromWordPromptCleanup || d || confirm(a.lang.pastefromword.confirmCleanup)) e.dataValue = CKEDITOR.cleanWord(c, a);
                                d = 0
                            });
                            g && b.cancel()
                        }
                    }, null, null, 3)
                }
            })
        })();
        (function() {
            var h, k = {
                modes: {
                    wysiwyg: 1,
                    source: 1
                },
                canUndo: !1,
                readOnly: 1,
                exec: function(a) {
                    var g, b = a.config,
                        f = b.baseHref ? '<base href="' + b.baseHref + '"/>' : "";
                    if (b.fullPage) g = a.getData().replace(/<head>/, "$&" + f).replace(/[^>]*(?=<\/title>)/, "$& &mdash; " + a.lang.preview.preview);
                    else {
                        var b = "<body ",
                            d = a.document && a.document.getBody();
                        d && (d.getAttribute("id") && (b += 'id="' + d.getAttribute("id") + '" '), d.getAttribute("class") && (b += 'class="' + d.getAttribute("class") + '" '));
                        b += ">";
                        g = a.config.docType + '<html dir="' + a.config.contentsLangDirection + '"><head>' + f + "<title>" + a.lang.preview.preview + "</title>" + CKEDITOR.tools.buildStyleHtml(a.config.contentsCss) + "</head>" + b + a.getData() + "</body></html>"
                    }
                    f = 640;
                    b = 420;
                    d = 80;
                    try {
                        var c = window.screen,
                            f = Math.round(.8 * c.width),
                            b = Math.round(.7 * c.height),
                            d = Math.round(.1 * c.width)
                    } catch (k) {}
                    if (!1 === a.fire("contentPreview", a = {
                            dataValue: g
                        })) return !1;
                    var c = "",
                        e;
                    CKEDITOR.env.ie && (window._cke_htmlToLoad = a.dataValue, e = "javascript:void( (function(){document.open();" + ("(" + CKEDITOR.tools.fixDomain + ")();").replace(/\/\/.*?\n/g, "").replace(/parent\./g, "window.opener.") + "document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad = null;})() )", c = "");
                    CKEDITOR.env.gecko && (window._cke_htmlToLoad = a.dataValue, c = CKEDITOR.getUrl(h + "preview.html"));
                    c = window.open(c, null, "toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=" + f + ",height=" + b + ",left=" + d);
                    CKEDITOR.env.ie && c && (c.location = e);
                    CKEDITOR.env.ie || CKEDITOR.env.gecko || (e = c.document, e.open(), e.write(a.dataValue), e.close());
                    return !0
                }
            };
            CKEDITOR.plugins.add("preview", {
                init: function(a) {
                    a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (h = this.path, a.addCommand("preview", k), a.ui.addButton && a.ui.addButton("Preview", {
                        label: a.lang.preview.preview,
                        command: "preview",
                        toolbar: "document,40"
                    }))
                }
            })
        })();
        CKEDITOR.plugins.add("print", {
            init: function(a) {
                a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE && (a.addCommand("print", CKEDITOR.plugins.print), a.ui.addButton && a.ui.addButton("Print", {
                    label: a.lang.print.toolbar,
                    command: "print",
                    toolbar: "document,50"
                }))
            }
        });
        CKEDITOR.plugins.print = {
            exec: function(a) {
                CKEDITOR.env.gecko ? a.window.$.print() : a.document.$.execCommand("Print")
            },
            canUndo: !1,
            readOnly: 1,
            modes: {
                wysiwyg: 1
            }
        };
        CKEDITOR.plugins.add("removeformat", {
            init: function(a) {
                a.addCommand("removeFormat", CKEDITOR.plugins.removeformat.commands.removeformat);
                a.ui.addButton && a.ui.addButton("RemoveFormat", {
                    label: a.lang.removeformat.toolbar,
                    command: "removeFormat",
                    toolbar: "cleanup,10"
                })
            }
        });
        CKEDITOR.plugins.removeformat = {
            commands: {
                removeformat: {
                    exec: function(a) {
                        for (var h = a._.removeFormatRegex || (a._.removeFormatRegex = new RegExp("^(?:" + a.config.removeFormatTags.replace(/,/g, "|") + ")$", "i")), e = a._.removeAttributes || (a._.removeAttributes = a.config.removeFormatAttributes.split(",")), f = CKEDITOR.plugins.removeformat.filter, m = a.getSelection().getRanges(), n = m.createIterator(), p = function(a) {
                                return a.type == CKEDITOR.NODE_ELEMENT
                            }, c; c = n.getNextRange();) {
                            c.collapsed || c.enlarge(CKEDITOR.ENLARGE_ELEMENT);
                            var l = c.createBookmark(),
                                b = l.startNode,
                                d = l.endNode,
                                k = function(b) {
                                    for (var c = a.elementPath(b), e = c.elements, d = 1, g;
                                        (g = e[d]) && !g.equals(c.block) && !g.equals(c.blockLimit); d++) h.test(g.getName()) && f(a, g) && b.breakParent(g)
                                };
                            k(b);
                            if (d)
                                for (k(d), b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT); b && !b.equals(d);)
                                    if (b.isReadOnly()) {
                                        if (b.getPosition(d) & CKEDITOR.POSITION_CONTAINS) break;
                                        b = b.getNext(p)
                                    } else k = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT), "img" == b.getName() && b.data("cke-realelement") || !f(a, b) || (h.test(b.getName()) ? b.remove(1) : (b.removeAttributes(e), a.fire("removeFormatCleanup", b))), b = k;
                            c.moveToBookmark(l)
                        }
                        a.forceNextSelectionCheck();
                        a.getSelection().selectRanges(m)
                    }
                }
            },
            filter: function(a, h) {
                for (var e = a._.removeFormatFilters || [], f = 0; f < e.length; f++)
                    if (!1 === e[f](h)) return !1;
                return !0
            }
        };
        CKEDITOR.editor.prototype.addRemoveFormatFilter = function(a) {
            this._.removeFormatFilters || (this._.removeFormatFilters = []);
            this._.removeFormatFilters.push(a)
        };
        CKEDITOR.config.removeFormatTags = "b,big,cite,code,del,dfn,em,font,i,ins,kbd,q,s,samp,small,span,strike,strong,sub,sup,tt,u,var";
        CKEDITOR.config.removeFormatAttributes = "class,style,lang,width,height,align,hspace,valign";
        (function() {
            var b = {
                readOnly: 1,
                exec: function(a) {
                    if (a.fire("save") && (a = a.element.$.form)) try {
                        a.submit()
                    } catch (b) {
                        a.submit.click && a.submit.click()
                    }
                }
            };
            CKEDITOR.plugins.add("save", {
                init: function(a) {
                    a.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && (a.addCommand("save", b).modes = {
                        wysiwyg: !!a.element.$.form
                    }, a.ui.addButton && a.ui.addButton("Save", {
                        label: a.lang.save.toolbar,
                        command: "save",
                        toolbar: "document,10"
                    }))
                }
            })
        })();
        (function() {
            CKEDITOR.plugins.add("selectall", {
                init: function(b) {
                    b.addCommand("selectAll", {
                        modes: {
                            wysiwyg: 1,
                            source: 1
                        },
                        exec: function(a) {
                            var b = a.editable();
                            if (b.is("textarea")) a = b.$, CKEDITOR.env.ie ? a.createTextRange().execCommand("SelectAll") : (a.selectionStart = 0, a.selectionEnd = a.value.length), a.focus();
                            else {
                                if (b.is("body")) a.document.$.execCommand("SelectAll", !1, null);
                                else {
                                    var c = a.createRange();
                                    c.selectNodeContents(b);
                                    c.select()
                                }
                                a.forceNextSelectionCheck();
                                a.selectionChange()
                            }
                        },
                        canUndo: !1
                    });
                    b.ui.addButton && b.ui.addButton("SelectAll", {
                        label: b.lang.selectall.toolbar,
                        command: "selectAll",
                        toolbar: "selection,10"
                    })
                }
            })
        })();
        (function() {
            var k = {
                readOnly: 1,
                preserveState: !0,
                editorFocus: !1,
                exec: function(a) {
                    this.toggleState();
                    this.refresh(a)
                },
                refresh: function(a) {
                    if (a.document) {
                        var c = this.state != CKEDITOR.TRISTATE_ON || a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && !a.focusManager.hasFocus ? "removeClass" : "attachClass";
                        a.editable()[c]("cke_show_blocks")
                    }
                }
            };
            CKEDITOR.plugins.add("showblocks", {
                onLoad: function() {
                    var a = "p div pre address blockquote h1 h2 h3 h4 h5 h6".split(" "),
                        c, b, e, f, k = CKEDITOR.getUrl(this.path),
                        l = !(CKEDITOR.env.ie && 9 > CKEDITOR.env.version),
                        g = l ? ":not([contenteditable=false]):not(.cke_show_blocks_off)" : "",
                        d, h;
                    for (c = b = e = f = ""; d = a.pop();) h = a.length ? "," : "", c += ".cke_show_blocks " + d + g + h, e += ".cke_show_blocks.cke_contents_ltr " + d + g + h, f += ".cke_show_blocks.cke_contents_rtl " + d + g + h, b += ".cke_show_blocks " + d + g + "{background-image:url(" + CKEDITOR.getUrl(k + "images/block_" + d + ".png") + ")}";
                    CKEDITOR.addCss((c + "{background-repeat:no-repeat;border:1px dotted gray;padding-top:8px}").concat(b, e + "{background-position:top left;padding-left:8px}", f + "{background-position:top right;padding-right:8px}"));
                    l || CKEDITOR.addCss(".cke_show_blocks [contenteditable=false],.cke_show_blocks .cke_show_blocks_off{border:none;padding-top:0;background-image:none}.cke_show_blocks.cke_contents_rtl [contenteditable=false],.cke_show_blocks.cke_contents_rtl .cke_show_blocks_off{padding-right:0}.cke_show_blocks.cke_contents_ltr [contenteditable=false],.cke_show_blocks.cke_contents_ltr .cke_show_blocks_off{padding-left:0}")
                },
                init: function(a) {
                    function c() {
                        b.refresh(a)
                    }
                    if (!a.blockless) {
                        var b = a.addCommand("showblocks", k);
                        b.canUndo = !1;
                        a.config.startupOutlineBlocks && b.setState(CKEDITOR.TRISTATE_ON);
                        a.ui.addButton && a.ui.addButton("ShowBlocks", {
                            label: a.lang.showblocks.toolbar,
                            command: "showblocks",
                            toolbar: "tools,20"
                        });
                        a.on("mode", function() {
                            b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
                        });
                        a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE && (a.on("focus", c), a.on("blur", c));
                        a.on("contentDom", function() {
                            b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
                        })
                    }
                }
            })
        })();
        (function() {
            var f = {
                preserveState: !0,
                editorFocus: !1,
                readOnly: 1,
                exec: function(a) {
                    this.toggleState();
                    this.refresh(a)
                },
                refresh: function(a) {
                    if (a.document) {
                        var b = this.state == CKEDITOR.TRISTATE_ON ? "attachClass" : "removeClass";
                        a.editable()[b]("cke_show_borders")
                    }
                }
            };
            CKEDITOR.plugins.add("showborders", {
                modes: {
                    wysiwyg: 1
                },
                onLoad: function() {
                    var a;
                    a = (CKEDITOR.env.ie6Compat ? [".%1 table.%2,", ".%1 table.%2 td, .%1 table.%2 th", "{", "border : #d3d3d3 1px dotted", "}"] : ".%1 table.%2,;.%1 table.%2 > tr > td, .%1 table.%2 > tr > th,;.%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,;.%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,;.%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th;{;border : #d3d3d3 1px dotted;}".split(";")).join("").replace(/%2/g, "cke_show_border").replace(/%1/g, "cke_show_borders ");
                    CKEDITOR.addCss(a)
                },
                init: function(a) {
                    var b = a.addCommand("showborders", f);
                    b.canUndo = !1;
                    !1 !== a.config.startupShowBorders && b.setState(CKEDITOR.TRISTATE_ON);
                    a.on("mode", function() {
                        b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
                    }, null, null, 100);
                    a.on("contentDom", function() {
                        b.state != CKEDITOR.TRISTATE_DISABLED && b.refresh(a)
                    });
                    a.on("removeFormatCleanup", function(d) {
                        d = d.data;
                        a.getCommand("showborders").state == CKEDITOR.TRISTATE_ON && d.is("table") && (!d.hasAttribute("border") || 0 >= parseInt(d.getAttribute("border"), 10)) && d.addClass("cke_show_border")
                    })
                },
                afterInit: function(a) {
                    var b = a.dataProcessor;
                    a = b && b.dataFilter;
                    b = b && b.htmlFilter;
                    a && a.addRules({
                        elements: {
                            table: function(a) {
                                a = a.attributes;
                                var b = a["class"],
                                    c = parseInt(a.border, 10);
                                c && !(0 >= c) || b && -1 != b.indexOf("cke_show_border") || (a["class"] = (b || "") + " cke_show_border")
                            }
                        }
                    });
                    b && b.addRules({
                        elements: {
                            table: function(a) {
                                a = a.attributes;
                                var b = a["class"];
                                b && (a["class"] = b.replace("cke_show_border", "").replace(/\s{2}/, " ").replace(/^\s+|\s+$/, ""))
                            }
                        }
                    })
                }
            });
            CKEDITOR.on("dialogDefinition", function(a) {
                var b = a.data.name;
                if ("table" == b || "tableProperties" == b)
                    if (a = a.data.definition, b = a.getContents("info").get("txtBorder"), b.commit = CKEDITOR.tools.override(b.commit, function(a) {
                            return function(b, c) {
                                a.apply(this, arguments);
                                var e = parseInt(this.getValue(), 10);
                                c[!e || 0 >= e ? "addClass" : "removeClass"]("cke_show_border")
                            }
                        }), a = (a = a.getContents("advanced")) && a.get("advCSSClasses")) a.setup = CKEDITOR.tools.override(a.setup, function(a) {
                        return function() {
                            a.apply(this, arguments);
                            this.setValue(this.getValue().replace(/cke_show_border/, ""))
                        }
                    }), a.commit = CKEDITOR.tools.override(a.commit, function(a) {
                        return function(b, c) {
                            a.apply(this, arguments);
                            parseInt(c.getAttribute("border"), 10) || c.addClass("cke_show_border")
                        }
                    })
            })
        })();
        (function() {
            CKEDITOR.plugins.add("sourcearea", {
                init: function(a) {
                    function d() {
                        var a = e && this.equals(CKEDITOR.document.getActive());
                        this.hide();
                        this.setStyle("height", this.getParent().$.clientHeight + "px");
                        this.setStyle("width", this.getParent().$.clientWidth + "px");
                        this.show();
                        a && this.focus()
                    }
                    if (a.elementMode != CKEDITOR.ELEMENT_MODE_INLINE) {
                        var f = CKEDITOR.plugins.sourcearea;
                        a.addMode("source", function(e) {
                            var b = a.ui.space("contents").getDocument().createElement("textarea");
                            b.setStyles(CKEDITOR.tools.extend({
                                width: CKEDITOR.env.ie7Compat ? "99%" : "100%",
                                height: "100%",
                                resize: "none",
                                outline: "none",
                                "text-align": "left"
                            }, CKEDITOR.tools.cssVendorPrefix("tab-size", a.config.sourceAreaTabSize || 4)));
                            b.setAttribute("dir", "ltr");
                            b.addClass("cke_source").addClass("cke_reset").addClass("cke_enable_context_menu");
                            a.ui.space("contents").append(b);
                            b = a.editable(new c(a, b));
                            b.setData(a.getData(1));
                            CKEDITOR.env.ie && (b.attachListener(a, "resize", d, b), b.attachListener(CKEDITOR.document.getWindow(), "resize", d, b), CKEDITOR.tools.setTimeout(d, 0, b));
                            a.fire("ariaWidget", this);
                            e()
                        });
                        a.addCommand("source", f.commands.source);
                        a.ui.addButton && a.ui.addButton("Source", {
                            label: a.lang.sourcearea.toolbar,
                            command: "source",
                            toolbar: "mode,10"
                        });
                        a.on("mode", function() {
                            a.getCommand("source").setState("source" == a.mode ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF)
                        });
                        var e = CKEDITOR.env.ie && 9 == CKEDITOR.env.version
                    }
                }
            });
            var c = CKEDITOR.tools.createClass({
                base: CKEDITOR.editable,
                proto: {
                    setData: function(a) {
                        this.setValue(a);
                        this.status = "ready";
                        this.editor.fire("dataReady")
                    },
                    getData: function() {
                        return this.getValue()
                    },
                    insertHtml: function() {},
                    insertElement: function() {},
                    insertText: function() {},
                    setReadOnly: function(a) {
                        this[(a ? "set" : "remove") + "Attribute"]("readOnly", "readonly")
                    },
                    detach: function() {
                        c.baseProto.detach.call(this);
                        this.clearCustomData();
                        this.remove()
                    }
                }
            })
        })();
        CKEDITOR.plugins.sourcearea = {
            commands: {
                source: {
                    modes: {
                        wysiwyg: 1,
                        source: 1
                    },
                    editorFocus: !1,
                    readOnly: 1,
                    exec: function(c) {
                        "wysiwyg" == c.mode && c.fire("saveSnapshot");
                        c.getCommand("source").setState(CKEDITOR.TRISTATE_DISABLED);
                        c.setMode("source" == c.mode ? "wysiwyg" : "source")
                    },
                    canUndo: !1
                }
            }
        };
        CKEDITOR.plugins.add("specialchar", {
            availableLangs: {
                af: 1,
                ar: 1,
                bg: 1,
                ca: 1,
                cs: 1,
                cy: 1,
                da: 1,
                de: 1,
                "de-ch": 1,
                el: 1,
                en: 1,
                "en-gb": 1,
                eo: 1,
                es: 1,
                et: 1,
                eu: 1,
                fa: 1,
                fi: 1,
                fr: 1,
                "fr-ca": 1,
                gl: 1,
                he: 1,
                hr: 1,
                hu: 1,
                id: 1,
                it: 1,
                ja: 1,
                km: 1,
                ko: 1,
                ku: 1,
                lt: 1,
                lv: 1,
                nb: 1,
                nl: 1,
                no: 1,
                pl: 1,
                pt: 1,
                "pt-br": 1,
                ru: 1,
                si: 1,
                sk: 1,
                sl: 1,
                sq: 1,
                sv: 1,
                th: 1,
                tr: 1,
                tt: 1,
                ug: 1,
                uk: 1,
                vi: 1,
                zh: 1,
                "zh-cn": 1
            },
            requires: "dialog",
            init: function(a) {
                var c = this;
                CKEDITOR.dialog.add("specialchar", this.path + "dialogs/specialchar.js");
                a.addCommand("specialchar", {
                    exec: function() {
                        var b = a.langCode,
                            b = c.availableLangs[b] ? b : c.availableLangs[b.replace(/-.*/, "")] ? b.replace(/-.*/, "") : "en";
                        CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c.path + "dialogs/lang/" + b + ".js"), function() {
                            CKEDITOR.tools.extend(a.lang.specialchar, c.langEntries[b]);
                            a.openDialog("specialchar")
                        })
                    },
                    modes: {
                        wysiwyg: 1
                    },
                    canUndo: !1
                });
                a.ui.addButton && a.ui.addButton("SpecialChar", {
                    label: a.lang.specialchar.toolbar,
                    command: "specialchar",
                    toolbar: "insert,50"
                })
            }
        });
        CKEDITOR.config.specialChars = "! &quot; # $ % &amp; ' ( ) * + - . / 0 1 2 3 4 5 6 7 8 9 : ; &lt; = &gt; ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~ &euro; &lsquo; &rsquo; &ldquo; &rdquo; &ndash; &mdash; &iexcl; &cent; &pound; &curren; &yen; &brvbar; &sect; &uml; &copy; &ordf; &laquo; &not; &reg; &macr; &deg; &sup2; &sup3; &acute; &micro; &para; &middot; &cedil; &sup1; &ordm; &raquo; &frac14; &frac12; &frac34; &iquest; &Agrave; &Aacute; &Acirc; &Atilde; &Auml; &Aring; &AElig; &Ccedil; &Egrave; &Eacute; &Ecirc; &Euml; &Igrave; &Iacute; &Icirc; &Iuml; &ETH; &Ntilde; &Ograve; &Oacute; &Ocirc; &Otilde; &Ouml; &times; &Oslash; &Ugrave; &Uacute; &Ucirc; &Uuml; &Yacute; &THORN; &szlig; &agrave; &aacute; &acirc; &atilde; &auml; &aring; &aelig; &ccedil; &egrave; &eacute; &ecirc; &euml; &igrave; &iacute; &icirc; &iuml; &eth; &ntilde; &ograve; &oacute; &ocirc; &otilde; &ouml; &divide; &oslash; &ugrave; &uacute; &ucirc; &uuml; &yacute; &thorn; &yuml; &OElig; &oelig; &#372; &#374 &#373 &#375; &sbquo; &#8219; &bdquo; &hellip; &trade; &#9658; &bull; &rarr; &rArr; &hArr; &diams; &asymp;".split(" ");
        CKEDITOR.plugins.add("scayt", {
            requires: "menubutton,dialog",
            tabToOpen: null,
            dialogName: "scaytDialog",
            init: function(a) {
                var c = this,
                    d = CKEDITOR.plugins.scayt;
                this.bindEvents(a);
                this.parseConfig(a);
                this.addRule(a);
                CKEDITOR.dialog.add(this.dialogName, CKEDITOR.getUrl(this.path + "dialogs/options.js"));
                this.addMenuItems(a);
                var b = a.lang.scayt,
                    e = CKEDITOR.env;
                a.ui.add("Scayt", CKEDITOR.UI_MENUBUTTON, {
                    label: b.text_title,
                    title: a.plugins.wsc ? a.lang.wsc.title : b.text_title,
                    modes: {
                        wysiwyg: !(e.ie && (8 > e.version || e.quirks))
                    },
                    toolbar: "spellchecker,20",
                    refresh: function() {
                        var b = a.ui.instances.Scayt.getState();
                        a.scayt && (b = d.state.scayt[a.name] ? CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF);
                        a.fire("scaytButtonState", b)
                    },
                    onRender: function() {
                        var b = this;
                        a.on("scaytButtonState", function(a) {
                            void 0 !== typeof a.data && b.setState(a.data)
                        })
                    },
                    onMenu: function() {
                        var b = a.scayt;
                        a.getMenuItem("scaytToggle").label = a.lang.scayt[b && d.state.scayt[a.name] ? "btn_disable" : "btn_enable"];
                        b = {
                            scaytToggle: CKEDITOR.TRISTATE_OFF,
                            scaytOptions: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                            scaytLangs: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                            scaytDict: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                            scaytAbout: b ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                            WSC: a.plugins.wsc ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
                        };
                        a.config.scayt_uiTabs[0] || delete b.scaytOptions;
                        a.config.scayt_uiTabs[1] || delete b.scaytLangs;
                        a.config.scayt_uiTabs[2] || delete b.scaytDict;
                        return b
                    }
                });
                a.contextMenu && a.addMenuItems && (a.contextMenu.addListener(function(b, d) {
                    var e = a.scayt,
                        k, l;
                    e && (l = e.getSelectionNode()) && (k = c.menuGenerator(a, l), e.showBanner("." + a.contextMenu._.definition.panel.className.split(" ").join(" .")));
                    return k
                }), a.contextMenu._.onHide = CKEDITOR.tools.override(a.contextMenu._.onHide, function(b) {
                    return function() {
                        var d = a.scayt;
                        d && d.hideBanner();
                        return b.apply(this)
                    }
                }))
            },
            addMenuItems: function(a) {
                var c = this,
                    d = CKEDITOR.plugins.scayt;
                a.addMenuGroup("scaytButton");
                for (var b = a.config.scayt_contextMenuItemsOrder.split("|"), e = 0; e < b.length; e++) b[e] = "scayt_" + b[e];
                if ((b = ["grayt_description", "grayt_suggest", "grayt_control"].concat(b)) && b.length)
                    for (e = 0; e < b.length; e++) a.addMenuGroup(b[e], e - 10);
                a.addCommand("scaytToggle", {
                    exec: function(a) {
                        var b = a.scayt;
                        d.state.scayt[a.name] = !d.state.scayt[a.name];
                        !0 === d.state.scayt[a.name] ? b || d.createScayt(a) : b && d.destroy(a)
                    }
                });
                a.addCommand("scaytAbout", {
                    exec: function(a) {
                        a.scayt.tabToOpen = "about";
                        a.lockSelection();
                        a.openDialog(c.dialogName)
                    }
                });
                a.addCommand("scaytOptions", {
                    exec: function(a) {
                        a.scayt.tabToOpen = "options";
                        a.lockSelection();
                        a.openDialog(c.dialogName)
                    }
                });
                a.addCommand("scaytLangs", {
                    exec: function(a) {
                        a.scayt.tabToOpen = "langs";
                        a.lockSelection();
                        a.openDialog(c.dialogName)
                    }
                });
                a.addCommand("scaytDict", {
                    exec: function(a) {
                        a.scayt.tabToOpen = "dictionaries";
                        a.lockSelection();
                        a.openDialog(c.dialogName)
                    }
                });
                b = {
                    scaytToggle: {
                        label: a.lang.scayt.btn_enable,
                        group: "scaytButton",
                        command: "scaytToggle"
                    },
                    scaytAbout: {
                        label: a.lang.scayt.btn_about,
                        group: "scaytButton",
                        command: "scaytAbout"
                    },
                    scaytOptions: {
                        label: a.lang.scayt.btn_options,
                        group: "scaytButton",
                        command: "scaytOptions"
                    },
                    scaytLangs: {
                        label: a.lang.scayt.btn_langs,
                        group: "scaytButton",
                        command: "scaytLangs"
                    },
                    scaytDict: {
                        label: a.lang.scayt.btn_dictionaries,
                        group: "scaytButton",
                        command: "scaytDict"
                    }
                };
                a.plugins.wsc && (b.WSC = {
                    label: a.lang.wsc.toolbar,
                    group: "scaytButton",
                    onClick: function() {
                        var b = CKEDITOR.plugins.scayt,
                            d = a.scayt,
                            c = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
                        (c = c.replace(/\s/g, "")) ? (d && b.state.scayt[a.name] && d.setMarkupPaused && d.setMarkupPaused(!0), a.lockSelection(), a.execCommand("checkspell")) : alert("Nothing to check!")
                    }
                });
                a.addMenuItems(b)
            },
            bindEvents: function(a) {
                var c = CKEDITOR.plugins.scayt,
                    d = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE,
                    b = function() {
                        c.destroy(a)
                    },
                    e = function() {
                        !c.state.scayt[a.name] || a.readOnly || a.scayt || c.createScayt(a)
                    },
                    f = function() {
                        var b = a.editable();
                        b.attachListener(b, "focus", function(b) {
                            CKEDITOR.plugins.scayt && !a.scayt && setTimeout(e, 0);
                            b = CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[a.name] && a.scayt;
                            var c, h;
                            if ((d || b) && a._.savedSelection) {
                                b = a._.savedSelection.getSelectedElement();
                                b = !b && a._.savedSelection.getRanges();
                                for (var f = 0; f < b.length; f++) h = b[f], "string" === typeof h.startContainer.$.nodeValue && (c = h.startContainer.getText().length, (c < h.startOffset || c < h.endOffset) && a.unlockSelection(!1))
                            }
                        }, this, null, -10)
                    },
                    g = function() {
                        d ? a.config.scayt_inlineModeImmediateMarkup ? e() : (a.on("blur", function() {
                            setTimeout(b, 0)
                        }), a.on("focus", e), a.focusManager.hasFocus && e()) : e();
                        f();
                        var c = a.editable();
                        c.attachListener(c, "mousedown", function(b) {
                            b = b.data.getTarget();
                            var d = a.widgets && a.widgets.getByElement(b);
                            d && (d.wrapper = b.getAscendant(function(a) {
                                return a.hasAttribute("data-cke-widget-wrapper")
                            }, !0))
                        }, this, null, -10)
                    };
                a.on("contentDom", g);
                a.on("beforeCommandExec", function(b) {
                    var d = a.scayt,
                        e = null,
                        f = !1,
                        g = !0;
                    b.data.name in c.options.disablingCommandExec && "wysiwyg" == a.mode ? d && (c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED)) : "bold" !== b.data.name && "italic" !== b.data.name && "underline" !== b.data.name && "strike" !== b.data.name && "subscript" !== b.data.name && "superscript" !== b.data.name && "enter" !== b.data.name && "cut" !== b.data.name && "language" !== b.data.name || !d || ("cut" === b.data.name && (g = !1, f = !0), "language" === b.data.name && (e = (e = a.plugins.language.getCurrentLangElement(a)) && e.$, f = !0), a.fire("reloadMarkupScayt", {
                        removeOptions: {
                            removeInside: g,
                            forceBookmark: f,
                            selectionNode: e
                        },
                        timeout: 0
                    }))
                });
                a.on("beforeSetMode", function(b) {
                    if ("source" == b.data) {
                        if (b = a.scayt) c.destroy(a), a.fire("scaytButtonState", CKEDITOR.TRISTATE_DISABLED);
                        a.document && a.document.getBody().removeAttribute("_jquid")
                    }
                });
                a.on("afterCommandExec", function(b) {
                    "wysiwyg" != a.mode || "undo" != b.data.name && "redo" != b.data.name || setTimeout(function() {
                        var b = a.scayt,
                            d = b && b.getScaytLangList();
                        d && d.ltr && d.rtl && b.fire("startSpellCheck, startGrammarCheck")
                    }, 250)
                });
                a.on("readOnly", function(b) {
                    var d;
                    b && (d = a.scayt, !0 === b.editor.readOnly ? d && d.fire("removeMarkupInDocument", {}) : d ? d.fire("startSpellCheck, startGrammarCheck") : "wysiwyg" == b.editor.mode && !0 === c.state.scayt[b.editor.name] && (c.createScayt(a), b.editor.fire("scaytButtonState", CKEDITOR.TRISTATE_ON)))
                });
                a.on("beforeDestroy", b);
                a.on("setData", function() {
                    b();
                    (a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE || a.plugins.divarea) && g()
                }, this, null, 50);
                a.on("reloadMarkupScayt", function(b) {
                    var d = b.data && b.data.removeOptions;
                    setTimeout(function() {
                        var b = a.scayt,
                            c = b && b.getScaytLangList();
                        c && c.ltr && c.rtl && (a.document.fire("keydown", new CKEDITOR.dom.event({
                            keyCode: 37
                        })), b.removeMarkupInSelectionNode(d), b.fire("startSpellCheck, startGrammarCheck"))
                    }, b.data && b.data.timeout || 0)
                });
                a.on("insertElement", function() {
                    a.fire("reloadMarkupScayt", {
                        removeOptions: {
                            forceBookmark: !0
                        }
                    })
                }, this, null, 50);
                a.on("insertHtml", function() {
                    a.fire("reloadMarkupScayt")
                }, this, null, 50);
                a.on("insertText", function() {
                    a.fire("reloadMarkupScayt")
                }, this, null, 50);
                a.on("scaytDialogShown", function(b) {
                    b.data.selectPage(a.scayt.tabToOpen)
                })
            },
            parseConfig: function(a) {
                var c = CKEDITOR.plugins.scayt;
                c.replaceOldOptionsNames(a.config);
                "boolean" !== typeof a.config.scayt_autoStartup && (a.config.scayt_autoStartup = !1);
                c.state.scayt[a.name] = a.config.scayt_autoStartup;
                "boolean" !== typeof a.config.grayt_autoStartup && (a.config.grayt_autoStartup = !1);
                "boolean" !== typeof a.config.scayt_inlineModeImmediateMarkup && (a.config.scayt_inlineModeImmediateMarkup = !1);
                c.state.grayt[a.name] = a.config.grayt_autoStartup;
                a.config.scayt_contextCommands || (a.config.scayt_contextCommands = "ignore|ignoreall|add");
                a.config.scayt_contextMenuItemsOrder || (a.config.scayt_contextMenuItemsOrder = "suggest|moresuggest|control");
                a.config.scayt_sLang || (a.config.scayt_sLang = "en_US");
                if (void 0 === a.config.scayt_maxSuggestions || "number" != typeof a.config.scayt_maxSuggestions || 0 > a.config.scayt_maxSuggestions) a.config.scayt_maxSuggestions = 5;
                if (void 0 === a.config.scayt_minWordLength || "number" != typeof a.config.scayt_minWordLength || 1 > a.config.scayt_minWordLength) a.config.scayt_minWordLength = 4;
                if (void 0 === a.config.scayt_customDictionaryIds || "string" !== typeof a.config.scayt_customDictionaryIds) a.config.scayt_customDictionaryIds = "";
                if (void 0 === a.config.scayt_userDictionaryName || "string" !== typeof a.config.scayt_userDictionaryName) a.config.scayt_userDictionaryName = null;
                if ("string" === typeof a.config.scayt_uiTabs && 3 === a.config.scayt_uiTabs.split(",").length) {
                    var d = [],
                        b = [];
                    a.config.scayt_uiTabs = a.config.scayt_uiTabs.split(",");
                    CKEDITOR.tools.search(a.config.scayt_uiTabs, function(a) {
                        1 === Number(a) || 0 === Number(a) ? (b.push(!0), d.push(Number(a))) : b.push(!1)
                    });
                    null === CKEDITOR.tools.search(b, !1) ? a.config.scayt_uiTabs = d : a.config.scayt_uiTabs = [1, 1, 1]
                } else a.config.scayt_uiTabs = [1, 1, 1];
                "string" != typeof a.config.scayt_serviceProtocol && (a.config.scayt_serviceProtocol = null);
                "string" != typeof a.config.scayt_serviceHost && (a.config.scayt_serviceHost = null);
                "string" != typeof a.config.scayt_servicePort && (a.config.scayt_servicePort = null);
                "string" != typeof a.config.scayt_servicePath && (a.config.scayt_servicePath = null);
                a.config.scayt_moreSuggestions || (a.config.scayt_moreSuggestions = "on");
                "string" !== typeof a.config.scayt_customerId && (a.config.scayt_customerId = "1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2");
                "string" !== typeof a.config.scayt_srcUrl && (c = document.location.protocol, c = -1 != c.search(/https?:/) ? c : "http:", a.config.scayt_srcUrl = c + "//svc.webspellchecker.net/spellcheck31/lf/scayt3/ckscayt/ckscayt.js");
                "boolean" !== typeof CKEDITOR.config.scayt_handleCheckDirty && (CKEDITOR.config.scayt_handleCheckDirty = !0);
                "boolean" !== typeof CKEDITOR.config.scayt_handleUndoRedo && (CKEDITOR.config.scayt_handleUndoRedo = !0);
                CKEDITOR.config.scayt_handleUndoRedo = CKEDITOR.plugins.undo ? CKEDITOR.config.scayt_handleUndoRedo : !1;
                "boolean" !== typeof a.config.scayt_multiLanguageMode && (a.config.scayt_multiLanguageMode = !1);
                "object" !== typeof a.config.scayt_multiLanguageStyles && (a.config.scayt_multiLanguageStyles = {});
                a.config.scayt_ignoreAllCapsWords && "boolean" !== typeof a.config.scayt_ignoreAllCapsWords && (a.config.scayt_ignoreAllCapsWords = !1);
                a.config.scayt_ignoreDomainNames && "boolean" !== typeof a.config.scayt_ignoreDomainNames && (a.config.scayt_ignoreDomainNames = !1);
                a.config.scayt_ignoreWordsWithMixedCases && "boolean" !== typeof a.config.scayt_ignoreWordsWithMixedCases && (a.config.scayt_ignoreWordsWithMixedCases = !1);
                a.config.scayt_ignoreWordsWithNumbers && "boolean" !== typeof a.config.scayt_ignoreWordsWithNumbers && (a.config.scayt_ignoreWordsWithNumbers = !1);
                if (a.config.scayt_disableOptionsStorage) {
                    var c = CKEDITOR.tools.isArray(a.config.scayt_disableOptionsStorage) ? a.config.scayt_disableOptionsStorage : "string" === typeof a.config.scayt_disableOptionsStorage ? [a.config.scayt_disableOptionsStorage] : void 0,
                        e = "all options lang ignore-all-caps-words ignore-domain-names ignore-words-with-mixed-cases ignore-words-with-numbers".split(" "),
                        f = ["lang", "ignore-all-caps-words", "ignore-domain-names", "ignore-words-with-mixed-cases", "ignore-words-with-numbers"],
                        g = CKEDITOR.tools.search,
                        h = CKEDITOR.tools.indexOf;
                    a.config.scayt_disableOptionsStorage = function(a) {
                        for (var b = [], d = 0; d < a.length; d++) {
                            var c = a[d],
                                m = !!g(a, "options");
                            if (!g(e, c) || m && g(f, function(a) {
                                    if ("lang" === a) return !1
                                })) return;
                            g(f, c) && f.splice(h(f, c), 1);
                            if ("all" === c || m && g(a, "lang")) return [];
                            "options" === c && (f = ["lang"])
                        }
                        return b = b.concat(f)
                    }(c)
                }
            },
            addRule: function(a) {
                var c = CKEDITOR.plugins.scayt,
                    d = a.dataProcessor,
                    b = d && d.htmlFilter,
                    e = a._.elementsPath && a._.elementsPath.filters,
                    d = d && d.dataFilter,
                    f = a.addRemoveFormatFilter,
                    g = function(b) {
                        if (a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute))) return !1
                    },
                    h = function(b) {
                        var d = !0;
                        a.scayt && (b.hasAttribute(c.options.data_attribute_name) || b.hasAttribute(c.options.problem_grammar_data_attribute)) && (d = !1);
                        return d
                    };
                e && e.push(g);
                d && d.addRules({
                    elements: {
                        span: function(a) {
                            var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options.data_attribute_name],
                                d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];
                            c && (b || d) && delete a.name;
                            return a
                        }
                    }
                });
                b && b.addRules({
                    elements: {
                        span: function(a) {
                            var b = a.hasClass(c.options.misspelled_word_class) && a.attributes[c.options.data_attribute_name],
                                d = a.hasClass(c.options.problem_grammar_class) && a.attributes[c.options.problem_grammar_data_attribute];
                            c && (b || d) && delete a.name;
                            return a
                        }
                    }
                });
                f && f.call(a, h)
            },
            scaytMenuDefinition: function(a) {
                var c = this;
                a = a.scayt;
                return {
                    scayt: {
                        scayt_ignore: {
                            label: a.getLocal("btn_ignore"),
                            group: "scayt_control",
                            order: 1,
                            exec: function(a) {
                                a.scayt.ignoreWord()
                            }
                        },
                        scayt_ignoreall: {
                            label: a.getLocal("btn_ignoreAll"),
                            group: "scayt_control",
                            order: 2,
                            exec: function(a) {
                                a.scayt.ignoreAllWords()
                            }
                        },
                        scayt_add: {
                            label: a.getLocal("btn_addWord"),
                            group: "scayt_control",
                            order: 3,
                            exec: function(a) {
                                var b = a.scayt;
                                setTimeout(function() {
                                    b.addWordToUserDictionary()
                                }, 10)
                            }
                        },
                        scayt_option: {
                            label: a.getLocal("btn_options"),
                            group: "scayt_control",
                            order: 4,
                            exec: function(a) {
                                a.scayt.tabToOpen = "options";
                                a.lockSelection();
                                a.openDialog(c.dialogName)
                            },
                            verification: function(a) {
                                return 1 == a.config.scayt_uiTabs[0] ? !0 : !1
                            }
                        },
                        scayt_language: {
                            label: a.getLocal("btn_langs"),
                            group: "scayt_control",
                            order: 5,
                            exec: function(a) {
                                a.scayt.tabToOpen = "langs";
                                a.lockSelection();
                                a.openDialog(c.dialogName)
                            },
                            verification: function(a) {
                                return 1 == a.config.scayt_uiTabs[1] ? !0 : !1
                            }
                        },
                        scayt_dictionary: {
                            label: a.getLocal("btn_dictionaries"),
                            group: "scayt_control",
                            order: 6,
                            exec: function(a) {
                                a.scayt.tabToOpen = "dictionaries";
                                a.lockSelection();
                                a.openDialog(c.dialogName)
                            },
                            verification: function(a) {
                                return 1 == a.config.scayt_uiTabs[2] ? !0 : !1
                            }
                        },
                        scayt_about: {
                            label: a.getLocal("btn_about"),
                            group: "scayt_control",
                            order: 7,
                            exec: function(a) {
                                a.scayt.tabToOpen = "about";
                                a.lockSelection();
                                a.openDialog(c.dialogName)
                            }
                        }
                    },
                    grayt: {
                        grayt_problemdescription: {
                            label: "Grammar problem description",
                            group: "grayt_description",
                            order: 1,
                            state: CKEDITOR.TRISTATE_DISABLED,
                            exec: function(a) {}
                        },
                        grayt_ignore: {
                            label: a.getLocal("btn_ignore"),
                            group: "grayt_control",
                            order: 2,
                            exec: function(a) {
                                a.scayt.ignorePhrase()
                            }
                        }
                    }
                }
            },
            buildSuggestionMenuItems: function(a, c, d) {
                var b = {},
                    e = {},
                    f = d ? "word" : "phrase",
                    g = d ? "startGrammarCheck" : "startSpellCheck",
                    h = a.scayt;
                if (0 < c.length && "no_any_suggestions" !== c[0])
                    if (d)
                        for (d = 0; d < c.length; d++) {
                            var k = "scayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_");
                            a.addCommand(k, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g));
                            d < a.config.scayt_maxSuggestions ? (a.addMenuItem(k, {
                                label: c[d],
                                command: k,
                                group: "scayt_suggest",
                                order: d + 1
                            }), b[k] = CKEDITOR.TRISTATE_OFF) : (a.addMenuItem(k, {
                                label: c[d],
                                command: k,
                                group: "scayt_moresuggest",
                                order: d + 1
                            }), e[k] = CKEDITOR.TRISTATE_OFF, "on" === a.config.scayt_moreSuggestions && (a.addMenuItem("scayt_moresuggest", {
                                label: h.getLocal("btn_moreSuggestions"),
                                group: "scayt_moresuggest",
                                order: 10,
                                getItems: function() {
                                    return e
                                }
                            }), b.scayt_moresuggest = CKEDITOR.TRISTATE_OFF))
                        } else
                            for (d = 0; d < c.length; d++) k = "grayt_suggest_" + CKEDITOR.plugins.scayt.suggestions[d].replace(" ", "_"), a.addCommand(k, this.createCommand(CKEDITOR.plugins.scayt.suggestions[d], f, g)), a.addMenuItem(k, {
                                label: c[d],
                                command: k,
                                group: "grayt_suggest",
                                order: d + 1
                            }), b[k] = CKEDITOR.TRISTATE_OFF;
                    else b.no_scayt_suggest = CKEDITOR.TRISTATE_DISABLED, a.addCommand("no_scayt_suggest", {
                        exec: function() {}
                    }), a.addMenuItem("no_scayt_suggest", {
                        label: h.getLocal("btn_noSuggestions") || "no_scayt_suggest",
                        command: "no_scayt_suggest",
                        group: "scayt_suggest",
                        order: 0
                    });
                return b
            },
            menuGenerator: function(a, c) {
                var d = a.scayt,
                    b = this.scaytMenuDefinition(a),
                    e = {},
                    f = a.config.scayt_contextCommands.split("|"),
                    g = c.getAttribute(d.getLangAttribute()) || d.getLang(),
                    h, k;
                h = d.isScaytNode(c);
                k = d.isGraytNode(c);
                h ? (b = b.scayt, e = c.getAttribute(d.getScaytNodeAttributeName()), d.fire("getSuggestionsList", {
                    lang: g,
                    word: e
                }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, h)) : k && (b = b.grayt, e = c.getAttribute(d.getGraytNodeAttributeName()), k = d.getProblemDescriptionText(e, g), b.grayt_problemdescription && k && (b.grayt_problemdescription.label = k), d.fire("getGrammarSuggestionsList", {
                    lang: g,
                    phrase: e
                }), e = this.buildSuggestionMenuItems(a, CKEDITOR.plugins.scayt.suggestions, h));
                if (h && "off" == a.config.scayt_contextCommands) return e;
                for (var l in b) h && -1 == CKEDITOR.tools.indexOf(f, l.replace("scayt_", "")) && "all" != a.config.scayt_contextCommands || (e[l] = "undefined" != typeof b[l].state ? b[l].state : CKEDITOR.TRISTATE_OFF, "function" !== typeof b[l].verification || b[l].verification(a) || delete e[l], a.addCommand(l, {
                    exec: b[l].exec
                }), a.addMenuItem(l, {
                    label: a.lang.scayt[b[l].label] || b[l].label,
                    command: l,
                    group: b[l].group,
                    order: b[l].order
                }));
                return e
            },
            createCommand: function(a, c, d) {
                return {
                    exec: function(b) {
                        b = b.scayt;
                        var e = {};
                        e[c] = a;
                        b.replaceSelectionNode(e);
                        "startGrammarCheck" === d && b.removeMarkupInSelectionNode({
                            grammarOnly: !0
                        });
                        b.fire(d)
                    }
                }
            }
        });
        CKEDITOR.plugins.scayt = {
            state: {
                scayt: {},
                grayt: {}
            },
            suggestions: [],
            loadingHelper: {
                loadOrder: []
            },
            isLoading: !1,
            options: {
                disablingCommandExec: {
                    source: !0,
                    newpage: !0,
                    templates: !0
                },
                data_attribute_name: "data-scayt-word",
                misspelled_word_class: "scayt-misspell-word",
                problem_grammar_data_attribute: "data-grayt-phrase",
                problem_grammar_class: "gramm-problem"
            },
            backCompatibilityMap: {
                scayt_service_protocol: "scayt_serviceProtocol",
                scayt_service_host: "scayt_serviceHost",
                scayt_service_port: "scayt_servicePort",
                scayt_service_path: "scayt_servicePath",
                scayt_customerid: "scayt_customerId"
            },
            replaceOldOptionsNames: function(a) {
                for (var c in a) c in this.backCompatibilityMap && (a[this.backCompatibilityMap[c]] = a[c], delete a[c])
            },
            createScayt: function(a) {
                var c = this,
                    d = CKEDITOR.plugins.scayt;
                this.loadScaytLibrary(a, function(a) {
                    var e = a.window && a.window.getFrame() || a.editable();
                    e ? (e = {
                        lang: a.config.scayt_sLang,
                        container: e.$,
                        customDictionary: a.config.scayt_customDictionaryIds,
                        userDictionaryName: a.config.scayt_userDictionaryName,
                        localization: a.langCode,
                        customer_id: a.config.scayt_customerId,
                        debug: a.config.scayt_debug,
                        data_attribute_name: c.options.data_attribute_name,
                        misspelled_word_class: c.options.misspelled_word_class,
                        problem_grammar_data_attribute: c.options.problem_grammar_data_attribute,
                        problem_grammar_class: c.options.problem_grammar_class,
                        "options-to-restore": a.config.scayt_disableOptionsStorage,
                        focused: a.editable().hasFocus,
                        ignoreElementsRegex: a.config.scayt_elementsToIgnore,
                        minWordLength: a.config.scayt_minWordLength,
                        multiLanguageMode: a.config.scayt_multiLanguageMode,
                        multiLanguageStyles: a.config.scayt_multiLanguageStyles,
                        graytAutoStartup: d.state.grayt[a.name]
                    }, a.config.scayt_serviceProtocol && (e.service_protocol = a.config.scayt_serviceProtocol), a.config.scayt_serviceHost && (e.service_host = a.config.scayt_serviceHost), a.config.scayt_servicePort && (e.service_port = a.config.scayt_servicePort), a.config.scayt_servicePath && (e.service_path = a.config.scayt_servicePath), "boolean" === typeof a.config.scayt_ignoreAllCapsWords && (e["ignore-all-caps-words"] = a.config.scayt_ignoreAllCapsWords), "boolean" === typeof a.config.scayt_ignoreDomainNames && (e["ignore-domain-names"] = a.config.scayt_ignoreDomainNames), "boolean" === typeof a.config.scayt_ignoreWordsWithMixedCases && (e["ignore-words-with-mixed-cases"] = a.config.scayt_ignoreWordsWithMixedCases), "boolean" === typeof a.config.scayt_ignoreWordsWithNumbers && (e["ignore-words-with-numbers"] = a.config.scayt_ignoreWordsWithNumbers), e = new SCAYT.CKSCAYT(e, function() {}, function() {}), e.subscribe("suggestionListSend", function(a) {
                        for (var b = {}, d = [], c = 0; c < a.suggestionList.length; c++) b["word_" + a.suggestionList[c]] || (b["word_" + a.suggestionList[c]] = a.suggestionList[c], d.push(a.suggestionList[c]));
                        CKEDITOR.plugins.scayt.suggestions = d
                    }), e.subscribe("selectionIsChanged", function(d) {
                        a.getSelection().isLocked && a.lockSelection()
                    }), e.subscribe("graytStateChanged", function(c) {
                        d.state.grayt[a.name] = c.state
                    }), a.scayt = e, a.fire("scaytButtonState", a.readOnly ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_ON)) : d.state.scayt[a.name] = !1
                })
            },
            destroy: function(a) {
                a.scayt && a.scayt.destroy();
                delete a.scayt;
                a.fire("scaytButtonState", CKEDITOR.TRISTATE_OFF)
            },
            loadScaytLibrary: function(a, c) {
                var d = this,
                    b, e;
                this.loadingHelper[a.name] || ("undefined" === typeof window.SCAYT || "function" !== typeof window.SCAYT.CKSCAYT ? (this.loadingHelper[a.name] = c, this.loadingHelper.loadOrder.push(a.name), b = new Date, b = b.getTime(), e = a.config.scayt_srcUrl, e += 0 <= e.indexOf("?") ? "" : "?" + b, this.loadingHelper.ckscaytLoading || (CKEDITOR.scriptLoader.load(e, function(a) {
                    if (a) {
                        CKEDITOR.fireOnce("scaytReady");
                        for (var b = 0; b < d.loadingHelper.loadOrder.length; b++) {
                            a = d.loadingHelper.loadOrder[b];
                            if ("function" === typeof d.loadingHelper[a]) d.loadingHelper[a](CKEDITOR.instances[a]);
                            delete d.loadingHelper[a]
                        }
                        d.loadingHelper.loadOrder = []
                    }
                }), this.loadingHelper.ckscaytLoading = !0)) : window.SCAYT && "function" === typeof window.SCAYT.CKSCAYT && (CKEDITOR.fireOnce("scaytReady"), a.scayt || "function" === typeof c && c(a)))
            }
        };
        CKEDITOR.on("dialogDefinition", function(a) {
            var c = a.data.name;
            a = a.data.definition.dialog;
            if ("scaytDialog" === c) a.on("cancel", function(a) {
                return !1
            }, this, null, -1);
            if ("checkspell" === c) a.on("cancel", function(a) {
                a = a.sender && a.sender.getParentEditor();
                var b = CKEDITOR.plugins.scayt,
                    c = a.scayt;
                c && b.state.scayt[a.name] && c.setMarkupPaused && c.setMarkupPaused(!1);
                a.unlockSelection()
            }, this, null, -2);
            if ("link" === c) a.on("ok", function(a) {
                var b = a.sender && a.sender.getParentEditor();
                b && setTimeout(function() {
                    b.fire("reloadMarkupScayt", {
                        removeOptions: {
                            removeInside: !0,
                            forceBookmark: !0
                        },
                        timeout: 0
                    })
                }, 0)
            })
        });
        CKEDITOR.on("scaytReady", function() {
            if (!0 === CKEDITOR.config.scayt_handleCheckDirty) {
                var a = CKEDITOR.editor.prototype;
                a.checkDirty = CKEDITOR.tools.override(a.checkDirty, function(a) {
                    return function() {
                        var b = null,
                            c = this.scayt;
                        if (CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt) {
                            if (b = "ready" == this.status) var f = c.removeMarkupFromString(this.getSnapshot()),
                                c = c.removeMarkupFromString(this._.previousValue),
                                b = b && c !== f
                        } else b = a.call(this);
                        return b
                    }
                });
                a.resetDirty = CKEDITOR.tools.override(a.resetDirty, function(a) {
                    return function() {
                        var b = this.scayt;
                        CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[this.name] && this.scayt ? this._.previousValue = b.removeMarkupFromString(this.getSnapshot()) : a.call(this)
                    }
                })
            }
            if (!0 === CKEDITOR.config.scayt_handleUndoRedo) {
                var a = CKEDITOR.plugins.undo.Image.prototype,
                    c = "function" == typeof a.equalsContent ? "equalsContent" : "equals";
                a[c] = CKEDITOR.tools.override(a[c], function(a) {
                    return function(b) {
                        var c = b.editor.scayt,
                            f = this.contents,
                            g = b.contents,
                            h = null;
                        CKEDITOR.plugins.scayt && CKEDITOR.plugins.scayt.state.scayt[b.editor.name] && b.editor.scayt && (this.contents = c.removeMarkupFromString(f) || "", b.contents = c.removeMarkupFromString(g) || "");
                        h = a.apply(this, arguments);
                        this.contents = f;
                        b.contents = g;
                        return h
                    }
                })
            }
        });
        (function() {
            CKEDITOR.plugins.add("stylescombo", {
                requires: "richcombo",
                init: function(c) {
                    var l = c.config,
                        g = c.lang.stylescombo,
                        f = {},
                        k = [],
                        m = [];
                    c.on("stylesSet", function(b) {
                        if (b = b.data.styles) {
                            for (var a, h, d, e = 0, n = b.length; e < n; e++)(a = b[e], c.blockless && a.element in CKEDITOR.dtd.$block || (h = a.name, a = new CKEDITOR.style(a), c.filter.customConfig && !c.filter.check(a))) || (a._name = h, a._.enterMode = l.enterMode, a._.type = d = a.assignedTo || a.type, a._.weight = e + 1e3 * (d == CKEDITOR.STYLE_OBJECT ? 1 : d == CKEDITOR.STYLE_BLOCK ? 2 : 3), f[h] = a, k.push(a), m.push(a));
                            k.sort(function(a, b) {
                                return a._.weight - b._.weight
                            })
                        }
                    });
                    c.ui.addRichCombo("Styles", {
                        label: g.label,
                        title: g.panelTitle,
                        toolbar: "styles,10",
                        allowedContent: m,
                        panel: {
                            css: [CKEDITOR.skin.getPath("editor")].concat(l.contentsCss),
                            multiSelect: !0,
                            attributes: {
                                "aria-label": g.panelTitle
                            }
                        },
                        init: function() {
                            var b, a, c, d, e, f;
                            e = 0;
                            for (f = k.length; e < f; e++) b = k[e], a = b._name, d = b._.type, d != c && (this.startGroup(g["panelTitle" + String(d)]), c = d), this.add(a, b.type == CKEDITOR.STYLE_OBJECT ? a : b.buildPreview(), a);
                            this.commit()
                        },
                        onClick: function(b) {
                            c.focus();
                            c.fire("saveSnapshot");
                            b = f[b];
                            var a = c.elementPath();
                            c[b.checkActive(a, c) ? "removeStyle" : "applyStyle"](b);
                            c.fire("saveSnapshot")
                        },
                        onRender: function() {
                            c.on("selectionChange", function(b) {
                                var a = this.getValue();
                                b = b.data.path.elements;
                                for (var h = 0, d = b.length, e; h < d; h++) {
                                    e = b[h];
                                    for (var g in f)
                                        if (f[g].checkElementRemovable(e, !0, c)) {
                                            g != a && this.setValue(g);
                                            return
                                        }
                                }
                                this.setValue("")
                            }, this)
                        },
                        onOpen: function() {
                            var b = c.getSelection().getSelectedElement(),
                                b = c.elementPath(b),
                                a = [0, 0, 0, 0];
                            this.showAll();
                            this.unmarkAll();
                            for (var h in f) {
                                var d = f[h],
                                    e = d._.type;
                                d.checkApplicable(b, c, c.activeFilter) ? a[e]++ : this.hideItem(h);
                                d.checkActive(b, c) && this.mark(h)
                            }
                            a[CKEDITOR.STYLE_BLOCK] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_BLOCK)]);
                            a[CKEDITOR.STYLE_INLINE] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_INLINE)]);
                            a[CKEDITOR.STYLE_OBJECT] || this.hideGroup(g["panelTitle" + String(CKEDITOR.STYLE_OBJECT)])
                        },
                        refresh: function() {
                            var b = c.elementPath();
                            if (b) {
                                for (var a in f)
                                    if (f[a].checkApplicable(b, c, c.activeFilter)) return;
                                this.setState(CKEDITOR.TRISTATE_DISABLED)
                            }
                        },
                        reset: function() {
                            f = {};
                            k = []
                        }
                    })
                }
            })
        })();
        (function() {
            function k(c) {
                return {
                    editorFocus: !1,
                    canUndo: !1,
                    modes: {
                        wysiwyg: 1
                    },
                    exec: function(d) {
                        if (d.editable().hasFocus) {
                            var e = d.getSelection(),
                                b;
                            if (b = new CKEDITOR.dom.elementPath(e.getCommonAncestor(), e.root).contains({
                                    td: 1,
                                    th: 1
                                }, 1)) {
                                var e = d.createRange(),
                                    a = CKEDITOR.tools.tryThese(function() {
                                        var a = b.getParent().$.cells[b.$.cellIndex + (c ? -1 : 1)];
                                        a.parentNode.parentNode;
                                        return a
                                    }, function() {
                                        var a = b.getParent(),
                                            a = a.getAscendant("table").$.rows[a.$.rowIndex + (c ? -1 : 1)];
                                        return a.cells[c ? a.cells.length - 1 : 0]
                                    });
                                if (a || c)
                                    if (a) a = new CKEDITOR.dom.element(a), e.moveToElementEditStart(a), e.checkStartOfBlock() && e.checkEndOfBlock() || e.selectNodeContents(a);
                                    else return !0;
                                else {
                                    for (var f = b.getAscendant("table").$, a = b.getParent().$.cells, f = new CKEDITOR.dom.element(f.insertRow(-1), d.document), g = 0, h = a.length; g < h; g++) f.append(new CKEDITOR.dom.element(a[g], d.document).clone(!1, !1)).appendBogus();
                                    e.moveToElementEditStart(f)
                                }
                                e.select(!0);
                                return !0
                            }
                        }
                        return !1
                    }
                }
            }
            var h = {
                    editorFocus: !1,
                    modes: {
                        wysiwyg: 1,
                        source: 1
                    }
                },
                g = {
                    exec: function(c) {
                        c.container.focusNext(!0, c.tabIndex)
                    }
                },
                f = {
                    exec: function(c) {
                        c.container.focusPrevious(!0, c.tabIndex)
                    }
                };
            CKEDITOR.plugins.add("tab", {
                init: function(c) {
                    for (var d = !1 !== c.config.enableTabKeyTools, e = c.config.tabSpaces || 0, b = ""; e--;) b += " ";
                    if (b) c.on("key", function(a) {
                        9 == a.data.keyCode && (c.insertText(b), a.cancel())
                    });
                    if (d) c.on("key", function(a) {
                        (9 == a.data.keyCode && c.execCommand("selectNextCell") || a.data.keyCode == CKEDITOR.SHIFT + 9 && c.execCommand("selectPreviousCell")) && a.cancel()
                    });
                    c.addCommand("blur", CKEDITOR.tools.extend(g, h));
                    c.addCommand("blurBack", CKEDITOR.tools.extend(f, h));
                    c.addCommand("selectNextCell", k());
                    c.addCommand("selectPreviousCell", k(!0))
                }
            })
        })();
        CKEDITOR.dom.element.prototype.focusNext = function(k, h) {
            var g = void 0 === h ? this.getTabIndex() : h,
                f, c, d, e, b, a;
            if (0 >= g)
                for (b = this.getNextSourceNode(k, CKEDITOR.NODE_ELEMENT); b;) {
                    if (b.isVisible() && 0 === b.getTabIndex()) {
                        d = b;
                        break
                    }
                    b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT)
                } else
                    for (b = this.getDocument().getBody().getFirst(); b = b.getNextSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
                        if (!f)
                            if (!c && b.equals(this)) {
                                if (c = !0, k) {
                                    if (!(b = b.getNextSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
                                    f = 1
                                }
                            } else c && !this.contains(b) && (f = 1);
                        if (b.isVisible() && !(0 > (a = b.getTabIndex()))) {
                            if (f && a == g) {
                                d = b;
                                break
                            }
                            a > g && (!d || !e || a < e) ? (d = b, e = a) : d || 0 !== a || (d = b, e = a)
                        }
                    }
            d && d.focus()
        };
        CKEDITOR.dom.element.prototype.focusPrevious = function(k, h) {
            for (var g = void 0 === h ? this.getTabIndex() : h, f, c, d, e = 0, b, a = this.getDocument().getBody().getLast(); a = a.getPreviousSourceNode(!1, CKEDITOR.NODE_ELEMENT);) {
                if (!f)
                    if (!c && a.equals(this)) {
                        if (c = !0, k) {
                            if (!(a = a.getPreviousSourceNode(!0, CKEDITOR.NODE_ELEMENT))) break;
                            f = 1
                        }
                    } else c && !this.contains(a) && (f = 1);
                if (a.isVisible() && !(0 > (b = a.getTabIndex())))
                    if (0 >= g) {
                        if (f && 0 === b) {
                            d = a;
                            break
                        }
                        b > e && (d = a, e = b)
                    } else {
                        if (f && b == g) {
                            d = a;
                            break
                        }
                        b < g && (!d || b > e) && (d = a, e = b)
                    }
            }
            d && d.focus()
        };
        CKEDITOR.plugins.add("table", {
            requires: "dialog",
            init: function(a) {
                function e(a) {
                    return CKEDITOR.tools.extend(a || {}, {
                        contextSensitive: 1,
                        refresh: function(a, f) {
                            this.setState(f.contains("table", 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
                        }
                    })
                }
                if (!a.blockless) {
                    var c = a.lang.table;
                    a.addCommand("table", new CKEDITOR.dialogCommand("table", {
                        context: "table",
                        allowedContent: "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr[scope];" + (a.plugins.dialogadvtab ? "table" + a.plugins.dialogadvtab.allowedContent() : ""),
                        requiredContent: "table",
                        contentTransformations: [
                            ["table{width}: sizeToStyle", "table[width]: sizeToAttribute"]
                        ]
                    }));
                    a.addCommand("tableProperties", new CKEDITOR.dialogCommand("tableProperties", e()));
                    a.addCommand("tableDelete", e({
                        exec: function(a) {
                            var b = a.elementPath().contains("table", 1);
                            if (b) {
                                var d = b.getParent(),
                                    c = a.editable();
                                1 != d.getChildCount() || d.is("td", "th") || d.equals(c) || (b = d);
                                a = a.createRange();
                                a.moveToPosition(b, CKEDITOR.POSITION_BEFORE_START);
                                b.remove();
                                a.select()
                            }
                        }
                    }));
                    a.ui.addButton && a.ui.addButton("Table", {
                        label: c.toolbar,
                        command: "table",
                        toolbar: "insert,30"
                    });
                    CKEDITOR.dialog.add("table", this.path + "dialogs/table.js");
                    CKEDITOR.dialog.add("tableProperties", this.path + "dialogs/table.js");
                    a.addMenuItems && a.addMenuItems({
                        table: {
                            label: c.menu,
                            command: "tableProperties",
                            group: "table",
                            order: 5
                        },
                        tabledelete: {
                            label: c.deleteTable,
                            command: "tableDelete",
                            group: "table",
                            order: 1
                        }
                    });
                    a.on("doubleclick", function(a) {
                        a.data.element.is("table") && (a.data.dialog = "tableProperties")
                    });
                    a.contextMenu && a.contextMenu.addListener(function() {
                        return {
                            tabledelete: CKEDITOR.TRISTATE_OFF,
                            table: CKEDITOR.TRISTATE_OFF
                        }
                    })
                }
            }
        });
        (function() {
            function t(e) {
                function d(a) {
                    0 < b.length || a.type != CKEDITOR.NODE_ELEMENT || !C.test(a.getName()) || a.getCustomData("selected_cell") || (CKEDITOR.dom.element.setMarker(c, a, "selected_cell", !0), b.push(a))
                }
                e = e.getRanges();
                for (var b = [], c = {}, a = 0; a < e.length; a++) {
                    var f = e[a];
                    if (f.collapsed) f = f.getCommonAncestor(), (f = f.getAscendant("td", !0) || f.getAscendant("th", !0)) && b.push(f);
                    else {
                        var f = new CKEDITOR.dom.walker(f),
                            g;
                        for (f.guard = d; g = f.next();) g.type == CKEDITOR.NODE_ELEMENT && g.is(CKEDITOR.dtd.table) || (g = g.getAscendant("td", !0) || g.getAscendant("th", !0)) && !g.getCustomData("selected_cell") && (CKEDITOR.dom.element.setMarker(c, g, "selected_cell", !0), b.push(g))
                    }
                }
                CKEDITOR.dom.element.clearAllMarkers(c);
                return b
            }

            function p(e, d) {
                for (var b = t(e), c = b[0], a = c.getAscendant("table"), c = c.getDocument(), f = b[0].getParent(), g = f.$.rowIndex, b = b[b.length - 1], h = b.getParent().$.rowIndex + b.$.rowSpan - 1, b = new CKEDITOR.dom.element(a.$.rows[h]), g = d ? g : h, f = d ? f : b, b = CKEDITOR.tools.buildTableMap(a), a = b[g], g = d ? b[g - 1] : b[g + 1], b = b[0].length, c = c.createElement("tr"), h = 0; a[h] && h < b; h++) {
                    var k;
                    1 < a[h].rowSpan && g && a[h] == g[h] ? (k = a[h], k.rowSpan += 1) : (k = new CKEDITOR.dom.element(a[h]).clone(), k.removeAttribute("rowSpan"), k.appendBogus(), c.append(k), k = k.$);
                    h += k.colSpan - 1
                }
                d ? c.insertBefore(f) : c.insertAfter(f)
            }

            function u(e) {
                if (e instanceof CKEDITOR.dom.selection) {
                    var d = t(e),
                        b = d[0].getAscendant("table"),
                        c = CKEDITOR.tools.buildTableMap(b);
                    e = d[0].getParent().$.rowIndex;
                    for (var d = d[d.length - 1], a = d.getParent().$.rowIndex + d.$.rowSpan - 1, d = [], f = e; f <= a; f++) {
                        for (var g = c[f], h = new CKEDITOR.dom.element(b.$.rows[f]), k = 0; k < g.length; k++) {
                            var l = new CKEDITOR.dom.element(g[k]),
                                n = l.getParent().$.rowIndex;
                            1 == l.$.rowSpan ? l.remove() : (--l.$.rowSpan, n == f && (n = c[f + 1], n[k - 1] ? l.insertAfter(new CKEDITOR.dom.element(n[k - 1])) : new CKEDITOR.dom.element(b.$.rows[f + 1]).append(l, 1)));
                            k += l.$.colSpan - 1
                        }
                        d.push(h)
                    }
                    c = b.$.rows;
                    b = new CKEDITOR.dom.element(c[a + 1] || (0 < e ? c[e - 1] : null) || b.$.parentNode);
                    for (f = d.length; 0 <= f; f--) u(d[f]);
                    return b
                }
                e instanceof CKEDITOR.dom.element && (b = e.getAscendant("table"), 1 == b.$.rows.length ? b.remove() : e.remove());
                return null
            }

            function v(e, d) {
                for (var b = d ? Infinity : 0, c = 0; c < e.length; c++) {
                    var a;
                    a = e[c];
                    for (var f = d, g = a.getParent().$.cells, h = 0, k = 0; k < g.length; k++) {
                        var l = g[k],
                            h = h + (f ? 1 : l.colSpan);
                        if (l == a.$) break
                    }
                    a = h - 1;
                    if (d ? a < b : a > b) b = a
                }
                return b
            }

            function m(e, d) {
                for (var b = t(e), c = b[0].getAscendant("table"), a = v(b, 1), b = v(b), a = d ? a : b, f = CKEDITOR.tools.buildTableMap(c), c = [], b = [], g = f.length, h = 0; h < g; h++) c.push(f[h][a]), b.push(d ? f[h][a - 1] : f[h][a + 1]);
                for (h = 0; h < g; h++) c[h] && (1 < c[h].colSpan && b[h] == c[h] ? (a = c[h], a.colSpan += 1) : (a = new CKEDITOR.dom.element(c[h]).clone(), a.removeAttribute("colSpan"), a.appendBogus(), a[d ? "insertBefore" : "insertAfter"].call(a, new CKEDITOR.dom.element(c[h])), a = a.$), h += a.rowSpan - 1)
            }

            function y(e, d) {
                var b = e.getStartElement();
                if (b = b.getAscendant("td", 1) || b.getAscendant("th", 1)) {
                    var c = b.clone();
                    c.appendBogus();
                    d ? c.insertBefore(b) : c.insertAfter(b)
                }
            }

            function x(e) {
                if (e instanceof CKEDITOR.dom.selection) {
                    e = t(e);
                    var d = e[0] && e[0].getAscendant("table"),
                        b;
                    a: {
                        var c = 0;b = e.length - 1;
                        for (var a = {}, f, g; f = e[c++];) CKEDITOR.dom.element.setMarker(a, f, "delete_cell", !0);
                        for (c = 0; f = e[c++];)
                            if ((g = f.getPrevious()) && !g.getCustomData("delete_cell") || (g = f.getNext()) && !g.getCustomData("delete_cell")) {
                                CKEDITOR.dom.element.clearAllMarkers(a);
                                b = g;
                                break a
                            }
                        CKEDITOR.dom.element.clearAllMarkers(a);g = e[0].getParent();
                        (g = g.getPrevious()) ? b = g.getLast() : (g = e[b].getParent(), b = (g = g.getNext()) ? g.getChild(0) : null)
                    }
                    for (g = e.length - 1; 0 <= g; g--) x(e[g]);
                    b ? q(b, !0) : d && d.remove()
                } else e instanceof CKEDITOR.dom.element && (d = e.getParent(), 1 == d.getChildCount() ? d.remove() : e.remove())
            }

            function q(e, d) {
                var b = e.getDocument(),
                    c = CKEDITOR.document;
                CKEDITOR.env.ie && 10 == CKEDITOR.env.version && (c.focus(), b.focus());
                b = new CKEDITOR.dom.range(b);
                b["moveToElementEdit" + (d ? "End" : "Start")](e) || (b.selectNodeContents(e), b.collapse(d ? !1 : !0));
                b.select(!0)
            }

            function z(e, d, b) {
                e = e[d];
                if ("undefined" == typeof b) return e;
                for (d = 0; e && d < e.length; d++) {
                    if (b.is && e[d] == b.$) return d;
                    if (d == b) return new CKEDITOR.dom.element(e[d])
                }
                return b.is ? -1 : null
            }

            function w(e, d, b) {
                var c = t(e),
                    a;
                if ((d ? 1 != c.length : 2 > c.length) || (a = e.getCommonAncestor()) && a.type == CKEDITOR.NODE_ELEMENT && a.is("table")) return !1;
                var f;
                e = c[0];
                a = e.getAscendant("table");
                var g = CKEDITOR.tools.buildTableMap(a),
                    h = g.length,
                    k = g[0].length,
                    l = e.getParent().$.rowIndex,
                    n = z(g, l, e);
                if (d) {
                    var r;
                    try {
                        var q = parseInt(e.getAttribute("rowspan"), 10) || 1;
                        f = parseInt(e.getAttribute("colspan"), 10) || 1;
                        r = g["up" == d ? l - q : "down" == d ? l + q : l]["left" == d ? n - f : "right" == d ? n + f : n]
                    } catch (D) {
                        return !1
                    }
                    if (!r || e.$ == r) return !1;
                    c["up" == d || "left" == d ? "unshift" : "push"](new CKEDITOR.dom.element(r))
                }
                d = e.getDocument();
                var p = l,
                    q = r = 0,
                    u = !b && new CKEDITOR.dom.documentFragment(d),
                    w = 0;
                for (d = 0; d < c.length; d++) {
                    f = c[d];
                    var m = f.getParent(),
                        x = f.getFirst(),
                        v = f.$.colSpan,
                        y = f.$.rowSpan,
                        m = m.$.rowIndex,
                        A = z(g, m, f),
                        w = w + v * y,
                        q = Math.max(q, A - n + v);
                    r = Math.max(r, m - l + y);
                    b || (v = f, (y = v.getBogus()) && y.remove(), v.trim(), f.getChildren().count() && (m == p || !x || x.isBlockBoundary && x.isBlockBoundary({
                        br: 1
                    }) || (p = u.getLast(CKEDITOR.dom.walker.whitespaces(!0)), !p || p.is && p.is("br") || u.append("br")), f.moveChildren(u)), d ? f.remove() : f.setHtml(""));
                    p = m
                }
                if (b) return r * q == w;
                u.moveChildren(e);
                e.appendBogus();
                q >= k ? e.removeAttribute("rowSpan") : e.$.rowSpan = r;
                r >= h ? e.removeAttribute("colSpan") : e.$.colSpan = q;
                b = new CKEDITOR.dom.nodeList(a.$.rows);
                c = b.count();
                for (d = c - 1; 0 <= d; d--) a = b.getItem(d), a.$.cells.length || (a.remove(), c++);
                return e
            }

            function A(e, d) {
                var b = t(e);
                if (1 < b.length) return !1;
                if (d) return !0;
                var b = b[0],
                    c = b.getParent(),
                    a = c.getAscendant("table"),
                    f = CKEDITOR.tools.buildTableMap(a),
                    g = c.$.rowIndex,
                    h = z(f, g, b),
                    k = b.$.rowSpan,
                    l;
                if (1 < k) {
                    l = Math.ceil(k / 2);
                    for (var k = Math.floor(k / 2), c = g + l, a = new CKEDITOR.dom.element(a.$.rows[c]), f = z(f, c), n, c = b.clone(), g = 0; g < f.length; g++)
                        if (n = f[g], n.parentNode == a.$ && g > h) {
                            c.insertBefore(new CKEDITOR.dom.element(n));
                            break
                        } else n = null;
                    n || a.append(c)
                } else
                    for (k = l = 1, a = c.clone(), a.insertAfter(c), a.append(c = b.clone()), n = z(f, g), h = 0; h < n.length; h++) n[h].rowSpan++;
                c.appendBogus();
                b.$.rowSpan = l;
                c.$.rowSpan = k;
                1 == l && b.removeAttribute("rowSpan");
                1 == k && c.removeAttribute("rowSpan");
                return c
            }

            function B(e, d) {
                var b = t(e);
                if (1 < b.length) return !1;
                if (d) return !0;
                var b = b[0],
                    c = b.getParent(),
                    a = c.getAscendant("table"),
                    a = CKEDITOR.tools.buildTableMap(a),
                    f = z(a, c.$.rowIndex, b),
                    g = b.$.colSpan;
                if (1 < g) c = Math.ceil(g / 2), g = Math.floor(g / 2);
                else {
                    for (var g = c = 1, h = [], k = 0; k < a.length; k++) {
                        var l = a[k];
                        h.push(l[f]);
                        1 < l[f].rowSpan && (k += l[f].rowSpan - 1)
                    }
                    for (a = 0; a < h.length; a++) h[a].colSpan++
                }
                a = b.clone();
                a.insertAfter(b);
                a.appendBogus();
                b.$.colSpan = c;
                a.$.colSpan = g;
                1 == c && b.removeAttribute("colSpan");
                1 == g && a.removeAttribute("colSpan");
                return a
            }
            var C = /^(?:td|th)$/;
            CKEDITOR.plugins.tabletools = {
                requires: "table,dialog,contextmenu",
                init: function(e) {
                    function d(a) {
                        return CKEDITOR.tools.extend(a || {}, {
                            contextSensitive: 1,
                            refresh: function(a, b) {
                                this.setState(b.contains({
                                    td: 1,
                                    th: 1
                                }, 1) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
                            }
                        })
                    }

                    function b(a, b) {
                        var c = e.addCommand(a, b);
                        e.addFeature(c)
                    }
                    var c = e.lang.table;
                    b("cellProperties", new CKEDITOR.dialogCommand("cellProperties", d({
                        allowedContent: "td th{width,height,border-color,background-color,white-space,vertical-align,text-align}[colspan,rowspan]",
                        requiredContent: "table"
                    })));
                    CKEDITOR.dialog.add("cellProperties", this.path + "dialogs/tableCell.js");
                    b("rowDelete", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            q(u(a))
                        }
                    }));
                    b("rowInsertBefore", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            p(a, !0)
                        }
                    }));
                    b("rowInsertAfter", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            p(a)
                        }
                    }));
                    b("columnDelete", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            a = t(a);
                            var b = a[0],
                                c = a[a.length - 1];
                            a = b.getAscendant("table");
                            for (var d = CKEDITOR.tools.buildTableMap(a), e, l, n = [], r = 0, p = d.length; r < p; r++)
                                for (var m = 0, u = d[r].length; m < u; m++) d[r][m] == b.$ && (e = m), d[r][m] == c.$ && (l = m);
                            for (r = e; r <= l; r++)
                                for (m = 0; m < d.length; m++) c = d[m], b = new CKEDITOR.dom.element(a.$.rows[m]), c = new CKEDITOR.dom.element(c[r]), c.$ && (1 == c.$.colSpan ? c.remove() : --c.$.colSpan, m += c.$.rowSpan - 1, b.$.cells.length || n.push(b));
                            l = a.$.rows[0] && a.$.rows[0].cells;
                            e = new CKEDITOR.dom.element(l[e] || (e ? l[e - 1] : a.$.parentNode));
                            n.length == p && a.remove();
                            e && q(e, !0)
                        }
                    }));
                    b("columnInsertBefore", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            m(a, !0)
                        }
                    }));
                    b("columnInsertAfter", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            m(a)
                        }
                    }));
                    b("cellDelete", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            x(a)
                        }
                    }));
                    b("cellMerge", d({
                        allowedContent: "td[colspan,rowspan]",
                        requiredContent: "td[colspan,rowspan]",
                        exec: function(a) {
                            q(w(a.getSelection()), !0)
                        }
                    }));
                    b("cellMergeRight", d({
                        allowedContent: "td[colspan]",
                        requiredContent: "td[colspan]",
                        exec: function(a) {
                            q(w(a.getSelection(), "right"), !0)
                        }
                    }));
                    b("cellMergeDown", d({
                        allowedContent: "td[rowspan]",
                        requiredContent: "td[rowspan]",
                        exec: function(a) {
                            q(w(a.getSelection(), "down"), !0)
                        }
                    }));
                    b("cellVerticalSplit", d({
                        allowedContent: "td[rowspan]",
                        requiredContent: "td[rowspan]",
                        exec: function(a) {
                            q(B(a.getSelection()))
                        }
                    }));
                    b("cellHorizontalSplit", d({
                        allowedContent: "td[colspan]",
                        requiredContent: "td[colspan]",
                        exec: function(a) {
                            q(A(a.getSelection()))
                        }
                    }));
                    b("cellInsertBefore", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            y(a, !0)
                        }
                    }));
                    b("cellInsertAfter", d({
                        requiredContent: "table",
                        exec: function(a) {
                            a = a.getSelection();
                            y(a)
                        }
                    }));
                    e.addMenuItems && e.addMenuItems({
                        tablecell: {
                            label: c.cell.menu,
                            group: "tablecell",
                            order: 1,
                            getItems: function() {
                                var a = e.getSelection(),
                                    b = t(a);
                                return {
                                    tablecell_insertBefore: CKEDITOR.TRISTATE_OFF,
                                    tablecell_insertAfter: CKEDITOR.TRISTATE_OFF,
                                    tablecell_delete: CKEDITOR.TRISTATE_OFF,
                                    tablecell_merge: w(a, null, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                                    tablecell_merge_right: w(a, "right", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                                    tablecell_merge_down: w(a, "down", !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                                    tablecell_split_vertical: B(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                                    tablecell_split_horizontal: A(a, !0) ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED,
                                    tablecell_properties: 0 < b.length ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED
                                }
                            }
                        },
                        tablecell_insertBefore: {
                            label: c.cell.insertBefore,
                            group: "tablecell",
                            command: "cellInsertBefore",
                            order: 5
                        },
                        tablecell_insertAfter: {
                            label: c.cell.insertAfter,
                            group: "tablecell",
                            command: "cellInsertAfter",
                            order: 10
                        },
                        tablecell_delete: {
                            label: c.cell.deleteCell,
                            group: "tablecell",
                            command: "cellDelete",
                            order: 15
                        },
                        tablecell_merge: {
                            label: c.cell.merge,
                            group: "tablecell",
                            command: "cellMerge",
                            order: 16
                        },
                        tablecell_merge_right: {
                            label: c.cell.mergeRight,
                            group: "tablecell",
                            command: "cellMergeRight",
                            order: 17
                        },
                        tablecell_merge_down: {
                            label: c.cell.mergeDown,
                            group: "tablecell",
                            command: "cellMergeDown",
                            order: 18
                        },
                        tablecell_split_horizontal: {
                            label: c.cell.splitHorizontal,
                            group: "tablecell",
                            command: "cellHorizontalSplit",
                            order: 19
                        },
                        tablecell_split_vertical: {
                            label: c.cell.splitVertical,
                            group: "tablecell",
                            command: "cellVerticalSplit",
                            order: 20
                        },
                        tablecell_properties: {
                            label: c.cell.title,
                            group: "tablecellproperties",
                            command: "cellProperties",
                            order: 21
                        },
                        tablerow: {
                            label: c.row.menu,
                            group: "tablerow",
                            order: 1,
                            getItems: function() {
                                return {
                                    tablerow_insertBefore: CKEDITOR.TRISTATE_OFF,
                                    tablerow_insertAfter: CKEDITOR.TRISTATE_OFF,
                                    tablerow_delete: CKEDITOR.TRISTATE_OFF
                                }
                            }
                        },
                        tablerow_insertBefore: {
                            label: c.row.insertBefore,
                            group: "tablerow",
                            command: "rowInsertBefore",
                            order: 5
                        },
                        tablerow_insertAfter: {
                            label: c.row.insertAfter,
                            group: "tablerow",
                            command: "rowInsertAfter",
                            order: 10
                        },
                        tablerow_delete: {
                            label: c.row.deleteRow,
                            group: "tablerow",
                            command: "rowDelete",
                            order: 15
                        },
                        tablecolumn: {
                            label: c.column.menu,
                            group: "tablecolumn",
                            order: 1,
                            getItems: function() {
                                return {
                                    tablecolumn_insertBefore: CKEDITOR.TRISTATE_OFF,
                                    tablecolumn_insertAfter: CKEDITOR.TRISTATE_OFF,
                                    tablecolumn_delete: CKEDITOR.TRISTATE_OFF
                                }
                            }
                        },
                        tablecolumn_insertBefore: {
                            label: c.column.insertBefore,
                            group: "tablecolumn",
                            command: "columnInsertBefore",
                            order: 5
                        },
                        tablecolumn_insertAfter: {
                            label: c.column.insertAfter,
                            group: "tablecolumn",
                            command: "columnInsertAfter",
                            order: 10
                        },
                        tablecolumn_delete: {
                            label: c.column.deleteColumn,
                            group: "tablecolumn",
                            command: "columnDelete",
                            order: 15
                        }
                    });
                    e.contextMenu && e.contextMenu.addListener(function(a, b, c) {
                        return (a = c.contains({
                            td: 1,
                            th: 1
                        }, 1)) && !a.isReadOnly() ? {
                            tablecell: CKEDITOR.TRISTATE_OFF,
                            tablerow: CKEDITOR.TRISTATE_OFF,
                            tablecolumn: CKEDITOR.TRISTATE_OFF
                        } : null
                    })
                },
                getSelectedCells: t
            };
            CKEDITOR.plugins.add("tabletools", CKEDITOR.plugins.tabletools)
        })();
        CKEDITOR.tools.buildTableMap = function(t) {
            t = t.$.rows;
            for (var p = -1, u = [], v = 0; v < t.length; v++) {
                p++;
                !u[p] && (u[p] = []);
                for (var m = -1, y = 0; y < t[v].cells.length; y++) {
                    var x = t[v].cells[y];
                    for (m++; u[p][m];) m++;
                    for (var q = isNaN(x.colSpan) ? 1 : x.colSpan, x = isNaN(x.rowSpan) ? 1 : x.rowSpan, z = 0; z < x; z++) {
                        u[p + z] || (u[p + z] = []);
                        for (var w = 0; w < q; w++) u[p + z][m + w] = t[v].cells[y]
                    }
                    m += q - 1
                }
            }
            return u
        };
        (function() {
            var g = [CKEDITOR.CTRL + 90, CKEDITOR.CTRL + 89, CKEDITOR.CTRL + CKEDITOR.SHIFT + 90],
                n = {
                    8: 1,
                    46: 1
                };
            CKEDITOR.plugins.add("undo", {
                init: function(a) {
                    function b(a) {
                        d.enabled && !1 !== a.data.command.canUndo && d.save()
                    }

                    function c() {
                        d.enabled = a.readOnly ? !1 : "wysiwyg" == a.mode;
                        d.onChange()
                    }
                    var d = a.undoManager = new e(a),
                        l = d.editingHandler = new k(d),
                        f = a.addCommand("undo", {
                            exec: function() {
                                d.undo() && (a.selectionChange(), this.fire("afterUndo"))
                            },
                            startDisabled: !0,
                            canUndo: !1
                        }),
                        h = a.addCommand("redo", {
                            exec: function() {
                                d.redo() && (a.selectionChange(), this.fire("afterRedo"))
                            },
                            startDisabled: !0,
                            canUndo: !1
                        });
                    a.setKeystroke([
                        [g[0], "undo"],
                        [g[1], "redo"],
                        [g[2], "redo"]
                    ]);
                    d.onChange = function() {
                        f.setState(d.undoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED);
                        h.setState(d.redoable() ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED)
                    };
                    a.on("beforeCommandExec", b);
                    a.on("afterCommandExec", b);
                    a.on("saveSnapshot", function(a) {
                        d.save(a.data && a.data.contentOnly)
                    });
                    a.on("contentDom", l.attachListeners, l);
                    a.on("instanceReady", function() {
                        a.fire("saveSnapshot")
                    });
                    a.on("beforeModeUnload", function() {
                        "wysiwyg" == a.mode && d.save(!0)
                    });
                    a.on("mode", c);
                    a.on("readOnly", c);
                    a.ui.addButton && (a.ui.addButton("Undo", {
                        label: a.lang.undo.undo,
                        command: "undo",
                        toolbar: "undo,10"
                    }), a.ui.addButton("Redo", {
                        label: a.lang.undo.redo,
                        command: "redo",
                        toolbar: "undo,20"
                    }));
                    a.resetUndo = function() {
                        d.reset();
                        a.fire("saveSnapshot")
                    };
                    a.on("updateSnapshot", function() {
                        d.currentImage && d.update()
                    });
                    a.on("lockSnapshot", function(a) {
                        a = a.data;
                        d.lock(a && a.dontUpdate, a && a.forceUpdate)
                    });
                    a.on("unlockSnapshot", d.unlock, d)
                }
            });
            CKEDITOR.plugins.undo = {};
            var e = CKEDITOR.plugins.undo.UndoManager = function(a) {
                this.strokesRecorded = [0, 0];
                this.locked = null;
                this.previousKeyGroup = -1;
                this.limit = a.config.undoStackSize || 20;
                this.strokesLimit = 25;
                this.editor = a;
                this.reset()
            };
            e.prototype = {
                type: function(a, b) {
                    var c = e.getKeyGroup(a),
                        d = this.strokesRecorded[c] + 1;
                    b = b || d >= this.strokesLimit;
                    this.typing || (this.hasUndo = this.typing = !0, this.hasRedo = !1, this.onChange());
                    b ? (d = 0, this.editor.fire("saveSnapshot")) : this.editor.fire("change");
                    this.strokesRecorded[c] = d;
                    this.previousKeyGroup = c
                },
                keyGroupChanged: function(a) {
                    return e.getKeyGroup(a) != this.previousKeyGroup
                },
                reset: function() {
                    this.snapshots = [];
                    this.index = -1;
                    this.currentImage = null;
                    this.hasRedo = this.hasUndo = !1;
                    this.locked = null;
                    this.resetType()
                },
                resetType: function() {
                    this.strokesRecorded = [0, 0];
                    this.typing = !1;
                    this.previousKeyGroup = -1
                },
                refreshState: function() {
                    this.hasUndo = !!this.getNextImage(!0);
                    this.hasRedo = !!this.getNextImage(!1);
                    this.resetType();
                    this.onChange()
                },
                save: function(a, b, c) {
                    var d = this.editor;
                    if (this.locked || "ready" != d.status || "wysiwyg" != d.mode) return !1;
                    var e = d.editable();
                    if (!e || "ready" != e.status) return !1;
                    e = this.snapshots;
                    b || (b = new f(d));
                    if (!1 === b.contents) return !1;
                    if (this.currentImage)
                        if (b.equalsContent(this.currentImage)) {
                            if (a || b.equalsSelection(this.currentImage)) return !1
                        } else !1 !== c && d.fire("change");
                    e.splice(this.index + 1, e.length - this.index - 1);
                    e.length == this.limit && e.shift();
                    this.index = e.push(b) - 1;
                    this.currentImage = b;
                    !1 !== c && this.refreshState();
                    return !0
                },
                restoreImage: function(a) {
                    var b = this.editor,
                        c;
                    a.bookmarks && (b.focus(), c = b.getSelection());
                    this.locked = {
                        level: 999
                    };
                    this.editor.loadSnapshot(a.contents);
                    a.bookmarks ? c.selectBookmarks(a.bookmarks) : CKEDITOR.env.ie && (c = this.editor.document.getBody().$.createTextRange(), c.collapse(!0), c.select());
                    this.locked = null;
                    this.index = a.index;
                    this.currentImage = this.snapshots[this.index];
                    this.update();
                    this.refreshState();
                    b.fire("change")
                },
                getNextImage: function(a) {
                    var b = this.snapshots,
                        c = this.currentImage,
                        d;
                    if (c)
                        if (a)
                            for (d = this.index - 1; 0 <= d; d--) {
                                if (a = b[d], !c.equalsContent(a)) return a.index = d, a
                            } else
                                for (d = this.index + 1; d < b.length; d++)
                                    if (a = b[d], !c.equalsContent(a)) return a.index = d, a;
                    return null
                },
                redoable: function() {
                    return this.enabled && this.hasRedo
                },
                undoable: function() {
                    return this.enabled && this.hasUndo
                },
                undo: function() {
                    if (this.undoable()) {
                        this.save(!0);
                        var a = this.getNextImage(!0);
                        if (a) return this.restoreImage(a), !0
                    }
                    return !1
                },
                redo: function() {
                    if (this.redoable() && (this.save(!0), this.redoable())) {
                        var a = this.getNextImage(!1);
                        if (a) return this.restoreImage(a), !0
                    }
                    return !1
                },
                update: function(a) {
                    if (!this.locked) {
                        a || (a = new f(this.editor));
                        for (var b = this.index, c = this.snapshots; 0 < b && this.currentImage.equalsContent(c[b - 1]);) --b;
                        c.splice(b, this.index - b + 1, a);
                        this.index = b;
                        this.currentImage = a
                    }
                },
                updateSelection: function(a) {
                    if (!this.snapshots.length) return !1;
                    var b = this.snapshots,
                        c = b[b.length - 1];
                    return c.equalsContent(a) && !c.equalsSelection(a) ? (this.currentImage = b[b.length - 1] = a, !0) : !1
                },
                lock: function(a, b) {
                    if (this.locked) this.locked.level++;
                    else if (a) this.locked = {
                        level: 1
                    };
                    else {
                        var c = null;
                        if (b) c = !0;
                        else {
                            var d = new f(this.editor, !0);
                            this.currentImage && this.currentImage.equalsContent(d) && (c = d)
                        }
                        this.locked = {
                            update: c,
                            level: 1
                        }
                    }
                },
                unlock: function() {
                    if (this.locked && !--this.locked.level) {
                        var a = this.locked.update;
                        this.locked = null;
                        if (!0 === a) this.update();
                        else if (a) {
                            var b = new f(this.editor, !0);
                            a.equalsContent(b) || this.update()
                        }
                    }
                }
            };
            e.navigationKeyCodes = {
                37: 1,
                38: 1,
                39: 1,
                40: 1,
                36: 1,
                35: 1,
                33: 1,
                34: 1
            };
            e.keyGroups = {
                PRINTABLE: 0,
                FUNCTIONAL: 1
            };
            e.isNavigationKey = function(a) {
                return !!e.navigationKeyCodes[a]
            };
            e.getKeyGroup = function(a) {
                var b = e.keyGroups;
                return n[a] ? b.FUNCTIONAL : b.PRINTABLE
            };
            e.getOppositeKeyGroup = function(a) {
                var b = e.keyGroups;
                return a == b.FUNCTIONAL ? b.PRINTABLE : b.FUNCTIONAL
            };
            e.ieFunctionalKeysBug = function(a) {
                return CKEDITOR.env.ie && e.getKeyGroup(a) == e.keyGroups.FUNCTIONAL
            };
            var f = CKEDITOR.plugins.undo.Image = function(a, b) {
                    this.editor = a;
                    a.fire("beforeUndoImage");
                    var c = a.getSnapshot();
                    CKEDITOR.env.ie && c && (c = c.replace(/\s+data-cke-expando=".*?"/g, ""));
                    this.contents = c;
                    b || (this.bookmarks = (c = c && a.getSelection()) && c.createBookmarks2(!0));
                    a.fire("afterUndoImage")
                },
                h = /\b(?:href|src|name)="[^"]*?"/gi;
            f.prototype = {
                equalsContent: function(a) {
                    var b = this.contents;
                    a = a.contents;
                    CKEDITOR.env.ie && (CKEDITOR.env.ie7Compat || CKEDITOR.env.quirks) && (b = b.replace(h, ""), a = a.replace(h, ""));
                    return b != a ? !1 : !0
                },
                equalsSelection: function(a) {
                    var b = this.bookmarks;
                    a = a.bookmarks;
                    if (b || a) {
                        if (!b || !a || b.length != a.length) return !1;
                        for (var c = 0; c < b.length; c++) {
                            var d = b[c],
                                e = a[c];
                            if (d.startOffset != e.startOffset || d.endOffset != e.endOffset || !CKEDITOR.tools.arrayCompare(d.start, e.start) || !CKEDITOR.tools.arrayCompare(d.end, e.end)) return !1
                        }
                    }
                    return !0
                }
            };
            var k = CKEDITOR.plugins.undo.NativeEditingHandler = function(a) {
                this.undoManager = a;
                this.ignoreInputEvent = !1;
                this.keyEventsStack = new m;
                this.lastKeydownImage = null
            };
            k.prototype = {
                onKeydown: function(a) {
                    var b = a.data.getKey();
                    if (229 !== b)
                        if (-1 < CKEDITOR.tools.indexOf(g, a.data.getKeystroke())) a.data.preventDefault();
                        else if (this.keyEventsStack.cleanUp(a), a = this.undoManager, this.keyEventsStack.getLast(b) || this.keyEventsStack.push(b), this.lastKeydownImage = new f(a.editor), e.isNavigationKey(b) || this.undoManager.keyGroupChanged(b))
                        if (a.strokesRecorded[0] || a.strokesRecorded[1]) a.save(!1, this.lastKeydownImage, !1), a.resetType()
                },
                onInput: function() {
                    if (this.ignoreInputEvent) this.ignoreInputEvent = !1;
                    else {
                        var a = this.keyEventsStack.getLast();
                        a || (a = this.keyEventsStack.push(0));
                        this.keyEventsStack.increment(a.keyCode);
                        this.keyEventsStack.getTotalInputs() >= this.undoManager.strokesLimit && (this.undoManager.type(a.keyCode, !0), this.keyEventsStack.resetInputs())
                    }
                },
                onKeyup: function(a) {
                    var b = this.undoManager;
                    a = a.data.getKey();
                    var c = this.keyEventsStack.getTotalInputs();
                    this.keyEventsStack.remove(a);
                    if (!(e.ieFunctionalKeysBug(a) && this.lastKeydownImage && this.lastKeydownImage.equalsContent(new f(b.editor, !0))))
                        if (0 < c) b.type(a);
                        else if (e.isNavigationKey(a)) this.onNavigationKey(!0)
                },
                onNavigationKey: function(a) {
                    var b = this.undoManager;
                    !a && b.save(!0, null, !1) || b.updateSelection(new f(b.editor));
                    b.resetType()
                },
                ignoreInputEventListener: function() {
                    this.ignoreInputEvent = !0
                },
                attachListeners: function() {
                    var a = this.undoManager.editor,
                        b = a.editable(),
                        c = this;
                    b.attachListener(b, "keydown", function(a) {
                        c.onKeydown(a);
                        if (e.ieFunctionalKeysBug(a.data.getKey())) c.onInput()
                    }, null, null, 999);
                    b.attachListener(b, CKEDITOR.env.ie ? "keypress" : "input", c.onInput, c, null, 999);
                    b.attachListener(b, "keyup", c.onKeyup, c, null, 999);
                    b.attachListener(b, "paste", c.ignoreInputEventListener, c, null, 999);
                    b.attachListener(b, "drop", c.ignoreInputEventListener, c, null, 999);
                    b.attachListener(b.isInline() ? b : a.document.getDocumentElement(), "click", function() {
                        c.onNavigationKey()
                    }, null, null, 999);
                    b.attachListener(this.undoManager.editor, "blur", function() {
                        c.keyEventsStack.remove(9)
                    }, null, null, 999)
                }
            };
            var m = CKEDITOR.plugins.undo.KeyEventsStack = function() {
                this.stack = []
            };
            m.prototype = {
                push: function(a) {
                    a = this.stack.push({
                        keyCode: a,
                        inputs: 0
                    });
                    return this.stack[a - 1]
                },
                getLastIndex: function(a) {
                    if ("number" != typeof a) return this.stack.length - 1;
                    for (var b = this.stack.length; b--;)
                        if (this.stack[b].keyCode == a) return b;
                    return -1
                },
                getLast: function(a) {
                    a = this.getLastIndex(a);
                    return -1 != a ? this.stack[a] : null
                },
                increment: function(a) {
                    this.getLast(a).inputs++
                },
                remove: function(a) {
                    a = this.getLastIndex(a); - 1 != a && this.stack.splice(a, 1)
                },
                resetInputs: function(a) {
                    if ("number" == typeof a) this.getLast(a).inputs = 0;
                    else
                        for (a = this.stack.length; a--;) this.stack[a].inputs = 0
                },
                getTotalInputs: function() {
                    for (var a = this.stack.length, b = 0; a--;) b += this.stack[a].inputs;
                    return b
                },
                cleanUp: function(a) {
                    a = a.data.$;
                    a.ctrlKey || a.metaKey || this.remove(17);
                    a.shiftKey || this.remove(16);
                    a.altKey || this.remove(18)
                }
            }
        })();
        CKEDITOR.plugins.add("wsc", {
            requires: "dialog",
            parseApi: function(a) {
                a.config.wsc_onFinish = "function" === typeof a.config.wsc_onFinish ? a.config.wsc_onFinish : function() {};
                a.config.wsc_onClose = "function" === typeof a.config.wsc_onClose ? a.config.wsc_onClose : function() {}
            },
            parseConfig: function(a) {
                a.config.wsc_customerId = a.config.wsc_customerId || CKEDITOR.config.wsc_customerId || "1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";
                a.config.wsc_customDictionaryIds = a.config.wsc_customDictionaryIds || CKEDITOR.config.wsc_customDictionaryIds || "";
                a.config.wsc_userDictionaryName = a.config.wsc_userDictionaryName || CKEDITOR.config.wsc_userDictionaryName || "";
                a.config.wsc_customLoaderScript = a.config.wsc_customLoaderScript || CKEDITOR.config.wsc_customLoaderScript;
                CKEDITOR.config.wsc_cmd = a.config.wsc_cmd || CKEDITOR.config.wsc_cmd || "spell";
                CKEDITOR.config.wsc_version = "v4.3.0-master-d769233";
                CKEDITOR.config.wsc_removeGlobalVariable = !0
            },
            init: function(a) {
                var b = CKEDITOR.env;
                this.parseConfig(a);
                this.parseApi(a);
                a.addCommand("checkspell", new CKEDITOR.dialogCommand("checkspell")).modes = {
                    wysiwyg: !CKEDITOR.env.opera && !CKEDITOR.env.air && document.domain == window.location.hostname && !(b.ie && (8 > b.version || b.quirks))
                };
                "undefined" == typeof a.plugins.scayt && a.ui.addButton && a.ui.addButton("SpellChecker", {
                    label: a.lang.wsc.toolbar,
                    click: function(a) {
                        var b = a.elementMode == CKEDITOR.ELEMENT_MODE_INLINE ? a.container.getText() : a.document.getBody().getText();
                        (b = b.replace(/\s/g, "")) ? a.execCommand("checkspell"): alert("Nothing to check!")
                    },
                    toolbar: "spellchecker,10"
                });
                CKEDITOR.dialog.add("checkspell", this.path + (CKEDITOR.env.ie && 7 >= CKEDITOR.env.version ? "dialogs/wsc_ie.js" : window.postMessage ? "dialogs/wsc.js" : "dialogs/wsc_ie.js"))
            }
        });
        CKEDITOR.config.plugins = "dialogui,dialog,about,a11yhelp,dialogadvtab,basicstyles,bidi,blockquote,clipboard,button,panelbutton,panel,floatpanel,colorbutton,colordialog,templates,menu,contextmenu,div,resize,toolbar,elementspath,enterkey,entities,popup,filebrowser,find,fakeobjects,flash,floatingspace,listblock,richcombo,font,forms,format,horizontalrule,htmlwriter,iframe,wysiwygarea,image,indent,indentblock,indentlist,smiley,justify,menubutton,language,link,list,liststyle,magicline,maximize,newpage,pagebreak,pastetext,pastefromword,preview,print,removeformat,save,selectall,showblocks,showborders,sourcearea,specialchar,scayt,stylescombo,tab,table,tabletools,undo,wsc";
        CKEDITOR.config.skin = "moono";
        (function() {
            var setIcons = function(icons, strip) {
                var path = CKEDITOR.getUrl("plugins/" + strip);
                icons = icons.split(",");
                for (var i = 0; i < icons.length; i++) CKEDITOR.skin.icons[icons[i]] = {
                    path: path,
                    offset: -icons[++i],
                    bgsize: icons[++i]
                }
            };
            if (CKEDITOR.env.hidpi) setIcons("about,0,,bold,24,,italic,48,,strike,72,,subscript,96,,superscript,120,,underline,144,,bidiltr,168,,bidirtl,192,,blockquote,216,,copy-rtl,240,,copy,264,,cut-rtl,288,,cut,312,,paste-rtl,336,,paste,360,,bgcolor,384,,textcolor,408,,templates-rtl,432,,templates,456,,creatediv,480,,find-rtl,504,,find,528,,replace,552,,flash,576,,button,600,,checkbox,624,,form,648,,hiddenfield,672,,imagebutton,696,,radio,720,,select-rtl,744,,select,768,,textarea-rtl,792,,textarea,816,,textfield-rtl,840,,textfield,864,,horizontalrule,888,,iframe,912,,image,936,,indent-rtl,960,,indent,984,,outdent-rtl,1008,,outdent,1032,,smiley,1056,,justifyblock,1080,,justifycenter,1104,,justifyleft,1128,,justifyright,1152,,language,1176,,anchor-rtl,1200,,anchor,1224,,link,1248,,unlink,1272,,bulletedlist-rtl,1296,,bulletedlist,1320,,numberedlist-rtl,1344,,numberedlist,1368,,maximize,1392,,newpage-rtl,1416,,newpage,1440,,pagebreak-rtl,1464,,pagebreak,1488,,pastetext-rtl,1512,,pastetext,1536,,pastefromword-rtl,1560,,pastefromword,1584,,preview-rtl,1608,,preview,1632,,print,1656,,removeformat,1680,,save,1704,,selectall,1728,,showblocks-rtl,1752,,showblocks,1776,,source-rtl,1800,,source,1824,,specialchar,1848,,scayt,1872,,table,1896,,redo-rtl,1920,,redo,1944,,undo-rtl,1968,,undo,1992,,spellchecker,2016,", "icons_hidpi.png");
            else setIcons("about,0,auto,bold,24,auto,italic,48,auto,strike,72,auto,subscript,96,auto,superscript,120,auto,underline,144,auto,bidiltr,168,auto,bidirtl,192,auto,blockquote,216,auto,copy-rtl,240,auto,copy,264,auto,cut-rtl,288,auto,cut,312,auto,paste-rtl,336,auto,paste,360,auto,bgcolor,384,auto,textcolor,408,auto,templates-rtl,432,auto,templates,456,auto,creatediv,480,auto,find-rtl,504,auto,find,528,auto,replace,552,auto,flash,576,auto,button,600,auto,checkbox,624,auto,form,648,auto,hiddenfield,672,auto,imagebutton,696,auto,radio,720,auto,select-rtl,744,auto,select,768,auto,textarea-rtl,792,auto,textarea,816,auto,textfield-rtl,840,auto,textfield,864,auto,horizontalrule,888,auto,iframe,912,auto,image,936,auto,indent-rtl,960,auto,indent,984,auto,outdent-rtl,1008,auto,outdent,1032,auto,smiley,1056,auto,justifyblock,1080,auto,justifycenter,1104,auto,justifyleft,1128,auto,justifyright,1152,auto,language,1176,auto,anchor-rtl,1200,auto,anchor,1224,auto,link,1248,auto,unlink,1272,auto,bulletedlist-rtl,1296,auto,bulletedlist,1320,auto,numberedlist-rtl,1344,auto,numberedlist,1368,auto,maximize,1392,auto,newpage-rtl,1416,auto,newpage,1440,auto,pagebreak-rtl,1464,auto,pagebreak,1488,auto,pastetext-rtl,1512,auto,pastetext,1536,auto,pastefromword-rtl,1560,auto,pastefromword,1584,auto,preview-rtl,1608,auto,preview,1632,auto,print,1656,auto,removeformat,1680,auto,save,1704,auto,selectall,1728,auto,showblocks-rtl,1752,auto,showblocks,1776,auto,source-rtl,1800,auto,source,1824,auto,specialchar,1848,auto,scayt,1872,auto,table,1896,auto,redo-rtl,1920,auto,redo,1944,auto,undo-rtl,1968,auto,undo,1992,auto,spellchecker,2016,auto", "icons.png")
        })();
        CKEDITOR.lang.languages = {
            af: 1,
            sq: 1,
            ar: 1,
            eu: 1,
            bn: 1,
            bs: 1,
            bg: 1,
            ca: 1,
            "zh-cn": 1,
            zh: 1,
            hr: 1,
            cs: 1,
            da: 1,
            nl: 1,
            en: 1,
            "en-au": 1,
            "en-ca": 1,
            "en-gb": 1,
            eo: 1,
            et: 1,
            fo: 1,
            fi: 1,
            fr: 1,
            "fr-ca": 1,
            gl: 1,
            ka: 1,
            de: 1,
            "de-ch": 1,
            el: 1,
            gu: 1,
            he: 1,
            hi: 1,
            hu: 1,
            is: 1,
            id: 1,
            it: 1,
            ja: 1,
            km: 1,
            ko: 1,
            ku: 1,
            lv: 1,
            lt: 1,
            mk: 1,
            ms: 1,
            mn: 1,
            no: 1,
            nb: 1,
            fa: 1,
            pl: 1,
            "pt-br": 1,
            pt: 1,
            ro: 1,
            ru: 1,
            sr: 1,
            "sr-latn": 1,
            si: 1,
            sk: 1,
            sl: 1,
            es: 1,
            sv: 1,
            tt: 1,
            th: 1,
            tr: 1,
            ug: 1,
            uk: 1,
            vi: 1,
            cy: 1
        }
    })();
    CKEDITOR.disableAutoInline = true
});
define("jquery.ui.dialog", ["jquery", "require"], function(jQuery, require) {
    require("jquery.ui.widget");
    require("jquery.ui.button");
    require("jquery.ui.draggable");
    require("jquery.ui.mouse");
    require("jquery.ui.position");
    require("jquery.ui.resizable");
    (function($, undefined) {
        $.widget("ui.dialog", {
            version: "@VERSION",
            options: {
                appendTo: "body",
                autoOpen: true,
                buttons: [],
                closeOnEscape: true,
                closeText: "Close",
                dialogClass: "",
                draggable: true,
                hide: null,
                height: "auto",
                maxHeight: null,
                maxWidth: null,
                minHeight: 150,
                minWidth: 150,
                modal: false,
                position: {
                    my: "center",
                    at: "center",
                    of: window,
                    collision: "fit",
                    using: function(pos) {
                        var topOffset = $(this).css(pos).offset().top;
                        if (topOffset < 0) {
                            $(this).css("top", pos.top - topOffset)
                        }
                    }
                },
                resizable: true,
                show: null,
                title: null,
                width: 300,
                beforeClose: null,
                close: null,
                drag: null,
                dragStart: null,
                dragStop: null,
                focus: null,
                open: null,
                resize: null,
                resizeStart: null,
                resizeStop: null
            },
            sizeRelatedOptions: {
                buttons: true,
                height: true,
                maxHeight: true,
                maxWidth: true,
                minHeight: true,
                minWidth: true,
                width: true
            },
            resizableRelatedOptions: {
                maxHeight: true,
                maxWidth: true,
                minHeight: true,
                minWidth: true
            },
            _create: function() {
                this.originalCss = {
                    display: this.element[0].style.display,
                    width: this.element[0].style.width,
                    minHeight: this.element[0].style.minHeight,
                    maxHeight: this.element[0].style.maxHeight,
                    height: this.element[0].style.height
                };
                this.originalPosition = {
                    parent: this.element.parent(),
                    index: this.element.parent().children().index(this.element)
                };
                this.originalTitle = this.element.attr("title");
                this.options.title = this.options.title || this.originalTitle;
                this._createWrapper();
                this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog);
                this._createTitlebar();
                this._createButtonPane();
                if (this.options.draggable && $.fn.draggable) {
                    this._makeDraggable()
                }
                if (this.options.resizable && $.fn.resizable) {
                    this._makeResizable()
                }
                this._isOpen = false;
                this._trackFocus()
            },
            _init: function() {
                if (this.options.autoOpen) {
                    this.open()
                }
            },
            _appendTo: function() {
                var element = this.options.appendTo;
                if (element && (element.jquery || element.nodeType)) {
                    return $(element)
                }
                return this.document.find(element || "body").eq(0)
            },
            _destroy: function() {
                var next, originalPosition = this.originalPosition;
                this._destroyOverlay();
                this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach();
                this.uiDialog.stop(true, true).remove();
                if (this.originalTitle) {
                    this.element.attr("title", this.originalTitle)
                }
                next = originalPosition.parent.children().eq(originalPosition.index);
                if (next.length && next[0] !== this.element[0]) {
                    next.before(this.element)
                } else {
                    originalPosition.parent.append(this.element)
                }
            },
            widget: function() {
                return this.uiDialog
            },
            disable: $.noop,
            enable: $.noop,
            close: function(event) {
                var activeElement, that = this;
                if (!this._isOpen || this._trigger("beforeClose", event) === false) {
                    return
                }
                this._isOpen = false;
                this._focusedElement = null;
                this._destroyOverlay();
                this._untrackInstance();
                if (!this.opener.filter(":focusable").focus().length) {
                    try {
                        activeElement = this.document[0].activeElement;
                        if (activeElement && activeElement.nodeName.toLowerCase() !== "body") {
                            $(activeElement).blur()
                        }
                    } catch (error) {}
                }
                this._hide(this.uiDialog, this.options.hide, function() {
                    that._trigger("close", event)
                })
            },
            isOpen: function() {
                return this._isOpen
            },
            moveToTop: function() {
                this._moveToTop()
            },
            _moveToTop: function(event, silent) {
                var moved = false,
                    zIndicies = this.uiDialog.siblings(".ui-front:visible").map(function() {
                        return +$(this).css("z-index")
                    }).get(),
                    zIndexMax = Math.max.apply(null, zIndicies);
                if (zIndexMax >= +this.uiDialog.css("z-index")) {
                    this.uiDialog.css("z-index", zIndexMax + 1);
                    moved = true
                }
                if (moved && !silent) {
                    this._trigger("focus", event)
                }
                return moved
            },
            open: function() {
                var that = this;
                if (this._isOpen) {
                    if (this._moveToTop()) {
                        this._focusTabbable()
                    }
                    return
                }
                this._isOpen = true;
                this.opener = $(this.document[0].activeElement);
                this._size();
                this._position();
                this._createOverlay();
                this._moveToTop(null, true);
                this._show(this.uiDialog, this.options.show, function() {
                    that._focusTabbable();
                    that._trigger("focus")
                });
                this._trigger("open")
            },
            _focusTabbable: function() {
                var hasFocus = this._focusedElement;
                if (!hasFocus) {
                    hasFocus = this.element.find("[autofocus]")
                }
                if (!hasFocus.length) {
                    hasFocus = this.element.find(":tabbable")
                }
                if (!hasFocus.length) {
                    hasFocus = this.uiDialogButtonPane.find(":tabbable")
                }
                if (!hasFocus.length) {
                    hasFocus = this.uiDialogTitlebarClose.filter(":tabbable")
                }
                if (!hasFocus.length) {
                    hasFocus = this.uiDialog
                }
                hasFocus.eq(0).focus()
            },
            _keepFocus: function(event) {
                function checkFocus() {
                    var activeElement = this.document[0].activeElement,
                        isActive = this.uiDialog[0] === activeElement || $.contains(this.uiDialog[0], activeElement);
                    if (!isActive) {
                        this._focusTabbable()
                    }
                }
                event.preventDefault();
                checkFocus.call(this);
                this._delay(checkFocus)
            },
            _createWrapper: function() {
                this.uiDialog = $("<div>").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front " + this.options.dialogClass).hide().attr({
                    tabIndex: -1,
                    role: "dialog"
                }).appendTo(this._appendTo());
                this._on(this.uiDialog, {
                    keydown: function(event) {
                        if (this.options.closeOnEscape && !event.isDefaultPrevented() && event.keyCode && event.keyCode === $.ui.keyCode.ESCAPE) {
                            event.preventDefault();
                            this.close(event);
                            return
                        }
                        if (event.keyCode !== $.ui.keyCode.TAB) {
                            return
                        }
                        var tabbables = this.uiDialog.find(":tabbable"),
                            first = tabbables.filter(":first"),
                            last = tabbables.filter(":last");
                        if ((event.target === last[0] || event.target === this.uiDialog[0]) && !event.shiftKey) {
                            first.focus(1);
                            event.preventDefault()
                        } else if ((event.target === first[0] || event.target === this.uiDialog[0]) && event.shiftKey) {
                            last.focus(1);
                            event.preventDefault()
                        }
                    },
                    mousedown: function(event) {
                        if (this._moveToTop(event)) {
                            this._focusTabbable()
                        }
                    }
                });
                if (!this.element.find("[aria-describedby]").length) {
                    this.uiDialog.attr({
                        "aria-describedby": this.element.uniqueId().attr("id")
                    })
                }
            },
            _createTitlebar: function() {
                var uiDialogTitle;
                this.uiDialogTitlebar = $("<div>").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog);
                this._on(this.uiDialogTitlebar, {
                    mousedown: function(event) {
                        if (!$(event.target).closest(".ui-dialog-titlebar-close")) {
                            this.uiDialog.focus()
                        }
                    }
                });
                this.uiDialogTitlebarClose = $("<button type='button'></button>").button({
                    label: this.options.closeText,
                    icons: {
                        primary: "ui-icon-closethick"
                    },
                    text: false
                }).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar);
                this._on(this.uiDialogTitlebarClose, {
                    click: function(event) {
                        event.preventDefault();
                        this.close(event)
                    }
                });
                uiDialogTitle = $("<span>").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar);
                this._title(uiDialogTitle);
                this.uiDialog.attr({
                    "aria-labelledby": uiDialogTitle.attr("id")
                })
            },
            _title: function(title) {
                if (!this.options.title) {
                    title.html("&#160;")
                }
                title.text(this.options.title)
            },
            _createButtonPane: function() {
                this.uiDialogButtonPane = $("<div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");
                this.uiButtonSet = $("<div>").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane);
                this._createButtons()
            },
            _createButtons: function() {
                var that = this,
                    buttons = this.options.buttons;
                this.uiDialogButtonPane.remove();
                this.uiButtonSet.empty();
                if ($.isEmptyObject(buttons) || $.isArray(buttons) && !buttons.length) {
                    this.uiDialog.removeClass("ui-dialog-buttons");
                    return
                }
                $.each(buttons, function(name, props) {
                    var click, buttonOptions;
                    props = $.isFunction(props) ? {
                        click: props,
                        text: name
                    } : props;
                    props = $.extend({
                        type: "button"
                    }, props);
                    click = props.click;
                    props.click = function() {
                        click.apply(that.element[0], arguments)
                    };
                    buttonOptions = {
                        icons: props.icons,
                        text: props.showText
                    };
                    delete props.icons;
                    delete props.showText;
                    $("<button></button>", props).button(buttonOptions).appendTo(that.uiButtonSet)
                });
                this.uiDialog.addClass("ui-dialog-buttons");
                this.uiDialogButtonPane.appendTo(this.uiDialog)
            },
            _makeDraggable: function() {
                var that = this,
                    options = this.options;

                function filteredUi(ui) {
                    return {
                        position: ui.position,
                        offset: ui.offset
                    }
                }
                this.uiDialog.draggable({
                    cancel: ".ui-dialog-content, .ui-dialog-titlebar-close",
                    handle: ".ui-dialog-titlebar",
                    containment: "document",
                    start: function(event, ui) {
                        $(this).addClass("ui-dialog-dragging");
                        that._blockFrames();
                        that._trigger("dragStart", event, filteredUi(ui))
                    },
                    drag: function(event, ui) {
                        that._trigger("drag", event, filteredUi(ui))
                    },
                    stop: function(event, ui) {
                        var left = ui.offset.left - that.document.scrollLeft(),
                            top = ui.offset.top - that.document.scrollTop();
                        options.position = {
                            my: "left top",
                            at: "left" + (left >= 0 ? "+" : "") + left + " " + "top" + (top >= 0 ? "+" : "") + top,
                            of: that.window
                        };
                        $(this).removeClass("ui-dialog-dragging");
                        that._unblockFrames();
                        that._trigger("dragStop", event, filteredUi(ui))
                    }
                })
            },
            _makeResizable: function() {
                var that = this,
                    options = this.options,
                    handles = options.resizable,
                    position = this.uiDialog.css("position"),
                    resizeHandles = typeof handles === "string" ? handles : "n,e,s,w,se,sw,ne,nw";

                function filteredUi(ui) {
                    return {
                        originalPosition: ui.originalPosition,
                        originalSize: ui.originalSize,
                        position: ui.position,
                        size: ui.size
                    }
                }
                this.uiDialog.resizable({
                    cancel: ".ui-dialog-content",
                    containment: "document",
                    alsoResize: this.element,
                    maxWidth: options.maxWidth,
                    maxHeight: options.maxHeight,
                    minWidth: options.minWidth,
                    minHeight: this._minHeight(),
                    handles: resizeHandles,
                    start: function(event, ui) {
                        $(this).addClass("ui-dialog-resizing");
                        that._blockFrames();
                        that._trigger("resizeStart", event, filteredUi(ui))
                    },
                    resize: function(event, ui) {
                        that._trigger("resize", event, filteredUi(ui))
                    },
                    stop: function(event, ui) {
                        var offset = that.uiDialog.offset(),
                            left = offset.left - that.document.scrollLeft(),
                            top = offset.top - that.document.scrollTop();
                        options.height = that.uiDialog.height();
                        options.width = that.uiDialog.width();
                        options.position = {
                            my: "left top",
                            at: "left" + (left >= 0 ? "+" : "") + left + " " + "top" + (top >= 0 ? "+" : "") + top,
                            of: that.window
                        };
                        $(this).removeClass("ui-dialog-resizing");
                        that._unblockFrames();
                        that._trigger("resizeStop", event, filteredUi(ui))
                    }
                }).css("position", position)
            },
            _trackFocus: function() {
                this._on(this.widget(), {
                    focusin: function(event) {
                        this._untrackInstance();
                        this._trackingInstances().unshift(this);
                        this._focusedElement = $(event.target)
                    }
                })
            },
            _untrackInstance: function() {
                var instances = this._trackingInstances(),
                    exists = $.inArray(this, instances);
                if (exists !== -1) {
                    instances.splice(exists, 1)
                }
            },
            _trackingInstances: function() {
                var instances = this.document.data("ui-dialog-instances");
                if (!instances) {
                    instances = [];
                    this.document.data("ui-dialog-instances", instances)
                }
                return instances
            },
            _minHeight: function() {
                var options = this.options;
                return options.height === "auto" ? options.minHeight : Math.min(options.minHeight, options.height)
            },
            _position: function() {
                var isVisible = this.uiDialog.is(":visible");
                if (!isVisible) {
                    this.uiDialog.show()
                }
                this.uiDialog.position(this.options.position);
                if (!isVisible) {
                    this.uiDialog.hide()
                }
            },
            _setOptions: function(options) {
                var that = this,
                    resize = false,
                    resizableOptions = {};
                $.each(options, function(key, value) {
                    that._setOption(key, value);
                    if (key in that.sizeRelatedOptions) {
                        resize = true
                    }
                    if (key in that.resizableRelatedOptions) {
                        resizableOptions[key] = value
                    }
                });
                if (resize) {
                    this._size();
                    this._position()
                }
                if (this.uiDialog.is(":data(ui-resizable)")) {
                    this.uiDialog.resizable("option", resizableOptions)
                }
            },
            _setOption: function(key, value) {
                var isDraggable, isResizable, uiDialog = this.uiDialog;
                if (key === "dialogClass") {
                    uiDialog.removeClass(this.options.dialogClass).addClass(value)
                }
                if (key === "disabled") {
                    return
                }
                this._super(key, value);
                if (key === "appendTo") {
                    this.uiDialog.appendTo(this._appendTo())
                }
                if (key === "buttons") {
                    this._createButtons()
                }
                if (key === "closeText") {
                    this.uiDialogTitlebarClose.button({
                        label: "" + value
                    })
                }
                if (key === "draggable") {
                    isDraggable = uiDialog.is(":data(ui-draggable)");
                    if (isDraggable && !value) {
                        uiDialog.draggable("destroy")
                    }
                    if (!isDraggable && value) {
                        this._makeDraggable()
                    }
                }
                if (key === "position") {
                    this._position()
                }
                if (key === "resizable") {
                    isResizable = uiDialog.is(":data(ui-resizable)");
                    if (isResizable && !value) {
                        uiDialog.resizable("destroy")
                    }
                    if (isResizable && typeof value === "string") {
                        uiDialog.resizable("option", "handles", value)
                    }
                    if (!isResizable && value !== false) {
                        this._makeResizable()
                    }
                }
                if (key === "title") {
                    this._title(this.uiDialogTitlebar.find(".ui-dialog-title"))
                }
            },
            _size: function() {
                var nonContentHeight, minContentHeight, maxContentHeight, options = this.options;
                this.element.show().css({
                    width: "auto",
                    minHeight: 0,
                    maxHeight: "none",
                    height: 0
                });
                if (options.minWidth > options.width) {
                    options.width = options.minWidth
                }
                nonContentHeight = this.uiDialog.css({
                    height: "auto",
                    width: options.width
                }).outerHeight();
                minContentHeight = Math.max(0, options.minHeight - nonContentHeight);
                maxContentHeight = typeof options.maxHeight === "number" ? Math.max(0, options.maxHeight - nonContentHeight) : "none";
                if (options.height === "auto") {
                    this.element.css({
                        minHeight: minContentHeight,
                        maxHeight: maxContentHeight,
                        height: "auto"
                    })
                } else {
                    this.element.height(Math.max(0, options.height - nonContentHeight))
                }
                if (this.uiDialog.is(":data(ui-resizable)")) {
                    this.uiDialog.resizable("option", "minHeight", this._minHeight())
                }
            },
            _blockFrames: function() {
                this.iframeBlocks = this.document.find("iframe").map(function() {
                    var iframe = $(this);
                    return $("<div>").css({
                        position: "absolute",
                        width: iframe.outerWidth(),
                        height: iframe.outerHeight()
                    }).appendTo(iframe.parent()).offset(iframe.offset())[0]
                })
            },
            _unblockFrames: function() {
                if (this.iframeBlocks) {
                    this.iframeBlocks.remove();
                    delete this.iframeBlocks
                }
            },
            _allowInteraction: function(event) {
                if ($(event.target).closest(".ui-dialog").length) {
                    return true
                }
                return !!$(event.target).closest(".ui-datepicker").length
            },
            _createOverlay: function() {
                if (!this.options.modal) {
                    return
                }
                var isOpening = true;
                this._delay(function() {
                    isOpening = false
                });
                if (!this.document.data("ui-dialog-overlays")) {
                    this._on(this.document, {
                        focusin: function(event) {
                            if (isOpening) {
                                return
                            }
                            if (!this._allowInteraction(event)) {
                                event.preventDefault();
                                this._trackingInstances()[0]._focusTabbable()
                            }
                        }
                    })
                }
                this.overlay = $("<div>").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo());
                this._on(this.overlay, {
                    mousedown: "_keepFocus"
                });
                this.document.data("ui-dialog-overlays", (this.document.data("ui-dialog-overlays") || 0) + 1)
            },
            _destroyOverlay: function() {
                if (!this.options.modal) {
                    return
                }
                if (this.overlay) {
                    var overlays = this.document.data("ui-dialog-overlays") - 1;
                    if (!overlays) {
                        this.document.off("focusin").removeData("ui-dialog-overlays")
                    } else {
                        this.document.data("ui-dialog-overlays", overlays)
                    }
                    this.overlay.remove();
                    this.overlay = null
                }
            }
        })
    })(jQuery);
    return jQuery
});
define("ankama.ui.dialog", ["jquery", "require"], function(jQuery, require) {
    require("jquery.ui.dialog");
    (function(window, undefined) {
        var $ = require("jquery"),
            _ = require("lodash");
        $.widget("ankama.ak_dialog", $.ui.dialog, {
            options: {
                autoOpen: true,
                width: "90%",
                maxHeight: "90%",
                modal: false,
                fluid: true,
                closeOnClick: true,
                resizable: false,
                draggable: false,
                position: {
                    my: "center",
                    at: "center",
                    of: window
                }
            },
            _destroy: function() {
                if (this.options.closeOnClick && this.overlay) {
                    this.overlay.off("click")
                }
                this._superApply(arguments)
            },
            _create: function() {
                this._superApply(arguments)
            },
            _init: function() {
                this._initMaxheight();
                this._superApply(arguments)
            },
            _iPercentMaxHeight: null,
            _initMaxheight: function() {
                if ("maxHeight" in this.options && typeof this.options.maxHeight.indexOf === "function" && this.options.maxHeight.indexOf("%") !== -1) {
                    this._iPercentMaxHeight = parseInt(this.options.maxHeight, 10);
                    this.options.maxHeight = $(window).height() * this._iPercentMaxHeight / 100
                }
            },
            open: function() {
                var self = this;
                this._superApply(arguments);
                if (self.options.fluid) {
                    var iResizeTimer = null;
                    $(window).on("resize.responsive", function() {
                        clearTimeout(iResizeTimer);
                        iResizeTimer = setTimeout(function() {
                            iResizeTimer = null;
                            self.refreshDimensions()
                        }, 100)
                    })
                }
                self.refreshDimensions()
            },
            refreshDimensions: function() {
                var self = this;
                if (self.options.maxWidth && self.options.width) {
                    self.uiDialog.css("max-width", self.options.maxWidth)
                }
                self.element.ak_dialog("option", "maxHeight", self.options.maxHeight + $(".ui-dialog-titlebar", this.element.closest(".ui-dialog")).outerHeight());
                self.option("position", self.options.position)
            },
            close: function() {
                this._superApply();
                $(window).off("resize.responsive")
            },
            _createOverlay: function() {
                var self = this;
                self._superApply();
                if (self.options.mask !== true) return;
                if (self.options.modal) {
                    var baseZIndex = +self.overlay.css("zIndex");
                    self.overlay.css("zIndex", baseZIndex + $.ui.dialog.overlayInstances);
                    self.uiDialog.css("zIndex", +self.overlay.css("zIndex") + 1)
                }
                if (self.options.closeOnClick) {
                    self.overlay.on("click", function() {
                        self.close()
                    })
                }
            }
        })
    })(this);
    return jQuery
});
(function() {
    var FastClick = require("fastclick");
    FastClick(document.body);
    require("jquery.ankama")
})();
(function() {
    delete window.$;
    delete window.jQuery
})();
define("jquery.ui.widget", ["jquery", "require"], function(jQuery, require) {
    (function($, undefined) {
        $.ui = $.ui || {};
        $.extend($.ui, {
            version: "@VERSION",
            keyCode: {
                BACKSPACE: 8,
                COMMA: 188,
                DELETE: 46,
                DOWN: 40,
                END: 35,
                ENTER: 13,
                ESCAPE: 27,
                HOME: 36,
                LEFT: 37,
                PAGE_DOWN: 34,
                PAGE_UP: 33,
                PERIOD: 190,
                RIGHT: 39,
                SPACE: 32,
                TAB: 9,
                UP: 38
            }
        });
        $.fn.extend({
            focus: function(orig) {
                return function(delay, fn) {
                    return typeof delay === "number" ? this.each(function() {
                        var elem = this;
                        setTimeout(function() {
                            $(elem).focus();
                            if (fn) {
                                fn.call(elem)
                            }
                        }, delay)
                    }) : orig.apply(this, arguments)
                }
            }($.fn.focus),
            scrollParent: function() {
                var position = this.css("position"),
                    excludeStaticParent = position === "absolute",
                    scrollParent = this.parents().filter(function() {
                        var parent = $(this);
                        if (excludeStaticParent && parent.css("position") === "static") {
                            return false
                        }
                        return /(auto|scroll)/.test(parent.css("overflow") + parent.css("overflow-y") + parent.css("overflow-x"))
                    }).eq(0);
                return position === "fixed" || !scrollParent.length ? $(this[0].ownerDocument || document) : scrollParent
            },
            uniqueId: function() {
                var uuid = 0;
                return function() {
                    return this.each(function() {
                        if (!this.id) {
                            this.id = "ui-id-" + ++uuid
                        }
                    })
                }
            }(),
            removeUniqueId: function() {
                return this.each(function() {
                    if (/^ui-id-\d+$/.test(this.id)) {
                        $(this).removeAttr("id")
                    }
                })
            }
        });

        function focusable(element, isTabIndexNotNaN) {
            var map, mapName, img, nodeName = element.nodeName.toLowerCase();
            if ("area" === nodeName) {
                map = element.parentNode;
                mapName = map.name;
                if (!element.href || !mapName || map.nodeName.toLowerCase() !== "map") {
                    return false
                }
                img = $("img[usemap=#" + mapName + "]")[0];
                return !!img && visible(img)
            }
            return (/input|select|textarea|button|object/.test(nodeName) ? !element.disabled : "a" === nodeName ? element.href || isTabIndexNotNaN : isTabIndexNotNaN) && visible(element)
        }

        function visible(element) {
            return $.expr.filters.visible(element) && !$(element).parents().addBack().filter(function() {
                return $.css(this, "visibility") === "hidden"
            }).length
        }
        $.extend($.expr[":"], {
            data: $.expr.createPseudo ? $.expr.createPseudo(function(dataName) {
                return function(elem) {
                    return !!$.data(elem, dataName)
                }
            }) : function(elem, i, match) {
                return !!$.data(elem, match[3])
            },
            focusable: function(element) {
                return focusable(element, !isNaN($.attr(element, "tabindex")))
            },
            tabbable: function(element) {
                var tabIndex = $.attr(element, "tabindex"),
                    isTabIndexNaN = isNaN(tabIndex);
                return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN)
            }
        });
        if (!$("<a>").outerWidth(1).jquery) {
            $.each(["Width", "Height"], function(i, name) {
                var side = name === "Width" ? ["Left", "Right"] : ["Top", "Bottom"],
                    type = name.toLowerCase(),
                    orig = {
                        innerWidth: $.fn.innerWidth,
                        innerHeight: $.fn.innerHeight,
                        outerWidth: $.fn.outerWidth,
                        outerHeight: $.fn.outerHeight
                    };

                function reduce(elem, size, border, margin) {
                    $.each(side, function() {
                        size -= parseFloat($.css(elem, "padding" + this)) || 0;
                        if (border) {
                            size -= parseFloat($.css(elem, "border" + this + "Width")) || 0
                        }
                        if (margin) {
                            size -= parseFloat($.css(elem, "margin" + this)) || 0
                        }
                    });
                    return size
                }
                $.fn["inner" + name] = function(size) {
                    if (size === undefined) {
                        return orig["inner" + name].call(this)
                    }
                    return this.each(function() {
                        $(this).css(type, reduce(this, size) + "px")
                    })
                };
                $.fn["outer" + name] = function(size, margin) {
                    if (typeof size !== "number") {
                        return orig["outer" + name].call(this, size)
                    }
                    return this.each(function() {
                        $(this).css(type, reduce(this, size, true, margin) + "px")
                    })
                }
            })
        }
        if (!$.fn.addBack) {
            $.fn.addBack = function(selector) {
                return this.add(selector == null ? this.prevObject : this.prevObject.filter(selector))
            }
        }
        if ($("<a>").data("a-b", "a").removeData("a-b").data("a-b")) {
            $.fn.removeData = function(removeData) {
                return function(key) {
                    if (arguments.length) {
                        return removeData.call(this, $.camelCase(key))
                    } else {
                        return removeData.call(this)
                    }
                }
            }($.fn.removeData)
        }
        $.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());
        $.support.selectstart = "onselectstart" in document.createElement("div");
        $.fn.extend({
            disableSelection: function() {
                return this.bind(($.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function(event) {
                    event.preventDefault()
                })
            },
            enableSelection: function() {
                return this.unbind(".ui-disableSelection")
            },
            zIndex: function(zIndex) {
                if (zIndex !== undefined) {
                    return this.css("zIndex", zIndex)
                }
                if (this.length) {
                    var elem = $(this[0]),
                        position, value;
                    while (elem.length && elem[0] !== document) {
                        position = elem.css("position");
                        if (position === "absolute" || position === "relative" || position === "fixed") {
                            value = parseInt(elem.css("zIndex"), 10);
                            if (!isNaN(value) && value !== 0) {
                                return value
                            }
                        }
                        elem = elem.parent()
                    }
                }
                return 0
            }
        });
        $.ui.plugin = {
            add: function(module, option, set) {
                var i, proto = $.ui[module].prototype;
                for (i in set) {
                    proto.plugins[i] = proto.plugins[i] || [];
                    proto.plugins[i].push([option, set[i]])
                }
            },
            call: function(instance, name, args, allowDisconnected) {
                var i, set = instance.plugins[name];
                if (!set) {
                    return
                }
                if (!allowDisconnected && (!instance.element[0].parentNode || instance.element[0].parentNode.nodeType === 11)) {
                    return
                }
                for (i = 0; i < set.length; i++) {
                    if (instance.options[set[i][0]]) {
                        set[i][1].apply(instance.element, args)
                    }
                }
            }
        }
    })(jQuery);
    (function($, undefined) {
        var widget_uuid = 0,
            widget_slice = Array.prototype.slice;
        $.cleanData = function(orig) {
            return function(elems) {
                for (var i = 0, elem;
                    (elem = elems[i]) != null; i++) {
                    try {
                        $(elem).triggerHandler("remove")
                    } catch (e) {}
                }
                orig(elems)
            }
        }($.cleanData);
        $.widget = function(name, base, prototype) {
            var fullName, existingConstructor, constructor, basePrototype, proxiedPrototype = {},
                namespace = name.split(".")[0];
            name = name.split(".")[1];
            fullName = namespace + "-" + name;
            if (!prototype) {
                prototype = base;
                base = $.Widget
            }
            $.expr[":"][fullName.toLowerCase()] = function(elem) {
                return !!$.data(elem, fullName)
            };
            $[namespace] = $[namespace] || {};
            existingConstructor = $[namespace][name];
            constructor = $[namespace][name] = function(options, element) {
                if (!this._createWidget) {
                    return new constructor(options, element)
                }
                if (arguments.length) {
                    this._createWidget(options, element)
                }
            };
            $.extend(constructor, existingConstructor, {
                version: prototype.version,
                _proto: $.extend({}, prototype),
                _childConstructors: []
            });
            basePrototype = new base;
            basePrototype.options = $.widget.extend({}, basePrototype.options);
            $.each(prototype, function(prop, value) {
                if (!$.isFunction(value)) {
                    proxiedPrototype[prop] = value;
                    return
                }
                proxiedPrototype[prop] = function() {
                    var _super = function() {
                            return base.prototype[prop].apply(this, arguments)
                        },
                        _superApply = function(args) {
                            return base.prototype[prop].apply(this, args)
                        };
                    return function() {
                        var __super = this._super,
                            __superApply = this._superApply,
                            returnValue;
                        this._super = _super;
                        this._superApply = _superApply;
                        returnValue = value.apply(this, arguments);
                        this._super = __super;
                        this._superApply = __superApply;
                        return returnValue
                    }
                }()
            });
            constructor.prototype = $.widget.extend(basePrototype, {
                widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix || name : name
            }, proxiedPrototype, {
                constructor: constructor,
                namespace: namespace,
                widgetName: name,
                widgetFullName: fullName
            });
            if (existingConstructor) {
                $.each(existingConstructor._childConstructors, function(i, child) {
                    var childPrototype = child.prototype;
                    $.widget(childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto)
                });
                delete existingConstructor._childConstructors
            } else {
                base._childConstructors.push(constructor)
            }
            $.widget.bridge(name, constructor);
            return constructor
        };
        $.widget.extend = function(target) {
            var input = widget_slice.call(arguments, 1),
                inputIndex = 0,
                inputLength = input.length,
                key, value;
            for (; inputIndex < inputLength; inputIndex++) {
                for (key in input[inputIndex]) {
                    value = input[inputIndex][key];
                    if (input[inputIndex].hasOwnProperty(key) && value !== undefined) {
                        if ($.isPlainObject(value)) {
                            target[key] = $.isPlainObject(target[key]) ? $.widget.extend({}, target[key], value) : $.widget.extend({}, value)
                        } else {
                            target[key] = value
                        }
                    }
                }
            }
            return target
        };
        $.widget.bridge = function(name, object) {
            var fullName = object.prototype.widgetFullName || name;
            $.fn[name] = function(options) {
                var isMethodCall = typeof options === "string",
                    args = widget_slice.call(arguments, 1),
                    returnValue = this;
                options = !isMethodCall && args.length ? $.widget.extend.apply(null, [options].concat(args)) : options;
                if (isMethodCall) {
                    this.each(function() {
                        var methodValue, instance = $.data(this, fullName);
                        if (options === "instance") {
                            returnValue = instance;
                            return false
                        }
                        if (!instance) {
                            return $.error("cannot call methods on " + name + " prior to initialization; " + "attempted to call method '" + options + "'")
                        }
                        if (!$.isFunction(instance[options]) || options.charAt(0) === "_") {
                            return $.error("no such method '" + options + "' for " + name + " widget instance")
                        }
                        methodValue = instance[options].apply(instance, args);
                        if (methodValue !== instance && methodValue !== undefined) {
                            returnValue = methodValue && methodValue.jquery ? returnValue.pushStack(methodValue.get()) : methodValue;
                            return false
                        }
                    })
                } else {
                    this.each(function() {
                        var instance = $.data(this, fullName);
                        if (instance) {
                            instance.option(options || {});
                            if (instance._init) {
                                instance._init()
                            }
                        } else {
                            $.data(this, fullName, new object(options, this))
                        }
                    })
                }
                return returnValue
            }
        };
        $.Widget = function() {};
        $.Widget._childConstructors = [];
        $.Widget.prototype = {
            widgetName: "widget",
            widgetEventPrefix: "",
            defaultElement: "<div>",
            options: {
                disabled: false,
                create: null
            },
            _createWidget: function(options, element) {
                element = $(element || this.defaultElement || this)[0];
                this.element = $(element);
                this.uuid = widget_uuid++;
                this.eventNamespace = "." + this.widgetName + this.uuid;
                this.options = $.widget.extend({}, this.options, this._getCreateOptions(), options);
                this.bindings = $();
                this.hoverable = $();
                this.focusable = $();
                if (element !== this) {
                    $.data(element, this.widgetFullName, this);
                    this._on(true, this.element, {
                        remove: function(event) {
                            if (event.target === element) {
                                this.destroy()
                            }
                        }
                    });
                    this.document = $(element.style ? element.ownerDocument : element.document || element);
                    this.window = $(this.document[0].defaultView || this.document[0].parentWindow)
                }
                this._create();
                this._trigger("create", null, this._getCreateEventData());
                this._init()
            },
            _getCreateOptions: $.noop,
            _getCreateEventData: $.noop,
            _create: $.noop,
            _init: $.noop,
            destroy: function() {
                this._destroy();
                this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData($.camelCase(this.widgetFullName));
                this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName + "-disabled " + "ui-state-disabled");
                this.bindings.unbind(this.eventNamespace);
                this.hoverable.removeClass("ui-state-hover");
                this.focusable.removeClass("ui-state-focus")
            },
            _destroy: $.noop,
            widget: function() {
                return this.element
            },
            option: function(key, value) {
                var options = key,
                    parts, curOption, i;
                if (arguments.length === 0) {
                    return $.widget.extend({}, this.options)
                }
                if (typeof key === "string") {
                    options = {};
                    parts = key.split(".");
                    key = parts.shift();
                    if (parts.length) {
                        curOption = options[key] = $.widget.extend({}, this.options[key]);
                        for (i = 0; i < parts.length - 1; i++) {
                            curOption[parts[i]] = curOption[parts[i]] || {};
                            curOption = curOption[parts[i]]
                        }
                        key = parts.pop();
                        if (arguments.length === 1) {
                            return curOption[key] === undefined ? null : curOption[key]
                        }
                        curOption[key] = value
                    } else {
                        if (arguments.length === 1) {
                            return this.options[key] === undefined ? null : this.options[key]
                        }
                        options[key] = value
                    }
                }
                this._setOptions(options);
                return this
            },
            _setOptions: function(options) {
                var key;
                for (key in options) {
                    this._setOption(key, options[key])
                }
                return this
            },
            _setOption: function(key, value) {
                this.options[key] = value;
                if (key === "disabled") {
                    this.widget().toggleClass(this.widgetFullName + "-disabled", !!value);
                    if (value) {
                        this.hoverable.removeClass("ui-state-hover");
                        this.focusable.removeClass("ui-state-focus")
                    }
                }
                return this
            },
            enable: function() {
                return this._setOptions({
                    disabled: false
                })
            },
            disable: function() {
                return this._setOptions({
                    disabled: true
                })
            },
            _on: function(suppressDisabledCheck, element, handlers) {
                var delegateElement, instance = this;
                if (typeof suppressDisabledCheck !== "boolean") {
                    handlers = element;
                    element = suppressDisabledCheck;
                    suppressDisabledCheck = false
                }
                if (!handlers) {
                    handlers = element;
                    element = this.element;
                    delegateElement = this.widget()
                } else {
                    element = delegateElement = $(element);
                    this.bindings = this.bindings.add(element)
                }
                $.each(handlers, function(event, handler) {
                    function handlerProxy() {
                        if (!suppressDisabledCheck && (instance.options.disabled === true || $(this).hasClass("ui-state-disabled"))) {
                            return
                        }
                        return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments)
                    }
                    if (typeof handler !== "string") {
                        handlerProxy.guid = handler.guid = handler.guid || handlerProxy.guid || $.guid++
                    }
                    var match = event.match(/^([\w:-]*)\s*(.*)$/),
                        eventName = match[1] + instance.eventNamespace,
                        selector = match[2];
                    if (selector) {
                        delegateElement.delegate(selector, eventName, handlerProxy)
                    } else {
                        element.bind(eventName, handlerProxy)
                    }
                })
            },
            _off: function(element, eventName) {
                eventName = (eventName || "").split(" ").join(this.eventNamespace + " ") + this.eventNamespace;
                element.unbind(eventName).undelegate(eventName)
            },
            _delay: function(handler, delay) {
                function handlerProxy() {
                    return (typeof handler === "string" ? instance[handler] : handler).apply(instance, arguments)
                }
                var instance = this;
                return setTimeout(handlerProxy, delay || 0)
            },
            _hoverable: function(element) {
                this.hoverable = this.hoverable.add(element);
                this._on(element, {
                    mouseenter: function(event) {
                        $(event.currentTarget).addClass("ui-state-hover")
                    },
                    mouseleave: function(event) {
                        $(event.currentTarget).removeClass("ui-state-hover")
                    }
                })
            },
            _focusable: function(element) {
                this.focusable = this.focusable.add(element);
                this._on(element, {
                    focusin: function(event) {
                        $(event.currentTarget).addClass("ui-state-focus")
                    },
                    focusout: function(event) {
                        $(event.currentTarget).removeClass("ui-state-focus")
                    }
                })
            },
            _trigger: function(type, event, data) {
                var prop, orig, callback = this.options[type];
                data = data || {};
                event = $.Event(event);
                event.type = (type === this.widgetEventPrefix ? type : this.widgetEventPrefix + type).toLowerCase();
                event.target = this.element[0];
                orig = event.originalEvent;
                if (orig) {
                    for (prop in orig) {
                        if (!(prop in event)) {
                            event[prop] = orig[prop]
                        }
                    }
                }
                this.element.trigger(event, data);
                return !($.isFunction(callback) && callback.apply(this.element[0], [event].concat(data)) === false || event.isDefaultPrevented())
            }
        };
        $.each({
            show: "fadeIn",
            hide: "fadeOut"
        }, function(method, defaultEffect) {
            $.Widget.prototype["_" + method] = function(element, options, callback) {
                if (typeof options === "string") {
                    options = {
                        effect: options
                    }
                }
                var hasOptions, effectName = !options ? method : options === true || typeof options === "number" ? defaultEffect : options.effect || defaultEffect;
                options = options || {};
                if (typeof options === "number") {
                    options = {
                        duration: options
                    }
                }
                hasOptions = !$.isEmptyObject(options);
                options.complete = callback;
                if (options.delay) {
                    element.delay(options.delay)
                }
                if (hasOptions && $.effects && $.effects.effect[effectName]) {
                    element[method](options)
                } else if (effectName !== method && element[effectName]) {
                    element[effectName](options.duration, options.easing, callback)
                } else {
                    element.queue(function(next) {
                        $(this)[method]();
                        if (callback) {
                            callback.call(element[0])
                        }
                        next()
                    })
                }
            }
        })
    })(jQuery);
    return jQuery
});
define("ankama.widget", ["jquery", "require"], function(jQuery, require) {
    require("jquery.ui.widget");
    (function($, window) {
        var nsNormalizeDict = {};
        $.akm = $.extend({}, {
            ns: "",
            nsNormalize: function(prop) {
                if (!prop) return;
                return nsNormalizeDict[prop] || (nsNormalizeDict[prop] = $.camelCase($.akm.ns + prop))
            }
        });
        $.fn.akmData = function(prop, value) {
            var result;
            if (typeof prop !== "undefined") {
                if (prop) prop = $.akm.nsNormalize(prop);
                if (arguments.length < 2 || value === undefined) result = this.data(prop);
                else result = this.data(prop, value)
            }
            return result
        };
        $.akmData = function(elem, prop, value) {
            var result;
            if (typeof prop !== "undefined") result = $.data(elem, prop ? $.akm.nsNormalize(prop) : prop, value);
            return result
        };
        var oldFind = $.find,
            akmDataRE = /:akmData\(([^)]*)\)/g;
        $.find = function(selector, context, ret, extra) {
            selector = selector.replace(akmDataRE, "[data-" + ($.akm.ns || "") + "$1]");
            return oldFind.call(this, selector, context, ret, extra)
        };
        $.extend($.find, oldFind);
        $.find.matches = function(expr, set) {
            return $.find(expr, null, null, set)
        };
        $.find.matchesSelector = function(node, expr) {
            return $.find(expr, null, null, [node]).length > 0
        }
    })(jQuery, this);
    (function($, undefined) {
        $.widget("ankama.widget", {
            _createWidget: function() {
                $.Widget.prototype._createWidget.apply(this, arguments);
                this._trigger("init")
            },
            _destroy: function() {},
            _getCreateOptions: function() {
                var elem = this.element,
                    options = {};
                options = $.extend(true, {}, this.options);
                $.extend(true, options, this.element.data("options") || {});
                if (typeof this.element.akOptions === "function") {
                    $.extend(true, options, this.element.akOptions())
                }
                $.each(options, function(option) {
                    var value = elem.akmData(option.replace(/[A-Z]/g, function(c) {
                        return "-" + c.toLowerCase()
                    }));
                    if (value !== undefined) options[option] = value
                });
                return options
            },
            enhanceWithin: function(target) {
                var self = this;
                if (!self.options.initSelector) return;
                if (self.options.initSelector.indexOf(".") === 0) {
                    self.enhance(target.getElementsByClassName(self.options.initSelector.slice(1)))
                } else self.enhance($(self.options.initSelector, $(target)))
            },
            enhance: function(targets) {
                var self = this,
                    fnEnhanceWidget = function() {
                        var $widgetElements = $(targets);
                        $widgetElements[self.widgetName]()
                    };
                if (self.options.initProfile !== undefined && typeof $.getCurrentProfile === "function") {
                    $(document).on("profilechange", function(jqEvent, oldProfile, newProfile) {
                        if (newProfile === self.options.initProfile) {
                            fnEnhanceWidget()
                        } else {
                            try {
                                $(targets)[self.widgetName]("destroy")
                            } catch (e) {}
                        }
                    });
                    if (self.options.initProfile !== $.getCurrentProfile()) return
                }
                fnEnhanceWidget()
            },
            raise: function(msg) {
                throw "Widget [" + this.widgetName + "]: " + msg
            }
        })
    })(jQuery);
    return jQuery
});
