/* Shameless port of a shameless port @defunkt => @janl => @aq See http://github.com/defunkt/mustache for more info. */ ;(function($) { /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ var Mustache = (typeof module !== "undefined" && module.exports) || {}; (function (exports) { exports.name = "mustache.js"; exports.version = "0.5.0-dev"; exports.tags = ["{{", "}}"]; exports.parse = parse; exports.compile = compile; exports.render = render; exports.clearCache = clearCache; // This is here for backwards compatibility with 0.4.x. exports.to_html = function (template, view, partials, send) { var result = render(template, view, partials); if (typeof send === "function") { send(result); } else { return result; } }; var _toString = Object.prototype.toString; var _isArray = Array.isArray; var _forEach = Array.prototype.forEach; var _trim = String.prototype.trim; var isArray; if (_isArray) { isArray = _isArray; } else { isArray = function (obj) { return _toString.call(obj) === "[object Array]"; }; } var forEach; if (_forEach) { forEach = function (obj, callback, scope) { return _forEach.call(obj, callback, scope); }; } else { forEach = function (obj, callback, scope) { for (var i = 0, len = obj.length; i < len; ++i) { callback.call(scope, obj[i], i, obj); } }; } var spaceRe = /^\s*$/; function isWhitespace(string) { return spaceRe.test(string); } var trim; if (_trim) { trim = function (string) { return string == null ? "" : _trim.call(string); }; } else { var trimLeft, trimRight; if (isWhitespace("\xA0")) { trimLeft = /^\s+/; trimRight = /\s+$/; } else { // IE doesn't match non-breaking spaces with \s, thanks jQuery. trimLeft = /^[\s\xA0]+/; trimRight = /[\s\xA0]+$/; } trim = function (string) { return string == null ? "" : String(string).replace(trimLeft, "").replace(trimRight, ""); }; } var escapeMap = { "&": "&", "<": "<", ">": ">", '"': '"', "'": ''' }; function escapeHTML(string) { return String(string).replace(/&(?!\w+;)|[<>"']/g, function (s) { return escapeMap[s] || s; }); } /** * Adds the `template`, `line`, and `file` properties to the given error * object and alters the message to provide more useful debugging information. */ function debug(e, template, line, file) { file = file || "