/* Minification failed. Returning unminified contents.
(9224,32-33): run-time error JS1195: Expected expression: )
(9224,35-36): run-time error JS1195: Expected expression: >
(9229,14-15): run-time error JS1195: Expected expression: ,
(9230,9-10): run-time error JS1002: Syntax error: }
(9236,27-28): run-time error JS1195: Expected expression: )
(9236,29-30): run-time error JS1004: Expected ';': {
(9242,6-7): run-time error JS1195: Expected expression: )
 */
(function e(t, n, r) {
    function s(o, u) {
        if (!n[o]) {
            if (!t[o]) {
                var a = typeof require == "function" && require;
                if (!u && a) return a(o, !0);
                if (i) return i(o, !0);
                var f = new Error("Cannot find module '" + o + "'");
                throw f.code = "MODULE_NOT_FOUND", f
            }
            var l = n[o] = {
                exports: {}
            };
            t[o][0].call(l.exports, function(e) {
                var n = t[o][1][e];
                return s(n ? n : e)
            }, l, l.exports, e, t, n, r)
        }
        return n[o].exports
    }
    var i = typeof require == "function" && require;
    for (var o = 0; o < r.length; o++) s(r[o]);
    return s
})({
    1: [function(require, module, exports) {
        (function(process, __filename) {
            "use strict";

            function amdefine(module, requireFn) {
                "use strict";
                var defineCache = {},
                    loaderCache = {},
                    alreadyCalled = false,
                    path = require("path"),
                    makeRequire, stringRequire;

                function trimDots(ary) {
                    var i, part;
                    for (i = 0; ary[i]; i += 1) {
                        part = ary[i];
                        if (part === ".") {
                            ary.splice(i, 1);
                            i -= 1
                        } else if (part === "..") {
                            if (i === 1 && (ary[2] === ".." || ary[0] === "..")) {
                                break
                            } else if (i > 0) {
                                ary.splice(i - 1, 2);
                                i -= 2
                            }
                        }
                    }
                }

                function normalize(name, baseName) {
                    var baseParts;
                    if (name && name.charAt(0) === ".") {
                        if (baseName) {
                            baseParts = baseName.split("/");
                            baseParts = baseParts.slice(0, baseParts.length - 1);
                            baseParts = baseParts.concat(name.split("/"));
                            trimDots(baseParts);
                            name = baseParts.join("/")
                        }
                    }
                    return name
                }

                function makeNormalize(relName) {
                    return function(name) {
                        return normalize(name, relName)
                    }
                }

                function makeLoad(id) {
                    function load(value) {
                        loaderCache[id] = value
                    }
                    load.fromText = function(id, text) {
                        throw new Error("amdefine does not implement load.fromText")
                    };
                    return load
                }
                makeRequire = function(systemRequire, exports, module, relId) {
                    function amdRequire(deps, callback) {
                        if (typeof deps === "string") {
                            return stringRequire(systemRequire, exports, module, deps, relId)
                        } else {
                            deps = deps.map(function(depName) {
                                return stringRequire(systemRequire, exports, module, depName, relId)
                            });
                            if (callback) {
                                process.nextTick(function() {
                                    callback.apply(null, deps)
                                })
                            }
                        }
                    }
                    amdRequire.toUrl = function(filePath) {
                        if (filePath.indexOf(".") === 0) {
                            return normalize(filePath, path.dirname(module.filename))
                        } else {
                            return filePath
                        }
                    };
                    return amdRequire
                };
                requireFn = requireFn || function req() {
                    return module.require.apply(module, arguments)
                };

                function runFactory(id, deps, factory) {
                    var r, e, m, result;
                    if (id) {
                        e = loaderCache[id] = {};
                        m = {
                            id: id,
                            uri: __filename,
                            exports: e
                        };
                        r = makeRequire(requireFn, e, m, id)
                    } else {
                        if (alreadyCalled) {
                            throw new Error("amdefine with no module ID cannot be called more than once per file.")
                        }
                        alreadyCalled = true;
                        e = module.exports;
                        m = module;
                        r = makeRequire(requireFn, e, m, module.id)
                    }
                    if (deps) {
                        deps = deps.map(function(depName) {
                            return r(depName)
                        })
                    }
                    if (typeof factory === "function") {
                        result = factory.apply(m.exports, deps)
                    } else {
                        result = factory
                    }
                    if (result !== undefined) {
                        m.exports = result;
                        if (id) {
                            loaderCache[id] = m.exports
                        }
                    }
                }
                stringRequire = function(systemRequire, exports, module, id, relId) {
                    var index = id.indexOf("!"),
                        originalId = id,
                        prefix, plugin;
                    if (index === -1) {
                        id = normalize(id, relId);
                        if (id === "require") {
                            return makeRequire(systemRequire, exports, module, relId)
                        } else if (id === "exports") {
                            return exports
                        } else if (id === "module") {
                            return module
                        } else if (loaderCache.hasOwnProperty(id)) {
                            return loaderCache[id]
                        } else if (defineCache[id]) {
                            runFactory.apply(null, defineCache[id]);
                            return loaderCache[id]
                        } else {
                            if (systemRequire) {
                                return systemRequire(originalId)
                            } else {
                                throw new Error("No module with ID: " + id)
                            }
                        }
                    } else {
                        prefix = id.substring(0, index);
                        id = id.substring(index + 1, id.length);
                        plugin = stringRequire(systemRequire, exports, module, prefix, relId);
                        if (plugin.normalize) {
                            id = plugin.normalize(id, makeNormalize(relId))
                        } else {
                            id = normalize(id, relId)
                        }
                        if (loaderCache[id]) {
                            return loaderCache[id]
                        } else {
                            plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});
                            return loaderCache[id]
                        }
                    }
                };

                function define(id, deps, factory) {
                    if (Array.isArray(id)) {
                        factory = deps;
                        deps = id;
                        id = undefined
                    } else if (typeof id !== "string") {
                        factory = id;
                        id = deps = undefined
                    }
                    if (deps && !Array.isArray(deps)) {
                        factory = deps;
                        deps = undefined
                    }
                    if (!deps) {
                        deps = ["require", "exports", "module"]
                    }
                    if (id) {
                        defineCache[id] = [id, deps, factory]
                    } else {
                        runFactory(id, deps, factory)
                    }
                }
                define.require = function(id) {
                    if (loaderCache[id]) {
                        return loaderCache[id]
                    }
                    if (defineCache[id]) {
                        runFactory.apply(null, defineCache[id]);
                        return loaderCache[id]
                    }
                };
                define.amd = {};
                return define
            }
            module.exports = amdefine
        }).call(this, require("_process"), "/node_modules/amdefine/amdefine.js")
    }, {
        _process: 45,
        path: 44
    }],
    2: [function(require, module, exports) {}, {}],
    3: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _handlebarsRuntime = require("./handlebars.runtime");
        var _handlebarsRuntime2 = _interopRequireDefault(_handlebarsRuntime);
        var _handlebarsCompilerAst = require("./handlebars/compiler/ast");
        var _handlebarsCompilerAst2 = _interopRequireDefault(_handlebarsCompilerAst);
        var _handlebarsCompilerBase = require("./handlebars/compiler/base");
        var _handlebarsCompilerCompiler = require("./handlebars/compiler/compiler");
        var _handlebarsCompilerJavascriptCompiler = require("./handlebars/compiler/javascript-compiler");
        var _handlebarsCompilerJavascriptCompiler2 = _interopRequireDefault(_handlebarsCompilerJavascriptCompiler);
        var _handlebarsCompilerVisitor = require("./handlebars/compiler/visitor");
        var _handlebarsCompilerVisitor2 = _interopRequireDefault(_handlebarsCompilerVisitor);
        var _handlebarsNoConflict = require("./handlebars/no-conflict");
        var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);
        var _create = _handlebarsRuntime2["default"].create;

        function create() {
            var hb = _create();
            hb.compile = function(input, options) {
                return _handlebarsCompilerCompiler.compile(input, options, hb)
            };
            hb.precompile = function(input, options) {
                return _handlebarsCompilerCompiler.precompile(input, options, hb)
            };
            hb.AST = _handlebarsCompilerAst2["default"];
            hb.Compiler = _handlebarsCompilerCompiler.Compiler;
            hb.JavaScriptCompiler = _handlebarsCompilerJavascriptCompiler2["default"];
            hb.Parser = _handlebarsCompilerBase.parser;
            hb.parse = _handlebarsCompilerBase.parse;
            return hb
        }
        var inst = create();
        inst.create = create;
        _handlebarsNoConflict2["default"](inst);
        inst.Visitor = _handlebarsCompilerVisitor2["default"];
        inst["default"] = inst;
        exports["default"] = inst;
        module.exports = exports["default"]
    }, {
        "./handlebars.runtime": 4,
        "./handlebars/compiler/ast": 6,
        "./handlebars/compiler/base": 7,
        "./handlebars/compiler/compiler": 9,
        "./handlebars/compiler/javascript-compiler": 11,
        "./handlebars/compiler/visitor": 14,
        "./handlebars/no-conflict": 28
    }],
    4: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }

        function _interopRequireWildcard(obj) {
            if (obj && obj.__esModule) {
                return obj
            } else {
                var newObj = {};
                if (obj != null) {
                    for (var key in obj) {
                        if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]
                    }
                }
                newObj["default"] = obj;
                return newObj
            }
        }
        var _handlebarsBase = require("./handlebars/base");
        var base = _interopRequireWildcard(_handlebarsBase);
        var _handlebarsSafeString = require("./handlebars/safe-string");
        var _handlebarsSafeString2 = _interopRequireDefault(_handlebarsSafeString);
        var _handlebarsException = require("./handlebars/exception");
        var _handlebarsException2 = _interopRequireDefault(_handlebarsException);
        var _handlebarsUtils = require("./handlebars/utils");
        var Utils = _interopRequireWildcard(_handlebarsUtils);
        var _handlebarsRuntime = require("./handlebars/runtime");
        var runtime = _interopRequireWildcard(_handlebarsRuntime);
        var _handlebarsNoConflict = require("./handlebars/no-conflict");
        var _handlebarsNoConflict2 = _interopRequireDefault(_handlebarsNoConflict);

        function create() {
            var hb = new base.HandlebarsEnvironment;
            Utils.extend(hb, base);
            hb.SafeString = _handlebarsSafeString2["default"];
            hb.Exception = _handlebarsException2["default"];
            hb.Utils = Utils;
            hb.escapeExpression = Utils.escapeExpression;
            hb.VM = runtime;
            hb.template = function(spec) {
                return runtime.template(spec, hb)
            };
            return hb
        }
        var inst = create();
        inst.create = create;
        _handlebarsNoConflict2["default"](inst);
        inst["default"] = inst;
        exports["default"] = inst;
        module.exports = exports["default"]
    }, {
        "./handlebars/base": 5,
        "./handlebars/exception": 18,
        "./handlebars/no-conflict": 28,
        "./handlebars/runtime": 29,
        "./handlebars/safe-string": 30,
        "./handlebars/utils": 31
    }],
    5: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.HandlebarsEnvironment = HandlebarsEnvironment;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _utils = require("./utils");
        var _exception = require("./exception");
        var _exception2 = _interopRequireDefault(_exception);
        var _helpers = require("./helpers");
        var _decorators = require("./decorators");
        var _logger = require("./logger");
        var _logger2 = _interopRequireDefault(_logger);
        var VERSION = "4.0.5";
        exports.VERSION = VERSION;
        var COMPILER_REVISION = 7;
        exports.COMPILER_REVISION = COMPILER_REVISION;
        var REVISION_CHANGES = {
            1: "<= 1.0.rc.2",
            2: "== 1.0.0-rc.3",
            3: "== 1.0.0-rc.4",
            4: "== 1.x.x",
            5: "== 2.0.0-alpha.x",
            6: ">= 2.0.0-beta.1",
            7: ">= 4.0.0"
        };
        exports.REVISION_CHANGES = REVISION_CHANGES;
        var objectType = "[object Object]";

        function HandlebarsEnvironment(helpers, partials, decorators) {
            this.helpers = helpers || {};
            this.partials = partials || {};
            this.decorators = decorators || {};
            _helpers.registerDefaultHelpers(this);
            _decorators.registerDefaultDecorators(this)
        }
        HandlebarsEnvironment.prototype = {
            constructor: HandlebarsEnvironment,
            logger: _logger2["default"],
            log: _logger2["default"].log,
            registerHelper: function registerHelper(name, fn) {
                if (_utils.toString.call(name) === objectType) {
                    if (fn) {
                        throw new _exception2["default"]("Arg not supported with multiple helpers")
                    }
                    _utils.extend(this.helpers, name)
                } else {
                    this.helpers[name] = fn
                }
            },
            unregisterHelper: function unregisterHelper(name) {
                delete this.helpers[name]
            },
            registerPartial: function registerPartial(name, partial) {
                if (_utils.toString.call(name) === objectType) {
                    _utils.extend(this.partials, name)
                } else {
                    if (typeof partial === "undefined") {
                        throw new _exception2["default"]('Attempting to register a partial called "' + name + '" as undefined')
                    }
                    this.partials[name] = partial
                }
            },
            unregisterPartial: function unregisterPartial(name) {
                delete this.partials[name]
            },
            registerDecorator: function registerDecorator(name, fn) {
                if (_utils.toString.call(name) === objectType) {
                    if (fn) {
                        throw new _exception2["default"]("Arg not supported with multiple decorators")
                    }
                    _utils.extend(this.decorators, name)
                } else {
                    this.decorators[name] = fn
                }
            },
            unregisterDecorator: function unregisterDecorator(name) {
                delete this.decorators[name]
            }
        };
        var log = _logger2["default"].log;
        exports.log = log;
        exports.createFrame = _utils.createFrame;
        exports.logger = _logger2["default"]
    }, {
        "./decorators": 16,
        "./exception": 18,
        "./helpers": 19,
        "./logger": 27,
        "./utils": 31
    }],
    6: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var AST = {
            helpers: {
                helperExpression: function helperExpression(node) {
                    return node.type === "SubExpression" || (node.type === "MustacheStatement" || node.type === "BlockStatement") && !!(node.params && node.params.length || node.hash)
                },
                scopedId: function scopedId(path) {
                    return /^\.|this\b/.test(path.original)
                },
                simpleId: function simpleId(path) {
                    return path.parts.length === 1 && !AST.helpers.scopedId(path) && !path.depth
                }
            }
        };
        exports["default"] = AST;
        module.exports = exports["default"]
    }, {}],
    7: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.parse = parse;

        function _interopRequireWildcard(obj) {
            if (obj && obj.__esModule) {
                return obj
            } else {
                var newObj = {};
                if (obj != null) {
                    for (var key in obj) {
                        if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]
                    }
                }
                newObj["default"] = obj;
                return newObj
            }
        }

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _parser = require("./parser");
        var _parser2 = _interopRequireDefault(_parser);
        var _whitespaceControl = require("./whitespace-control");
        var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
        var _helpers = require("./helpers");
        var Helpers = _interopRequireWildcard(_helpers);
        var _utils = require("../utils");
        exports.parser = _parser2["default"];
        var yy = {};
        _utils.extend(yy, Helpers);

        function parse(input, options) {
            if (input.type === "Program") {
                return input
            }
            _parser2["default"].yy = yy;
            yy.locInfo = function(locInfo) {
                return new yy.SourceLocation(options && options.srcName, locInfo)
            };
            var strip = new _whitespaceControl2["default"](options);
            return strip.accept(_parser2["default"].parse(input))
        }
    }, {
        "../utils": 31,
        "./helpers": 10,
        "./parser": 12,
        "./whitespace-control": 15
    }],
    8: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var _utils = require("../utils");
        var SourceNode = undefined;
        try {
            if (typeof define !== "function" || !define.amd) {
                var SourceMap = require("source-map");
                SourceNode = SourceMap.SourceNode
            }
        } catch (err) {}
        if (!SourceNode) {
            SourceNode = function(line, column, srcFile, chunks) {
                this.src = "";
                if (chunks) {
                    this.add(chunks)
                }
            };
            SourceNode.prototype = {
                add: function add(chunks) {
                    if (_utils.isArray(chunks)) {
                        chunks = chunks.join("")
                    }
                    this.src += chunks
                },
                prepend: function prepend(chunks) {
                    if (_utils.isArray(chunks)) {
                        chunks = chunks.join("")
                    }
                    this.src = chunks + this.src
                },
                toStringWithSourceMap: function toStringWithSourceMap() {
                    return {
                        code: this.toString()
                    }
                },
                toString: function toString() {
                    return this.src
                }
            }
        }

        function castChunk(chunk, codeGen, loc) {
            if (_utils.isArray(chunk)) {
                var ret = [];
                for (var i = 0, len = chunk.length; i < len; i++) {
                    ret.push(codeGen.wrap(chunk[i], loc))
                }
                return ret
            } else if (typeof chunk === "boolean" || typeof chunk === "number") {
                return chunk + ""
            }
            return chunk
        }

        function CodeGen(srcFile) {
            this.srcFile = srcFile;
            this.source = []
        }
        CodeGen.prototype = {
            isEmpty: function isEmpty() {
                return !this.source.length
            },
            prepend: function prepend(source, loc) {
                this.source.unshift(this.wrap(source, loc))
            },
            push: function push(source, loc) {
                this.source.push(this.wrap(source, loc))
            },
            merge: function merge() {
                var source = this.empty();
                this.each(function(line) {
                    source.add(["  ", line, "\n"])
                });
                return source
            },
            each: function each(iter) {
                for (var i = 0, len = this.source.length; i < len; i++) {
                    iter(this.source[i])
                }
            },
            empty: function empty() {
                var loc = this.currentLocation || {
                    start: {}
                };
                return new SourceNode(loc.start.line, loc.start.column, this.srcFile)
            },
            wrap: function wrap(chunk) {
                var loc = arguments.length <= 1 || arguments[1] === undefined ? this.currentLocation || {
                    start: {}
                } : arguments[1];
                if (chunk instanceof SourceNode) {
                    return chunk
                }
                chunk = castChunk(chunk, this, loc);
                return new SourceNode(loc.start.line, loc.start.column, this.srcFile, chunk)
            },
            functionCall: function functionCall(fn, type, params) {
                params = this.generateList(params);
                return this.wrap([fn, type ? "." + type + "(" : "(", params, ")"])
            },
            quotedString: function quotedString(str) {
                return '"' + (str + "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + '"'
            },
            objectLiteral: function objectLiteral(obj) {
                var pairs = [];
                for (var key in obj) {
                    if (obj.hasOwnProperty(key)) {
                        var value = castChunk(obj[key], this);
                        if (value !== "undefined") {
                            pairs.push([this.quotedString(key), ":", value])
                        }
                    }
                }
                var ret = this.generateList(pairs);
                ret.prepend("{");
                ret.add("}");
                return ret
            },
            generateList: function generateList(entries) {
                var ret = this.empty();
                for (var i = 0, len = entries.length; i < len; i++) {
                    if (i) {
                        ret.add(",")
                    }
                    ret.add(castChunk(entries[i], this))
                }
                return ret
            },
            generateArray: function generateArray(entries) {
                var ret = this.generateList(entries);
                ret.prepend("[");
                ret.add("]");
                return ret
            }
        };
        exports["default"] = CodeGen;
        module.exports = exports["default"]
    }, {
        "../utils": 31,
        "source-map": 33
    }],
    9: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.Compiler = Compiler;
        exports.precompile = precompile;
        exports.compile = compile;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _exception = require("../exception");
        var _exception2 = _interopRequireDefault(_exception);
        var _utils = require("../utils");
        var _ast = require("./ast");
        var _ast2 = _interopRequireDefault(_ast);
        var slice = [].slice;

        function Compiler() {}
        Compiler.prototype = {
            compiler: Compiler,
            equals: function equals(other) {
                var len = this.opcodes.length;
                if (other.opcodes.length !== len) {
                    return false
                }
                for (var i = 0; i < len; i++) {
                    var opcode = this.opcodes[i],
                        otherOpcode = other.opcodes[i];
                    if (opcode.opcode !== otherOpcode.opcode || !argEquals(opcode.args, otherOpcode.args)) {
                        return false
                    }
                }
                len = this.children.length;
                for (var i = 0; i < len; i++) {
                    if (!this.children[i].equals(other.children[i])) {
                        return false
                    }
                }
                return true
            },
            guid: 0,
            compile: function compile(program, options) {
                this.sourceNode = [];
                this.opcodes = [];
                this.children = [];
                this.options = options;
                this.stringParams = options.stringParams;
                this.trackIds = options.trackIds;
                options.blockParams = options.blockParams || [];
                var knownHelpers = options.knownHelpers;
                options.knownHelpers = {
                    helperMissing: true,
                    blockHelperMissing: true,
                    each: true,
                    "if": true,
                    unless: true,
                    "with": true,
                    log: true,
                    lookup: true
                };
                if (knownHelpers) {
                    for (var _name in knownHelpers) {
                        if (_name in knownHelpers) {
                            options.knownHelpers[_name] = knownHelpers[_name]
                        }
                    }
                }
                return this.accept(program)
            },
            compileProgram: function compileProgram(program) {
                var childCompiler = new this.compiler,
                    result = childCompiler.compile(program, this.options),
                    guid = this.guid++;
                this.usePartial = this.usePartial || result.usePartial;
                this.children[guid] = result;
                this.useDepths = this.useDepths || result.useDepths;
                return guid
            },
            accept: function accept(node) {
                if (!this[node.type]) {
                    throw new _exception2["default"]("Unknown type: " + node.type, node)
                }
                this.sourceNode.unshift(node);
                var ret = this[node.type](node);
                this.sourceNode.shift();
                return ret
            },
            Program: function Program(program) {
                this.options.blockParams.unshift(program.blockParams);
                var body = program.body,
                    bodyLength = body.length;
                for (var i = 0; i < bodyLength; i++) {
                    this.accept(body[i])
                }
                this.options.blockParams.shift();
                this.isSimple = bodyLength === 1;
                this.blockParams = program.blockParams ? program.blockParams.length : 0;
                return this
            },
            BlockStatement: function BlockStatement(block) {
                transformLiteralToPath(block);
                var program = block.program,
                    inverse = block.inverse;
                program = program && this.compileProgram(program);
                inverse = inverse && this.compileProgram(inverse);
                var type = this.classifySexpr(block);
                if (type === "helper") {
                    this.helperSexpr(block, program, inverse)
                } else if (type === "simple") {
                    this.simpleSexpr(block);
                    this.opcode("pushProgram", program);
                    this.opcode("pushProgram", inverse);
                    this.opcode("emptyHash");
                    this.opcode("blockValue", block.path.original)
                } else {
                    this.ambiguousSexpr(block, program, inverse);
                    this.opcode("pushProgram", program);
                    this.opcode("pushProgram", inverse);
                    this.opcode("emptyHash");
                    this.opcode("ambiguousBlockValue")
                }
                this.opcode("append")
            },
            DecoratorBlock: function DecoratorBlock(decorator) {
                var program = decorator.program && this.compileProgram(decorator.program);
                var params = this.setupFullMustacheParams(decorator, program, undefined),
                    path = decorator.path;
                this.useDecorators = true;
                this.opcode("registerDecorator", params.length, path.original)
            },
            PartialStatement: function PartialStatement(partial) {
                this.usePartial = true;
                var program = partial.program;
                if (program) {
                    program = this.compileProgram(partial.program)
                }
                var params = partial.params;
                if (params.length > 1) {
                    throw new _exception2["default"]("Unsupported number of partial arguments: " + params.length, partial)
                } else if (!params.length) {
                    if (this.options.explicitPartialContext) {
                        this.opcode("pushLiteral", "undefined")
                    } else {
                        params.push({
                            type: "PathExpression",
                            parts: [],
                            depth: 0
                        })
                    }
                }
                var partialName = partial.name.original,
                    isDynamic = partial.name.type === "SubExpression";
                if (isDynamic) {
                    this.accept(partial.name)
                }
                this.setupFullMustacheParams(partial, program, undefined, true);
                var indent = partial.indent || "";
                if (this.options.preventIndent && indent) {
                    this.opcode("appendContent", indent);
                    indent = ""
                }
                this.opcode("invokePartial", isDynamic, partialName, indent);
                this.opcode("append")
            },
            PartialBlockStatement: function PartialBlockStatement(partialBlock) {
                this.PartialStatement(partialBlock)
            },
            MustacheStatement: function MustacheStatement(mustache) {
                this.SubExpression(mustache);
                if (mustache.escaped && !this.options.noEscape) {
                    this.opcode("appendEscaped")
                } else {
                    this.opcode("append")
                }
            },
            Decorator: function Decorator(decorator) {
                this.DecoratorBlock(decorator)
            },
            ContentStatement: function ContentStatement(content) {
                if (content.value) {
                    this.opcode("appendContent", content.value)
                }
            },
            CommentStatement: function CommentStatement() {},
            SubExpression: function SubExpression(sexpr) {
                transformLiteralToPath(sexpr);
                var type = this.classifySexpr(sexpr);
                if (type === "simple") {
                    this.simpleSexpr(sexpr)
                } else if (type === "helper") {
                    this.helperSexpr(sexpr)
                } else {
                    this.ambiguousSexpr(sexpr)
                }
            },
            ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
                var path = sexpr.path,
                    name = path.parts[0],
                    isBlock = program != null || inverse != null;
                this.opcode("getContext", path.depth);
                this.opcode("pushProgram", program);
                this.opcode("pushProgram", inverse);
                path.strict = true;
                this.accept(path);
                this.opcode("invokeAmbiguous", name, isBlock)
            },
            simpleSexpr: function simpleSexpr(sexpr) {
                var path = sexpr.path;
                path.strict = true;
                this.accept(path);
                this.opcode("resolvePossibleLambda")
            },
            helperSexpr: function helperSexpr(sexpr, program, inverse) {
                var params = this.setupFullMustacheParams(sexpr, program, inverse),
                    path = sexpr.path,
                    name = path.parts[0];
                if (this.options.knownHelpers[name]) {
                    this.opcode("invokeKnownHelper", params.length, name)
                } else if (this.options.knownHelpersOnly) {
                    throw new _exception2["default"]("You specified knownHelpersOnly, but used the unknown helper " + name, sexpr)
                } else {
                    path.strict = true;
                    path.falsy = true;
                    this.accept(path);
                    this.opcode("invokeHelper", params.length, path.original, _ast2["default"].helpers.simpleId(path))
                }
            },
            PathExpression: function PathExpression(path) {
                this.addDepth(path.depth);
                this.opcode("getContext", path.depth);
                var name = path.parts[0],
                    scoped = _ast2["default"].helpers.scopedId(path),
                    blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
                if (blockParamId) {
                    this.opcode("lookupBlockParam", blockParamId, path.parts)
                } else if (!name) {
                    this.opcode("pushContext")
                } else if (path.data) {
                    this.options.data = true;
                    this.opcode("lookupData", path.depth, path.parts, path.strict)
                } else {
                    this.opcode("lookupOnContext", path.parts, path.falsy, path.strict, scoped)
                }
            },
            StringLiteral: function StringLiteral(string) {
                this.opcode("pushString", string.value)
            },
            NumberLiteral: function NumberLiteral(number) {
                this.opcode("pushLiteral", number.value)
            },
            BooleanLiteral: function BooleanLiteral(bool) {
                this.opcode("pushLiteral", bool.value)
            },
            UndefinedLiteral: function UndefinedLiteral() {
                this.opcode("pushLiteral", "undefined")
            },
            NullLiteral: function NullLiteral() {
                this.opcode("pushLiteral", "null")
            },
            Hash: function Hash(hash) {
                var pairs = hash.pairs,
                    i = 0,
                    l = pairs.length;
                this.opcode("pushHash");
                for (; i < l; i++) {
                    this.pushParam(pairs[i].value)
                }
                while (i--) {
                    this.opcode("assignToHash", pairs[i].key)
                }
                this.opcode("popHash")
            },
            opcode: function opcode(name) {
                this.opcodes.push({
                    opcode: name,
                    args: slice.call(arguments, 1),
                    loc: this.sourceNode[0].loc
                })
            },
            addDepth: function addDepth(depth) {
                if (!depth) {
                    return
                }
                this.useDepths = true
            },
            classifySexpr: function classifySexpr(sexpr) {
                var isSimple = _ast2["default"].helpers.simpleId(sexpr.path);
                var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
                var isHelper = !isBlockParam && _ast2["default"].helpers.helperExpression(sexpr);
                var isEligible = !isBlockParam && (isHelper || isSimple);
                if (isEligible && !isHelper) {
                    var _name2 = sexpr.path.parts[0],
                        options = this.options;
                    if (options.knownHelpers[_name2]) {
                        isHelper = true
                    } else if (options.knownHelpersOnly) {
                        isEligible = false
                    }
                }
                if (isHelper) {
                    return "helper"
                } else if (isEligible) {
                    return "ambiguous"
                } else {
                    return "simple"
                }
            },
            pushParams: function pushParams(params) {
                for (var i = 0, l = params.length; i < l; i++) {
                    this.pushParam(params[i])
                }
            },
            pushParam: function pushParam(val) {
                var value = val.value != null ? val.value : val.original || "";
                if (this.stringParams) {
                    if (value.replace) {
                        value = value.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".")
                    }
                    if (val.depth) {
                        this.addDepth(val.depth)
                    }
                    this.opcode("getContext", val.depth || 0);
                    this.opcode("pushStringParam", value, val.type);
                    if (val.type === "SubExpression") {
                        this.accept(val)
                    }
                } else {
                    if (this.trackIds) {
                        var blockParamIndex = undefined;
                        if (val.parts && !_ast2["default"].helpers.scopedId(val) && !val.depth) {
                            blockParamIndex = this.blockParamIndex(val.parts[0])
                        }
                        if (blockParamIndex) {
                            var blockParamChild = val.parts.slice(1).join(".");
                            this.opcode("pushId", "BlockParam", blockParamIndex, blockParamChild)
                        } else {
                            value = val.original || value;
                            if (value.replace) {
                                value = value.replace(/^this(?:\.|$)/, "").replace(/^\.\//, "").replace(/^\.$/, "")
                            }
                            this.opcode("pushId", val.type, value)
                        }
                    }
                    this.accept(val)
                }
            },
            setupFullMustacheParams: function setupFullMustacheParams(sexpr, program, inverse, omitEmpty) {
                var params = sexpr.params;
                this.pushParams(params);
                this.opcode("pushProgram", program);
                this.opcode("pushProgram", inverse);
                if (sexpr.hash) {
                    this.accept(sexpr.hash)
                } else {
                    this.opcode("emptyHash", omitEmpty)
                }
                return params
            },
            blockParamIndex: function blockParamIndex(name) {
                for (var depth = 0, len = this.options.blockParams.length; depth < len; depth++) {
                    var blockParams = this.options.blockParams[depth],
                        param = blockParams && _utils.indexOf(blockParams, name);
                    if (blockParams && param >= 0) {
                        return [depth, param]
                    }
                }
            }
        };

        function precompile(input, options, env) {
            if (input == null || typeof input !== "string" && input.type !== "Program") {
                throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed " + input)
            }
            options = options || {};
            if (!("data" in options)) {
                options.data = true
            }
            if (options.compat) {
                options.useDepths = true
            }
            var ast = env.parse(input, options),
                environment = (new env.Compiler).compile(ast, options);
            return (new env.JavaScriptCompiler).compile(environment, options)
        }

        function compile(input, options, env) {
            if (options === undefined) options = {};
            if (input == null || typeof input !== "string" && input.type !== "Program") {
                throw new _exception2["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed " + input)
            }
            if (!("data" in options)) {
                options.data = true
            }
            if (options.compat) {
                options.useDepths = true
            }
            var compiled = undefined;

            function compileInput() {
                var ast = env.parse(input, options),
                    environment = (new env.Compiler).compile(ast, options),
                    templateSpec = (new env.JavaScriptCompiler).compile(environment, options, undefined, true);
                return env.template(templateSpec)
            }

            function ret(context, execOptions) {
                if (!compiled) {
                    compiled = compileInput()
                }
                return compiled.call(this, context, execOptions)
            }
            ret._setup = function(setupOptions) {
                if (!compiled) {
                    compiled = compileInput()
                }
                return compiled._setup(setupOptions)
            };
            ret._child = function(i, data, blockParams, depths) {
                if (!compiled) {
                    compiled = compileInput()
                }
                return compiled._child(i, data, blockParams, depths)
            };
            return ret
        }

        function argEquals(a, b) {
            if (a === b) {
                return true
            }
            if (_utils.isArray(a) && _utils.isArray(b) && a.length === b.length) {
                for (var i = 0; i < a.length; i++) {
                    if (!argEquals(a[i], b[i])) {
                        return false
                    }
                }
                return true
            }
        }

        function transformLiteralToPath(sexpr) {
            if (!sexpr.path.parts) {
                var literal = sexpr.path;
                sexpr.path = {
                    type: "PathExpression",
                    data: false,
                    depth: 0,
                    parts: [literal.original + ""],
                    original: literal.original + "",
                    loc: literal.loc
                }
            }
        }
    }, {
        "../exception": 18,
        "../utils": 31,
        "./ast": 6
    }],
    10: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.SourceLocation = SourceLocation;
        exports.id = id;
        exports.stripFlags = stripFlags;
        exports.stripComment = stripComment;
        exports.preparePath = preparePath;
        exports.prepareMustache = prepareMustache;
        exports.prepareRawBlock = prepareRawBlock;
        exports.prepareBlock = prepareBlock;
        exports.prepareProgram = prepareProgram;
        exports.preparePartialBlock = preparePartialBlock;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _exception = require("../exception");
        var _exception2 = _interopRequireDefault(_exception);

        function validateClose(open, close) {
            close = close.path ? close.path.original : close;
            if (open.path.original !== close) {
                var errorNode = {
                    loc: open.path.loc
                };
                throw new _exception2["default"](open.path.original + " doesn't match " + close, errorNode)
            }
        }

        function SourceLocation(source, locInfo) {
            this.source = source;
            this.start = {
                line: locInfo.first_line,
                column: locInfo.first_column
            };
            this.end = {
                line: locInfo.last_line,
                column: locInfo.last_column
            }
        }

        function id(token) {
            if (/^\[.*\]$/.test(token)) {
                return token.substr(1, token.length - 2)
            } else {
                return token
            }
        }

        function stripFlags(open, close) {
            return {
                open: open.charAt(2) === "~",
                close: close.charAt(close.length - 3) === "~"
            }
        }

        function stripComment(comment) {
            return comment.replace(/^\{\{~?\!-?-?/, "").replace(/-?-?~?\}\}$/, "")
        }

        function preparePath(data, parts, loc) {
            loc = this.locInfo(loc);
            var original = data ? "@" : "",
                dig = [],
                depth = 0,
                depthString = "";
            for (var i = 0, l = parts.length; i < l; i++) {
                var part = parts[i].part,
                    isLiteral = parts[i].original !== part;
                original += (parts[i].separator || "") + part;
                if (!isLiteral && (part === ".." || part === "." || part === "this")) {
                    if (dig.length > 0) {
                        throw new _exception2["default"]("Invalid path: " + original, {
                            loc: loc
                        })
                    } else if (part === "..") {
                        depth++;
                        depthString += "../"
                    }
                } else {
                    dig.push(part)
                }
            }
            return {
                type: "PathExpression",
                data: data,
                depth: depth,
                parts: dig,
                original: original,
                loc: loc
            }
        }

        function prepareMustache(path, params, hash, open, strip, locInfo) {
            var escapeFlag = open.charAt(3) || open.charAt(2),
                escaped = escapeFlag !== "{" && escapeFlag !== "&";
            var decorator = /\*/.test(open);
            return {
                type: decorator ? "Decorator" : "MustacheStatement",
                path: path,
                params: params,
                hash: hash,
                escaped: escaped,
                strip: strip,
                loc: this.locInfo(locInfo)
            }
        }

        function prepareRawBlock(openRawBlock, contents, close, locInfo) {
            validateClose(openRawBlock, close);
            locInfo = this.locInfo(locInfo);
            var program = {
                type: "Program",
                body: contents,
                strip: {},
                loc: locInfo
            };
            return {
                type: "BlockStatement",
                path: openRawBlock.path,
                params: openRawBlock.params,
                hash: openRawBlock.hash,
                program: program,
                openStrip: {},
                inverseStrip: {},
                closeStrip: {},
                loc: locInfo
            }
        }

        function prepareBlock(openBlock, program, inverseAndProgram, close, inverted, locInfo) {
            if (close && close.path) {
                validateClose(openBlock, close)
            }
            var decorator = /\*/.test(openBlock.open);
            program.blockParams = openBlock.blockParams;
            var inverse = undefined,
                inverseStrip = undefined;
            if (inverseAndProgram) {
                if (decorator) {
                    throw new _exception2["default"]("Unexpected inverse block on decorator", inverseAndProgram)
                }
                if (inverseAndProgram.chain) {
                    inverseAndProgram.program.body[0].closeStrip = close.strip
                }
                inverseStrip = inverseAndProgram.strip;
                inverse = inverseAndProgram.program
            }
            if (inverted) {
                inverted = inverse;
                inverse = program;
                program = inverted
            }
            return {
                type: decorator ? "DecoratorBlock" : "BlockStatement",
                path: openBlock.path,
                params: openBlock.params,
                hash: openBlock.hash,
                program: program,
                inverse: inverse,
                openStrip: openBlock.strip,
                inverseStrip: inverseStrip,
                closeStrip: close && close.strip,
                loc: this.locInfo(locInfo)
            }
        }

        function prepareProgram(statements, loc) {
            if (!loc && statements.length) {
                var firstLoc = statements[0].loc,
                    lastLoc = statements[statements.length - 1].loc;
                if (firstLoc && lastLoc) {
                    loc = {
                        source: firstLoc.source,
                        start: {
                            line: firstLoc.start.line,
                            column: firstLoc.start.column
                        },
                        end: {
                            line: lastLoc.end.line,
                            column: lastLoc.end.column
                        }
                    }
                }
            }
            return {
                type: "Program",
                body: statements,
                strip: {},
                loc: loc
            }
        }

        function preparePartialBlock(open, program, close, locInfo) {
            validateClose(open, close);
            return {
                type: "PartialBlockStatement",
                name: open.path,
                params: open.params,
                hash: open.hash,
                program: program,
                openStrip: open.strip,
                closeStrip: close && close.strip,
                loc: this.locInfo(locInfo)
            }
        }
    }, {
        "../exception": 18
    }],
    11: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _base = require("../base");
        var _exception = require("../exception");
        var _exception2 = _interopRequireDefault(_exception);
        var _utils = require("../utils");
        var _codeGen = require("./code-gen");
        var _codeGen2 = _interopRequireDefault(_codeGen);

        function Literal(value) {
            this.value = value
        }

        function JavaScriptCompiler() {}
        JavaScriptCompiler.prototype = {
            nameLookup: function nameLookup(parent, name) {
                if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {
                    return [parent, ".", name]
                } else {
                    return [parent, "[", JSON.stringify(name), "]"]
                }
            },
            depthedLookup: function depthedLookup(name) {
                return [this.aliasable("container.lookup"), '(depths, "', name, '")']
            },
            compilerInfo: function compilerInfo() {
                var revision = _base.COMPILER_REVISION,
                    versions = _base.REVISION_CHANGES[revision];
                return [revision, versions]
            },
            appendToBuffer: function appendToBuffer(source, location, explicit) {
                if (!_utils.isArray(source)) {
                    source = [source]
                }
                source = this.source.wrap(source, location);
                if (this.environment.isSimple) {
                    return ["return ", source, ";"]
                } else if (explicit) {
                    return ["buffer += ", source, ";"]
                } else {
                    source.appendToBuffer = true;
                    return source
                }
            },
            initializeBuffer: function initializeBuffer() {
                return this.quotedString("")
            },
            compile: function compile(environment, options, context, asObject) {
                this.environment = environment;
                this.options = options;
                this.stringParams = this.options.stringParams;
                this.trackIds = this.options.trackIds;
                this.precompile = !asObject;
                this.name = this.environment.name;
                this.isChild = !!context;
                this.context = context || {
                    decorators: [],
                    programs: [],
                    environments: []
                };
                this.preamble();
                this.stackSlot = 0;
                this.stackVars = [];
                this.aliases = {};
                this.registers = {
                    list: []
                };
                this.hashes = [];

                this.compileStack = [];
                this.inlineStack = [];
                this.blockParams = [];
                this.compileChildren(environment, options);
                this.useDepths = this.useDepths || environment.useDepths || environment.useDecorators || this.options.compat;
                this.useBlockParams = this.useBlockParams || environment.useBlockParams;
                var opcodes = environment.opcodes,
                    opcode = undefined,
                    firstLoc = undefined,
                    i = undefined,
                    l = undefined;
                for (i = 0, l = opcodes.length; i < l; i++) {
                    opcode = opcodes[i];
                    this.source.currentLocation = opcode.loc;
                    firstLoc = firstLoc || opcode.loc;
                    this[opcode.opcode].apply(this, opcode.args)
                }
                this.source.currentLocation = firstLoc;
                this.pushSource("");
                if (this.stackSlot || this.inlineStack.length || this.compileStack.length) {
                    throw new _exception2["default"]("Compile completed with content left on stack")
                }
                if (!this.decorators.isEmpty()) {
                    this.useDecorators = true;
                    this.decorators.prepend("var decorators = container.decorators;\n");
                    this.decorators.push("return fn;");
                    if (asObject) {
                        this.decorators = Function.apply(this, ["fn", "props", "container", "depth0", "data", "blockParams", "depths", this.decorators.merge()])
                    } else {
                        this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n");
                        this.decorators.push("}\n");
                        this.decorators = this.decorators.merge()
                    }
                } else {
                    this.decorators = undefined
                }
                var fn = this.createFunctionContext(asObject);
                if (!this.isChild) {
                    var ret = {
                        compiler: this.compilerInfo(),
                        main: fn
                    };
                    if (this.decorators) {
                        ret.main_d = this.decorators;
                        ret.useDecorators = true
                    }
                    var _context = this.context;
                    var programs = _context.programs;
                    var decorators = _context.decorators;
                    for (i = 0, l = programs.length; i < l; i++) {
                        if (programs[i]) {
                            ret[i] = programs[i];
                            if (decorators[i]) {
                                ret[i + "_d"] = decorators[i];
                                ret.useDecorators = true
                            }
                        }
                    }
                    if (this.environment.usePartial) {
                        ret.usePartial = true
                    }
                    if (this.options.data) {
                        ret.useData = true
                    }
                    if (this.useDepths) {
                        ret.useDepths = true
                    }
                    if (this.useBlockParams) {
                        ret.useBlockParams = true
                    }
                    if (this.options.compat) {
                        ret.compat = true
                    }
                    if (!asObject) {
                        ret.compiler = JSON.stringify(ret.compiler);
                        this.source.currentLocation = {
                            start: {
                                line: 1,
                                column: 0
                            }
                        };
                        ret = this.objectLiteral(ret);
                        if (options.srcName) {
                            ret = ret.toStringWithSourceMap({
                                file: options.destName
                            });
                            ret.map = ret.map && ret.map.toString()
                        } else {
                            ret = ret.toString()
                        }
                    } else {
                        ret.compilerOptions = this.options
                    }
                    return ret
                } else {
                    return fn
                }
            },
            preamble: function preamble() {
                this.lastContext = 0;
                this.source = new _codeGen2["default"](this.options.srcName);
                this.decorators = new _codeGen2["default"](this.options.srcName)
            },
            createFunctionContext: function createFunctionContext(asObject) {
                var varDeclarations = "";
                var locals = this.stackVars.concat(this.registers.list);
                if (locals.length > 0) {
                    varDeclarations += ", " + locals.join(", ")
                }
                var aliasCount = 0;
                for (var alias in this.aliases) {
                    var node = this.aliases[alias];
                    if (this.aliases.hasOwnProperty(alias) && node.children && node.referenceCount > 1) {
                        varDeclarations += ", alias" + ++aliasCount + "=" + alias;
                        node.children[0] = "alias" + aliasCount
                    }
                }
                var params = ["container", "depth0", "helpers", "partials", "data"];
                if (this.useBlockParams || this.useDepths) {
                    params.push("blockParams")
                }
                if (this.useDepths) {
                    params.push("depths")
                }
                var source = this.mergeSource(varDeclarations);
                if (asObject) {
                    params.push(source);
                    return Function.apply(this, params)
                } else {
                    return this.source.wrap(["function(", params.join(","), ") {\n  ", source, "}"])
                }
            },
            mergeSource: function mergeSource(varDeclarations) {
                var isSimple = this.environment.isSimple,
                    appendOnly = !this.forceBuffer,
                    appendFirst = undefined,
                    sourceSeen = undefined,
                    bufferStart = undefined,
                    bufferEnd = undefined;
                this.source.each(function(line) {
                    if (line.appendToBuffer) {
                        if (bufferStart) {
                            line.prepend("  + ")
                        } else {
                            bufferStart = line
                        }
                        bufferEnd = line
                    } else {
                        if (bufferStart) {
                            if (!sourceSeen) {
                                appendFirst = true
                            } else {
                                bufferStart.prepend("buffer += ")
                            }
                            bufferEnd.add(";");
                            bufferStart = bufferEnd = undefined
                        }
                        sourceSeen = true;
                        if (!isSimple) {
                            appendOnly = false
                        }
                    }
                });
                if (appendOnly) {
                    if (bufferStart) {
                        bufferStart.prepend("return ");
                        bufferEnd.add(";")
                    } else if (!sourceSeen) {
                        this.source.push('return "";')
                    }
                } else {
                    varDeclarations += ", buffer = " + (appendFirst ? "" : this.initializeBuffer());
                    if (bufferStart) {
                        bufferStart.prepend("return buffer + ");
                        bufferEnd.add(";")
                    } else {
                        this.source.push("return buffer;")
                    }
                }
                if (varDeclarations) {
                    this.source.prepend("var " + varDeclarations.substring(2) + (appendFirst ? "" : ";\n"))
                }
                return this.source.merge()
            },
            blockValue: function blockValue(name) {
                var blockHelperMissing = this.aliasable("helpers.blockHelperMissing"),
                    params = [this.contextName(0)];
                this.setupHelperArgs(name, 0, params);
                var blockName = this.popStack();
                params.splice(1, 0, blockName);
                this.push(this.source.functionCall(blockHelperMissing, "call", params))
            },
            ambiguousBlockValue: function ambiguousBlockValue() {
                var blockHelperMissing = this.aliasable("helpers.blockHelperMissing"),
                    params = [this.contextName(0)];
                this.setupHelperArgs("", 0, params, true);
                this.flushInline();
                var current = this.topStack();
                params.splice(1, 0, current);
                this.pushSource(["if (!", this.lastHelper, ") { ", current, " = ", this.source.functionCall(blockHelperMissing, "call", params), "}"])
            },
            appendContent: function appendContent(content) {
                if (this.pendingContent) {
                    content = this.pendingContent + content
                } else {
                    this.pendingLocation = this.source.currentLocation
                }
                this.pendingContent = content
            },
            append: function append() {
                if (this.isInline()) {
                    this.replaceStack(function(current) {
                        return [" != null ? ", current, ' : ""']
                    });
                    this.pushSource(this.appendToBuffer(this.popStack()))
                } else {
                    var local = this.popStack();
                    this.pushSource(["if (", local, " != null) { ", this.appendToBuffer(local, undefined, true), " }"]);
                    if (this.environment.isSimple) {
                        this.pushSource(["else { ", this.appendToBuffer("''", undefined, true), " }"])
                    }
                }
            },
            appendEscaped: function appendEscaped() {
                this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"), "(", this.popStack(), ")"]))
            },
            getContext: function getContext(depth) {
                this.lastContext = depth
            },
            pushContext: function pushContext() {
                this.pushStackLiteral(this.contextName(this.lastContext))
            },
            lookupOnContext: function lookupOnContext(parts, falsy, strict, scoped) {
                var i = 0;
                if (!scoped && this.options.compat && !this.lastContext) {
                    this.push(this.depthedLookup(parts[i++]))
                } else {
                    this.pushContext()
                }
                this.resolvePath("context", parts, i, falsy, strict)
            },
            lookupBlockParam: function lookupBlockParam(blockParamId, parts) {
                this.useBlockParams = true;
                this.push(["blockParams[", blockParamId[0], "][", blockParamId[1], "]"]);
                this.resolvePath("context", parts, 1)
            },
            lookupData: function lookupData(depth, parts, strict) {
                if (!depth) {
                    this.pushStackLiteral("data")
                } else {
                    this.pushStackLiteral("container.data(data, " + depth + ")")
                }
                this.resolvePath("data", parts, 0, true, strict)
            },
            resolvePath: function resolvePath(type, parts, i, falsy, strict) {
                var _this = this;
                if (this.options.strict || this.options.assumeObjects) {
                    this.push(strictLookup(this.options.strict && strict, this, parts, type));
                    return
                }
                var len = parts.length;
                for (; i < len; i++) {
                    this.replaceStack(function(current) {
                        var lookup = _this.nameLookup(current, parts[i], type);
                        if (!falsy) {
                            return [" != null ? ", lookup, " : ", current]
                        } else {
                            return [" && ", lookup]
                        }
                    })
                }
            },
            resolvePossibleLambda: function resolvePossibleLambda() {
                this.push([this.aliasable("container.lambda"), "(", this.popStack(), ", ", this.contextName(0), ")"])
            },
            pushStringParam: function pushStringParam(string, type) {
                this.pushContext();
                this.pushString(type);
                if (type !== "SubExpression") {
                    if (typeof string === "string") {
                        this.pushString(string)
                    } else {
                        this.pushStackLiteral(string)
                    }
                }
            },
            emptyHash: function emptyHash(omitEmpty) {
                if (this.trackIds) {
                    this.push("{}")
                }
                if (this.stringParams) {
                    this.push("{}");
                    this.push("{}")
                }
                this.pushStackLiteral(omitEmpty ? "undefined" : "{}")
            },
            pushHash: function pushHash() {
                if (this.hash) {
                    this.hashes.push(this.hash)
                }
                this.hash = {
                    values: [],
                    types: [],
                    contexts: [],
                    ids: []
                }
            },
            popHash: function popHash() {
                var hash = this.hash;
                this.hash = this.hashes.pop();
                if (this.trackIds) {
                    this.push(this.objectLiteral(hash.ids))
                }
                if (this.stringParams) {
                    this.push(this.objectLiteral(hash.contexts));
                    this.push(this.objectLiteral(hash.types))
                }
                this.push(this.objectLiteral(hash.values))
            },
            pushString: function pushString(string) {
                this.pushStackLiteral(this.quotedString(string))
            },
            pushLiteral: function pushLiteral(value) {
                this.pushStackLiteral(value)
            },
            pushProgram: function pushProgram(guid) {
                if (guid != null) {
                    this.pushStackLiteral(this.programExpression(guid))
                } else {
                    this.pushStackLiteral(null)
                }
            },
            registerDecorator: function registerDecorator(paramSize, name) {
                var foundDecorator = this.nameLookup("decorators", name, "decorator"),
                    options = this.setupHelperArgs(name, paramSize);
                this.decorators.push(["fn = ", this.decorators.functionCall(foundDecorator, "", ["fn", "props", "container", options]), " || fn;"])
            },
            invokeHelper: function invokeHelper(paramSize, name, isSimple) {
                var nonHelper = this.popStack(),
                    helper = this.setupHelper(paramSize, name),
                    simple = isSimple ? [helper.name, " || "] : "";
                var lookup = ["("].concat(simple, nonHelper);
                if (!this.options.strict) {
                    lookup.push(" || ", this.aliasable("helpers.helperMissing"))
                }
                lookup.push(")");
                this.push(this.source.functionCall(lookup, "call", helper.callParams))
            },
            invokeKnownHelper: function invokeKnownHelper(paramSize, name) {
                var helper = this.setupHelper(paramSize, name);
                this.push(this.source.functionCall(helper.name, "call", helper.callParams))
            },
            invokeAmbiguous: function invokeAmbiguous(name, helperCall) {
                this.useRegister("helper");
                var nonHelper = this.popStack();
                this.emptyHash();
                var helper = this.setupHelper(0, name, helperCall);
                var helperName = this.lastHelper = this.nameLookup("helpers", name, "helper");
                var lookup = ["(", "(helper = ", helperName, " || ", nonHelper, ")"];
                if (!this.options.strict) {
                    lookup[0] = "(helper = ";
                    lookup.push(" != null ? helper : ", this.aliasable("helpers.helperMissing"))
                }
                this.push(["(", lookup, helper.paramsInit ? ["),(", helper.paramsInit] : [], "),", "(typeof helper === ", this.aliasable('"function"'), " ? ", this.source.functionCall("helper", "call", helper.callParams), " : helper))"])
            },
            invokePartial: function invokePartial(isDynamic, name, indent) {
                var params = [],
                    options = this.setupParams(name, 1, params);
                if (isDynamic) {
                    name = this.popStack();
                    delete options.name
                }
                if (indent) {
                    options.indent = JSON.stringify(indent)
                }
                options.helpers = "helpers";
                options.partials = "partials";
                options.decorators = "container.decorators";
                if (!isDynamic) {
                    params.unshift(this.nameLookup("partials", name, "partial"))
                } else {
                    params.unshift(name)
                }
                if (this.options.compat) {
                    options.depths = "depths"
                }
                options = this.objectLiteral(options);
                params.push(options);
                this.push(this.source.functionCall("container.invokePartial", "", params))
            },
            assignToHash: function assignToHash(key) {
                var value = this.popStack(),
                    context = undefined,
                    type = undefined,
                    id = undefined;
                if (this.trackIds) {
                    id = this.popStack()
                }
                if (this.stringParams) {
                    type = this.popStack();
                    context = this.popStack()
                }
                var hash = this.hash;
                if (context) {
                    hash.contexts[key] = context
                }
                if (type) {
                    hash.types[key] = type
                }
                if (id) {
                    hash.ids[key] = id
                }
                hash.values[key] = value
            },
            pushId: function pushId(type, name, child) {
                if (type === "BlockParam") {
                    this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " + JSON.stringify("." + child) : ""))
                } else if (type === "PathExpression") {
                    this.pushString(name)
                } else if (type === "SubExpression") {
                    this.pushStackLiteral("true")
                } else {
                    this.pushStackLiteral("null")
                }
            },
            compiler: JavaScriptCompiler,
            compileChildren: function compileChildren(environment, options) {
                var children = environment.children,
                    child = undefined,
                    compiler = undefined;
                for (var i = 0, l = children.length; i < l; i++) {
                    child = children[i];
                    compiler = new this.compiler;
                    var index = this.matchExistingProgram(child);
                    if (index == null) {
                        this.context.programs.push("");
                        index = this.context.programs.length;
                        child.index = index;
                        child.name = "program" + index;
                        this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
                        this.context.decorators[index] = compiler.decorators;
                        this.context.environments[index] = child;
                        this.useDepths = this.useDepths || compiler.useDepths;
                        this.useBlockParams = this.useBlockParams || compiler.useBlockParams
                    } else {
                        child.index = index;
                        child.name = "program" + index;
                        this.useDepths = this.useDepths || child.useDepths;
                        this.useBlockParams = this.useBlockParams || child.useBlockParams
                    }
                }
            },
            matchExistingProgram: function matchExistingProgram(child) {
                for (var i = 0, len = this.context.environments.length; i < len; i++) {
                    var environment = this.context.environments[i];
                    if (environment && environment.equals(child)) {
                        return i
                    }
                }
            },
            programExpression: function programExpression(guid) {
                var child = this.environment.children[guid],
                    programParams = [child.index, "data", child.blockParams];
                if (this.useBlockParams || this.useDepths) {
                    programParams.push("blockParams")
                }
                if (this.useDepths) {
                    programParams.push("depths")
                }
                return "container.program(" + programParams.join(", ") + ")"
            },
            useRegister: function useRegister(name) {
                if (!this.registers[name]) {
                    this.registers[name] = true;
                    this.registers.list.push(name)
                }
            },
            push: function push(expr) {
                if (!(expr instanceof Literal)) {
                    expr = this.source.wrap(expr)
                }
                this.inlineStack.push(expr);
                return expr
            },
            pushStackLiteral: function pushStackLiteral(item) {
                this.push(new Literal(item))
            },
            pushSource: function pushSource(source) {
                if (this.pendingContent) {
                    this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent), this.pendingLocation));
                    this.pendingContent = undefined
                }
                if (source) {
                    this.source.push(source)
                }
            },
            replaceStack: function replaceStack(callback) {
                var prefix = ["("],
                    stack = undefined,
                    createdStack = undefined,
                    usedLiteral = undefined;
                if (!this.isInline()) {
                    throw new _exception2["default"]("replaceStack on non-inline")
                }
                var top = this.popStack(true);
                if (top instanceof Literal) {
                    stack = [top.value];
                    prefix = ["(", stack];
                    usedLiteral = true
                } else {
                    createdStack = true;
                    var _name = this.incrStack();
                    prefix = ["((", this.push(_name), " = ", top, ")"];
                    stack = this.topStack()
                }
                var item = callback.call(this, stack);
                if (!usedLiteral) {
                    this.popStack()
                }
                if (createdStack) {
                    this.stackSlot--
                }
                this.push(prefix.concat(item, ")"))
            },
            incrStack: function incrStack() {
                this.stackSlot++;
                if (this.stackSlot > this.stackVars.length) {
                    this.stackVars.push("stack" + this.stackSlot)
                }
                return this.topStackName()
            },
            topStackName: function topStackName() {
                return "stack" + this.stackSlot
            },
            flushInline: function flushInline() {
                var inlineStack = this.inlineStack;
                this.inlineStack = [];
                for (var i = 0, len = inlineStack.length; i < len; i++) {
                    var entry = inlineStack[i];
                    if (entry instanceof Literal) {
                        this.compileStack.push(entry)
                    } else {
                        var stack = this.incrStack();
                        this.pushSource([stack, " = ", entry, ";"]);
                        this.compileStack.push(stack)
                    }
                }
            },
            isInline: function isInline() {
                return this.inlineStack.length
            },
            popStack: function popStack(wrapped) {
                var inline = this.isInline(),
                    item = (inline ? this.inlineStack : this.compileStack).pop();
                if (!wrapped && item instanceof Literal) {
                    return item.value
                } else {
                    if (!inline) {
                        if (!this.stackSlot) {
                            throw new _exception2["default"]("Invalid stack pop")
                        }
                        this.stackSlot--
                    }
                    return item
                }
            },
            topStack: function topStack() {
                var stack = this.isInline() ? this.inlineStack : this.compileStack,
                    item = stack[stack.length - 1];
                if (item instanceof Literal) {
                    return item.value
                } else {
                    return item
                }
            },
            contextName: function contextName(context) {
                if (this.useDepths && context) {
                    return "depths[" + context + "]"
                } else {
                    return "depth" + context
                }
            },
            quotedString: function quotedString(str) {
                return this.source.quotedString(str)
            },
            objectLiteral: function objectLiteral(obj) {
                return this.source.objectLiteral(obj)
            },
            aliasable: function aliasable(name) {
                var ret = this.aliases[name];
                if (ret) {
                    ret.referenceCount++;
                    return ret
                }
                ret = this.aliases[name] = this.source.wrap(name);
                ret.aliasable = true;
                ret.referenceCount = 1;
                return ret
            },
            setupHelper: function setupHelper(paramSize, name, blockHelper) {
                var params = [],
                    paramsInit = this.setupHelperArgs(name, paramSize, params, blockHelper);
                var foundHelper = this.nameLookup("helpers", name, "helper"),
                    callContext = this.aliasable(this.contextName(0) + " != null ? " + this.contextName(0) + " : {}");
                return {
                    params: params,
                    paramsInit: paramsInit,
                    name: foundHelper,
                    callParams: [callContext].concat(params)
                }
            },
            setupParams: function setupParams(helper, paramSize, params) {
                var options = {},
                    contexts = [],
                    types = [],
                    ids = [],
                    objectArgs = !params,
                    param = undefined;
                if (objectArgs) {
                    params = []
                }
                options.name = this.quotedString(helper);
                options.hash = this.popStack();
                if (this.trackIds) {
                    options.hashIds = this.popStack()
                }
                if (this.stringParams) {
                    options.hashTypes = this.popStack();
                    options.hashContexts = this.popStack()
                }
                var inverse = this.popStack(),
                    program = this.popStack();
                if (program || inverse) {
                    options.fn = program || "container.noop";
                    options.inverse = inverse || "container.noop"
                }
                var i = paramSize;
                while (i--) {
                    param = this.popStack();
                    params[i] = param;
                    if (this.trackIds) {
                        ids[i] = this.popStack()
                    }
                    if (this.stringParams) {
                        types[i] = this.popStack();
                        contexts[i] = this.popStack()
                    }
                }
                if (objectArgs) {
                    options.args = this.source.generateArray(params)
                }
                if (this.trackIds) {
                    options.ids = this.source.generateArray(ids)
                }
                if (this.stringParams) {
                    options.types = this.source.generateArray(types);
                    options.contexts = this.source.generateArray(contexts)
                }
                if (this.options.data) {
                    options.data = "data"
                }
                if (this.useBlockParams) {
                    options.blockParams = "blockParams"
                }
                return options
            },
            setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
                var options = this.setupParams(helper, paramSize, params);
                options = this.objectLiteral(options);
                if (useRegister) {
                    this.useRegister("options");
                    params.push("options");
                    return ["options=", options]
                } else if (params) {
                    params.push(options);
                    return ""
                } else {
                    return options
                }
            }
        };
        (function() {
            var reservedWords = ("break else new var" + " case finally return void" + " catch for switch while" + " continue function this with" + " default if throw" + " delete in try" + " do instanceof typeof" + " abstract enum int short" + " boolean export interface static" + " byte extends long super" + " char final native synchronized" + " class float package throws" + " const goto private transient" + " debugger implements protected volatile" + " double import public let yield await" + " null true false").split(" ");
            var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};
            for (var i = 0, l = reservedWords.length; i < l; i++) {
                compilerWords[reservedWords[i]] = true
            }
        })();
        JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
            return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name)
        };

        function strictLookup(requireTerminal, compiler, parts, type) {
            var stack = compiler.popStack(),
                i = 0,
                len = parts.length;
            if (requireTerminal) {
                len--
            }
            for (; i < len; i++) {
                stack = compiler.nameLookup(stack, parts[i], type)
            }
            if (requireTerminal) {
                return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[i]), ")"]
            } else {
                return stack
            }
        }
        exports["default"] = JavaScriptCompiler;
        module.exports = exports["default"]
    }, {
        "../base": 5,
        "../exception": 18,
        "../utils": 31,
        "./code-gen": 8
    }],
    12: [function(require, module, exports) {
        "use strict";
        var handlebars = function() {
            var parser = {
                trace: function trace() {},
                yy: {},
                symbols_: {
                    error: 2,
                    root: 3,
                    program: 4,
                    EOF: 5,
                    program_repetition0: 6,
                    statement: 7,
                    mustache: 8,
                    block: 9,
                    rawBlock: 10,
                    partial: 11,
                    partialBlock: 12,
                    content: 13,
                    COMMENT: 14,
                    CONTENT: 15,
                    openRawBlock: 16,
                    rawBlock_repetition_plus0: 17,
                    END_RAW_BLOCK: 18,
                    OPEN_RAW_BLOCK: 19,
                    helperName: 20,
                    openRawBlock_repetition0: 21,
                    openRawBlock_option0: 22,
                    CLOSE_RAW_BLOCK: 23,
                    openBlock: 24,
                    block_option0: 25,
                    closeBlock: 26,
                    openInverse: 27,
                    block_option1: 28,
                    OPEN_BLOCK: 29,
                    openBlock_repetition0: 30,
                    openBlock_option0: 31,
                    openBlock_option1: 32,
                    CLOSE: 33,
                    OPEN_INVERSE: 34,
                    openInverse_repetition0: 35,
                    openInverse_option0: 36,
                    openInverse_option1: 37,
                    openInverseChain: 38,
                    OPEN_INVERSE_CHAIN: 39,
                    openInverseChain_repetition0: 40,
                    openInverseChain_option0: 41,
                    openInverseChain_option1: 42,
                    inverseAndProgram: 43,
                    INVERSE: 44,
                    inverseChain: 45,
                    inverseChain_option0: 46,
                    OPEN_ENDBLOCK: 47,
                    OPEN: 48,
                    mustache_repetition0: 49,
                    mustache_option0: 50,
                    OPEN_UNESCAPED: 51,
                    mustache_repetition1: 52,
                    mustache_option1: 53,
                    CLOSE_UNESCAPED: 54,
                    OPEN_PARTIAL: 55,
                    partialName: 56,
                    partial_repetition0: 57,
                    partial_option0: 58,
                    openPartialBlock: 59,
                    OPEN_PARTIAL_BLOCK: 60,
                    openPartialBlock_repetition0: 61,
                    openPartialBlock_option0: 62,
                    param: 63,
                    sexpr: 64,
                    OPEN_SEXPR: 65,
                    sexpr_repetition0: 66,
                    sexpr_option0: 67,
                    CLOSE_SEXPR: 68,
                    hash: 69,
                    hash_repetition_plus0: 70,
                    hashSegment: 71,
                    ID: 72,
                    EQUALS: 73,
                    blockParams: 74,
                    OPEN_BLOCK_PARAMS: 75,
                    blockParams_repetition_plus0: 76,
                    CLOSE_BLOCK_PARAMS: 77,
                    path: 78,
                    dataName: 79,
                    STRING: 80,
                    NUMBER: 81,
                    BOOLEAN: 82,
                    UNDEFINED: 83,
                    NULL: 84,
                    DATA: 85,
                    pathSegments: 86,
                    SEP: 87,
                    $accept: 0,
                    $end: 1
                },
                terminals_: {
                    2: "error",
                    5: "EOF",
                    14: "COMMENT",
                    15: "CONTENT",
                    18: "END_RAW_BLOCK",
                    19: "OPEN_RAW_BLOCK",
                    23: "CLOSE_RAW_BLOCK",
                    29: "OPEN_BLOCK",
                    33: "CLOSE",
                    34: "OPEN_INVERSE",
                    39: "OPEN_INVERSE_CHAIN",
                    44: "INVERSE",
                    47: "OPEN_ENDBLOCK",
                    48: "OPEN",
                    51: "OPEN_UNESCAPED",
                    54: "CLOSE_UNESCAPED",
                    55: "OPEN_PARTIAL",
                    60: "OPEN_PARTIAL_BLOCK",
                    65: "OPEN_SEXPR",
                    68: "CLOSE_SEXPR",
                    72: "ID",
                    73: "EQUALS",
                    75: "OPEN_BLOCK_PARAMS",
                    77: "CLOSE_BLOCK_PARAMS",
                    80: "STRING",
                    81: "NUMBER",
                    82: "BOOLEAN",
                    83: "UNDEFINED",
                    84: "NULL",
                    85: "DATA",
                    87: "SEP"
                },
                productions_: [0, [3, 2],
                    [4, 1],
                    [7, 1],
                    [7, 1],
                    [7, 1],
                    [7, 1],
                    [7, 1],
                    [7, 1],
                    [7, 1],
                    [13, 1],
                    [10, 3],
                    [16, 5],
                    [9, 4],
                    [9, 4],
                    [24, 6],
                    [27, 6],
                    [38, 6],
                    [43, 2],
                    [45, 3],
                    [45, 1],
                    [26, 3],
                    [8, 5],
                    [8, 5],
                    [11, 5],
                    [12, 3],
                    [59, 5],
                    [63, 1],
                    [63, 1],
                    [64, 5],
                    [69, 1],
                    [71, 3],
                    [74, 3],
                    [20, 1],
                    [20, 1],
                    [20, 1],
                    [20, 1],
                    [20, 1],
                    [20, 1],
                    [20, 1],
                    [56, 1],
                    [56, 1],
                    [79, 2],
                    [78, 1],
                    [86, 3],
                    [86, 1],
                    [6, 0],
                    [6, 2],
                    [17, 1],
                    [17, 2],
                    [21, 0],
                    [21, 2],
                    [22, 0],
                    [22, 1],
                    [25, 0],
                    [25, 1],
                    [28, 0],
                    [28, 1],
                    [30, 0],
                    [30, 2],
                    [31, 0],
                    [31, 1],
                    [32, 0],
                    [32, 1],
                    [35, 0],
                    [35, 2],
                    [36, 0],
                    [36, 1],
                    [37, 0],
                    [37, 1],
                    [40, 0],
                    [40, 2],
                    [41, 0],
                    [41, 1],
                    [42, 0],
                    [42, 1],
                    [46, 0],
                    [46, 1],
                    [49, 0],
                    [49, 2],
                    [50, 0],
                    [50, 1],
                    [52, 0],
                    [52, 2],
                    [53, 0],
                    [53, 1],
                    [57, 0],
                    [57, 2],
                    [58, 0],
                    [58, 1],
                    [61, 0],
                    [61, 2],
                    [62, 0],
                    [62, 1],
                    [66, 0],
                    [66, 2],
                    [67, 0],
                    [67, 1],
                    [70, 1],
                    [70, 2],
                    [76, 1],
                    [76, 2]
                ],
                performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
                    var $0 = $$.length - 1;
                    switch (yystate) {
                        case 1:
                            return $$[$0 - 1];
                            break;
                        case 2:
                            this.$ = yy.prepareProgram($$[$0]);
                            break;
                        case 3:
                            this.$ = $$[$0];
                            break;
                        case 4:
                            this.$ = $$[$0];
                            break;
                        case 5:
                            this.$ = $$[$0];
                            break;
                        case 6:
                            this.$ = $$[$0];
                            break;
                        case 7:
                            this.$ = $$[$0];
                            break;
                        case 8:
                            this.$ = $$[$0];
                            break;
                        case 9:
                            this.$ = {
                                type: "CommentStatement",
                                value: yy.stripComment($$[$0]),
                                strip: yy.stripFlags($$[$0], $$[$0]),
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 10:
                            this.$ = {
                                type: "ContentStatement",
                                original: $$[$0],
                                value: $$[$0],
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 11:
                            this.$ = yy.prepareRawBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
                            break;
                        case 12:
                            this.$ = {
                                path: $$[$0 - 3],
                                params: $$[$0 - 2],
                                hash: $$[$0 - 1]
                            };
                            break;
                        case 13:
                            this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], false, this._$);
                            break;
                        case 14:
                            this.$ = yy.prepareBlock($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0], true, this._$);
                            break;
                        case 15:
                            this.$ = {
                                open: $$[$0 - 5],
                                path: $$[$0 - 4],
                                params: $$[$0 - 3],
                                hash: $$[$0 - 2],
                                blockParams: $$[$0 - 1],
                                strip: yy.stripFlags($$[$0 - 5], $$[$0])
                            };
                            break;
                        case 16:
                            this.$ = {
                                path: $$[$0 - 4],
                                params: $$[$0 - 3],
                                hash: $$[$0 - 2],
                                blockParams: $$[$0 - 1],
                                strip: yy.stripFlags($$[$0 - 5], $$[$0])
                            };
                            break;
                        case 17:
                            this.$ = {
                                path: $$[$0 - 4],
                                params: $$[$0 - 3],
                                hash: $$[$0 - 2],
                                blockParams: $$[$0 - 1],
                                strip: yy.stripFlags($$[$0 - 5], $$[$0])
                            };
                            break;
                        case 18:
                            this.$ = {
                                strip: yy.stripFlags($$[$0 - 1], $$[$0 - 1]),
                                program: $$[$0]
                            };
                            break;
                        case 19:
                            var inverse = yy.prepareBlock($$[$0 - 2], $$[$0 - 1], $$[$0], $$[$0], false, this._$),
                                program = yy.prepareProgram([inverse], $$[$0 - 1].loc);
                            program.chained = true;
                            this.$ = {
                                strip: $$[$0 - 2].strip,
                                program: program,
                                chain: true
                            };
                            break;
                        case 20:
                            this.$ = $$[$0];
                            break;
                        case 21:
                            this.$ = {
                                path: $$[$0 - 1],
                                strip: yy.stripFlags($$[$0 - 2], $$[$0])
                            };
                            break;
                        case 22:
                            this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
                            break;
                        case 23:
                            this.$ = yy.prepareMustache($$[$0 - 3], $$[$0 - 2], $$[$0 - 1], $$[$0 - 4], yy.stripFlags($$[$0 - 4], $$[$0]), this._$);
                            break;
                        case 24:
                            this.$ = {
                                type: "PartialStatement",
                                name: $$[$0 - 3],
                                params: $$[$0 - 2],
                                hash: $$[$0 - 1],
                                indent: "",
                                strip: yy.stripFlags($$[$0 - 4], $$[$0]),
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 25:
                            this.$ = yy.preparePartialBlock($$[$0 - 2], $$[$0 - 1], $$[$0], this._$);
                            break;
                        case 26:
                            this.$ = {
                                path: $$[$0 - 3],
                                params: $$[$0 - 2],
                                hash: $$[$0 - 1],
                                strip: yy.stripFlags($$[$0 - 4], $$[$0])
                            };
                            break;
                        case 27:
                            this.$ = $$[$0];
                            break;
                        case 28:
                            this.$ = $$[$0];
                            break;
                        case 29:
                            this.$ = {
                                type: "SubExpression",
                                path: $$[$0 - 3],
                                params: $$[$0 - 2],
                                hash: $$[$0 - 1],
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 30:
                            this.$ = {
                                type: "Hash",
                                pairs: $$[$0],
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 31:
                            this.$ = {
                                type: "HashPair",
                                key: yy.id($$[$0 - 2]),
                                value: $$[$0],
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 32:
                            this.$ = yy.id($$[$0 - 1]);
                            break;
                        case 33:
                            this.$ = $$[$0];
                            break;
                        case 34:
                            this.$ = $$[$0];
                            break;
                        case 35:
                            this.$ = {
                                type: "StringLiteral",
                                value: $$[$0],
                                original: $$[$0],
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 36:
                            this.$ = {
                                type: "NumberLiteral",
                                value: Number($$[$0]),
                                original: Number($$[$0]),
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 37:
                            this.$ = {
                                type: "BooleanLiteral",
                                value: $$[$0] === "true",
                                original: $$[$0] === "true",
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 38:
                            this.$ = {
                                type: "UndefinedLiteral",
                                original: undefined,
                                value: undefined,
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 39:
                            this.$ = {
                                type: "NullLiteral",
                                original: null,
                                value: null,
                                loc: yy.locInfo(this._$)
                            };
                            break;
                        case 40:
                            this.$ = $$[$0];
                            break;
                        case 41:
                            this.$ = $$[$0];
                            break;
                        case 42:
                            this.$ = yy.preparePath(true, $$[$0], this._$);
                            break;
                        case 43:
                            this.$ = yy.preparePath(false, $$[$0], this._$);
                            break;
                        case 44:
                            $$[$0 - 2].push({
                                part: yy.id($$[$0]),
                                original: $$[$0],
                                separator: $$[$0 - 1]
                            });
                            this.$ = $$[$0 - 2];
                            break;
                        case 45:
                            this.$ = [{
                                part: yy.id($$[$0]),
                                original: $$[$0]
                            }];
                            break;
                        case 46:
                            this.$ = [];
                            break;
                        case 47:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 48:
                            this.$ = [$$[$0]];
                            break;
                        case 49:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 50:
                            this.$ = [];
                            break;
                        case 51:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 58:
                            this.$ = [];
                            break;
                        case 59:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 64:
                            this.$ = [];
                            break;
                        case 65:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 70:
                            this.$ = [];
                            break;
                        case 71:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 78:
                            this.$ = [];
                            break;
                        case 79:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 82:
                            this.$ = [];
                            break;
                        case 83:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 86:
                            this.$ = [];
                            break;
                        case 87:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 90:
                            this.$ = [];
                            break;
                        case 91:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 94:
                            this.$ = [];
                            break;
                        case 95:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 98:
                            this.$ = [$$[$0]];
                            break;
                        case 99:
                            $$[$0 - 1].push($$[$0]);
                            break;
                        case 100:
                            this.$ = [$$[$0]];
                            break;
                        case 101:
                            $$[$0 - 1].push($$[$0]);
                            break
                    }
                },
                table: [{
                    3: 1,
                    4: 2,
                    5: [2, 46],
                    6: 3,
                    14: [2, 46],
                    15: [2, 46],
                    19: [2, 46],
                    29: [2, 46],
                    34: [2, 46],
                    48: [2, 46],
                    51: [2, 46],
                    55: [2, 46],
                    60: [2, 46]
                }, {
                    1: [3]
                }, {
                    5: [1, 4]
                }, {
                    5: [2, 2],
                    7: 5,
                    8: 6,
                    9: 7,
                    10: 8,
                    11: 9,
                    12: 10,
                    13: 11,
                    14: [1, 12],
                    15: [1, 20],
                    16: 17,
                    19: [1, 23],
                    24: 15,
                    27: 16,
                    29: [1, 21],
                    34: [1, 22],
                    39: [2, 2],
                    44: [2, 2],
                    47: [2, 2],
                    48: [1, 13],
                    51: [1, 14],
                    55: [1, 18],
                    59: 19,
                    60: [1, 24]
                }, {
                    1: [2, 1]
                }, {
                    5: [2, 47],
                    14: [2, 47],
                    15: [2, 47],
                    19: [2, 47],
                    29: [2, 47],
                    34: [2, 47],
                    39: [2, 47],
                    44: [2, 47],
                    47: [2, 47],
                    48: [2, 47],
                    51: [2, 47],
                    55: [2, 47],
                    60: [2, 47]
                }, {
                    5: [2, 3],
                    14: [2, 3],
                    15: [2, 3],
                    19: [2, 3],
                    29: [2, 3],
                    34: [2, 3],
                    39: [2, 3],
                    44: [2, 3],
                    47: [2, 3],
                    48: [2, 3],
                    51: [2, 3],
                    55: [2, 3],
                    60: [2, 3]
                }, {
                    5: [2, 4],
                    14: [2, 4],
                    15: [2, 4],
                    19: [2, 4],
                    29: [2, 4],
                    34: [2, 4],
                    39: [2, 4],
                    44: [2, 4],
                    47: [2, 4],
                    48: [2, 4],
                    51: [2, 4],
                    55: [2, 4],
                    60: [2, 4]
                }, {
                    5: [2, 5],
                    14: [2, 5],
                    15: [2, 5],
                    19: [2, 5],
                    29: [2, 5],
                    34: [2, 5],
                    39: [2, 5],
                    44: [2, 5],
                    47: [2, 5],
                    48: [2, 5],
                    51: [2, 5],
                    55: [2, 5],
                    60: [2, 5]
                }, {
                    5: [2, 6],
                    14: [2, 6],
                    15: [2, 6],
                    19: [2, 6],
                    29: [2, 6],
                    34: [2, 6],
                    39: [2, 6],
                    44: [2, 6],
                    47: [2, 6],
                    48: [2, 6],
                    51: [2, 6],
                    55: [2, 6],
                    60: [2, 6]
                }, {
                    5: [2, 7],
                    14: [2, 7],
                    15: [2, 7],
                    19: [2, 7],
                    29: [2, 7],
                    34: [2, 7],
                    39: [2, 7],
                    44: [2, 7],
                    47: [2, 7],
                    48: [2, 7],
                    51: [2, 7],
                    55: [2, 7],
                    60: [2, 7]
                }, {
                    5: [2, 8],
                    14: [2, 8],
                    15: [2, 8],
                    19: [2, 8],
                    29: [2, 8],
                    34: [2, 8],
                    39: [2, 8],
                    44: [2, 8],
                    47: [2, 8],
                    48: [2, 8],
                    51: [2, 8],
                    55: [2, 8],
                    60: [2, 8]
                }, {
                    5: [2, 9],
                    14: [2, 9],
                    15: [2, 9],
                    19: [2, 9],
                    29: [2, 9],
                    34: [2, 9],
                    39: [2, 9],
                    44: [2, 9],
                    47: [2, 9],
                    48: [2, 9],
                    51: [2, 9],
                    55: [2, 9],
                    60: [2, 9]
                }, {
                    20: 25,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 36,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    4: 37,
                    6: 3,
                    14: [2, 46],
                    15: [2, 46],
                    19: [2, 46],
                    29: [2, 46],
                    34: [2, 46],
                    39: [2, 46],
                    44: [2, 46],
                    47: [2, 46],
                    48: [2, 46],
                    51: [2, 46],
                    55: [2, 46],
                    60: [2, 46]
                }, {
                    4: 38,
                    6: 3,
                    14: [2, 46],
                    15: [2, 46],
                    19: [2, 46],
                    29: [2, 46],
                    34: [2, 46],
                    44: [2, 46],
                    47: [2, 46],
                    48: [2, 46],
                    51: [2, 46],
                    55: [2, 46],
                    60: [2, 46]
                }, {
                    13: 40,
                    15: [1, 20],
                    17: 39
                }, {
                    20: 42,
                    56: 41,
                    64: 43,
                    65: [1, 44],
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    4: 45,
                    6: 3,
                    14: [2, 46],
                    15: [2, 46],
                    19: [2, 46],
                    29: [2, 46],
                    34: [2, 46],
                    47: [2, 46],
                    48: [2, 46],
                    51: [2, 46],
                    55: [2, 46],
                    60: [2, 46]
                }, {
                    5: [2, 10],
                    14: [2, 10],
                    15: [2, 10],
                    18: [2, 10],
                    19: [2, 10],
                    29: [2, 10],
                    34: [2, 10],
                    39: [2, 10],
                    44: [2, 10],
                    47: [2, 10],
                    48: [2, 10],
                    51: [2, 10],
                    55: [2, 10],
                    60: [2, 10]
                }, {
                    20: 46,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 47,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 48,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 42,
                    56: 49,
                    64: 43,
                    65: [1, 44],
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    33: [2, 78],
                    49: 50,
                    65: [2, 78],
                    72: [2, 78],
                    80: [2, 78],
                    81: [2, 78],
                    82: [2, 78],
                    83: [2, 78],
                    84: [2, 78],
                    85: [2, 78]
                }, {
                    23: [2, 33],
                    33: [2, 33],
                    54: [2, 33],
                    65: [2, 33],
                    68: [2, 33],
                    72: [2, 33],
                    75: [2, 33],
                    80: [2, 33],
                    81: [2, 33],
                    82: [2, 33],
                    83: [2, 33],
                    84: [2, 33],
                    85: [2, 33]
                }, {
                    23: [2, 34],
                    33: [2, 34],
                    54: [2, 34],
                    65: [2, 34],
                    68: [2, 34],
                    72: [2, 34],
                    75: [2, 34],
                    80: [2, 34],
                    81: [2, 34],
                    82: [2, 34],
                    83: [2, 34],
                    84: [2, 34],
                    85: [2, 34]
                }, {
                    23: [2, 35],
                    33: [2, 35],
                    54: [2, 35],
                    65: [2, 35],
                    68: [2, 35],
                    72: [2, 35],
                    75: [2, 35],
                    80: [2, 35],
                    81: [2, 35],
                    82: [2, 35],
                    83: [2, 35],
                    84: [2, 35],
                    85: [2, 35]
                }, {
                    23: [2, 36],
                    33: [2, 36],
                    54: [2, 36],
                    65: [2, 36],
                    68: [2, 36],
                    72: [2, 36],
                    75: [2, 36],
                    80: [2, 36],
                    81: [2, 36],
                    82: [2, 36],
                    83: [2, 36],
                    84: [2, 36],
                    85: [2, 36]
                }, {
                    23: [2, 37],
                    33: [2, 37],
                    54: [2, 37],
                    65: [2, 37],
                    68: [2, 37],
                    72: [2, 37],
                    75: [2, 37],
                    80: [2, 37],
                    81: [2, 37],
                    82: [2, 37],
                    83: [2, 37],
                    84: [2, 37],
                    85: [2, 37]
                }, {
                    23: [2, 38],
                    33: [2, 38],
                    54: [2, 38],
                    65: [2, 38],
                    68: [2, 38],
                    72: [2, 38],
                    75: [2, 38],
                    80: [2, 38],
                    81: [2, 38],
                    82: [2, 38],
                    83: [2, 38],
                    84: [2, 38],
                    85: [2, 38]
                }, {
                    23: [2, 39],
                    33: [2, 39],
                    54: [2, 39],
                    65: [2, 39],
                    68: [2, 39],
                    72: [2, 39],
                    75: [2, 39],
                    80: [2, 39],
                    81: [2, 39],
                    82: [2, 39],
                    83: [2, 39],
                    84: [2, 39],
                    85: [2, 39]
                }, {
                    23: [2, 43],
                    33: [2, 43],
                    54: [2, 43],
                    65: [2, 43],
                    68: [2, 43],
                    72: [2, 43],
                    75: [2, 43],
                    80: [2, 43],
                    81: [2, 43],
                    82: [2, 43],
                    83: [2, 43],
                    84: [2, 43],
                    85: [2, 43],
                    87: [1, 51]
                }, {
                    72: [1, 35],
                    86: 52
                }, {
                    23: [2, 45],
                    33: [2, 45],
                    54: [2, 45],
                    65: [2, 45],
                    68: [2, 45],
                    72: [2, 45],
                    75: [2, 45],
                    80: [2, 45],
                    81: [2, 45],
                    82: [2, 45],
                    83: [2, 45],
                    84: [2, 45],
                    85: [2, 45],
                    87: [2, 45]
                }, {
                    52: 53,
                    54: [2, 82],
                    65: [2, 82],
                    72: [2, 82],
                    80: [2, 82],
                    81: [2, 82],
                    82: [2, 82],
                    83: [2, 82],
                    84: [2, 82],
                    85: [2, 82]
                }, {
                    25: 54,
                    38: 56,
                    39: [1, 58],
                    43: 57,
                    44: [1, 59],
                    45: 55,
                    47: [2, 54]
                }, {
                    28: 60,
                    43: 61,
                    44: [1, 59],
                    47: [2, 56]
                }, {
                    13: 63,
                    15: [1, 20],
                    18: [1, 62]
                }, {
                    15: [2, 48],
                    18: [2, 48]
                }, {
                    33: [2, 86],
                    57: 64,
                    65: [2, 86],
                    72: [2, 86],
                    80: [2, 86],
                    81: [2, 86],
                    82: [2, 86],
                    83: [2, 86],
                    84: [2, 86],
                    85: [2, 86]
                }, {
                    33: [2, 40],
                    65: [2, 40],
                    72: [2, 40],
                    80: [2, 40],
                    81: [2, 40],
                    82: [2, 40],
                    83: [2, 40],
                    84: [2, 40],
                    85: [2, 40]
                }, {
                    33: [2, 41],
                    65: [2, 41],
                    72: [2, 41],
                    80: [2, 41],
                    81: [2, 41],
                    82: [2, 41],
                    83: [2, 41],
                    84: [2, 41],
                    85: [2, 41]
                }, {
                    20: 65,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    26: 66,
                    47: [1, 67]
                }, {
                    30: 68,
                    33: [2, 58],
                    65: [2, 58],
                    72: [2, 58],
                    75: [2, 58],
                    80: [2, 58],
                    81: [2, 58],
                    82: [2, 58],
                    83: [2, 58],
                    84: [2, 58],
                    85: [2, 58]
                }, {
                    33: [2, 64],
                    35: 69,
                    65: [2, 64],
                    72: [2, 64],
                    75: [2, 64],
                    80: [2, 64],
                    81: [2, 64],
                    82: [2, 64],
                    83: [2, 64],
                    84: [2, 64],
                    85: [2, 64]
                }, {
                    21: 70,
                    23: [2, 50],
                    65: [2, 50],
                    72: [2, 50],
                    80: [2, 50],
                    81: [2, 50],
                    82: [2, 50],
                    83: [2, 50],
                    84: [2, 50],
                    85: [2, 50]
                }, {
                    33: [2, 90],
                    61: 71,
                    65: [2, 90],
                    72: [2, 90],
                    80: [2, 90],
                    81: [2, 90],
                    82: [2, 90],
                    83: [2, 90],
                    84: [2, 90],
                    85: [2, 90]
                }, {
                    20: 75,
                    33: [2, 80],
                    50: 72,
                    63: 73,
                    64: 76,
                    65: [1, 44],
                    69: 74,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    72: [1, 80]
                }, {
                    23: [2, 42],
                    33: [2, 42],
                    54: [2, 42],
                    65: [2, 42],
                    68: [2, 42],
                    72: [2, 42],
                    75: [2, 42],
                    80: [2, 42],
                    81: [2, 42],
                    82: [2, 42],
                    83: [2, 42],
                    84: [2, 42],
                    85: [2, 42],
                    87: [1, 51]
                }, {
                    20: 75,
                    53: 81,
                    54: [2, 84],
                    63: 82,
                    64: 76,
                    65: [1, 44],
                    69: 83,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    26: 84,
                    47: [1, 67]
                }, {
                    47: [2, 55]
                }, {
                    4: 85,
                    6: 3,
                    14: [2, 46],
                    15: [2, 46],
                    19: [2, 46],
                    29: [2, 46],
                    34: [2, 46],
                    39: [2, 46],
                    44: [2, 46],
                    47: [2, 46],
                    48: [2, 46],
                    51: [2, 46],
                    55: [2, 46],
                    60: [2, 46]
                }, {
                    47: [2, 20]
                }, {
                    20: 86,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    4: 87,
                    6: 3,
                    14: [2, 46],
                    15: [2, 46],
                    19: [2, 46],
                    29: [2, 46],
                    34: [2, 46],
                    47: [2, 46],
                    48: [2, 46],
                    51: [2, 46],
                    55: [2, 46],
                    60: [2, 46]
                }, {
                    26: 88,
                    47: [1, 67]
                }, {
                    47: [2, 57]
                }, {
                    5: [2, 11],
                    14: [2, 11],
                    15: [2, 11],
                    19: [2, 11],
                    29: [2, 11],
                    34: [2, 11],
                    39: [2, 11],
                    44: [2, 11],
                    47: [2, 11],
                    48: [2, 11],
                    51: [2, 11],
                    55: [2, 11],
                    60: [2, 11]
                }, {
                    15: [2, 49],
                    18: [2, 49]
                }, {
                    20: 75,
                    33: [2, 88],
                    58: 89,
                    63: 90,
                    64: 76,
                    65: [1, 44],
                    69: 91,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    65: [2, 94],
                    66: 92,
                    68: [2, 94],
                    72: [2, 94],
                    80: [2, 94],
                    81: [2, 94],
                    82: [2, 94],
                    83: [2, 94],
                    84: [2, 94],
                    85: [2, 94]
                }, {
                    5: [2, 25],
                    14: [2, 25],
                    15: [2, 25],
                    19: [2, 25],
                    29: [2, 25],
                    34: [2, 25],
                    39: [2, 25],
                    44: [2, 25],
                    47: [2, 25],
                    48: [2, 25],
                    51: [2, 25],
                    55: [2, 25],
                    60: [2, 25]
                }, {
                    20: 93,
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 75,
                    31: 94,
                    33: [2, 60],
                    63: 95,
                    64: 76,
                    65: [1, 44],
                    69: 96,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    75: [2, 60],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 75,
                    33: [2, 66],
                    36: 97,
                    63: 98,
                    64: 76,
                    65: [1, 44],
                    69: 99,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    75: [2, 66],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 75,
                    22: 100,
                    23: [2, 52],
                    63: 101,
                    64: 76,
                    65: [1, 44],
                    69: 102,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    20: 75,
                    33: [2, 92],
                    62: 103,
                    63: 104,
                    64: 76,
                    65: [1, 44],
                    69: 105,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    33: [1, 106]
                }, {
                    33: [2, 79],
                    65: [2, 79],
                    72: [2, 79],
                    80: [2, 79],
                    81: [2, 79],
                    82: [2, 79],
                    83: [2, 79],
                    84: [2, 79],
                    85: [2, 79]
                }, {
                    33: [2, 81]
                }, {
                    23: [2, 27],
                    33: [2, 27],
                    54: [2, 27],
                    65: [2, 27],
                    68: [2, 27],
                    72: [2, 27],
                    75: [2, 27],
                    80: [2, 27],
                    81: [2, 27],
                    82: [2, 27],
                    83: [2, 27],
                    84: [2, 27],
                    85: [2, 27]
                }, {
                    23: [2, 28],
                    33: [2, 28],
                    54: [2, 28],
                    65: [2, 28],
                    68: [2, 28],
                    72: [2, 28],
                    75: [2, 28],
                    80: [2, 28],
                    81: [2, 28],
                    82: [2, 28],
                    83: [2, 28],
                    84: [2, 28],
                    85: [2, 28]
                }, {
                    23: [2, 30],
                    33: [2, 30],
                    54: [2, 30],
                    68: [2, 30],
                    71: 107,
                    72: [1, 108],
                    75: [2, 30]
                }, {
                    23: [2, 98],
                    33: [2, 98],
                    54: [2, 98],
                    68: [2, 98],
                    72: [2, 98],
                    75: [2, 98]
                }, {
                    23: [2, 45],
                    33: [2, 45],
                    54: [2, 45],
                    65: [2, 45],
                    68: [2, 45],
                    72: [2, 45],
                    73: [1, 109],
                    75: [2, 45],
                    80: [2, 45],
                    81: [2, 45],
                    82: [2, 45],
                    83: [2, 45],
                    84: [2, 45],
                    85: [2, 45],
                    87: [2, 45]
                }, {
                    23: [2, 44],
                    33: [2, 44],
                    54: [2, 44],
                    65: [2, 44],
                    68: [2, 44],
                    72: [2, 44],
                    75: [2, 44],
                    80: [2, 44],
                    81: [2, 44],
                    82: [2, 44],
                    83: [2, 44],
                    84: [2, 44],
                    85: [2, 44],
                    87: [2, 44]
                }, {
                    54: [1, 110]
                }, {
                    54: [2, 83],
                    65: [2, 83],
                    72: [2, 83],
                    80: [2, 83],
                    81: [2, 83],
                    82: [2, 83],
                    83: [2, 83],
                    84: [2, 83],
                    85: [2, 83]
                }, {
                    54: [2, 85]
                }, {
                    5: [2, 13],
                    14: [2, 13],
                    15: [2, 13],
                    19: [2, 13],
                    29: [2, 13],
                    34: [2, 13],
                    39: [2, 13],
                    44: [2, 13],
                    47: [2, 13],
                    48: [2, 13],
                    51: [2, 13],
                    55: [2, 13],
                    60: [2, 13]
                }, {
                    38: 56,
                    39: [1, 58],
                    43: 57,
                    44: [1, 59],
                    45: 112,
                    46: 111,
                    47: [2, 76]
                }, {
                    33: [2, 70],
                    40: 113,
                    65: [2, 70],
                    72: [2, 70],
                    75: [2, 70],
                    80: [2, 70],
                    81: [2, 70],
                    82: [2, 70],
                    83: [2, 70],
                    84: [2, 70],
                    85: [2, 70]
                }, {
                    47: [2, 18]
                }, {
                    5: [2, 14],
                    14: [2, 14],
                    15: [2, 14],
                    19: [2, 14],
                    29: [2, 14],
                    34: [2, 14],
                    39: [2, 14],
                    44: [2, 14],
                    47: [2, 14],
                    48: [2, 14],
                    51: [2, 14],
                    55: [2, 14],
                    60: [2, 14]
                }, {
                    33: [1, 114]
                }, {
                    33: [2, 87],
                    65: [2, 87],
                    72: [2, 87],
                    80: [2, 87],
                    81: [2, 87],
                    82: [2, 87],
                    83: [2, 87],
                    84: [2, 87],
                    85: [2, 87]
                }, {
                    33: [2, 89]
                }, {
                    20: 75,
                    63: 116,
                    64: 76,
                    65: [1, 44],
                    67: 115,
                    68: [2, 96],
                    69: 117,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    33: [1, 118]
                }, {
                    32: 119,
                    33: [2, 62],
                    74: 120,
                    75: [1, 121]
                }, {
                    33: [2, 59],
                    65: [2, 59],
                    72: [2, 59],
                    75: [2, 59],
                    80: [2, 59],
                    81: [2, 59],
                    82: [2, 59],
                    83: [2, 59],
                    84: [2, 59],
                    85: [2, 59]
                }, {
                    33: [2, 61],
                    75: [2, 61]
                }, {
                    33: [2, 68],
                    37: 122,
                    74: 123,
                    75: [1, 121]
                }, {
                    33: [2, 65],
                    65: [2, 65],
                    72: [2, 65],
                    75: [2, 65],
                    80: [2, 65],
                    81: [2, 65],
                    82: [2, 65],
                    83: [2, 65],
                    84: [2, 65],
                    85: [2, 65]
                }, {
                    33: [2, 67],
                    75: [2, 67]
                }, {
                    23: [1, 124]
                }, {
                    23: [2, 51],
                    65: [2, 51],
                    72: [2, 51],
                    80: [2, 51],
                    81: [2, 51],
                    82: [2, 51],
                    83: [2, 51],
                    84: [2, 51],
                    85: [2, 51]
                }, {
                    23: [2, 53]
                }, {
                    33: [1, 125]
                }, {
                    33: [2, 91],
                    65: [2, 91],
                    72: [2, 91],
                    80: [2, 91],
                    81: [2, 91],
                    82: [2, 91],
                    83: [2, 91],
                    84: [2, 91],
                    85: [2, 91]
                }, {
                    33: [2, 93]
                }, {
                    5: [2, 22],
                    14: [2, 22],
                    15: [2, 22],
                    19: [2, 22],
                    29: [2, 22],
                    34: [2, 22],
                    39: [2, 22],
                    44: [2, 22],
                    47: [2, 22],
                    48: [2, 22],
                    51: [2, 22],
                    55: [2, 22],
                    60: [2, 22]
                }, {
                    23: [2, 99],
                    33: [2, 99],
                    54: [2, 99],
                    68: [2, 99],
                    72: [2, 99],
                    75: [2, 99]
                }, {
                    73: [1, 109]
                }, {
                    20: 75,
                    63: 126,
                    64: 76,
                    65: [1, 44],
                    72: [1, 35],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    5: [2, 23],
                    14: [2, 23],
                    15: [2, 23],
                    19: [2, 23],
                    29: [2, 23],
                    34: [2, 23],
                    39: [2, 23],
                    44: [2, 23],
                    47: [2, 23],
                    48: [2, 23],
                    51: [2, 23],
                    55: [2, 23],
                    60: [2, 23]
                }, {
                    47: [2, 19]
                }, {
                    47: [2, 77]
                }, {
                    20: 75,
                    33: [2, 72],
                    41: 127,
                    63: 128,
                    64: 76,
                    65: [1, 44],
                    69: 129,
                    70: 77,
                    71: 78,
                    72: [1, 79],
                    75: [2, 72],
                    78: 26,
                    79: 27,
                    80: [1, 28],
                    81: [1, 29],
                    82: [1, 30],
                    83: [1, 31],
                    84: [1, 32],
                    85: [1, 34],
                    86: 33
                }, {
                    5: [2, 24],
                    14: [2, 24],
                    15: [2, 24],
                    19: [2, 24],
                    29: [2, 24],
                    34: [2, 24],
                    39: [2, 24],
                    44: [2, 24],
                    47: [2, 24],
                    48: [2, 24],
                    51: [2, 24],
                    55: [2, 24],
                    60: [2, 24]
                }, {
                    68: [1, 130]
                }, {
                    65: [2, 95],
                    68: [2, 95],
                    72: [2, 95],
                    80: [2, 95],
                    81: [2, 95],
                    82: [2, 95],
                    83: [2, 95],
                    84: [2, 95],
                    85: [2, 95]
                }, {
                    68: [2, 97]
                }, {
                    5: [2, 21],
                    14: [2, 21],
                    15: [2, 21],
                    19: [2, 21],
                    29: [2, 21],
                    34: [2, 21],
                    39: [2, 21],
                    44: [2, 21],
                    47: [2, 21],
                    48: [2, 21],
                    51: [2, 21],
                    55: [2, 21],
                    60: [2, 21]
                }, {
                    33: [1, 131]
                }, {
                    33: [2, 63]
                }, {
                    72: [1, 133],
                    76: 132
                }, {
                    33: [1, 134]
                }, {
                    33: [2, 69]
                }, {
                    15: [2, 12]
                }, {
                    14: [2, 26],
                    15: [2, 26],
                    19: [2, 26],
                    29: [2, 26],
                    34: [2, 26],
                    47: [2, 26],
                    48: [2, 26],
                    51: [2, 26],
                    55: [2, 26],
                    60: [2, 26]
                }, {
                    23: [2, 31],
                    33: [2, 31],
                    54: [2, 31],
                    68: [2, 31],
                    72: [2, 31],
                    75: [2, 31]
                }, {
                    33: [2, 74],
                    42: 135,
                    74: 136,
                    75: [1, 121]
                }, {
                    33: [2, 71],
                    65: [2, 71],
                    72: [2, 71],
                    75: [2, 71],
                    80: [2, 71],
                    81: [2, 71],
                    82: [2, 71],
                    83: [2, 71],
                    84: [2, 71],
                    85: [2, 71]
                }, {
                    33: [2, 73],
                    75: [2, 73]
                }, {
                    23: [2, 29],
                    33: [2, 29],
                    54: [2, 29],
                    65: [2, 29],
                    68: [2, 29],
                    72: [2, 29],
                    75: [2, 29],
                    80: [2, 29],
                    81: [2, 29],
                    82: [2, 29],
                    83: [2, 29],
                    84: [2, 29],
                    85: [2, 29]
                }, {
                    14: [2, 15],
                    15: [2, 15],
                    19: [2, 15],
                    29: [2, 15],
                    34: [2, 15],
                    39: [2, 15],
                    44: [2, 15],
                    47: [2, 15],
                    48: [2, 15],
                    51: [2, 15],
                    55: [2, 15],
                    60: [2, 15]
                }, {
                    72: [1, 138],
                    77: [1, 137]
                }, {
                    72: [2, 100],
                    77: [2, 100]
                }, {
                    14: [2, 16],
                    15: [2, 16],
                    19: [2, 16],
                    29: [2, 16],
                    34: [2, 16],
                    44: [2, 16],
                    47: [2, 16],
                    48: [2, 16],
                    51: [2, 16],
                    55: [2, 16],
                    60: [2, 16]
                }, {
                    33: [1, 139]
                }, {
                    33: [2, 75]
                }, {
                    33: [2, 32]
                }, {
                    72: [2, 101],
                    77: [2, 101]
                }, {
                    14: [2, 17],
                    15: [2, 17],
                    19: [2, 17],
                    29: [2, 17],
                    34: [2, 17],
                    39: [2, 17],
                    44: [2, 17],
                    47: [2, 17],
                    48: [2, 17],
                    51: [2, 17],
                    55: [2, 17],
                    60: [2, 17]
                }],
                defaultActions: {
                    4: [2, 1],
                    55: [2, 55],
                    57: [2, 20],
                    61: [2, 57],
                    74: [2, 81],
                    83: [2, 85],
                    87: [2, 18],
                    91: [2, 89],
                    102: [2, 53],
                    105: [2, 93],
                    111: [2, 19],
                    112: [2, 77],
                    117: [2, 97],
                    120: [2, 63],
                    123: [2, 69],
                    124: [2, 12],
                    136: [2, 75],
                    137: [2, 32]
                },
                parseError: function parseError(str, hash) {
                    throw new Error(str)
                },
                parse: function parse(input) {
                    var self = this,
                        stack = [0],
                        vstack = [null],
                        lstack = [],
                        table = this.table,
                        yytext = "",
                        yylineno = 0,
                        yyleng = 0,
                        recovering = 0,
                        TERROR = 2,
                        EOF = 1;
                    this.lexer.setInput(input);
                    this.lexer.yy = this.yy;
                    this.yy.lexer = this.lexer;
                    this.yy.parser = this;
                    if (typeof this.lexer.yylloc == "undefined") this.lexer.yylloc = {};
                    var yyloc = this.lexer.yylloc;
                    lstack.push(yyloc);
                    var ranges = this.lexer.options && this.lexer.options.ranges;
                    if (typeof this.yy.parseError === "function") this.parseError = this.yy.parseError;

                    function popStack(n) {
                        stack.length = stack.length - 2 * n;
                        vstack.length = vstack.length - n;
                        lstack.length = lstack.length - n
                    }

                    function lex() {
                        var token;
                        token = self.lexer.lex() || 1;
                        if (typeof token !== "number") {
                            token = self.symbols_[token] || token
                        }
                        return token
                    }
                    var symbol, preErrorSymbol, state, action, a, r, yyval = {},
                        p, len, newState, expected;
                    while (true) {
                        state = stack[stack.length - 1];
                        if (this.defaultActions[state]) {
                            action = this.defaultActions[state]
                        } else {
                            if (symbol === null || typeof symbol == "undefined") {
                                symbol = lex()
                            }
                            action = table[state] && table[state][symbol]
                        }
                        if (typeof action === "undefined" || !action.length || !action[0]) {
                            var errStr = "";
                            if (!recovering) {
                                expected = [];
                                for (p in table[state])
                                    if (this.terminals_[p] && p > 2) {
                                        expected.push("'" + this.terminals_[p] + "'")
                                    }
                                if (this.lexer.showPosition) {
                                    errStr = "Parse error on line " + (yylineno + 1) + ":\n" + this.lexer.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'"
                                } else {
                                    errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == 1 ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'")
                                }
                                this.parseError(errStr, {
                                    text: this.lexer.match,
                                    token: this.terminals_[symbol] || symbol,
                                    line: this.lexer.yylineno,
                                    loc: yyloc,
                                    expected: expected
                                })
                            }
                        }
                        if (action[0] instanceof Array && action.length > 1) {
                            throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol)
                        }
                        switch (action[0]) {
                            case 1:
                                stack.push(symbol);
                                vstack.push(this.lexer.yytext);
                                lstack.push(this.lexer.yylloc);
                                stack.push(action[1]);
                                symbol = null;
                                if (!preErrorSymbol) {
                                    yyleng = this.lexer.yyleng;
                                    yytext = this.lexer.yytext;
                                    yylineno = this.lexer.yylineno;
                                    yyloc = this.lexer.yylloc;
                                    if (recovering > 0) recovering--
                                } else {
                                    symbol = preErrorSymbol;
                                    preErrorSymbol = null
                                }
                                break;
                            case 2:
                                len = this.productions_[action[1]][1];
                                yyval.$ = vstack[vstack.length - len];
                                yyval._$ = {
                                    first_line: lstack[lstack.length - (len || 1)].first_line,
                                    last_line: lstack[lstack.length - 1].last_line,
                                    first_column: lstack[lstack.length - (len || 1)].first_column,
                                    last_column: lstack[lstack.length - 1].last_column
                                };
                                if (ranges) {
                                    yyval._$.range = [lstack[lstack.length - (len || 1)].range[0], lstack[lstack.length - 1].range[1]]
                                }
                                r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
                                if (typeof r !== "undefined") {
                                    return r
                                }
                                if (len) {
                                    stack = stack.slice(0, -1 * len * 2);
                                    vstack = vstack.slice(0, -1 * len);
                                    lstack = lstack.slice(0, -1 * len)
                                }
                                stack.push(this.productions_[action[1]][0]);
                                vstack.push(yyval.$);
                                lstack.push(yyval._$);
                                newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
                                stack.push(newState);
                                break;
                            case 3:
                                return true
                        }
                    }
                    return true
                }
            };
            var lexer = function() {
                var lexer = {
                    EOF: 1,
                    parseError: function parseError(str, hash) {
                        if (this.yy.parser) {
                            this.yy.parser.parseError(str, hash)
                        } else {
                            throw new Error(str)
                        }
                    },
                    setInput: function setInput(input) {
                        this._input = input;
                        this._more = this._less = this.done = false;
                        this.yylineno = this.yyleng = 0;
                        this.yytext = this.matched = this.match = "";
                        this.conditionStack = ["INITIAL"];
                        this.yylloc = {
                            first_line: 1,
                            first_column: 0,
                            last_line: 1,
                            last_column: 0
                        };
                        if (this.options.ranges) this.yylloc.range = [0, 0];
                        this.offset = 0;
                        return this
                    },
                    input: function input() {
                        var ch = this._input[0];
                        this.yytext += ch;
                        this.yyleng++;
                        this.offset++;
                        this.match += ch;
                        this.matched += ch;
                        var lines = ch.match(/(?:\r\n?|\n).*/g);
                        if (lines) {
                            this.yylineno++;
                            this.yylloc.last_line++
                        } else {
                            this.yylloc.last_column++
                        }
                        if (this.options.ranges) this.yylloc.range[1]++;
                        this._input = this._input.slice(1);
                        return ch
                    },
                    unput: function unput(ch) {
                        var len = ch.length;
                        var lines = ch.split(/(?:\r\n?|\n)/g);
                        this._input = ch + this._input;
                        this.yytext = this.yytext.substr(0, this.yytext.length - len - 1);
                        this.offset -= len;
                        var oldLines = this.match.split(/(?:\r\n?|\n)/g);
                        this.match = this.match.substr(0, this.match.length - 1);
                        this.matched = this.matched.substr(0, this.matched.length - 1);
                        if (lines.length - 1) this.yylineno -= lines.length - 1;
                        var r = this.yylloc.range;
                        this.yylloc = {
                            first_line: this.yylloc.first_line,
                            last_line: this.yylineno + 1,
                            first_column: this.yylloc.first_column,
                            last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
                        };
                        if (this.options.ranges) {
                            this.yylloc.range = [r[0], r[0] + this.yyleng - len]
                        }
                        return this
                    },
                    more: function more() {
                        this._more = true;
                        return this
                    },
                    less: function less(n) {
                        this.unput(this.match.slice(n))
                    },
                    pastInput: function pastInput() {
                        var past = this.matched.substr(0, this.matched.length - this.match.length);
                        return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "")
                    },
                    upcomingInput: function upcomingInput() {
                        var next = this.match;
                        if (next.length < 20) {
                            next += this._input.substr(0, 20 - next.length)
                        }
                        return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "")
                    },
                    showPosition: function showPosition() {
                        var pre = this.pastInput();
                        var c = new Array(pre.length + 1).join("-");
                        return pre + this.upcomingInput() + "\n" + c + "^"
                    },
                    next: function next() {
                        if (this.done) {
                            return this.EOF
                        }
                        if (!this._input) this.done = true;
                        var token, match, tempMatch, index, col, lines;
                        if (!this._more) {
                            this.yytext = "";
                            this.match = ""
                        }
                        var rules = this._currentRules();
                        for (var i = 0; i < rules.length; i++) {
                            tempMatch = this._input.match(this.rules[rules[i]]);
                            if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
                                match = tempMatch;
                                index = i;
                                if (!this.options.flex) break
                            }
                        }
                        if (match) {
                            lines = match[0].match(/(?:\r\n?|\n).*/g);
                            if (lines) this.yylineno += lines.length;
                            this.yylloc = {
                                first_line: this.yylloc.last_line,
                                last_line: this.yylineno + 1,
                                first_column: this.yylloc.last_column,
                                last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
                            };
                            this.yytext += match[0];
                            this.match += match[0];
                            this.matches = match;
                            this.yyleng = this.yytext.length;
                            if (this.options.ranges) {
                                this.yylloc.range = [this.offset, this.offset += this.yyleng]
                            }
                            this._more = false;
                            this._input = this._input.slice(match[0].length);
                            this.matched += match[0];
                            token = this.performAction.call(this, this.yy, this, rules[index], this.conditionStack[this.conditionStack.length - 1]);
                            if (this.done && this._input) this.done = false;
                            if (token) return token;
                            else return
                        }
                        if (this._input === "") {
                            return this.EOF
                        } else {
                            return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
                                text: "",
                                token: null,
                                line: this.yylineno
                            })
                        }
                    },
                    lex: function lex() {
                        var r = this.next();
                        if (typeof r !== "undefined") {
                            return r
                        } else {
                            return this.lex()
                        }
                    },
                    begin: function begin(condition) {
                        this.conditionStack.push(condition)
                    },
                    popState: function popState() {
                        return this.conditionStack.pop()
                    },
                    _currentRules: function _currentRules() {
                        return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules
                    },
                    topState: function topState() {
                        return this.conditionStack[this.conditionStack.length - 2]
                    },
                    pushState: function begin(condition) {
                        this.begin(condition)
                    }
                };
                lexer.options = {};
                lexer.performAction = function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
                    function strip(start, end) {
                        return yy_.yytext = yy_.yytext.substr(start, yy_.yyleng - end)
                    }
                    var YYSTATE = YY_START;
                    switch ($avoiding_name_collisions) {
                        case 0:
                            if (yy_.yytext.slice(-2) === "\\\\") {
                                strip(0, 1);
                                this.begin("mu")
                            } else if (yy_.yytext.slice(-1) === "\\") {
                                strip(0, 1);
                                this.begin("emu")
                            } else {
                                this.begin("mu")
                            }
                            if (yy_.yytext) return 15;
                            break;
                        case 1:
                            return 15;
                            break;
                        case 2:
                            this.popState();
                            return 15;
                            break;
                        case 3:
                            this.begin("raw");
                            return 15;
                            break;
                        case 4:
                            this.popState();
                            if (this.conditionStack[this.conditionStack.length - 1] === "raw") {
                                return 15
                            } else {
                                yy_.yytext = yy_.yytext.substr(5, yy_.yyleng - 9);
                                return "END_RAW_BLOCK"
                            }
                            break;
                        case 5:
                            return 15;
                            break;
                        case 6:
                            this.popState();
                            return 14;
                            break;
                        case 7:
                            return 65;
                            break;
                        case 8:
                            return 68;
                            break;
                        case 9:
                            return 19;
                            break;
                        case 10:
                            this.popState();
                            this.begin("raw");
                            return 23;
                            break;
                        case 11:
                            return 55;
                            break;
                        case 12:
                            return 60;
                            break;
                        case 13:
                            return 29;
                            break;
                        case 14:
                            return 47;
                            break;
                        case 15:
                            this.popState();
                            return 44;
                            break;
                        case 16:
                            this.popState();
                            return 44;
                            break;
                        case 17:
                            return 34;
                            break;
                        case 18:
                            return 39;
                            break;
                        case 19:
                            return 51;
                            break;
                        case 20:
                            return 48;
                            break;
                        case 21:
                            this.unput(yy_.yytext);
                            this.popState();
                            this.begin("com");
                            break;
                        case 22:
                            this.popState();
                            return 14;
                            break;
                        case 23:
                            return 48;
                            break;
                        case 24:
                            return 73;
                            break;
                        case 25:
                            return 72;
                            break;
                        case 26:
                            return 72;
                            break;
                        case 27:
                            return 87;
                            break;
                        case 28:
                            break;
                        case 29:
                            this.popState();
                            return 54;
                            break;
                        case 30:
                            this.popState();
                            return 33;
                            break;
                        case 31:
                            yy_.yytext = strip(1, 2).replace(/\\"/g, '"');
                            return 80;
                            break;
                        case 32:
                            yy_.yytext = strip(1, 2).replace(/\\'/g, "'");
                            return 80;
                            break;
                        case 33:
                            return 85;
                            break;
                        case 34:
                            return 82;
                            break;
                        case 35:
                            return 82;
                            break;
                        case 36:
                            return 83;
                            break;
                        case 37:
                            return 84;
                            break;
                        case 38:
                            return 81;
                            break;
                        case 39:
                            return 75;
                            break;
                        case 40:
                            return 77;
                            break;
                        case 41:
                            return 72;
                            break;
                        case 42:
                            yy_.yytext = yy_.yytext.replace(/\\([\\\]])/g, "$1");
                            return 72;
                            break;
                        case 43:
                            return "INVALID";
                            break;
                        case 44:
                            return 5;
                            break
                    }
                };
                lexer.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]*?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
                lexer.conditions = {
                    mu: {
                        rules: [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44],
                        inclusive: false
                    },
                    emu: {
                        rules: [2],
                        inclusive: false
                    },
                    com: {
                        rules: [6],
                        inclusive: false
                    },
                    raw: {
                        rules: [3, 4, 5],
                        inclusive: false
                    },
                    INITIAL: {
                        rules: [0, 1, 44],
                        inclusive: true
                    }
                };
                return lexer
            }();
            parser.lexer = lexer;

            function Parser() {
                this.yy = {}
            }
            Parser.prototype = parser;
            parser.Parser = Parser;
            return new Parser
        }();
        exports.__esModule = true;
        exports["default"] = handlebars
    }, {}],
    13: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.print = print;
        exports.PrintVisitor = PrintVisitor;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _visitor = require("./visitor");
        var _visitor2 = _interopRequireDefault(_visitor);

        function print(ast) {
            return (new PrintVisitor).accept(ast)
        }

        function PrintVisitor() {
            this.padding = 0
        }
        PrintVisitor.prototype = new _visitor2["default"];
        PrintVisitor.prototype.pad = function(string) {
            var out = "";
            for (var i = 0, l = this.padding; i < l; i++) {
                out += "  "
            }
            out += string + "\n";
            return out
        };
        PrintVisitor.prototype.Program = function(program) {
            var out = "",
                body = program.body,
                i = undefined,
                l = undefined;
            if (program.blockParams) {
                var blockParams = "BLOCK PARAMS: [";
                for (i = 0, l = program.blockParams.length; i < l; i++) {
                    blockParams += " " + program.blockParams[i]
                }
                blockParams += " ]";
                out += this.pad(blockParams)
            }
            for (i = 0, l = body.length; i < l; i++) {
                out += this.accept(body[i])
            }
            this.padding--;
            return out
        };
        PrintVisitor.prototype.MustacheStatement = function(mustache) {
            return this.pad("{{ " + this.SubExpression(mustache) + " }}")
        };
        PrintVisitor.prototype.Decorator = function(mustache) {
            return this.pad("{{ DIRECTIVE " + this.SubExpression(mustache) + " }}")
        };
        PrintVisitor.prototype.BlockStatement = PrintVisitor.prototype.DecoratorBlock = function(block) {
            var out = "";
            out += this.pad((block.type === "DecoratorBlock" ? "DIRECTIVE " : "") + "BLOCK:");
            this.padding++;
            out += this.pad(this.SubExpression(block));
            if (block.program) {
                out += this.pad("PROGRAM:");
                this.padding++;
                out += this.accept(block.program);
                this.padding--
            }
            if (block.inverse) {
                if (block.program) {
                    this.padding++
                }
                out += this.pad("{{^}}");
                this.padding++;
                out += this.accept(block.inverse);
                this.padding--;
                if (block.program) {
                    this.padding--
                }
            }
            this.padding--;
            return out
        };
        PrintVisitor.prototype.PartialStatement = function(partial) {
            var content = "PARTIAL:" + partial.name.original;
            if (partial.params[0]) {
                content += " " + this.accept(partial.params[0])
            }
            if (partial.hash) {
                content += " " + this.accept(partial.hash)
            }
            return this.pad("{{> " + content + " }}")
        };
        PrintVisitor.prototype.PartialBlockStatement = function(partial) {
            var content = "PARTIAL BLOCK:" + partial.name.original;
            if (partial.params[0]) {
                content += " " + this.accept(partial.params[0])
            }
            if (partial.hash) {
                content += " " + this.accept(partial.hash)
            }
            content += " " + this.pad("PROGRAM:");
            this.padding++;
            content += this.accept(partial.program);
            this.padding--;
            return this.pad("{{> " + content + " }}")
        };
        PrintVisitor.prototype.ContentStatement = function(content) {
            return this.pad("CONTENT[ '" + content.value + "' ]")
        };
        PrintVisitor.prototype.CommentStatement = function(comment) {
            return this.pad("{{! '" + comment.value + "' }}")
        };
        PrintVisitor.prototype.SubExpression = function(sexpr) {
            var params = sexpr.params,
                paramStrings = [],
                hash = undefined;
            for (var i = 0, l = params.length; i < l; i++) {
                paramStrings.push(this.accept(params[i]))
            }
            params = "[" + paramStrings.join(", ") + "]";
            hash = sexpr.hash ? " " + this.accept(sexpr.hash) : "";
            return this.accept(sexpr.path) + " " + params + hash
        };
        PrintVisitor.prototype.PathExpression = function(id) {
            var path = id.parts.join("/");
            return (id.data ? "@" : "") + "PATH:" + path
        };
        PrintVisitor.prototype.StringLiteral = function(string) {
            return '"' + string.value + '"'
        };
        PrintVisitor.prototype.NumberLiteral = function(number) {
            return "NUMBER{" + number.value + "}"
        };
        PrintVisitor.prototype.BooleanLiteral = function(bool) {
            return "BOOLEAN{" + bool.value + "}"
        };
        PrintVisitor.prototype.UndefinedLiteral = function() {
            return "UNDEFINED"
        };
        PrintVisitor.prototype.NullLiteral = function() {
            return "NULL"
        };
        PrintVisitor.prototype.Hash = function(hash) {
            var pairs = hash.pairs,
                joinedPairs = [];
            for (var i = 0, l = pairs.length; i < l; i++) {
                joinedPairs.push(this.accept(pairs[i]))
            }
            return "HASH{" + joinedPairs.join(", ") + "}"
        };
        PrintVisitor.prototype.HashPair = function(pair) {
            return pair.key + "=" + this.accept(pair.value)
        }
    }, {
        "./visitor": 14
    }],
    14: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _exception = require("../exception");
        var _exception2 = _interopRequireDefault(_exception);

        function Visitor() {
            this.parents = []
        }
        Visitor.prototype = {
            constructor: Visitor,
            mutating: false,
            acceptKey: function acceptKey(node, name) {
                var value = this.accept(node[name]);
                if (this.mutating) {
                    if (value && !Visitor.prototype[value.type]) {
                        throw new _exception2["default"]('Unexpected node type "' + value.type + '" found when accepting ' + name + " on " + node.type)
                    }
                    node[name] = value
                }
            },
            acceptRequired: function acceptRequired(node, name) {
                this.acceptKey(node, name);
                if (!node[name]) {
                    throw new _exception2["default"](node.type + " requires " + name)
                }
            },
            acceptArray: function acceptArray(array) {
                for (var i = 0, l = array.length; i < l; i++) {
                    this.acceptKey(array, i);
                    if (!array[i]) {
                        array.splice(i, 1);
                        i--;
                        l--
                    }
                }
            },
            accept: function accept(object) {
                if (!object) {
                    return
                }
                if (!this[object.type]) {
                    throw new _exception2["default"]("Unknown type: " + object.type, object)
                }
                if (this.current) {
                    this.parents.unshift(this.current)
                }
                this.current = object;
                var ret = this[object.type](object);
                this.current = this.parents.shift();
                if (!this.mutating || ret) {
                    return ret
                } else if (ret !== false) {
                    return object
                }
            },
            Program: function Program(program) {
                this.acceptArray(program.body)
            },
            MustacheStatement: visitSubExpression,
            Decorator: visitSubExpression,
            BlockStatement: visitBlock,
            DecoratorBlock: visitBlock,
            PartialStatement: visitPartial,
            PartialBlockStatement: function PartialBlockStatement(partial) {
                visitPartial.call(this, partial);
                this.acceptKey(partial, "program")
            },
            ContentStatement: function ContentStatement() {},
            CommentStatement: function CommentStatement() {},
            SubExpression: visitSubExpression,
            PathExpression: function PathExpression() {},
            StringLiteral: function StringLiteral() {},
            NumberLiteral: function NumberLiteral() {},
            BooleanLiteral: function BooleanLiteral() {},
            UndefinedLiteral: function UndefinedLiteral() {},
            NullLiteral: function NullLiteral() {},
            Hash: function Hash(hash) {
                this.acceptArray(hash.pairs)
            },
            HashPair: function HashPair(pair) {
                this.acceptRequired(pair, "value")
            }
        };

        function visitSubExpression(mustache) {
            this.acceptRequired(mustache, "path");
            this.acceptArray(mustache.params);
            this.acceptKey(mustache, "hash")
        }

        function visitBlock(block) {
            visitSubExpression.call(this, block);
            this.acceptKey(block, "program");
            this.acceptKey(block, "inverse")
        }

        function visitPartial(partial) {
            this.acceptRequired(partial, "name");
            this.acceptArray(partial.params);
            this.acceptKey(partial, "hash")
        }
        exports["default"] = Visitor;
        module.exports = exports["default"]
    }, {
        "../exception": 18
    }],
    15: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _visitor = require("./visitor");
        var _visitor2 = _interopRequireDefault(_visitor);

        function WhitespaceControl() {
            var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
            this.options = options
        }
        WhitespaceControl.prototype = new _visitor2["default"];
        WhitespaceControl.prototype.Program = function(program) {
            var doStandalone = !this.options.ignoreStandalone;
            var isRoot = !this.isRootSeen;
            this.isRootSeen = true;
            var body = program.body;
            for (var i = 0, l = body.length; i < l; i++) {
                var current = body[i],
                    strip = this.accept(current);
                if (!strip) {
                    continue
                }
                var _isPrevWhitespace = isPrevWhitespace(body, i, isRoot),
                    _isNextWhitespace = isNextWhitespace(body, i, isRoot),
                    openStandalone = strip.openStandalone && _isPrevWhitespace,
                    closeStandalone = strip.closeStandalone && _isNextWhitespace,
                    inlineStandalone = strip.inlineStandalone && _isPrevWhitespace && _isNextWhitespace;
                if (strip.close) {
                    omitRight(body, i, true)
                }
                if (strip.open) {
                    omitLeft(body, i, true)
                }
                if (doStandalone && inlineStandalone) {
                    omitRight(body, i);
                    if (omitLeft(body, i)) {
                        if (current.type === "PartialStatement") {
                            current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1]
                        }
                    }
                }
                if (doStandalone && openStandalone) {
                    omitRight((current.program || current.inverse).body);
                    omitLeft(body, i)
                }
                if (doStandalone && closeStandalone) {
                    omitRight(body, i);
                    omitLeft((current.inverse || current.program).body)
                }
            }
            return program
        };
        WhitespaceControl.prototype.BlockStatement = WhitespaceControl.prototype.DecoratorBlock = WhitespaceControl.prototype.PartialBlockStatement = function(block) {
            this.accept(block.program);
            this.accept(block.inverse);
            var program = block.program || block.inverse,
                inverse = block.program && block.inverse,
                firstInverse = inverse,
                lastInverse = inverse;
            if (inverse && inverse.chained) {
                firstInverse = inverse.body[0].program;
                while (lastInverse.chained) {
                    lastInverse = lastInverse.body[lastInverse.body.length - 1].program
                }
            }
            var strip = {
                open: block.openStrip.open,
                close: block.closeStrip.close,
                openStandalone: isNextWhitespace(program.body),
                closeStandalone: isPrevWhitespace((firstInverse || program).body)
            };
            if (block.openStrip.close) {
                omitRight(program.body, null, true)
            }
            if (inverse) {
                var inverseStrip = block.inverseStrip;
                if (inverseStrip.open) {
                    omitLeft(program.body, null, true)
                }
                if (inverseStrip.close) {
                    omitRight(firstInverse.body, null, true)
                }
                if (block.closeStrip.open) {
                    omitLeft(lastInverse.body, null, true)
                }
                if (!this.options.ignoreStandalone && isPrevWhitespace(program.body) && isNextWhitespace(firstInverse.body)) {
                    omitLeft(program.body);
                    omitRight(firstInverse.body)
                }
            } else if (block.closeStrip.open) {
                omitLeft(program.body, null, true)
            }
            return strip
        };
        WhitespaceControl.prototype.Decorator = WhitespaceControl.prototype.MustacheStatement = function(mustache) {
            return mustache.strip
        };
        WhitespaceControl.prototype.PartialStatement = WhitespaceControl.prototype.CommentStatement = function(node) {
            var strip = node.strip || {};
            return {
                inlineStandalone: true,
                open: strip.open,
                close: strip.close
            }
        };

        function isPrevWhitespace(body, i, isRoot) {
            if (i === undefined) {
                i = body.length
            }
            var prev = body[i - 1],
                sibling = body[i - 2];
            if (!prev) {
                return isRoot
            }
            if (prev.type === "ContentStatement") {
                return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original)
            }
        }

        function isNextWhitespace(body, i, isRoot) {
            if (i === undefined) {
                i = -1
            }
            var next = body[i + 1],
                sibling = body[i + 2];
            if (!next) {
                return isRoot
            }
            if (next.type === "ContentStatement") {
                return (sibling || !isRoot ? /^\s*?\r?\n/ : /^\s*?(\r?\n|$)/).test(next.original)
            }
        }

        function omitRight(body, i, multiple) {
            var current = body[i == null ? 0 : i + 1];
            if (!current || current.type !== "ContentStatement" || !multiple && current.rightStripped) {
                return
            }
            var original = current.value;
            current.value = current.value.replace(multiple ? /^\s+/ : /^[ \t]*\r?\n?/, "");
            current.rightStripped = current.value !== original
        }

        function omitLeft(body, i, multiple) {
            var current = body[i == null ? body.length - 1 : i - 1];
            if (!current || current.type !== "ContentStatement" || !multiple && current.leftStripped) {
                return
            }
            var original = current.value;
            current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, "");
            current.leftStripped = current.value !== original;
            return current.leftStripped
        }
        exports["default"] = WhitespaceControl;
        module.exports = exports["default"]
    }, {
        "./visitor": 14
    }],
    16: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.registerDefaultDecorators = registerDefaultDecorators;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _decoratorsInline = require("./decorators/inline");
        var _decoratorsInline2 = _interopRequireDefault(_decoratorsInline);

        function registerDefaultDecorators(instance) {
            _decoratorsInline2["default"](instance)
        }
    }, {
        "./decorators/inline": 17
    }],
    17: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var _utils = require("../utils");
        exports["default"] = function(instance) {
            instance.registerDecorator("inline", function(fn, props, container, options) {
                var ret = fn;
                if (!props.partials) {
                    props.partials = {};
                    ret = function(context, options) {
                        var original = container.partials;
                        container.partials = _utils.extend({}, original, props.partials);
                        var ret = fn(context, options);
                        container.partials = original;
                        return ret
                    }
                }
                props.partials[options.args[0]] = options.fn;
                return ret
            })
        };
        module.exports = exports["default"]
    }, {
        "../utils": 31
    }],
    18: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var errorProps = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"];

        function Exception(message, node) {
            var loc = node && node.loc,
                line = undefined,
                column = undefined;
            if (loc) {
                line = loc.start.line;
                column = loc.start.column;
                message += " - " + line + ":" + column
            }
            var tmp = Error.prototype.constructor.call(this, message);
            for (var idx = 0; idx < errorProps.length; idx++) {
                this[errorProps[idx]] = tmp[errorProps[idx]]
            }
            if (Error.captureStackTrace) {
                Error.captureStackTrace(this, Exception)
            }
            if (loc) {
                this.lineNumber = line;
                this.column = column
            }
        }
        Exception.prototype = new Error;
        exports["default"] = Exception;
        module.exports = exports["default"]
    }, {}],
    19: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.registerDefaultHelpers = registerDefaultHelpers;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _helpersBlockHelperMissing = require("./helpers/block-helper-missing");
        var _helpersBlockHelperMissing2 = _interopRequireDefault(_helpersBlockHelperMissing);
        var _helpersEach = require("./helpers/each");
        var _helpersEach2 = _interopRequireDefault(_helpersEach);
        var _helpersHelperMissing = require("./helpers/helper-missing");
        var _helpersHelperMissing2 = _interopRequireDefault(_helpersHelperMissing);
        var _helpersIf = require("./helpers/if");
        var _helpersIf2 = _interopRequireDefault(_helpersIf);
        var _helpersLog = require("./helpers/log");
        var _helpersLog2 = _interopRequireDefault(_helpersLog);
        var _helpersLookup = require("./helpers/lookup");
        var _helpersLookup2 = _interopRequireDefault(_helpersLookup);
        var _helpersWith = require("./helpers/with");
        var _helpersWith2 = _interopRequireDefault(_helpersWith);

        function registerDefaultHelpers(instance) {
            _helpersBlockHelperMissing2["default"](instance);
            _helpersEach2["default"](instance);
            _helpersHelperMissing2["default"](instance);
            _helpersIf2["default"](instance);
            _helpersLog2["default"](instance);
            _helpersLookup2["default"](instance);
            _helpersWith2["default"](instance)
        }
    }, {
        "./helpers/block-helper-missing": 20,
        "./helpers/each": 21,
        "./helpers/helper-missing": 22,
        "./helpers/if": 23,
        "./helpers/log": 24,
        "./helpers/lookup": 25,
        "./helpers/with": 26
    }],
    20: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var _utils = require("../utils");
        exports["default"] = function(instance) {
            instance.registerHelper("blockHelperMissing", function(context, options) {
                var inverse = options.inverse,
                    fn = options.fn;
                if (context === true) {
                    return fn(this)
                } else if (context === false || context == null) {
                    return inverse(this)
                } else if (_utils.isArray(context)) {
                    if (context.length > 0) {
                        if (options.ids) {
                            options.ids = [options.name]
                        }
                        return instance.helpers.each(context, options)
                    } else {
                        return inverse(this)
                    }
                } else {
                    if (options.data && options.ids) {
                        var data = _utils.createFrame(options.data);
                        data.contextPath = _utils.appendContextPath(options.data.contextPath, options.name);
                        options = {
                            data: data
                        }
                    }
                    return fn(context, options)
                }
            })
        };
        module.exports = exports["default"]
    }, {
        "../utils": 31
    }],
    21: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _utils = require("../utils");
        var _exception = require("../exception");
        var _exception2 = _interopRequireDefault(_exception);
        exports["default"] = function(instance) {
            instance.registerHelper("each", function(context, options) {
                if (!options) {
                    throw new _exception2["default"]("Must pass iterator to #each")
                }
                var fn = options.fn,
                    inverse = options.inverse,
                    i = 0,
                    ret = "",
                    data = undefined,
                    contextPath = undefined;
                if (options.data && options.ids) {
                    contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0]) + "."
                }
                if (_utils.isFunction(context)) {
                    context = context.call(this)
                }
                if (options.data) {
                    data = _utils.createFrame(options.data)
                }

                function execIteration(field, index, last) {
                    if (data) {
                        data.key = field;
                        data.index = index;
                        data.first = index === 0;
                        data.last = !!last;
                        if (contextPath) {
                            data.contextPath = contextPath + field
                        }
                    }
                    ret = ret + fn(context[field], {
                        data: data,
                        blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
                    })
                }
                if (context && typeof context === "object") {
                    if (_utils.isArray(context)) {
                        for (var j = context.length; i < j; i++) {
                            if (i in context) {
                                execIteration(i, i, i === context.length - 1)
                            }
                        }
                    } else {
                        var priorKey = undefined;
                        for (var key in context) {
                            if (context.hasOwnProperty(key)) {
                                if (priorKey !== undefined) {
                                    execIteration(priorKey, i - 1)
                                }
                                priorKey = key;
                                i++
                            }
                        }
                        if (priorKey !== undefined) {
                            execIteration(priorKey, i - 1, true)
                        }
                    }
                }
                if (i === 0) {
                    ret = inverse(this)
                }
                return ret
            })
        };
        module.exports = exports["default"]
    }, {
        "../exception": 18,
        "../utils": 31
    }],
    22: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }
        var _exception = require("../exception");
        var _exception2 = _interopRequireDefault(_exception);
        exports["default"] = function(instance) {
            instance.registerHelper("helperMissing", function() {
                if (arguments.length === 1) {
                    return undefined
                } else {
                    throw new _exception2["default"]('Missing helper: "' + arguments[arguments.length - 1].name + '"')
                }
            })
        };
        module.exports = exports["default"]
    }, {
        "../exception": 18
    }],
    23: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var _utils = require("../utils");
        exports["default"] = function(instance) {
            instance.registerHelper("if", function(conditional, options) {
                if (_utils.isFunction(conditional)) {
                    conditional = conditional.call(this)
                }
                if (!options.hash.includeZero && !conditional || _utils.isEmpty(conditional)) {
                    return options.inverse(this)
                } else {
                    return options.fn(this)
                }
            });
            instance.registerHelper("unless", function(conditional, options) {
                return instance.helpers["if"].call(this, conditional, {
                    fn: options.inverse,
                    inverse: options.fn,
                    hash: options.hash
                })
            })
        };
        module.exports = exports["default"]
    }, {
        "../utils": 31
    }],
    24: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports["default"] = function(instance) {
            instance.registerHelper("log", function() {
                var args = [undefined],
                    options = arguments[arguments.length - 1];
                for (var i = 0; i < arguments.length - 1; i++) {
                    args.push(arguments[i])
                }
                var level = 1;
                if (options.hash.level != null) {
                    level = options.hash.level
                } else if (options.data && options.data.level != null) {
                    level = options.data.level
                }
                args[0] = level;
                instance.log.apply(instance, args)
            })
        };
        module.exports = exports["default"]
    }, {}],
    25: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports["default"] = function(instance) {
            instance.registerHelper("lookup", function(obj, field) {
                return obj && obj[field]
            })
        };
        module.exports = exports["default"]
    }, {}],
    26: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var _utils = require("../utils");
        exports["default"] = function(instance) {
            instance.registerHelper("with", function(context, options) {
                if (_utils.isFunction(context)) {
                    context = context.call(this)
                }
                var fn = options.fn;
                if (!_utils.isEmpty(context)) {
                    var data = options.data;
                    if (options.data && options.ids) {
                        data = _utils.createFrame(options.data);
                        data.contextPath = _utils.appendContextPath(options.data.contextPath, options.ids[0])
                    }
                    return fn(context, {
                        data: data,
                        blockParams: _utils.blockParams([context], [data && data.contextPath])
                    })
                } else {
                    return options.inverse(this)
                }
            })
        };
        module.exports = exports["default"]
    }, {
        "../utils": 31
    }],
    27: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        var _utils = require("./utils");
        var logger = {
            methodMap: ["debug", "info", "warn", "error"],
            level: "info",
            lookupLevel: function lookupLevel(level) {
                if (typeof level === "string") {
                    var levelMap = _utils.indexOf(logger.methodMap, level.toLowerCase());
                    if (levelMap >= 0) {
                        level = levelMap
                    } else {
                        level = parseInt(level, 10)
                    }
                }
                return level
            },
            log: function log(level) {
                level = logger.lookupLevel(level);
                if (typeof console !== "undefined" && logger.lookupLevel(logger.level) <= level) {
                    var method = logger.methodMap[level];
                    if (!console[method]) {
                        method = "log"
                    }
                    for (var _len = arguments.length, message = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
                        message[_key - 1] = arguments[_key]
                    }
                    console[method].apply(console, message)
                }
            }
        };
        exports["default"] = logger;
        module.exports = exports["default"]
    }, {
        "./utils": 31
    }],
    28: [function(require, module, exports) {
        (function(global) {
            "use strict";
            exports.__esModule = true;
            exports["default"] = function(Handlebars) {
                var root = typeof global !== "undefined" ? global : window,
                    $Handlebars = root.Handlebars;
                Handlebars.noConflict = function() {
                    if (root.Handlebars === Handlebars) {
                        root.Handlebars = $Handlebars
                    }
                    return Handlebars
                }
            };
            module.exports = exports["default"]
        }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
    }, {}],
    29: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.checkRevision = checkRevision;
        exports.template = template;
        exports.wrapProgram = wrapProgram;
        exports.resolvePartial = resolvePartial;
        exports.invokePartial = invokePartial;
        exports.noop = noop;

        function _interopRequireDefault(obj) {
            return obj && obj.__esModule ? obj : {
                "default": obj
            }
        }

        function _interopRequireWildcard(obj) {
            if (obj && obj.__esModule) {
                return obj
            } else {
                var newObj = {};
                if (obj != null) {
                    for (var key in obj) {
                        if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]
                    }
                }
                newObj["default"] = obj;
                return newObj
            }
        }
        var _utils = require("./utils");
        var Utils = _interopRequireWildcard(_utils);
        var _exception = require("./exception");
        var _exception2 = _interopRequireDefault(_exception);
        var _base = require("./base");

        function checkRevision(compilerInfo) {
            var compilerRevision = compilerInfo && compilerInfo[0] || 1,
                currentRevision = _base.COMPILER_REVISION;
            if (compilerRevision !== currentRevision) {
                if (compilerRevision < currentRevision) {
                    var runtimeVersions = _base.REVISION_CHANGES[currentRevision],
                        compilerVersions = _base.REVISION_CHANGES[compilerRevision];
                    throw new _exception2["default"]("Template was precompiled with an older version of Handlebars than the current runtime. " + "Please update your precompiler to a newer version (" + runtimeVersions + ") or downgrade your runtime to an older version (" + compilerVersions + ").")
                } else {
                    throw new _exception2["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. " + "Please update your runtime to a newer version (" + compilerInfo[1] + ").")
                }
            }
        }

        function template(templateSpec, env) {
            if (!env) {
                throw new _exception2["default"]("No environment passed to template")
            }
            if (!templateSpec || !templateSpec.main) {
                throw new _exception2["default"]("Unknown template object: " + typeof templateSpec)
            }
            templateSpec.main.decorator = templateSpec.main_d;
            env.VM.checkRevision(templateSpec.compiler);

            function invokePartialWrapper(partial, context, options) {
                if (options.hash) {
                    context = Utils.extend({}, context, options.hash);
                    if (options.ids) {
                        options.ids[0] = true
                    }
                }
                partial = env.VM.resolvePartial.call(this, partial, context, options);
                var result = env.VM.invokePartial.call(this, partial, context, options);
                if (result == null && env.compile) {
                    options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
                    result = options.partials[options.name](context, options)
                }
                if (result != null) {
                    if (options.indent) {
                        var lines = result.split("\n");
                        for (var i = 0, l = lines.length; i < l; i++) {
                            if (!lines[i] && i + 1 === l) {
                                break
                            }
                            lines[i] = options.indent + lines[i]
                        }
                        result = lines.join("\n")
                    }
                    return result
                } else {
                    throw new _exception2["default"]("The partial " + options.name + " could not be compiled when running in runtime-only mode")
                }
            }
            var container = {
                strict: function strict(obj, name) {
                    if (!(name in obj)) {
                        throw new _exception2["default"]('"' + name + '" not defined in ' + obj)
                    }
                    return obj[name]
                },
                lookup: function lookup(depths, name) {
                    var len = depths.length;
                    for (var i = 0; i < len; i++) {
                        if (depths[i] && depths[i][name] != null) {
                            return depths[i][name]
                        }
                    }
                },
                lambda: function lambda(current, context) {
                    return typeof current === "function" ? current.call(context) : current
                },
                escapeExpression: Utils.escapeExpression,
                invokePartial: invokePartialWrapper,
                fn: function fn(i) {
                    var ret = templateSpec[i];
                    ret.decorator = templateSpec[i + "_d"];
                    return ret
                },
                programs: [],
                program: function program(i, data, declaredBlockParams, blockParams, depths) {
                    var programWrapper = this.programs[i],
                        fn = this.fn(i);
                    if (data || depths || blockParams || declaredBlockParams) {
                        programWrapper = wrapProgram(this, i, fn, data, declaredBlockParams, blockParams, depths)
                    } else if (!programWrapper) {
                        programWrapper = this.programs[i] = wrapProgram(this, i, fn)
                    }
                    return programWrapper
                },
                data: function data(value, depth) {
                    while (value && depth--) {
                        value = value._parent
                    }
                    return value
                },
                merge: function merge(param, common) {
                    var obj = param || common;
                    if (param && common && param !== common) {
                        obj = Utils.extend({}, common, param)
                    }
                    return obj
                },
                noop: env.VM.noop,
                compilerInfo: templateSpec.compiler
            };

            function ret(context) {
                var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
                var data = options.data;
                ret._setup(options);
                if (!options.partial && templateSpec.useData) {
                    data = initData(context, data)
                }
                var depths = undefined,
                    blockParams = templateSpec.useBlockParams ? [] : undefined;
                if (templateSpec.useDepths) {
                    if (options.depths) {
                        depths = context !== options.depths[0] ? [context].concat(options.depths) : options.depths
                    } else {
                        depths = [context]
                    }
                }

                function main(context) {
                    return "" + templateSpec.main(container, context, container.helpers, container.partials, data, blockParams, depths)
                }
                main = executeDecorators(templateSpec.main, main, container, options.depths || [], data, blockParams);
                return main(context, options)
            }
            ret.isTop = true;
            ret._setup = function(options) {
                if (!options.partial) {
                    container.helpers = container.merge(options.helpers, env.helpers);
                    if (templateSpec.usePartial) {
                        container.partials = container.merge(options.partials, env.partials)
                    }
                    if (templateSpec.usePartial || templateSpec.useDecorators) {
                        container.decorators = container.merge(options.decorators, env.decorators)
                    }
                } else {
                    container.helpers = options.helpers;
                    container.partials = options.partials;
                    container.decorators = options.decorators
                }
            };
            ret._child = function(i, data, blockParams, depths) {
                if (templateSpec.useBlockParams && !blockParams) {
                    throw new _exception2["default"]("must pass block params")
                }
                if (templateSpec.useDepths && !depths) {
                    throw new _exception2["default"]("must pass parent depths")
                }
                return wrapProgram(container, i, templateSpec[i], data, 0, blockParams, depths)
            };
            return ret
        }

        function wrapProgram(container, i, fn, data, declaredBlockParams, blockParams, depths) {
            function prog(context) {
                var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
                var currentDepths = depths;
                if (depths && context !== depths[0]) {
                    currentDepths = [context].concat(depths)
                }
                return fn(container, context, container.helpers, container.partials, options.data || data, blockParams && [options.blockParams].concat(blockParams), currentDepths)
            }
            prog = executeDecorators(fn, prog, container, depths, data, blockParams);
            prog.program = i;
            prog.depth = depths ? depths.length : 0;
            prog.blockParams = declaredBlockParams || 0;
            return prog
        }

        function resolvePartial(partial, context, options) {
            if (!partial) {
                if (options.name === "@partial-block") {
                    partial = options.data["partial-block"]
                } else {
                    partial = options.partials[options.name]
                }
            } else if (!partial.call && !options.name) {
                options.name = partial;
                partial = options.partials[partial]
            }
            return partial
        }

        function invokePartial(partial, context, options) {
            options.partial = true;
            if (options.ids) {
                options.data.contextPath = options.ids[0] || options.data.contextPath
            }
            var partialBlock = undefined;
            if (options.fn && options.fn !== noop) {
                options.data = _base.createFrame(options.data);
                partialBlock = options.data["partial-block"] = options.fn;
                if (partialBlock.partials) {
                    options.partials = Utils.extend({}, options.partials, partialBlock.partials)
                }
            }
            if (partial === undefined && partialBlock) {
                partial = partialBlock
            }
            if (partial === undefined) {
                throw new _exception2["default"]("The partial " + options.name + " could not be found")
            } else if (partial instanceof Function) {
                return partial(context, options)
            }
        }

        function noop() {
            return ""
        }

        function initData(context, data) {
            if (!data || !("root" in data)) {
                data = data ? _base.createFrame(data) : {};
                data.root = context
            }
            return data
        }

        function executeDecorators(fn, prog, container, depths, data, blockParams) {
            if (fn.decorator) {
                var props = {};
                prog = fn.decorator(prog, props, container, depths && depths[0], data, blockParams, depths);
                Utils.extend(prog, props)
            }
            return prog
        }
    }, {
        "./base": 5,
        "./exception": 18,
        "./utils": 31
    }],
    30: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;

        function SafeString(string) {
            this.string = string
        }
        SafeString.prototype.toString = SafeString.prototype.toHTML = function() {
            return "" + this.string
        };
        exports["default"] = SafeString;
        module.exports = exports["default"]
    }, {}],
    31: [function(require, module, exports) {
        "use strict";
        exports.__esModule = true;
        exports.extend = extend;
        exports.indexOf = indexOf;
        exports.escapeExpression = escapeExpression;
        exports.isEmpty = isEmpty;
        exports.createFrame = createFrame;
        exports.blockParams = blockParams;
        exports.appendContextPath = appendContextPath;
        var escape = {
            "&": "&amp;",
            "<": "&lt;",
            ">": "&gt;",
            '"': "&quot;",
            "'": "&#x27;",
            "`": "&#x60;",
            "=": "&#x3D;"
        };
        var badChars = /[&<>"'`=]/g,
            possible = /[&<>"'`=]/;

        function escapeChar(chr) {
            return escape[chr]
        }

        function extend(obj) {
            for (var i = 1; i < arguments.length; i++) {
                for (var key in arguments[i]) {
                    if (Object.prototype.hasOwnProperty.call(arguments[i], key)) {
                        obj[key] = arguments[i][key]
                    }
                }
            }
            return obj
        }
        var toString = Object.prototype.toString;
        exports.toString = toString;
        var isFunction = function isFunction(value) {
            return typeof value === "function"
        };
        if (isFunction(/x/)) {
            exports.isFunction = isFunction = function(value) {
                return typeof value === "function" && toString.call(value) === "[object Function]"
            }
        }
        exports.isFunction = isFunction;
        var isArray = Array.isArray || function(value) {
            return value && typeof value === "object" ? toString.call(value) === "[object Array]" : false
        };
        exports.isArray = isArray;

        function indexOf(array, value) {
            for (var i = 0, len = array.length; i < len; i++) {
                if (array[i] === value) {
                    return i
                }
            }
            return -1
        }

        function escapeExpression(string) {
            if (typeof string !== "string") {
                if (string && string.toHTML) {
                    return string.toHTML()
                } else if (string == null) {
                    return ""
                } else if (!string) {
                    return string + ""
                }
                string = "" + string
            }
            if (!possible.test(string)) {
                return string
            }
            return string.replace(badChars, escapeChar)
        }

        function isEmpty(value) {
            if (!value && value !== 0) {
                return true
            } else if (isArray(value) && value.length === 0) {
                return true
            } else {
                return false
            }
        }

        function createFrame(object) {
            var frame = extend({}, object);
            frame._parent = object;
            return frame
        }

        function blockParams(params, ids) {
            params.path = ids;
            return params
        }

        function appendContextPath(contextPath, id) {
            return (contextPath ? contextPath + "." : "") + id
        }
    }, {}],
    32: [function(require, module, exports) {
        var handlebars = require("../dist/cjs/handlebars")["default"];
        var printer = require("../dist/cjs/handlebars/compiler/printer");
        handlebars.PrintVisitor = printer.PrintVisitor;
        handlebars.print = printer.print;
        module.exports = handlebars;

        function extension(module, filename) {
            var fs = require("fs");
            var templateString = fs.readFileSync(filename, "utf8");
            module.exports = handlebars.compile(templateString)
        }
        if (typeof require !== "undefined" && require.extensions) {
            require.extensions[".handlebars"] = extension;
            require.extensions[".hbs"] = extension
        }
    }, {
        "../dist/cjs/handlebars": 3,
        "../dist/cjs/handlebars/compiler/printer": 13,
        fs: 2
    }],
    33: [function(require, module, exports) {
        exports.SourceMapGenerator = require("./source-map/source-map-generator").SourceMapGenerator;
        exports.SourceMapConsumer = require("./source-map/source-map-consumer").SourceMapConsumer;
        exports.SourceNode = require("./source-map/source-node").SourceNode
    }, {
        "./source-map/source-map-consumer": 40,
        "./source-map/source-map-generator": 41,
        "./source-map/source-node": 42
    }],
    34: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            var util = require("./util");

            function ArraySet() {
                this._array = [];
                this._set = {}
            }
            ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
                var set = new ArraySet;
                for (var i = 0, len = aArray.length; i < len; i++) {
                    set.add(aArray[i], aAllowDuplicates)
                }
                return set
            };
            ArraySet.prototype.size = function ArraySet_size() {
                return Object.getOwnPropertyNames(this._set).length
            };
            ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
                var isDuplicate = this.has(aStr);
                var idx = this._array.length;
                if (!isDuplicate || aAllowDuplicates) {
                    this._array.push(aStr)
                }
                if (!isDuplicate) {
                    this._set[util.toSetString(aStr)] = idx
                }
            };
            ArraySet.prototype.has = function ArraySet_has(aStr) {
                return Object.prototype.hasOwnProperty.call(this._set, util.toSetString(aStr))
            };
            ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
                if (this.has(aStr)) {
                    return this._set[util.toSetString(aStr)]
                }
                throw new Error('"' + aStr + '" is not in the set.')
            };
            ArraySet.prototype.at = function ArraySet_at(aIdx) {
                if (aIdx >= 0 && aIdx < this._array.length) {
                    return this._array[aIdx]
                }
                throw new Error("No element indexed by " + aIdx)
            };
            ArraySet.prototype.toArray = function ArraySet_toArray() {
                return this._array.slice()
            };
            exports.ArraySet = ArraySet
        })
    }, {
        "./util": 43,
        amdefine: 1
    }],
    35: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            var base64 = require("./base64");
            var VLQ_BASE_SHIFT = 5;
            var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
            var VLQ_BASE_MASK = VLQ_BASE - 1;
            var VLQ_CONTINUATION_BIT = VLQ_BASE;

            function toVLQSigned(aValue) {
                return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0
            }

            function fromVLQSigned(aValue) {
                var isNegative = (aValue & 1) === 1;
                var shifted = aValue >> 1;
                return isNegative ? -shifted : shifted
            }
            exports.encode = function base64VLQ_encode(aValue) {
                var encoded = "";
                var digit;
                var vlq = toVLQSigned(aValue);
                do {
                    digit = vlq & VLQ_BASE_MASK;
                    vlq >>>= VLQ_BASE_SHIFT;
                    if (vlq > 0) {
                        digit |= VLQ_CONTINUATION_BIT
                    }
                    encoded += base64.encode(digit)
                } while (vlq > 0);
                return encoded
            };
            exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
                var strLen = aStr.length;
                var result = 0;
                var shift = 0;
                var continuation, digit;
                do {
                    if (aIndex >= strLen) {
                        throw new Error("Expected more digits in base 64 VLQ value.")
                    }
                    digit = base64.decode(aStr.charCodeAt(aIndex++));
                    if (digit === -1) {
                        throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1))
                    }
                    continuation = !!(digit & VLQ_CONTINUATION_BIT);
                    digit &= VLQ_BASE_MASK;
                    result = result + (digit << shift);
                    shift += VLQ_BASE_SHIFT
                } while (continuation);
                aOutParam.value = fromVLQSigned(result);
                aOutParam.rest = aIndex
            }
        })
    }, {
        "./base64": 36,
        amdefine: 1
    }],
    36: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
            exports.encode = function(number) {
                if (0 <= number && number < intToCharMap.length) {
                    return intToCharMap[number]
                }
                throw new TypeError("Must be between 0 and 63: " + aNumber)
            };
            exports.decode = function(charCode) {
                var bigA = 65;
                var bigZ = 90;
                var littleA = 97;
                var littleZ = 122;
                var zero = 48;
                var nine = 57;
                var plus = 43;
                var slash = 47;
                var littleOffset = 26;
                var numberOffset = 52;
                if (bigA <= charCode && charCode <= bigZ) {
                    return charCode - bigA
                }
                if (littleA <= charCode && charCode <= littleZ) {
                    return charCode - littleA + littleOffset
                }
                if (zero <= charCode && charCode <= nine) {
                    return charCode - zero + numberOffset
                }
                if (charCode == plus) {
                    return 62
                }
                if (charCode == slash) {
                    return 63
                }
                return -1
            }
        })
    }, {
        amdefine: 1
    }],
    37: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            exports.GREATEST_LOWER_BOUND = 1;
            exports.LEAST_UPPER_BOUND = 2;

            function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
                var mid = Math.floor((aHigh - aLow) / 2) + aLow;
                var cmp = aCompare(aNeedle, aHaystack[mid], true);
                if (cmp === 0) {
                    return mid
                } else if (cmp > 0) {
                    if (aHigh - mid > 1) {
                        return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias)
                    }
                    if (aBias == exports.LEAST_UPPER_BOUND) {
                        return aHigh < aHaystack.length ? aHigh : -1
                    } else {
                        return mid
                    }
                } else {
                    if (mid - aLow > 1) {
                        return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias)
                    }
                    if (aBias == exports.LEAST_UPPER_BOUND) {
                        return mid
                    } else {
                        return aLow < 0 ? -1 : aLow
                    }
                }
            }
            exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
                if (aHaystack.length === 0) {
                    return -1
                }
                var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
                if (index < 0) {
                    return -1
                }
                while (index - 1 >= 0) {
                    if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
                        break
                    }--index
                }
                return index
            }
        })
    }, {
        amdefine: 1
    }],
    38: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            var util = require("./util");

            function generatedPositionAfter(mappingA, mappingB) {
                var lineA = mappingA.generatedLine;
                var lineB = mappingB.generatedLine;
                var columnA = mappingA.generatedColumn;
                var columnB = mappingB.generatedColumn;
                return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0
            }

            function MappingList() {
                this._array = [];
                this._sorted = true;
                this._last = {
                    generatedLine: -1,
                    generatedColumn: 0
                }
            }
            MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
                this._array.forEach(aCallback, aThisArg)
            };
            MappingList.prototype.add = function MappingList_add(aMapping) {
                var mapping;
                if (generatedPositionAfter(this._last, aMapping)) {
                    this._last = aMapping;
                    this._array.push(aMapping)
                } else {
                    this._sorted = false;
                    this._array.push(aMapping)
                }
            };
            MappingList.prototype.toArray = function MappingList_toArray() {
                if (!this._sorted) {
                    this._array.sort(util.compareByGeneratedPositionsInflated);
                    this._sorted = true
                }
                return this._array
            };
            exports.MappingList = MappingList
        })
    }, {
        "./util": 43,
        amdefine: 1
    }],
    39: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            function swap(ary, x, y) {
                var temp = ary[x];
                ary[x] = ary[y];
                ary[y] = temp
            }

            function randomIntInRange(low, high) {
                return Math.round(low + Math.random() * (high - low))
            }

            function doQuickSort(ary, comparator, p, r) {
                if (p < r) {
                    var pivotIndex = randomIntInRange(p, r);
                    var i = p - 1;
                    swap(ary, pivotIndex, r);
                    var pivot = ary[r];
                    for (var j = p; j < r; j++) {
                        if (comparator(ary[j], pivot) <= 0) {
                            i += 1;
                            swap(ary, i, j)
                        }
                    }
                    swap(ary, i + 1, j);
                    var q = i + 1;
                    doQuickSort(ary, comparator, p, q - 1);
                    doQuickSort(ary, comparator, q + 1, r)
                }
            }
            exports.quickSort = function(ary, comparator) {
                doQuickSort(ary, comparator, 0, ary.length - 1)
            }
        })
    }, {
        amdefine: 1
    }],
    40: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            var util = require("./util");
            var binarySearch = require("./binary-search");
            var ArraySet = require("./array-set").ArraySet;
            var base64VLQ = require("./base64-vlq");
            var quickSort = require("./quick-sort").quickSort;

            function SourceMapConsumer(aSourceMap) {
                var sourceMap = aSourceMap;
                if (typeof aSourceMap === "string") {
                    sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ""))
                }
                return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap) : new BasicSourceMapConsumer(sourceMap)
            }
            SourceMapConsumer.fromSourceMap = function(aSourceMap) {
                return BasicSourceMapConsumer.fromSourceMap(aSourceMap)
            };
            SourceMapConsumer.prototype._version = 3;
            SourceMapConsumer.prototype.__generatedMappings = null;
            Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
                get: function() {
                    if (!this.__generatedMappings) {
                        this._parseMappings(this._mappings, this.sourceRoot)
                    }
                    return this.__generatedMappings
                }
            });
            SourceMapConsumer.prototype.__originalMappings = null;
            Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
                get: function() {
                    if (!this.__originalMappings) {
                        this._parseMappings(this._mappings, this.sourceRoot)
                    }
                    return this.__originalMappings
                }
            });
            SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
                var c = aStr.charAt(index);
                return c === ";" || c === ","
            };
            SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
                throw new Error("Subclasses must implement _parseMappings")
            };
            SourceMapConsumer.GENERATED_ORDER = 1;
            SourceMapConsumer.ORIGINAL_ORDER = 2;
            SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
            SourceMapConsumer.LEAST_UPPER_BOUND = 2;
            SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
                var context = aContext || null;
                var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
                var mappings;
                switch (order) {
                    case SourceMapConsumer.GENERATED_ORDER:
                        mappings = this._generatedMappings;
                        break;
                    case SourceMapConsumer.ORIGINAL_ORDER:
                        mappings = this._originalMappings;
                        break;
                    default:
                        throw new Error("Unknown order of iteration.")
                }
                var sourceRoot = this.sourceRoot;
                mappings.map(function(mapping) {
                    var source = mapping.source === null ? null : this._sources.at(mapping.source);
                    if (source != null && sourceRoot != null) {
                        source = util.join(sourceRoot, source)
                    }
                    return {
                        source: source,
                        generatedLine: mapping.generatedLine,
                        generatedColumn: mapping.generatedColumn,
                        originalLine: mapping.originalLine,
                        originalColumn: mapping.originalColumn,
                        name: mapping.name === null ? null : this._names.at(mapping.name)
                    }
                }, this).forEach(aCallback, context)
            };
            SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
                var line = util.getArg(aArgs, "line");
                var needle = {
                    source: util.getArg(aArgs, "source"),
                    originalLine: line,
                    originalColumn: util.getArg(aArgs, "column", 0)
                };
                if (this.sourceRoot != null) {
                    needle.source = util.relative(this.sourceRoot, needle.source)
                }
                if (!this._sources.has(needle.source)) {
                    return []
                }
                needle.source = this._sources.indexOf(needle.source);
                var mappings = [];
                var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
                if (index >= 0) {
                    var mapping = this._originalMappings[index];
                    if (aArgs.column === undefined) {
                        var originalLine = mapping.originalLine;
                        while (mapping && mapping.originalLine === originalLine) {
                            mappings.push({
                                line: util.getArg(mapping, "generatedLine", null),
                                column: util.getArg(mapping, "generatedColumn", null),
                                lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
                            });
                            mapping = this._originalMappings[++index]
                        }
                    } else {
                        var originalColumn = mapping.originalColumn;
                        while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
                            mappings.push({
                                line: util.getArg(mapping, "generatedLine", null),
                                column: util.getArg(mapping, "generatedColumn", null),
                                lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
                            });
                            mapping = this._originalMappings[++index]
                        }
                    }
                }
                return mappings
            };
            exports.SourceMapConsumer = SourceMapConsumer;

            function BasicSourceMapConsumer(aSourceMap) {
                var sourceMap = aSourceMap;
                if (typeof aSourceMap === "string") {
                    sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ""))
                }
                var version = util.getArg(sourceMap, "version");
                var sources = util.getArg(sourceMap, "sources");
                var names = util.getArg(sourceMap, "names", []);
                var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
                var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
                var mappings = util.getArg(sourceMap, "mappings");
                var file = util.getArg(sourceMap, "file", null);
                if (version != this._version) {
                    throw new Error("Unsupported version: " + version)
                }
                sources = sources.map(util.normalize);
                this._names = ArraySet.fromArray(names, true);
                this._sources = ArraySet.fromArray(sources, true);
                this.sourceRoot = sourceRoot;
                this.sourcesContent = sourcesContent;
                this._mappings = mappings;
                this.file = file
            }
            BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
            BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
            BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap) {
                var smc = Object.create(BasicSourceMapConsumer.prototype);
                var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
                var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
                smc.sourceRoot = aSourceMap._sourceRoot;
                smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
                smc.file = aSourceMap._file;
                var generatedMappings = aSourceMap._mappings.toArray().slice();
                var destGeneratedMappings = smc.__generatedMappings = [];
                var destOriginalMappings = smc.__originalMappings = [];
                for (var i = 0, length = generatedMappings.length; i < length; i++) {
                    var srcMapping = generatedMappings[i];
                    var destMapping = new Mapping;
                    destMapping.generatedLine = srcMapping.generatedLine;
                    destMapping.generatedColumn = srcMapping.generatedColumn;
                    if (srcMapping.source) {
                        destMapping.source = sources.indexOf(srcMapping.source);
                        destMapping.originalLine = srcMapping.originalLine;
                        destMapping.originalColumn = srcMapping.originalColumn;
                        if (srcMapping.name) {
                            destMapping.name = names.indexOf(srcMapping.name)
                        }
                        destOriginalMappings.push(destMapping)
                    }
                    destGeneratedMappings.push(destMapping)
                }
                quickSort(smc.__originalMappings, util.compareByOriginalPositions);
                return smc
            };
            BasicSourceMapConsumer.prototype._version = 3;
            Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
                get: function() {
                    return this._sources.toArray().map(function(s) {
                        return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s
                    }, this)
                }
            });

            function Mapping() {
                this.generatedLine = 0;
                this.generatedColumn = 0;
                this.source = null;
                this.originalLine = null;
                this.originalColumn = null;
                this.name = null
            }
            BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
                var generatedLine = 1;
                var previousGeneratedColumn = 0;
                var previousOriginalLine = 0;
                var previousOriginalColumn = 0;
                var previousSource = 0;
                var previousName = 0;
                var length = aStr.length;
                var index = 0;
                var cachedSegments = {};
                var temp = {};
                var originalMappings = [];
                var generatedMappings = [];
                var mapping, str, segment, end, value;
                while (index < length) {
                    if (aStr.charAt(index) === ";") {
                        generatedLine++;
                        index++;
                        previousGeneratedColumn = 0
                    } else if (aStr.charAt(index) === ",") {
                        index++
                    } else {
                        mapping = new Mapping;
                        mapping.generatedLine = generatedLine;
                        for (end = index; end < length; end++) {
                            if (this._charIsMappingSeparator(aStr, end)) {
                                break
                            }
                        }
                        str = aStr.slice(index, end);
                        segment = cachedSegments[str];
                        if (segment) {
                            index += str.length
                        } else {
                            segment = [];
                            while (index < end) {
                                base64VLQ.decode(aStr, index, temp);
                                value = temp.value;
                                index = temp.rest;
                                segment.push(value)
                            }
                            if (segment.length === 2) {
                                throw new Error("Found a source, but no line and column")
                            }
                            if (segment.length === 3) {
                                throw new Error("Found a source and line, but no column")
                            }
                            cachedSegments[str] = segment
                        }
                        mapping.generatedColumn = previousGeneratedColumn + segment[0];
                        previousGeneratedColumn = mapping.generatedColumn;
                        if (segment.length > 1) {
                            mapping.source = previousSource + segment[1];
                            previousSource += segment[1];
                            mapping.originalLine = previousOriginalLine + segment[2];
                            previousOriginalLine = mapping.originalLine;
                            mapping.originalLine += 1;
                            mapping.originalColumn = previousOriginalColumn + segment[3];
                            previousOriginalColumn = mapping.originalColumn;
                            if (segment.length > 4) {
                                mapping.name = previousName + segment[4];
                                previousName += segment[4]
                            }
                        }
                        generatedMappings.push(mapping);
                        if (typeof mapping.originalLine === "number") {
                            originalMappings.push(mapping)
                        }
                    }
                }
                quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
                this.__generatedMappings = generatedMappings;
                quickSort(originalMappings, util.compareByOriginalPositions);
                this.__originalMappings = originalMappings
            };
            BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
                if (aNeedle[aLineName] <= 0) {
                    throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName])
                }
                if (aNeedle[aColumnName] < 0) {
                    throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName])
                }
                return binarySearch.search(aNeedle, aMappings, aComparator, aBias)
            };
            BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
                for (var index = 0; index < this._generatedMappings.length; ++index) {
                    var mapping = this._generatedMappings[index];
                    if (index + 1 < this._generatedMappings.length) {
                        var nextMapping = this._generatedMappings[index + 1];
                        if (mapping.generatedLine === nextMapping.generatedLine) {
                            mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
                            continue
                        }
                    }
                    mapping.lastGeneratedColumn = Infinity
                }
            };
            BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
                var needle = {
                    generatedLine: util.getArg(aArgs, "line"),
                    generatedColumn: util.getArg(aArgs, "column")
                };
                var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));
                if (index >= 0) {
                    var mapping = this._generatedMappings[index];
                    if (mapping.generatedLine === needle.generatedLine) {
                        var source = util.getArg(mapping, "source", null);
                        if (source !== null) {
                            source = this._sources.at(source);
                            if (this.sourceRoot != null) {
                                source = util.join(this.sourceRoot, source)
                            }
                        }
                        var name = util.getArg(mapping, "name", null);
                        if (name !== null) {
                            name = this._names.at(name)
                        }
                        return {
                            source: source,
                            line: util.getArg(mapping, "originalLine", null),
                            column: util.getArg(mapping, "originalColumn", null),
                            name: name
                        }
                    }
                }
                return {
                    source: null,
                    line: null,
                    column: null,
                    name: null
                }
            };
            BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
                if (!this.sourcesContent) {
                    return false
                }
                return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
                    return sc == null
                })
            };
            BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
                if (!this.sourcesContent) {
                    return null
                }
                if (this.sourceRoot != null) {
                    aSource = util.relative(this.sourceRoot, aSource)
                }
                if (this._sources.has(aSource)) {
                    return this.sourcesContent[this._sources.indexOf(aSource)]
                }
                var url;
                if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
                    var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
                    if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
                        return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
                    }
                    if ((!url.path || url.path == "/") && this._sources.has("/" + aSource)) {
                        return this.sourcesContent[this._sources.indexOf("/" + aSource)]
                    }
                }
                if (nullOnMissing) {
                    return null
                } else {
                    throw new Error('"' + aSource + '" is not in the SourceMap.')
                }
            };
            BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
                var source = util.getArg(aArgs, "source");
                if (this.sourceRoot != null) {
                    source = util.relative(this.sourceRoot, source)
                }
                if (!this._sources.has(source)) {
                    return {
                        line: null,
                        column: null,
                        lastColumn: null
                    }
                }
                source = this._sources.indexOf(source);
                var needle = {
                    source: source,
                    originalLine: util.getArg(aArgs, "line"),
                    originalColumn: util.getArg(aArgs, "column")
                };
                var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND));

                if (index >= 0) {
                    var mapping = this._originalMappings[index];
                    if (mapping.source === needle.source) {
                        return {
                            line: util.getArg(mapping, "generatedLine", null),
                            column: util.getArg(mapping, "generatedColumn", null),
                            lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
                        }
                    }
                }
                return {
                    line: null,
                    column: null,
                    lastColumn: null
                }
            };
            exports.BasicSourceMapConsumer = BasicSourceMapConsumer;

            function IndexedSourceMapConsumer(aSourceMap) {
                var sourceMap = aSourceMap;
                if (typeof aSourceMap === "string") {
                    sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ""))
                }
                var version = util.getArg(sourceMap, "version");
                var sections = util.getArg(sourceMap, "sections");
                if (version != this._version) {
                    throw new Error("Unsupported version: " + version)
                }
                this._sources = new ArraySet;
                this._names = new ArraySet;
                var lastOffset = {
                    line: -1,
                    column: 0
                };
                this._sections = sections.map(function(s) {
                    if (s.url) {
                        throw new Error("Support for url field in sections not implemented.")
                    }
                    var offset = util.getArg(s, "offset");
                    var offsetLine = util.getArg(offset, "line");
                    var offsetColumn = util.getArg(offset, "column");
                    if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
                        throw new Error("Section offsets must be ordered and non-overlapping.")
                    }
                    lastOffset = offset;
                    return {
                        generatedOffset: {
                            generatedLine: offsetLine + 1,
                            generatedColumn: offsetColumn + 1
                        },
                        consumer: new SourceMapConsumer(util.getArg(s, "map"))
                    }
                })
            }
            IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
            IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
            IndexedSourceMapConsumer.prototype._version = 3;
            Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
                get: function() {
                    var sources = [];
                    for (var i = 0; i < this._sections.length; i++) {
                        for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
                            sources.push(this._sections[i].consumer.sources[j])
                        }
                    }
                    return sources
                }
            });
            IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
                var needle = {
                    generatedLine: util.getArg(aArgs, "line"),
                    generatedColumn: util.getArg(aArgs, "column")
                };
                var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) {
                    var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
                    if (cmp) {
                        return cmp
                    }
                    return needle.generatedColumn - section.generatedOffset.generatedColumn
                });
                var section = this._sections[sectionIndex];
                if (!section) {
                    return {
                        source: null,
                        line: null,
                        column: null,
                        name: null
                    }
                }
                return section.consumer.originalPositionFor({
                    line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
                    column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
                    bias: aArgs.bias
                })
            };
            IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
                return this._sections.every(function(s) {
                    return s.consumer.hasContentsOfAllSources()
                })
            };
            IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
                for (var i = 0; i < this._sections.length; i++) {
                    var section = this._sections[i];
                    var content = section.consumer.sourceContentFor(aSource, true);
                    if (content) {
                        return content
                    }
                }
                if (nullOnMissing) {
                    return null
                } else {
                    throw new Error('"' + aSource + '" is not in the SourceMap.')
                }
            };
            IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
                for (var i = 0; i < this._sections.length; i++) {
                    var section = this._sections[i];
                    if (section.consumer.sources.indexOf(util.getArg(aArgs, "source")) === -1) {
                        continue
                    }
                    var generatedPosition = section.consumer.generatedPositionFor(aArgs);
                    if (generatedPosition) {
                        var ret = {
                            line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
                            column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
                        };
                        return ret
                    }
                }
                return {
                    line: null,
                    column: null
                }
            };
            IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
                this.__generatedMappings = [];
                this.__originalMappings = [];
                for (var i = 0; i < this._sections.length; i++) {
                    var section = this._sections[i];
                    var sectionMappings = section.consumer._generatedMappings;
                    for (var j = 0; j < sectionMappings.length; j++) {
                        var mapping = sectionMappings[i];
                        var source = section.consumer._sources.at(mapping.source);
                        if (section.consumer.sourceRoot !== null) {
                            source = util.join(section.consumer.sourceRoot, source)
                        }
                        this._sources.add(source);
                        source = this._sources.indexOf(source);
                        var name = section.consumer._names.at(mapping.name);
                        this._names.add(name);
                        name = this._names.indexOf(name);
                        var adjustedMapping = {
                            source: source,
                            generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
                            generatedColumn: mapping.column + (section.generatedOffset.generatedLine === mapping.generatedLine) ? section.generatedOffset.generatedColumn - 1 : 0,
                            originalLine: mapping.originalLine,
                            originalColumn: mapping.originalColumn,
                            name: name
                        };
                        this.__generatedMappings.push(adjustedMapping);
                        if (typeof adjustedMapping.originalLine === "number") {
                            this.__originalMappings.push(adjustedMapping)
                        }
                    }
                }
                quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
                quickSort(this.__originalMappings, util.compareByOriginalPositions)
            };
            exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer
        })
    }, {
        "./array-set": 34,
        "./base64-vlq": 35,
        "./binary-search": 37,
        "./quick-sort": 39,
        "./util": 43,
        amdefine: 1
    }],
    41: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            var base64VLQ = require("./base64-vlq");
            var util = require("./util");
            var ArraySet = require("./array-set").ArraySet;
            var MappingList = require("./mapping-list").MappingList;

            function SourceMapGenerator(aArgs) {
                if (!aArgs) {
                    aArgs = {}
                }
                this._file = util.getArg(aArgs, "file", null);
                this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
                this._skipValidation = util.getArg(aArgs, "skipValidation", false);
                this._sources = new ArraySet;
                this._names = new ArraySet;
                this._mappings = new MappingList;
                this._sourcesContents = null
            }
            SourceMapGenerator.prototype._version = 3;
            SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
                var sourceRoot = aSourceMapConsumer.sourceRoot;
                var generator = new SourceMapGenerator({
                    file: aSourceMapConsumer.file,
                    sourceRoot: sourceRoot
                });
                aSourceMapConsumer.eachMapping(function(mapping) {
                    var newMapping = {
                        generated: {
                            line: mapping.generatedLine,
                            column: mapping.generatedColumn
                        }
                    };
                    if (mapping.source != null) {
                        newMapping.source = mapping.source;
                        if (sourceRoot != null) {
                            newMapping.source = util.relative(sourceRoot, newMapping.source)
                        }
                        newMapping.original = {
                            line: mapping.originalLine,
                            column: mapping.originalColumn
                        };
                        if (mapping.name != null) {
                            newMapping.name = mapping.name
                        }
                    }
                    generator.addMapping(newMapping)
                });
                aSourceMapConsumer.sources.forEach(function(sourceFile) {
                    var content = aSourceMapConsumer.sourceContentFor(sourceFile);
                    if (content != null) {
                        generator.setSourceContent(sourceFile, content)
                    }
                });
                return generator
            };
            SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
                var generated = util.getArg(aArgs, "generated");
                var original = util.getArg(aArgs, "original", null);
                var source = util.getArg(aArgs, "source", null);
                var name = util.getArg(aArgs, "name", null);
                if (!this._skipValidation) {
                    this._validateMapping(generated, original, source, name)
                }
                if (source != null && !this._sources.has(source)) {
                    this._sources.add(source)
                }
                if (name != null && !this._names.has(name)) {
                    this._names.add(name)
                }
                this._mappings.add({
                    generatedLine: generated.line,
                    generatedColumn: generated.column,
                    originalLine: original != null && original.line,
                    originalColumn: original != null && original.column,
                    source: source,
                    name: name
                })
            };
            SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
                var source = aSourceFile;
                if (this._sourceRoot != null) {
                    source = util.relative(this._sourceRoot, source)
                }
                if (aSourceContent != null) {
                    if (!this._sourcesContents) {
                        this._sourcesContents = {}
                    }
                    this._sourcesContents[util.toSetString(source)] = aSourceContent
                } else if (this._sourcesContents) {
                    delete this._sourcesContents[util.toSetString(source)];
                    if (Object.keys(this._sourcesContents).length === 0) {
                        this._sourcesContents = null
                    }
                }
            };
            SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
                var sourceFile = aSourceFile;
                if (aSourceFile == null) {
                    if (aSourceMapConsumer.file == null) {
                        throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, " + 'or the source map\'s "file" property. Both were omitted.')
                    }
                    sourceFile = aSourceMapConsumer.file
                }
                var sourceRoot = this._sourceRoot;
                if (sourceRoot != null) {
                    sourceFile = util.relative(sourceRoot, sourceFile)
                }
                var newSources = new ArraySet;
                var newNames = new ArraySet;
                this._mappings.unsortedForEach(function(mapping) {
                    if (mapping.source === sourceFile && mapping.originalLine != null) {
                        var original = aSourceMapConsumer.originalPositionFor({
                            line: mapping.originalLine,
                            column: mapping.originalColumn
                        });
                        if (original.source != null) {
                            mapping.source = original.source;
                            if (aSourceMapPath != null) {
                                mapping.source = util.join(aSourceMapPath, mapping.source)
                            }
                            if (sourceRoot != null) {
                                mapping.source = util.relative(sourceRoot, mapping.source)
                            }
                            mapping.originalLine = original.line;
                            mapping.originalColumn = original.column;
                            if (original.name != null) {
                                mapping.name = original.name
                            }
                        }
                    }
                    var source = mapping.source;
                    if (source != null && !newSources.has(source)) {
                        newSources.add(source)
                    }
                    var name = mapping.name;
                    if (name != null && !newNames.has(name)) {
                        newNames.add(name)
                    }
                }, this);
                this._sources = newSources;
                this._names = newNames;
                aSourceMapConsumer.sources.forEach(function(sourceFile) {
                    var content = aSourceMapConsumer.sourceContentFor(sourceFile);
                    if (content != null) {
                        if (aSourceMapPath != null) {
                            sourceFile = util.join(aSourceMapPath, sourceFile)
                        }
                        if (sourceRoot != null) {
                            sourceFile = util.relative(sourceRoot, sourceFile)
                        }
                        this.setSourceContent(sourceFile, content)
                    }
                }, this)
            };
            SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
                if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
                    return
                } else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
                    return
                } else {
                    throw new Error("Invalid mapping: " + JSON.stringify({
                        generated: aGenerated,
                        source: aSource,
                        original: aOriginal,
                        name: aName
                    }))
                }
            };
            SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
                var previousGeneratedColumn = 0;
                var previousGeneratedLine = 1;
                var previousOriginalColumn = 0;
                var previousOriginalLine = 0;
                var previousName = 0;
                var previousSource = 0;
                var result = "";
                var mapping;
                var mappings = this._mappings.toArray();
                for (var i = 0, len = mappings.length; i < len; i++) {
                    mapping = mappings[i];
                    if (mapping.generatedLine !== previousGeneratedLine) {
                        previousGeneratedColumn = 0;
                        while (mapping.generatedLine !== previousGeneratedLine) {
                            result += ";";
                            previousGeneratedLine++
                        }
                    } else {
                        if (i > 0) {
                            if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
                                continue
                            }
                            result += ","
                        }
                    }
                    result += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
                    previousGeneratedColumn = mapping.generatedColumn;
                    if (mapping.source != null) {
                        result += base64VLQ.encode(this._sources.indexOf(mapping.source) - previousSource);
                        previousSource = this._sources.indexOf(mapping.source);
                        result += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
                        previousOriginalLine = mapping.originalLine - 1;
                        result += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
                        previousOriginalColumn = mapping.originalColumn;
                        if (mapping.name != null) {
                            result += base64VLQ.encode(this._names.indexOf(mapping.name) - previousName);
                            previousName = this._names.indexOf(mapping.name)
                        }
                    }
                }
                return result
            };
            SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
                return aSources.map(function(source) {
                    if (!this._sourcesContents) {
                        return null
                    }
                    if (aSourceRoot != null) {
                        source = util.relative(aSourceRoot, source)
                    }
                    var key = util.toSetString(source);
                    return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null
                }, this)
            };
            SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
                var map = {
                    version: this._version,
                    sources: this._sources.toArray(),
                    names: this._names.toArray(),
                    mappings: this._serializeMappings()
                };
                if (this._file != null) {
                    map.file = this._file
                }
                if (this._sourceRoot != null) {
                    map.sourceRoot = this._sourceRoot
                }
                if (this._sourcesContents) {
                    map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot)
                }
                return map
            };
            SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
                return JSON.stringify(this.toJSON())
            };
            exports.SourceMapGenerator = SourceMapGenerator
        })
    }, {
        "./array-set": 34,
        "./base64-vlq": 35,
        "./mapping-list": 38,
        "./util": 43,
        amdefine: 1
    }],
    42: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            var SourceMapGenerator = require("./source-map-generator").SourceMapGenerator;
            var util = require("./util");
            var REGEX_NEWLINE = /(\r?\n)/;
            var NEWLINE_CODE = 10;
            var isSourceNode = "$$$isSourceNode$$$";

            function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
                this.children = [];
                this.sourceContents = {};
                this.line = aLine == null ? null : aLine;
                this.column = aColumn == null ? null : aColumn;
                this.source = aSource == null ? null : aSource;
                this.name = aName == null ? null : aName;
                this[isSourceNode] = true;
                if (aChunks != null) this.add(aChunks)
            }
            SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
                var node = new SourceNode;
                var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
                var shiftNextLine = function() {
                    var lineContents = remainingLines.shift();
                    var newLine = remainingLines.shift() || "";
                    return lineContents + newLine
                };
                var lastGeneratedLine = 1,
                    lastGeneratedColumn = 0;
                var lastMapping = null;
                aSourceMapConsumer.eachMapping(function(mapping) {
                    if (lastMapping !== null) {
                        if (lastGeneratedLine < mapping.generatedLine) {
                            var code = "";
                            addMappingWithCode(lastMapping, shiftNextLine());
                            lastGeneratedLine++;
                            lastGeneratedColumn = 0
                        } else {
                            var nextLine = remainingLines[0];
                            var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
                            remainingLines[0] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
                            lastGeneratedColumn = mapping.generatedColumn;
                            addMappingWithCode(lastMapping, code);
                            lastMapping = mapping;
                            return
                        }
                    }
                    while (lastGeneratedLine < mapping.generatedLine) {
                        node.add(shiftNextLine());
                        lastGeneratedLine++
                    }
                    if (lastGeneratedColumn < mapping.generatedColumn) {
                        var nextLine = remainingLines[0];
                        node.add(nextLine.substr(0, mapping.generatedColumn));
                        remainingLines[0] = nextLine.substr(mapping.generatedColumn);
                        lastGeneratedColumn = mapping.generatedColumn
                    }
                    lastMapping = mapping
                }, this);
                if (remainingLines.length > 0) {
                    if (lastMapping) {
                        addMappingWithCode(lastMapping, shiftNextLine())
                    }
                    node.add(remainingLines.join(""))
                }
                aSourceMapConsumer.sources.forEach(function(sourceFile) {
                    var content = aSourceMapConsumer.sourceContentFor(sourceFile);
                    if (content != null) {
                        if (aRelativePath != null) {
                            sourceFile = util.join(aRelativePath, sourceFile)
                        }
                        node.setSourceContent(sourceFile, content)
                    }
                });
                return node;

                function addMappingWithCode(mapping, code) {
                    if (mapping === null || mapping.source === undefined) {
                        node.add(code)
                    } else {
                        var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
                        node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name))
                    }
                }
            };
            SourceNode.prototype.add = function SourceNode_add(aChunk) {
                if (Array.isArray(aChunk)) {
                    aChunk.forEach(function(chunk) {
                        this.add(chunk)
                    }, this)
                } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
                    if (aChunk) {
                        this.children.push(aChunk)
                    }
                } else {
                    throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk)
                }
                return this
            };
            SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
                if (Array.isArray(aChunk)) {
                    for (var i = aChunk.length - 1; i >= 0; i--) {
                        this.prepend(aChunk[i])
                    }
                } else if (aChunk[isSourceNode] || typeof aChunk === "string") {
                    this.children.unshift(aChunk)
                } else {
                    throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk)
                }
                return this
            };
            SourceNode.prototype.walk = function SourceNode_walk(aFn) {
                var chunk;
                for (var i = 0, len = this.children.length; i < len; i++) {
                    chunk = this.children[i];
                    if (chunk[isSourceNode]) {
                        chunk.walk(aFn)
                    } else {
                        if (chunk !== "") {
                            aFn(chunk, {
                                source: this.source,
                                line: this.line,
                                column: this.column,
                                name: this.name
                            })
                        }
                    }
                }
            };
            SourceNode.prototype.join = function SourceNode_join(aSep) {
                var newChildren;
                var i;
                var len = this.children.length;
                if (len > 0) {
                    newChildren = [];
                    for (i = 0; i < len - 1; i++) {
                        newChildren.push(this.children[i]);
                        newChildren.push(aSep)
                    }
                    newChildren.push(this.children[i]);
                    this.children = newChildren
                }
                return this
            };
            SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
                var lastChild = this.children[this.children.length - 1];
                if (lastChild[isSourceNode]) {
                    lastChild.replaceRight(aPattern, aReplacement)
                } else if (typeof lastChild === "string") {
                    this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement)
                } else {
                    this.children.push("".replace(aPattern, aReplacement))
                }
                return this
            };
            SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
                this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent
            };
            SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
                for (var i = 0, len = this.children.length; i < len; i++) {
                    if (this.children[i][isSourceNode]) {
                        this.children[i].walkSourceContents(aFn)
                    }
                }
                var sources = Object.keys(this.sourceContents);
                for (var i = 0, len = sources.length; i < len; i++) {
                    aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]])
                }
            };
            SourceNode.prototype.toString = function SourceNode_toString() {
                var str = "";
                this.walk(function(chunk) {
                    str += chunk
                });
                return str
            };
            SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
                var generated = {
                    code: "",
                    line: 1,
                    column: 0
                };
                var map = new SourceMapGenerator(aArgs);
                var sourceMappingActive = false;
                var lastOriginalSource = null;
                var lastOriginalLine = null;
                var lastOriginalColumn = null;
                var lastOriginalName = null;
                this.walk(function(chunk, original) {
                    generated.code += chunk;
                    if (original.source !== null && original.line !== null && original.column !== null) {
                        if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
                            map.addMapping({
                                source: original.source,
                                original: {
                                    line: original.line,
                                    column: original.column
                                },
                                generated: {
                                    line: generated.line,
                                    column: generated.column
                                },
                                name: original.name
                            })
                        }
                        lastOriginalSource = original.source;
                        lastOriginalLine = original.line;
                        lastOriginalColumn = original.column;
                        lastOriginalName = original.name;
                        sourceMappingActive = true
                    } else if (sourceMappingActive) {
                        map.addMapping({
                            generated: {
                                line: generated.line,
                                column: generated.column
                            }
                        });
                        lastOriginalSource = null;
                        sourceMappingActive = false
                    }
                    for (var idx = 0, length = chunk.length; idx < length; idx++) {
                        if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
                            generated.line++;
                            generated.column = 0;
                            if (idx + 1 === length) {
                                lastOriginalSource = null;
                                sourceMappingActive = false
                            } else if (sourceMappingActive) {
                                map.addMapping({
                                    source: original.source,
                                    original: {
                                        line: original.line,
                                        column: original.column
                                    },
                                    generated: {
                                        line: generated.line,
                                        column: generated.column
                                    },
                                    name: original.name
                                })
                            }
                        } else {
                            generated.column++
                        }
                    }
                });
                this.walkSourceContents(function(sourceFile, sourceContent) {
                    map.setSourceContent(sourceFile, sourceContent)
                });
                return {
                    code: generated.code,
                    map: map
                }
            };
            exports.SourceNode = SourceNode
        })
    }, {
        "./source-map-generator": 41,
        "./util": 43,
        amdefine: 1
    }],
    43: [function(require, module, exports) {
        if (typeof define !== "function") {
            var define = require("amdefine")(module, require)
        }
        define(function(require, exports, module) {
            function getArg(aArgs, aName, aDefaultValue) {
                if (aName in aArgs) {
                    return aArgs[aName]
                } else if (arguments.length === 3) {
                    return aDefaultValue
                } else {
                    throw new Error('"' + aName + '" is a required argument.')
                }
            }
            exports.getArg = getArg;
            var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
            var dataUrlRegexp = /^data:.+\,.+$/;

            function urlParse(aUrl) {
                var match = aUrl.match(urlRegexp);
                if (!match) {
                    return null
                }
                return {
                    scheme: match[1],
                    auth: match[2],
                    host: match[3],
                    port: match[4],
                    path: match[5]
                }
            }
            exports.urlParse = urlParse;

            function urlGenerate(aParsedUrl) {
                var url = "";
                if (aParsedUrl.scheme) {
                    url += aParsedUrl.scheme + ":"
                }
                url += "//";
                if (aParsedUrl.auth) {
                    url += aParsedUrl.auth + "@"
                }
                if (aParsedUrl.host) {
                    url += aParsedUrl.host
                }
                if (aParsedUrl.port) {
                    url += ":" + aParsedUrl.port
                }
                if (aParsedUrl.path) {
                    url += aParsedUrl.path
                }
                return url
            }
            exports.urlGenerate = urlGenerate;

            function normalize(aPath) {
                var path = aPath;
                var url = urlParse(aPath);
                if (url) {
                    if (!url.path) {
                        return aPath
                    }
                    path = url.path
                }
                var isAbsolute = path.charAt(0) === "/";
                var parts = path.split(/\/+/);
                for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
                    part = parts[i];
                    if (part === ".") {
                        parts.splice(i, 1)
                    } else if (part === "..") {
                        up++
                    } else if (up > 0) {
                        if (part === "") {
                            parts.splice(i + 1, up);
                            up = 0
                        } else {
                            parts.splice(i, 2);
                            up--
                        }
                    }
                }
                path = parts.join("/");
                if (path === "") {
                    path = isAbsolute ? "/" : "."
                }
                if (url) {
                    url.path = path;
                    return urlGenerate(url)
                }
                return path
            }
            exports.normalize = normalize;

            function join(aRoot, aPath) {
                if (aRoot === "") {
                    aRoot = "."
                }
                if (aPath === "") {
                    aPath = "."
                }
                var aPathUrl = urlParse(aPath);
                var aRootUrl = urlParse(aRoot);
                if (aRootUrl) {
                    aRoot = aRootUrl.path || "/"
                }
                if (aPathUrl && !aPathUrl.scheme) {
                    if (aRootUrl) {
                        aPathUrl.scheme = aRootUrl.scheme
                    }
                    return urlGenerate(aPathUrl)
                }
                if (aPathUrl || aPath.match(dataUrlRegexp)) {
                    return aPath
                }
                if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
                    aRootUrl.host = aPath;
                    return urlGenerate(aRootUrl)
                }
                var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
                if (aRootUrl) {
                    aRootUrl.path = joined;
                    return urlGenerate(aRootUrl)
                }
                return joined
            }
            exports.join = join;

            function relative(aRoot, aPath) {
                if (aRoot === "") {
                    aRoot = "."
                }
                aRoot = aRoot.replace(/\/$/, "");
                var level = 0;
                while (aPath.indexOf(aRoot + "/") !== 0) {
                    var index = aRoot.lastIndexOf("/");
                    if (index < 0) {
                        return aPath
                    }
                    aRoot = aRoot.slice(0, index);
                    if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
                        return aPath
                    }++level
                }
                return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1)
            }
            exports.relative = relative;

            function toSetString(aStr) {
                return "$" + aStr
            }
            exports.toSetString = toSetString;

            function fromSetString(aStr) {
                return aStr.substr(1)
            }
            exports.fromSetString = fromSetString;

            function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
                var cmp = mappingA.source - mappingB.source;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.originalLine - mappingB.originalLine;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.originalColumn - mappingB.originalColumn;
                if (cmp !== 0 || onlyCompareOriginal) {
                    return cmp
                }
                cmp = mappingA.generatedColumn - mappingB.generatedColumn;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.generatedLine - mappingB.generatedLine;
                if (cmp !== 0) {
                    return cmp
                }
                return mappingA.name - mappingB.name
            }
            exports.compareByOriginalPositions = compareByOriginalPositions;

            function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
                var cmp = mappingA.generatedLine - mappingB.generatedLine;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.generatedColumn - mappingB.generatedColumn;
                if (cmp !== 0 || onlyCompareGenerated) {
                    return cmp
                }
                cmp = mappingA.source - mappingB.source;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.originalLine - mappingB.originalLine;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.originalColumn - mappingB.originalColumn;
                if (cmp !== 0) {
                    return cmp
                }
                return mappingA.name - mappingB.name
            }
            exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;

            function strcmp(aStr1, aStr2) {
                if (aStr1 === aStr2) {
                    return 0
                }
                if (aStr1 > aStr2) {
                    return 1
                }
                return -1
            }

            function compareByGeneratedPositionsInflated(mappingA, mappingB) {
                var cmp = mappingA.generatedLine - mappingB.generatedLine;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.generatedColumn - mappingB.generatedColumn;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = strcmp(mappingA.source, mappingB.source);
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.originalLine - mappingB.originalLine;
                if (cmp !== 0) {
                    return cmp
                }
                cmp = mappingA.originalColumn - mappingB.originalColumn;
                if (cmp !== 0) {
                    return cmp
                }
                return strcmp(mappingA.name, mappingB.name)
            }
            exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated
        })
    }, {
        amdefine: 1
    }],
    44: [function(require, module, exports) {
        (function(process) {
            function normalizeArray(parts, allowAboveRoot) {
                var up = 0;
                for (var i = parts.length - 1; i >= 0; i--) {
                    var last = parts[i];
                    if (last === ".") {
                        parts.splice(i, 1)
                    } else if (last === "..") {
                        parts.splice(i, 1);
                        up++
                    } else if (up) {
                        parts.splice(i, 1);
                        up--
                    }
                }
                if (allowAboveRoot) {
                    for (; up--; up) {
                        parts.unshift("..")
                    }
                }
                return parts
            }
            var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
            var splitPath = function(filename) {
                return splitPathRe.exec(filename).slice(1)
            };
            exports.resolve = function() {
                var resolvedPath = "",
                    resolvedAbsolute = false;
                for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
                    var path = i >= 0 ? arguments[i] : process.cwd();
                    if (typeof path !== "string") {
                        throw new TypeError("Arguments to path.resolve must be strings")
                    } else if (!path) {
                        continue
                    }
                    resolvedPath = path + "/" + resolvedPath;
                    resolvedAbsolute = path.charAt(0) === "/"
                }
                resolvedPath = normalizeArray(filter(resolvedPath.split("/"), function(p) {
                    return !!p
                }), !resolvedAbsolute).join("/");
                return (resolvedAbsolute ? "/" : "") + resolvedPath || "."
            };
            exports.normalize = function(path) {
                var isAbsolute = exports.isAbsolute(path),
                    trailingSlash = substr(path, -1) === "/";
                path = normalizeArray(filter(path.split("/"), function(p) {
                    return !!p
                }), !isAbsolute).join("/");
                if (!path && !isAbsolute) {
                    path = "."
                }
                if (path && trailingSlash) {
                    path += "/"
                }
                return (isAbsolute ? "/" : "") + path
            };
            exports.isAbsolute = function(path) {
                return path.charAt(0) === "/"
            };
            exports.join = function() {
                var paths = Array.prototype.slice.call(arguments, 0);
                return exports.normalize(filter(paths, function(p, index) {
                    if (typeof p !== "string") {
                        throw new TypeError("Arguments to path.join must be strings")
                    }
                    return p
                }).join("/"))
            };
            exports.relative = function(from, to) {
                from = exports.resolve(from).substr(1);
                to = exports.resolve(to).substr(1);

                function trim(arr) {
                    var start = 0;
                    for (; start < arr.length; start++) {
                        if (arr[start] !== "") break
                    }
                    var end = arr.length - 1;
                    for (; end >= 0; end--) {
                        if (arr[end] !== "") break
                    }
                    if (start > end) return [];
                    return arr.slice(start, end - start + 1)
                }
                var fromParts = trim(from.split("/"));
                var toParts = trim(to.split("/"));
                var length = Math.min(fromParts.length, toParts.length);
                var samePartsLength = length;
                for (var i = 0; i < length; i++) {
                    if (fromParts[i] !== toParts[i]) {
                        samePartsLength = i;
                        break
                    }
                }
                var outputParts = [];
                for (var i = samePartsLength; i < fromParts.length; i++) {
                    outputParts.push("..")
                }
                outputParts = outputParts.concat(toParts.slice(samePartsLength));
                return outputParts.join("/")
            };
            exports.sep = "/";
            exports.delimiter = ":";
            exports.dirname = function(path) {
                var result = splitPath(path),
                    root = result[0],
                    dir = result[1];
                if (!root && !dir) {
                    return "."
                }
                if (dir) {
                    dir = dir.substr(0, dir.length - 1)
                }
                return root + dir
            };
            exports.basename = function(path, ext) {
                var f = splitPath(path)[2];
                if (ext && f.substr(-1 * ext.length) === ext) {
                    f = f.substr(0, f.length - ext.length)
                }
                return f
            };
            exports.extname = function(path) {
                return splitPath(path)[3]
            };

            function filter(xs, f) {
                if (xs.filter) return xs.filter(f);
                var res = [];
                for (var i = 0; i < xs.length; i++) {
                    if (f(xs[i], i, xs)) res.push(xs[i])
                }
                return res
            }
            var substr = "ab".substr(-1) === "b" ? function(str, start, len) {
                return str.substr(start, len)
            } : function(str, start, len) {
                if (start < 0) start = str.length + start;
                return str.substr(start, len)
            }
        }).call(this, require("_process"))
    }, {
        _process: 45
    }],
    45: [function(require, module, exports) {
        var process = module.exports = {};
        var queue = [];
        var draining = false;
        var currentQueue;
        var queueIndex = -1;

        function cleanUpNextTick() {
            draining = false;
            if (currentQueue.length) {
                queue = currentQueue.concat(queue)
            } else {
                queueIndex = -1
            }
            if (queue.length) {
                drainQueue()
            }
        }

        function drainQueue() {
            if (draining) {
                return
            }
            var timeout = setTimeout(cleanUpNextTick);
            draining = true;
            var len = queue.length;
            while (len) {
                currentQueue = queue;
                queue = [];
                while (++queueIndex < len) {
                    if (currentQueue) {
                        currentQueue[queueIndex].run()
                    }
                }
                queueIndex = -1;
                len = queue.length
            }
            currentQueue = null;
            draining = false;
            clearTimeout(timeout)
        }
        process.nextTick = function(fun) {
            var args = new Array(arguments.length - 1);
            if (arguments.length > 1) {
                for (var i = 1; i < arguments.length; i++) {
                    args[i - 1] = arguments[i]
                }
            }
            queue.push(new Item(fun, args));
            if (queue.length === 1 && !draining) {
                setTimeout(drainQueue, 0)
            }
        };

        function Item(fun, array) {
            this.fun = fun;
            this.array = array
        }
        Item.prototype.run = function() {
            this.fun.apply(null, this.array)
        };
        process.title = "browser";
        process.browser = true;
        process.env = {};
        process.argv = [];
        process.version = "";
        process.versions = {};

        function noop() {}
        process.on = noop;
        process.addListener = noop;
        process.once = noop;
        process.off = noop;
        process.removeListener = noop;
        process.removeAllListeners = noop;
        process.emit = noop;
        process.binding = function(name) {
            throw new Error("process.binding is not supported")
        };
        process.cwd = function() {
            return "/"
        };
        process.chdir = function(dir) {
            throw new Error("process.chdir is not supported")
        };
        process.umask = function() {
            return 0
        }
    }, {}],
    46: [function(require, module, exports) {
        "use strict";
        require("./utilities/filter");
        require("./utilities/customValidationMessages");
        var verify = require("./utilities/verify");
        var toggler = require("./utilities/toggler");
        //var leaveSite = require("./utilities/leaveSite");
        //leaveSite.init();
        toggler.init()
    }, {
        "./utilities/customValidationMessages": 47,
        "./utilities/filter": 48,
        "./utilities/leaveSite": 49,
        "./utilities/toggler": 50,
        "./utilities/verify": 51
    }],
    47: [function(require, module, exports) {
        "use strict";
        var handleValidationMessages = function handleValidationMessages(form) {
            var required = [].slice.call(form.querySelectorAll("[required]"));
            var requiredWithMessage = required.filter(function(field) {
                return field.hasAttribute("data-validationmessage")
            });
            required.forEach(function(field) {
                field.oninvalid = function(e) {
                    if (!e.target.validity.valid) {
                        form.classList.add("submitted")
                    }
                }
            });
            requiredWithMessage.forEach(function(field) {
                var validationMessage = field.getAttribute("data-validationmessage");
                field.oninvalid = function(e) {
                    if (!e.target.validity.valid) {
                        e.target.setCustomValidity(validationMessage)
                    }
                };
                field.oninput = function(e) {
                    e.target.setCustomValidity("")
                }
            })
        };
        var init = function init() {
            var pageForms = document.forms;
            for (var i = 0; i < pageForms.length; i++) {
                var form = pageForms[i];
                handleValidationMessages(form)
            }
        };
        init()
    }, {}],
    48: [function(require, module, exports) {
        "use strict";
        var $filterBanks = void 0;
        var initFilterBank = function initFilterBank() {
            var $this = $(this);
            var $controls = $this.find(".js-filterControl");
            var itemKey = $this.data("filterItems");
            var $items = $(itemKey);
            var currentFilter = "";
            $controls.on("click", function(e) {
                var $this = $(this);
                var filterKey = $this.data("filterKey");
                var $filtered = void 0;
                var checked = $this.attr("aria-checked") === "true" ? "false" : "true";
                $controls.attr("aria-checked", "false");
                $this.attr("aria-checked", checked);
                if (currentFilter !== filterKey && filterKey !== "all") {
                    $items.hide();
                    $filtered = $items.filter(filterKey);
                    $filtered.show();
                    currentFilter = filterKey
                } else {
                    $items.show();
                    currentFilter = ""
                }
            })
        };
        var initFilter = function initFilter() {
            $filterBanks = $(".js-filterBank");
            $filterBanks.each(function(index, value) {
                return initFilterBank.call(value)
            })
        };
        initFilter();
        exports.init = initFilter
    }, {}],
    49: [function(require, module, exports) {}, {
        handlebars: 32
    }],
    50: [function(require, module, exports) {
        "use strict";
        var toggle = function toggle(e) {
            var $this = $(this);
            var cls = $this.data("togglerclass");
            var target = $this.data("togglertarget");

            // Do not toggle aria-pressed if aria-expanded is present. Doing so will interfere with some SR tech.
            if ($this.attr('aria-expanded') === undefined) {
                var pressed = $this.attr("aria-pressed") === "true" ? "false" : "true";
                $this.attr("aria-pressed", pressed);
            }

            $(target).toggleClass(cls);
            $this.toggleClass("toggle-on");
            e.preventDefault();
            $this.trigger("toggled", this)
        };
        exports.init = function() {
            $("body").on("click", ".js-toggler", toggle)
        }
    }, {}],
    51: [function(require, module, exports) {
        "use strict";
        $(document).ready(function() {
            function verifyDropdown() {
                var $verifyContent = $(".verify-group");
                var $verifySelector = $("#verify-selector");
                $verifyContent.hide();
                $verifySelector.on("change", function (e) {
                    var $verifyTarget = $("#" + $(this).val()).show();
                    $verifyContent.not($verifyTarget).hide()
                });
            } verifyDropdown()
        })
    }, {}]
}, {}, [46]);

$(function () {
    //$('li[title]').each(function (index, element)
    //{
    //	var anItem = $(element);
    //	var li_title = anItem.attr('title');
    //	anItem.prepend('<span class="li-title">' + li_title + '</span>');
    //});

    $('.doc-container ol,.doc-container ul').each(function (index, element) {
        var aList = $(element);
        var symbol_l = aList.data('title-left-enclosing-symbol') || '';
        var symbol_r = aList.data('title-right-enclosing-symbol') || '';

        aList.children('li').each(function (index, element) {
            var anItem = $(element);
            var li_title = anItem.attr('title');
            if (li_title != null) {
                anItem.prepend('<span class="li-title">' + symbol_l + li_title + symbol_r + '</span>');
            }
        });
    });

    $('.doc-container ol.multilevel:not(.multilevel-skip)').each(function (index, element) {
        multiOrderedList($(this));
    });

    function multiOrderedList2(aList, currentPrefix) {
        if (currentPrefix == null) {
            currentPrefix = '';
        }
        else {
            currentPrefix += ".";
        }
        aList.children('li').each(function (index, element) {
            var counter = index + 1;
            var anItem = $(element);
            var newPrefix = currentPrefix + '<ol class="noproc"><li value="' + counter + '"></li></ol>';
            anItem.prepend(newPrefix + '. ');
            //This commented block doesn't work in IE.
            //anItem.children('ol:not(.noproc)').each(function (index, childOl)
            //{
            //	multiOrderedList($(childOl), newPrefix);
            //});
            $.each(anItem.children('ol:not(.noproc)'), function (index, childOl) {
                multiOrderedList($(childOl), newPrefix);
            });
        });
    }

    function multiOrderedList(aList, currentPrefix) {
        if (currentPrefix == null) {
            currentPrefix = '';
        }
        else {
            currentPrefix += ".";
        }
        aList.children('li').each(function (index, element) {
            var counter = index + 1;
            var anItem = $(element);
            var newPrefix = currentPrefix + counter;
            anItem.prepend('<span class="multilevel-counter">' + newPrefix + '. ' + '</span>');
            //This commented block doesn't work in IE.
            //anItem.children('ol:not(.multilevel-skip)').each(function (index, childOl)
            //{
            //	multiOrderedList($(childOl), newPrefix);
            //});
            $.each(anItem.children('ol:not(.multilevel-skip)'), function (index, childOl) {
                multiOrderedList($(childOl), newPrefix);
            });
        });
    }


    $('.data-table-src.responsive:not(.js-ignore)').each(function () {
        var CurrentChain = $(this);
        var containsGroups = CurrentChain.hasClass('grouped');
        var toggleCellIndex = containsGroups? 1 : 0;
        CurrentChain.DataTable(
        {
            bFilter: false
            , bInfo: false
            , paging: false
            , ordering: false
            //, sDom: 't'
            //, fixedHeader: true
            //, fixedColumns: true
            //, scrollX: true
            //, scrollY: '300px'
            //, scrollCollapse: true
            //, sScrollXInner: '100%'
            , createdRow: function (row, data, index) {
                //$('td', row).attr('tabindex', 0);
                $('td:nth(' + toggleCellIndex + ')', row).toggleClass('responsive-details-toggle fa-plus').attr('tabindex', 0).keydown(function (e) {
                      if (e.which == 13 || e.which == 32) 
                      {//Enter key pressed
                          $(e.currentTarget).click();
                          return false;
                      }
                  });

                  //  $(row).children('.details-control').attr('tabindex', 0).keydown(function (e) {
                  //    if (e.which == 13 || e.which == 32) {//Enter key pressed
                  //        $(e.currentTarget).click();
                  //    }
                  //});
            }
            , responsive: {
                details: {
                    renderer: function (api, rowIdx, columns) {
                        var data = $.map(columns, function (col, i) {
                            return col.hidden && col.data ?
                                '<li data-dtr-index="' + col.columnIndex + '" data-dt-row="' + col.rowIndex + '" data-dt-column="' + col.columnIndex + '">' +
                                '<span class="dtr-title">' + col.title + (col.title ? ':' : '') + '</span> <span class="dtr-data">' + col.data + '</span>' +
                                '</li>' :
                                '';
                        }).join('');
                        return data ? $('<ul data-dtr-index="' + rowIdx + '"/>').append(data) : false;
                    }
                }
            }
            , drawCallback: function (settings) {
                if (containsGroups) {
                    var api = this.api(), rows = api.rows({ page: 'current' }).nodes(), last = null;
                    api.columns(0).visible(false);
                    api.column(0, { page: 'current' }).data().each(function (group, i) {
                        var $aRow = $(rows).eq(i);
                        if (last !== group) {
                            $aRow.before('<tr class="group-header"><td class="hidden-element"></td><td colspan="' + $aRow.children().length + '">' + group + '</td></tr>');
                            last = group;
                        }
                    });
                }
            }
        });


    });


    $('table.responsive .dtr-data').each(function () {
        var currentInstance = $(this);

        if (currentInstance.text() == '') {
            currentInstance.closest('li').hide();
        }
    });

    //  When user clicks on a collapsable tab, set aria attributes correctly.
    $('button.m-drawer').click(function (e) {
        var $this = $(this);
        var isExpanding = $this.attr('aria-expanded') == 'true' ? 'false' : 'true';
        var isHidden = $this.attr('aria-expanded') == 'true' ? 'true' : 'false';
        $this.attr('aria-expanded', isExpanding);
        var targetSelector = $this.data('togglertarget');
        if (targetSelector !== undefined) {
            $(targetSelector).attr({
                'aria-hidden': isHidden,
                'tabindex': -1
            }).css('outline', '0')
        }
    });

});

////Common JS
//function customDateTimeFormatter(dateVal, locale) {
//    // same as "Constants.DateTime_Long" >> "ddd, dd MMM yyyy HH:mm";   
//    // example:  Fri, 15 Mar 1977 18:15
//    var str = "";
//    str += " " + dateVal.toLocaleString(locale, { weekday: "short" }) + ",";
//    str += " " + dateVal.toLocaleString(locale, { day: "numeric" });
//    str += " " + dateVal.toLocaleString(locale, { month: "short" });
//    str += " " + dateVal.toLocaleString(locale, { year: "numeric" });
//    str += " " + dateVal.toLocaleString(locale, { hour: '2-digit', minute: '2-digit', hour12: false });
//    return str.trim();
//}
function customDateTimeFormatter(date, locale) {
    var newDate = new Date(date);
    var days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
    var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
    if (typeof (window.LocalizationResources) != undefined) {
        try {
            days[0] = window.LocalizationResources['day_sun'];
            days[1] = window.LocalizationResources['day_mon'];
            days[2] = window.LocalizationResources['day_tue'];
            days[3] = window.LocalizationResources['day_wed'];
            days[4] = window.LocalizationResources['day_thu'];
            days[5] = window.LocalizationResources['day_fri'];
            days[6] = window.LocalizationResources['day_sat'];
            months[0] = window.LocalizationResources['month_jan'];
            months[1] = window.LocalizationResources['month_feb'];
            months[2] = window.LocalizationResources['month_mar'];
            months[3] = window.LocalizationResources['month_apr'];
            months[4] = window.LocalizationResources['month_may'];
            months[5] = window.LocalizationResources['month_jun'];
            months[6] = window.LocalizationResources['month_jul'];
            months[7] = window.LocalizationResources['month_aug'];
            months[8] = window.LocalizationResources['month_sep'];
            months[9] = window.LocalizationResources['month_oct'];
            months[10] = window.LocalizationResources['month_nov'];
            months[11] = window.LocalizationResources['month_dec'];
        }
        catch (e) {
            
        }
    }
    var hours = newDate.getHours();
    var minutes = newDate.getMinutes();
    var ampm = hours >= 12 ? 'pm' : 'am';
    hours = hours % 12;
    hours = hours ? hours : 12;
    minutes = minutes < 10 ? '0' + minutes : minutes;   
    hours = hours < 10 ? '0' + hours : hours;
    return days[newDate.getDay()] + ', ' + newDate.getDate() + ' ' + months[newDate.getMonth()] + ' ' + newDate.getFullYear() + ' ' + hours + ':' + minutes + ' ' + ampm.toUpperCase();
}



// ____________________________________________________________________________________________________________________
// ___________________  K - P I V O T  ________________________________________________________________________________
// The K-Pivot behaves a lot like the m-pivot or the c-pivot. It looks the same. The difference is 
// that the selection of a tab will execute a click event. As a result, you can do some custom 
// tabpanel action, or use this as a type of filter like on the products page. There are two modes. 
// ArrowKey controlled (TabPanel), and Tab Controlled (Regular links).
//
// Controls (TabPanel):
//      Arrow-Left: Select tab left of current tab, or wrap around to the last tab.
//      Arrow-Right: Select tab right of current tab, or wrap around to beginning tab.
//      Tab: Focus on the selected tab if not already focused on it. 
//      Tab Again: Go INTO the tab panel. (Skip other tab options)
//  
// Controls (Regular):
//      Tab: Focus on first tab.
//      Tab Again: Focus on the next tab, or if already at last tab, go to whatever element is visible and after the tablist.
//      Space/Enter: Select a tab and activate its click event.
//
//  Example Code (Regular):
//      <div class="k-pivot">
//          <div class="k-pivot-tablist">
//              <a href="/Search/Index">Overview</a>
//              <a href="/Search/Teams" class="f-active">Teams</a>
//              <a onclick="someJSFunction()">Competitions</a>
//          </div>
//      </div>
//
//  
//  Example Code (TabPanel):
//      <div class="k-pivot js-ArrowKeys">
//          <div class="k-pivot-tablist">
//              <a href="/Search/Index">Overview</a>
//              <a href="/Search/Teams" class="f-active">Teams</a>
//              <a onclick="someJSFunction()">Competitions</a>
//          </div>
//      </div>
//                                  - or -
//
//      // If using tablist role, be sure to follow all accessibility requirements for that tab panel widget.
//      // Some additional JavaScript may be required to enable/disable aria states. 
//      <div class="k-pivot">
//          <div class="k-pivot-tablist" role="tablist">
//              <a role="tab" aria-controls="examplePivot1Target1">Overview</a>
//              <a role="tab" class="f-active"  aria-controls="examplePivot1Target2">Teams</a>
//              <a role="tab" onclick="someJSFunction()" aria-controls="examplePivot1Target3">Competitions</a>
//          </div>
//          <section id="examplePivot1Target1" role="tabpanel" aria-hidden="false">
//              <h3 class="c-heading-3">Section 1</h3>
//              <p class="c-paragraph-3">Lorem ipsum</p>
//          </section>
//          <section id="examplePivot1Target2" role="tabpanel" aria-hidden="true">
//              <h3 class="c-heading-3">Section 2</h3>
//              <p class="c-paragraph-3">Lorem ipsum</p>
//          </section>
//          <section id="examplePivot1Target3" role="tabpanel" aria-hidden="true">
//              <h3 class="c-heading-3">Section 3</h3>
//              <p class="c-paragraph-3">Lorem ipsum</p>
//          </section>
//      </div>
// 
$(document).on('keydown', '.k-pivot.js-ArrowKeys>.k-pivot-tablist>a,.k-pivot>.k-pivot-tablist[role="tablist"]>a', null,
    function (event) {
        var currentPivot = event.target;
        var delta = 0;
        var keyCode = event.keyCode;
        if ((keyCode === 13 /* Enter */) || (keyCode === 32 /* Space */)) {
            if (event.preventDefault) event.preventDefault();
        }
        else if ((keyCode === 37 /* ArrowLeft */)) {
            if (event.preventDefault) event.preventDefault();
            delta = -1;
        }
        else if ((keyCode === 39 /* ArrowRight */)) {
            if (event.preventDefault) event.preventDefault();
            delta = 1;
        }
        if (delta != 0) {
            if (currentPivot) {
                var children = $(currentPivot).parent().children('a');
                var targetPivot = null;
                for (var i = 0; i < children.length; i++) {
                    var child = children[i];
                    if (child === currentPivot) {
                        var targetIndex = i + delta;
                        if (targetIndex >= children.length) {
                            targetIndex = 0;
                        }
                        else if (targetIndex < 0) {
                            targetIndex = children.length - 1;
                        }
                        targetPivot = children[targetIndex];
                        break;
                    }
                }
                if (targetPivot != null) {
                    Accessibility.simulateClick(targetPivot);
                }
            }
        }
    }
);

// If behaving like a set of links (Tab + Space/Enter controlled)
$(document).on('keydown', '.k-pivot:not(.js-ArrowKeys)>.k-pivot-tablist>a,.k-pivot>.k-pivot-tablist:not([role="tablist"])>a', null,
    function (event) {
        var targetPivot = event.target;
        var keyCode = event.keyCode;
        if ((keyCode === 13 /* Enter */) || (keyCode === 32 /* Space */)) {
            if (event.preventDefault) event.preventDefault();
            if (targetPivot != null) {
                Accessibility.simulateClick(targetPivot);
            }
        }
    }
);

// Standard click handling
$(document).on('click', '.k-pivot>.k-pivot-tablist>a', null,
    function (event) {
        var currentPivot = event.target;
        if (currentPivot) {
            $(currentPivot).addClass('f-active').attr('aria-selected', 'true').focus();
            $(currentPivot).siblings('a').attr('aria-selected', 'false').removeClass('f-active');

            // We only force the tab behavior if we are behaving like a tab panel.
            if ($(currentPivot).closest('.k-pivot').hasClass('.js-ArrowKeys') || $(currentPivot).attr('role') == 'tab') {
                $(currentPivot).attr('tabindex', '0'); $(currentPivot).siblings('a').attr('tabindex', '-1');
            }
        }
    }
);

$(document).ready(function () {
    // We only want one tab at a time being focusable, if performing like a tabpanel.
    $('.k-pivot.js-ArrowKeys>.k-pivot-tablist,.k-pivot>.k-pivot-tablist[role="tablist"]').each(function (i, e) {
        if ($(e).children('a.f-active').length == 0) {
            $(e).children('a').attr('tabindex', '-1').removeClass('f-active');
            $(e).children('a:first()').attr('tabindex', '0').addClass('f-active');
        } else {
            $(e).children('a').attr('tabindex', '-1');
            $(e).children('a.f-active').attr('tabindex', '0');
        }
    });
});

// _______  E N D _ K - P I V O T  ___________________________________________________________________________________
// ____________________________________________________________________________________________________________________// ____________________________________________________________________________________________________________________

var matchHeightRatioTimeout;
$(document).ready(function (e) { doMatchHeightResizes(); });
$(window).resize(function (e) {
    if (!!matchHeightRatioTimeout) {
        clearTimeout(matchHeightRatioTimeout);
    }
    matchHeightRatioTimeout = setTimeout(doMatchHeightResizes(), 200);
});

function doMatchHeightResizes() {
    $('*[data-match-height-with]').each(function (i, e) {
        var targetSelector = $(e).data('match-height-with');
        var $et = $('#' + targetSelector);
        var height = $et.height();
        // Responsive elements only need to share same height if they are on the same horizontal level.
        if ($et.position().top == $(e).position().top) {
            $(e).css('min-height', height);
        } else {
            $(e).css('min-height', '');
        }
    });
}


var aspectRatioTimeout;
$(document).ready(function (e) { doAspectRatio(); });
$(window).resize(function (e) {
    if (!!aspectRatioTimeout) {
        clearTimeout(aspectRatioTimeout);
    }
    aspectRatioTimeout = setTimeout(doAspectRatio(), 200);
});

function doAspectRatio() {
    $('*[data-aspect-ratio]').each(function (i, e) {
        var ratio = $(e).attr('data-aspect-ratio');
        var parts = ratio.split(':');
        if (parts.length == 2) {
            var width = $(e).width();
            var height = width * parts[1] / parts[0];
            $(e).css('min-height', height);
            if ($(e).is("iframe")) {
                $(e).attr('height', height);
            }
        }
    });
}

/* MWF dropdown fix to apply selectRequired class to required form fields */
$(document).ready(function () {

    $(document).on('click', '.c-select button', function (e) {
        let divAriaLabel = $(e.target.parentElement).attr('data-default-aria-label');
        let labelId = $(e.target.parentElement.parentElement.parentElement).find('label').attr('id');
        let ulElement = $(e.target.nextElementSibling);

        if (labelId) {
            ulElement.attr('aria-labelledby', labelId);
        } else {
            ulElement.attr('aria-label', divAriaLabel);
        }
    });
        
    $(document).on('change', '.c-select select', function (e) {
        let nDisplay = $(e.target).find('[selected]').text();
        $(e.target).parent().find('button').attr('aria-label', nDisplay);
    });


    var MutationObserver = window.MutationObserver || window.WebKitMutationObserver;

    var observeFilter = { childList: true };
    var dropdownObserver = new MutationObserver(function (mutationRecords) {
        $.each(mutationRecords, function (index, mutationRecord) {
            if (mutationRecord.addedNodes.length > 0) {
                let nDisplay = $(mutationRecord.target).find('[selected]').text();

                // Prevent wacky behavior on "enter" on other inputs that are part of the same form.
                $(mutationRecord.target).find('button').first()
                    .attr('type', 'button')
                    .attr('aria-label', nDisplay);
                //$(mutationRecord.target).find('[data-default-aria-labelledby]').each(function (k, v) {
                //    $(v).find('button').attr('aria-labelledby', $(v).attr('data-default-aria-labelledby'));
                //});
            }
        });
    });

    $('.c-select').each(function () {
        dropdownObserver.observe(this, observeFilter);
        $(this).children('select').attr('tabindex', '-1');

        if ($(this).children('select').attr('required')) {
            $(this).children('select').on('change', function () {
                $(this).valid();
            });
            $(this).children('select').addClass('selectRequired');
        }
    });
});

/* add MWF select support to jquery Validate */
jQuery.validator.addMethod("selectRequired", function (val, element) {
    if (this.optional(element)) return true;
    var control = $(element).parent().children('.c-select-menu'); 
    var control_text = control.children('button').text();
    var val_text = $(element).children("option:selected").text();
    if (control_text.trim() != val_text.trim()) return false; // IF Control text does not match selected value, user has not changed it!
    return true;
}, function (val, element) {            
    return $(element).data('validationmessage');
});
jQuery.validator.addClassRules("selectRequired", {
    selectRequired: true
});


// Custom error message validator so if you wanted to add an error message anywhere, 
// you can do so with $(elem).addClass('customErrorMessage') $(element).attr('data-error-msg', 'Your error message')
jQuery.validator.addMethod("customErrorMessage", function (val, element) {
    var msg = $(element).attr('data-error-msg');
    if (msg != null && msg != "") {
        return false;
    }
    return true;
}, function (val, element) {
    return $(element).attr('data-error-msg');
});
jQuery.validator.addClassRules('customErrorMessage', {
    customErrorMessage: true
});


// string format polyfill
if (!String.prototype.format) {
    String.prototype.format = function() {
        var args = arguments;
        return this.replace(/{(\d+)}/g, function(match, number) { 
            return typeof args[number] != 'undefined'
                ? args[number]
                : match;
        });
    };
};

var dataJsHref = {
    target: null,
    origX: -1,
    origY: -1
};

$(document).on('mousedown', '*[data-js-href]', function (e) {
    dataJsHref.origX = e.clientX;
    dataJsHref.origY = e.clientY;
    dataJsHref.target = e.target;
    if (e.button == 1) {
        if ($(e.target).closest('[data-js-href]').length > 0) {
            if ($(e.target).is(':not(button,a)')) {
                e.preventDefault();
                return false;
            }
        }
    }
});

// Enable middle click + click behavior for items within the data-js-href box.
$(document).on('mouseup', '*[data-js-href]', function (e) {
    if ($(e.target).not('a,button')) {
        if (e.target === dataJsHref.target) {
            if ((Math.max(e.clientX, dataJsHref.origX) - Math.min(e.clientX, dataJsHref.origX)) < 3) {
                if ((Math.max(e.clientY, dataJsHref.origY) - Math.min(e.clientY, dataJsHref.origY)) < 3) {
                    var elem = $(e.target).closest('[data-js-href]');
                    if (!!elem) {
                        var isMiddleClick = e.button === 1 || e.ctrlKey === true;
                        var href = $(elem).attr('data-js-href');
                        if (isMiddleClick) {
                            window.open(href)
                            e.stopPropagation();
                            return false;
                        } else {
                            window.location = href;
                            e.stopPropagation();
                        }
                    }
                }
            }
        }
    }
});;
// Account profile picture control
$(function () {
    setMSAProfilePictureControls();
});
function setMSAProfilePictureControls() {
    var defaultProfilePicture = 'https://mem.gfx.ms/me/MeControl/9.18199.0/msa_enabled.png';
    $('.profile-picture-control img').attr('src', defaultProfilePicture);
    if ($('.profile-picture-control').length > 0) { // profile pic control on page
        if ($('.msame_Header').length > 0) { // user's profile pic also on page (uhf)
            if ($('.msame_Drop_AI_picframe img').length > 0) {
                var profilePic = $('.msame_Drop_AI_picframe img').attr('src');
                if (profilePic == null || profilePic == "") profilePic = defaultProfilePicture; // Default pic
                $('.profile-picture-control img').attr('src', profilePic);
            } else {
                setTimeout(setProfilePictureControls, 2000);
            }
        }
    }
};

// On resize
window.onResizeActions = [];
$(window).ready(resizeCallback);
$(window).resize(resizeCallback);
var resizeTimeoutId = null;
function resizeCallback() {
    if (resizeTimeoutId)
        window.clearTimeout(resizeTimeoutId);
    resizeTimeoutId = window.setTimeout(window.doResizeActions, 5);
}
window.doResizeActions = function () {
    for (var rai = 0; rai < window.onResizeActions.length; rai++) {
        window.onResizeActions[rai]();
    }
};
window.onResize = function (func) {
    window.onResizeActions.push(func);
}

// Fixed navbar
$(window).ready(function () {
    var navContainer = $('#divMainContent');
    var nav = $(navContainer).find('.fixed-bar');

    if (nav.length == 0) return;

    // When the fixed starts
    var fixedNavStartOffset = 0;
    var fixedNavStartPos;

    // When the fixed stops
    var fixedNavEnd = $('.social-footer');
    var fixedNavEndOffset = 0;
    var fixedNavEndPos;

    // Measurements for position calcs
    var navHeight;
    var navPos;
    var fixedNavEndPos;
    recalculatePositions();

    window.onResize(function () {
        var navContainer = $('#divMainContent');
        var nav = $(navContainer).find('.fixed-bar');
        if (nav.length == 0) return;
        if ($(nav).css('position') == 'fixed') {
            $(window).scroll();
        }
    });

    function recalculatePositions() {
        // Start position
        fixedNavStartPos = $(navContainer).offset().top + fixedNavStartOffset;

        // End position
        fixedNavEndPos = $(fixedNavEnd).offset().top + fixedNavEndOffset;

        // Fixed nav position based on parent block elements
        navPos = $(navContainer).offset();
        navPos.left = navPos.left + parseInt($(navContainer).css('paddingLeft'), 0);

        // Nav height for end zone calc
        navheight = $(nav).outerHeight();
    }

    $(window).on('scroll', function () {
        recalculatePositions();

        if (window.innerWidth <= 768 || $(nav).hasClass('disabled')) {
            $(nav).removeClass('f-sticky');
            $(navContainer).css('padding-bottom', 0);
            $(navContainer).css('padding-top', 0);
        } else {
            if (window.innerWidth <= 768) {
                $(nav).removeClass('f-sticky');
                $(navContainer).css('padding-bottom', 0);
                $(navContainer).css('padding-top', 0);
            }
            else {
                if ($(window).scrollTop() + navheight > fixedNavEndPos) { // Nav is stuck to bottom of page
                    $(nav).removeClass('f-sticky');
                    $(nav).css('position', 'absolute');
                    $(nav).css('bottom', '0');
                    $(nav).css('left', '0');
                    $(nav).css('right', '0');
                    $(navContainer).css('padding-bottom', navheight + 'px');
                }
                else if ($(window).scrollTop() > fixedNavStartPos) { // Nav is fixed to scroll
                    $(nav).addClass('f-sticky');
                    $(nav).css('left', navPos.left);
                    $(nav).css('position', '');
                    $(nav).css('bottom', '');
                    $(navContainer).css('padding-top', navheight + 'px');
                }
                else { // Nav is in default position
                    $(nav).removeClass('f-sticky');
                    $(nav).css('left', '');
                    $(nav).css('position', '');
                    $(nav).css('bottom', '');
                    $(navContainer).css('padding-top', '0');
                }
            }
        }

    });
});


// Textarea character counter
$(function () {
    var loc_CharactersRemaining = (typeof (window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['CharactersRemaining']) !== "undefined") ? window.LocalizationResources['CharactersRemaining'] : 'characters remaining.';

    $('textarea[data-val-length-max]').each(function (k, v) {
        var maxlength = $(this).attr('data-val-length-max');
        var name = $(v).attr('name');

        $(v).attr('aria-describedby', name + '-char-counter');
        $(v).attr('maxlength', $(v).attr('data-val-length-max'));

        var counterDiv = $('<span/>', {
            'id': name + '-char-counter',
            'class': 'char-counter c-caption-2',
            'aria-live': 'polite'
        }).append($('<span/>', {
            'id': name + '-char-count',
            'text': maxlength
        }), ' ' + loc_CharactersRemaining);

        $(v).parent('.c-textarea').append(counterDiv);
        $(v).on('change keyup paste', function (e) {
            var charsRemaining = $(e.target.parentElement).find('span > span');
            var maxlength = $(this).attr('data-val-length-max');
            if (maxlength != null) {
                var count = maxlength - $(this).val().length;
                charsRemaining.text(count);
            }
        });
        $(v).change();
    });
});

// c-text-field data-prepend script
$(function () {
    $('input.c-text-field[data-prepend]').each(function () {
        $(this).on('focus', function () {
            $(this).get(0).setSelectionRange($(this).val().length, $(this).val().length);
        });
        $(this).on('keyup paste', function () {
            if ($(this).val().length > $(this).data('prepend').length) {
                if (!$(this).val().startsWith($(this).data('prepend'))) {
                    var currText = $(this).val().replace($(this).data('prepend'), "");
                    $(this).val($(this).data('prepend') + currText);
                }
            } else {
                $(this).val($(this).data('prepend'));
            }
        });
        $(this).trigger('paste');
    });
});

// "Read more" control
$(function () {
    window.ReadMoreControl = function () {
        var loc_readmore = (typeof (window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['ReadMore']) !== "undefined") ? window.LocalizationResources['ReadMore'] : 'Read more';
        var loc_readless = (typeof (window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['ReadLess']) !== "undefined") ? window.LocalizationResources['ReadLess'] : 'Read less';

        $('[data-readmore]').each(function (k, v) {
            var content = $(this).text();
            var maxLength = $(this).attr('data-readmore');
            var contentLength = content.length;
            if (contentLength > maxLength) {
                var aboveFold = content.substr(0, maxLength);
                var belowFold = content.substr(maxLength, contentLength);
                $(this).text(aboveFold).append('<span class="read-more-ellipsis">…</span><br class="read-more-break"/>');

                var hiddenContent = $('<span>').text(belowFold).hide();
                var readMoreLink = $('<a href="#" class="x-type-right c-hyperlink c-caption-1 readMoreLink" role="button" style="display:block;"></a>').text(loc_readmore);
                $(readMoreLink).click(function (e) {
                    e.preventDefault();
                    if ($(this).prev('span').is(':visible')) {
                        $(this).parent().find('.read-more-ellipsis').show();
                        $(this).parent().find('.read-more-break').show();
                        $(this).prev('span').hide();
                        $(this).text(loc_readmore);
                        if ($(this).parents('.block-item').length > 0) {
                            $(this).parents('.block-item').css('height', '');
                        }
                    } else {
                        $(this).parent().find('.read-more-ellipsis').hide();
                        $(this).parent().find('.read-more-break').hide();
                        $(this).prev('span').show();
                        $(this).text(loc_readless);
                        if ($(this).parents('.block-item').length > 0) {
                            var prevHeight = $(this).parents('.block-item').innerHeight;
                            $(this).parents('.block-item').css('height', 'auto');
                            $(this).parents('.block-item').attr('data-prevheight', prevHeight);
                        }
                    }
                });
                $(this).append(hiddenContent);
                $(this).append(readMoreLink);
            }
        });
    }
    window.ReadMoreControl();
});

//wrapBox.on('mousewheel DOMMouseScroll', function (e) {
//    console.log('I scrolled');
//})

// image upload control
// Use with the ImageUploadControl partial
$(function () {
    // crop variables
    let result = document.querySelector('.result');
    let img_result = document.querySelector('.img-result');
    let saveCrop = document.querySelector('.saveCrop');
    let cropped = document.querySelector('.cropped');
    let cancelCrop = document.querySelector('.cancelCrop');
    let cropper = '';
    let cropBtn = document.querySelector('#confirmCrop');
    
    if ($('#confirmCrop').length) {
        
        // when crop button is clicked
        cropBtn.addEventListener('click', function (e) {
            //let cropperCanvas = document.querySelector('.cropper-canvas');
            //console.log(cropperCanvas);
            let img_og = $(this).siblings('section.image-upload-control').find('.OgImg');
            // if cropped image preview exists
            if (cropBtn.dataset.uploadReady == 'true') {

                // begin upload process
                let imgBlob = dataURItoBlob(cropped.src);
                var form = $(this).parent();
                ImageUpload_progressStart(form);
                var useAjax = $('.image-upload-control input[name="ajax"]').val();
                if (useAjax != 'true') {
                    document.getElementsByName("cropFile").value = "";
                    document.getElementsByName("cropFile")[0].setAttribute("value", cropped.src);
                    ImageUpload_progressEnd(form);
                } else {
                    // Generate payload
                    var formData = new FormData();
                    formData.append("type", $(this).siblings("section.image-upload-control").find("input[name='type']").val());
                    formData.append("uniqueId", $(this).siblings("section.image-upload-control").find("input[name='uniqueId']").val());
                    formData.append("index", "0");
                    formData.append("fileUpload", imgBlob, $(this).parent().children('[type="file"]').val());
                    formData.append("__RequestVerificationToken", $('#__AjaxAntiForgeryForm input[name=__RequestVerificationToken]').val());
                    var ident = $('.image-upload-control input[name="type"]').val() + '_' + $('.image-upload-control input[name="uniqueId"]').val() + '_' + '0';
                  
                    // Call image upload endpoint
                    $.ajax({
                        url: '/Image/Upload',
                        data: formData,
                        type: 'POST',
                        processData: false,
                        contentType: false,
                        cache: false,
                        async: true,
                        success: function (e) {
                            if (e.success == null || e.success != true) {
                                alert('Error uploading image. Please contact support.');
                                $('#image_upload_result_' + ident).text('Unknown error uploading image. Please contact support.');

                                $(form).children('.progress-overlay').hide();
                                $(form).children('a').show();
                            } else if (e.success == false) {
                                alert(e.error);
                                $('#image_upload_result_' + ident).text(e.error);

                                $(form).children('.progress-overlay').hide();
                                $(form).children('a').show();
                            } else {
                                var newUrl = e.url; // Refresh the image with new URL, try to break cache.
                                $(form).children('img').attr('src', '');
                                if (e.url.indexOf('?') != -1) {
                                    newUrl += '&timestamp=' + Math.random();
                                }
                                else {
                                    newUrl += '?timestamp=' + Math.random();
                                }

                                $(form).children('img').attr('src', newUrl);

                                $(form).children('[name="length"]').val(e.length);

                                ImageUpload_progressEnd(form);

                                // This is for the gallery file upload. The "new" upload needs to be copied for the new index.
                                if ($(form).hasClass('new-file-upload')) {
                                    makeNewUploadForm(form);
                                }
                            }
                        },
                        error: function (e) {
                            console.log(e);
                            ImageUpload_progressEnd(form);
                            alert('Unknown error uploading image. Please contact support.');
                            $('#image_upload_result_' + ident).text('Unknown error uploading image. Please contact support.');
                        }
                    });
                }

                // replace original image with the cropped result
                img_og.attr('src', cropped.src);
                $(this).parent().find("section.image-upload-control").show();
                $(this).parent().find("section#cropUpload").hide();
                $(this).text(window.LocalizationResources['Team_Manage_CroptPhoto']);
                cropBtn.dataset.uploadReady = 'false';
            } else {
                $(this).parent().find("section.image-upload-control").hide();
                $(this).parent().find("section#cropUpload").show();
                // checks if image element is empty, if not, then init cropper with the image src.
                if (img_og.attr('src') != "") {

                    if (cropped.src) {
                        $(".cropped").attr("src", "");
                    }
                    // create new image
                    let img = document.createElement('img');
                    img.id = 'image';
                    img.src = img_og.attr('src');
                    // clean result before
                    result.innerHTML = '';
                    // append new image
                    result.appendChild(img);
                    // show save btn and options
                    saveCrop.classList.remove('hide');
                    // init cropper
                    // new requirements for images cropping and uploads
                    cropper = new Cropper(img, {
                        zoomable: false,
                        aspectRatio: 16 / 9, minWidth: 800, minHeight: 450, viewMode: 1, cropmove: function (event) {
                            var data = cropper.getData();
                            if (data.width < 200) {
                                if (typeof (event) !== 'undefined') {
                                    event.preventDefault();
                                    data.width = 200;
                                    cropper.setData(data);
                                }
                            }
                            if (data.height < 200) {
                                if (typeof (event) !== 'undefined') {
                                    event.preventDefault();
                                    data.height = 200;
                                    cropper.setData(data);
                                }
                            }
                        }
                    });

                    cropper.options.cropmove();

                    // hide upload btn
                    $(this).hide();
                }
                $(this).text(window.LocalizationResources['Team_Manage_SaveCrop']);
                cropBtn.dataset.uploadReady = 'true';
                if ($('.saveCrop').html() != window.LocalizationResources['Content_Preview_for']) {
                    $('.saveCrop').html(window.LocalizationResources['Content_Preview_for']);
                }
            }
        });

        cropBtn.addEventListener("keyup", function (event) {
            event.preventDefault();
            if (event.keyCode === 13) {
                document.getElementById("confirmCrop").click();
            }
        });

        // click "cancel" button
        if ($('.cancelCrop').length) {
            cancelCrop.addEventListener('click', function (e) {
                if (cropBtn.dataset.uploadReady == 'true') {
                    e.preventDefault();
                    // delete variables
                    $(".cropped").attr("src", "");
                    $(".result").empty();
                    $(this).parent().parent().hide();
                    $(this).parent().parent().siblings('section.image-upload-control').show();
                    $(this).parent().parent().parent().find('#confirmCrop').show();
                    $('#confirmCrop').text(window.LocalizationResources['Team_Manage_CroptPhoto']);
                    cropBtn.dataset.uploadReady = 'false';
                }
            });
        }

        // save on click
        if ($('.saveCrop').length) {
            saveCrop.addEventListener('click', function (e) {
                e.preventDefault();
                // get result to data uri

                var imgType = $(this).parent().parent().parent().find('input[type="file"]').attr('data-filetype');
                let imgSrc = cropper.getCroppedCanvas({
                    //updated photo requirements 4/2020
                    aspectRatio: 16 / 9,
                    minWidth: 800,
                    minHeight: 450,
                }).toDataURL(imgType);

                // remove hide class of img
                cropped.classList.remove('hide');
                img_result.classList.remove('hide');
                // show image cropped
                cropped.src = imgSrc;
                cancelCrop.classList.remove('hide');
                $(this).parent().parent().siblings('a#confirmCrop').show();
            });
        }
    }


    var progressAriaStart = "Your image has been uploaded.";
    if (typeof (window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['ImageUpload_ProgressStart']) !== 'undefined' && window.LocalizationResources['ImageUpload_ProgressStart'].length > 0) {
        progressAriaStart = window.LocalizationResources['ImageUpload_ProgressStart'];
    }
    var progressAriaEnd = "Your image is being uploaded.";
    if (typeof (window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['ImageUpload_ProgressEnd']) !== 'undefined' && window.LocalizationResources['ImageUpload_ProgressEnd'].length > 0) {
        progressAriaEnd = window.LocalizationResources['ImageUpload_ProgressEnd'];
    }

    // Hide/show progress functions
    function ImageUpload_progressStart(form) {
        
        $(form).children('.progress-overlay').children('.c-progress').attr('aria-label', progressAriaStart);
        $(form).children('.progress-overlay').show();
        $(form).children('a').hide();
        setTimeout(function () {
            ImageUpload_progressEnd(form);
        }, 30000);
        $(form).children('.progress-overlay').find('.c-progress').focus();
    }

    // dataURI to blob
    function dataURItoBlob(dataURI) {
        // convert base64 to raw binary data held in a string
        // doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
        var byteString = atob(dataURI.split(',')[1]);

        // separate out the mime component
        var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]

        // write the bytes of the string to an ArrayBuffer
        var ab = new ArrayBuffer(byteString.length);

        // create a view into the buffer
        var ia = new Uint8Array(ab);

        // set the bytes of the buffer to the correct values
        for (var i = 0; i < byteString.length; i++) {
            ia[i] = byteString.charCodeAt(i);
        }

        // write the ArrayBuffer to a blob, and you're done
        var blob = new Blob([ab], { type: mimeString });
        return blob;
    }

    function ImageUpload_progressEnd(form) {
        $(form).children('.progress-overlay').children('.c-progress').attr('aria-label', progressAriaEnd);
        $(form).children('.progress-overlay').hide();
        $(form).children('a').show();
        if (document.activeElement == null || document.activeElement.tagName == "BODY") {
            $(form).children('a').focus();
        }
    }

    // While the image is loading, show the progress. Once loaded, hide.
    function ImageUpload_bindLoadComplete() {
        $('.image-upload-control img').each(function (k, v) { // Hide progress, show actions when image has loaded (or failed to load)
            $(this).get(0).onload = function () {
                //ImageUpload_progressEnd($(this).parent());
            };

            $(this).get(0).onerror = function () {
                //ImageUpload_progressEnd($(this).parent());
            };
        });
    }

    // anchor click event for the actions
    function ImageUpload_bindActionClick() {
        $('.image-upload-control a').off('click');
        $('.image-upload-control a').on('click', function (e) {
            e.preventDefault();
            var ident = $(this).parent().children('[name="type"]').val() + '_' + $(this).parent().children('[name="uniqueId"]').val() + '_' + $(this).parent().children('[name="index"]').val();
            var length = $(this).parent().children('[name="length"]').val();
            var replaceable = $(this).parent().children('[name="replaceable"]').val();
            var useAjax = $(this).parent().children('[name="ajax"]').val();

            if (useAjax == "false") {
                // If ajax is set to false we're just holding the image to be uploaded on POST
                if (parseInt(length) > 0 && replaceable == "false") {
                    // Remove image that is set
                    $('#image_upload_' + ident).parent().remove();
                }
                else {
                    $(this).parent().children('input[type="file"]').trigger('click');
                }
            }
            else {
                // If ajax is true or unset we use the image data to upload to the image server
                if (parseInt(length) > 0 && replaceable == "false") {
                    // Begin delete process
                    $(this).parent().children('.progress-overlay').show();
                    $(this).parent().children('.progress-overlay').find('.c-progress').focus();
                    var formData = new FormData();
                    formData.append("type", $(this).parent().children('[name="type"]').val());
                    formData.append("uniqueId", $(this).parent().children('[name="uniqueId"]').val());
                    formData.append("index", $(this).parent().children('[name="index"]').val());
                    formData.append("__RequestVerificationToken", $('#__AjaxAntiForgeryForm input[name=__RequestVerificationToken]').val());

                    $.ajax({
                        url: '/Image/DeleteImage',
                        data: AntiForgeryHelper.Wrap(formData),
                        type: 'POST',
                        processData: false,
                        contentType: false,
                        cache: false,
                        async: true,
                        success: function (e) {
                            if (typeof (e) !== undefined && e.success == true) {
                                $('#image_upload_' + ident).parent().remove();
                            } else {
                                alert(e.error);
                                $('#image_upload_result_' + ident).html(e.error);
                            }
                            ImageUpload_progressEnd($(this).parent());
                        },
                        error: function (e) {
                            ImageUpload_progressEnd($(this).parent());
                        }
                    });
                }
                else {
                    // Image is not uploaded or can be replaced, let user chose new file.
                    $(this).parent().children('input[type="file"]').trigger('click');
                }
            }
        });
    }

    // When file input is changed, begin upload process.
    function ImageUpload_bindInputChange() {

        $('.image-upload-control input[type="file"]').off('change');
        $('.image-upload-control input[type="file"]').on('change', function () {
            var form = $(this).parent();
            var ident = $(this).parent().children('[name="type"]').val() + '_' + $(this).parent().children('[name="uniqueId"]').val() + '_' + $(this).parent().children('[name="index"]').val();
            var inputType = $(this).parent().children('[name="type"]').val();
            // A file is provided to process
            if (this.files.length > 0) {
                ImageUpload_progressStart(form);
                var useAjax = $(this).parent().children('[name="ajax"]').val();
                $(form).children('input[type="file"]').attr('data-filetype', this.files[0].type);


               
                var isValidDimensions = true;
                var reader = new FileReader();
                reader.readAsDataURL(this.files[0]);
                reader.onload = function (e) {

                    var image = new Image();
                    image.src = e.target.result;
                    image.onload = function () {
                        var height = this.height;
                        var width = this.width;

                        if (inputType === 'TeamProfile') {

                            if (height > 10000 || width > 10000 || width < 800 || height < 450) {
                                isValidDimensions = false;
                            }


                            if (!isValidDimensions) {
                                ImageUpload_progressEnd(form);
                                $('#image_upload_result_' + ident).text(window.LocalizationResources["Team_Manage_Upload_Fail"]);
                                return;
                            }
                        }



                        if (useAjax == "false") {
                            var reader = new FileReader();
                            reader.onload = function (e) {
                                if ($(form).hasClass('new-file-upload')) {
                                    makeNewUploadForm(form);
                                }
                                $(form).children('img').attr('src', e.target.result);
                                ImageUpload_progressEnd(form);
                                $(form).children('a').text('Click to change photo');
                                $(form).children('[name="length"]').val($(form).children('[type="file"]').get(0).files[0].size);
                            };
                            reader.readAsDataURL(this.files[0]);
                            ImageUpload_progressEnd(form);
                            $('#confirmCrop').show();
                        }
                        else {
                            // Generate payload
                            var formData = new FormData();
                            formData.append("type", $(form).children('[name="type"]').val());
                            formData.append("uniqueId", $(form).children('[name="uniqueId"]').val());
                            formData.append("index", $(form).children('[name="index"]').val());
                            formData.append("fileUpload", $(form).children('[type="file"]').get(0).files[0], $(form).children('[type="file"]').val());
                            formData.append("__RequestVerificationToken", $('#__AjaxAntiForgeryForm input[name=__RequestVerificationToken]').val());
                            ident = $(form).children('[name="type"]').val() + '_' + $(form).children('[name="uniqueId"]').val() + '_' + $().children('[name="index"]').val();

                            // Call image upload endpoint
                            $.ajax({
                                url: '/Image/Upload',
                                data: formData,
                                type: 'POST',
                                processData: false,
                                contentType: false,
                                cache: false,
                                async: true,
                                success: function (e) {
                                    if (e.success == null || e.success != true) {
                                        alert('Error uploading image. Please contact support.');
                                        $('#image_upload_result_' + ident).text('Unknown error uploading image. Please contact support.');

                                        $(form).children('.progress-overlay').hide();
                                        $(form).children('a').show();
                                    } else if (e.success == false) {
                                        alert(e.error);
                                        $('#image_upload_result_' + ident).text(e.error);

                                        $(form).children('.progress-overlay').hide();
                                        $(form).children('a').show();
                                    } else {
                                        var newUrl = e.url; // Refresh the image with new URL, try to break cache.
                                        $(form).children('img').attr('src', '');
                                        if (e.url.indexOf('?') != -1) {
                                            newUrl += '&timestamp=' + Math.random();
                                        }
                                        else {
                                            newUrl += '?timestamp=' + Math.random();
                                        }

                                        $(form).children('img').attr('src', newUrl);

                                        $(form).children('[name="length"]').val(e.length);

                                        ImageUpload_progressEnd(form);

                                        // This is for the gallery file upload. The "new" upload needs to be copied for the new index.
                                        if ($(form).hasClass('new-file-upload')) {
                                            makeNewUploadForm(form);
                                        }

                                        $(form).parent().find('#confirmCrop').show();
                                    }

                                },
                                error: function (e) {
                                    console.log(e);
                                    ImageUpload_progressEnd(form);
                                    alert('Unknown error uploading image. Please contact support.');
                                    $('#image_upload_result_' + ident).text('Unknown error uploading image. Please contact support.');
                                }
                            });
                        }
                    }
                }
            }

        });
    }

    function makeNewUploadForm(form) {
        var gallery = $(form).parent();
        var newForm = $(form).clone(false, false);
        var oldId = $(newForm).children('input[type="file"]').attr('id');
        var pieces = oldId.split('_');
        var newIndex = parseInt(pieces.pop()) + 1;
        var newVal = pieces.join('_') + "_" + newIndex;
        $(form).removeClass('new-file-upload');
        $(form).children('a').removeClass('glyph-add');
        $(form).children('a').addClass('glyph-remove');
        $(form).children('a').text('Click to remove photo');
        $(newForm).children('input[type="file"]').attr('id', newVal);
        $(newForm).children('input[type="file"]').val('');
        $(newForm).children('input[name="index"]').val(newIndex);
        $(newForm).children('input[name="length"]').val('0');
        $(newForm).children('img').attr('src', '/Image/' + pieces[2] + '/' + pieces[3] + '?index=' + newIndex);
        $(gallery).append(newForm);

        ImageUpload_bindLoadComplete();
        ImageUpload_bindInputChange();
        ImageUpload_bindActionClick();
    }

    ImageUpload_bindLoadComplete();
    ImageUpload_bindInputChange();
    ImageUpload_bindActionClick();

});

// image view control
$(function () {
    $('.image-view-gallery .image-upload-control').slice(4).hide();
    $('.image-view-gallery-see-more').click(function (e) {
        e.stopImmediatePropagation();
        $(this).parent().children('.image-upload-control').show();
        $(this).hide();
        return false;
    });
    $('.image-view-gallery .image-upload-control').click(function () {
        $(this).toggleClass('lightbox');
    });
});

// Register/GetStarted buttons
function Subscription_RegisteredOrNot(SubID) {
    // returns true or false
    var hiddenVal = $("#" + SubID).val();
    var openComps = $("#comp_" + SubID).val();

    if (typeof (openComps) == "undefined") openComps = "false";
    if (typeof (hiddenVal) == "undefined") hiddenVal = "false";

    if (hiddenVal != undefined) {
        hiddenVal = hiddenVal.toString().toLowerCase();
        openComps = openComps.toString().toLowerCase();

        $('div[id^="' + SubID + '_"]').hide();

        var showSubID = SubID + "_" + hiddenVal;

        // redirect "get started" to FAQ page if the user is signed in and registered, but with no active competition
        if (hiddenVal == "true" && openComps == "false") {
            try {
                $("#" + showSubID + " a").attr("href", "/account/manage");
            } catch (e) { }
        }

        if ($("#" + showSubID).length > 0) {
            $("#" + showSubID).show();
        }
        else {
            $('div[id^="' + SubID + '_"]').first().show();
        }
    }
}


// format polyfill
String.prototype.format = String.prototype.format = function () {
    var s = this,
        i = arguments.length;

    while (i--) {
        s = s.replace(new RegExp('\\{' + i + '\\}', 'gm'), arguments[i]);
    }
    return s;
};

// startsWith polyfill
if (!String.prototype.startsWith) {
    String.prototype.startsWith = function (searchString, position) {
        position = position || 0;
        return this.substr(position, searchString.length) === searchString;
    };
}


// endsWith polyfill
if (!String.prototype.endsWith) {
    String.prototype.endsWith = function (search, this_len) {
        if (this_len === undefined || this_len > this.length) {
            this_len = this.length;
        }
        return this.substring(this_len - search.length, this_len) === search;
    };
}

// includes polyfill
if (!Array.prototype.includes) {
    Object.defineProperty(Array.prototype, 'includes', {
        value: function (searchElement, fromIndex) {
            if (this == null) {
                throw new TypeError('"this" is null or not defined');
            }
            // 1. Let O be ? ToObject(this value).
            var o = Object(this);
            // 2. Let len be ? ToLength(? Get(O, "length")).
            var len = o.length >>> 0;
            // 3. If len is 0, return false.
            if (len === 0) {
                return false;
            }
            // 4. Let n be ? ToInteger(fromIndex).
            //    (If fromIndex is undefined, this step produces the value 0.)
            var n = fromIndex | 0;
            // 5. If n ≥ 0, then
            //  a. Let k be n.
            // 6. Else n < 0,
            //  a. Let k be len + n.
            //  b. If k < 0, let k be 0.
            var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
            function sameValueZero(x, y) {
                return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));
            }
            // 7. Repeat, while k < len
            while (k < len) {
                // a. Let elementK be the result of ? Get(O, ! ToString(k)).
                // b. If SameValueZero(searchElement, elementK) is true, return true.
                if (sameValueZero(o[k], searchElement)) {
                    return true;
                }
                // c. Increase k by 1. 
                k++;
            }
            // 8. Return false
            return false;
        }
    });
}

// nodelist foreach polyfill
if (window.NodeList && !NodeList.prototype.forEach) {
    NodeList.prototype.forEach = function (callback, thisArg) {
        thisArg = thisArg || window;
        for (var i = 0; i < this.length; i++) {
            callback.call(thisArg, this[i], i, this);
        }
    };
}

// jquery case insensitive contains
jQuery.expr[':'].ContainsCaseIns = function (a, i, m) {
    return jQuery(a).text().toUpperCase()
        .indexOf(m[3].toUpperCase()) >= 0;
};


// random func
function getRandomInt(min, max) {
    return Math.floor(Math.random() * (max - min)) + min;
}



// drag-n-drop file upload
if ($('body').children('.overlay-disabled').length == 0) {
    $('body').append('<div class="overlay-disabled" style="display:none;"></div>');
}

var dragging = 0;
$('body').on('drag dragstart dragend dragover dragenter dragleave drop', function (e) {
    e.preventDefault();
    e.stopPropagation();
    return false;
})
    .on('dragenter', function (e) {
        dragging++;
        if ($('.icWebFileUpload:visible').length === 1) {
            $('.icWebFileUpload').addClass('overlay-highlight');
            $('.overlay-disabled').show();
        }

        e.preventDefault();
        e.stopPropagation();
        return false;
    })
    .on('dragleave', function (e) {
        dragging--;
        if (dragging == 0) {
            window.setTimeout(() => {
                if ($('.icWebFileUpload:visible').length === 1) {
                    $('.icWebFileUpload').removeClass('overlay-highlight');
                    $('.overlay-disabled').hide();
                }
            }, 50);
        }

        e.preventDefault();
        e.stopPropagation();
        return false;
    })
    .on('drop', function () {
        dragging = 0;
        if ($('.icWebFileUpload:visible').length === 1) {
            $('.icWebFileUpload').removeClass('overlay-highlight');
            $('.overlay-disabled').hide();
        }
    });

var fileUploadDrag = 0;
$('.icWebFileUpload').on('dragenter', function () {
    fileUploadDrag++;
    $(this).addClass('file-dragover');
    console.log('dragenter ' + fileUploadDrag);
});

$('.icWebFileUpload').on('dragleave', function () {
    fileUploadDrag--;
    if (fileUploadDrag == 0) {
        $(this).removeClass('file-dragover');
    }
    console.log('dragleave ' + fileUploadDrag);

});

$('.icWebFileUpload').on('drop', function (e) {
    $(this).removeClass('file-dragover');
    var droppedFile = false;
    if (typeof e != 'undefined' && e.originalEvent != null && e.originalEvent.dataTransfer != null && e.originalEvent.dataTransfer.files.length > 0) {
        droppedFile = e.originalEvent.dataTransfer.files[0];
    }

    if (droppedFile) {
        var index = $(this).find('input[type="file"]').attr('data-index');
        var options = $(this).find('input[type="file"]').attr('accept');
        var maxSize = $(this).find('input[type="file"]').attr('data-maxSize');
        var compId = $(this).find('input[type="file"]').attr('data-compId');
        var teamId = $(this).find('input[type="file"]').attr('data-teamId') || 0;
        var userProfileId = $(this).find('input[type="file"]').attr('data-userProfileId') || 0;
        var userCompId = $(this).find('input[type="file"]').attr('data-userCompId') || 0;
        var subAttrId = $(this).find('input[type="file"]').attr('data-subAttrId');
        var altName = $(this).find('input[type="file"]').attr('data-altName');

        var studentLabel = null;
        var num = parseInt(teamId, 10);
        if (isNaN(num)) { // If teamID isn't a number, set to -1, and use studentLabel
            studentLabel = teamId;
            teamId = -1;
        }

        if (ClientValidateAjaxFile(droppedFile, 'fileUpload_' + index, options, maxSize, 'divStatusMessage_' + index)) {
            StartAjaxFileBatchUpload(droppedFile,
                'fileUpload_' + index,
                'uploaded_file_name_' + index,
                'fileHolder_' + index,
                4194304,
                3,
                'file_progress_' + index,
                'divStatusMessage_' + index,
                'hidSavedFilePath_' + index,
                'btnUpload_' + index,
                'btnCancel_' + index,
                compId,
                teamId,
                userProfileId,
                userCompId,
                studentLabel,
                subAttrId,
                index,
                altName,
                validFileUpload
            );
        }
    }
});

$('.icWebFileUpload button[name="btnSelect"]').click(function () {
    $(this).parent().children('input[type="file"]').click();
});

$('.icWebFileUpload input[type="file"]').change(function () {
    if ($(this)[0].files.length > 0) {
        var file = $(this)[0].files[0];
        var index = $(this).attr('data-index');
        var options = $(this).attr('accept');
        var maxSize = $(this).attr('data-maxSize');
        var compId = $(this).attr('data-compId');
        var teamId = $(this).attr('data-teamId');
        var userCompId = $(this).attr('data-userCompId');
        var userProfileId = $(this).attr('data-userProfileId');
        var subAttrId = $(this).attr('data-subAttrId');
        var altName = $(this).attr('data-altName');

        if (userProfileId == "") userProfileId = 0;
        if (teamId == "") teamId = 0;

        var studentLabel = null;
        var num = parseInt(teamId, 10);
        if (isNaN(num)) { // If teamID isn't a number, set to -1, and use studentLabel
            studentLabel = teamId;
            teamId = -1;
        }

        if (ClientValidateAjaxFile(file, 'fileUpload_' + index, options, maxSize, 'divStatusMessage_' + index)) {
            StartAjaxFileBatchUpload(file,
                'fileUpload_' + index,
                'uploaded_file_name_' + index,
                'fileHolder_' + index,
                4194304,
                3,
                'file_progress_' + index,
                'divStatusMessage_' + index,
                'hidSavedFilePath_' + index,
                'btnUpload_' + index,
                'btnCancel_' + index,
                compId,
                teamId,
                userProfileId,
                userCompId,
                studentLabel,
                subAttrId,
                index,
                altName,
                validFileUpload
            );
        }
    }
});

$('.icWebFileUpload .file_replace').click(function (e) {
    e.preventDefault();
    $(this).parents('.icWebFileUpload').find('input[type="file"]').click();
});

$('.icWebFileUpload .file_delete').click(function (e) {
    e.preventDefault();

    var fileInput = $(this).parents('.icWebFileUpload').find('input[type="file"]');
    var index = $(fileInput).attr('data-index');

    if (!confirm("Are you sure you want to delete this file?")) {
        return;
    }

    // Reset to default state
    $(fileInput).attr('data-uploaded', 'false');
    $('#uploaded_file_name_' + index).val('');
    $('#hidSavedFilePath_' + index).val('');
    $('#divStatusMessage_' + index).text('');
    $('#model_attribute_index_' + index).find('.file').hide();
    $('#model_attribute_index_' + index).find('.select').show();
    $('[name="[' + index + '].FileIsUploaded"]').val('false');

    // Grab the new submission detail DTO (empty, going to wipe out the db)
    var data = $(this).parents('[data-subAttrId]').clone();
    var i = 0;
    var processed = []; // rename from whatever id to [0]
    $(data).find('input').each(function () {
        var name = $(this).attr('name');
        if (typeof name != 'undefined' && name != null) {
            var oldId = "[" + name.substr(1, name.indexOf("]") - 1) + "]";
            var newId = "[" + i + "]";
            if (!processed.includes(oldId)) {
                $(data).find('input[name^="' + oldId + '"]').each(function () { $(this).attr('name', $(this).attr('name').replace(oldId, newId)); });
                i++;
                processed.push(newId);
            }
        }
    });

    // Post update to sub dto
    var newForm = $('<form/>').append(data);
    var dataToSend = newForm.serializeArray();
    dataToSend.push({ "name": "isSubmit", "value": "false" });
    dataToSend.push({ "name": "__RequestVerificationToken", "value": AntiForgeryHelper.Token().value });
    $.ajax({
        type: 'POST',
        url: 'Submission/RemoteSave',
        data: AntiForgeryHelper.Wrap(dataToSend),
        async: true,
        cache: false,
        traditional: true,
        success: function (data) {
        },
        error: function (data) {
            //console.log('error' + data);
        }
    });
});

/* slide picker control */
$('.SlidePicker').find('input[type="text"]').on('input change', function () {
    var container = $(this).closest('.SlidePicker');
    var slide = $(this).parent().find('input[type="range"]');
    var output = $(this).parent().children('.output');
    if (output.length > 0) {
        var val = $(this).val();
        if (isNaN(val)) {
            $(this).val('');
            val = '';
        }

        var min = $(slide).attr('min');
        var max = $(slide).attr('max');

        var width = $(slide).width();
        var newPoint = ((val - max) / max - min) + 1;

        var offset = $(output).width() * newPoint * -1;

        if (newPoint < 0) newPoint = 0;
        if (newPoint > 1) newPoint = 1;

        newPoint = newPoint * width;

        if (val != "") {
            output.text(val);
            output.css('font-size', '25px');
        } else {
            output.text('unset');
            output.css('font-size', '11px');
        }
        output.css('left', newPoint + 'px');
        output.css('margin-left', offset + 'px');
    }
}).trigger('change');

$('.SlidePicker').find('input[type="range"]').on('input change', function () {
    var input = $(this).parent().parent().children('input[type="text"]');
    if (input.length > 0) {
        $(input).val($(this).val()).trigger('change');
    }
});

window.onResize(function () {
    $('.SlidePicker').find('input[type="text"]').trigger('change');
});

/* new MWF version, fix onchanged */
if (typeof (mwfAutoInit) != "undefined") {
    var mwfAutoInit_Select_onSelectionChanged = mwfAutoInit.Select.prototype.onSelectionChanged;
    mwfAutoInit.Select.prototype.onSelectionChanged = (function (e) {
        mwfAutoInit_Select_onSelectionChanged.apply(this, arguments);
        $(this.select).val(e.id);
        $(this.select).trigger('change');
        return true;
    });
}


// teams collaboration join now component
function TeamsCollabOptInPartial() {
    if ($('#teams-collab-opt-in').length > 0) {
        var loc_click_here_to_continue = (typeof (window.LocalizationResources['teams_collab_click_here_to_continue']) !== "undefined") ? window.LocalizationResources['teams_collab_click_here_to_continue'] : 'Click here to continue Teams Collaboration registration';
        var loc_generic_error = (typeof (window.LocalizationResources['GenericError']) !== "undefined") ? window.LocalizationResources['GenericError'] : 'There was an error. Please retry.';

        $('#TeamsCollabOptInPrivacyNoticeRead').on('change', function () {
            if ($('#TeamsCollabOptInPrivacyNoticeRead').is(':checked')) {
                $('#teams-collab-opt-in').addClass('f-purple');
                $('#teams-collab-opt-in').removeClass('f-clear');
                $('#teams-collab-opt-in').removeAttr('disabled');
            } else {
                $('#teams-collab-opt-in').removeClass('f-purple');
                $('#teams-collab-opt-in').addClass('f-clear');
                $('#teams-collab-opt-in').attr('disabled', 'disabled');
            }
        });
        $('#teams-collab-opt-in').on('click', function (e) {
            e.preventDefault();
            if ($('#TeamsCollabOptInPrivacyNoticeRead').is(':checked')) {
                $(this).removeClass('f-purple');
                $(this).addClass('f-clear');
                $(this).prop('disabled', 'disabled');
                $('.teams-collaboration-block-item').find('.c-progress').show();
                var returnUrl = null;
                if (window.location.pathname.toLowerCase().includes("/search")) {
                    returnUrl = window.location.pathname + window.location.search + window.location.hash;
                }
                $.post('/Account/TeamsCollaborationOptIn', AntiForgeryHelper.Wrap({ optin: true, returnUrl: returnUrl }), function (s) {
                    if (typeof (s) == "object") {
                        if (typeof (s.Data) == "string" && s.Data.startsWith("http")) {
                            window.location.href = s.Data;

                            setTimeout(function () {
                                $('.teams-collaboration-block-item').append('<a href="' + s.Data + '" class="c-hyperlink"> ' + loc_click_here_to_continue + '</a>');
                            }, 4000);
                        } else if (typeof (s.Data) == "boolean") {
                            if (s.Data == true) {
                                if ($('#userregionProfile').length > 0) {
                                    $.get('/account/GetUserProfileRegion', function (s) {
                                        $('#userregionProfile').html(s);
                                    });
                                }
                                if ($('#GetTeamsCollaborationRequests').length > 0) {
                                    $.get('/account/GetTeamsCollaborationRequests', function (s) {
                                        $('#GetTeamsCollaborationRequests').html(s);
                                    })
                                }
                                if (document.location.pathname.toLowerCase().includes("/search/")) {
                                    document.location.reload();
                                }
                            } else {
                                $('.teams-collaboration-block-item').append(loc_generic_error);
                            }
                        }
                    } else {
                        $('.teams-collaboration-block-item').append(loc_generic_error);
                    }

                    // Center-screen popup window script
                    //var newWindow;
                    //if (s != "true" || s.startsWith("http")) {
                    //    var w = 400;
                    //    var h = 500;
                    //    var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width;
                    //    var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height;
                    //    var systemZoom = width / window.screen.availWidth;
                    //    var left = (width - w) / 2 / systemZoom;
                    //    var top = (height - h) / 2 / systemZoom;

                    //    newWindow = window.open(s, "Imagine Cup Teams Collaboration Opt-In", 'scrollbars=yes, width=' + w / systemZoom + ', height=' + h / systemZoom + ', top=' + top + ', left=' + left + ', location=no, menubar=no, resizable=no, toolbar=no');

                    //    try {
                    //        newWindow.focus();
                    //    } catch (e) {
                    //        $('.teams-collaboration-block-item').append('<a href="' + s + '" class="c-hyperlink">Click here to continue Teams Collaboration registration</a>');
                    //    }
                    //}

                    //var timer = setInterval(function () {
                    //    if (typeof (newWindow) == 'undefined' || newWindow.closed) {
                    //        $.get('@Url.Action("GetUserProfileRegion", "Account")', function (s) {
                    //            $('#userregionProfile').html(s);
                    //        });
                    //        clearTimeout(timer);
                    //    }
                    //}, 1000)
                });
            }
        });
    }
}
$(function () {
    TeamsCollabOptInPartial();
});;
$(function () {
    var loc_dialogShow = (typeof (window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['SupportBot_Show_Aria']) !== "undefined") ? window.LocalizationResources['SupportBot_Show_Aria'] : 'Click or press enter to show the support bot dialog';
    var loc_dialogHide = (typeof (window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['SupportBot_Hide_Aria']) !== "undefined") ? window.LocalizationResources['SupportBot_Hide_Aria'] : 'Click or press enter to hide the support bot dialog';
    var loc_NetworkError = (typeof (window.LocalizationResources) !== "undefined" && typeof(window.LocalizationResources['NetworkError']) !== "undefined") ? window.LocalizationResources['NetworkError'] : 'A network error occurred. Please email support.';
    var loc_youSaid = (typeof(window.LocalizationResources) !== "undefined" && typeof (window.LocalizationResources['SupportBot_Aria_YouSaid']) !== "undefined") ? window.LocalizationResources['SupportBot_Aria_YouSaid'] : 'You said...';
    var queryTemplate = $('<div class="query" tabindex="0" role="alertdialog">');
    var typingIndicatorTemplate = $('<div class="typing-indicator"><span></span><span></span><span></span></div>');

    if ($('.SupportChatBot').length > 0) {
        var culture = $('.SupportChatBot').attr('data-locale');

        // Bind controls
        $('.SupportChatBot input[type="text"]').on('keyup', function (e) {
            if (e.keyCode == 13) {
                SubmitQuery();
            }
        });

        $('.SupportChatBot button').on('click', function () {
            SubmitQuery();
        });

        $(document).ready(function () {
            // remove re-add previous messages for aria-live to update properly
            var log = $('.SupportChatBot .responses').html().trim();
            $('.SupportChatBot .responses').html('');
            $('.SupportChatBot .responses').append(log);

            // Tab focus capture
            tabFocusCapture();

            // Script for when focus goes behind the fixed chat window
            $('body').on('focusin', function (e) {
                if (typeof(e.target) == 'undefined' || e.target == null) return;
                if ($(e.target).hasClass('SupportChatBot') || $(e.target).parents('.SupportChatBot').length > 0) return;

                var targetPos = e.target.getBoundingClientRect();
                var chatbotPos = document.querySelector('.SupportChatBot').getBoundingClientRect();

                var overlap = !(targetPos.right < chatbotPos.left ||
                                targetPos.left > chatbotPos.right ||
                                targetPos.bottom < chatbotPos.top ||
                                targetPos.top > chatbotPos.bottom);

                if (overlap) {
                    var moveTop = chatbotPos.bottom - targetPos.top;
                    window.scrollTo(0, window.scrollY + moveTop);
                }
            });


            
            if ($('.SupportChatBot').parent('.fixed-bottom-right').length > 0) {
                var initialBottom = $('.SupportChatBot').css('bottom');

                window.onResize(function () {
                    $(window).scroll();
                });

                $(window).on('resize', function () {
                    $(window).scroll();
                });

                $(window).on('scroll', function () {
                    if ($('.SupportChatBot').parent('.fixed-bottom-right').length > 0) {
                        var height = $('.SupportChatBot .top').outerHeight();

                        // End position
                        var endPos = $('.social-footer').offset().top;
                        var scrollBottom = $(window).scrollTop() + $(window).height();

                        if (scrollBottom > endPos) { // Nav is stuck to bottom of page
                            $('.SupportChatBot').css('position', 'absolute');
                            $('.SupportChatBot').css('bottom', '10px');
                        } else {
                            $('.SupportChatBot').css('position', 'fixed');
                            $('.SupportChatBot').css('bottom', initialBottom);
                        }
                    }
                });
            }
        });

        function tabFocusCapture() {
            var focusable = $('.SupportChatBot').find('a:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])');
            var firstFocusable = $(focusable).first().get(0);
            var lastFocusable = $(focusable).last().get(0);
            $('.SupportChatBot').off('keydown');

            if (firstFocusable == lastFocusable) return;
            $('.SupportChatBot').on('keydown', function (e) {
                if (e.key === 'Tab' || e.keyCode === 9) {
                    if (e.shiftKey) {
                        if (document.activeElement == firstFocusable) {
                            lastFocusable.focus();
                            e.preventDefault();
                        }
                    } else {
                        if (document.activeElement == lastFocusable) {
                            firstFocusable.focus();
                            e.preventDefault();
                        }
                    }
                }
            });
        }

        // Logic for querying
        function SubmitQuery() {
            var query = $('.SupportChatBot input[type="text"]').val().trim();
            var session = $('.SupportChatBot .responses').children().first().attr('data-session') || "-1";
            if (query.length > 0) {
                $('.SupportChatBot input[type="text"]').val('');
                var userQueryBox = $(queryTemplate).clone(false, false).text(query);
                $(userQueryBox).prepend('<div class="screen-reader-text">You said...</div>');
                $('.SupportChatBot .responses').append(userQueryBox);
                $('.SupportChatBot .responses').append($(typingIndicatorTemplate).clone(false, false));
                $.ajax({
                    type: 'POST',
                    url: "/" + culture + "/Support/ChatbotQuery",
                    dataType: "html",
                    async: true,
                    cache: false,
                    data: AntiForgeryHelper.Wrap({ query: query, session: session }),
                    success: function (response, xhr, details) {
                        if (response.replace(/\s/g, '').toLowerCase().startsWith('<!doctype') || response.replace(/\s/g, '').toLowerCase().startsWith('<html')) {
                            error();
                        } else {
                            $('.SupportChatBot .typing-indicator').remove();
                            $('.SupportChatBot .responses').append(response);
                        }
                    },
                    error: function (xhr, status, errThrow) {
                        error();
                    }
                });
            }
        }

        function error() {
            $('.SupportChatBot .typing-indicator').remove();
            $('.SupportChatBot .responses').append($('<div class="error">' + loc_NetworkError + '</div>'));
        }

        $('.SupportChatBot .responses').bind('DOMSubtreeModified', function (e) {
            $('.SupportChatBot .responses').scrollTop(function () { return this.scrollHeight; });
        });

        $('.SupportChatBot .hide-show-btn').bind('click', function () {
            if ($('.SupportChatBot .top .hide-show-btn').hasClass('glyph-chevron-down')) {
                hideChatBot();
            } else {
                showChatBot();
            }
        });

        if (window.innerWidth <= 767) {
            hideChatBot();
        }

        function hideChatBot() {
            $('.SupportChatBot .top .hide-show-btn').removeClass('glyph-chevron-down');
            $('.SupportChatBot .top .hide-show-btn').addClass('glyph-chevron-up');
            $('.SupportChatBot .top .hide-show-btn').attr('aria-label', loc_dialogShow);
            $('.SupportChatBot').attr('tabindex', '-1');
            $('.SupportChatBot .controls').find('a,button,input').attr('tabindex', '-1');
            $('.SupportChatBot .responses').find('a').attr('tabindex', '-1');
            $('.SupportChatBot .responses .response').attr('tabindex', '-1');
            $('.SupportChatBot .responses .query').attr('tabindex', '-1');
            $('.SupportChatBot').animate({ 'height': '65px' }, 500);
            $('.SupportChatBot').animate({ 'width': '100px' }, 500);
            tabFocusCapture();
        }

        function showChatBot() {
            $('.SupportChatBot .top .hide-show-btn').removeClass('glyph-chevron-up');
            $('.SupportChatBot .top .hide-show-btn').addClass('glyph-chevron-down');
            $('.SupportChatBot .top .hide-show-btn').attr('aria-label', loc_dialogHide);
            $('.SupportChatBot').attr('tabindex', '0');
            $('.SupportChatBot .controls').find('a,button,input').attr('tabindex', '0');
            $('.SupportChatBot .responses').find('a').attr('tabindex', '0');
            $('.SupportChatBot .responses .response').attr('tabindex', '0');
            $('.SupportChatBot .responses .query').attr('tabindex', '0');
            $('.SupportChatBot').animate({ 'width': '300px' }, 500);
            $('.SupportChatBot').animate({ 'height': '400px' }, 500);
            tabFocusCapture();
        }
    };
});;
