Socket
Socket
Sign inDemoInstall

dustjs-linkedin

Package Overview
Dependencies
Maintainers
4
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dustjs-linkedin - npm Package Compare versions

Comparing version 2.6.2 to 2.7.0

dust.komodoproject

5

bower.json
{
"name": "dustjs-linkedin",
"version": "2.6.2",
"version": "2.7.0",
"homepage": "https://github.com/linkedin/dustjs",

@@ -38,6 +38,5 @@ "authors": [

"**/.*",
"benchmark",
"bin",
"docs",
"examples",
"index.js",
"lib",

@@ -44,0 +43,0 @@ "node_modules",

18

CHANGELOG.md
## Change Log
### v2.6.2 (2015/03/26 20:27 +00:00)
### v2.7.0 (2015/04/17 23:23 +00:00)
- [#636](https://github.com/linkedin/dustjs/pull/636) Fix failing tests in IE8 (@sethkinast)
- [#633](https://github.com/linkedin/dustjs/pull/633) Drop Node 0.8 (@sethkinast)
- [#635](https://github.com/linkedin/dustjs/pull/635) Resolve dynamic partial names via original context (@sethkinast)
- [#631](https://github.com/linkedin/dustjs/pull/631) Try to avoid creating Stacks with no content when possible (@sethkinast)
- [#613](https://github.com/linkedin/dustjs/pull/613) Refactor template compilation * `dust.render` and `dust.stream` now accept a compiled template function in addition to a template name. * `dust.compile` no longer requires a template name, and will compile an anonymous template without one (so `--name` is no longer required for dustc either) * `dust.load` is removed from the public API * `dust.renderSource` is moved to the compiler, so it's only included in dust-full now (Fixes #412) * `dust.compileFn` is moved to the compiler, so it's only included in dust-full now * add `dust.isTemplateFn` * add `dust.config.cache = true`, set to `false` to disable caching and load templates again every time (Fixes #451) * add `dust.config.cjs = false`, set to `true` to compile templates as CommonJS modules * add `--cjs` flag to `dustc` * Move a bunch of exposed compiler stuff under `dust.compiler` (but leave it exposed until 2.8) (@sethkinast)
- [#624](https://github.com/linkedin/dustjs/pull/624) dustc always creates templates with forward slashes (@sethkinast)
- [#617](https://github.com/linkedin/dustjs/pull/617) Add `chunk.stream` to allow streamables in context (@sethkinast)
- [#610](https://github.com/linkedin/dustjs/pull/610) clean up PEG grammar a little bit (@sethkinast)
- [#622](https://github.com/linkedin/dustjs/pull/622) Fix behavior of `Context#resolve` when resolving a context function that returns a Chunk (@sethkinast)
- [#611](https://github.com/linkedin/dustjs/pull/611) Add grunt-github-changes plugin to automatically update changelog before releases (@sethkinast)
- [#627](https://github.com/linkedin/dustjs/pull/627) Move to Travis CI Container builds (@sethkinast)
- [#623](https://github.com/linkedin/dustjs/pull/623) Update to stable chokidar. (@paulmillr)
- [#592](https://github.com/linkedin/dustjs/pull/592) Remove benchmark and old docs (@sethkinast)
- [#609](https://github.com/linkedin/dustjs/pull/609) Clarify a few examples and add a new explicitly-incremental streaming example (@sethkinast)
### v2.6.2 (2015/03/26 20:28 +00:00)
- [#593](https://github.com/linkedin/dustjs/pull/593) npm upgrade (@sethkinast)

@@ -5,0 +21,0 @@ - [#590](https://github.com/linkedin/dustjs/pull/590) Add deep resolution of Thenables in context (@sethkinast)

@@ -1,3 +0,3 @@

/*! Dust - Asynchronous Templating - v2.6.2
* http://linkedin.github.io/dustjs/
/*! dustjs-linkedin - v2.7.0
* http://dustjs.com/
* Copyright (c) 2015 Aleksander Williams; Released under the MIT License */

@@ -15,3 +15,3 @@ (function (root, factory) {

var dust = {
"version": "2.6.2"
"version": "2.7.0"
},

@@ -23,3 +23,5 @@ NONE = 'NONE', ERROR = 'ERROR', WARN = 'WARN', INFO = 'INFO', DEBUG = 'DEBUG',

whitespace: false,
amd: false
amd: false,
cjs: false,
cache: true
};

@@ -92,9 +94,10 @@

}
tmpl.templateName = name;
dust.cache[name] = tmpl;
};
dust.render = function(name, context, callback) {
dust.render = function(nameOrTemplate, context, callback) {
var chunk = new Stub(callback).head;
try {
dust.load(name, chunk, Context.wrap(context, name)).end();
load(nameOrTemplate, chunk, context).end();
} catch (err) {

@@ -105,3 +108,3 @@ chunk.setError(err);

dust.stream = function(name, context) {
dust.stream = function(nameOrTemplate, context) {
var stream = new Stream(),

@@ -111,3 +114,3 @@ chunk = stream.head;

try {
dust.load(name, stream.head, Context.wrap(context, name)).end();
load(nameOrTemplate, chunk, context).end();
} catch (err) {

@@ -120,52 +123,44 @@ chunk.setError(err);

dust.renderSource = function(source, context, callback) {
return dust.compileFn(source)(context, callback);
};
function load(nameOrTemplate, chunk, context) {
if(!nameOrTemplate) {
return chunk.setError(new Error('No template or template name provided to render'));
}
/**
* Compile a template to an invokable function.
* If `name` is provided, also registers the template under `name`.
* @param source {String} template source
* @param [name] {String} template name
* @return {Function} has the signature `fn(context, cb)`
*/
dust.compileFn = function(source, name) {
name = name || null;
var tmpl = dust.loadSource(dust.compile(source, name));
return function(context, callback) {
var master = callback ? new Stub(callback) : new Stream();
dust.nextTick(function() {
if(typeof tmpl === 'function') {
tmpl(master.head, Context.wrap(context, name)).end();
} else {
dust.log(new Error('Template `' + name + '` could not be loaded'), ERROR);
}
});
return master;
};
};
if(!dust.config.cache) {
dust.cache = {};
}
dust.load = function(name, chunk, context) {
var tmpl = dust.cache[name];
var tmpl;
if(typeof nameOrTemplate === 'function' && nameOrTemplate.template) {
// Sugar away CommonJS module templates
tmpl = nameOrTemplate.template;
} else if(dust.isTemplateFn(nameOrTemplate)) {
// Template functions passed directly
tmpl = nameOrTemplate;
} else {
// Load a template with this name from cache
tmpl = dust.cache[nameOrTemplate];
}
if (tmpl) {
return tmpl(chunk, context);
return tmpl(chunk, Context.wrap(context, tmpl.templateName));
} else {
if (dust.onLoad) {
return chunk.map(function(chunk) {
dust.onLoad(name, function(err, src) {
dust.onLoad(nameOrTemplate, function(err, src) {
if (err) {
return chunk.setError(err);
}
if (!dust.cache[name]) {
dust.loadSource(dust.compile(src, name));
if (!dust.cache[nameOrTemplate]) {
dust.loadSource(dust.compile(src, nameOrTemplate));
}
dust.cache[name](chunk, context).end();
dust.cache[nameOrTemplate](chunk, Context.wrap(context, nameOrTemplate)).end();
});
});
}
return chunk.setError(new Error('Template Not Found: ' + name));
return chunk.setError(new Error('Template Not Found: ' + nameOrTemplate));
}
};
}
dust.loadSource = function(source, path) {
dust.loadSource = function(source) {
/*jshint evil:true*/

@@ -185,5 +180,5 @@ return eval(source);

return function(callback) {
setTimeout(callback,0);
setTimeout(callback, 0);
};
} )();
})();

@@ -223,2 +218,7 @@ /**

dust.isTemplateFn = function(elem) {
return typeof elem === 'function' &&
elem.__dustBody;
};
/**

@@ -235,2 +235,12 @@ * Decide somewhat-naively if something is a Thenable.

/**
* Decide very naively if something is a Stream.
* @param elem {*} object to inspect
* @return {Boolean} is `elem` a Stream?
*/
dust.isStreamable = function(elem) {
return elem &&
typeof elem.on === 'function';
};
// apply the filter chain and return the output string

@@ -276,2 +286,5 @@ dust.filter = function(string, auto, filters) {

function Context(stack, global, blocks, templateName) {
if(stack !== undefined && !(stack instanceof Stack)) {
stack = new Stack(stack);
}
this.stack = stack;

@@ -284,3 +297,3 @@ this.global = global;

dust.makeBase = function(global) {
return new Context(new Stack(), global);
return new Context(undefined, global);
};

@@ -304,3 +317,3 @@

}
return new Context(new Stack(context), {}, null, name);
return new Context(context, {}, null, name);
};

@@ -366,6 +379,7 @@

// Try looking in the global context if we haven't found anything yet
if (value !== undefined) {
ctx = value;
} else {
ctx = this.global ? this.global[first] : undefined;
ctx = this.global && this.global[first];
}

@@ -417,3 +431,7 @@ } else if (ctx) {

Context.prototype.push = function(head, idx, len) {
return new Context(new Stack(head, this.stack, idx, len), this.global, this.blocks, this.getTemplateName());
if(head === undefined) {
dust.log("Not pushing an undefined variable onto the context", INFO);
return this;
}
return this.rebase(new Stack(head, this.stack, idx, len));
};

@@ -428,3 +446,3 @@

Context.prototype.rebase = function(head) {
return new Context(new Stack(head), this.global, this.blocks, this.getTemplateName());
return new Context(head, this.global, this.blocks, this.getTemplateName());
};

@@ -442,3 +460,3 @@

Context.prototype.getBlock = function(key, chk, ctx) {
Context.prototype.getBlock = function(key) {
var blocks, len, fn;

@@ -491,6 +509,6 @@

chunk = new Chunk().render(body, this);
if(!body.__dustBody) {
return chunk;
if(chunk instanceof Chunk) {
return chunk.data.join(''); // ie7 perf
}
return chunk.data.join(''); // ie7 perf
return chunk;
};

@@ -536,2 +554,5 @@

/**
* Creates an interface sort of like a Streams2 ReadableStream.
*/
function Stream() {

@@ -549,2 +570,3 @@ this.head = new Chunk(this);

this.emit('error', chunk.error);
this.emit('end');
dust.log('Streaming failed with error `' + chunk.error + '`', ERROR);

@@ -562,2 +584,7 @@ this.flush = EMPTY_FUNC;

/**
* Executes listeners for `type` by passing data. Note that this is different from a
* Node stream, which can pass an arbitrary number of arguments
* @return `true` if event had listeners, `false` otherwise
*/
Stream.prototype.emit = function(type, data) {

@@ -570,3 +597,3 @@ var events = this.events || {},

dust.log('Stream broadcasting, but no listeners for `' + type + '`', DEBUG);
return;
return false;
}

@@ -578,2 +605,3 @@

}
return true;
};

@@ -593,5 +621,32 @@

/**
* Pipes to a WritableStream. Note that backpressure isn't implemented,
* so we just write as fast as we can.
* @param stream {WritableStream}
* @return self
*/
Stream.prototype.pipe = function(stream) {
if(typeof stream.write !== 'function' ||
typeof stream.end !== 'function') {
dust.log('Incompatible stream passed to `pipe`', WARN);
return this;
}
var destEnded = false;
if(typeof stream.emit === 'function') {
stream.emit('pipe', this);
}
if(typeof stream.on === 'function') {
stream.on('error', function() {
destEnded = true;
});
}
return this
.on('data', function(data) {
if(destEnded) {
return;
}
try {

@@ -604,10 +659,11 @@ stream.write(data, 'utf8');

.on('end', function() {
if(destEnded) {
return;
}
try {
stream.end();
destEnded = true;
} catch (err) {
dust.log(err, ERROR);
}
})
.on('error', function(err) {
stream.error(err);
});

@@ -683,6 +739,10 @@ };

return elem;
} else {
return this.reference(elem, context, auto, filters);
}
}
if (dust.isThenable(elem)) {
return this.await(elem, context);
return this.await(elem, context, null, auto, filters);
} else if (dust.isStreamable(elem)) {
return this.stream(elem, context, null, auto, filters);
} else if (!dust.isEmpty(elem)) {

@@ -701,3 +761,3 @@ return this.write(dust.filter(elem, auto, filters));

if (typeof elem === 'function' && !elem.__dustBody) {
if (typeof elem === 'function' && !dust.isTemplateFn(elem)) {
try {

@@ -731,7 +791,7 @@ elem = elem.apply(context.current(), [this, context, bodies, params]);

if(context.stack.head) {
context.stack.head['$len'] = len;
context.stack.head.$len = len;
}
for (i = 0; i < len; i++) {
if(context.stack.head) {
context.stack.head['$idx'] = i;
context.stack.head.$idx = i;
}

@@ -741,4 +801,4 @@ chunk = body(chunk, context.push(elem[i], i, len));

if(context.stack.head) {
context.stack.head['$idx'] = undefined;
context.stack.head['$len'] = undefined;
context.stack.head.$idx = undefined;
context.stack.head.$len = undefined;
}

@@ -753,2 +813,4 @@ return chunk;

return this.await(elem, context, bodies);
} else if (dust.isStreamable(elem)) {
return this.stream(elem, context, bodies);
} else if (elem === true) {

@@ -814,22 +876,22 @@ // true is truthy but does not change context

Chunk.prototype.partial = function(elem, context, params) {
Chunk.prototype.partial = function(elem, context, partialContext, params) {
var head;
if (!dust.isEmptyObject(params)) {
context = context.clone();
head = context.pop();
context = context.push(params)
.push(head);
partialContext = partialContext.clone();
head = partialContext.pop();
partialContext = partialContext.push(params)
.push(head);
}
if (elem.__dustBody) {
if (dust.isTemplateFn(elem)) {
// The eventual result of evaluating `elem` is a partial name
// Load the partial after getting its name and end the async chunk
return this.capture(elem, context, function(name, chunk) {
context.templateName = name;
dust.load(name, chunk, context).end();
partialContext.templateName = name;
load(name, chunk, partialContext).end();
});
} else {
context.templateName = elem;
return dust.load(elem, this, context);
partialContext.templateName = elem;
return load(elem, this, partialContext);
}

@@ -866,3 +928,3 @@ };

*/
Chunk.prototype.await = function(thenable, context, bodies) {
Chunk.prototype.await = function(thenable, context, bodies, auto, filters) {
var body = bodies && bodies.block,

@@ -875,3 +937,3 @@ errorBody = bodies && bodies.error;

} else {
chunk.end(data);
chunk.reference(data, context, auto, filters).end();
}

@@ -889,2 +951,55 @@ }, function(err) {

/**
* Reserve a chunk to be evaluated with the contents of a streamable.
* Currently an error event will bomb out the stream. Once an error
* is received, we push it to an {:error} block if one exists, and log otherwise,
* then stop listening to the stream.
* @param streamable {Streamable} the target streamable that will emit events
* @param context {Context} context to use to render each thunk
* @param bodies {Object} must contain a "body", may contain an "error"
* @return {Chunk}
*/
Chunk.prototype.stream = function(stream, context, bodies, auto, filters) {
var body = bodies && bodies.block,
errorBody = bodies && bodies.error;
return this.map(function(chunk) {
var ended = false;
stream
.on('data', function data(thunk) {
if(ended) {
return;
}
if(body) {
// Fork a new chunk out of the blockstream so that we can flush it independently
chunk = chunk.map(function(chunk) {
chunk.render(body, context.push(thunk)).end();
});
} else {
// Don't fork, just write into the master async chunk
chunk = chunk.reference(thunk, context, auto, filters);
}
})
.on('error', function error(err) {
if(ended) {
return;
}
if(errorBody) {
chunk.render(errorBody, context.push(err));
} else {
dust.log('Unhandled stream error in `' + context.getTemplateName() + '`');
}
if(!ended) {
ended = true;
chunk.end();
}
})
.on('end', function end() {
if(!ended) {
ended = true;
chunk.end();
}
});
});
};
Chunk.prototype.capture = function(body, context, callback) {

@@ -891,0 +1006,0 @@ return this.map(function(chunk) {

@@ -1,4 +0,4 @@

/*! Dust - Asynchronous Templating - v2.6.2
* http://linkedin.github.io/dustjs/
/*! dustjs-linkedin - v2.7.0
* http://dustjs.com/
* Copyright (c) 2015 Aleksander Williams; Released under the MIT License */
!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.core",[],b):"object"==typeof exports?module.exports=b():a.dust=b()}(this,function(){function Context(a,b,c,d){this.stack=a,this.global=b,this.blocks=c,this.templateName=d}function getWithResolvedData(a,b,c){return function(d){return a.push(d)._get(b,c)}}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function Tap(a,b){this.head=a,this.tail=b}var dust={version:"2.6.2"},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",EMPTY_FUNC=function(){};dust.config={whitespace:!1,amd:!1},dust._aliases={write:"w",end:"e",map:"m",render:"r",reference:"f",section:"s",exists:"x",notexists:"nx",block:"b",partial:"p",helper:"h"},function(){var a,b,c={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};"undefined"!=typeof console&&console.log?(a=console.log,b="function"==typeof a?function(){a.apply(console,arguments)}:function(){a(Array.prototype.slice.apply(arguments).join(" "))}):b=EMPTY_FUNC,dust.log=function(a,d){d=d||INFO,c[d]>=c[dust.debugLevel]&&b("[DUST:"+d+"]",a)},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(dust.cache[a]=b)},dust.render=function(a,b,c){var d=new Stub(c).head;try{dust.load(a,d,Context.wrap(b,a)).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{dust.load(a,c.head,Context.wrap(b,a)).end()}catch(e){d.setError(e)}}),c},dust.renderSource=function(a,b,c){return dust.compileFn(a)(b,c)},dust.compileFn=function(a,b){b=b||null;var c=dust.loadSource(dust.compile(a,b));return function(a,d){var e=d?new Stub(d):new Stream;return dust.nextTick(function(){"function"==typeof c?c(e.head,Context.wrap(a,b)).end():dust.log(new Error("Template `"+b+"` could not be loaded"),ERROR)}),e}},dust.load=function(a,b,c){var d=dust.cache[a];return d?d(b,c):dust.onLoad?b.map(function(b){dust.onLoad(a,function(d,e){return d?b.setError(d):(dust.cache[a]||dust.loadSource(dust.compile(e,a)),void dust.cache[a](b,c).end())})}):b.setError(new Error("Template Not Found: "+a))},dust.loadSource=function(source,path){return eval(source)},dust.isArray=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0===a?!1:dust.isArray(a)&&!a.length?!0:!a},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isThenable=function(a){return a&&"object"==typeof a&&"function"==typeof a.then},dust.filter=function(a,b,c){var d,e,f;if(c)for(d=0,e=c.length;e>d;d++)f=c[d],"s"===f?b=null:"function"==typeof dust.filters[f]?a=dust.filters[f](a):dust.log("Invalid filter `"+f+"`",WARN);return b&&(a=dust.filters[b](a)),a},dust.filters={h:function(a){return dust.escapeHtml(a)},j:function(a){return dust.escapeJs(a)},u:encodeURI,uc:encodeURIComponent,js:function(a){return dust.escapeJSON(a)},jp:function(a){return JSON?JSON.parse(a):(dust.log("JSON is undefined; could not parse `"+a+"`",WARN),a)}},dust.makeBase=function(a){return new Context(new Stack,a)},Context.wrap=function(a,b){return a instanceof Context?a:new Context(new Stack(a),{},null,b)},Context.prototype.get=function(a,b){return"string"==typeof a&&("."===a[0]&&(b=!0,a=a.substr(1)),a=a.split(".")),this._get(b,a)},Context.prototype._get=function(a,b){var c,d,e,f,g,h=this.stack||{},i=1;if(d=b[0],e=b.length,a&&0===e)f=h,h=h.head;else{if(a)h&&(h=h.head?h.head[d]:void 0);else{for(;h&&(!h.isObject||(f=h.head,c=h.head[d],void 0===c));)h=h.tail;h=void 0!==c?c:this.global?this.global[d]:void 0}for(;h&&e>i;){if(dust.isThenable(h))return h.then(getWithResolvedData(this,a,b.slice(i)));f=h,h=h[b[i]],i++}}return"function"==typeof h?(g=function(){try{return h.apply(f,arguments)}catch(a){throw dust.log(a,ERROR),a}},g.__dustBody=!!h.__dustBody,g):(void 0===h&&dust.log("Cannot find reference `{"+b.join(".")+"}` in template `"+this.getTemplateName()+"`",INFO),h)},Context.prototype.getPath=function(a,b){return this._get(a,b)},Context.prototype.push=function(a,b,c){return new Context(new Stack(a,this.stack,b,c),this.global,this.blocks,this.getTemplateName())},Context.prototype.pop=function(){var a=this.current();return this.stack=this.stack&&this.stack.tail,a},Context.prototype.rebase=function(a){return new Context(new Stack(a),this.global,this.blocks,this.getTemplateName())},Context.prototype.clone=function(){var a=this.rebase();return a.stack=this.stack,a},Context.prototype.current=function(){return this.stack&&this.stack.head},Context.prototype.getBlock=function(a){var b,c,d;if("function"==typeof a&&(a=a(new Chunk,this).data.join("")),b=this.blocks,!b)return dust.log("No blocks for context `"+a+"` in template `"+this.getTemplateName()+"`",DEBUG),!1;for(c=b.length;c--;)if(d=b[c][a])return d;return dust.log("Malformed template `"+this.getTemplateName()+"` was missing one or more blocks."),!1},Context.prototype.shiftBlocks=function(a){var b,c=this.blocks;return a?(b=c?c.concat([a]):[a],new Context(this.stack,this.global,b,this.getTemplateName())):this},Context.prototype.resolve=function(a){var b;return"function"!=typeof a?a:(b=(new Chunk).render(a,this),a.__dustBody?b.data.join(""):b)},Context.prototype.getTemplateName=function(){return this.templateName},Stub.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.callback(a.error),dust.log("Rendering failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.out+=a.data.join(""),a=a.next,this.head=a}this.callback(null,this.out)},Stream.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.emit("error",a.error),dust.log("Streaming failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.emit("data",a.data.join("")),a=a.next,this.head=a}this.emit("end")},Stream.prototype.emit=function(a,b){var c,d,e=this.events||{},f=e[a]||[];if(!f.length)return void dust.log("Stream broadcasting, but no listeners for `"+a+"`",DEBUG);for(f=f.slice(0),c=0,d=f.length;d>c;c++)f[c](b)},Stream.prototype.on=function(a,b){var c=this.events=this.events||{},d=c[a]=c[a]||[];return"function"!=typeof b?dust.log("No callback function provided for `"+a+"` event listener",WARN):d.push(b),this},Stream.prototype.pipe=function(a){return this.on("data",function(b){try{a.write(b,"utf8")}catch(c){dust.log(c,ERROR)}}).on("end",function(){try{a.end()}catch(b){dust.log(b,ERROR)}}).on("error",function(b){a.error(b)})},Chunk.prototype.write=function(a){var b=this.taps;return b&&(a=b.go(a)),this.data.push(a),this},Chunk.prototype.end=function(a){return a&&this.write(a),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(a){var b=new Chunk(this.root,this.next,this.taps),c=new Chunk(this.root,b,this.taps);this.next=c,this.flushable=!0;try{a(c)}catch(d){dust.log(d,ERROR),c.setError(d)}return b},Chunk.prototype.tap=function(a){var b=this.taps;return this.taps=b?b.push(a):new Tap(a),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(a,b){return a(this,b)},Chunk.prototype.reference=function(a,b,c,d){return"function"==typeof a&&(a=a.apply(b.current(),[this,b,null,{auto:c,filters:d}]),a instanceof Chunk)?a:dust.isThenable(a)?this.await(a,b):dust.isEmpty(a)?this:this.write(dust.filter(a,c,d))},Chunk.prototype.section=function(a,b,c,d){var e,f,g=c.block,h=c["else"],i=this;if("function"==typeof a&&!a.__dustBody){try{a=a.apply(b.current(),[this,b,c,d])}catch(j){return dust.log(j,ERROR),this.setError(j)}if(a instanceof Chunk)return a}if(dust.isEmptyObject(d)||(b=b.push(d)),dust.isArray(a)){if(g){if(f=a.length,f>0){for(b.stack.head&&(b.stack.head.$len=f),e=0;f>e;e++)b.stack.head&&(b.stack.head.$idx=e),i=g(i,b.push(a[e],e,f));return b.stack.head&&(b.stack.head.$idx=void 0,b.stack.head.$len=void 0),i}if(h)return h(this,b)}}else{if(dust.isThenable(a))return this.await(a,b,c);if(a===!0){if(g)return g(this,b)}else if(a||0===a){if(g)return g(this,b.push(a))}else if(h)return h(this,b)}return dust.log("Section without corresponding key in template `"+b.getTemplateName()+"`",DEBUG),this},Chunk.prototype.exists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(e)return e(this,b)}else{if(d)return d(this,b);dust.log("No block for exists check in template `"+b.getTemplateName()+"`",DEBUG)}return this},Chunk.prototype.notexists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(d)return d(this,b);dust.log("No block for not-exists check in template `"+b.getTemplateName()+"`",DEBUG)}else if(e)return e(this,b);return this},Chunk.prototype.block=function(a,b,c){var d=a||c.block;return d?d(this,b):this},Chunk.prototype.partial=function(a,b,c){var d;return dust.isEmptyObject(c)||(b=b.clone(),d=b.pop(),b=b.push(c).push(d)),a.__dustBody?this.capture(a,b,function(a,c){b.templateName=a,dust.load(a,c,b).end()}):(b.templateName=a,dust.load(a,this,b))},Chunk.prototype.helper=function(a,b,c,d){var e,f=this;if(!dust.helpers[a])return dust.log("Helper `"+a+"` does not exist",WARN),f;try{return e=dust.helpers[a](f,b,c,d),dust.isThenable(e)?this.await(e,b,c):e}catch(g){return dust.log("Error in helper `"+a+"`: "+g.message,ERROR),f.setError(g)}},Chunk.prototype.await=function(a,b,c){var d=c&&c.block,e=c&&c.error;return this.map(function(c){a.then(function(a){d?c.render(d,b.push(a)).end():c.end(a)},function(a){e?c.render(e,b.push(a)).end():(dust.log("Unhandled promise rejection in `"+b.getTemplateName()+"`"),c.end())})})},Chunk.prototype.capture=function(a,b,c){return this.map(function(d){var e=new Stub(function(a,b){a?d.setError(a):c(b,d)});a(e.head,b).end()})},Chunk.prototype.setError=function(a){return this.error=a,this.root.flush(),this};for(var f in Chunk.prototype)dust._aliases[f]&&(Chunk.prototype[dust._aliases[f]]=Chunk.prototype[f]);Tap.prototype.push=function(a){return new Tap(a,this)},Tap.prototype.go=function(a){for(var b=this;b;)a=b.head(a),b=b.tail;return a};var HCHARS=/[&<>"']/,AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&amp;").replace(LT,"&lt;").replace(GT,"&gt;").replace(QUOT,"&quot;").replace(SQUOT,"&#39;"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),"function"==typeof define&&define.amd&&define.amd.dust===!0&&define(["require","dust.core"],function(require,dust){return dust.onLoad=function(a,b){require([a],function(){b()})},dust});
!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.core",[],b):"object"==typeof exports?module.exports=b():a.dust=b()}(this,function(){function load(a,b,c){if(!a)return b.setError(new Error("No template or template name provided to render"));dust.config.cache||(dust.cache={});var d;return d="function"==typeof a&&a.template?a.template:dust.isTemplateFn(a)?a:dust.cache[a],d?d(b,Context.wrap(c,d.templateName)):dust.onLoad?b.map(function(b){dust.onLoad(a,function(d,e){return d?b.setError(d):(dust.cache[a]||dust.loadSource(dust.compile(e,a)),void dust.cache[a](b,Context.wrap(c,a)).end())})}):b.setError(new Error("Template Not Found: "+a))}function Context(a,b,c,d){void 0===a||a instanceof Stack||(a=new Stack(a)),this.stack=a,this.global=b,this.blocks=c,this.templateName=d}function getWithResolvedData(a,b,c){return function(d){return a.push(d)._get(b,c)}}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function Tap(a,b){this.head=a,this.tail=b}var dust={version:"2.7.0"},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",EMPTY_FUNC=function(){};dust.config={whitespace:!1,amd:!1,cjs:!1,cache:!0},dust._aliases={write:"w",end:"e",map:"m",render:"r",reference:"f",section:"s",exists:"x",notexists:"nx",block:"b",partial:"p",helper:"h"},function(){var a,b,c={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};"undefined"!=typeof console&&console.log?(a=console.log,b="function"==typeof a?function(){a.apply(console,arguments)}:function(){a(Array.prototype.slice.apply(arguments).join(" "))}):b=EMPTY_FUNC,dust.log=function(a,d){d=d||INFO,c[d]>=c[dust.debugLevel]&&b("[DUST:"+d+"]",a)},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(b.templateName=a,dust.cache[a]=b)},dust.render=function(a,b,c){var d=new Stub(c).head;try{load(a,d,b).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{load(a,d,b).end()}catch(c){d.setError(c)}}),c},dust.loadSource=function(source){return eval(source)},dust.isArray=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0===a?!1:dust.isArray(a)&&!a.length?!0:!a},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isTemplateFn=function(a){return"function"==typeof a&&a.__dustBody},dust.isThenable=function(a){return a&&"object"==typeof a&&"function"==typeof a.then},dust.isStreamable=function(a){return a&&"function"==typeof a.on},dust.filter=function(a,b,c){var d,e,f;if(c)for(d=0,e=c.length;e>d;d++)f=c[d],"s"===f?b=null:"function"==typeof dust.filters[f]?a=dust.filters[f](a):dust.log("Invalid filter `"+f+"`",WARN);return b&&(a=dust.filters[b](a)),a},dust.filters={h:function(a){return dust.escapeHtml(a)},j:function(a){return dust.escapeJs(a)},u:encodeURI,uc:encodeURIComponent,js:function(a){return dust.escapeJSON(a)},jp:function(a){return JSON?JSON.parse(a):(dust.log("JSON is undefined; could not parse `"+a+"`",WARN),a)}},dust.makeBase=function(a){return new Context(void 0,a)},Context.wrap=function(a,b){return a instanceof Context?a:new Context(a,{},null,b)},Context.prototype.get=function(a,b){return"string"==typeof a&&("."===a[0]&&(b=!0,a=a.substr(1)),a=a.split(".")),this._get(b,a)},Context.prototype._get=function(a,b){var c,d,e,f,g,h=this.stack||{},i=1;if(d=b[0],e=b.length,a&&0===e)f=h,h=h.head;else{if(a)h&&(h=h.head?h.head[d]:void 0);else{for(;h&&(!h.isObject||(f=h.head,c=h.head[d],void 0===c));)h=h.tail;h=void 0!==c?c:this.global&&this.global[d]}for(;h&&e>i;){if(dust.isThenable(h))return h.then(getWithResolvedData(this,a,b.slice(i)));f=h,h=h[b[i]],i++}}return"function"==typeof h?(g=function(){try{return h.apply(f,arguments)}catch(a){throw dust.log(a,ERROR),a}},g.__dustBody=!!h.__dustBody,g):(void 0===h&&dust.log("Cannot find reference `{"+b.join(".")+"}` in template `"+this.getTemplateName()+"`",INFO),h)},Context.prototype.getPath=function(a,b){return this._get(a,b)},Context.prototype.push=function(a,b,c){return void 0===a?(dust.log("Not pushing an undefined variable onto the context",INFO),this):this.rebase(new Stack(a,this.stack,b,c))},Context.prototype.pop=function(){var a=this.current();return this.stack=this.stack&&this.stack.tail,a},Context.prototype.rebase=function(a){return new Context(a,this.global,this.blocks,this.getTemplateName())},Context.prototype.clone=function(){var a=this.rebase();return a.stack=this.stack,a},Context.prototype.current=function(){return this.stack&&this.stack.head},Context.prototype.getBlock=function(a){var b,c,d;if("function"==typeof a&&(a=a(new Chunk,this).data.join("")),b=this.blocks,!b)return dust.log("No blocks for context `"+a+"` in template `"+this.getTemplateName()+"`",DEBUG),!1;for(c=b.length;c--;)if(d=b[c][a])return d;return dust.log("Malformed template `"+this.getTemplateName()+"` was missing one or more blocks."),!1},Context.prototype.shiftBlocks=function(a){var b,c=this.blocks;return a?(b=c?c.concat([a]):[a],new Context(this.stack,this.global,b,this.getTemplateName())):this},Context.prototype.resolve=function(a){var b;return"function"!=typeof a?a:(b=(new Chunk).render(a,this),b instanceof Chunk?b.data.join(""):b)},Context.prototype.getTemplateName=function(){return this.templateName},Stub.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.callback(a.error),dust.log("Rendering failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.out+=a.data.join(""),a=a.next,this.head=a}this.callback(null,this.out)},Stream.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.emit("error",a.error),this.emit("end"),dust.log("Streaming failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.emit("data",a.data.join("")),a=a.next,this.head=a}this.emit("end")},Stream.prototype.emit=function(a,b){var c,d,e=this.events||{},f=e[a]||[];if(!f.length)return dust.log("Stream broadcasting, but no listeners for `"+a+"`",DEBUG),!1;for(f=f.slice(0),c=0,d=f.length;d>c;c++)f[c](b);return!0},Stream.prototype.on=function(a,b){var c=this.events=this.events||{},d=c[a]=c[a]||[];return"function"!=typeof b?dust.log("No callback function provided for `"+a+"` event listener",WARN):d.push(b),this},Stream.prototype.pipe=function(a){if("function"!=typeof a.write||"function"!=typeof a.end)return dust.log("Incompatible stream passed to `pipe`",WARN),this;var b=!1;return"function"==typeof a.emit&&a.emit("pipe",this),"function"==typeof a.on&&a.on("error",function(){b=!0}),this.on("data",function(c){if(!b)try{a.write(c,"utf8")}catch(d){dust.log(d,ERROR)}}).on("end",function(){if(!b)try{a.end(),b=!0}catch(c){dust.log(c,ERROR)}})},Chunk.prototype.write=function(a){var b=this.taps;return b&&(a=b.go(a)),this.data.push(a),this},Chunk.prototype.end=function(a){return a&&this.write(a),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(a){var b=new Chunk(this.root,this.next,this.taps),c=new Chunk(this.root,b,this.taps);this.next=c,this.flushable=!0;try{a(c)}catch(d){dust.log(d,ERROR),c.setError(d)}return b},Chunk.prototype.tap=function(a){var b=this.taps;return this.taps=b?b.push(a):new Tap(a),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(a,b){return a(this,b)},Chunk.prototype.reference=function(a,b,c,d){return"function"==typeof a?(a=a.apply(b.current(),[this,b,null,{auto:c,filters:d}]),a instanceof Chunk?a:this.reference(a,b,c,d)):dust.isThenable(a)?this.await(a,b,null,c,d):dust.isStreamable(a)?this.stream(a,b,null,c,d):dust.isEmpty(a)?this:this.write(dust.filter(a,c,d))},Chunk.prototype.section=function(a,b,c,d){var e,f,g=c.block,h=c["else"],i=this;if("function"==typeof a&&!dust.isTemplateFn(a)){try{a=a.apply(b.current(),[this,b,c,d])}catch(j){return dust.log(j,ERROR),this.setError(j)}if(a instanceof Chunk)return a}if(dust.isEmptyObject(d)||(b=b.push(d)),dust.isArray(a)){if(g){if(f=a.length,f>0){for(b.stack.head&&(b.stack.head.$len=f),e=0;f>e;e++)b.stack.head&&(b.stack.head.$idx=e),i=g(i,b.push(a[e],e,f));return b.stack.head&&(b.stack.head.$idx=void 0,b.stack.head.$len=void 0),i}if(h)return h(this,b)}}else{if(dust.isThenable(a))return this.await(a,b,c);if(dust.isStreamable(a))return this.stream(a,b,c);if(a===!0){if(g)return g(this,b)}else if(a||0===a){if(g)return g(this,b.push(a))}else if(h)return h(this,b)}return dust.log("Section without corresponding key in template `"+b.getTemplateName()+"`",DEBUG),this},Chunk.prototype.exists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(e)return e(this,b)}else{if(d)return d(this,b);dust.log("No block for exists check in template `"+b.getTemplateName()+"`",DEBUG)}return this},Chunk.prototype.notexists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(d)return d(this,b);dust.log("No block for not-exists check in template `"+b.getTemplateName()+"`",DEBUG)}else if(e)return e(this,b);return this},Chunk.prototype.block=function(a,b,c){var d=a||c.block;return d?d(this,b):this},Chunk.prototype.partial=function(a,b,c,d){var e;return dust.isEmptyObject(d)||(c=c.clone(),e=c.pop(),c=c.push(d).push(e)),dust.isTemplateFn(a)?this.capture(a,b,function(a,b){c.templateName=a,load(a,b,c).end()}):(c.templateName=a,load(a,this,c))},Chunk.prototype.helper=function(a,b,c,d){var e,f=this;if(!dust.helpers[a])return dust.log("Helper `"+a+"` does not exist",WARN),f;try{return e=dust.helpers[a](f,b,c,d),dust.isThenable(e)?this.await(e,b,c):e}catch(g){return dust.log("Error in helper `"+a+"`: "+g.message,ERROR),f.setError(g)}},Chunk.prototype.await=function(a,b,c,d,e){var f=c&&c.block,g=c&&c.error;return this.map(function(c){a.then(function(a){f?c.render(f,b.push(a)).end():c.reference(a,b,d,e).end()},function(a){g?c.render(g,b.push(a)).end():(dust.log("Unhandled promise rejection in `"+b.getTemplateName()+"`"),c.end())})})},Chunk.prototype.stream=function(a,b,c,d,e){var f=c&&c.block,g=c&&c.error;return this.map(function(c){var h=!1;a.on("data",function(a){h||(c=f?c.map(function(c){c.render(f,b.push(a)).end()}):c.reference(a,b,d,e))}).on("error",function(a){h||(g?c.render(g,b.push(a)):dust.log("Unhandled stream error in `"+b.getTemplateName()+"`"),h||(h=!0,c.end()))}).on("end",function(){h||(h=!0,c.end())})})},Chunk.prototype.capture=function(a,b,c){return this.map(function(d){var e=new Stub(function(a,b){a?d.setError(a):c(b,d)});a(e.head,b).end()})},Chunk.prototype.setError=function(a){return this.error=a,this.root.flush(),this};for(var f in Chunk.prototype)dust._aliases[f]&&(Chunk.prototype[dust._aliases[f]]=Chunk.prototype[f]);Tap.prototype.push=function(a){return new Tap(a,this)},Tap.prototype.go=function(a){for(var b=this;b;)a=b.head(a),b=b.tail;return a};var HCHARS=/[&<>"']/,AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&amp;").replace(LT,"&lt;").replace(GT,"&gt;").replace(QUOT,"&quot;").replace(SQUOT,"&#39;"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),"function"==typeof define&&define.amd&&define.amd.dust===!0&&define(["require","dust.core"],function(require,dust){return dust.onLoad=function(a,b){require([a],function(){b()})},dust});

@@ -1,5 +0,6 @@

/*! Dust - Asynchronous Templating - v2.6.2
* http://linkedin.github.io/dustjs/
/*! dustjs-linkedin - v2.7.0
* http://dustjs.com/
* Copyright (c) 2015 Aleksander Williams; Released under the MIT License */
!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.core",[],b):"object"==typeof exports?module.exports=b():a.dust=b()}(this,function(){function Context(a,b,c,d){this.stack=a,this.global=b,this.blocks=c,this.templateName=d}function getWithResolvedData(a,b,c){return function(d){return a.push(d)._get(b,c)}}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function Tap(a,b){this.head=a,this.tail=b}var dust={version:"2.6.2"},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",EMPTY_FUNC=function(){};dust.config={whitespace:!1,amd:!1},dust._aliases={write:"w",end:"e",map:"m",render:"r",reference:"f",section:"s",exists:"x",notexists:"nx",block:"b",partial:"p",helper:"h"},function(){var a,b,c={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};"undefined"!=typeof console&&console.log?(a=console.log,b="function"==typeof a?function(){a.apply(console,arguments)}:function(){a(Array.prototype.slice.apply(arguments).join(" "))}):b=EMPTY_FUNC,dust.log=function(a,d){d=d||INFO,c[d]>=c[dust.debugLevel]&&b("[DUST:"+d+"]",a)},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(dust.cache[a]=b)},dust.render=function(a,b,c){var d=new Stub(c).head;try{dust.load(a,d,Context.wrap(b,a)).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{dust.load(a,c.head,Context.wrap(b,a)).end()}catch(e){d.setError(e)}}),c},dust.renderSource=function(a,b,c){return dust.compileFn(a)(b,c)},dust.compileFn=function(a,b){b=b||null;var c=dust.loadSource(dust.compile(a,b));return function(a,d){var e=d?new Stub(d):new Stream;return dust.nextTick(function(){"function"==typeof c?c(e.head,Context.wrap(a,b)).end():dust.log(new Error("Template `"+b+"` could not be loaded"),ERROR)}),e}},dust.load=function(a,b,c){var d=dust.cache[a];return d?d(b,c):dust.onLoad?b.map(function(b){dust.onLoad(a,function(d,e){return d?b.setError(d):(dust.cache[a]||dust.loadSource(dust.compile(e,a)),void dust.cache[a](b,c).end())})}):b.setError(new Error("Template Not Found: "+a))},dust.loadSource=function(source,path){return eval(source)},dust.isArray=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0===a?!1:dust.isArray(a)&&!a.length?!0:!a},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isThenable=function(a){return a&&"object"==typeof a&&"function"==typeof a.then},dust.filter=function(a,b,c){var d,e,f;if(c)for(d=0,e=c.length;e>d;d++)f=c[d],"s"===f?b=null:"function"==typeof dust.filters[f]?a=dust.filters[f](a):dust.log("Invalid filter `"+f+"`",WARN);return b&&(a=dust.filters[b](a)),a},dust.filters={h:function(a){return dust.escapeHtml(a)},j:function(a){return dust.escapeJs(a)},u:encodeURI,uc:encodeURIComponent,js:function(a){return dust.escapeJSON(a)},jp:function(a){return JSON?JSON.parse(a):(dust.log("JSON is undefined; could not parse `"+a+"`",WARN),a)}},dust.makeBase=function(a){return new Context(new Stack,a)},Context.wrap=function(a,b){return a instanceof Context?a:new Context(new Stack(a),{},null,b)},Context.prototype.get=function(a,b){return"string"==typeof a&&("."===a[0]&&(b=!0,a=a.substr(1)),a=a.split(".")),this._get(b,a)},Context.prototype._get=function(a,b){var c,d,e,f,g,h=this.stack||{},i=1;if(d=b[0],e=b.length,a&&0===e)f=h,h=h.head;else{if(a)h&&(h=h.head?h.head[d]:void 0);else{for(;h&&(!h.isObject||(f=h.head,c=h.head[d],void 0===c));)h=h.tail;h=void 0!==c?c:this.global?this.global[d]:void 0}for(;h&&e>i;){if(dust.isThenable(h))return h.then(getWithResolvedData(this,a,b.slice(i)));f=h,h=h[b[i]],i++}}return"function"==typeof h?(g=function(){try{return h.apply(f,arguments)}catch(a){throw dust.log(a,ERROR),a}},g.__dustBody=!!h.__dustBody,g):(void 0===h&&dust.log("Cannot find reference `{"+b.join(".")+"}` in template `"+this.getTemplateName()+"`",INFO),h)},Context.prototype.getPath=function(a,b){return this._get(a,b)},Context.prototype.push=function(a,b,c){return new Context(new Stack(a,this.stack,b,c),this.global,this.blocks,this.getTemplateName())},Context.prototype.pop=function(){var a=this.current();return this.stack=this.stack&&this.stack.tail,a},Context.prototype.rebase=function(a){return new Context(new Stack(a),this.global,this.blocks,this.getTemplateName())},Context.prototype.clone=function(){var a=this.rebase();return a.stack=this.stack,a},Context.prototype.current=function(){return this.stack&&this.stack.head},Context.prototype.getBlock=function(a){var b,c,d;if("function"==typeof a&&(a=a(new Chunk,this).data.join("")),b=this.blocks,!b)return dust.log("No blocks for context `"+a+"` in template `"+this.getTemplateName()+"`",DEBUG),!1;for(c=b.length;c--;)if(d=b[c][a])return d;return dust.log("Malformed template `"+this.getTemplateName()+"` was missing one or more blocks."),!1},Context.prototype.shiftBlocks=function(a){var b,c=this.blocks;return a?(b=c?c.concat([a]):[a],new Context(this.stack,this.global,b,this.getTemplateName())):this},Context.prototype.resolve=function(a){var b;return"function"!=typeof a?a:(b=(new Chunk).render(a,this),a.__dustBody?b.data.join(""):b)},Context.prototype.getTemplateName=function(){return this.templateName},Stub.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.callback(a.error),dust.log("Rendering failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.out+=a.data.join(""),a=a.next,this.head=a}this.callback(null,this.out)},Stream.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.emit("error",a.error),dust.log("Streaming failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.emit("data",a.data.join("")),a=a.next,this.head=a}this.emit("end")},Stream.prototype.emit=function(a,b){var c,d,e=this.events||{},f=e[a]||[];if(!f.length)return void dust.log("Stream broadcasting, but no listeners for `"+a+"`",DEBUG);for(f=f.slice(0),c=0,d=f.length;d>c;c++)f[c](b)},Stream.prototype.on=function(a,b){var c=this.events=this.events||{},d=c[a]=c[a]||[];return"function"!=typeof b?dust.log("No callback function provided for `"+a+"` event listener",WARN):d.push(b),this},Stream.prototype.pipe=function(a){return this.on("data",function(b){try{a.write(b,"utf8")}catch(c){dust.log(c,ERROR)}}).on("end",function(){try{a.end()}catch(b){dust.log(b,ERROR)}}).on("error",function(b){a.error(b)})},Chunk.prototype.write=function(a){var b=this.taps;return b&&(a=b.go(a)),this.data.push(a),this},Chunk.prototype.end=function(a){return a&&this.write(a),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(a){var b=new Chunk(this.root,this.next,this.taps),c=new Chunk(this.root,b,this.taps);this.next=c,this.flushable=!0;try{a(c)}catch(d){dust.log(d,ERROR),c.setError(d)}return b},Chunk.prototype.tap=function(a){var b=this.taps;return this.taps=b?b.push(a):new Tap(a),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(a,b){return a(this,b)},Chunk.prototype.reference=function(a,b,c,d){return"function"==typeof a&&(a=a.apply(b.current(),[this,b,null,{auto:c,filters:d}]),a instanceof Chunk)?a:dust.isThenable(a)?this.await(a,b):dust.isEmpty(a)?this:this.write(dust.filter(a,c,d))},Chunk.prototype.section=function(a,b,c,d){var e,f,g=c.block,h=c["else"],i=this;if("function"==typeof a&&!a.__dustBody){try{a=a.apply(b.current(),[this,b,c,d])}catch(j){return dust.log(j,ERROR),this.setError(j)}if(a instanceof Chunk)return a}if(dust.isEmptyObject(d)||(b=b.push(d)),dust.isArray(a)){if(g){if(f=a.length,f>0){for(b.stack.head&&(b.stack.head.$len=f),e=0;f>e;e++)b.stack.head&&(b.stack.head.$idx=e),i=g(i,b.push(a[e],e,f));return b.stack.head&&(b.stack.head.$idx=void 0,b.stack.head.$len=void 0),i}if(h)return h(this,b)}}else{if(dust.isThenable(a))return this.await(a,b,c);if(a===!0){if(g)return g(this,b)}else if(a||0===a){if(g)return g(this,b.push(a))}else if(h)return h(this,b)}return dust.log("Section without corresponding key in template `"+b.getTemplateName()+"`",DEBUG),this},Chunk.prototype.exists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(e)return e(this,b)}else{if(d)return d(this,b);dust.log("No block for exists check in template `"+b.getTemplateName()+"`",DEBUG)}return this},Chunk.prototype.notexists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(d)return d(this,b);dust.log("No block for not-exists check in template `"+b.getTemplateName()+"`",DEBUG)}else if(e)return e(this,b);return this},Chunk.prototype.block=function(a,b,c){var d=a||c.block;return d?d(this,b):this},Chunk.prototype.partial=function(a,b,c){var d;return dust.isEmptyObject(c)||(b=b.clone(),d=b.pop(),b=b.push(c).push(d)),a.__dustBody?this.capture(a,b,function(a,c){b.templateName=a,dust.load(a,c,b).end()}):(b.templateName=a,dust.load(a,this,b))},Chunk.prototype.helper=function(a,b,c,d){var e,f=this;if(!dust.helpers[a])return dust.log("Helper `"+a+"` does not exist",WARN),f;try{return e=dust.helpers[a](f,b,c,d),dust.isThenable(e)?this.await(e,b,c):e}catch(g){return dust.log("Error in helper `"+a+"`: "+g.message,ERROR),f.setError(g)}},Chunk.prototype.await=function(a,b,c){var d=c&&c.block,e=c&&c.error;return this.map(function(c){a.then(function(a){d?c.render(d,b.push(a)).end():c.end(a)},function(a){e?c.render(e,b.push(a)).end():(dust.log("Unhandled promise rejection in `"+b.getTemplateName()+"`"),c.end())})})},Chunk.prototype.capture=function(a,b,c){return this.map(function(d){var e=new Stub(function(a,b){a?d.setError(a):c(b,d)});a(e.head,b).end()})},Chunk.prototype.setError=function(a){return this.error=a,this.root.flush(),this};for(var f in Chunk.prototype)dust._aliases[f]&&(Chunk.prototype[dust._aliases[f]]=Chunk.prototype[f]);Tap.prototype.push=function(a){return new Tap(a,this)},Tap.prototype.go=function(a){for(var b=this;b;)a=b.head(a),b=b.tail;return a};var HCHARS=/[&<>"']/,AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&amp;").replace(LT,"&lt;").replace(GT,"&gt;").replace(QUOT,"&quot;").replace(SQUOT,"&#39;"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.parse",["dust.core"],function(dust){return b(dust).parse}):"object"==typeof exports?module.exports=b(require("./dust")):b(a.dust)}(this,function(dust){var a=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(){return f(ud).line}function d(){return f(ud).column}function e(a){throw h(a,null,ud)}function f(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return vd!==b&&(vd>b&&(vd=0,wd={line:1,column:1,seenCR:!1}),c(wd,vd,b),vd=b),wd}function g(a){xd>td||(td>xd&&(xd=td,yd=[]),yd.push(a))}function h(c,d,e){function g(a){var b=1;for(a.sort(function(a,b){return a.description<b.description?-1:a.description>b.description?1:0});b<a.length;)a[b-1]===a[b]?a.splice(b,1):b++}function h(a,b){function c(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}var d,e,f,g=new Array(a.length);for(f=0;f<a.length;f++)g[f]=a[f].description;return d=a.length>1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=f(e),j=e<a.length?a.charAt(e):null;return null!==d&&g(d),new b(null!==c?c:h(d,j),d,j,e,i.line,i.column)}function i(){var a;return a=j()}function j(){var a,b,c;for(a=td,b=[],c=k();c!==V;)b.push(c),c=k();return b!==V&&(ud=a,b=Y(b)),a=b}function k(){var a;return a=K(),a===V&&(a=L(),a===V&&(a=l(),a===V&&(a=s(),a===V&&(a=u(),a===V&&(a=r(),a===V&&(a=H())))))),a}function l(){var b,c,d,e,f,h,i,k;if(zd++,b=td,c=m(),c!==V){for(d=[],e=S();e!==V;)d.push(e),e=S();d!==V?(e=O(),e!==V?(f=j(),f!==V?(h=q(),h!==V?(i=n(),i===V&&(i=_),i!==V?(ud=td,k=ab(c,f,h,i),k=k?bb:$,k!==V?(ud=b,c=cb(c,f,h,i),b=c):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;if(b===V)if(b=td,c=m(),c!==V){for(d=[],e=S();e!==V;)d.push(e),e=S();d!==V?(47===a.charCodeAt(td)?(e=db,td++):(e=V,0===zd&&g(eb)),e!==V?(f=O(),f!==V?(ud=b,c=fb(c),b=c):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(Z)),b}function m(){var b,c,d,e,f,h,i;if(b=td,c=N(),c!==V)if(gb.test(a.charAt(td))?(d=a.charAt(td),td++):(d=V,0===zd&&g(hb)),d!==V){for(e=[],f=S();f!==V;)e.push(f),f=S();e!==V?(f=v(),f!==V?(h=o(),h!==V?(i=p(),i!==V?(ud=b,c=ib(d,f,h,i),b=c):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;else td=b,b=$;return b}function n(){var b,c,d,e,f,h,i;if(zd++,b=td,c=N(),c!==V)if(47===a.charCodeAt(td)?(d=db,td++):(d=V,0===zd&&g(eb)),d!==V){for(e=[],f=S();f!==V;)e.push(f),f=S();if(e!==V)if(f=v(),f!==V){for(h=[],i=S();i!==V;)h.push(i),i=S();h!==V?(i=O(),i!==V?(ud=b,c=kb(f),b=c):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;else td=b,b=$}else td=b,b=$;else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(jb)),b}function o(){var b,c,d,e;return b=td,c=td,58===a.charCodeAt(td)?(d=lb,td++):(d=V,0===zd&&g(mb)),d!==V?(e=v(),e!==V?(ud=c,d=nb(e),c=d):(td=c,c=$)):(td=c,c=$),c===V&&(c=_),c!==V&&(ud=b,c=ob(c)),b=c}function p(){var b,c,d,e,f,h,i;if(zd++,b=td,c=[],d=td,e=[],f=S(),f!==V)for(;f!==V;)e.push(f),f=S();else e=$;for(e!==V?(f=C(),f!==V?(61===a.charCodeAt(td)?(h=qb,td++):(h=V,0===zd&&g(rb)),h!==V?(i=w(),i===V&&(i=v(),i===V&&(i=F())),i!==V?(ud=d,e=sb(f,i),d=e):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$);d!==V;){if(c.push(d),d=td,e=[],f=S(),f!==V)for(;f!==V;)e.push(f),f=S();else e=$;e!==V?(f=C(),f!==V?(61===a.charCodeAt(td)?(h=qb,td++):(h=V,0===zd&&g(rb)),h!==V?(i=w(),i===V&&(i=v(),i===V&&(i=F())),i!==V?(ud=d,e=sb(f,i),d=e):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)}return c!==V&&(ud=b,c=tb(c)),b=c,zd--,b===V&&(c=V,0===zd&&g(pb)),b}function q(){var b,c,d,e,f,h,i,k;for(zd++,b=td,c=[],d=td,e=N(),e!==V?(58===a.charCodeAt(td)?(f=lb,td++):(f=V,0===zd&&g(mb)),f!==V?(h=C(),h!==V?(i=O(),i!==V?(k=j(),k!==V?(ud=d,e=sb(h,k),d=e):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$);d!==V;)c.push(d),d=td,e=N(),e!==V?(58===a.charCodeAt(td)?(f=lb,td++):(f=V,0===zd&&g(mb)),f!==V?(h=C(),h!==V?(i=O(),i!==V?(k=j(),k!==V?(ud=d,e=sb(h,k),d=e):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$);return c!==V&&(ud=b,c=vb(c)),b=c,zd--,b===V&&(c=V,0===zd&&g(ub)),b}function r(){var a,b,c,d,e;return zd++,a=td,b=N(),b!==V?(c=v(),c!==V?(d=t(),d!==V?(e=O(),e!==V?(ud=a,b=xb(c,d),a=b):(td=a,a=$)):(td=a,a=$)):(td=a,a=$)):(td=a,a=$),zd--,a===V&&(b=V,0===zd&&g(wb)),a}function s(){var b,c,d,e,f,h,i,j,k,l;if(zd++,b=td,c=N(),c!==V)if(62===a.charCodeAt(td)?(d=zb,td++):(d=V,0===zd&&g(Ab)),d===V&&(43===a.charCodeAt(td)?(d=Bb,td++):(d=V,0===zd&&g(Cb))),d!==V){for(e=[],f=S();f!==V;)e.push(f),f=S();if(e!==V)if(f=td,h=C(),h!==V&&(ud=f,h=Db(h)),f=h,f===V&&(f=F()),f!==V)if(h=o(),h!==V)if(i=p(),i!==V){for(j=[],k=S();k!==V;)j.push(k),k=S();j!==V?(47===a.charCodeAt(td)?(k=db,td++):(k=V,0===zd&&g(eb)),k!==V?(l=O(),l!==V?(ud=b,c=Eb(d,f,h,i),b=c):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;else td=b,b=$;else td=b,b=$;else td=b,b=$}else td=b,b=$;else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(yb)),b}function t(){var b,c,d,e,f;for(zd++,b=td,c=[],d=td,124===a.charCodeAt(td)?(e=Gb,td++):(e=V,0===zd&&g(Hb)),e!==V?(f=C(),f!==V?(ud=d,e=nb(f),d=e):(td=d,d=$)):(td=d,d=$);d!==V;)c.push(d),d=td,124===a.charCodeAt(td)?(e=Gb,td++):(e=V,0===zd&&g(Hb)),e!==V?(f=C(),f!==V?(ud=d,e=nb(f),d=e):(td=d,d=$)):(td=d,d=$);return c!==V&&(ud=b,c=Ib(c)),b=c,zd--,b===V&&(c=V,0===zd&&g(Fb)),b}function u(){var b,c,d,e,f;return zd++,b=td,c=N(),c!==V?(126===a.charCodeAt(td)?(d=Kb,td++):(d=V,0===zd&&g(Lb)),d!==V?(e=C(),e!==V?(f=O(),f!==V?(ud=b,c=Mb(e),b=c):(td=b,b=$)):(td=b,b=$)):(td=b,b=$)):(td=b,b=$),zd--,b===V&&(c=V,0===zd&&g(Jb)),b}function v(){var a,b;return zd++,a=td,b=B(),b!==V&&(ud=a,b=Ob(b)),a=b,a===V&&(a=td,b=C(),b!==V&&(ud=a,b=Pb(b)),a=b),zd--,a===V&&(b=V,0===zd&&g(Nb)),a}function w(){var a,b;return zd++,a=td,b=x(),b===V&&(b=A()),b!==V&&(ud=a,b=Rb(b)),a=b,zd--,a===V&&(b=V,0===zd&&g(Qb)),a}function x(){var b,c,d,e;return zd++,b=td,c=A(),c!==V?(46===a.charCodeAt(td)?(d=Tb,td++):(d=V,0===zd&&g(Ub)),d!==V?(e=y(),e!==V?(ud=b,c=Vb(c,e),b=c):(td=b,b=$)):(td=b,b=$)):(td=b,b=$),zd--,b===V&&(c=V,0===zd&&g(Sb)),b}function y(){var b,c,d;if(zd++,b=td,c=[],Xb.test(a.charAt(td))?(d=a.charAt(td),td++):(d=V,0===zd&&g(Yb)),d!==V)for(;d!==V;)c.push(d),Xb.test(a.charAt(td))?(d=a.charAt(td),td++):(d=V,0===zd&&g(Yb));else c=$;return c!==V&&(ud=b,c=Zb(c)),b=c,zd--,b===V&&(c=V,0===zd&&g(Wb)),b}function z(){var b,c,d;return zd++,b=td,45===a.charCodeAt(td)?(c=_b,td++):(c=V,0===zd&&g(ac)),c!==V?(d=y(),d!==V?(ud=b,c=bc(c,d),b=c):(td=b,b=$)):(td=b,b=$),zd--,b===V&&(c=V,0===zd&&g($b)),b}function A(){var a,b;return zd++,a=z(),a===V&&(a=y()),zd--,a===V&&(b=V,0===zd&&g(cc)),a}function B(){var b,c,d,e;if(zd++,b=td,c=C(),c===V&&(c=_),c!==V){if(d=[],e=E(),e===V&&(e=D()),e!==V)for(;e!==V;)d.push(e),e=E(),e===V&&(e=D());else d=$;d!==V?(ud=b,c=ec(c,d),b=c):(td=b,b=$)}else td=b,b=$;if(b===V)if(b=td,46===a.charCodeAt(td)?(c=Tb,td++):(c=V,0===zd&&g(Ub)),c!==V){for(d=[],e=E(),e===V&&(e=D());e!==V;)d.push(e),e=E(),e===V&&(e=D());d!==V?(ud=b,c=fc(d),b=c):(td=b,b=$)}else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(dc)),b}function C(){var b,c,d,e;if(zd++,b=td,hc.test(a.charAt(td))?(c=a.charAt(td),td++):(c=V,0===zd&&g(ic)),c!==V){for(d=[],jc.test(a.charAt(td))?(e=a.charAt(td),td++):(e=V,0===zd&&g(kc));e!==V;)d.push(e),jc.test(a.charAt(td))?(e=a.charAt(td),td++):(e=V,0===zd&&g(kc));d!==V?(ud=b,c=lc(c,d),b=c):(td=b,b=$)}else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(gc)),b}function D(){var b,c,d,e,f,h;if(zd++,b=td,c=td,d=P(),d!==V){if(e=td,f=[],Xb.test(a.charAt(td))?(h=a.charAt(td),td++):(h=V,0===zd&&g(Yb)),h!==V)for(;h!==V;)f.push(h),Xb.test(a.charAt(td))?(h=a.charAt(td),td++):(h=V,0===zd&&g(Yb));else f=$;f!==V&&(ud=e,f=nc(f)),e=f,e===V&&(e=v()),e!==V?(f=Q(),f!==V?(ud=c,d=oc(e),c=d):(td=c,c=$)):(td=c,c=$)}else td=c,c=$;return c!==V?(d=E(),d===V&&(d=_),d!==V?(ud=b,c=pc(c,d),b=c):(td=b,b=$)):(td=b,b=$),zd--,b===V&&(c=V,0===zd&&g(mc)),b}function E(){var b,c,d,e,f;if(zd++,b=td,c=[],d=td,46===a.charCodeAt(td)?(e=Tb,td++):(e=V,0===zd&&g(Ub)),e!==V?(f=C(),f!==V?(ud=d,e=rc(f),d=e):(td=d,d=$)):(td=d,d=$),d!==V)for(;d!==V;)c.push(d),d=td,46===a.charCodeAt(td)?(e=Tb,td++):(e=V,0===zd&&g(Ub)),e!==V?(f=C(),f!==V?(ud=d,e=rc(f),d=e):(td=d,d=$)):(td=d,d=$);else c=$;return c!==V?(d=D(),d===V&&(d=_),d!==V?(ud=b,c=sc(c,d),b=c):(td=b,b=$)):(td=b,b=$),zd--,b===V&&(c=V,0===zd&&g(qc)),b}function F(){var b,c,d,e;if(zd++,b=td,34===a.charCodeAt(td)?(c=uc,td++):(c=V,0===zd&&g(vc)),c!==V?(34===a.charCodeAt(td)?(d=uc,td++):(d=V,0===zd&&g(vc)),d!==V?(ud=b,c=wc(),b=c):(td=b,b=$)):(td=b,b=$),b===V&&(b=td,34===a.charCodeAt(td)?(c=uc,td++):(c=V,0===zd&&g(vc)),c!==V?(d=I(),d!==V?(34===a.charCodeAt(td)?(e=uc,td++):(e=V,0===zd&&g(vc)),e!==V?(ud=b,c=xc(d),b=c):(td=b,b=$)):(td=b,b=$)):(td=b,b=$),b===V))if(b=td,34===a.charCodeAt(td)?(c=uc,td++):(c=V,0===zd&&g(vc)),c!==V){if(d=[],e=G(),e!==V)for(;e!==V;)d.push(e),e=G();else d=$;d!==V?(34===a.charCodeAt(td)?(e=uc,td++):(e=V,0===zd&&g(vc)),e!==V?(ud=b,c=yc(d),b=c):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(tc)),b}function G(){var a,b;return a=u(),a===V&&(a=r(),a===V&&(a=td,b=I(),b!==V&&(ud=a,b=zc(b)),a=b)),a}function H(){var b,c,d,e,f,h,i,j;if(zd++,b=td,c=R(),c!==V){for(d=[],e=S();e!==V;)d.push(e),e=S();d!==V?(ud=b,c=Bc(c,d),b=c):(td=b,b=$)}else td=b,b=$;if(b===V){if(b=td,c=[],d=td,e=td,zd++,f=M(),zd--,f===V?e=bb:(td=e,e=$),e!==V?(f=td,zd++,h=K(),zd--,h===V?f=bb:(td=f,f=$),f!==V?(h=td,zd++,i=L(),zd--,i===V?h=bb:(td=h,h=$),h!==V?(i=td,zd++,j=R(),zd--,j===V?i=bb:(td=i,i=$),i!==V?(a.length>td?(j=a.charAt(td),td++):(j=V,0===zd&&g(Cc)),j!==V?(ud=d,e=Dc(j),d=e):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$),d!==V)for(;d!==V;)c.push(d),d=td,e=td,zd++,f=M(),zd--,f===V?e=bb:(td=e,e=$),e!==V?(f=td,zd++,h=K(),zd--,h===V?f=bb:(td=f,f=$),f!==V?(h=td,zd++,i=L(),zd--,i===V?h=bb:(td=h,h=$),h!==V?(i=td,zd++,j=R(),zd--,j===V?i=bb:(td=i,i=$),i!==V?(a.length>td?(j=a.charAt(td),td++):(j=V,0===zd&&g(Cc)),j!==V?(ud=d,e=Dc(j),d=e):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$)):(td=d,d=$);else c=$;c!==V&&(ud=b,c=Ec(c)),b=c}return zd--,b===V&&(c=V,0===zd&&g(Ac)),b}function I(){var b,c,d,e,f;if(zd++,b=td,c=[],d=td,e=td,zd++,f=M(),zd--,f===V?e=bb:(td=e,e=$),e!==V?(f=J(),f===V&&(Gc.test(a.charAt(td))?(f=a.charAt(td),td++):(f=V,0===zd&&g(Hc))),f!==V?(ud=d,e=Dc(f),d=e):(td=d,d=$)):(td=d,d=$),d!==V)for(;d!==V;)c.push(d),d=td,e=td,zd++,f=M(),zd--,f===V?e=bb:(td=e,e=$),e!==V?(f=J(),f===V&&(Gc.test(a.charAt(td))?(f=a.charAt(td),td++):(f=V,0===zd&&g(Hc))),f!==V?(ud=d,e=Dc(f),d=e):(td=d,d=$)):(td=d,d=$);else c=$;return c!==V&&(ud=b,c=Ic(c)),b=c,zd--,b===V&&(c=V,0===zd&&g(Fc)),b}function J(){var b,c;return b=td,a.substr(td,2)===Jc?(c=Jc,td+=2):(c=V,0===zd&&g(Kc)),c!==V&&(ud=b,c=Lc()),b=c}function K(){var b,c,d,e,f,h;if(zd++,b=td,a.substr(td,2)===Nc?(c=Nc,td+=2):(c=V,0===zd&&g(Oc)),c!==V){for(d=[],e=td,f=td,zd++,a.substr(td,2)===Pc?(h=Pc,td+=2):(h=V,0===zd&&g(Qc)),zd--,h===V?f=bb:(td=f,f=$),f!==V?(a.length>td?(h=a.charAt(td),td++):(h=V,0===zd&&g(Cc)),h!==V?(ud=e,f=Rc(h),e=f):(td=e,e=$)):(td=e,e=$);e!==V;)d.push(e),e=td,f=td,zd++,a.substr(td,2)===Pc?(h=Pc,td+=2):(h=V,0===zd&&g(Qc)),zd--,h===V?f=bb:(td=f,f=$),f!==V?(a.length>td?(h=a.charAt(td),td++):(h=V,0===zd&&g(Cc)),h!==V?(ud=e,f=Rc(h),e=f):(td=e,e=$)):(td=e,e=$);d!==V?(a.substr(td,2)===Pc?(e=Pc,td+=2):(e=V,0===zd&&g(Qc)),e!==V?(ud=b,c=Sc(d),b=c):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(Mc)),b}function L(){var b,c,d,e,f,h;if(zd++,b=td,a.substr(td,2)===Uc?(c=Uc,td+=2):(c=V,0===zd&&g(Vc)),c!==V){for(d=[],e=td,f=td,zd++,a.substr(td,2)===Wc?(h=Wc,td+=2):(h=V,0===zd&&g(Xc)),zd--,h===V?f=bb:(td=f,f=$),f!==V?(a.length>td?(h=a.charAt(td),td++):(h=V,0===zd&&g(Cc)),h!==V?(ud=e,f=Dc(h),e=f):(td=e,e=$)):(td=e,e=$);e!==V;)d.push(e),e=td,f=td,zd++,a.substr(td,2)===Wc?(h=Wc,td+=2):(h=V,0===zd&&g(Xc)),zd--,h===V?f=bb:(td=f,f=$),f!==V?(a.length>td?(h=a.charAt(td),td++):(h=V,0===zd&&g(Cc)),h!==V?(ud=e,f=Dc(h),e=f):(td=e,e=$)):(td=e,e=$);d!==V?(a.substr(td,2)===Wc?(e=Wc,td+=2):(e=V,0===zd&&g(Xc)),e!==V?(ud=b,c=Yc(d),b=c):(td=b,b=$)):(td=b,b=$)}else td=b,b=$;return zd--,b===V&&(c=V,0===zd&&g(Tc)),b}function M(){var b,c,d,e,f,h,i,j,k,l;if(b=td,c=N(),c!==V){for(d=[],e=S();e!==V;)d.push(e),e=S();if(d!==V)if(Zc.test(a.charAt(td))?(e=a.charAt(td),td++):(e=V,0===zd&&g($c)),e!==V){for(f=[],h=S();h!==V;)f.push(h),h=S();if(f!==V){if(h=[],i=td,j=td,zd++,k=O(),zd--,k===V?j=bb:(td=j,j=$),j!==V?(k=td,zd++,l=R(),zd--,l===V?k=bb:(td=k,k=$),k!==V?(a.length>td?(l=a.charAt(td),td++):(l=V,0===zd&&g(Cc)),l!==V?(j=[j,k,l],i=j):(td=i,i=$)):(td=i,i=$)):(td=i,i=$),i!==V)for(;i!==V;)h.push(i),i=td,j=td,zd++,k=O(),zd--,k===V?j=bb:(td=j,j=$),j!==V?(k=td,zd++,l=R(),zd--,l===V?k=bb:(td=k,k=$),k!==V?(a.length>td?(l=a.charAt(td),td++):(l=V,0===zd&&g(Cc)),l!==V?(j=[j,k,l],i=j):(td=i,i=$)):(td=i,i=$)):(td=i,i=$);else h=$;if(h!==V){for(i=[],j=S();j!==V;)i.push(j),j=S();i!==V?(j=O(),j!==V?(c=[c,d,e,f,h,i,j],b=c):(td=b,b=$)):(td=b,b=$)}else td=b,b=$}else td=b,b=$}else td=b,b=$;else td=b,b=$}else td=b,b=$;return b===V&&(b=r()),b}function N(){var b;return 123===a.charCodeAt(td)?(b=_c,td++):(b=V,0===zd&&g(ad)),b}function O(){var b;return 125===a.charCodeAt(td)?(b=bd,td++):(b=V,0===zd&&g(cd)),b}function P(){var b;return 91===a.charCodeAt(td)?(b=dd,td++):(b=V,0===zd&&g(ed)),b}function Q(){var b;return 93===a.charCodeAt(td)?(b=fd,td++):(b=V,0===zd&&g(gd)),b}function R(){var b;return 10===a.charCodeAt(td)?(b=hd,td++):(b=V,0===zd&&g(id)),b===V&&(a.substr(td,2)===jd?(b=jd,td+=2):(b=V,0===zd&&g(kd)),b===V&&(13===a.charCodeAt(td)?(b=ld,td++):(b=V,0===zd&&g(md)),b===V&&(8232===a.charCodeAt(td)?(b=nd,td++):(b=V,0===zd&&g(od)),b===V&&(8233===a.charCodeAt(td)?(b=pd,td++):(b=V,0===zd&&g(qd)))))),b}function S(){var b;return rd.test(a.charAt(td))?(b=a.charAt(td),td++):(b=V,0===zd&&g(sd)),b===V&&(b=R()),b}var T,U=arguments.length>1?arguments[1]:{},V={},W={start:i},X=i,Y=function(a){return["body"].concat(a).concat([["line",c()],["col",d()]])},Z={type:"other",description:"section"},$=V,_=null,ab=function(a,b,c,d){return d&&a[1].text===d.text||e("Expected end tag for "+a[1].text+" but it was not found."),!0},bb=void 0,cb=function(a,b,e){return e.push(["param",["literal","block"],b]),a.push(e),a.concat([["line",c()],["col",d()]])},db="/",eb={type:"literal",value:"/",description:'"/"'},fb=function(a){return a.push(["bodies"]),a.concat([["line",c()],["col",d()]])},gb=/^[#?\^<+@%]/,hb={type:"class",value:"[#?\\^<+@%]",description:"[#?\\^<+@%]"},ib=function(a,b,c,d){return[a,b,c,d]},jb={type:"other",description:"end tag"},kb=function(a){return a},lb=":",mb={type:"literal",value:":",description:'":"'},nb=function(a){return a},ob=function(a){return a?["context",a]:["context"]},pb={type:"other",description:"params"},qb="=",rb={type:"literal",value:"=",description:'"="'},sb=function(a,b){return["param",["literal",a],b]},tb=function(a){return["params"].concat(a)},ub={type:"other",description:"bodies"},vb=function(a){return["bodies"].concat(a)},wb={type:"other",description:"reference"},xb=function(a,b){return["reference",a,b].concat([["line",c()],["col",d()]])},yb={type:"other",description:"partial"},zb=">",Ab={type:"literal",value:">",description:'">"'},Bb="+",Cb={type:"literal",value:"+",description:'"+"'},Db=function(a){return["literal",a]},Eb=function(a,b,e,f){var g=">"===a?"partial":a;return[g,b,e,f].concat([["line",c()],["col",d()]])},Fb={type:"other",description:"filters"},Gb="|",Hb={type:"literal",value:"|",description:'"|"'},Ib=function(a){return["filters"].concat(a)},Jb={type:"other",description:"special"},Kb="~",Lb={type:"literal",value:"~",description:'"~"'},Mb=function(a){return["special",a].concat([["line",c()],["col",d()]])},Nb={type:"other",description:"identifier"},Ob=function(a){var b=["path"].concat(a);return b.text=a[1].join(".").replace(/,line,\d+,col,\d+/g,""),b},Pb=function(a){var b=["key",a];return b.text=a,b},Qb={type:"other",description:"number"},Rb=function(a){return["literal",a]},Sb={type:"other",description:"float"},Tb=".",Ub={type:"literal",value:".",description:'"."'},Vb=function(a,b){return parseFloat(a+"."+b)},Wb={type:"other",description:"unsigned_integer"},Xb=/^[0-9]/,Yb={type:"class",value:"[0-9]",description:"[0-9]"},Zb=function(a){return parseInt(a.join(""),10)},$b={type:"other",description:"signed_integer"},_b="-",ac={type:"literal",value:"-",description:'"-"'},bc=function(a,b){return-1*b},cc={type:"other",description:"integer"},dc={type:"other",description:"path"},ec=function(a,b){return b=b[0],a&&b?(b.unshift(a),[!1,b].concat([["line",c()],["col",d()]])):[!0,b].concat([["line",c()],["col",d()]])},fc=function(a){return a.length>0?[!0,a[0]].concat([["line",c()],["col",d()]]):[!0,[]].concat([["line",c()],["col",d()]])},gc={type:"other",description:"key"},hc=/^[a-zA-Z_$]/,ic={type:"class",value:"[a-zA-Z_$]",description:"[a-zA-Z_$]"},jc=/^[0-9a-zA-Z_$\-]/,kc={type:"class",value:"[0-9a-zA-Z_$\\-]",description:"[0-9a-zA-Z_$\\-]"},lc=function(a,b){return a+b.join("")},mc={type:"other",description:"array"},nc=function(a){return a.join("")},oc=function(a){return a},pc=function(a,b){return b?b.unshift(a):b=[a],b},qc={type:"other",description:"array_part"},rc=function(a){return a},sc=function(a,b){return b?a.concat(b):a},tc={type:"other",description:"inline"},uc='"',vc={type:"literal",value:'"',description:'"\\""'},wc=function(){return["literal",""].concat([["line",c()],["col",d()]])},xc=function(a){return["literal",a].concat([["line",c()],["col",d()]])},yc=function(a){return["body"].concat(a).concat([["line",c()],["col",d()]])},zc=function(a){return["buffer",a]},Ac={type:"other",description:"buffer"},Bc=function(a,b){return["format",a,b.join("")].concat([["line",c()],["col",d()]])},Cc={type:"any",description:"any character"},Dc=function(a){return a},Ec=function(a){return["buffer",a.join("")].concat([["line",c()],["col",d()]])},Fc={type:"other",description:"literal"},Gc=/^[^"]/,Hc={type:"class",value:'[^"]',description:'[^"]'},Ic=function(a){return a.join("")},Jc='\\"',Kc={type:"literal",value:'\\"',description:'"\\\\\\""'},Lc=function(){return'"'},Mc={type:"other",description:"raw"},Nc="{`",Oc={type:"literal",value:"{`",description:'"{`"'},Pc="`}",Qc={type:"literal",value:"`}",description:'"`}"'},Rc=function(a){return a},Sc=function(a){return["raw",a.join("")].concat([["line",c()],["col",d()]])},Tc={type:"other",description:"comment"},Uc="{!",Vc={type:"literal",value:"{!",description:'"{!"'},Wc="!}",Xc={type:"literal",value:"!}",description:'"!}"'},Yc=function(a){return["comment",a.join("")].concat([["line",c()],["col",d()]])},Zc=/^[#?\^><+%:@\/~%]/,$c={type:"class",value:"[#?\\^><+%:@\\/~%]",description:"[#?\\^><+%:@\\/~%]"},_c="{",ad={type:"literal",value:"{",description:'"{"'},bd="}",cd={type:"literal",value:"}",description:'"}"'},dd="[",ed={type:"literal",value:"[",description:'"["'},fd="]",gd={type:"literal",value:"]",description:'"]"'},hd="\n",id={type:"literal",value:"\n",description:'"\\n"'},jd="\r\n",kd={type:"literal",value:"\r\n",description:'"\\r\\n"'},ld="\r",md={type:"literal",value:"\r",description:'"\\r"'},nd="\u2028",od={type:"literal",value:"\u2028",description:'"\\u2028"'},pd="\u2029",qd={type:"literal",value:"\u2029",description:'"\\u2029"'},rd=/^[\t\x0B\f \xA0\uFEFF]/,sd={type:"class",value:"[\\t\\x0B\\f \\xA0\\uFEFF]",description:"[\\t\\x0B\\f \\xA0\\uFEFF]"},td=0,ud=0,vd=0,wd={line:1,column:1,seenCR:!1},xd=0,yd=[],zd=0;if("startRule"in U){if(!(U.startRule in W))throw new Error("Can't start parsing from rule \""+U.startRule+'".');X=W[U.startRule]}if(T=X(),T!==V&&td===a.length)return T;throw T!==V&&td<a.length&&g({type:"end",description:"end of input"}),h(null,yd,xd)}return a(b,Error),{SyntaxError:b,parse:c}}();return dust.parse=a.parse,a}),function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.compile",["dust.core","dust.parse"],function(dust,a){return b(a,dust).compile}):"object"==typeof exports?module.exports=b(require("./parser").parse,require("./dust")):b(a.dust.parse,a.dust)}(this,function(a,dust){function b(a){var b={};
return o.filterNode(b,a)}function c(a,b){var c,d,e,f=[b[0]];for(c=1,d=b.length;d>c;c++)e=o.filterNode(a,b[c]),e&&f.push(e);return f}function d(a,b){var c,d,e,f,g=[b[0]];for(d=1,e=b.length;e>d;d++)f=o.filterNode(a,b[d]),f&&("buffer"===f[0]||"format"===f[0]?c?(c[0]="buffer"===f[0]?"buffer":c[0],c[1]+=f.slice(1,-2).join("")):(c=f,g.push(f)):(c=null,g.push(f)));return g}function e(a,b){return["buffer",q[b[1]],b[2],b[3]]}function f(a,b){return b}function g(){}function h(a,b){return dust.config.whitespace?(b.splice(1,2,b.slice(1,-2).join("")),b):null}function i(a,b){var c={name:b,bodies:[],blocks:{},index:0,auto:"h"},d=dust.escapeJs(b),e="function(dust){dust.register("+(b?'"'+d+'"':"null")+","+o.compileNode(c,a)+");"+j(c)+k(c)+"return body_0;}";return dust.config.amd?'define("'+d+'",["dust.core"],'+e+");":"("+e+")(dust);"}function j(a){var b,c=[],d=a.blocks;for(b in d)c.push('"'+b+'":'+d[b]);return c.length?(a.blocks="ctx=ctx.shiftBlocks(blocks);","var blocks={"+c.join(",")+"};"):a.blocks=""}function k(a){var b,c,d=[],e=a.bodies,f=a.blocks;for(b=0,c=e.length;c>b;b++)d[b]="function body_"+b+"(chk,ctx){"+f+"return chk"+e[b]+";}body_"+b+".__dustBody=!0;";return d.join("")}function l(a,b){var c,d,e="";for(c=1,d=b.length;d>c;c++)e+=o.compileNode(a,b[c]);return e}function m(a,b,c){return"."+(dust._aliases[c]||c)+"("+o.compileNode(a,b[1])+","+o.compileNode(a,b[2])+","+o.compileNode(a,b[4])+","+o.compileNode(a,b[3])+")"}function n(a){return a.replace(r,"\\\\").replace(s,'\\"').replace(t,"\\f").replace(u,"\\n").replace(v,"\\r").replace(w,"\\t")}var o={},p=dust.isArray;o.compile=function(c,d){if(!d&&null!==d)throw new Error("Template name parameter cannot be undefined when calling dust.compile");try{var e=b(a(c));return i(e,d)}catch(f){if(!f.line||!f.column)throw f;throw new SyntaxError(f.message+" At line : "+f.line+", column : "+f.column)}},o.filterNode=function(a,b){return o.optimizers[b[0]](a,b)},o.optimizers={body:d,buffer:f,special:e,format:h,reference:c,"#":c,"?":c,"^":c,"<":c,"+":c,"@":c,"%":c,partial:c,context:c,params:c,bodies:c,param:c,filters:f,key:f,path:f,literal:f,raw:f,comment:g,line:g,col:g},o.pragmas={esc:function(a,b,c){var d,e=a.auto;return b||(b="h"),a.auto="s"===b?"":b,d=l(a,c.block),a.auto=e,d}};var q={s:" ",n:"\n",r:"\r",lb:"{",rb:"}"};o.compileNode=function(a,b){return o.nodes[b[0]](a,b)},o.nodes={body:function(a,b){var c=a.index++,d="body_"+c;return a.bodies[c]=l(a,b),d},buffer:function(a,b){return".w("+x(b[1])+")"},format:function(a,b){return".w("+x(b[1])+")"},reference:function(a,b){return".f("+o.compileNode(a,b[1])+",ctx,"+o.compileNode(a,b[2])+")"},"#":function(a,b){return m(a,b,"section")},"?":function(a,b){return m(a,b,"exists")},"^":function(a,b){return m(a,b,"notexists")},"<":function(a,b){for(var c=b[4],d=1,e=c.length;e>d;d++){var f=c[d],g=f[1][1];if("block"===g)return a.blocks[b[1].text]=o.compileNode(a,f[2]),""}return""},"+":function(a,b){return"undefined"==typeof b[1].text&&"undefined"==typeof b[4]?".block(ctx.getBlock("+o.compileNode(a,b[1])+",chk, ctx),"+o.compileNode(a,b[2])+", {},"+o.compileNode(a,b[3])+")":".block(ctx.getBlock("+x(b[1].text)+"),"+o.compileNode(a,b[2])+","+o.compileNode(a,b[4])+","+o.compileNode(a,b[3])+")"},"@":function(a,b){return".h("+x(b[1].text)+","+o.compileNode(a,b[2])+","+o.compileNode(a,b[4])+","+o.compileNode(a,b[3])+")"},"%":function(a,b){var c,d,e,f,g,h,i,j,k,l=b[1][1];if(!o.pragmas[l])return"";for(c=b[4],d={},j=1,k=c.length;k>j;j++)h=c[j],d[h[1][1]]=h[2];for(e=b[3],f={},j=1,k=e.length;k>j;j++)i=e[j],f[i[1][1]]=i[2][1];return g=b[2][1]?b[2][1].text:null,o.pragmas[l](a,g,d,f)},partial:function(a,b){return".p("+o.compileNode(a,b[1])+","+o.compileNode(a,b[2])+","+o.compileNode(a,b[3])+")"},context:function(a,b){return b[1]?"ctx.rebase("+o.compileNode(a,b[1])+")":"ctx"},params:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++)c.push(o.compileNode(a,b[d]));return c.length?"{"+c.join(",")+"}":"{}"},bodies:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++)c.push(o.compileNode(a,b[d]));return"{"+c.join(",")+"}"},param:function(a,b){return o.compileNode(a,b[1])+":"+o.compileNode(a,b[2])},filters:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++){var f=b[d];c.push('"'+f+'"')}return'"'+a.auto+'"'+(c.length?",["+c.join(",")+"]":"")},key:function(a,b){return'ctx.get(["'+b[1]+'"], false)'},path:function(a,b){for(var c=b[1],d=b[2],e=[],f=0,g=d.length;g>f;f++)e.push(p(d[f])?o.compileNode(a,d[f]):'"'+d[f]+'"');return"ctx.getPath("+c+", ["+e.join(",")+"])"},literal:function(a,b){return x(b[1])},raw:function(a,b){return".w("+x(b[1])+")"}};var r=/\\/g,s=/"/g,t=/\f/g,u=/\n/g,v=/\r/g,w=/\t/g,x="undefined"==typeof JSON?function(a){return'"'+n(a)+'"'}:JSON.stringify;return dust.compile=o.compile,dust.filterNode=o.filterNode,dust.optimizers=o.optimizers,dust.pragmas=o.pragmas,dust.compileNode=o.compileNode,dust.nodes=o.nodes,o}),"function"==typeof define&&define.amd&&define.amd.dust===!0&&define(["require","dust.core","dust.compile"],function(require,dust){return dust.onLoad=function(a,b){require([a],function(){b()})},dust});
!function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.core",[],b):"object"==typeof exports?module.exports=b():a.dust=b()}(this,function(){function load(a,b,c){if(!a)return b.setError(new Error("No template or template name provided to render"));dust.config.cache||(dust.cache={});var d;return d="function"==typeof a&&a.template?a.template:dust.isTemplateFn(a)?a:dust.cache[a],d?d(b,Context.wrap(c,d.templateName)):dust.onLoad?b.map(function(b){dust.onLoad(a,function(d,e){return d?b.setError(d):(dust.cache[a]||dust.loadSource(dust.compile(e,a)),void dust.cache[a](b,Context.wrap(c,a)).end())})}):b.setError(new Error("Template Not Found: "+a))}function Context(a,b,c,d){void 0===a||a instanceof Stack||(a=new Stack(a)),this.stack=a,this.global=b,this.blocks=c,this.templateName=d}function getWithResolvedData(a,b,c){return function(d){return a.push(d)._get(b,c)}}function Stack(a,b,c,d){this.tail=b,this.isObject=a&&"object"==typeof a,this.head=a,this.index=c,this.of=d}function Stub(a){this.head=new Chunk(this),this.callback=a,this.out=""}function Stream(){this.head=new Chunk(this)}function Chunk(a,b,c){this.root=a,this.next=b,this.data=[],this.flushable=!1,this.taps=c}function Tap(a,b){this.head=a,this.tail=b}var dust={version:"2.7.0"},NONE="NONE",ERROR="ERROR",WARN="WARN",INFO="INFO",DEBUG="DEBUG",EMPTY_FUNC=function(){};dust.config={whitespace:!1,amd:!1,cjs:!1,cache:!0},dust._aliases={write:"w",end:"e",map:"m",render:"r",reference:"f",section:"s",exists:"x",notexists:"nx",block:"b",partial:"p",helper:"h"},function(){var a,b,c={DEBUG:0,INFO:1,WARN:2,ERROR:3,NONE:4};"undefined"!=typeof console&&console.log?(a=console.log,b="function"==typeof a?function(){a.apply(console,arguments)}:function(){a(Array.prototype.slice.apply(arguments).join(" "))}):b=EMPTY_FUNC,dust.log=function(a,d){d=d||INFO,c[d]>=c[dust.debugLevel]&&b("[DUST:"+d+"]",a)},dust.debugLevel=NONE,"undefined"!=typeof process&&process.env&&/\bdust\b/.test(process.env.DEBUG)&&(dust.debugLevel=DEBUG)}(),dust.helpers={},dust.cache={},dust.register=function(a,b){a&&(b.templateName=a,dust.cache[a]=b)},dust.render=function(a,b,c){var d=new Stub(c).head;try{load(a,d,b).end()}catch(e){d.setError(e)}},dust.stream=function(a,b){var c=new Stream,d=c.head;return dust.nextTick(function(){try{load(a,d,b).end()}catch(c){d.setError(c)}}),c},dust.loadSource=function(source){return eval(source)},dust.isArray=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},dust.nextTick=function(){return function(a){setTimeout(a,0)}}(),dust.isEmpty=function(a){return 0===a?!1:dust.isArray(a)&&!a.length?!0:!a},dust.isEmptyObject=function(a){var b;if(null===a)return!1;if(void 0===a)return!1;if(a.length>0)return!1;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b))return!1;return!0},dust.isTemplateFn=function(a){return"function"==typeof a&&a.__dustBody},dust.isThenable=function(a){return a&&"object"==typeof a&&"function"==typeof a.then},dust.isStreamable=function(a){return a&&"function"==typeof a.on},dust.filter=function(a,b,c){var d,e,f;if(c)for(d=0,e=c.length;e>d;d++)f=c[d],"s"===f?b=null:"function"==typeof dust.filters[f]?a=dust.filters[f](a):dust.log("Invalid filter `"+f+"`",WARN);return b&&(a=dust.filters[b](a)),a},dust.filters={h:function(a){return dust.escapeHtml(a)},j:function(a){return dust.escapeJs(a)},u:encodeURI,uc:encodeURIComponent,js:function(a){return dust.escapeJSON(a)},jp:function(a){return JSON?JSON.parse(a):(dust.log("JSON is undefined; could not parse `"+a+"`",WARN),a)}},dust.makeBase=function(a){return new Context(void 0,a)},Context.wrap=function(a,b){return a instanceof Context?a:new Context(a,{},null,b)},Context.prototype.get=function(a,b){return"string"==typeof a&&("."===a[0]&&(b=!0,a=a.substr(1)),a=a.split(".")),this._get(b,a)},Context.prototype._get=function(a,b){var c,d,e,f,g,h=this.stack||{},i=1;if(d=b[0],e=b.length,a&&0===e)f=h,h=h.head;else{if(a)h&&(h=h.head?h.head[d]:void 0);else{for(;h&&(!h.isObject||(f=h.head,c=h.head[d],void 0===c));)h=h.tail;h=void 0!==c?c:this.global&&this.global[d]}for(;h&&e>i;){if(dust.isThenable(h))return h.then(getWithResolvedData(this,a,b.slice(i)));f=h,h=h[b[i]],i++}}return"function"==typeof h?(g=function(){try{return h.apply(f,arguments)}catch(a){throw dust.log(a,ERROR),a}},g.__dustBody=!!h.__dustBody,g):(void 0===h&&dust.log("Cannot find reference `{"+b.join(".")+"}` in template `"+this.getTemplateName()+"`",INFO),h)},Context.prototype.getPath=function(a,b){return this._get(a,b)},Context.prototype.push=function(a,b,c){return void 0===a?(dust.log("Not pushing an undefined variable onto the context",INFO),this):this.rebase(new Stack(a,this.stack,b,c))},Context.prototype.pop=function(){var a=this.current();return this.stack=this.stack&&this.stack.tail,a},Context.prototype.rebase=function(a){return new Context(a,this.global,this.blocks,this.getTemplateName())},Context.prototype.clone=function(){var a=this.rebase();return a.stack=this.stack,a},Context.prototype.current=function(){return this.stack&&this.stack.head},Context.prototype.getBlock=function(a){var b,c,d;if("function"==typeof a&&(a=a(new Chunk,this).data.join("")),b=this.blocks,!b)return dust.log("No blocks for context `"+a+"` in template `"+this.getTemplateName()+"`",DEBUG),!1;for(c=b.length;c--;)if(d=b[c][a])return d;return dust.log("Malformed template `"+this.getTemplateName()+"` was missing one or more blocks."),!1},Context.prototype.shiftBlocks=function(a){var b,c=this.blocks;return a?(b=c?c.concat([a]):[a],new Context(this.stack,this.global,b,this.getTemplateName())):this},Context.prototype.resolve=function(a){var b;return"function"!=typeof a?a:(b=(new Chunk).render(a,this),b instanceof Chunk?b.data.join(""):b)},Context.prototype.getTemplateName=function(){return this.templateName},Stub.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.callback(a.error),dust.log("Rendering failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.out+=a.data.join(""),a=a.next,this.head=a}this.callback(null,this.out)},Stream.prototype.flush=function(){for(var a=this.head;a;){if(!a.flushable)return a.error?(this.emit("error",a.error),this.emit("end"),dust.log("Streaming failed with error `"+a.error+"`",ERROR),void(this.flush=EMPTY_FUNC)):void 0;this.emit("data",a.data.join("")),a=a.next,this.head=a}this.emit("end")},Stream.prototype.emit=function(a,b){var c,d,e=this.events||{},f=e[a]||[];if(!f.length)return dust.log("Stream broadcasting, but no listeners for `"+a+"`",DEBUG),!1;for(f=f.slice(0),c=0,d=f.length;d>c;c++)f[c](b);return!0},Stream.prototype.on=function(a,b){var c=this.events=this.events||{},d=c[a]=c[a]||[];return"function"!=typeof b?dust.log("No callback function provided for `"+a+"` event listener",WARN):d.push(b),this},Stream.prototype.pipe=function(a){if("function"!=typeof a.write||"function"!=typeof a.end)return dust.log("Incompatible stream passed to `pipe`",WARN),this;var b=!1;return"function"==typeof a.emit&&a.emit("pipe",this),"function"==typeof a.on&&a.on("error",function(){b=!0}),this.on("data",function(c){if(!b)try{a.write(c,"utf8")}catch(d){dust.log(d,ERROR)}}).on("end",function(){if(!b)try{a.end(),b=!0}catch(c){dust.log(c,ERROR)}})},Chunk.prototype.write=function(a){var b=this.taps;return b&&(a=b.go(a)),this.data.push(a),this},Chunk.prototype.end=function(a){return a&&this.write(a),this.flushable=!0,this.root.flush(),this},Chunk.prototype.map=function(a){var b=new Chunk(this.root,this.next,this.taps),c=new Chunk(this.root,b,this.taps);this.next=c,this.flushable=!0;try{a(c)}catch(d){dust.log(d,ERROR),c.setError(d)}return b},Chunk.prototype.tap=function(a){var b=this.taps;return this.taps=b?b.push(a):new Tap(a),this},Chunk.prototype.untap=function(){return this.taps=this.taps.tail,this},Chunk.prototype.render=function(a,b){return a(this,b)},Chunk.prototype.reference=function(a,b,c,d){return"function"==typeof a?(a=a.apply(b.current(),[this,b,null,{auto:c,filters:d}]),a instanceof Chunk?a:this.reference(a,b,c,d)):dust.isThenable(a)?this.await(a,b,null,c,d):dust.isStreamable(a)?this.stream(a,b,null,c,d):dust.isEmpty(a)?this:this.write(dust.filter(a,c,d))},Chunk.prototype.section=function(a,b,c,d){var e,f,g=c.block,h=c["else"],i=this;if("function"==typeof a&&!dust.isTemplateFn(a)){try{a=a.apply(b.current(),[this,b,c,d])}catch(j){return dust.log(j,ERROR),this.setError(j)}if(a instanceof Chunk)return a}if(dust.isEmptyObject(d)||(b=b.push(d)),dust.isArray(a)){if(g){if(f=a.length,f>0){for(b.stack.head&&(b.stack.head.$len=f),e=0;f>e;e++)b.stack.head&&(b.stack.head.$idx=e),i=g(i,b.push(a[e],e,f));return b.stack.head&&(b.stack.head.$idx=void 0,b.stack.head.$len=void 0),i}if(h)return h(this,b)}}else{if(dust.isThenable(a))return this.await(a,b,c);if(dust.isStreamable(a))return this.stream(a,b,c);if(a===!0){if(g)return g(this,b)}else if(a||0===a){if(g)return g(this,b.push(a))}else if(h)return h(this,b)}return dust.log("Section without corresponding key in template `"+b.getTemplateName()+"`",DEBUG),this},Chunk.prototype.exists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(e)return e(this,b)}else{if(d)return d(this,b);dust.log("No block for exists check in template `"+b.getTemplateName()+"`",DEBUG)}return this},Chunk.prototype.notexists=function(a,b,c){var d=c.block,e=c["else"];if(dust.isEmpty(a)){if(d)return d(this,b);dust.log("No block for not-exists check in template `"+b.getTemplateName()+"`",DEBUG)}else if(e)return e(this,b);return this},Chunk.prototype.block=function(a,b,c){var d=a||c.block;return d?d(this,b):this},Chunk.prototype.partial=function(a,b,c,d){var e;return dust.isEmptyObject(d)||(c=c.clone(),e=c.pop(),c=c.push(d).push(e)),dust.isTemplateFn(a)?this.capture(a,b,function(a,b){c.templateName=a,load(a,b,c).end()}):(c.templateName=a,load(a,this,c))},Chunk.prototype.helper=function(a,b,c,d){var e,f=this;if(!dust.helpers[a])return dust.log("Helper `"+a+"` does not exist",WARN),f;try{return e=dust.helpers[a](f,b,c,d),dust.isThenable(e)?this.await(e,b,c):e}catch(g){return dust.log("Error in helper `"+a+"`: "+g.message,ERROR),f.setError(g)}},Chunk.prototype.await=function(a,b,c,d,e){var f=c&&c.block,g=c&&c.error;return this.map(function(c){a.then(function(a){f?c.render(f,b.push(a)).end():c.reference(a,b,d,e).end()},function(a){g?c.render(g,b.push(a)).end():(dust.log("Unhandled promise rejection in `"+b.getTemplateName()+"`"),c.end())})})},Chunk.prototype.stream=function(a,b,c,d,e){var f=c&&c.block,g=c&&c.error;return this.map(function(c){var h=!1;a.on("data",function(a){h||(c=f?c.map(function(c){c.render(f,b.push(a)).end()}):c.reference(a,b,d,e))}).on("error",function(a){h||(g?c.render(g,b.push(a)):dust.log("Unhandled stream error in `"+b.getTemplateName()+"`"),h||(h=!0,c.end()))}).on("end",function(){h||(h=!0,c.end())})})},Chunk.prototype.capture=function(a,b,c){return this.map(function(d){var e=new Stub(function(a,b){a?d.setError(a):c(b,d)});a(e.head,b).end()})},Chunk.prototype.setError=function(a){return this.error=a,this.root.flush(),this};for(var f in Chunk.prototype)dust._aliases[f]&&(Chunk.prototype[dust._aliases[f]]=Chunk.prototype[f]);Tap.prototype.push=function(a){return new Tap(a,this)},Tap.prototype.go=function(a){for(var b=this;b;)a=b.head(a),b=b.tail;return a};var HCHARS=/[&<>"']/,AMP=/&/g,LT=/</g,GT=/>/g,QUOT=/\"/g,SQUOT=/\'/g;dust.escapeHtml=function(a){return"string"==typeof a||a&&"function"==typeof a.toString?("string"!=typeof a&&(a=a.toString()),HCHARS.test(a)?a.replace(AMP,"&amp;").replace(LT,"&lt;").replace(GT,"&gt;").replace(QUOT,"&quot;").replace(SQUOT,"&#39;"):a):a};var BS=/\\/g,FS=/\//g,CR=/\r/g,LS=/\u2028/g,PS=/\u2029/g,NL=/\n/g,LF=/\f/g,SQ=/'/g,DQ=/"/g,TB=/\t/g;return dust.escapeJs=function(a){return"string"==typeof a?a.replace(BS,"\\\\").replace(FS,"\\/").replace(DQ,'\\"').replace(SQ,"\\'").replace(CR,"\\r").replace(LS,"\\u2028").replace(PS,"\\u2029").replace(NL,"\\n").replace(LF,"\\f").replace(TB,"\\t"):a},dust.escapeJSON=function(a){return JSON?JSON.stringify(a).replace(LS,"\\u2028").replace(PS,"\\u2029").replace(LT,"\\u003c"):(dust.log("JSON is undefined; could not escape `"+a+"`",WARN),a)},dust}),function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.parse",["dust.core"],function(dust){return b(dust).parse}):"object"==typeof exports?module.exports=b(require("./dust")):b(a.dust)}(this,function(dust){var a=function(){function a(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}function b(a,b,c,d,e,f){this.message=a,this.expected=b,this.found=c,this.offset=d,this.line=e,this.column=f,this.name="SyntaxError"}function c(a){function c(){return f(wc).line}function d(){return f(wc).column}function e(a){throw h(a,null,wc)}function f(b){function c(b,c,d){var e,f;for(e=c;d>e;e++)f=a.charAt(e),"\n"===f?(b.seenCR||b.line++,b.column=1,b.seenCR=!1):"\r"===f||"\u2028"===f||"\u2029"===f?(b.line++,b.column=1,b.seenCR=!0):(b.column++,b.seenCR=!1)}return xc!==b&&(xc>b&&(xc=0,yc={line:1,column:1,seenCR:!1}),c(yc,xc,b),xc=b),yc}function g(a){zc>vc||(vc>zc&&(zc=vc,Ac=[]),Ac.push(a))}function h(c,d,e){function g(a){var b=1;for(a.sort(function(a,b){return a.description<b.description?-1:a.description>b.description?1:0});b<a.length;)a[b-1]===a[b]?a.splice(b,1):b++}function h(a,b){function c(a){function b(a){return a.charCodeAt(0).toString(16).toUpperCase()}return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,function(a){return"\\x0"+b(a)}).replace(/[\x10-\x1F\x80-\xFF]/g,function(a){return"\\x"+b(a)}).replace(/[\u0180-\u0FFF]/g,function(a){return"\\u0"+b(a)}).replace(/[\u1080-\uFFFF]/g,function(a){return"\\u"+b(a)})}var d,e,f,g=new Array(a.length);for(f=0;f<a.length;f++)g[f]=a[f].description;return d=a.length>1?g.slice(0,-1).join(", ")+" or "+g[a.length-1]:g[0],e=b?'"'+c(b)+'"':"end of input","Expected "+d+" but "+e+" found."}var i=f(e),j=e<a.length?a.charAt(e):null;return null!==d&&g(d),new b(null!==c?c:h(d,j),d,j,e,i.line,i.column)}function i(){var a;return a=j()}function j(){var a,b,c;for(a=vc,b=[],c=k();c!==X;)b.push(c),c=k();return b!==X&&(wc=a,b=$(b)),a=b}function k(){var a;return a=K(),a===X&&(a=L(),a===X&&(a=l(),a===X&&(a=s(),a===X&&(a=u(),a===X&&(a=r(),a===X&&(a=H())))))),a}function l(){var b,c,d,e,f,h,i,k;if(Bc++,b=vc,c=m(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(e=O(),e!==X?(f=j(),f!==X?(h=q(),h!==X?(i=n(),i===X&&(i=ba),i!==X?(wc=vc,k=ca(c,f,h,i),k=k?da:aa,k!==X?(wc=b,c=ea(c,f,h,i),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;if(b===X)if(b=vc,c=m(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(47===a.charCodeAt(vc)?(e=fa,vc++):(e=X,0===Bc&&g(ga)),e!==X?(f=O(),f!==X?(wc=b,c=ha(c),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(_)),b}function m(){var b,c,d,e,f,h,i;if(b=vc,c=N(),c!==X)if(ia.test(a.charAt(vc))?(d=a.charAt(vc),vc++):(d=X,0===Bc&&g(ja)),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();e!==X?(f=v(),f!==X?(h=o(),h!==X?(i=p(),i!==X?(wc=b,c=ka(d,f,h,i),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;else vc=b,b=aa;return b}function n(){var b,c,d,e,f,h,i;if(Bc++,b=vc,c=N(),c!==X)if(47===a.charCodeAt(vc)?(d=fa,vc++):(d=X,0===Bc&&g(ga)),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();if(e!==X)if(f=v(),f!==X){for(h=[],i=S();i!==X;)h.push(i),i=S();h!==X?(i=O(),i!==X?(wc=b,c=ma(f),b=c):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;else vc=b,b=aa}else vc=b,b=aa;else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(la)),b}function o(){var b,c,d,e;return b=vc,c=vc,58===a.charCodeAt(vc)?(d=na,vc++):(d=X,0===Bc&&g(oa)),d!==X?(e=v(),e!==X?(wc=c,d=pa(e),c=d):(vc=c,c=aa)):(vc=c,c=aa),c===X&&(c=ba),c!==X&&(wc=b,c=qa(c)),b=c}function p(){var b,c,d,e,f,h,i;if(Bc++,b=vc,c=[],d=vc,e=[],f=S(),f!==X)for(;f!==X;)e.push(f),f=S();else e=aa;for(e!==X?(f=C(),f!==X?(61===a.charCodeAt(vc)?(h=sa,vc++):(h=X,0===Bc&&g(ta)),h!==X?(i=w(),i===X&&(i=v(),i===X&&(i=F())),i!==X?(wc=d,e=ua(f,i),d=e):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa);d!==X;){if(c.push(d),d=vc,e=[],f=S(),f!==X)for(;f!==X;)e.push(f),f=S();else e=aa;e!==X?(f=C(),f!==X?(61===a.charCodeAt(vc)?(h=sa,vc++):(h=X,0===Bc&&g(ta)),h!==X?(i=w(),i===X&&(i=v(),i===X&&(i=F())),i!==X?(wc=d,e=ua(f,i),d=e):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)}return c!==X&&(wc=b,c=va(c)),b=c,Bc--,b===X&&(c=X,0===Bc&&g(ra)),b}function q(){var b,c,d,e,f,h,i,k;for(Bc++,b=vc,c=[],d=vc,e=N(),e!==X?(58===a.charCodeAt(vc)?(f=na,vc++):(f=X,0===Bc&&g(oa)),f!==X?(h=C(),h!==X?(i=O(),i!==X?(k=j(),k!==X?(wc=d,e=ua(h,k),d=e):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa);d!==X;)c.push(d),d=vc,e=N(),e!==X?(58===a.charCodeAt(vc)?(f=na,vc++):(f=X,0===Bc&&g(oa)),f!==X?(h=C(),h!==X?(i=O(),i!==X?(k=j(),k!==X?(wc=d,e=ua(h,k),d=e):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa);return c!==X&&(wc=b,c=xa(c)),b=c,Bc--,b===X&&(c=X,0===Bc&&g(wa)),b}function r(){var a,b,c,d,e;return Bc++,a=vc,b=N(),b!==X?(c=v(),c!==X?(d=t(),d!==X?(e=O(),e!==X?(wc=a,b=za(c,d),a=b):(vc=a,a=aa)):(vc=a,a=aa)):(vc=a,a=aa)):(vc=a,a=aa),Bc--,a===X&&(b=X,0===Bc&&g(ya)),a}function s(){var b,c,d,e,f,h,i,j,k,l;if(Bc++,b=vc,c=N(),c!==X)if(62===a.charCodeAt(vc)?(d=Ba,vc++):(d=X,0===Bc&&g(Ca)),d===X&&(43===a.charCodeAt(vc)?(d=Da,vc++):(d=X,0===Bc&&g(Ea))),d!==X){for(e=[],f=S();f!==X;)e.push(f),f=S();if(e!==X)if(f=vc,h=C(),h!==X&&(wc=f,h=Fa(h)),f=h,f===X&&(f=F()),f!==X)if(h=o(),h!==X)if(i=p(),i!==X){for(j=[],k=S();k!==X;)j.push(k),k=S();j!==X?(47===a.charCodeAt(vc)?(k=fa,vc++):(k=X,0===Bc&&g(ga)),k!==X?(l=O(),l!==X?(wc=b,c=Ga(d,f,h,i),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;else vc=b,b=aa;else vc=b,b=aa;else vc=b,b=aa}else vc=b,b=aa;else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(Aa)),b}function t(){var b,c,d,e,f;for(Bc++,b=vc,c=[],d=vc,124===a.charCodeAt(vc)?(e=Ia,vc++):(e=X,0===Bc&&g(Ja)),e!==X?(f=C(),f!==X?(wc=d,e=pa(f),d=e):(vc=d,d=aa)):(vc=d,d=aa);d!==X;)c.push(d),d=vc,124===a.charCodeAt(vc)?(e=Ia,vc++):(e=X,0===Bc&&g(Ja)),e!==X?(f=C(),f!==X?(wc=d,e=pa(f),d=e):(vc=d,d=aa)):(vc=d,d=aa);return c!==X&&(wc=b,c=Ka(c)),b=c,Bc--,b===X&&(c=X,0===Bc&&g(Ha)),b}function u(){var b,c,d,e,f;return Bc++,b=vc,c=N(),c!==X?(126===a.charCodeAt(vc)?(d=Ma,vc++):(d=X,0===Bc&&g(Na)),d!==X?(e=C(),e!==X?(f=O(),f!==X?(wc=b,c=Oa(e),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa),Bc--,b===X&&(c=X,0===Bc&&g(La)),b}function v(){var a,b;return Bc++,a=vc,b=B(),b!==X&&(wc=a,b=Qa(b)),a=b,a===X&&(a=vc,b=C(),b!==X&&(wc=a,b=Ra(b)),a=b),Bc--,a===X&&(b=X,0===Bc&&g(Pa)),a}function w(){var a,b;return Bc++,a=vc,b=x(),b===X&&(b=A()),b!==X&&(wc=a,b=Ta(b)),a=b,Bc--,a===X&&(b=X,0===Bc&&g(Sa)),a}function x(){var b,c,d,e;return Bc++,b=vc,c=A(),c!==X?(46===a.charCodeAt(vc)?(d=Va,vc++):(d=X,0===Bc&&g(Wa)),d!==X?(e=y(),e!==X?(wc=b,c=Xa(c,e),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa),Bc--,b===X&&(c=X,0===Bc&&g(Ua)),b}function y(){var b,c,d;if(Bc++,b=vc,c=[],Za.test(a.charAt(vc))?(d=a.charAt(vc),vc++):(d=X,0===Bc&&g($a)),d!==X)for(;d!==X;)c.push(d),Za.test(a.charAt(vc))?(d=a.charAt(vc),vc++):(d=X,0===Bc&&g($a));else c=aa;return c!==X&&(wc=b,c=_a(c)),b=c,Bc--,b===X&&(c=X,0===Bc&&g(Ya)),b}function z(){var b,c,d;return Bc++,b=vc,45===a.charCodeAt(vc)?(c=bb,vc++):(c=X,0===Bc&&g(cb)),c!==X?(d=y(),d!==X?(wc=b,c=db(c,d),b=c):(vc=b,b=aa)):(vc=b,b=aa),Bc--,b===X&&(c=X,0===Bc&&g(ab)),b}function A(){var a,b;return Bc++,a=z(),a===X&&(a=y()),Bc--,a===X&&(b=X,0===Bc&&g(eb)),a}function B(){var b,c,d,e;if(Bc++,b=vc,c=C(),c===X&&(c=ba),c!==X){if(d=[],e=E(),e===X&&(e=D()),e!==X)for(;e!==X;)d.push(e),e=E(),e===X&&(e=D());else d=aa;d!==X?(wc=b,c=gb(c,d),b=c):(vc=b,b=aa)}else vc=b,b=aa;if(b===X)if(b=vc,46===a.charCodeAt(vc)?(c=Va,vc++):(c=X,0===Bc&&g(Wa)),c!==X){for(d=[],e=E(),e===X&&(e=D());e!==X;)d.push(e),e=E(),e===X&&(e=D());d!==X?(wc=b,c=hb(d),b=c):(vc=b,b=aa)}else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(fb)),b}function C(){var b,c,d,e;if(Bc++,b=vc,jb.test(a.charAt(vc))?(c=a.charAt(vc),vc++):(c=X,0===Bc&&g(kb)),c!==X){for(d=[],lb.test(a.charAt(vc))?(e=a.charAt(vc),vc++):(e=X,0===Bc&&g(mb));e!==X;)d.push(e),lb.test(a.charAt(vc))?(e=a.charAt(vc),vc++):(e=X,0===Bc&&g(mb));d!==X?(wc=b,c=nb(c,d),b=c):(vc=b,b=aa)}else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(ib)),b}function D(){var b,c,d,e,f,h;if(Bc++,b=vc,c=vc,d=P(),d!==X){if(e=vc,f=[],Za.test(a.charAt(vc))?(h=a.charAt(vc),vc++):(h=X,0===Bc&&g($a)),h!==X)for(;h!==X;)f.push(h),Za.test(a.charAt(vc))?(h=a.charAt(vc),vc++):(h=X,0===Bc&&g($a));else f=aa;f!==X&&(wc=e,f=pb(f)),e=f,e===X&&(e=v()),e!==X?(f=Q(),f!==X?(wc=c,d=qb(e),c=d):(vc=c,c=aa)):(vc=c,c=aa)}else vc=c,c=aa;return c!==X?(d=E(),d===X&&(d=ba),d!==X?(wc=b,c=rb(c,d),b=c):(vc=b,b=aa)):(vc=b,b=aa),Bc--,b===X&&(c=X,0===Bc&&g(ob)),b}function E(){var b,c,d,e,f;if(Bc++,b=vc,c=[],d=vc,46===a.charCodeAt(vc)?(e=Va,vc++):(e=X,0===Bc&&g(Wa)),e!==X?(f=C(),f!==X?(wc=d,e=tb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa),d!==X)for(;d!==X;)c.push(d),d=vc,46===a.charCodeAt(vc)?(e=Va,vc++):(e=X,0===Bc&&g(Wa)),e!==X?(f=C(),f!==X?(wc=d,e=tb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa);else c=aa;return c!==X?(d=D(),d===X&&(d=ba),d!==X?(wc=b,c=ub(c,d),b=c):(vc=b,b=aa)):(vc=b,b=aa),Bc--,b===X&&(c=X,0===Bc&&g(sb)),b}function F(){var b,c,d,e;if(Bc++,b=vc,34===a.charCodeAt(vc)?(c=wb,vc++):(c=X,0===Bc&&g(xb)),c!==X?(34===a.charCodeAt(vc)?(d=wb,vc++):(d=X,0===Bc&&g(xb)),d!==X?(wc=b,c=yb(),b=c):(vc=b,b=aa)):(vc=b,b=aa),b===X&&(b=vc,34===a.charCodeAt(vc)?(c=wb,vc++):(c=X,0===Bc&&g(xb)),c!==X?(d=I(),d!==X?(34===a.charCodeAt(vc)?(e=wb,vc++):(e=X,0===Bc&&g(xb)),e!==X?(wc=b,c=zb(d),b=c):(vc=b,b=aa)):(vc=b,b=aa)):(vc=b,b=aa),b===X))if(b=vc,34===a.charCodeAt(vc)?(c=wb,vc++):(c=X,0===Bc&&g(xb)),c!==X){if(d=[],e=G(),e!==X)for(;e!==X;)d.push(e),e=G();else d=aa;d!==X?(34===a.charCodeAt(vc)?(e=wb,vc++):(e=X,0===Bc&&g(xb)),e!==X?(wc=b,c=Ab(d),b=c):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(vb)),b}function G(){var a,b;return a=u(),a===X&&(a=r(),a===X&&(a=vc,b=I(),b!==X&&(wc=a,b=Bb(b)),a=b)),a}function H(){var b,c,d,e,f,h,i,j;if(Bc++,b=vc,c=R(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();d!==X?(wc=b,c=Db(c,d),b=c):(vc=b,b=aa)}else vc=b,b=aa;if(b===X){if(b=vc,c=[],d=vc,e=vc,Bc++,f=M(),Bc--,f===X?e=da:(vc=e,e=aa),e!==X?(f=vc,Bc++,h=K(),Bc--,h===X?f=da:(vc=f,f=aa),f!==X?(h=vc,Bc++,i=L(),Bc--,i===X?h=da:(vc=h,h=aa),h!==X?(i=vc,Bc++,j=R(),Bc--,j===X?i=da:(vc=i,i=aa),i!==X?(a.length>vc?(j=a.charAt(vc),vc++):(j=X,0===Bc&&g(Eb)),j!==X?(wc=d,e=Fb(j),d=e):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa),d!==X)for(;d!==X;)c.push(d),d=vc,e=vc,Bc++,f=M(),Bc--,f===X?e=da:(vc=e,e=aa),e!==X?(f=vc,Bc++,h=K(),Bc--,h===X?f=da:(vc=f,f=aa),f!==X?(h=vc,Bc++,i=L(),Bc--,i===X?h=da:(vc=h,h=aa),h!==X?(i=vc,Bc++,j=R(),Bc--,j===X?i=da:(vc=i,i=aa),i!==X?(a.length>vc?(j=a.charAt(vc),vc++):(j=X,0===Bc&&g(Eb)),j!==X?(wc=d,e=Fb(j),d=e):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa)):(vc=d,d=aa);else c=aa;c!==X&&(wc=b,c=Gb(c)),b=c}return Bc--,b===X&&(c=X,0===Bc&&g(Cb)),b}function I(){var b,c,d,e,f;if(Bc++,b=vc,c=[],d=vc,e=vc,Bc++,f=M(),Bc--,f===X?e=da:(vc=e,e=aa),e!==X?(f=J(),f===X&&(Ib.test(a.charAt(vc))?(f=a.charAt(vc),vc++):(f=X,0===Bc&&g(Jb))),f!==X?(wc=d,e=Fb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa),d!==X)for(;d!==X;)c.push(d),d=vc,e=vc,Bc++,f=M(),Bc--,f===X?e=da:(vc=e,e=aa),e!==X?(f=J(),f===X&&(Ib.test(a.charAt(vc))?(f=a.charAt(vc),vc++):(f=X,0===Bc&&g(Jb))),f!==X?(wc=d,e=Fb(f),d=e):(vc=d,d=aa)):(vc=d,d=aa);else c=aa;return c!==X&&(wc=b,c=Kb(c)),b=c,Bc--,b===X&&(c=X,0===Bc&&g(Hb)),b}function J(){var b,c;return b=vc,a.substr(vc,2)===Lb?(c=Lb,vc+=2):(c=X,0===Bc&&g(Mb)),c!==X&&(wc=b,c=Nb()),b=c}function K(){var b,c,d,e,f,h;if(Bc++,b=vc,a.substr(vc,2)===Pb?(c=Pb,vc+=2):(c=X,0===Bc&&g(Qb)),c!==X){for(d=[],e=vc,f=vc,Bc++,a.substr(vc,2)===Rb?(h=Rb,vc+=2):(h=X,0===Bc&&g(Sb)),Bc--,h===X?f=da:(vc=f,f=aa),f!==X?(a.length>vc?(h=a.charAt(vc),vc++):(h=X,0===Bc&&g(Eb)),h!==X?(wc=e,f=Tb(h),e=f):(vc=e,e=aa)):(vc=e,e=aa);e!==X;)d.push(e),e=vc,f=vc,Bc++,a.substr(vc,2)===Rb?(h=Rb,vc+=2):(h=X,0===Bc&&g(Sb)),Bc--,h===X?f=da:(vc=f,f=aa),f!==X?(a.length>vc?(h=a.charAt(vc),vc++):(h=X,0===Bc&&g(Eb)),h!==X?(wc=e,f=Tb(h),e=f):(vc=e,e=aa)):(vc=e,e=aa);d!==X?(a.substr(vc,2)===Rb?(e=Rb,vc+=2):(e=X,0===Bc&&g(Sb)),e!==X?(wc=b,c=Ub(d),b=c):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(Ob)),b}function L(){var b,c,d,e,f,h;if(Bc++,b=vc,a.substr(vc,2)===Wb?(c=Wb,vc+=2):(c=X,0===Bc&&g(Xb)),c!==X){for(d=[],e=vc,f=vc,Bc++,a.substr(vc,2)===Yb?(h=Yb,vc+=2):(h=X,0===Bc&&g(Zb)),Bc--,h===X?f=da:(vc=f,f=aa),f!==X?(a.length>vc?(h=a.charAt(vc),vc++):(h=X,0===Bc&&g(Eb)),h!==X?(wc=e,f=Fb(h),e=f):(vc=e,e=aa)):(vc=e,e=aa);e!==X;)d.push(e),e=vc,f=vc,Bc++,a.substr(vc,2)===Yb?(h=Yb,vc+=2):(h=X,0===Bc&&g(Zb)),Bc--,h===X?f=da:(vc=f,f=aa),f!==X?(a.length>vc?(h=a.charAt(vc),vc++):(h=X,0===Bc&&g(Eb)),h!==X?(wc=e,f=Fb(h),e=f):(vc=e,e=aa)):(vc=e,e=aa);d!==X?(a.substr(vc,2)===Yb?(e=Yb,vc+=2):(e=X,0===Bc&&g(Zb)),e!==X?(wc=b,c=$b(d),b=c):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa;return Bc--,b===X&&(c=X,0===Bc&&g(Vb)),b}function M(){var b,c,d,e,f,h,i,j,k,l;if(b=vc,c=N(),c!==X){for(d=[],e=S();e!==X;)d.push(e),e=S();if(d!==X)if(_b.test(a.charAt(vc))?(e=a.charAt(vc),vc++):(e=X,0===Bc&&g(ac)),e!==X){for(f=[],h=S();h!==X;)f.push(h),h=S();if(f!==X){if(h=[],i=vc,j=vc,Bc++,k=O(),Bc--,k===X?j=da:(vc=j,j=aa),j!==X?(k=vc,Bc++,l=R(),Bc--,l===X?k=da:(vc=k,k=aa),k!==X?(a.length>vc?(l=a.charAt(vc),vc++):(l=X,0===Bc&&g(Eb)),l!==X?(j=[j,k,l],i=j):(vc=i,i=aa)):(vc=i,i=aa)):(vc=i,i=aa),i!==X)for(;i!==X;)h.push(i),i=vc,j=vc,Bc++,k=O(),Bc--,k===X?j=da:(vc=j,j=aa),j!==X?(k=vc,Bc++,l=R(),Bc--,l===X?k=da:(vc=k,k=aa),k!==X?(a.length>vc?(l=a.charAt(vc),vc++):(l=X,0===Bc&&g(Eb)),l!==X?(j=[j,k,l],i=j):(vc=i,i=aa)):(vc=i,i=aa)):(vc=i,i=aa);else h=aa;if(h!==X){for(i=[],j=S();j!==X;)i.push(j),j=S();i!==X?(j=O(),j!==X?(c=[c,d,e,f,h,i,j],b=c):(vc=b,b=aa)):(vc=b,b=aa)}else vc=b,b=aa}else vc=b,b=aa}else vc=b,b=aa;else vc=b,b=aa}else vc=b,b=aa;return b===X&&(b=r()),b}function N(){var b;return 123===a.charCodeAt(vc)?(b=bc,vc++):(b=X,0===Bc&&g(cc)),b}function O(){var b;return 125===a.charCodeAt(vc)?(b=dc,vc++):(b=X,0===Bc&&g(ec)),b}function P(){var b;return 91===a.charCodeAt(vc)?(b=fc,vc++):(b=X,0===Bc&&g(gc)),b}function Q(){var b;return 93===a.charCodeAt(vc)?(b=hc,vc++):(b=X,0===Bc&&g(ic)),b}function R(){var b;return 10===a.charCodeAt(vc)?(b=jc,vc++):(b=X,0===Bc&&g(kc)),b===X&&(a.substr(vc,2)===lc?(b=lc,vc+=2):(b=X,0===Bc&&g(mc)),b===X&&(13===a.charCodeAt(vc)?(b=nc,vc++):(b=X,0===Bc&&g(oc)),b===X&&(8232===a.charCodeAt(vc)?(b=pc,vc++):(b=X,0===Bc&&g(qc)),b===X&&(8233===a.charCodeAt(vc)?(b=rc,vc++):(b=X,0===Bc&&g(sc)))))),b}function S(){var b;return tc.test(a.charAt(vc))?(b=a.charAt(vc),vc++):(b=X,0===Bc&&g(uc)),b===X&&(b=R()),b}function T(a){return parseInt(a.join(""),10)}function U(a){return a.concat([["line",c()],["col",d()]])}var V,W=arguments.length>1?arguments[1]:{},X={},Y={start:i},Z=i,$=function(a){var b=["body"].concat(a);return U(b)},_={type:"other",description:"section"},aa=X,ba=null,ca=function(a,b,c,d){return d&&a[1].text===d.text||e("Expected end tag for "+a[1].text+" but it was not found."),!0},da=void 0,ea=function(a,b,c,d){return c.push(["param",["literal","block"],b]),a.push(c),U(a)},fa="/",ga={type:"literal",value:"/",description:'"/"'},ha=function(a){return a.push(["bodies"]),U(a)},ia=/^[#?\^<+@%]/,ja={type:"class",value:"[#?\\^<+@%]",description:"[#?\\^<+@%]"},ka=function(a,b,c,d){return[a,b,c,d]},la={type:"other",description:"end tag"},ma=function(a){return a},na=":",oa={type:"literal",value:":",description:'":"'},pa=function(a){return a},qa=function(a){return a?["context",a]:["context"]},ra={type:"other",description:"params"},sa="=",ta={type:"literal",value:"=",description:'"="'},ua=function(a,b){return["param",["literal",a],b]},va=function(a){return["params"].concat(a)},wa={type:"other",description:"bodies"},xa=function(a){return["bodies"].concat(a)},ya={type:"other",description:"reference"},za=function(a,b){return U(["reference",a,b])},Aa={type:"other",description:"partial"},Ba=">",Ca={type:"literal",value:">",description:'">"'},Da="+",Ea={type:"literal",value:"+",description:'"+"'},Fa=function(a){return["literal",a]},Ga=function(a,b,c,d){var e=">"===a?"partial":a;return U([e,b,c,d])},Ha={type:"other",description:"filters"},Ia="|",Ja={type:"literal",value:"|",description:'"|"'},Ka=function(a){return["filters"].concat(a)},La={type:"other",description:"special"},Ma="~",Na={type:"literal",value:"~",description:'"~"'},Oa=function(a){return U(["special",a])},Pa={type:"other",description:"identifier"},Qa=function(a){var b=["path"].concat(a);return b.text=a[1].join(".").replace(/,line,\d+,col,\d+/g,""),b},Ra=function(a){var b=["key",a];return b.text=a,b},Sa={type:"other",description:"number"},Ta=function(a){return["literal",a]},Ua={type:"other",description:"float"},Va=".",Wa={type:"literal",value:".",description:'"."'},Xa=function(a,b){return parseFloat(a+"."+b)},Ya={type:"other",description:"unsigned_integer"},Za=/^[0-9]/,$a={type:"class",value:"[0-9]",description:"[0-9]"},_a=function(a){return T(a)},ab={type:"other",description:"signed_integer"},bb="-",cb={type:"literal",value:"-",description:'"-"'},db=function(a,b){return-1*b},eb={type:"other",description:"integer"},fb={type:"other",description:"path"},gb=function(a,b){return b=b[0],a&&b?(b.unshift(a),U([!1,b])):U([!0,b])},hb=function(a){return U(a.length>0?[!0,a[0]]:[!0,[]])},ib={type:"other",description:"key"},jb=/^[a-zA-Z_$]/,kb={type:"class",value:"[a-zA-Z_$]",description:"[a-zA-Z_$]"},lb=/^[0-9a-zA-Z_$\-]/,mb={type:"class",value:"[0-9a-zA-Z_$\\-]",description:"[0-9a-zA-Z_$\\-]"},nb=function(a,b){return a+b.join("")},ob={type:"other",description:"array"},pb=function(a){return a.join("")},qb=function(a){return a},rb=function(a,b){return b?b.unshift(a):b=[a],b},sb={type:"other",description:"array_part"},tb=function(a){return a},ub=function(a,b){return b?a.concat(b):a},vb={type:"other",description:"inline"},wb='"',xb={type:"literal",value:'"',description:'"\\""'},yb=function(){return U(["literal",""])},zb=function(a){return U(["literal",a])},Ab=function(a){return U(["body"].concat(a))},Bb=function(a){return["buffer",a]},Cb={type:"other",description:"buffer"},Db=function(a,b){return U(["format",a,b.join("")])},Eb={type:"any",description:"any character"},Fb=function(a){return a},Gb=function(a){return U(["buffer",a.join("")])},Hb={type:"other",description:"literal"},Ib=/^[^"]/,Jb={type:"class",value:'[^"]',description:'[^"]'},Kb=function(a){return a.join("")},Lb='\\"',Mb={type:"literal",value:'\\"',description:'"\\\\\\""'},Nb=function(){return'"'},Ob={type:"other",description:"raw"},Pb="{`",Qb={type:"literal",value:"{`",description:'"{`"'},Rb="`}",Sb={type:"literal",value:"`}",description:'"`}"'},Tb=function(a){return a},Ub=function(a){return U(["raw",a.join("")])},Vb={type:"other",description:"comment"},Wb="{!",Xb={type:"literal",value:"{!",description:'"{!"'},Yb="!}",Zb={type:"literal",value:"!}",description:'"!}"'},$b=function(a){return U(["comment",a.join("")])},_b=/^[#?\^><+%:@\/~%]/,ac={type:"class",value:"[#?\\^><+%:@\\/~%]",description:"[#?\\^><+%:@\\/~%]"},bc="{",cc={type:"literal",value:"{",description:'"{"'},dc="}",ec={type:"literal",value:"}",description:'"}"'},fc="[",gc={type:"literal",value:"[",description:'"["'},hc="]",ic={type:"literal",value:"]",description:'"]"'},jc="\n",kc={type:"literal",value:"\n",description:'"\\n"'},lc="\r\n",mc={type:"literal",value:"\r\n",description:'"\\r\\n"'},nc="\r",oc={type:"literal",value:"\r",description:'"\\r"'},pc="\u2028",qc={type:"literal",value:"\u2028",description:'"\\u2028"'},rc="\u2029",sc={type:"literal",value:"\u2029",description:'"\\u2029"'},tc=/^[\t\x0B\f \xA0\uFEFF]/,uc={type:"class",value:"[\\t\\x0B\\f \\xA0\\uFEFF]",description:"[\\t\\x0B\\f \\xA0\\uFEFF]"},vc=0,wc=0,xc=0,yc={line:1,column:1,seenCR:!1},zc=0,Ac=[],Bc=0;if("startRule"in W){if(!(W.startRule in Y))throw new Error("Can't start parsing from rule \""+W.startRule+'".');
Z=Y[W.startRule]}if(V=Z(),V!==X&&vc===a.length)return V;throw V!==X&&vc<a.length&&g({type:"end",description:"end of input"}),h(null,Ac,zc)}return a(b,Error),{SyntaxError:b,parse:c}}();return dust.parse=a.parse,a}),function(a,b){"function"==typeof define&&define.amd&&define.amd.dust===!0?define("dust.compile",["dust.core","dust.parse"],function(dust,a){return b(a,dust).compile}):"object"==typeof exports?module.exports=b(require("./parser").parse,require("./dust")):b(a.dust.parse,a.dust)}(this,function(a,dust){function b(a){var b={};return r.filterNode(b,a)}function c(a,b){var c,d,e,f=[b[0]];for(c=1,d=b.length;d>c;c++)e=r.filterNode(a,b[c]),e&&f.push(e);return f}function d(a,b){var c,d,e,f,g=[b[0]];for(d=1,e=b.length;e>d;d++)f=r.filterNode(a,b[d]),f&&("buffer"===f[0]||"format"===f[0]?c?(c[0]="buffer"===f[0]?"buffer":c[0],c[1]+=f.slice(1,-2).join("")):(c=f,g.push(f)):(c=null,g.push(f)));return g}function e(a,b){return["buffer",t[b[1]],b[2],b[3]]}function f(a,b){return b}function g(){}function h(a,b){return dust.config.whitespace?(b.splice(1,2,b.slice(1,-2).join("")),b):null}function i(a,b){var c,d={name:b,bodies:[],blocks:{},index:0,auto:"h"},e=dust.escapeJs(b),f=b?'"'+e+'",':"",g="function(dust){",h=r.compileNode(d,a);return b&&(g+='dust.register("'+e+'",'+h+");"),g+=j(d)+k(d)+"return "+h+"}",c="("+g+"(dust));",dust.config.amd?"define("+f+'["dust.core"],'+g+");":dust.config.cjs?"module.exports=function(dust){var tmpl="+c+"var f="+q().toString()+";f.template=tmpl;return f}":c}function j(a){var b,c=[],d=a.blocks;for(b in d)c.push('"'+b+'":'+d[b]);return c.length?(a.blocks="ctx=ctx.shiftBlocks(blocks);","var blocks={"+c.join(",")+"};"):(a.blocks="",a.blocks)}function k(a){var b,c,d=[],e=a.bodies,f=a.blocks;for(b=0,c=e.length;c>b;b++)d[b]="function body_"+b+"(chk,ctx){"+f+"return chk"+e[b]+";}body_"+b+".__dustBody=!0;";return d.join("")}function l(a,b){var c,d,e="";for(c=1,d=b.length;d>c;c++)e+=r.compileNode(a,b[c]);return e}function m(a,b,c){return"."+(dust._aliases[c]||c)+"("+r.compileNode(a,b[1])+","+r.compileNode(a,b[2])+","+r.compileNode(a,b[4])+","+r.compileNode(a,b[3])+")"}function n(a){return a.replace(u,"\\\\").replace(v,'\\"').replace(w,"\\f").replace(x,"\\n").replace(y,"\\r").replace(z,"\\t")}function o(a,b,c){var d=dust.loadSource(dust.compile(a));return q(d)(b,c)}function p(a,b){var c=dust.loadSource(dust.compile(a,b));return q(c)}function q(a){return function(b,c){var d=c?"render":"stream";return dust[d](a,b,c)}}var r={},s=dust.isArray;r.compile=function(c,d){try{var e=b(a(c));return i(e,d)}catch(f){if(!f.line||!f.column)throw f;throw new SyntaxError(f.message+" At line : "+f.line+", column : "+f.column)}},r.filterNode=function(a,b){return r.optimizers[b[0]](a,b)},r.optimizers={body:d,buffer:f,special:e,format:h,reference:c,"#":c,"?":c,"^":c,"<":c,"+":c,"@":c,"%":c,partial:c,context:c,params:c,bodies:c,param:c,filters:f,key:f,path:f,literal:f,raw:f,comment:g,line:g,col:g},r.pragmas={esc:function(a,b,c){var d,e=a.auto;return b||(b="h"),a.auto="s"===b?"":b,d=l(a,c.block),a.auto=e,d}};var t={s:" ",n:"\n",r:"\r",lb:"{",rb:"}"};r.compileNode=function(a,b){return r.nodes[b[0]](a,b)},r.nodes={body:function(a,b){var c=a.index++,d="body_"+c;return a.bodies[c]=l(a,b),d},buffer:function(a,b){return".w("+A(b[1])+")"},format:function(a,b){return".w("+A(b[1])+")"},reference:function(a,b){return".f("+r.compileNode(a,b[1])+",ctx,"+r.compileNode(a,b[2])+")"},"#":function(a,b){return m(a,b,"section")},"?":function(a,b){return m(a,b,"exists")},"^":function(a,b){return m(a,b,"notexists")},"<":function(a,b){for(var c=b[4],d=1,e=c.length;e>d;d++){var f=c[d],g=f[1][1];if("block"===g)return a.blocks[b[1].text]=r.compileNode(a,f[2]),""}return""},"+":function(a,b){return"undefined"==typeof b[1].text&&"undefined"==typeof b[4]?".b(ctx.getBlock("+r.compileNode(a,b[1])+",chk, ctx),"+r.compileNode(a,b[2])+", {},"+r.compileNode(a,b[3])+")":".b(ctx.getBlock("+A(b[1].text)+"),"+r.compileNode(a,b[2])+","+r.compileNode(a,b[4])+","+r.compileNode(a,b[3])+")"},"@":function(a,b){return".h("+A(b[1].text)+","+r.compileNode(a,b[2])+","+r.compileNode(a,b[4])+","+r.compileNode(a,b[3])+")"},"%":function(a,b){var c,d,e,f,g,h,i,j,k,l=b[1][1];if(!r.pragmas[l])return"";for(c=b[4],d={},j=1,k=c.length;k>j;j++)h=c[j],d[h[1][1]]=h[2];for(e=b[3],f={},j=1,k=e.length;k>j;j++)i=e[j],f[i[1][1]]=i[2][1];return g=b[2][1]?b[2][1].text:null,r.pragmas[l](a,g,d,f)},partial:function(a,b){return".p("+r.compileNode(a,b[1])+",ctx,"+r.compileNode(a,b[2])+","+r.compileNode(a,b[3])+")"},context:function(a,b){return b[1]?"ctx.rebase("+r.compileNode(a,b[1])+")":"ctx"},params:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++)c.push(r.compileNode(a,b[d]));return c.length?"{"+c.join(",")+"}":"{}"},bodies:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++)c.push(r.compileNode(a,b[d]));return"{"+c.join(",")+"}"},param:function(a,b){return r.compileNode(a,b[1])+":"+r.compileNode(a,b[2])},filters:function(a,b){for(var c=[],d=1,e=b.length;e>d;d++){var f=b[d];c.push('"'+f+'"')}return'"'+a.auto+'"'+(c.length?",["+c.join(",")+"]":"")},key:function(a,b){return'ctx.get(["'+b[1]+'"], false)'},path:function(a,b){for(var c=b[1],d=b[2],e=[],f=0,g=d.length;g>f;f++)e.push(s(d[f])?r.compileNode(a,d[f]):'"'+d[f]+'"');return"ctx.getPath("+c+", ["+e.join(",")+"])"},literal:function(a,b){return A(b[1])},raw:function(a,b){return".w("+A(b[1])+")"}};var u=/\\/g,v=/"/g,w=/\f/g,x=/\n/g,y=/\r/g,z=/\t/g,A="undefined"==typeof JSON?function(a){return'"'+n(a)+'"'}:JSON.stringify;return dust.compiler=r,dust.compile=dust.compiler.compile,dust.renderSource=o,dust.compileFn=p,dust.filterNode=r.filterNode,dust.optimizers=r.optimizers,dust.pragmas=r.pragmas,dust.compileNode=r.compileNode,dust.nodes=r.nodes,r}),"function"==typeof define&&define.amd&&define.amd.dust===!0&&define(["require","dust.core","dust.compile"],function(require,dust){return dust.onLoad=function(a,b){require([a],function(){b()})},dust});

@@ -1,7 +0,11 @@

To run:
To install:
bower install && ../../bin/dustc views/*.dust --output=lib/compiled.js
npm install && bower install
To (re)compile templates:
../../bin/dustc views/*.dust --output=lib/compiled.js
Then load `index.html` in your browser.
This example shows how to simply load Dust using script tags. Templates are stored in the **views** directory and are then compiled to a single script file that is included on the page.

@@ -7,3 +7,2 @@ {

"dependencies": {
"dustjs-linkedin": "^2.6.1",
"express": "^4.12.3",

@@ -10,0 +9,0 @@ "hoffman": "^0.1.4",

@@ -11,2 +11,4 @@ To run:

Note that Hoffman doesn't always use the most up-to-date version of Dust, so you might need to manually upgrade it by editing its `package.json` file.
More info on Hoffman: https://www.npmjs.com/package/hoffman

@@ -9,2 +9,3 @@ var fs = require('fs'),

// Define a custom `onLoad` function to tell Dust how to load templates
dust.onLoad = function(tmpl, cb) {

@@ -11,0 +12,0 @@ fs.readFile(path.join('./views', path.resolve('/', tmpl + '.dust')),

@@ -9,4 +9,4 @@ /*global process*/

var context = vm.createContext({dust: dust});
dust.loadSource = function(source, path) {
return vm.runInContext(source, context, path);
dust.loadSource = function(source) {
return vm.runInContext(source, context);
};

@@ -13,0 +13,0 @@

@@ -25,5 +25,2 @@ /*jshint latedef:false */

// for the common case (using compile and render) a name is required so that templates will be cached by name and rendered later, by name.
if (!name && name !== null) {
throw new Error('Template name parameter cannot be undefined when calling dust.compile');
}

@@ -81,3 +78,3 @@ try {

compiler.pragmas = {
esc: function(compiler, context, bodies, params) {
esc: function(compiler, context, bodies) {
var old = compiler.auto,

@@ -169,14 +166,26 @@ out;

escapedName = dust.escapeJs(name),
body_0 = 'function(dust){dust.register(' +
(name ? '"' + escapedName + '"' : 'null') + ',' +
compiler.compileNode(context, ast) +
');' +
compileBlocks(context) +
compileBodies(context) +
'return body_0;}';
AMDName = name? '"' + escapedName + '",' : '',
compiled = 'function(dust){',
entry = compiler.compileNode(context, ast),
iife;
if(name) {
compiled += 'dust.register("' + escapedName + '",' + entry + ');';
}
compiled += compileBlocks(context) +
compileBodies(context) +
'return ' + entry + '}';
iife = '(' + compiled + '(dust));';
if(dust.config.amd) {
return 'define("' + escapedName + '",["dust.core"],' + body_0 + ');';
return 'define(' + AMDName + '["dust.core"],' + compiled + ');';
} else if(dust.config.cjs) {
return 'module.exports=function(dust){' +
'var tmpl=' + iife +
'var f=' + loaderFor().toString() + ';' +
'f.template=tmpl;return f}';
} else {
return '(' + body_0 + ')(dust);';
return iife;
}

@@ -196,4 +205,6 @@ }

return 'var blocks={' + out.join(',') + '};';
} else {
context.blocks = '';
}
return context.blocks = '';
return context.blocks;
}

@@ -275,3 +286,3 @@

if (typeof(node[1].text) === 'undefined' && typeof(node[4]) === 'undefined'){
return '.block(ctx.getBlock(' +
return '.b(ctx.getBlock(' +
compiler.compileNode(context, node[1]) +

@@ -282,3 +293,3 @@ ',chk, ctx),' + compiler.compileNode(context, node[2]) + ', {},' +

} else {
return '.block(ctx.getBlock(' +
return '.b(ctx.getBlock(' +
escape(node[1].text) +

@@ -335,3 +346,3 @@ '),' + compiler.compileNode(context, node[2]) + ',' +

compiler.compileNode(context, node[1]) +
',' + compiler.compileNode(context, node[2]) +
',ctx,' + compiler.compileNode(context, node[2]) +
',' + compiler.compileNode(context, node[3]) + ')';

@@ -435,4 +446,26 @@ },

function renderSource(source, context, callback) {
var tmpl = dust.loadSource(dust.compile(source));
return loaderFor(tmpl)(context, callback);
}
function compileFn(source, name) {
var tmpl = dust.loadSource(dust.compile(source, name));
return loaderFor(tmpl);
}
function loaderFor(tmpl) {
return function load(ctx, cb) {
var fn = cb ? 'render' : 'stream';
return dust[fn](tmpl, ctx, cb);
};
}
// expose compiler methods
dust.compile = compiler.compile;
dust.compiler = compiler;
dust.compile = dust.compiler.compile;
dust.renderSource = renderSource;
dust.compileFn = compileFn;
// DEPRECATED legacy names. Removed in 2.8.0
dust.filterNode = compiler.filterNode;

@@ -439,0 +472,0 @@ dust.optimizers = compiler.optimizers;

@@ -12,3 +12,3 @@ (function (root, factory) {

var dust = {
"version": "2.6.2"
"version": "2.7.0"
},

@@ -20,3 +20,5 @@ NONE = 'NONE', ERROR = 'ERROR', WARN = 'WARN', INFO = 'INFO', DEBUG = 'DEBUG',

whitespace: false,
amd: false
amd: false,
cjs: false,
cache: true
};

@@ -89,9 +91,10 @@

}
tmpl.templateName = name;
dust.cache[name] = tmpl;
};
dust.render = function(name, context, callback) {
dust.render = function(nameOrTemplate, context, callback) {
var chunk = new Stub(callback).head;
try {
dust.load(name, chunk, Context.wrap(context, name)).end();
load(nameOrTemplate, chunk, context).end();
} catch (err) {

@@ -102,3 +105,3 @@ chunk.setError(err);

dust.stream = function(name, context) {
dust.stream = function(nameOrTemplate, context) {
var stream = new Stream(),

@@ -108,3 +111,3 @@ chunk = stream.head;

try {
dust.load(name, stream.head, Context.wrap(context, name)).end();
load(nameOrTemplate, chunk, context).end();
} catch (err) {

@@ -117,52 +120,44 @@ chunk.setError(err);

dust.renderSource = function(source, context, callback) {
return dust.compileFn(source)(context, callback);
};
function load(nameOrTemplate, chunk, context) {
if(!nameOrTemplate) {
return chunk.setError(new Error('No template or template name provided to render'));
}
/**
* Compile a template to an invokable function.
* If `name` is provided, also registers the template under `name`.
* @param source {String} template source
* @param [name] {String} template name
* @return {Function} has the signature `fn(context, cb)`
*/
dust.compileFn = function(source, name) {
name = name || null;
var tmpl = dust.loadSource(dust.compile(source, name));
return function(context, callback) {
var master = callback ? new Stub(callback) : new Stream();
dust.nextTick(function() {
if(typeof tmpl === 'function') {
tmpl(master.head, Context.wrap(context, name)).end();
} else {
dust.log(new Error('Template `' + name + '` could not be loaded'), ERROR);
}
});
return master;
};
};
if(!dust.config.cache) {
dust.cache = {};
}
dust.load = function(name, chunk, context) {
var tmpl = dust.cache[name];
var tmpl;
if(typeof nameOrTemplate === 'function' && nameOrTemplate.template) {
// Sugar away CommonJS module templates
tmpl = nameOrTemplate.template;
} else if(dust.isTemplateFn(nameOrTemplate)) {
// Template functions passed directly
tmpl = nameOrTemplate;
} else {
// Load a template with this name from cache
tmpl = dust.cache[nameOrTemplate];
}
if (tmpl) {
return tmpl(chunk, context);
return tmpl(chunk, Context.wrap(context, tmpl.templateName));
} else {
if (dust.onLoad) {
return chunk.map(function(chunk) {
dust.onLoad(name, function(err, src) {
dust.onLoad(nameOrTemplate, function(err, src) {
if (err) {
return chunk.setError(err);
}
if (!dust.cache[name]) {
dust.loadSource(dust.compile(src, name));
if (!dust.cache[nameOrTemplate]) {
dust.loadSource(dust.compile(src, nameOrTemplate));
}
dust.cache[name](chunk, context).end();
dust.cache[nameOrTemplate](chunk, Context.wrap(context, nameOrTemplate)).end();
});
});
}
return chunk.setError(new Error('Template Not Found: ' + name));
return chunk.setError(new Error('Template Not Found: ' + nameOrTemplate));
}
};
}
dust.loadSource = function(source, path) {
dust.loadSource = function(source) {
/*jshint evil:true*/

@@ -182,5 +177,5 @@ return eval(source);

return function(callback) {
setTimeout(callback,0);
setTimeout(callback, 0);
};
} )();
})();

@@ -220,2 +215,7 @@ /**

dust.isTemplateFn = function(elem) {
return typeof elem === 'function' &&
elem.__dustBody;
};
/**

@@ -232,2 +232,12 @@ * Decide somewhat-naively if something is a Thenable.

/**
* Decide very naively if something is a Stream.
* @param elem {*} object to inspect
* @return {Boolean} is `elem` a Stream?
*/
dust.isStreamable = function(elem) {
return elem &&
typeof elem.on === 'function';
};
// apply the filter chain and return the output string

@@ -273,2 +283,5 @@ dust.filter = function(string, auto, filters) {

function Context(stack, global, blocks, templateName) {
if(stack !== undefined && !(stack instanceof Stack)) {
stack = new Stack(stack);
}
this.stack = stack;

@@ -281,3 +294,3 @@ this.global = global;

dust.makeBase = function(global) {
return new Context(new Stack(), global);
return new Context(undefined, global);
};

@@ -301,3 +314,3 @@

}
return new Context(new Stack(context), {}, null, name);
return new Context(context, {}, null, name);
};

@@ -363,6 +376,7 @@

// Try looking in the global context if we haven't found anything yet
if (value !== undefined) {
ctx = value;
} else {
ctx = this.global ? this.global[first] : undefined;
ctx = this.global && this.global[first];
}

@@ -414,3 +428,7 @@ } else if (ctx) {

Context.prototype.push = function(head, idx, len) {
return new Context(new Stack(head, this.stack, idx, len), this.global, this.blocks, this.getTemplateName());
if(head === undefined) {
dust.log("Not pushing an undefined variable onto the context", INFO);
return this;
}
return this.rebase(new Stack(head, this.stack, idx, len));
};

@@ -425,3 +443,3 @@

Context.prototype.rebase = function(head) {
return new Context(new Stack(head), this.global, this.blocks, this.getTemplateName());
return new Context(head, this.global, this.blocks, this.getTemplateName());
};

@@ -439,3 +457,3 @@

Context.prototype.getBlock = function(key, chk, ctx) {
Context.prototype.getBlock = function(key) {
var blocks, len, fn;

@@ -488,6 +506,6 @@

chunk = new Chunk().render(body, this);
if(!body.__dustBody) {
return chunk;
if(chunk instanceof Chunk) {
return chunk.data.join(''); // ie7 perf
}
return chunk.data.join(''); // ie7 perf
return chunk;
};

@@ -533,2 +551,5 @@

/**
* Creates an interface sort of like a Streams2 ReadableStream.
*/
function Stream() {

@@ -546,2 +567,3 @@ this.head = new Chunk(this);

this.emit('error', chunk.error);
this.emit('end');
dust.log('Streaming failed with error `' + chunk.error + '`', ERROR);

@@ -559,2 +581,7 @@ this.flush = EMPTY_FUNC;

/**
* Executes listeners for `type` by passing data. Note that this is different from a
* Node stream, which can pass an arbitrary number of arguments
* @return `true` if event had listeners, `false` otherwise
*/
Stream.prototype.emit = function(type, data) {

@@ -567,3 +594,3 @@ var events = this.events || {},

dust.log('Stream broadcasting, but no listeners for `' + type + '`', DEBUG);
return;
return false;
}

@@ -575,2 +602,3 @@

}
return true;
};

@@ -590,5 +618,32 @@

/**
* Pipes to a WritableStream. Note that backpressure isn't implemented,
* so we just write as fast as we can.
* @param stream {WritableStream}
* @return self
*/
Stream.prototype.pipe = function(stream) {
if(typeof stream.write !== 'function' ||
typeof stream.end !== 'function') {
dust.log('Incompatible stream passed to `pipe`', WARN);
return this;
}
var destEnded = false;
if(typeof stream.emit === 'function') {
stream.emit('pipe', this);
}
if(typeof stream.on === 'function') {
stream.on('error', function() {
destEnded = true;
});
}
return this
.on('data', function(data) {
if(destEnded) {
return;
}
try {

@@ -601,10 +656,11 @@ stream.write(data, 'utf8');

.on('end', function() {
if(destEnded) {
return;
}
try {
stream.end();
destEnded = true;
} catch (err) {
dust.log(err, ERROR);
}
})
.on('error', function(err) {
stream.error(err);
});

@@ -680,6 +736,10 @@ };

return elem;
} else {
return this.reference(elem, context, auto, filters);
}
}
if (dust.isThenable(elem)) {
return this.await(elem, context);
return this.await(elem, context, null, auto, filters);
} else if (dust.isStreamable(elem)) {
return this.stream(elem, context, null, auto, filters);
} else if (!dust.isEmpty(elem)) {

@@ -698,3 +758,3 @@ return this.write(dust.filter(elem, auto, filters));

if (typeof elem === 'function' && !elem.__dustBody) {
if (typeof elem === 'function' && !dust.isTemplateFn(elem)) {
try {

@@ -728,7 +788,7 @@ elem = elem.apply(context.current(), [this, context, bodies, params]);

if(context.stack.head) {
context.stack.head['$len'] = len;
context.stack.head.$len = len;
}
for (i = 0; i < len; i++) {
if(context.stack.head) {
context.stack.head['$idx'] = i;
context.stack.head.$idx = i;
}

@@ -738,4 +798,4 @@ chunk = body(chunk, context.push(elem[i], i, len));

if(context.stack.head) {
context.stack.head['$idx'] = undefined;
context.stack.head['$len'] = undefined;
context.stack.head.$idx = undefined;
context.stack.head.$len = undefined;
}

@@ -750,2 +810,4 @@ return chunk;

return this.await(elem, context, bodies);
} else if (dust.isStreamable(elem)) {
return this.stream(elem, context, bodies);
} else if (elem === true) {

@@ -811,22 +873,22 @@ // true is truthy but does not change context

Chunk.prototype.partial = function(elem, context, params) {
Chunk.prototype.partial = function(elem, context, partialContext, params) {
var head;
if (!dust.isEmptyObject(params)) {
context = context.clone();
head = context.pop();
context = context.push(params)
.push(head);
partialContext = partialContext.clone();
head = partialContext.pop();
partialContext = partialContext.push(params)
.push(head);
}
if (elem.__dustBody) {
if (dust.isTemplateFn(elem)) {
// The eventual result of evaluating `elem` is a partial name
// Load the partial after getting its name and end the async chunk
return this.capture(elem, context, function(name, chunk) {
context.templateName = name;
dust.load(name, chunk, context).end();
partialContext.templateName = name;
load(name, chunk, partialContext).end();
});
} else {
context.templateName = elem;
return dust.load(elem, this, context);
partialContext.templateName = elem;
return load(elem, this, partialContext);
}

@@ -863,3 +925,3 @@ };

*/
Chunk.prototype.await = function(thenable, context, bodies) {
Chunk.prototype.await = function(thenable, context, bodies, auto, filters) {
var body = bodies && bodies.block,

@@ -872,3 +934,3 @@ errorBody = bodies && bodies.error;

} else {
chunk.end(data);
chunk.reference(data, context, auto, filters).end();
}

@@ -886,2 +948,55 @@ }, function(err) {

/**
* Reserve a chunk to be evaluated with the contents of a streamable.
* Currently an error event will bomb out the stream. Once an error
* is received, we push it to an {:error} block if one exists, and log otherwise,
* then stop listening to the stream.
* @param streamable {Streamable} the target streamable that will emit events
* @param context {Context} context to use to render each thunk
* @param bodies {Object} must contain a "body", may contain an "error"
* @return {Chunk}
*/
Chunk.prototype.stream = function(stream, context, bodies, auto, filters) {
var body = bodies && bodies.block,
errorBody = bodies && bodies.error;
return this.map(function(chunk) {
var ended = false;
stream
.on('data', function data(thunk) {
if(ended) {
return;
}
if(body) {
// Fork a new chunk out of the blockstream so that we can flush it independently
chunk = chunk.map(function(chunk) {
chunk.render(body, context.push(thunk)).end();
});
} else {
// Don't fork, just write into the master async chunk
chunk = chunk.reference(thunk, context, auto, filters);
}
})
.on('error', function error(err) {
if(ended) {
return;
}
if(errorBody) {
chunk.render(errorBody, context.push(err));
} else {
dust.log('Unhandled stream error in `' + context.getTemplateName() + '`');
}
if(!ended) {
ended = true;
chunk.end();
}
})
.on('end', function end() {
if(!ended) {
ended = true;
chunk.end();
}
});
});
};
Chunk.prototype.capture = function(body, context, callback) {

@@ -888,0 +1003,0 @@ return this.map(function(chunk) {

{
"name": "dustjs-linkedin",
"title": "Dust - Asynchronous Templating",
"version": "2.6.2",
"version": "2.7.0",
"author": {

@@ -9,4 +8,4 @@ "name": "Aleksander Williams",

},
"homepage": "http://linkedin.github.io/dustjs/",
"description": "Asynchronous templates for the browser and node.js ( LinkedIn fork )",
"homepage": "http://dustjs.com/",
"description": "Asynchronous templates for the browser and server (LinkedIn fork)",
"contributors": [

@@ -44,3 +43,3 @@ "Veena Basavaraj <vybs@users.noreply.github.com>",

"dependencies": {
"chokidar": "~1.0.0-rc4",
"chokidar": "~1.0.0",
"cli": "~0.6.5"

@@ -61,5 +60,7 @@ },

"grunt-gh-pages": "~0.10.0",
"grunt-github-changes": "~0.0.6",
"grunt-jasmine-nodejs": "~1.0.2",
"grunt-shell": "~1.1.2",
"grunt-template-jasmine-istanbul": "~0.3.3",
"highland": "2.4.0",
"pegjs": "0.8.0"

@@ -69,4 +70,4 @@ },

"engine": {
"node": ">=0.8"
"node": ">=0.10"
}
}

@@ -8,3 +8,3 @@ # Dust.js [![Build Status](https://secure.travis-ci.org/linkedin/dustjs.png)](http://travis-ci.org/linkedin/dustjs)

npm install --save dustjs-linkedin
npm install --save --production dustjs-linkedin
# If you want the dustc compiler available globally

@@ -15,4 +15,4 @@ npm install -g dustjs-linkedin

npm install --save dustjs-helpers
npm install --save dustjs-filters-secure
npm install --save --production dustjs-helpers
npm install --save --production dustjs-filters-secure

@@ -19,0 +19,0 @@ ### Bower

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc