=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/
+
+
+
+
+
+
+
+
+"""
+
+htmlFinalText = """
+
+
+
+
+
+
+
+
+
+
+
+"""
+
+indentHostCoffee = """
+test = () ->
+ ###import 'indentChild.coffee' ###
+"""
+
+indentChildCoffee = """
+printStuff: () ->
+
+ ###import 'indentGrandChild.coffee' ###
+
+
+"""
+
+indentGrandChildCoffee = """
+console.log "this is just some text and stuff"
+console.log "this is a second line, just to be sure"
+"""
+
+indentResultCoffee = """
+test = () ->
+ printStuff: () ->
+
+ console.log "this is just some text and stuff"
+ console.log "this is a second line, just to be sure"
+
+
+"""
+
+createFile = ( local, name, working, content ) ->
+ dependents: 0
+ ext: () -> path.extname name
+ fullPath: path.join working, name
+ imports: []
+ name: name
+ originalName: name
+ relativePath: working
+ workingPath: working
+ content: content
+ combined: false
+
+oneCoffee = createFile "source", "one.coffee", "tmp", coffeeOneTxt
+twoCoffee = createFile "source", "two.coffee", "tmp", coffeeTwoTxt
+threeCoffee = createFile "source", "three.coffee", "tmp", coffeeThreeTxt
+
+fourJs = createFile "source", "four.js", "tmp", jsFourTxt
+fiveJs = createFile "source", "five.js", "tmp", jsFiveTxt
+sixJs = createFile "source", "six.js", "tmp", jsSixTxt
+
+oneCss = createFile "style", "one.css", "tmp", cssOneTxt
+twoCss = createFile "style", "two.css", "tmp", cssTwoTxt
+ignored = createFile "style", "ignored.less", "tmp", ignoredTxt
+
+htmlFile = createFile "markup", "one.html", "tmp", htmlText
+
+indentHost = createFile "source", "indentHost.coffee", "tmp", indentHostCoffee
+indentChild = createFile "source", "indentChild.coffeee", "tmp", indentChildCoffee
+indentGrandChild = createFile "source", "indentGrandChild.coffeee", "tmp", indentGrandChildCoffee
+indentResult = createFile "source", "indentResult.coffee", "tmp", indentResultCoffee
+
+all = [ oneCoffee, twoCoffee, threeCoffee, fourJs, fiveJs, sixJs, oneCss, twoCss, ignored, htmlFile, indentHost, indentChild, indentGrandChild, indentResult ]
+
+describe "when adding files for tests", ->
+
+ it "should have created all files", ( ready ) ->
+ scheduler.parallel(
+ all,
+ ( x, done ) ->
+ fp.write x.fullPath, x.content, done
+ , () -> ready()
+ )
+
+describe "when getting imports for coffeescript", ->
+ combine = new Combiner sourceFindPatterns, sourceReplacePatterns
+ coffeeFiles = [ oneCoffee, twoCoffee, threeCoffee ]
+ findImport = ( file, done ) ->
+ combine.findImports file, coffeeFiles, done
+
+ before ( done ) ->
+ scheduler.parallel coffeeFiles, findImport, () -> done()
+
+ it "one.coffee should have 1 import", () ->
+ oneCoffee.imports.length.should.equal 1
+
+ it "one.coffee should import two.coffee", () ->
+ oneCoffee.imports[0].name.should.equal "two.coffee"
+
+ it "three.coffee should have 1 import", () ->
+ threeCoffee.imports.length.should.equal 1
+
+ it "three.coffee should import one.coffee", () ->
+ threeCoffee.imports[0].name.should.equal "one.coffee"
+
+ it "two.coffee should have no imports", () ->
+ twoCoffee.imports.length.should.equal 0
+
+describe "when getting dependencies for coffeescript", ->
+ combine = new Combiner sourceFindPatterns, sourceReplacePatterns
+ coffeeFiles = [ oneCoffee, twoCoffee, threeCoffee ]
+
+ before () ->
+ for f in coffeeFiles
+ combine.findDependents f, coffeeFiles
+
+ it "one.coffee should have 1 dependent", () ->
+ oneCoffee.dependents.should.equal 1
+
+ it "two.coffee should have 1 dependent", () ->
+ twoCoffee.dependents.should.equal 1
+
+ it "three.coffee should have no dependents", () ->
+ threeCoffee.dependents.should.equal 0
+
+describe "when combining coffee files", ->
+ combine = new Combiner sourceFindPatterns, sourceReplacePatterns
+ coffeeFiles = [ oneCoffee, twoCoffee, threeCoffee ]
+
+ wrapper = ( f, done ) ->
+ combine.combineFile f, done
+
+ before ( done ) ->
+ scheduler.parallel coffeeFiles, wrapper, () -> done()
+
+ it "should combine files correctly", ( done ) ->
+ fp.read [ threeCoffee.workingPath, threeCoffee.name ], ( content ) ->
+ compareOutput content, coffeeFinalTxt
+ done()
+
+describe "when combining js files", ->
+ combine = new Combiner sourceFindPatterns, sourceReplacePatterns
+ jsFiles = [ fourJs, fiveJs, sixJs ]
+
+ before ( done ) ->
+ combine.combineList jsFiles, () -> done()
+
+ it "should combine files correctly", ( done ) ->
+ fp.read [ sixJs.workingPath, sixJs.name ], ( content ) ->
+ compareOutput content, jsFinalTxt
+ done()
+
+describe "when getting imports for css", ->
+ combine = new Combiner cssFindPatterns, cssReplacePatterns
+ cssFiles = [ oneCss, twoCss, ignored ]
+ findImport = ( file, done ) ->
+ combine.findImports file, cssFiles, done
+
+ before ( done ) ->
+ scheduler.parallel cssFiles, findImport, () -> done()
+
+ it "one.css should have 1 import", () ->
+ oneCss.imports.length.should.equal 1
+
+ it "one.css should import two.css", () ->
+ oneCss.imports[0].name.should.equal "two.css"
+
+ it "two.coffee should have no imports", () ->
+ twoCoffee.imports.length.should.equal 0
+
+describe "when getting dependencies for css", ->
+ combine = new Combiner cssFindPatterns, cssReplacePatterns
+ cssFiles = [ oneCss, twoCss, ignored ]
+
+ before () ->
+ for f in cssFiles
+ combine.findDependents f, cssFiles
+
+ it "one.css should have no dependents", () ->
+ oneCss.dependents.should.equal 0
+
+ it "two.css should have 1 dependent", () ->
+ twoCss.dependents.should.equal 1
+
+describe "when combining css files", ->
+ combine = new Combiner cssFindPatterns, cssReplacePatterns
+ cssFiles = [ oneCss, twoCss, ignored ]
+
+ before ( done ) ->
+ combine.combineList cssFiles, () -> done()
+
+ it "should combine files correctly", ( done ) ->
+ fp.read [ oneCss.workingPath, oneCss.name ], ( content ) ->
+ compareOutput content, cssFinalTxt
+ done()
+
+
+describe "when getting imports for html", ->
+ combine = new Combiner htmlFindPatterns, htmlReplacePatterns
+ htmlFiles = [ htmlFile ]
+ findImport = ( file, done ) ->
+ combine.findImports file, all, done
+
+ before ( done ) ->
+ scheduler.parallel htmlFiles, findImport, () -> done()
+
+ it "one.html should have 3 import", () ->
+ htmlFile.imports.length.should.equal 3
+
+ it "one.html should import one.css", () ->
+ htmlFile.imports[2].name.should.equal "one.css"
+
+ it "one.html should import three.coffee", () ->
+ htmlFile.imports[0].name.should.equal "three.coffee"
+
+ it "one.html should import six.js", () ->
+ htmlFile.imports[1].name.should.equal "six.js"
+
+describe "when combining html with other resources", ->
+ combine = new Combiner htmlFindPatterns, htmlReplacePatterns
+ htmlFiles = [ htmlFile ]
+
+ before ( done ) ->
+ combine.combineFile htmlFile, () -> done()
+
+ it "should combine files correctly", ( done ) ->
+ fp.read [ htmlFile.workingPath, htmlFile.name ], ( content ) ->
+ compareOutput content, htmlFinalText
+ done()
+
+describe "when combining files with indented import statements", ->
+ combine = new Combiner sourceFindPatterns, sourceReplacePatterns
+ coffeeFiles = [ indentHost, indentChild, indentGrandChild ]
+
+ wrapper = ( f, done ) ->
+ combine.combineFile f, done
+
+ before ( done ) ->
+ scheduler.parallel coffeeFiles, wrapper, () -> done()
+
+ it "should combine files correctly", ( done ) ->
+ fp.read [ indentResult.workingPath, indentResult.name ], ( content ) ->
+ content.should.equal indentResultCoffee
+ done()
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/spec/compiler.specs.coffee b/node_modules/anvil.js/next/spec/compiler.specs.coffee
new file mode 100644
index 0000000..617a735
--- /dev/null
+++ b/node_modules/anvil.js/next/spec/compiler.specs.coffee
@@ -0,0 +1,680 @@
+_ = require "underscore"
+log = require( "./logMock.coffee" ).log
+FP = require( "./fsMock.coffee" ).fsProvider
+Compiler = require( "../src/compile.coffee").compiler
+path = require "path"
+
+require "should"
+
+fp = new FP()
+compiler = new Compiler fp, log
+
+stripSpace = ( content ) -> content.replace ///\s///g, ""
+compareOutput = ( one, two ) -> ( stripSpace one ).should.equal ( stripSpace two )
+
+#------------------------------------------------------------------------------
+#
+# Coffee Resources
+#
+#------------------------------------------------------------------------------
+goodCoffee =
+"""
+class GoodClass
+ constructor: ( @name ) ->
+
+ method: () ->
+ console.log 'this is a method call!'
+
+"""
+
+goodJs = """
+var GoodClass;
+
+GoodClass = (function() {
+
+function GoodClass(name) {
+ this.name = name;
+}
+
+GoodClass.prototype.method = function() {
+ return console.log('this is a method call!');
+};
+
+return GoodClass;
+
+})();
+"""
+
+badCoffee = """
+ var Test = function( name ) {
+ console.log( 'This is bad coffee, yo :(' );
+ };
+"""
+
+
+#------------------------------------------------------------------------------
+#
+# CoffeeKup Resources
+#
+#------------------------------------------------------------------------------
+goodKup =
+"""
+doctype 5
+html ->
+ head ->
+ body ->
+ div class: "hero-unit", ->
+ h1 "Learn CoffeeKup ... I have no idea why"
+ span class: "snark", "Maybe to prove you can do it"
+"""
+
+kupHtml = """
+
+
+
+
+
+
+
Learn CoffeeKup ... I have no idea why
+ Maybe to prove you can do it
+
+
+
+"""
+
+badKup = """
+
+
+ This isn't going to work out
+
+
+"""
+
+#------------------------------------------------------------------------------
+#
+# HAML Resources
+#
+#------------------------------------------------------------------------------
+goodHaml =
+"""
+!!!
+%html
+ %head
+ %body
+ .hero-unit
+ %h1 Learn HAML For Fun And Profit
+ %span.snark Great good seems like reaching a bit...
+"""
+
+hamlHtml = """
+
+
+
+
+
+
Learn HAML For Fun And Profit
+ Great good seems like reaching a bit...
+
+
+
+"""
+
+badHaml = """
+TURP
+"""
+
+#------------------------------------------------------------------------------
+#
+# Markdown Resources
+#
+#------------------------------------------------------------------------------
+goodMarkdown =
+"""
+# This Has Limited Uses
+
+ * Use it for content
+ * Let Anvil combine it into pages like a mix-in
+"""
+
+markdownHtml = """
+This Has Limited Uses
+
+* Use it for content
+* Let Anvil combine it into pages like a mix-in
+
+"""
+
+badMarkdown = """
+!()[{}]
+"""
+
+#------------------------------------------------------------------------------
+#
+# Less Resources
+#
+#------------------------------------------------------------------------------
+goodLess =
+"""
+.rounded-corners (@radius: 5px) {
+ border-radius: @radius;
+ -webkit-border-radius: @radius;
+ -moz-border-radius: @radius;
+}
+
+#header {
+ .rounded-corners;
+}
+#footer {
+ .rounded-corners(10px);
+}
+"""
+
+lessCss = """
+#header {
+ border-radius: 5px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+}
+#footer {
+ border-radius: 10px;
+ -webkit-border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+"""
+
+badLess = """
+this shouldn't work
+"""
+
+#------------------------------------------------------------------------------
+#
+# Sass Resources
+#
+#------------------------------------------------------------------------------
+goodSass =
+"""
+$blue: #3bbfce
+$margin: 16px
+
+.content-navigation
+ border-color: $blue
+ color: darken($blue, 9%)
+
+.border
+ padding: $margin / 2
+ margin: $margin / 2
+ border-color: $blue
+"""
+
+sassCss = """
+.content-navigation {
+ border-color: #3bbfce;
+ color: #2b9eab;
+}
+
+.border {
+ padding: 8px;
+ margin: 8px;
+ border-color: #3bbfce;
+}
+"""
+
+badSass = """
+this shouldn't work
+"""
+
+#------------------------------------------------------------------------------
+#
+# Scss Resources
+#
+#------------------------------------------------------------------------------
+goodScss =
+"""
+$blue: #3bbfce;
+$margin: 16px;
+
+.content-navigation {
+ border-color: $blue;
+ color:
+ darken($blue, 9%);
+}
+
+.border {
+ padding: $margin / 2;
+ margin: $margin / 2;
+ border-color: $blue;
+}
+"""
+
+scssCss = """
+.content-navigation {
+ border-color: #3bbfce;
+ color: #2b9eab;
+}
+
+.border {
+ padding: 8px;
+ margin: 8px;
+ border-color: #3bbfce;
+}
+"""
+
+badScss = """
+this shouldn't work
+"""
+
+#------------------------------------------------------------------------------
+#
+# Stylus Resources
+#
+#------------------------------------------------------------------------------
+goodStylus =
+"""
+font-size = 14px
+
+body
+ font font-size Arial, sans-serif
+"""
+
+stylusCss = """
+body {
+ font: 14px Arial, sans-serif;
+ }
+"""
+
+badStylus = """
+this shouldn't work
+"""
+
+#------------------------------------------------------------------------------
+#
+# CoffeeScript Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid coffeescript", ->
+
+ file =
+ name: "good.coffee"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.coffee", goodCoffee, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a JavaScript file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid JavaScript", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ compareOutput content, goodJs
+ done()
+
+describe "when compiling invalid coffeescript", ->
+
+ file =
+ name: "good.coffee"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ errorCode = undefined
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.coffee", badCoffee, () ->
+ compiler.compile file, ( err ) ->
+ errorCode = err
+ done()
+
+
+ it "should not create a JavaScript file", () ->
+ fp.pathExists( [ file.workingPath, file.name ] ).should.not.be
+
+ it "should produce error message", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ errorCode.toString().should.equal 'SyntaxError: Reserved word "var" on line 1'
+ done()
+
+#------------------------------------------------------------------------------
+#
+# CoffeeKup Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid coffeekup", ->
+
+ file =
+ name: "good.kup"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.kup", goodKup, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a html file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid html", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ compareOutput content, kupHtml
+ done()
+
+describe "when compiling invalid coffeekup", ->
+
+ file =
+ name: "bad.kup"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ errorCode = undefined
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/bad.kup", badKup, () ->
+ compiler.compile file, ( err ) ->
+ errorCode = err
+ done()
+
+
+ it "should not create a html file", () ->
+ fp.pathExists( [ file.workingPath, file.name ] ).should.not.be
+
+ it "should produce error message", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ errorCode.toString().should.equal "Error: Parse error on line 1: Unexpected 'COMPARE'"
+ done()
+
+#------------------------------------------------------------------------------
+#
+# Haml Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid Haml", ->
+
+ file =
+ name: "good.haml"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.haml", goodHaml, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a html file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid html", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ compareOutput content, hamlHtml
+ done()
+
+describe "when compiling invalid Haml", ->
+
+ file =
+ name: "bad.haml"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ errorCode = undefined
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/bad.haml", badKup, () ->
+ compiler.compile file, ( err ) ->
+ errorCode = err
+ done()
+
+
+ it "should not create a html file", () ->
+ fp.pathExists( [ file.workingPath, file.name ] ).should.not.be
+
+ it "should produce error message", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ #errorCode.should.equal "Error: Parse error on line 1: Unexpected 'COMPARE'"
+ done()
+
+#------------------------------------------------------------------------------
+#
+# Markdown Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid Markdown", ->
+
+ file =
+ name: "good.markdown"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.markdown", goodMarkdown, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a html file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid html", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ compareOutput content, markdownHtml
+ done()
+
+describe "when compiling invalid Markdown", ->
+
+ file =
+ name: "bad.markdown"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/bad.markdown", badMarkdown, () ->
+ compiler.compile file, () -> done()
+
+ it "should produce hot garbage", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ content.should.not.equal hamlHtml
+ done()
+
+#------------------------------------------------------------------------------
+#
+# Less Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid Less", ->
+
+ file =
+ name: "good.less"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.less", goodLess, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a css file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid css", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ compareOutput content, lessCss
+ done()
+
+describe "when compiling invalid Less", ->
+
+ file =
+ name: "bad.less"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+ errorCode = undefined
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/bad.less", badLess, () ->
+ compiler.compile file, ( err ) ->
+ errorCode = err
+ done()
+
+ it "should not produce css file", () ->
+ ( fp.pathExists [ file.workingPath, file.name ] ).should.not.be
+
+#------------------------------------------------------------------------------
+#
+# Sass Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid Sass", ->
+
+ file =
+ name: "good.sass"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.sass", goodSass, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a css file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid css", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ #compareOutput content, sassCss
+ done()
+
+describe "when compiling invalid Sass", ->
+
+ file =
+ name: "bad.sass"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+ errorCode = undefined
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/bad.sass", badSass, () ->
+ compiler.compile file, ( err ) ->
+ errorCode = err
+ done()
+
+ it "should not produce css file", () ->
+ ( fp.pathExists [ file.workingPath, file.name ] ).should.not.be
+
+# it "should return an error", () ->
+# errorCode.should.exist
+
+#------------------------------------------------------------------------------
+#
+# Scss Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid Scss", ->
+
+ file =
+ name: "good.scss"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.scss", goodScss, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a css file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid css", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ #compareOutput scssCss, content
+ done()
+
+describe "when compiling invalid Scss", ->
+
+ file =
+ name: "bad.scss"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+ errorCode = undefined
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/bad.scss", badScss, () ->
+ compiler.compile file, ( err ) ->
+ errorCode = err
+ done()
+
+ it "should not produce css file", () ->
+ ( fp.pathExists [ file.workingPath, file.name ] ).should.not.be
+
+# it "should return an error", () ->
+# errorCode.should.exist
+
+#------------------------------------------------------------------------------
+#
+# Stylus Compiler
+#
+#------------------------------------------------------------------------------
+
+describe "when compiling valid Stylus", ->
+
+ file =
+ name: "good.styl"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/good.styl", goodStylus, () ->
+ compiler.compile file, () -> done()
+
+ it "should create a css file", () ->
+ fp.pathExists [ file.workingPath, file.name ].should.be.ok
+
+ it "should produce valid css", ( done ) ->
+ fp.read [ file.workingPath, file.name ], ( content ) ->
+ compareOutput content, stylusCss
+ done()
+
+describe "when compiling invalid Stylus", ->
+
+ file =
+ name: "bad.styl"
+ workingPath: "tmp"
+ ext: () -> path.extname @name
+ errorCode = undefined
+ fp.reset();
+
+ before ( done ) ->
+ fp.write "tmp/bad.styl", badStylus, () ->
+ compiler.compile file, ( err ) ->
+ errorCode = err
+ done()
+
+ it "should not produce css file", () ->
+ ( fp.pathExists [ file.workingPath, file.name ] ).should.not.be
+
+ #it "should return an error", () ->
+ # errorCode.should.exist
diff --git a/node_modules/anvil.js/next/spec/config.specs.coffee b/node_modules/anvil.js/next/spec/config.specs.coffee
new file mode 100644
index 0000000..63dcd18
--- /dev/null
+++ b/node_modules/anvil.js/next/spec/config.specs.coffee
@@ -0,0 +1,396 @@
+_ = require "underscore"
+log = require( "./logMock.coffee" ).log
+FP = require( "./fsMock.coffee" ).fsProvider
+Configuration = require( "../src/config").configuration
+Scheduler = require( "../src/scheduler.coffee").scheduler
+scheduler = new Scheduler()
+
+require "should"
+
+defaultSiteConfig =
+ "source": "src"
+ "style": "style"
+ "markup": "markup"
+ "output":
+ {
+ "source": [ "lib", "site/js" ],
+ "style": [ "css", "site/css" ],
+ "markup": "site/"
+ }
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "cssmin": {}
+ "hosts": {
+ "/": "site"
+ }
+ "working": "./tmp"
+
+defaultLibConfig =
+ "source": "src"
+ "output": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "hosts": {
+ "/": "spec"
+ }
+ "working": "./tmp"
+
+class Anvil
+ constructor: () ->
+ build: () ->
+
+describe "when building in lib without build file", ->
+ fp = new FP()
+ cp = new Configuration fp, scheduler, log
+
+ it "should provide default lib configuration", ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ defaultLibConfig.output =
+ "style": "lib"
+ "source": "lib"
+ "markup": "lib"
+ _.isEqual( config, defaultLibConfig ).should.be.ok
+ done()
+
+describe "when building in site without build file", ->
+ fp = new FP()
+ cp = new Configuration fp, scheduler, log
+
+ before ( done ) ->
+ fp.ensurePath "./site", done
+
+ it "should provide default site configuration", ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ _.isEqual( config, defaultSiteConfig ).should.be.ok
+ done()
+
+describe "when using default build.json file", ->
+ fp = new FP()
+
+ build =
+ "source": "thisHereIsMuhSource"
+ "output":
+ "style": "lib"
+ "source": "lib"
+ "markup": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "finalize": {}
+ "wrap": {}
+
+ before ( done ) ->
+ json = JSON.stringify build
+ fp.write "./build.json", json, done
+
+ cp = new Configuration fp, scheduler, log
+
+ it "should use the loaded file", ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ build.working = "./tmp"
+ _.isEqual( config, build ).should.be.ok
+ done()
+
+describe "when specifying CI", ->
+ fp = new FP()
+ cp = new Configuration fp, scheduler, log
+
+ it "should set continuous flag", ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil", "--ci" ], ( config ) ->
+ config.continuous.should.be.ok
+ done()
+
+describe "when specifying hosting", ->
+ fp = new FP()
+ cp = new Configuration fp, scheduler, log
+
+ it "should set host flag", ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil", "--host" ], ( config ) ->
+ config.host.should.be.ok
+ done()
+
+describe "when lib scaffold is requested", ->
+ fp = new FP()
+ cp = new Configuration fp, scheduler, log
+
+ config = {}
+ before ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil", "--lib", "newlib" ], ( cfg ) ->
+ config = cfg
+ done()
+
+ describe "once scaffold is complete", ->
+ it "should create source folder", () -> fp.paths["newlib/src"].should.be.ok
+ it "should create lib folder", () -> fp.paths["newlib/lib"].should.be.ok
+ it "should create ext folder", () -> fp.paths["newlib/ext"].should.be.ok
+ it "should create spec folder", () -> fp.paths["newlib/spec"].should.be.ok
+ it "should create the standard lib build config", () ->
+ # validate that build file is standard site build
+ delete config[ "host" ]
+ delete config[ "continuous" ]
+ _.isEqual( config, defaultLibConfig ).should.be.ok
+
+describe "when site scaffold is requested", ->
+ fp = new FP()
+ cp = new Configuration fp, scheduler, log
+
+ config = {}
+ before ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil", "--site", "newSite" ], ( cfg ) ->
+ config = cfg
+ done()
+
+ describe "once scaffold is complete", ->
+ it "should create source folder", () -> fp.paths["newSite/src"].should.be.ok
+ it "should create style folder", () -> fp.paths["newSite/style"].should.be.ok
+ it "should create markup folder", () -> fp.paths["newSite/markup"].should.be.ok
+ it "should create lib folder", () -> fp.paths["newSite/lib"].should.be.ok
+ it "should create css folder", () -> fp.paths["newSite/css"].should.be.ok
+ it "should create site/css folder", () -> fp.paths["newSite/site/css"].should.be.ok
+ it "should create site/js folder", () -> fp.paths["newSite/site/js"].should.be.ok
+ it "should create ext folder", () -> fp.paths["newSite/ext"].should.be.ok
+ it "should create spec folder", () -> fp.paths["newSite/spec"].should.be.ok
+ it "should create the standard site build config", () ->
+ # validate that build file is standard site build
+ _.isEqual( config, defaultSiteConfig ).should.be.ok
+
+describe "when requesting new lib build file", ->
+ fp = new FP()
+ cp = new Configuration fp, scheduler, log
+
+ it "should create the default lib configuration", ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil", "--libfile", "new" ], ( config ) ->
+ fp.read "new.json", ( content ) ->
+ obj = JSON.parse content
+ delete obj["host"]
+ delete obj["continuous"]
+
+ _.isEqual( obj, defaultLibConfig ).should.be.ok
+ done()
+
+describe "when requesting new site build file", ->
+ fp = new FP()
+ process.argv.push "--sitefile"
+ process.argv.push "new"
+ cp = new Configuration fp, scheduler, log
+
+ it "should create the default site configuration", ( done ) ->
+ cp.configure [ "coffee", "./bin/anvil", "--sitefile", "new" ], ( config ) ->
+ fp.read "new.json", ( content ) ->
+ obj = JSON.parse content
+ delete obj["host"]
+ delete obj["continuous"]
+ _.isEqual( obj, defaultSiteConfig ).should.be.ok
+ done()
+
+describe "when finalize has string header only", ->
+ fp = new FP()
+
+ build =
+ "source": "thisHereIsMuhSource"
+ "output":
+ "style": "lib"
+ "source": "lib"
+ "markup": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "finalize":
+ "header": "// this is a test header"
+
+ expected =
+ "source": "thisHereIsMuhSource"
+ "output":
+ "style": "lib"
+ "source": "lib"
+ "markup": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "finalize":
+ "source":
+ "header": "// this is a test header"
+ "footer": ""
+ "working": "./tmp"
+
+ before ( done ) ->
+ json = JSON.stringify build
+ fp.write "./build.json", json, done
+
+ cp = new Configuration fp, scheduler, log
+
+ it "should use the loaded file", ( complete ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ build.working = "./tmp"
+ _.isEqual( config, expected ).should.be.ok
+ complete()
+
+describe "when finalize has a file header only", ->
+ fp = new FP()
+
+ build =
+ "source": "thisHereIsMuhSource"
+ "output":
+ "style": "lib"
+ "source": "lib"
+ "markup": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "finalize":
+ "header-file": "test.txt"
+
+ expected =
+ "source": "thisHereIsMuhSource"
+ "output":
+ "style": "lib"
+ "source": "lib"
+ "markup": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "finalize":
+ "source":
+ "header": "// this is a test header"
+ "footer": ""
+ "working": "./tmp"
+
+ before ( done ) ->
+ json = JSON.stringify build
+ fp.write "./build.json", json, () ->
+ fp.write "test.txt", "// this is a test header", done
+
+ cp = new Configuration fp, scheduler, log
+
+ it "should use the loaded file", ( complete ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ build.working = "./tmp"
+ _.isEqual( config, expected ).should.be.ok
+ complete()
+
+describe "when wrapping with strings", ->
+ fp = new FP()
+
+ build =
+ "source": "thisHereIsMuhSource"
+ "output": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "wrap":
+ "prefix": "look at my prefix, ya'll"
+ "suffix": "bye, ya'll"
+
+ expected =
+ "source": "thisHereIsMuhSource"
+ "output":
+ "style": "lib"
+ "source": "lib"
+ "markup": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "wrap":
+ "source":
+ "prefix": "look at my prefix, ya'll"
+ "suffix": "bye, ya'll"
+ "working": "./tmp"
+
+ before ( done ) ->
+ json = JSON.stringify build
+ fp.write "./build.json", json, done
+
+ cp = new Configuration fp, scheduler, log
+
+ it "should normalize the wrapper", ( complete ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ build.working = "./tmp"
+ _.isEqual( config, expected ).should.be.ok
+ complete()
+
+describe "when using a single name customization", ->
+ fp = new FP()
+ build =
+ "source": "thisHereIsMuhSource"
+ "output": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "name": "test/this/is/so/fun/test.js"
+
+ before ( done ) ->
+ json = JSON.stringify build
+ fp.write "./build.json", json, done
+
+ cp = new Configuration fp, scheduler, log
+
+ it "should create any path as part of the name", ( complete ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ exists = fp.pathExists "lib/test/this/is/so/fun"
+ exists.should.be.ok
+ complete()
+
+describe "when using a multiple name customizations", ->
+ fp = new FP()
+ build =
+ "source": "thisHereIsMuhSource"
+ "output": "lib"
+ "spec": "spec"
+ "ext": "ext"
+ "lint": {}
+ "uglify": {}
+ "gzip": {}
+ "hosts":
+ "/": "spec"
+ "name":
+ "one.js": "test/this/is/so/fun/test.js"
+ "two.js": "this/is/also/pretty/great/test.js",
+ "three.js": "notspecial.js"
+
+ before ( done ) ->
+ json = JSON.stringify build
+ fp.write "./build.json", json, done
+
+ cp = new Configuration fp, scheduler, log
+
+ it "should create all paths as part of the name", ( complete ) ->
+ cp.configure [ "coffee", "./bin/anvil" ], ( config ) ->
+ fp.pathExists( "lib/test/this/is/so/fun" ).should.be.ok
+ fp.pathExists( "lib/this/is/also/pretty/great" ).should.be.ok
+ complete()
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/spec/fileMachine.spec.coffee b/node_modules/anvil.js/next/spec/fileMachine.spec.coffee
new file mode 100644
index 0000000..15dada0
--- /dev/null
+++ b/node_modules/anvil.js/next/spec/fileMachine.spec.coffee
@@ -0,0 +1,33 @@
+_ = require "underscore"
+postal = require "postal"
+machina = require "machina"
+path = require "path"
+
+log = require( "./logMock.coffee" ).log
+FP = require( "./fsMock.coffee" ).fsProvider
+Scheduler = require( "../src/scheduler.js" )( _ )
+fp = new FP()
+scheduler = new Scheduler()
+Combiner = require( "../src/combiner.js" )( _, fp, scheduler )
+FM = require( "../src/fileMachine.js" )( _, fp, scheduler, postal, machina )
+
+require "should"
+
+
+coffeeOne = """
+class Test
+ method: () ->
+ console.log "I'm a coffee file, yo!"
+"""
+
+
+describe "creating files for tests", () ->
+
+ before ( done ) ->
+ scheduler.
+
+describe "when creating a new file state machine", () ->
+
+
+
+ before ( done ) ->
diff --git a/node_modules/anvil.js/next/spec/fileProvider.int.coffee b/node_modules/anvil.js/next/spec/fileProvider.int.coffee
new file mode 100644
index 0000000..64848d1
--- /dev/null
+++ b/node_modules/anvil.js/next/spec/fileProvider.int.coffee
@@ -0,0 +1,17 @@
+_ = require "underscore"
+log = require( "./logMock.coffee" ).log
+path = require "path"
+Scheduler = require( "../src/scheduler.coffee").scheduler
+scheduler = new Scheduler()
+Crawler = require( "../src/crawler.coffee").crawler
+crawler = new Crawler scheduler
+FSProvider = require( "../src/file").fsProvider
+fp = new FSProvider crawler, log
+require "should"
+
+describe "when listing files from a directory structure", ->
+
+ it "should get complete file list", ( done ) ->
+ fp.getFiles "../ext", ( files ) ->
+ files.length.should.equal 5
+ done()
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/spec/fsMock.coffee b/node_modules/anvil.js/next/spec/fsMock.coffee
new file mode 100644
index 0000000..66e7035
--- /dev/null
+++ b/node_modules/anvil.js/next/spec/fsMock.coffee
@@ -0,0 +1,120 @@
+_ = require "underscore"
+path = require "path"
+
+class FileMock
+ constructor: ( @name ) ->
+ @delay = 0
+ @available = true
+
+ delete: ( onComplete ) ->
+ if @available
+ @content = ""
+ onComplete()
+ else
+ throw new Error "Cannot delete file #{ @name }"
+
+ read: ( onContent ) ->
+ self = this
+ if 1 == 1
+ #if @available
+ @available = false
+ setTimeout () ->
+ onContent self.content
+ self.available = true
+ , self.delay
+ else
+ throw new Error "Cannot read file #{ @name }"
+
+ write: ( content, onComplete ) ->
+ @lastModified = new Date();
+ self = this
+ if @available
+ setTimeout( () ->
+ self.content = content
+ onComplete()
+ , self.delay
+ )
+ else
+ throw new Error "Cannot write file #{ @name }"
+
+
+class FSMock
+
+ constructor: () ->
+ @files = {}
+ @paths = {}
+
+ buildPath: ( pathSpec ) ->
+ fullPath = pathSpec
+ if _( pathSpec ).isArray()
+ fullPath = path.join.apply {}, pathSpec
+ fullPath
+
+ delete: ( filePath, onDeleted ) ->
+ filePath = this.buildPath filePath
+ file = @files[ filePath ]
+ if file
+ delete @files filePath
+ file.delete onDeleted
+ else
+ throw new Error "Cannot delete #{filePath} - it does not exist"
+
+ ensurePath: ( pathSpec, onComplete ) ->
+ pathSpec = this.buildPath pathSpec
+ @paths[ pathSpec ] = true
+ onComplete()
+
+ getFiles: ( filePath, onFiles ) ->
+ filePath = this.buildPath filePath
+ files = _.chain( @files )
+ .keys()
+ .filter( ( name ) ->
+ ( name.indexOf filePath ) >= 0
+ ).value()
+ onFiles files
+
+ metadata: ( fullPath, onStat ) ->
+ fullPath = this.buildPath( fullPath )
+ file = @files[ fullPath ]
+ onStat( { lastModified: stat.mtime } )
+
+ pathExists: ( pathSpec ) ->
+ pathSpec = this.buildPath pathSpec
+ if path.extname pathSpec
+ return @files[ pathSpec ]
+ else
+ return @paths[ pathSpec ]
+
+ transform: ( filePath, transform, outputPath, onComplete ) ->
+ self = this
+ filePath = this.buildPath filePath
+ outputPath = this.buildPath outputPath
+ this.read( filePath,
+ ( content ) ->
+ transform content, ( newContent, err ) ->
+ self.write outputPath, newContent, () ->
+ onComplete( err )
+ )
+
+ read: ( filePath, onContent ) ->
+ filePath = this.buildPath filePath
+ file = @files[ filePath ]
+ if file
+ file.read ( content ) ->
+ onContent content
+ else
+ throw new Error "Cannot read #{filePath} - it does not exist"
+
+ write: ( filePath, content, onComplete ) ->
+ filePath = this.buildPath filePath
+ file = @files[ filePath ]
+ unless file
+ file = new FileMock filePath
+ @files[ filePath ] = file
+ file.write content, onComplete
+
+ reset: () ->
+ @files = {}
+ @paths = {}
+
+exports.fsProvider = FSMock
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/spec/logMock.coffee b/node_modules/anvil.js/next/spec/logMock.coffee
new file mode 100644
index 0000000..51fd6bb
--- /dev/null
+++ b/node_modules/anvil.js/next/spec/logMock.coffee
@@ -0,0 +1,46 @@
+colors = require "colors"
+
+class LogMock
+
+ messages: []
+
+ # ## onEvent ##
+ # Logs events in default console color
+ # ### Args:
+ # * _x {String}_: message to log
+ onEvent: (x) ->
+ unless @quiet
+ @messages.push " #{x}"
+ #console.log " #{x}"
+
+
+ # ## onStep ##
+ # Logs steps in blue
+ # ### Args:
+ # * _x {String}_: message to log
+ onStep: (x) ->
+ unless @quiet
+ @messages.push "#{x}".blue
+ #console.log "#{x}".blue
+
+
+ # ## onComplete ##
+ # Logs successful process completions in green
+ # ### Args:
+ # * _x {String}_: message to log
+ onComplete: (x) ->
+ @messages.push "#{x}".green
+ #console.log "#{x}".green
+
+
+ # ## onError ##
+ # Logs errors in red
+ # ### Args:
+ # * _x {String}_: message to log
+ onError: (x) ->
+ @messages.push "!!! #{x} !!!".red
+ #console.log "!!! #{x} !!!".red
+
+log = new LogMock()
+
+exports.log = log
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/spec/scheduler.specs.coffee b/node_modules/anvil.js/next/spec/scheduler.specs.coffee
new file mode 100644
index 0000000..651b2e0
--- /dev/null
+++ b/node_modules/anvil.js/next/spec/scheduler.specs.coffee
@@ -0,0 +1,82 @@
+_ = require "underscore"
+Scheduler = require( "../src/scheduler.coffee").scheduler
+scheduler = new Scheduler()
+require "should"
+
+describe "when building an item through a pipeline", ->
+
+ start = ""
+ step1 = ( x, done ) -> done( x + "hello" )
+ step2 = ( x, done ) -> done( x + " " )
+ step3 = ( x, done ) -> done( x + "world" )
+ step4 = ( x, done ) -> done( x + "!" )
+ expected = "hello world!"
+
+ steps = [ step1, step2, step3, step4 ]
+
+ it "should run pipeline in order", ( done ) ->
+ scheduler.pipeline start, steps, ( result ) ->
+ result.should.equal expected
+ done()
+
+describe "when manipulating a single item through a pipeline", ->
+
+ start = 100
+ step1 = ( x, done ) -> done( x / 2 )
+ step2 = ( x, done ) -> done( x - 25 )
+ step3 = ( x, done ) -> done( x / 5 )
+ step4 = ( x, done ) -> done( x + 5 )
+ expected = 10
+
+ steps = [ step1, step2, step3, step4 ]
+
+ it "should run pipeline in order", ( done ) ->
+ scheduler.pipeline start, steps, ( result ) ->
+ result.should.equal expected
+ done()
+
+describe "when mutating a single item through a pipeline", ->
+
+ start = "<1> [2] {3}"
+ step1 = ( x, done ) -> done( x.replace ///[<]1[>]///, "one" )
+ step2 = ( x, done ) -> done( x.replace ///[\[]2[\]]///, "two" )
+ step3 = ( x, done ) -> done( x.replace ///[\{]3[\}]///, "three" )
+ expected = "one two three"
+
+ steps = [ step1, step2, step3 ]
+
+ it "should run pipeline in order", ( done ) ->
+ scheduler.pipeline start, steps, ( result ) ->
+ result.should.equal expected
+ done()
+
+describe "when running calls in parallel", ->
+
+ start = [ 2, 3, 4 ]
+ call = ( x, done ) -> done x * 2
+ expected = [ 4, 6, 8 ]
+
+ it "should return collection (in any order)", ( done ) ->
+ scheduler.parallel start, call, ( result ) ->
+ _.difference( result, expected ).length.should.equal 0
+ done()
+
+describe "when aggregating multiple calls", ->
+
+ calls =
+ one: ( done ) -> setTimeout () ->
+ done 1
+ , 10
+ two: ( done ) -> setTimeout () ->
+ done 2
+ , 5
+ three: ( done ) -> setTimeout () ->
+ done 3
+ , 1
+
+ it "should complete with correctly constructed object", ( done ) ->
+ scheduler.aggregate calls, ( result ) ->
+ result.one.should.equal 1
+ result.two.should.equal 2
+ result.three.should.equal 3
+ done()
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/anvil.js b/node_modules/anvil.js/next/src/anvil.js
new file mode 100644
index 0000000..2482d24
--- /dev/null
+++ b/node_modules/anvil.js/next/src/anvil.js
@@ -0,0 +1,113 @@
+
+var anvilFactory = function( _, scheduler, fs, log, compiler, combiner ) {
+
+ var Anvil = function( ) {
+
+ this.conventions = {
+ defaultImportPatterns: {
+ "**/*.(js|coffee)": {
+ find: [ /([\/]{2}|[\#]{3}).?import.?[(]?.?['"].*["'].?[)]?[;]?.?([\#]{0,3})/g ],
+ replace: [ /([\/]{2}|[\#]{3}).?import.?[(]?.?['"]replace["'].?[)]?[;]?.?([\#]{0,3})/g ]
+ },
+ "**/*.(css|styl|less|stylus)": {
+ find: [ /([\/]{2}|[\/][*]).?import[(]?.?['"].*["'].?[)]?([*][\/])?/g ],
+ replace: [ ]
+ },
+ "**/*.(md|html)": {
+ find: [ /[<][!][-]{2}.?import[(]?.?['"].*["'].?[)]?.?[-]{2}[>]/g ],
+ replace: [ /[<][!][-]{2}.?import[(]?.?['"]replace["'].?[)]?.?[-]{2}[>]/g ]
+ }
+ },
+ defaultSiteBlock: {
+ source: "src",
+ style: "style",
+ markup: "markup",
+ output: {
+ source: [ "lib", "site/js" ],
+ style: [ "css", "site/css" ],
+ markup: "site/"
+ },
+ spec: "spec",
+ ext: "ext",
+ lint: {},
+ uglify: {},
+ cssmin: {},
+ hosts: {
+ "/": "site"
+ }
+ },
+ defaultLibBlock: {
+ source: "src",
+ output: "lib",
+ spec: "spec",
+ ext: "ext",
+ lint: {},
+ uglify: {},
+ hosts: {
+ "/": "site"
+ }
+ }
+ };
+
+ this.services = {};
+ this.combiner = combiner;
+ this.compiler = compiler;
+ this.preprocessors = {};
+ this.postprocessors = {};
+ this.buildState = {};
+ this.events = {};
+ this.inProcess = false;
+
+
+
+ _.bindAll( this );
+ };
+
+ Anvil.prototype.load = function() {
+ var self = this,
+ moduleSpecification;
+ _.each( this.extensions, function( extension ) {
+ moduleSpecification = extension.file || extension.module;
+ require( moduleSpecification )( _, scheduler, fs, log, self );
+ } );
+ };
+
+ Anvil.prototype.raise = function( eventName, data ) {
+ var handlers = this.events[ eventName ];
+ _.each( handlers, function( handler ) {
+ try {
+ handler.apply( arguments );
+ } catch( error ) {
+ // we don't need to do anything,
+ // but there's no reason to blow up
+ // just because a subscriber did
+ }
+ } );
+ };
+
+ Anvil.prototype.onConfiguration = function( config, stop ) {
+ this.configuration = config;
+ if( !stop ) {
+ // create load pipeline
+
+
+
+
+
+ // wire up services
+
+
+
+
+ }
+ };
+
+ Anvil.prototype.on = function( eventName, onEvent ) {
+ var handlers = this.events[ eventName ] || [];
+ handlers.push( onEvent );
+ };
+
+ return Anvil;
+};
+
+module.exports = anvilFactory;
diff --git a/node_modules/anvil.js/next/src/build.js b/node_modules/anvil.js/next/src/build.js
new file mode 100644
index 0000000..e2ab2bd
--- /dev/null
+++ b/node_modules/anvil.js/next/src/build.js
@@ -0,0 +1,44 @@
+var fileBootstrapFactory = function( _, fp, scheduler, minimatch ) {
+
+ var Bootstrapper = function( paths, inclusions, exclusions, callback ) {
+ var map = {};
+ this.inclusions = inclusions;
+ this.exclusions = exclusions;
+ this.callback = callback;
+ _.bindAll( this );
+
+ paths = _.isArray( paths ) ? paths : [ paths ];
+ _.each( paths, function( p ) {
+ map[ p ] = fp.getFiles;
+ } );
+ scheduler.mapped( map, this.onFiles );
+ };
+
+ Build.prototype.onFiles = function( fileLists ) {
+ var included = [],
+ exlcluded = [],
+ list;
+ _.each( this.inclusions, function( inclusion ) {
+ included.push( fileLists.filter( minimatch.filter( inclusion ) ) );
+ } );
+
+ _.each( this.exclusions, function( exclusion ) {
+ excluded.push( fileLists.filter( minimatch.filter( exclusion ) ) );
+ } );
+
+ list = _( included )
+ .chain()
+ .flatten()
+ .uniq()
+ .difference( excluded )
+ .value();
+ fileMap = {};
+ _.each( list, function( path ) {
+ fileMap[ path ] = this.createFileMachine;
+ }, this );
+
+ scheduler.mapped( fileMap, this.callback );
+ };
+};
+
+module.exports = fileBootStrapFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/cli.js b/node_modules/anvil.js/next/src/cli.js
new file mode 100644
index 0000000..67e93d3
--- /dev/null
+++ b/node_modules/anvil.js/next/src/cli.js
@@ -0,0 +1,25 @@
+// # Cli
+// Provides the command line interface for interacting with Anvil and related modules
+var cliFactory = function( _, Anvil, Configuration ) {
+
+ // ## constructor
+ // Create the initial instance where all we really have is the
+ // configuration module to get us started.
+ var Cli = function() {
+ this.configuration = new Configuration();
+ _.bindAll( this );
+ };
+
+ // ## start
+ // Kicks off the configuration process
+ Cli.prototype.start = function() {
+ this.configuration( process.argv, function( config, done ) {
+ if( !done ) {
+ Anvil.configure( config );
+ }
+ } );
+ };
+
+ return Cli;
+};
+module.exports = cliFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/combiner.js b/node_modules/anvil.js/next/src/combiner.js
new file mode 100644
index 0000000..6b5405c
--- /dev/null
+++ b/node_modules/anvil.js/next/src/combiner.js
@@ -0,0 +1,115 @@
+var combinerFactory = function( _, fp, scheduler ) {
+
+ var Combiner = function( findPatterns, replacePatterns ) {
+ this.findPatterns = findPatterns;
+ this.replacePatterns = replacePatterns;
+ _.bindAll( this );
+ };
+
+ Combiner.prototype.combine = function( file, onComplete ) {
+ var self = this,
+ steps = [],
+ imported;
+
+ if( !file.combined && file.imports.length > 0 ) {
+ _.each( file.imports, function( imported ) {
+ steps.push( this.getStep( imported ) );
+ }, this );
+ fp.read( [ file.workingPath, file.name ], function( main ) {
+ scheduler.pipeline( main, steps, function( result ) {
+ fp.write( [ file.workingPath, file.name ], result, onComplete );
+ } );
+ } );
+ } else {
+ onComplete();
+ }
+ };
+
+ Combiner.prototype.combineFile = function( file, onComplete ) {
+ var self = this,
+ dependencies = file.imports,
+ done = function() {
+ file.combined = true;
+ onComplete();
+ },
+ combine = function() {
+ self.combine( file, done );
+ };
+
+ if( file.combined ) {
+ onComplete();
+ } else if( dependencies && dependencies.length > 0 ) {
+ scheduler.parallel( dependencies, this.combineFile, combine );
+ } else {
+ combine();
+ }
+ };
+
+ Combiner.prototype.combineList = function( list, onComplete ) {
+ var self = this,
+ findImports = function( file, done ) {
+ self.findImports( file, list, done );
+ },
+ onImports = function() {
+ self.onImports( list, onComplete );
+ };
+ scheduler.parallel( list, findImports, onImports );
+ };
+
+ Combiner.prototype.findDependents = function( file, list ) {
+ var imported = function( importFile ) { return file.name === importFile.name; },
+ item;
+ _.each( list, function( item ) {
+ if( _.any( item.imports, imported ) ) {
+ file.dependents++;
+ }
+ } );
+ };
+
+ Combiner.prototype.getStep = function( imported ) {
+ var self = this;
+ return function( text, done ) {
+ self.replace( text, imported, done );
+ };
+ };
+
+ Combiner.prototype.onImports = function( list, onComplete ) {
+ _.each( list, function( file ) {
+ this.findDependents( file, list );
+ }, this );
+ scheduler.parallel( list, this.combineFile, onComplete );
+ };
+
+ Combiner.prototype.replace = function( content, imported, onComplete ) {
+ var self = this,
+ source = imported.name,
+ working = imported.workingPath;
+
+ fp.read( [ working, source ], function( newContent ) {
+ var steps = [],
+ pattern;
+
+ _.each( self.replacePatterns, function( pattern ) {
+ steps.push( function( current, done ) {
+ var stringified = pattern.toString().replace( /replace/, source ),
+ trimmed = stringified.substring( 1, stringified.length - 2 ),
+ newPattern = new RegExp( trimmed, "g" ),
+ capture = newPattern.exec( content ),
+ whiteSpace;
+
+ newContent = newContent.replace( "\$", "dollahr" )
+ if( capture && capture.length > 1 ) {
+ whiteSpace = capture[ 1 ];
+ newContent = whiteSpace + newContent.replace( /\n/g, "\n" + whiteSpace );
+ }
+ done( current.replace( newPattern, newContent ).replace( "dollahr", "$" ) );
+ } );
+ scheduler.pipeline( content, steps, onComplete );
+ } );
+ } );
+ };
+
+ return Combiner;
+};
+
+module.exports = combinerFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/compiler.js b/node_modules/anvil.js/next/src/compiler.js
new file mode 100644
index 0000000..2a927f0
--- /dev/null
+++ b/node_modules/anvil.js/next/src/compiler.js
@@ -0,0 +1,43 @@
+var compilerFactory = function( _, fp, log ) {
+
+ var Compiler = function( ) {
+ this.extensionMap = {};
+ this.compilers = {};
+ };
+
+ Compiler.prototype.registerCompiler = function( fromExt, toExt, compile ) {
+ this.extensionMap[ fromExt ] = toExt;
+ this.compilers[ fromExt ] = compile;
+ };
+
+ Compiler.prototype.compile = function( file, onComplete ) {
+ var ext = file.ext(),
+ newExt = this.extensionMap[ ext ],
+ newFile = file.name.replace( ext, newExt ),
+ compiler = this.compilers[ ext ];
+
+ if( compiler && newExt ) {
+ log.onDebug( "Compiling " + file.name + " to " + newFile );
+ fp.transform(
+ [ file.workingPath, file.name ],
+ compiler,
+ [ file.workingPath, newFile ],
+ function( err ) {
+ if( !err ) {
+ file.name = newFile;
+ onComplete( file );
+ } else {
+ log.onError( "Error compiling " + file.name + ": \r\n " + err );
+ onComplete( file, err );
+ }
+ } );
+ } else {
+ log.onWarning( "No compilers registered for files of type " + ext );
+ onComplete( file );
+ }
+ };
+
+ return Compiler;
+};
+
+module.exports = compilerFactory;
diff --git a/node_modules/anvil.js/next/src/configuration.js b/node_modules/anvil.js/next/src/configuration.js
new file mode 100644
index 0000000..ea80a3a
--- /dev/null
+++ b/node_modules/anvil.js/next/src/configuration.js
@@ -0,0 +1,14 @@
+
+
+
+var configurationFactory = function( _, FSProvider, Scheduler, Log ) {
+
+ var Configuration = function() {
+
+ _.bindAll( this );
+ };
+
+ return Configuration;
+};
+
+module.exports = configurationFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/crawler.js b/node_modules/anvil.js/next/src/crawler.js
new file mode 100644
index 0000000..094d0e7
--- /dev/null
+++ b/node_modules/anvil.js/next/src/crawler.js
@@ -0,0 +1,91 @@
+var crawlerFactory = function( _, fs, path, scheduler ) {
+
+ var Crawler = function( ) {
+ _.bindAll( this );
+ };
+
+ Crawler.prototype.crawl = function( directory, onComplete ) {
+ var self = this,
+ fileList = [],
+ onContents = function( error, contents ) {
+ self.onContents( error, contents, fileList, onComplete );
+ };
+
+ if( directory && directory !== "" ) {
+ directory = path.resolve( directory );
+ fs.readdir( directory, onContents );
+ } else {
+ onComplete( fileList );
+ }
+ };
+
+ Crawler.prototype.classifyHandle = function( file, onComplete ) {
+ fs.stat( file, function( err, stat ) {
+ if( err ) {
+ onComplete( { file: file, err: err } );
+ } else {
+ onComplete( { file: file, isDirectory: stat.isDirectory() } );
+ }
+ } );
+ };
+
+ Crawler.prototype.classifyHandles = function( list, onComplete ) {
+ var self = this;
+ if( list && list.length > 0 ) {
+ scheduler.parallel( list, this.classifyHandle, function( classified ) {
+ self.onClassified( classified, onComplete );
+ } );
+ } else {
+ onComplete( [], [] );
+ }
+ };
+
+ Crawler.prototype.onClassified = function( classified, onComplete ) {
+ var files = [],
+ directories = [],
+ item;
+
+ for( item in classified ) {
+ if( item.isDirectory ) {
+ directories.push( item.file );
+ } else if( !item.error ) {
+ files.push( item.file );
+ }
+ }
+ onComplete( files, directories );
+ };
+
+ Crawler.prototype.onContents = function( error, contents, fileList, onComplete ) {
+ var self = this,
+ qualified =[],
+ onQualified = function( files, directories ) {
+ self.onQualified( files, directories, fileList, onComplete );
+ },
+ item;
+
+ if( !err && contents.length > 0 ) {
+ for( item in contents ) {
+ qualified.push( path.resolve( directory, item ) );
+ }
+ this.classifyHandles( qualified, onQualified );
+ } else {
+ onComplete( fileList );
+ }
+ };
+
+ Crawler.prototype.onQualified = function( files, directories, fileList, onComplete ) {
+ fileList = fileList.concat( files );
+ if( directories.length > 0 ) {
+ scheduler.parallel( directories, this.crawl, function( files ) {
+ fileList = fileList.concat( _.flatten( files ) );
+ onComplete( fileList );
+ } );
+ } else {
+ onComplete( fileList );
+ }
+ };
+
+ return Crawler;
+};
+
+module.exports = crawlerFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/file.js b/node_modules/anvil.js/next/src/file.js
new file mode 100644
index 0000000..983dc56
--- /dev/null
+++ b/node_modules/anvil.js/next/src/file.js
@@ -0,0 +1,130 @@
+var fileFactory = function( _, fs, path, mkdir, crawler ) {
+
+ var FileProvider = function() {
+ _.bindAll( this );
+ };
+
+ FileProvider.prototype.buildPath = function( pathSpec ) {
+ var fullPath = pathSpec || "";
+
+ if( _.isArray( pathSpec ) ) {
+ fullPath = path.join.apply( {}, pathSpec );
+ }
+ return fullPath;
+ };
+
+ FileProvider.prototype.copy = function( from, to, onComplete ) {
+ from = this.buildPath( from );
+ to = this.buildPath( to );
+ var toDir = path.dirname( to ),
+ readStream, writeStream;
+ this.ensurePath( to, function() {
+ writeStream = fs.createWriterStream( to );
+ ( readStream = fs.createReadStream( from ) ).pipe( writeStream );
+ readStream.on( "end", function() {
+ if( writeStream ) {
+ writeStream.destroySoon();
+ }
+ onComplete( to );
+ } );
+ } );
+ };
+
+ FileProvider.prototype["delete"] = function( filePath, onDeleted ) {
+ filePath = this.buildPath( filePath );
+ if( this.pathExists( filePath ) ) {
+ fs.unlink( filePath, function( error ) {
+ onDeleted( error );
+ } );
+ }
+ };
+
+ FileProvider.prototype.ensurePath = function( fullPath, onComplete ) {
+ fullPath = this.buildPath( fullPath );
+ path.exists( fullPath, function( exists ) {
+ if( !exists ) {
+ mkdir( fullPath, "0755", function( error ) {
+ if( error ) {
+ onComplete( error );
+ } else {
+ onComplete();
+ }
+ } );
+ } else {
+ onComplete();
+ }
+ } );
+ };
+
+ FileProvider.prototype.getFiles = function( fullPath, onFiles ) {
+ var fullPath = this.buildPath( fullPath );
+ crawler.crawl( fullPath, onFiles );
+ };
+
+ FileProvider.prototype.metadata = function( fullPath, onStat ) {
+ fullPath = this.buildPath( fullPath );
+ try {
+ return fs.stat( fullPath, function( stat ) {
+ onStat( { lastModified: stat.mtime } );
+ } );
+ } catch ( err ) {
+ onStat( { error: err } );
+ }
+ }
+
+ FileProvider.prototype.pathExists = function( fullPath ) {
+ fullPath = this.buildPath( fullPath );
+ path.existsSync( fullPath );
+ };
+
+ FileProvider.prototype.read = function( fullPath, onContent ) {
+ fullPath = this.buildPath( fullPath );
+ fs.readFile( fullPath, "utf8", function( error, content ) {
+ if( error ) {
+ onContent( "", error );
+ } else {
+ onContent( content );
+ }
+ } );
+ };
+
+ FileProvider.prototype.readSync = function( fullPath ) {
+ fullPath = this.buildPath( fullPath );
+ try {
+ return fs.readFileSync( fullPath, "utf8" );
+ } catch( error ) {
+ return error;
+ }
+ };
+
+ FileProvider.prototype.transform = function( from, transform, to, onComplete ) {
+ from = this.buildPath( from );
+ to = this.buildPath( to );
+ var self = this;
+ this.read( from, function( content ) {
+ transform( content, function( modified, error ) {
+ if( !error ) {
+ self.write( to, modified, onComplete );
+ } else {
+ onComplete( error );
+ }
+ } );
+ } );
+ };
+
+ FileProvider.prototype.write = function( fullPath, content, onComplete ) {
+ fullPath = this.buildPath( fullPath );
+ fs.writeFile( fullPath, content, "utf8", function( error ) {
+ if( !error ) {
+ onComplete();
+ } else {
+ onComplete( error );
+ }
+ } );
+ };
+
+ return FileProvider;
+};
+
+module.exports = fileFactory;
+
diff --git a/node_modules/anvil.js/next/src/fileMachine.js b/node_modules/anvil.js/next/src/fileMachine.js
new file mode 100644
index 0000000..0f24001
--- /dev/null
+++ b/node_modules/anvil.js/next/src/fileMachine.js
@@ -0,0 +1,125 @@
+var fileMachineFactory = function( _, fp, scheduler, postal, machina ) {
+
+ // ## FileMachine
+ // This state machine manages the pipeline and interactions
+ // for this file during the build.
+ // The filePath is the fully qualified or relative path to
+ // the file and the onComplete callback will receive a handle
+ // to the created file state machine.
+ var FileMachine = function( filePath, searchPatterns, replacePatterns, onCreated ) {
+ fp.stat( filePath, function( metadata ) {
+ var machine = new machina.Fsm( {
+ broadcast: postal.channel( "fileEvents" ),
+ dependents: 0,
+ ext: function() { return path.extname( this.name ); },
+ fullPath: path.resolve( filePath ),
+ imports: [],
+ initialState: "initilization",
+ lastModified: metadata.lastModified,
+ name: path.basename( filePath ),
+ relativePath: path.resolve( "./", filePath ),
+ replacePatterns: replacePatterns,
+ searchPatterns: searchPatterns,
+ watcher: fs.watch( filePath, this.onFileChange ),
+ workingPath: "",
+
+ currentFullPath: function() {
+ return fp.buildPath( [ this.workingPath, this.name ] );
+ },
+
+ onFileChange: function() {},
+
+ broadcastStep: function( step ) {
+ this.broadcast.publish( {
+ topic: this.currentFullPath(),
+ body: {
+ file: this,
+ event: step
+ }
+ } );
+ },
+
+ copy: function( to, onComplete ) {
+ var self = this;
+ fp.copy( [ this.workingPath, this.name ], to, function( newFull ) {
+ self.workingPath = path.dirname( newFull );
+ self.name = path.basename( newFull );
+ onComplete();
+ } );
+ },
+
+ findImports: function( onComplete ) {
+ var self = this,
+ sourcePath = this.currentFullPath(),
+ imports = [],
+ match;
+
+ fp.read( this.currentFullPath(), function( content ) {
+ _.each( self.searchPatterns, function( pattern ) {
+ if( ( match = content.match( pattern ) ) != undefined ) {
+ imports = imports.concat( match );
+ }
+ } );
+
+ _.each( imports, function ( imported ) {
+ var importName = imported.match( /['\"].*['\"]/ )[ 0 ].replace( /['\"]/g, "" );
+ var importPath = path.resolve( currentFullPath, importName );
+ if( path.existsSync( importPath ) ) {
+ self.imports.push( importPath );
+ }
+ } );
+ onComplete();
+ } );
+ },
+
+ transform: function( type, newName, transform, onComplete ) {
+ var self = this;
+ fp.transform(
+ [ this.workingPath, this.name ],
+ transform,
+ [ this.workingPath, newName ],
+ function( err ) {
+ if( !err ) {
+ file.name = newFile;
+ onComplete( file );
+ } else {
+ self.raiseEvent( {
+ type: type,
+ message: type + " failed for " + self.fullPath,
+ error: err
+ } );
+ onComplete( file, err );
+ }
+ } );
+ },
+
+ states: {
+ "initialization": {
+ _onEnter: function() {
+ _.bindAll( this );
+ this.broadcastStep("ready");
+ },
+ "copy": function( command ) {
+ this.copy( command.path, function() {
+ this.transition( "scanning" );
+ } );
+ }
+ },
+ "scanning": {
+ _onEnter: function() {
+
+ },
+ "imported": function() {
+ this.dependents++;
+ },
+ "*": function() {
+
+ }
+ }
+ }
+ } ) );
+ } );
+
+};
+
+modules.exports = fileMachineFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/log.js b/node_modules/anvil.js/next/src/log.js
new file mode 100644
index 0000000..7ceb7e2
--- /dev/null
+++ b/node_modules/anvil.js/next/src/log.js
@@ -0,0 +1,32 @@
+var logFactory = function( options ) {
+ return {
+ onDebug: function( x ) {
+ if( options.debug ) {
+ console.log( x.purple );
+ }
+ },
+ onEvent: function( x ) {
+ if( !options.quiet ) {
+ console.log( "\t" + x );
+ }
+ },
+ onStep: function( x ) {
+ if( !options.quiet ) {
+ console.log( x.blue );
+ }
+ },
+ onComplete: function( x ) {
+ console.log( x.green );
+ },
+ onWarning: function( x ) {
+ if( !options.quiet ) {
+ console.log( x.orange );
+ }
+ },
+ onError: function( x ) {
+ console.log( ("\t" + x).red );
+ }
+ };
+};
+
+module.exports = logFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/next/src/scheduler.js b/node_modules/anvil.js/next/src/scheduler.js
new file mode 100644
index 0000000..f4795c4
--- /dev/null
+++ b/node_modules/anvil.js/next/src/scheduler.js
@@ -0,0 +1,80 @@
+// # Scheduler
+// Asynchronous abstractions
+var schedulerFactory = function( _ ) {
+
+ function Scheduler() {
+
+ }
+
+ Scheduler.prototype.parallel = function( list, task, onComplete ) {
+ var length = 0,
+ index = 0,
+ results = [],
+ callback = function( result, resultIndex ){
+ results[ resultIndex ] = result;
+ if( --length === 0 ) {
+ onComplete( results );
+ }
+ },
+ input,
+ args;
+
+ // if the list of inputs is empty, then return an empty list.
+ if( !list || ( length = list.length ) === 0 ) {
+ onComplete( [] );
+ }
+
+ _.each( list, function( input ) {
+ task( input, function( result ) { callback( result, index ); } );
+ index++;
+ } );
+ };
+
+ Scheduler.prototype.mapped = function( map, onComplete ) {
+ var keys = _.keys( map ),
+ remaining = keys.length,
+ results = {},
+ callback = function( name, result ){
+ results[ name ] = result;
+ if( --remaining === 0 && firstPassComplete ) {
+ onComplete( results );
+ }
+ },
+ firstPassComplete;
+
+ _.each( keys, function( key ) {
+ map[ key ]( function( value ){ callback( key, value ); } );
+ } );
+ firstPassComplete = true;
+
+ // if the remaining count is 0, we're done
+ if( remaining === 0 ) {
+ onComplete( results );
+ }
+ };
+
+ Scheduler.prototype.pipeline = function( initial, transforms, onComplete ) {
+ var current = initial,
+ iterate = function iterate() {
+ transforms.shift()( current, done );
+ },
+ done = function done( result ) {
+ current = result;
+ if( transforms.length === 0 ) {
+ onComplete( current );
+ } else {
+ iterate();
+ }
+ };
+
+ if( !transforms || transforms.length === 0 ) {
+ onComplete( initial );
+ } else {
+ iterate( done );
+ }
+ };
+
+ return Scheduler;
+};
+
+module.exports = schedulerFactory;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/_mocha b/node_modules/anvil.js/node_modules/.bin/_mocha
new file mode 120000
index 0000000..f2a54ff
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/_mocha
@@ -0,0 +1 @@
+../mocha/bin/_mocha
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/ape b/node_modules/anvil.js/node_modules/.bin/ape
new file mode 120000
index 0000000..cbc1b28
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/ape
@@ -0,0 +1 @@
+../ape/bin/ape
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/cake b/node_modules/anvil.js/node_modules/.bin/cake
new file mode 120000
index 0000000..d95f32a
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/cake
@@ -0,0 +1 @@
+../coffee-script/bin/cake
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/coffee b/node_modules/anvil.js/node_modules/.bin/coffee
new file mode 120000
index 0000000..b57f275
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/coffee
@@ -0,0 +1 @@
+../coffee-script/bin/coffee
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/coffeekup b/node_modules/anvil.js/node_modules/.bin/coffeekup
new file mode 120000
index 0000000..9bf31da
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/coffeekup
@@ -0,0 +1 @@
+../coffeekup/bin/coffeekup
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/cssmin b/node_modules/anvil.js/node_modules/.bin/cssmin
new file mode 120000
index 0000000..b7161d7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/cssmin
@@ -0,0 +1 @@
+../cssmin/bin/cssmin
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/haml-js b/node_modules/anvil.js/node_modules/.bin/haml-js
new file mode 120000
index 0000000..e74b5f4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/haml-js
@@ -0,0 +1 @@
+../haml/lib/cli.js
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/jslint b/node_modules/anvil.js/node_modules/.bin/jslint
new file mode 120000
index 0000000..4d11ed7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/jslint
@@ -0,0 +1 @@
+../readyjslint/bin/jslint.js
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/lessc b/node_modules/anvil.js/node_modules/.bin/lessc
new file mode 120000
index 0000000..87a5294
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/lessc
@@ -0,0 +1 @@
+../less/bin/lessc
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/marked b/node_modules/anvil.js/node_modules/.bin/marked
new file mode 120000
index 0000000..a8d872e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/marked
@@ -0,0 +1 @@
+../marked/bin/marked
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/mocha b/node_modules/anvil.js/node_modules/.bin/mocha
new file mode 120000
index 0000000..43c668d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/mocha
@@ -0,0 +1 @@
+../mocha/bin/mocha
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/stylus b/node_modules/anvil.js/node_modules/.bin/stylus
new file mode 120000
index 0000000..4113f9b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/stylus
@@ -0,0 +1 @@
+../stylus/bin/stylus
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/.bin/uglifyjs b/node_modules/anvil.js/node_modules/.bin/uglifyjs
new file mode 120000
index 0000000..fef3468
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/.bin/uglifyjs
@@ -0,0 +1 @@
+../uglify-js/bin/uglifyjs
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/.npmignore b/node_modules/anvil.js/node_modules/ape/.npmignore
new file mode 100644
index 0000000..28f1ba7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/.npmignore
@@ -0,0 +1,2 @@
+node_modules
+.DS_Store
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/LICENSE b/node_modules/anvil.js/node_modules/ape/LICENSE
new file mode 100644
index 0000000..4e70c26
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/LICENSE
@@ -0,0 +1,19 @@
+Programmed by Nathan LaFreniere, Copyright (c) 2012 &Yet
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/anvil.js/node_modules/ape/README.md b/node_modules/anvil.js/node_modules/ape/README.md
new file mode 100644
index 0000000..6acc351
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/README.md
@@ -0,0 +1,26 @@
+ape
+===
+
+API docs? Nope, ape docs!
+
+ape generates API documentation in github-flavored-markup from comments in your code, and places them in line with the actual code. This allows for very easy integration with github.
+Optionally, ape can also output to html with a built-in jade template, or one you specify.
+
+
+See lib/template.jade for an example template, lib/ape.html and lib/ape.md are example output.
+
+To install:
+
+ sudo npm install -g ape
+
+And how to use:
+
+ Usage: node ./bin/ape [input file|directory list]
+
+ Options:
+ --md Output as markdown [boolean] [default: true]
+ --html Output as HTML [boolean] [default: false]
+ --template, -t Template for HTML output [string]
+ --output, -o Output directory [string]
+
+Currently python, javascript, ruby, lua, coffeescript, C, C++, Perl, PHP, C#, ObjC, SQL, Bash, CSS, and ActionScript are supported. Feel free to submit a pull request for additional languages!
diff --git a/node_modules/anvil.js/node_modules/ape/lib/ape.html b/node_modules/anvil.js/node_modules/ape/lib/ape.html
new file mode 100644
index 0000000..efebb25
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/lib/ape.html
@@ -0,0 +1,161 @@
+var fs = require('fs' ),
+ path = require('path' ),
+ gfm = require('ghm' ),
+ hljs = require('hljs' ),
+ jade = require('jade' );
+exports.supported = function (filename, callback) {
+ var lang = languages[path.extname(filename)];
+ if (typeof lang === 'undefined' ) {
+ callback(false );
+ } else {
+ callback(true );
+ }
+};
+exports.get_language = function (filename) {
+ var lang = languages[path.extname(filename)];
+ return lang;
+}
+function parse_code (code, lang, outputFormat, template, callback) {
+ var parsed_code = [],
+ this_line,
+ in_comment,
+ in_code,
+ spaces,
+ commentblock = [],
+ codeblock = [],
+ tempblock = [];
+
+ if (code && typeof code !== 'string' ) code = code.toString().split("\n" );
+ if (typeof lang === 'undefined' || !code) return ;
+
+ function pushblock () {
+ parsed_code.push({ code: codeblock.join('\n' ), comment: commentblock.join('\n' ) });
+ codeblock = [];
+ commentblock = [];
+ in_code = false ;
+ }
+
+ for (var i = 0 , l = code.length; i < l; i++) {
+ this_line = code[i];
+ if (this_line.match(lang.comment) && !in_comment && !this_line.match(/^#\!/ )) {
+ if (in_code) pushblock();
+ commentblock.push(this_line.replace(lang.comment, '' ))
+ } else if (this_line.match(lang.start) && !in_comment) {
+ if (lang.name === 'python' && in_code) {
+ while (codeblock[codeblock.length - 1 ].trim() !== '' ) {
+ tempblock.push(codeblock.pop());
+ }
+ }
+ if (in_code) pushblock();
+ if (lang.name === 'python' ) {
+ for (var ti = 0 , tl = tempblock.length; ti < tl; ti++) {
+ codeblock.push(tempblock.pop());
+ }
+ }
+ in_comment = true ;
+ spaces = this_line.match(/^\s+/ );
+ if (spaces) spaces = spaces[0 ].length;
+ this_line = this_line.replace(lang.start, '' );
+ if (this_line.match(lang.end)) {
+ this_line = this_line.replace(lang.end, '' );
+ in_comment = false ;
+ }
+ if (this_line.trim() !== '' ) commentblock.push(this_line);
+ } else if (this_line.match(lang.end) && in_comment) {
+ this_line = this_line.replace(lang.end, '' );
+ if (this_line.trim() !== '' ) commentblock.push(this_line);
+ in_comment = false ;
+ } else if (this_line.trim() === '' && !in_comment && !in_code) {
+ pushblock();
+ } else {
+ if (in_comment) {
+ if (lang.name === 'python' ) this_line = this_line.substring(spaces);
+ commentblock.push(this_line);
+ } else {
+ if (!in_code && this_line.trim() !== '' ) in_code = true ;
+ codeblock.push(this_line);
+ }
+ }
+ }
+
+ pushblock();
+
+ if (outputFormat === 'md' ) {
+ generate_md(parsed_code, lang, callback);
+ } else if (outputFormat === 'html' ) {
+ generate_html(parsed_code, lang, template, callback);
+ }
+}
+exports.generate_doc = parse_code;
+function generate_md (parsed_code, language, callback) {
+ var outfile,
+ outcode = '' ;
+
+ for (var i = 0 , l = parsed_code.length; i < l; i++) {
+ if (parsed_code[i].comment !== '' ) outcode += parsed_code[i].comment + '\n\n' ;
+ if (parsed_code[i].code !== '' ) outcode += '```' + language.name + '\n' + parsed_code[i].code + '\n```\n\n' ;
+ }
+
+ callback(null , outcode);
+}
+function generate_html (parsed_code, language, template, callback) {
+ var outfile,
+ templatePath,
+ template;
+
+ if (typeof template === 'undefined' ) {
+ templatePath = path.join(__dirname, 'template.jade' );
+ } else {
+ templatePath = template;
+ }
+
+ template = fs.readFileSync(__dirname + '/template.jade' , 'utf-8' );
+ var fn = jade.compile(template);
+
+ callback(null , fn({ gfm: gfm, data: parsed_code, hljs: hljs, lang: language.name }));
+}
+var C_LINE_COMMENT = /^\s*\/\/\s?/ ,
+ C_BLOCK_COMMENT_START = /^\s*\/\*\s?/ ,
+ C_BLOCK_COMMENT_END = /\*\/\s*$/ ,
+ HASH_LINE_COMMENT = /^\s*#\s?/ ,
+ NEVER_MATCH = /a\bc/ ;
+var languages = {
+ '.js' : { name: 'javascript' , comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.py' : { name: 'python' , comment: HASH_LINE_COMMENT, start: /^\s*\"\"\"\s?/ , end: /\"\"\"\s*$/ },
+ '.rb' : { name: 'ruby' , comment: HASH_LINE_COMMENT, start: /^\s*\=begin\s?/ , end: /\=end\s*$/ },
+ '.lua' : { name: 'lua' , comment: /^\s*--\s?/ , start: /^\s*--\[\[\s?/ , end: /--\]\]\s*$/ },
+ '.coffee' : { name: 'coffeescript' , comment: /^\s*#(?!##)\s?/ , start: /^\s*###\s?/ , end: /###\s*$/ },
+ '.php' : { name: 'php' , comment: /^\s*(?:#|\/\/\s?)/ , start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.c' : { name: null , comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.h' : { name: null , comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.pl' : { name: 'perl' , comment: HASH_LINE_COMMENT, start: NEVER_MATCH, end: NEVER_MATCH },
+ '.cpp' : { name: 'cpp' , comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.cs' : { name: 'cs' , comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.m' : { name: 'objectivec' , comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.sql' : { name: 'sql' , comment: /^\s*--\s?/ , start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.sh' : { name: 'bash' , comment: HASH_LINE_COMMENT, start: NEVER_MATCH, end: NEVER_MATCH },
+ '.css' : { name: 'css' , comment: NEVER_MATCH, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.as' : { name: 'actionscript' , comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END }
+};
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/lib/ape.js b/node_modules/anvil.js/node_modules/ape/lib/ape.js
new file mode 100644
index 0000000..e2f576e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/lib/ape.js
@@ -0,0 +1,185 @@
+/*
+## API docs? Nope, ape docs!
+
+---
+ape is a command line tool to generate documentation from your comments.
+It parses your source code files, and strips markdown formatted comments out,
+it then puts your code in github-flavored-markdown code blocks, and displays the comments in line.
+
+It wasn't written to be fancy, but rather to have a simple, automated way of keeping docs on github up to date.
+
+To use:
+
+ sudo npm install -g ape
+ ape [list of files or directories]
+*/
+
+// Require dependencies
+var fs = require('fs'),
+ path = require('path'),
+ gfm = require('ghm'),
+ hljs = require('hljs'),
+ jade = require('jade');
+
+/*
+This function is a helper for frontends, to make it simpler to determine if a file can be processed by ape.
+It returns a callback with a single boolean parameter indicating if the file is supported
+*/
+exports.supported = function (filename, callback) {
+ var lang = languages[path.extname(filename)];
+ if (typeof lang === 'undefined' ) {
+ callback(false);
+ } else {
+ callback(true);
+ }
+};
+
+// A simple helper function to return the dictionary of comment regexs, determined by the file extension
+exports.get_language = function (filename) {
+ var lang = languages[path.extname(filename)];
+ return lang;
+}
+
+/*
+This is the main function to parse the line array of source code, and return a new line array
+containing the formatted text
+*/
+function parse_code(code, lang, outputFormat, template, callback) {
+ var parsed_code = [],
+ this_line,
+ in_comment,
+ in_code,
+ spaces,
+ commentblock = [],
+ codeblock = [],
+ tempblock = [];
+
+ if (typeof code == "string") code = code.split("\n");
+ if (typeof lang === 'undefined' || !code) return;
+
+ function pushblock() {
+ parsed_code.push({ code: codeblock.join('\n'), comment: commentblock.join('\n') });
+ codeblock = [];
+ commentblock = [];
+ in_code = false;
+ }
+
+ for (var i = 0, l = code.length; i < l; i++) {
+ this_line = code[i];
+ if (this_line.match(lang.comment) && !in_comment && !this_line.match(/^#\!/)) {
+ if (in_code) pushblock();
+ commentblock.push(this_line.replace(lang.comment, ''))
+ } else if (this_line.match(lang.start) && !in_comment) {
+ if (lang.name === 'python' && in_code) {
+ while (codeblock[codeblock.length - 1].trim() !== '') {
+ tempblock.push(codeblock.pop());
+ }
+ }
+ if (in_code) pushblock();
+ if (lang.name === 'python') {
+ for (var ti = 0, tl = tempblock.length; ti < tl; ti++) {
+ codeblock.push(tempblock.pop());
+ }
+ }
+ in_comment = true;
+ spaces = this_line.match(/^\s+/);
+ if (spaces) spaces = spaces[0].length;
+ this_line = this_line.replace(lang.start, '');
+ if (this_line.match(lang.end)) {
+ this_line = this_line.replace(lang.end, '');
+ in_comment = false;
+ }
+ if (this_line.trim() !== '') commentblock.push(this_line);
+ } else if (this_line.match(lang.end) && in_comment) {
+ this_line = this_line.replace(lang.end, '');
+ if (this_line.trim() !== '') commentblock.push(this_line);
+ in_comment = false;
+ } else if (this_line.trim() === '' && !in_comment && !in_code) {
+ pushblock();
+ } else {
+ if (in_comment) {
+ if (lang.name === 'python') this_line = this_line.substring(spaces);
+ commentblock.push(this_line);
+ } else {
+ if (!in_code && this_line.trim() !== '') in_code = true;
+ codeblock.push(this_line);
+ }
+ }
+ }
+
+ pushblock();
+
+ if (outputFormat === 'md') {
+ generate_md(parsed_code, lang, callback);
+ } else if (outputFormat === 'html') {
+ generate_html(parsed_code, lang, template, callback);
+ }
+}
+
+// This is the exported method
+exports.generate_doc = parse_code;
+
+// This function writes the parsed output to a markdown file, matching the original source's filename but changing the extension to .md
+function generate_md(parsed_code, language, callback) {
+ var outfile,
+ outcode = '';
+
+ for (var i = 0, l = parsed_code.length; i < l; i++) {
+ if (parsed_code[i].comment !== '') outcode += parsed_code[i].comment + '\n\n';
+ if (parsed_code[i].code !== '') outcode += '```' + language.name + '\n' + parsed_code[i].code + '\n```\n\n';
+ }
+
+ callback(null, outcode);
+}
+
+// This function writes parsed output to html
+function generate_html(parsed_code, language, template, callback) {
+ var outfile,
+ templatePath,
+ template;
+
+ if (typeof template === 'undefined') {
+ templatePath = path.join(__dirname, 'template.jade');
+ } else {
+ templatePath = template;
+ }
+
+ template = fs.readFileSync(__dirname + '/template.jade', 'utf-8');
+ var fn = jade.compile(template);
+
+ callback(null, fn({ gfm: gfm, data: parsed_code, hljs: hljs, lang: language.name }));
+}
+
+/*
+Here we define our supported languages. Each language is a dictionary, keyed on the file extension. Inside the dictionary
+we have the the following items:
+
+* 'name': the identifier that we output to the markdown for code blocks
+* 'comment': is a regex that will match a single line comment for the specific language, but does NOT include the text on the line, only the comment
+* 'start': a regular expression to match the beginning of a multi-line commment block. 'start' should only match if it's on the beginning
+of a line
+* 'end': the partner regex to 'start' matching the end of a multi-line comment only if the match is at the end of a line.
+*/
+var C_LINE_COMMENT = /^\s*\/\/\s?/,
+ C_BLOCK_COMMENT_START = /^\s*\/\*\s?/,
+ C_BLOCK_COMMENT_END = /\*\/\s*$/,
+ HASH_LINE_COMMENT = /^\s*#\s?/,
+ NEVER_MATCH = /a\bc/;
+var languages = {
+ '.js': { name: 'javascript', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.py': { name: 'python', comment: HASH_LINE_COMMENT, start: /^\s*\"\"\"\s?/, end: /\"\"\"\s*$/ },
+ '.rb': { name: 'ruby', comment: HASH_LINE_COMMENT, start: /^\s*\=begin\s?/, end: /\=end\s*$/ },
+ '.lua': { name: 'lua', comment: /^\s*--\s?/, start: /^\s*--\[\[\s?/, end: /--\]\]\s*$/ },
+ '.coffee': { name: 'coffeescript', comment: /^\s*#(?!##)\s?/, start: /^\s*###\s?/, end: /###\s*$/ },
+ '.php': { name: 'php', comment: /^\s*(?:#|\/\/\s?)/, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.c': { name: null, comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.h': { name: null, comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.pl': { name: 'perl', comment: HASH_LINE_COMMENT, start: NEVER_MATCH, end: NEVER_MATCH },
+ '.cpp': { name: 'cpp', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.cs': { name: 'cs', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.m': { name: 'objectivec', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.sql': { name: 'sql', comment: /^\s*--\s?/, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.sh': { name: 'bash', comment: HASH_LINE_COMMENT, start: NEVER_MATCH, end: NEVER_MATCH },
+ '.css': { name: 'css', comment: NEVER_MATCH, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.as': { name: 'actionscript', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END }
+};
diff --git a/node_modules/anvil.js/node_modules/ape/lib/ape.md b/node_modules/anvil.js/node_modules/ape/lib/ape.md
new file mode 100644
index 0000000..f380875
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/lib/ape.md
@@ -0,0 +1,210 @@
+## API docs? Nope, ape docs!
+
+---
+ape is a command line tool to generate documentation from your comments.
+It parses your source code files, and strips markdown formatted comments out,
+it then puts your code in github-flavored-markdown code blocks, and displays the comments in line.
+
+It wasn't written to be fancy, but rather to have a simple, automated way of keeping docs on github up to date.
+
+To use:
+
+ sudo npm install -g ape
+ ape [list of files or directories]
+
+Require dependencies
+
+```javascript
+var fs = require('fs'),
+ path = require('path'),
+ gfm = require('ghm'),
+ hljs = require('hljs'),
+ jade = require('jade');
+
+```
+
+This function is a helper for frontends, to make it simpler to determine if a file can be processed by ape.
+It returns a callback with a single boolean parameter indicating if the file is supported
+
+```javascript
+exports.supported = function (filename, callback) {
+ var lang = languages[path.extname(filename)];
+ if (typeof lang === 'undefined' ) {
+ callback(false);
+ } else {
+ callback(true);
+ }
+};
+
+```
+
+A simple helper function to return the dictionary of comment regexs, determined by the file extension
+
+```javascript
+exports.get_language = function (filename) {
+ var lang = languages[path.extname(filename)];
+ return lang;
+}
+
+```
+
+This is the main function to parse the line array of source code, and return a new line array
+containing the formatted text
+
+```javascript
+function parse_code(code, lang, outputFormat, template, callback) {
+ var parsed_code = [],
+ this_line,
+ in_comment,
+ in_code,
+ spaces,
+ commentblock = [],
+ codeblock = [],
+ tempblock = [];
+
+ if (code && typeof code !== 'string') code = code.toString().split("\n");
+ if (typeof lang === 'undefined' || !code) return;
+
+ function pushblock() {
+ parsed_code.push({ code: codeblock.join('\n'), comment: commentblock.join('\n') });
+ codeblock = [];
+ commentblock = [];
+ in_code = false;
+ }
+
+ for (var i = 0, l = code.length; i < l; i++) {
+ this_line = code[i];
+ if (this_line.match(lang.comment) && !in_comment && !this_line.match(/^#\!/)) {
+ if (in_code) pushblock();
+ commentblock.push(this_line.replace(lang.comment, ''))
+ } else if (this_line.match(lang.start) && !in_comment) {
+ if (lang.name === 'python' && in_code) {
+ while (codeblock[codeblock.length - 1].trim() !== '') {
+ tempblock.push(codeblock.pop());
+ }
+ }
+ if (in_code) pushblock();
+ if (lang.name === 'python') {
+ for (var ti = 0, tl = tempblock.length; ti < tl; ti++) {
+ codeblock.push(tempblock.pop());
+ }
+ }
+ in_comment = true;
+ spaces = this_line.match(/^\s+/);
+ if (spaces) spaces = spaces[0].length;
+ this_line = this_line.replace(lang.start, '');
+ if (this_line.match(lang.end)) {
+ this_line = this_line.replace(lang.end, '');
+ in_comment = false;
+ }
+ if (this_line.trim() !== '') commentblock.push(this_line);
+ } else if (this_line.match(lang.end) && in_comment) {
+ this_line = this_line.replace(lang.end, '');
+ if (this_line.trim() !== '') commentblock.push(this_line);
+ in_comment = false;
+ } else if (this_line.trim() === '' && !in_comment && !in_code) {
+ pushblock();
+ } else {
+ if (in_comment) {
+ if (lang.name === 'python') this_line = this_line.substring(spaces);
+ commentblock.push(this_line);
+ } else {
+ if (!in_code && this_line.trim() !== '') in_code = true;
+ codeblock.push(this_line);
+ }
+ }
+ }
+
+ pushblock();
+
+ if (outputFormat === 'md') {
+ generate_md(parsed_code, lang, callback);
+ } else if (outputFormat === 'html') {
+ generate_html(parsed_code, lang, template, callback);
+ }
+}
+
+```
+
+This is the exported method
+
+```javascript
+exports.generate_doc = parse_code;
+
+```
+
+This function writes the parsed output to a markdown file, matching the original source's filename but changing the extension to .md
+
+```javascript
+function generate_md(parsed_code, language, callback) {
+ var outfile,
+ outcode = '';
+
+ for (var i = 0, l = parsed_code.length; i < l; i++) {
+ if (parsed_code[i].comment !== '') outcode += parsed_code[i].comment + '\n\n';
+ if (parsed_code[i].code !== '') outcode += '```' + language.name + '\n' + parsed_code[i].code + '\n```\n\n';
+ }
+
+ callback(null, outcode);
+}
+
+```
+
+This function writes parsed output to html
+
+```javascript
+function generate_html(parsed_code, language, template, callback) {
+ var outfile,
+ templatePath,
+ template;
+
+ if (typeof template === 'undefined') {
+ templatePath = path.join(__dirname, 'template.jade');
+ } else {
+ templatePath = template;
+ }
+
+ template = fs.readFileSync(__dirname + '/template.jade', 'utf-8');
+ var fn = jade.compile(template);
+
+ callback(null, fn({ gfm: gfm, data: parsed_code, hljs: hljs, lang: language.name }));
+}
+
+```
+
+Here we define our supported languages. Each language is a dictionary, keyed on the file extension. Inside the dictionary
+we have the the following items:
+
+* 'name': the identifier that we output to the markdown for code blocks
+* 'comment': is a regex that will match a single line comment for the specific language, but does NOT include the text on the line, only the comment
+* 'start': a regular expression to match the beginning of a multi-line commment block. 'start' should only match if it's on the beginning
+of a line
+* 'end': the partner regex to 'start' matching the end of a multi-line comment only if the match is at the end of a line.
+
+```javascript
+var C_LINE_COMMENT = /^\s*\/\/\s?/,
+ C_BLOCK_COMMENT_START = /^\s*\/\*\s?/,
+ C_BLOCK_COMMENT_END = /\*\/\s*$/,
+ HASH_LINE_COMMENT = /^\s*#\s?/,
+ NEVER_MATCH = /a\bc/;
+var languages = {
+ '.js': { name: 'javascript', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.py': { name: 'python', comment: HASH_LINE_COMMENT, start: /^\s*\"\"\"\s?/, end: /\"\"\"\s*$/ },
+ '.rb': { name: 'ruby', comment: HASH_LINE_COMMENT, start: /^\s*\=begin\s?/, end: /\=end\s*$/ },
+ '.lua': { name: 'lua', comment: /^\s*--\s?/, start: /^\s*--\[\[\s?/, end: /--\]\]\s*$/ },
+ '.coffee': { name: 'coffeescript', comment: /^\s*#(?!##)\s?/, start: /^\s*###\s?/, end: /###\s*$/ },
+ '.php': { name: 'php', comment: /^\s*(?:#|\/\/\s?)/, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.c': { name: null, comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.h': { name: null, comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.pl': { name: 'perl', comment: HASH_LINE_COMMENT, start: NEVER_MATCH, end: NEVER_MATCH },
+ '.cpp': { name: 'cpp', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.cs': { name: 'cs', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.m': { name: 'objectivec', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.sql': { name: 'sql', comment: /^\s*--\s?/, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.sh': { name: 'bash', comment: HASH_LINE_COMMENT, start: NEVER_MATCH, end: NEVER_MATCH },
+ '.css': { name: 'css', comment: NEVER_MATCH, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END },
+ '.as': { name: 'actionscript', comment: C_LINE_COMMENT, start: C_BLOCK_COMMENT_START, end: C_BLOCK_COMMENT_END }
+};
+
+```
+
diff --git a/node_modules/anvil.js/node_modules/ape/lib/template.jade b/node_modules/anvil.js/node_modules/ape/lib/template.jade
new file mode 100644
index 0000000..f1cf0da
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/lib/template.jade
@@ -0,0 +1,13 @@
+!!! 5
+head
+ style(type='text/css')
+ pre code{display:block;padding:.5em;color:black;background:#f8f8ff}pre .comment,pre .template_comment,pre .diff .header,pre .javadoc{color:#998;font-style:italic}pre .keyword,pre .css .rule .keyword,pre .winutils,pre .javascript .title,pre .lisp .title,pre .subst{color:black;font-weight:bold}pre .number,pre .hexcolor{color:#40a070}pre .string,pre .tag .value,pre .phpdoc,pre .tex .formula{color:#d14}pre .title,pre .id{color:#900;font-weight:bold}pre .javascript .title,pre .lisp .title,pre .subst{font-weight:normal}pre .class .title,pre .haskell .label,pre .tex .command{color:#458;font-weight:bold}pre .tag,pre .tag .title,pre .rules .property,pre .django .tag .keyword{color:navy;font-weight:normal}pre .attribute,pre .variable,pre .instancevar,pre .lisp .body{color:teal}pre .regexp{color:#009926}pre .class{color:#458;font-weight:bold}pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .lisp .keyword,pre .tex .special,pre .input_number{color:#990073}pre .builtin,pre .built_in,pre .lisp .title{color:#0086b3}pre .preprocessor,pre .pi,pre .doctype,pre .shebang,pre .cdata{color:#999;font-weight:bold}pre .deletion{background:#fdd}pre .addition{background:#dfd}pre .diff .change{background:#0086b3}pre .chunk{color:#aaa}pre .tex .formula{opacity:.5}#docs {margin:auto}.block {clear:both}.comment {padding: 0 10px;width:50%;background:snow}.code {width:49%;background:#f8f8ff}td {vertical-align:top}table {width:90%; border-collapse:collapse}
+body
+ table#docs
+ - each block in data
+ tr.block
+ td.comment
+ != gfm.parse(block.comment)
+ td.code
+ - if (block.code !== '')
+ != '' + hljs(block.code, lang).value + ' '
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/.bin/jade b/node_modules/anvil.js/node_modules/ape/node_modules/.bin/jade
new file mode 120000
index 0000000..571fae7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/.bin/jade
@@ -0,0 +1 @@
+../jade/bin/jade
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/.gitmodules b/node_modules/anvil.js/node_modules/ape/node_modules/async/.gitmodules
new file mode 100644
index 0000000..a9aae98
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/.gitmodules
@@ -0,0 +1,9 @@
+[submodule "deps/nodeunit"]
+ path = deps/nodeunit
+ url = git://github.com/caolan/nodeunit.git
+[submodule "deps/UglifyJS"]
+ path = deps/UglifyJS
+ url = https://github.com/mishoo/UglifyJS.git
+[submodule "deps/nodelint"]
+ path = deps/nodelint
+ url = https://github.com/tav/nodelint.git
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/.npmignore b/node_modules/anvil.js/node_modules/ape/node_modules/async/.npmignore
new file mode 100644
index 0000000..9bdfc97
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/.npmignore
@@ -0,0 +1,4 @@
+deps
+dist
+test
+nodelint.cfg
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/LICENSE b/node_modules/anvil.js/node_modules/ape/node_modules/async/LICENSE
new file mode 100644
index 0000000..b7f9d50
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/Makefile b/node_modules/anvil.js/node_modules/ape/node_modules/async/Makefile
new file mode 100644
index 0000000..bad647c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/Makefile
@@ -0,0 +1,25 @@
+PACKAGE = asyncjs
+NODEJS = $(if $(shell test -f /usr/bin/nodejs && echo "true"),nodejs,node)
+CWD := $(shell pwd)
+NODEUNIT = $(CWD)/node_modules/nodeunit/bin/nodeunit
+UGLIFY = $(CWD)/node_modules/uglify-js/bin/uglifyjs
+NODELINT = $(CWD)/node_modules/nodelint/nodelint
+
+BUILDDIR = dist
+
+all: clean test build
+
+build: $(wildcard lib/*.js)
+ mkdir -p $(BUILDDIR)
+ $(UGLIFY) lib/async.js > $(BUILDDIR)/async.min.js
+
+test:
+ $(NODEUNIT) test
+
+clean:
+ rm -rf $(BUILDDIR)
+
+lint:
+ $(NODELINT) --config nodelint.cfg lib/async.js
+
+.PHONY: test build all
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/README.md b/node_modules/anvil.js/node_modules/ape/node_modules/async/README.md
new file mode 100644
index 0000000..1bbbc47
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/README.md
@@ -0,0 +1,1021 @@
+# Async.js
+
+Async is a utility module which provides straight-forward, powerful functions
+for working with asynchronous JavaScript. Although originally designed for
+use with [node.js](http://nodejs.org), it can also be used directly in the
+browser.
+
+Async provides around 20 functions that include the usual 'functional'
+suspects (map, reduce, filter, forEach…) as well as some common patterns
+for asynchronous control flow (parallel, series, waterfall…). All these
+functions assume you follow the node.js convention of providing a single
+callback as the last argument of your async function.
+
+
+## Quick Examples
+
+ async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+ });
+
+ async.filter(['file1','file2','file3'], path.exists, function(results){
+ // results now equals an array of the existing files
+ });
+
+ async.parallel([
+ function(){ ... },
+ function(){ ... }
+ ], callback);
+
+ async.series([
+ function(){ ... },
+ function(){ ... }
+ ]);
+
+There are many more functions available so take a look at the docs below for a
+full list. This module aims to be comprehensive, so if you feel anything is
+missing please create a GitHub issue for it.
+
+
+## Download
+
+Releases are available for download from
+[GitHub](http://github.com/caolan/async/downloads).
+Alternatively, you can install using Node Package Manager (npm):
+
+ npm install async
+
+
+__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 17.5kb Uncompressed
+
+__Production:__ [async.min.js](https://github.com/caolan/async/raw/master/dist/async.min.js) - 1.7kb Packed and Gzipped
+
+
+## In the Browser
+
+So far its been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
+
+
+
+
+
+## Documentation
+
+### Collections
+
+* [forEach](#forEach)
+* [map](#map)
+* [filter](#filter)
+* [reject](#reject)
+* [reduce](#reduce)
+* [detect](#detect)
+* [sortBy](#sortBy)
+* [some](#some)
+* [every](#every)
+* [concat](#concat)
+
+### Control Flow
+
+* [series](#series)
+* [parallel](#parallel)
+* [whilst](#whilst)
+* [until](#until)
+* [waterfall](#waterfall)
+* [queue](#queue)
+* [auto](#auto)
+* [iterator](#iterator)
+* [apply](#apply)
+* [nextTick](#nextTick)
+
+### Utils
+
+* [memoize](#memoize)
+* [unmemoize](#unmemoize)
+* [log](#log)
+* [dir](#dir)
+* [noConflict](#noConflict)
+
+
+## Collections
+
+
+### forEach(arr, iterator, callback)
+
+Applies an iterator function to each item in an array, in parallel.
+The iterator is called with an item from the list and a callback for when it
+has finished. If the iterator passes an error to this callback, the main
+callback for the forEach function is immediately called with the error.
+
+Note, that since this function applies the iterator to each item in parallel
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed.
+* callback(err) - A callback which is called after all the iterator functions
+ have finished, or an error has occurred.
+
+__Example__
+
+ // assuming openFiles is an array of file names and saveFile is a function
+ // to save the modified contents of that file:
+
+ async.forEach(openFiles, saveFile, function(err){
+ // if any of the saves produced an error, err would equal that error
+ });
+
+---------------------------------------
+
+
+### forEachSeries(arr, iterator, callback)
+
+The same as forEach only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. This means the iterator functions will complete in order.
+
+
+---------------------------------------
+
+
+### forEachLimit(arr, limit, iterator, callback)
+
+The same as forEach only the iterator is applied to batches of items in the
+array, in series. The next batch of iterators is only called once the current
+one has completed processing.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* limit - How many items should be in each batch.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed.
+* callback(err) - A callback which is called after all the iterator functions
+ have finished, or an error has occurred.
+
+__Example__
+
+ // Assume documents is an array of JSON objects and requestApi is a
+ // function that interacts with a rate-limited REST api.
+
+ async.forEachLimit(documents, 20, requestApi, function(err){
+ // if any of the saves produced an error, err would equal that error
+ });
+---------------------------------------
+
+
+### map(arr, iterator, callback)
+
+Produces a new array of values by mapping each value in the given array through
+the iterator function. The iterator is called with an item from the array and a
+callback for when it has finished processing. The callback takes 2 arguments,
+an error and the transformed item from the array. If the iterator passes an
+error to this callback, the main callback for the map function is immediately
+called with the error.
+
+Note, that since this function applies the iterator to each item in parallel
+there is no guarantee that the iterator functions will complete in order, however
+the results array will be in the same order as the original array.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed
+ with an error (which can be null) and a transformed item.
+* callback(err, results) - A callback which is called after all the iterator
+ functions have finished, or an error has occurred. Results is an array of the
+ transformed items from the original array.
+
+__Example__
+
+ async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+ });
+
+---------------------------------------
+
+
+### mapSeries(arr, iterator, callback)
+
+The same as map only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+
+---------------------------------------
+
+
+### filter(arr, iterator, callback)
+
+__Alias:__ select
+
+Returns a new array of all the values which pass an async truth test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like path.exists. This operation is
+performed in parallel, but the results array will be in the same order as the
+original.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed.
+* callback(results) - A callback which is called after all the iterator
+ functions have finished.
+
+__Example__
+
+ async.filter(['file1','file2','file3'], path.exists, function(results){
+ // results now equals an array of the existing files
+ });
+
+---------------------------------------
+
+
+### filterSeries(arr, iterator, callback)
+
+__alias:__ selectSeries
+
+The same as filter only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+---------------------------------------
+
+
+### reject(arr, iterator, callback)
+
+The opposite of filter. Removes values that pass an async truth test.
+
+---------------------------------------
+
+
+### rejectSeries(arr, iterator, callback)
+
+The same as filter, only the iterator is applied to each item in the array
+in series.
+
+
+---------------------------------------
+
+
+### reduce(arr, memo, iterator, callback)
+
+__aliases:__ inject, foldl
+
+Reduces a list of values into a single value using an async iterator to return
+each successive step. Memo is the initial state of the reduction. This
+function only operates in series. For performance reasons, it may make sense to
+split a call to this function into a parallel map, then use the normal
+Array.prototype.reduce on the results. This function is for situations where
+each step in the reduction needs to be async, if you can get the data before
+reducing it then its probably a good idea to do so.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* memo - The initial state of the reduction.
+* iterator(memo, item, callback) - A function applied to each item in the
+ array to produce the next step in the reduction. The iterator is passed a
+ callback which accepts an optional error as its first argument, and the state
+ of the reduction as the second. If an error is passed to the callback, the
+ reduction is stopped and the main callback is immediately called with the
+ error.
+* callback(err, result) - A callback which is called after all the iterator
+ functions have finished. Result is the reduced value.
+
+__Example__
+
+ async.reduce([1,2,3], 0, function(memo, item, callback){
+ // pointless async:
+ process.nextTick(function(){
+ callback(null, memo + item)
+ });
+ }, function(err, result){
+ // result is now equal to the last value of memo, which is 6
+ });
+
+---------------------------------------
+
+
+### reduceRight(arr, memo, iterator, callback)
+
+__Alias:__ foldr
+
+Same as reduce, only operates on the items in the array in reverse order.
+
+
+---------------------------------------
+
+
+### detect(arr, iterator, callback)
+
+Returns the first value in a list that passes an async truth test. The
+iterator is applied in parallel, meaning the first iterator to return true will
+fire the detect callback with that result. That means the result might not be
+the first item in the original array (in terms of order) that passes the test.
+
+If order within the original array is important then look at detectSeries.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed.
+* callback(result) - A callback which is called as soon as any iterator returns
+ true, or after all the iterator functions have finished. Result will be
+ the first item in the array that passes the truth test (iterator) or the
+ value undefined if none passed.
+
+__Example__
+
+ async.detect(['file1','file2','file3'], path.exists, function(result){
+ // result now equals the first file in the list that exists
+ });
+
+---------------------------------------
+
+
+### detectSeries(arr, iterator, callback)
+
+The same as detect, only the iterator is applied to each item in the array
+in series. This means the result is always the first in the original array (in
+terms of array order) that passes the truth test.
+
+
+---------------------------------------
+
+
+### sortBy(arr, iterator, callback)
+
+Sorts a list by the results of running each value through an async iterator.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed
+ with an error (which can be null) and a value to use as the sort criteria.
+* callback(err, results) - A callback which is called after all the iterator
+ functions have finished, or an error has occurred. Results is the items from
+ the original array sorted by the values returned by the iterator calls.
+
+__Example__
+
+ async.sortBy(['file1','file2','file3'], function(file, callback){
+ fs.stat(file, function(err, stats){
+ callback(err, stats.mtime);
+ });
+ }, function(err, results){
+ // results is now the original array of files sorted by
+ // modified date
+ });
+
+
+---------------------------------------
+
+
+### some(arr, iterator, callback)
+
+__Alias:__ any
+
+Returns true if at least one element in the array satisfies an async test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like path.exists. Once any iterator
+call returns true, the main callback is immediately called.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed.
+* callback(result) - A callback which is called as soon as any iterator returns
+ true, or after all the iterator functions have finished. Result will be
+ either true or false depending on the values of the async tests.
+
+__Example__
+
+ async.some(['file1','file2','file3'], path.exists, function(result){
+ // if result is true then at least one of the files exists
+ });
+
+---------------------------------------
+
+
+### every(arr, iterator, callback)
+
+__Alias:__ all
+
+Returns true if every element in the array satisfies an async test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like path.exists.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed.
+* callback(result) - A callback which is called after all the iterator
+ functions have finished. Result will be either true or false depending on
+ the values of the async tests.
+
+__Example__
+
+ async.every(['file1','file2','file3'], path.exists, function(result){
+ // if result is true then every file exists
+ });
+
+---------------------------------------
+
+
+### concat(arr, iterator, callback)
+
+Applies an iterator to each item in a list, concatenating the results. Returns the
+concatenated list. The iterators are called in parallel, and the results are
+concatenated as they return. There is no guarantee that the results array will
+be returned in the original order of the arguments passed to the iterator function.
+
+__Arguments__
+
+* arr - An array to iterate over
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback which must be called once it has completed
+ with an error (which can be null) and an array of results.
+* callback(err, results) - A callback which is called after all the iterator
+ functions have finished, or an error has occurred. Results is an array containing
+ the concatenated results of the iterator function.
+
+__Example__
+
+ async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
+ // files is now a list of filenames that exist in the 3 directories
+ });
+
+---------------------------------------
+
+
+### concatSeries(arr, iterator, callback)
+
+Same as async.concat, but executes in series instead of parallel.
+
+
+## Control Flow
+
+
+### series(tasks, [callback])
+
+Run an array of functions in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its
+callback, no more functions are run and the callback for the series is
+immediately called with the value of the error. Once the tasks have completed,
+the results are passed to the final callback as an array.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final callback as an object
+instead of an array. This can be a more readable way of handling results from
+async.series.
+
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed
+ a callback it must call on completion.
+* callback(err, results) - An optional callback to run once all the functions
+ have completed. This function gets an array of all the arguments passed to
+ the callbacks used in the array.
+
+__Example__
+
+ async.series([
+ function(callback){
+ // do some stuff ...
+ callback(null, 'one');
+ },
+ function(callback){
+ // do some more stuff ...
+ callback(null, 'two');
+ },
+ ],
+ // optional callback
+ function(err, results){
+ // results is now equal to ['one', 'two']
+ });
+
+
+ // an example using an object instead of an array
+ async.series({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ },
+ },
+ function(err, results) {
+ // results is now equal to: {one: 1, two: 2}
+ });
+
+
+---------------------------------------
+
+
+### parallel(tasks, [callback])
+
+Run an array of functions in parallel, without waiting until the previous
+function has completed. If any of the functions pass an error to its
+callback, the main callback is immediately called with the value of the error.
+Once the tasks have completed, the results are passed to the final callback as an
+array.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final callback as an object
+instead of an array. This can be a more readable way of handling results from
+async.parallel.
+
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed a
+ callback it must call on completion.
+* callback(err, results) - An optional callback to run once all the functions
+ have completed. This function gets an array of all the arguments passed to
+ the callbacks used in the array.
+
+__Example__
+
+ async.parallel([
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'one');
+ }, 200);
+ },
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'two');
+ }, 100);
+ },
+ ],
+ // optional callback
+ function(err, results){
+ // the results array will equal ['one','two'] even though
+ // the second function had a shorter timeout.
+ });
+
+
+ // an example using an object instead of an array
+ async.parallel({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ },
+ },
+ function(err, results) {
+ // results is now equals to: {one: 1, two: 2}
+ });
+
+
+---------------------------------------
+
+
+### whilst(test, fn, callback)
+
+Repeatedly call fn, while test returns true. Calls the callback when stopped,
+or an error occurs.
+
+__Arguments__
+
+* test() - synchronous truth test to perform before each execution of fn.
+* fn(callback) - A function to call each time the test passes. The function is
+ passed a callback which must be called once it has completed with an optional
+ error as the first argument.
+* callback(err) - A callback which is called after the test fails and repeated
+ execution of fn has stopped.
+
+__Example__
+
+ var count = 0;
+
+ async.whilst(
+ function () { return count < 5; },
+ function (callback) {
+ count++;
+ setTimeout(callback, 1000);
+ },
+ function (err) {
+ // 5 seconds have passed
+ }
+ );
+
+
+---------------------------------------
+
+
+### until(test, fn, callback)
+
+Repeatedly call fn, until test returns true. Calls the callback when stopped,
+or an error occurs.
+
+The inverse of async.whilst.
+
+
+---------------------------------------
+
+
+### waterfall(tasks, [callback])
+
+Runs an array of functions in series, each passing their results to the next in
+the array. However, if any of the functions pass an error to the callback, the
+next function is not executed and the main callback is immediately called with
+the error.
+
+__Arguments__
+
+* tasks - An array of functions to run, each function is passed a callback it
+ must call on completion.
+* callback(err, [results]) - An optional callback to run once all the functions
+ have completed. This will be passed the results of the last task's callback.
+
+
+
+__Example__
+
+ async.waterfall([
+ function(callback){
+ callback(null, 'one', 'two');
+ },
+ function(arg1, arg2, callback){
+ callback(null, 'three');
+ },
+ function(arg1, callback){
+ // arg1 now equals 'three'
+ callback(null, 'done');
+ }
+ ], function (err, result) {
+ // result now equals 'done'
+ });
+
+
+---------------------------------------
+
+
+### queue(worker, concurrency)
+
+Creates a queue object with the specified concurrency. Tasks added to the
+queue will be processed in parallel (up to the concurrency limit). If all
+workers are in progress, the task is queued until one is available. Once
+a worker has completed a task, the task's callback is called.
+
+__Arguments__
+
+* worker(task, callback) - An asynchronous function for processing a queued
+ task.
+* concurrency - An integer for determining how many worker functions should be
+ run in parallel.
+
+__Queue objects__
+
+The queue object returned by this function has the following properties and
+methods:
+
+* length() - a function returning the number of items waiting to be processed.
+* concurrency - an integer for determining how many worker functions should be
+ run in parallel. This property can be changed after a queue is created to
+ alter the concurrency on-the-fly.
+* push(task, [callback]) - add a new task to the queue, the callback is called
+ once the worker has finished processing the task.
+ instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
+* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
+* empty - a callback that is called when the last item from the queue is given to a worker
+* drain - a callback that is called when the last item from the queue has returned from the worker
+
+__Example__
+
+ // create a queue object with concurrency 2
+
+ var q = async.queue(function (task, callback) {
+ console.log('hello ' + task.name);
+ callback();
+ }, 2);
+
+
+ // assign a callback
+ q.drain = function() {
+ console.log('all items have been processed');
+ }
+
+ // add some items to the queue
+
+ q.push({name: 'foo'}, function (err) {
+ console.log('finished processing foo');
+ });
+ q.push({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+ });
+
+ // add some items to the queue (batch-wise)
+
+ q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
+ console.log('finished processing bar');
+ });
+
+
+---------------------------------------
+
+
+### auto(tasks, [callback])
+
+Determines the best order for running functions based on their requirements.
+Each function can optionally depend on other functions being completed first,
+and each function is run as soon as its requirements are satisfied. If any of
+the functions pass an error to their callback, that function will not complete
+(so any other functions depending on it will not run) and the main callback
+will be called immediately with the error. Functions also receive an object
+containing the results of functions which have completed so far.
+
+__Arguments__
+
+* tasks - An object literal containing named functions or an array of
+ requirements, with the function itself the last item in the array. The key
+ used for each function or array is used when specifying requirements. The
+ syntax is easier to understand by looking at the example.
+* callback(err, results) - An optional callback which is called when all the
+ tasks have been completed. The callback will receive an error as an argument
+ if any tasks pass an error to their callback. If all tasks complete
+ successfully, it will receive an object containing their results.
+
+__Example__
+
+ async.auto({
+ get_data: function(callback){
+ // async code to get some data
+ },
+ make_folder: function(callback){
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ },
+ write_file: ['get_data', 'make_folder', function(callback){
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ callback(null, filename);
+ }],
+ email_link: ['write_file', function(callback, results){
+ // once the file is written let's email a link to it...
+ // results.write_file contains the filename returned by write_file.
+ }]
+ });
+
+This is a fairly trivial example, but to do this using the basic parallel and
+series functions would look like this:
+
+ async.parallel([
+ function(callback){
+ // async code to get some data
+ },
+ function(callback){
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ }
+ ],
+ function(results){
+ async.series([
+ function(callback){
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ },
+ email_link: function(callback){
+ // once the file is written let's email a link to it...
+ }
+ ]);
+ });
+
+For a complicated series of async tasks using the auto function makes adding
+new tasks much easier and makes the code more readable.
+
+
+---------------------------------------
+
+
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the array,
+returning a continuation to call the next one after that. Its also possible to
+'peek' the next iterator by doing iterator.next().
+
+This function is used internally by the async module but can be useful when
+you want to manually control the flow of functions in series.
+
+__Arguments__
+
+* tasks - An array of functions to run, each function is passed a callback it
+ must call on completion.
+
+__Example__
+
+ var iterator = async.iterator([
+ function(){ sys.p('one'); },
+ function(){ sys.p('two'); },
+ function(){ sys.p('three'); }
+ ]);
+
+ node> var iterator2 = iterator();
+ 'one'
+ node> var iterator3 = iterator2();
+ 'two'
+ node> iterator3();
+ 'three'
+ node> var nextfn = iterator2.next();
+ node> nextfn();
+ 'three'
+
+
+---------------------------------------
+
+
+### apply(function, arguments..)
+
+Creates a continuation function with some arguments already applied, a useful
+shorthand when combined with other control flow functions. Any arguments
+passed to the returned function are added to the arguments originally passed
+to apply.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to automatically apply when the
+ continuation is called.
+
+__Example__
+
+ // using apply
+
+ async.parallel([
+ async.apply(fs.writeFile, 'testfile1', 'test1'),
+ async.apply(fs.writeFile, 'testfile2', 'test2'),
+ ]);
+
+
+ // the same process without using apply
+
+ async.parallel([
+ function(callback){
+ fs.writeFile('testfile1', 'test1', callback);
+ },
+ function(callback){
+ fs.writeFile('testfile2', 'test2', callback);
+ },
+ ]);
+
+It's possible to pass any number of additional arguments when calling the
+continuation:
+
+ node> var fn = async.apply(sys.puts, 'one');
+ node> fn('two', 'three');
+ one
+ two
+ three
+
+---------------------------------------
+
+
+### nextTick(callback)
+
+Calls the callback on a later loop around the event loop. In node.js this just
+calls process.nextTick, in the browser it falls back to setTimeout(callback, 0),
+which means other higher priority events may precede the execution of the callback.
+
+This is used internally for browser-compatibility purposes.
+
+__Arguments__
+
+* callback - The function to call on a later loop around the event loop.
+
+__Example__
+
+ var call_order = [];
+ async.nextTick(function(){
+ call_order.push('two');
+ // call_order now equals ['one','two]
+ });
+ call_order.push('one')
+
+
+## Utils
+
+
+### memoize(fn, [hasher])
+
+Caches the results of an async function. When creating a hash to store function
+results against, the callback is omitted from the hash and an optional hash
+function can be used.
+
+__Arguments__
+
+* fn - the function you to proxy and cache results from.
+* hasher - an optional function for generating a custom hash for storing
+ results, it has all the arguments applied to it apart from the callback, and
+ must be synchronous.
+
+__Example__
+
+ var slow_fn = function (name, callback) {
+ // do something
+ callback(null, result);
+ };
+ var fn = async.memoize(slow_fn);
+
+ // fn can now be used as if it were slow_fn
+ fn('some name', function () {
+ // callback
+ });
+
+
+### unmemoize(fn)
+
+Undoes a memoized function, reverting it to the original, unmemoized
+form. Comes handy in tests.
+
+__Arguments__
+
+* fn - the memoized function
+
+
+### log(function, arguments)
+
+Logs the result of an async function to the console. Only works in node.js or
+in browsers that support console.log and console.error (such as FF and Chrome).
+If multiple arguments are returned from the async function, console.log is
+called on each argument in order.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to apply to the function.
+
+__Example__
+
+ var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, 'hello ' + name);
+ }, 1000);
+ };
+
+ node> async.log(hello, 'world');
+ 'hello world'
+
+
+---------------------------------------
+
+
+### dir(function, arguments)
+
+Logs the result of an async function to the console using console.dir to
+display the properties of the resulting object. Only works in node.js or
+in browsers that support console.dir and console.error (such as FF and Chrome).
+If multiple arguments are returned from the async function, console.dir is
+called on each argument in order.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to apply to the function.
+
+__Example__
+
+ var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, {hello: name});
+ }, 1000);
+ };
+
+ node> async.dir(hello, 'world');
+ {hello: 'world'}
+
+
+---------------------------------------
+
+
+### noConflict()
+
+Changes the value of async back to its original value, returning a reference to the
+async object.
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/async/index.js
new file mode 100644
index 0000000..8e23845
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/index.js
@@ -0,0 +1,3 @@
+// This file is just added for convenience so this repository can be
+// directly checked out into a project's deps folder
+module.exports = require('./lib/async');
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/lib/async.js b/node_modules/anvil.js/node_modules/ape/node_modules/async/lib/async.js
new file mode 100644
index 0000000..7cc4f5e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/lib/async.js
@@ -0,0 +1,692 @@
+/*global setTimeout: false, console: false */
+(function () {
+
+ var async = {};
+
+ // global on the server, window in the browser
+ var root = this,
+ previous_async = root.async;
+
+ if (typeof module !== 'undefined' && module.exports) {
+ module.exports = async;
+ }
+ else {
+ root.async = async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ //// cross-browser compatiblity functions ////
+
+ var _forEach = function (arr, iterator) {
+ if (arr.forEach) {
+ return arr.forEach(iterator);
+ }
+ for (var i = 0; i < arr.length; i += 1) {
+ iterator(arr[i], i, arr);
+ }
+ };
+
+ var _map = function (arr, iterator) {
+ if (arr.map) {
+ return arr.map(iterator);
+ }
+ var results = [];
+ _forEach(arr, function (x, i, a) {
+ results.push(iterator(x, i, a));
+ });
+ return results;
+ };
+
+ var _reduce = function (arr, iterator, memo) {
+ if (arr.reduce) {
+ return arr.reduce(iterator, memo);
+ }
+ _forEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ };
+
+ var _keys = function (obj) {
+ if (Object.keys) {
+ return Object.keys(obj);
+ }
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+ if (typeof process === 'undefined' || !(process.nextTick)) {
+ async.nextTick = function (fn) {
+ setTimeout(fn, 0);
+ };
+ }
+ else {
+ async.nextTick = process.nextTick;
+ }
+
+ async.forEach = function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ _forEach(arr, function (x) {
+ iterator(x, function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed === arr.length) {
+ callback(null);
+ }
+ }
+ });
+ });
+ };
+
+ async.forEachSeries = function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ var iterate = function () {
+ iterator(arr[completed], function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed === arr.length) {
+ callback(null);
+ }
+ else {
+ iterate();
+ }
+ }
+ });
+ };
+ iterate();
+ };
+
+ async.forEachLimit = function (arr, limit, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length || limit <= 0) {
+ return callback();
+ }
+ var completed = 0;
+ var started = 0;
+ var running = 0;
+
+ (function replenish () {
+ if (completed === arr.length) {
+ return callback();
+ }
+
+ while (running < limit && started < arr.length) {
+ started += 1;
+ running += 1;
+ iterator(arr[started - 1], function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ running -= 1;
+ if (completed === arr.length) {
+ callback();
+ }
+ else {
+ replenish();
+ }
+ }
+ });
+ }
+ })();
+ };
+
+
+ var doParallel = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.forEach].concat(args));
+ };
+ };
+ var doSeries = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.forEachSeries].concat(args));
+ };
+ };
+
+
+ var _asyncMap = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err, v) {
+ results[x.index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ };
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.forEachSeries(arr, function (x, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+ // inject alias
+ async.inject = async.reduce;
+ // foldl alias
+ async.foldl = async.reduce;
+
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, function (x) {
+ return x;
+ }).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+ // foldr alias
+ async.foldr = async.reduceRight;
+
+ var _filter = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.filter = doParallel(_filter);
+ async.filterSeries = doSeries(_filter);
+ // select alias
+ async.select = async.filter;
+ async.selectSeries = async.filterSeries;
+
+ var _reject = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (!v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.reject = doParallel(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ var _detect = function (eachfn, arr, iterator, main_callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x, function (result) {
+ if (result) {
+ main_callback(x);
+ main_callback = function () {};
+ }
+ else {
+ callback();
+ }
+ });
+ }, function (err) {
+ main_callback();
+ });
+ };
+ async.detect = doParallel(_detect);
+ async.detectSeries = doSeries(_detect);
+
+ async.some = function (arr, iterator, main_callback) {
+ async.forEach(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ main_callback(true);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(false);
+ });
+ };
+ // any alias
+ async.any = async.some;
+
+ async.every = function (arr, iterator, main_callback) {
+ async.forEach(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (!v) {
+ main_callback(false);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(true);
+ });
+ };
+ // all alias
+ async.all = async.every;
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ var fn = function (left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ };
+ callback(null, _map(results.sort(fn), function (x) {
+ return x.value;
+ }));
+ }
+ });
+ };
+
+ async.auto = function (tasks, callback) {
+ callback = callback || function () {};
+ var keys = _keys(tasks);
+ if (!keys.length) {
+ return callback(null);
+ }
+
+ var results = {};
+
+ var listeners = [];
+ var addListener = function (fn) {
+ listeners.unshift(fn);
+ };
+ var removeListener = function (fn) {
+ for (var i = 0; i < listeners.length; i += 1) {
+ if (listeners[i] === fn) {
+ listeners.splice(i, 1);
+ return;
+ }
+ }
+ };
+ var taskComplete = function () {
+ _forEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ };
+
+ addListener(function () {
+ if (_keys(results).length === keys.length) {
+ callback(null, results);
+ callback = function () {};
+ }
+ });
+
+ _forEach(keys, function (k) {
+ var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
+ var taskCallback = function (err) {
+ if (err) {
+ callback(err);
+ // stop subsequent errors hitting callback multiple times
+ callback = function () {};
+ }
+ else {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ taskComplete();
+ }
+ };
+ var requires = task.slice(0, Math.abs(task.length - 1)) || [];
+ var ready = function () {
+ return _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ };
+ if (ready()) {
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ var listener = function () {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ };
+ addListener(listener);
+ }
+ });
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = callback || function () {};
+ if (!tasks.length) {
+ return callback();
+ }
+ var wrapIterator = function (iterator) {
+ return function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ var args = Array.prototype.slice.call(arguments, 1);
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ async.nextTick(function () {
+ iterator.apply(null, args);
+ });
+ }
+ };
+ };
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ async.parallel = function (tasks, callback) {
+ callback = callback || function () {};
+ if (tasks.constructor === Array) {
+ async.map(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ async.forEach(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.series = function (tasks, callback) {
+ callback = callback || function () {};
+ if (tasks.constructor === Array) {
+ async.mapSeries(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ async.forEachSeries(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.iterator = function (tasks) {
+ var makeCallback = function (index) {
+ var fn = function () {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ };
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ };
+ return makeCallback(0);
+ };
+
+ async.apply = function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ return function () {
+ return fn.apply(
+ null, args.concat(Array.prototype.slice.call(arguments))
+ );
+ };
+ };
+
+ var _concat = function (eachfn, arr, fn, callback) {
+ var r = [];
+ eachfn(arr, function (x, cb) {
+ fn(x, function (err, y) {
+ r = r.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, r);
+ });
+ };
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ if (test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.whilst(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.until = function (test, iterator, callback) {
+ if (!test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.until(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.queue = function (worker, concurrency) {
+ var workers = 0;
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ saturated: null,
+ empty: null,
+ drain: null,
+ push: function (data, callback) {
+ if(data.constructor !== Array) {
+ data = [data];
+ }
+ _forEach(data, function(task) {
+ q.tasks.push({
+ data: task,
+ callback: typeof callback === 'function' ? callback : null
+ });
+ if (q.saturated && q.tasks.length == concurrency) {
+ q.saturated();
+ }
+ async.nextTick(q.process);
+ });
+ },
+ process: function () {
+ if (workers < q.concurrency && q.tasks.length) {
+ var task = q.tasks.shift();
+ if(q.empty && q.tasks.length == 0) q.empty();
+ workers += 1;
+ worker(task.data, function () {
+ workers -= 1;
+ if (task.callback) {
+ task.callback.apply(task, arguments);
+ }
+ if(q.drain && q.tasks.length + workers == 0) q.drain();
+ q.process();
+ });
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ }
+ };
+ return q;
+ };
+
+ var _console_fn = function (name) {
+ return function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ fn.apply(null, args.concat([function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (typeof console !== 'undefined') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _forEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ }]));
+ };
+ };
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ hasher = hasher || function (x) {
+ return x;
+ };
+ var memoized = function () {
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (key in memo) {
+ callback.apply(null, memo[key]);
+ }
+ else if (key in queues) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([function () {
+ memo[key] = arguments;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, arguments);
+ }
+ }]));
+ }
+ };
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+}());
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/async/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/async/package.json
new file mode 100644
index 0000000..39bc4ff
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/async/package.json
@@ -0,0 +1,21 @@
+{ "name": "async"
+, "description": "Higher-order functions and common patterns for asynchronous code"
+, "main": "./index"
+, "author": "Caolan McMahon"
+, "version": "0.1.22"
+, "repository" :
+ { "type" : "git"
+ , "url" : "http://github.com/caolan/async.git"
+ }
+, "bugs" : { "url" : "http://github.com/caolan/async/issues" }
+, "licenses" :
+ [ { "type" : "MIT"
+ , "url" : "http://github.com/caolan/async/raw/master/LICENSE"
+ }
+ ]
+, "devDependencies":
+ { "nodeunit": ">0.0.0"
+ , "uglify-js": "1.2.x"
+ , "nodelint": ">0.0.0"
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/.npmignore b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/.npmignore
new file mode 100644
index 0000000..9263a1e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/.npmignore
@@ -0,0 +1,2 @@
+_site
+.DS_Store
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/README.md b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/README.md
new file mode 100644
index 0000000..4ee3848
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/README.md
@@ -0,0 +1,17 @@
+See:
+[github-flavored-markdown](http://github.github.com/github-flavored-markdown/)
+
+As an npm package:
+
+ npm install ghm
+
+And then in your node program:
+
+ var ghm = require("ghm")
+ ghm.parse("I **love** GHM.\n\n#2", "isaacs/npm")
+ // returns:
+ // 'I love GHM. '+
+ // '#2
'
+
+To get the sha/issue/fork links, pass in a second argument specifying
+the current project that things should be relative to.
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/_config.yml b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/_config.yml
new file mode 100644
index 0000000..6595442
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/_config.yml
@@ -0,0 +1,3 @@
+markdown: rdiscount
+auto: true
+server: true
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/_layouts/default.html b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/_layouts/default.html
new file mode 100644
index 0000000..86089d6
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/_layouts/default.html
@@ -0,0 +1,133 @@
+
+
+
+
+
+ GitHub Flavored Markdown - {{ page.title }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ content }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/code.rb b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/code.rb
new file mode 100644
index 0000000..e477c07
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/code.rb
@@ -0,0 +1,67 @@
+require 'digest/md5'
+
+def gfm(text)
+ # Extract pre blocks
+ extractions = {}
+ text.gsub!(%r{.*? }m) do |match|
+ md5 = Digest::MD5.hexdigest(match)
+ extractions[md5] = match
+ "{gfm-extraction-#{md5}}"
+ end
+
+ # prevent foo_bar_baz from ending up with an italic word in the middle
+ text.gsub!(/(^(?! {4}|\t)\w+_\w+_\w[\w_]*)/) do |x|
+ x.gsub('_', '\_') if x.split('').sort.to_s[0..1] == '__'
+ end
+
+ # in very clear cases, let newlines become tags
+ text.gsub!(/(\A|^$\n)(^\w[^\n]*\n)(^\w[^\n]*$)+/m) do |x|
+ x.gsub(/^(.+)$/, "\\1 ")
+ end
+
+ # Insert pre block extractions
+ text.gsub!(/\{gfm-extraction-([0-9a-f]{32})\}/) do
+ extractions[$1]
+ end
+
+ text
+end
+
+if $0 == __FILE__
+ require 'test/unit'
+ require 'shoulda'
+
+ class GFMTest < Test::Unit::TestCase
+ context "GFM" do
+ should "not touch single underscores inside words" do
+ assert_equal "foo_bar", gfm("foo_bar")
+ end
+
+ should "not touch underscores in code blocks" do
+ assert_equal " foo_bar_baz", gfm(" foo_bar_baz")
+ end
+
+ should "not touch underscores in pre blocks" do
+ assert_equal "\nfoo_bar_baz\n ", gfm("\nfoo_bar_baz\n ")
+ end
+
+ should "escape two or more underscores inside words" do
+ assert_equal "foo\\_bar\\_baz", gfm("foo_bar_baz")
+ end
+
+ should "turn newlines into br tags in simple cases" do
+ assert_equal "foo \nbar ", gfm("foo\nbar")
+ end
+
+ should "convert newlines in all groups" do
+ assert_equal "apple \npear \norange\n\nruby \npython \nerlang",
+ gfm("apple\npear\norange\n\nruby\npython\nerlang")
+ end
+
+ should "not convert newlines in lists" do
+ assert_equal "# foo\n# bar", gfm("# foo\n# bar")
+ assert_equal "* foo\n* bar", gfm("* foo\n* bar")
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/images/gfm.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/images/gfm.png
new file mode 100644
index 0000000..bfa66e8
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/images/gfm.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/images/gfm_hint.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/images/gfm_hint.png
new file mode 100644
index 0000000..1c9bde9
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/images/gfm_hint.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/index.md b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/index.md
new file mode 100644
index 0000000..29f516f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/index.md
@@ -0,0 +1,97 @@
+---
+title: Introduction
+layout: default
+---
+
+#Introduction to GFM
+
+GitHub uses what we're calling "GitHub Flavored Markdown" (GFM) for messages, issues, and comments. It differs from standard Markdown (SM) in a few significant ways and adds some additional functionality.
+
+If you're not already familiar with Markdown, you should spend 15 minutes and go over the excellent [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) at Daring Fireball.
+
+If you prefer to learn by example, see the following source and result:
+
+* [Source](sample_content.html)
+* [Result](http://github.com/mojombo/github-flavored-markdown/issues/#issue/1)
+
+You can also use our [live javascript preview](http://github.github.com/github-flavored-markdown/preview.html) to see GFM in action.
+
+If you're interested in how we render Markdown files, you might want to check out [Redcarpet](https://github.com/tanoku/redcarpet), our Ruby interface to the [Sundown](https://www.github.com/tanoku/sundown) library.
+
+Differences from traditional Markdown
+-------------------------------------
+
+### Newlines
+
+The biggest difference that GFM introduces is in the handling of linebreaks. With SM you can hard wrap paragraphs of text and they will be combined into a single paragraph. We find this to be the cause of a huge number of unintentional formatting errors. GFM treats newlines in paragraph-like content as real line breaks, which is probably what you intended.
+
+The next paragraph contains two phrases separated by a single newline character:
+
+ Roses are red
+ Violets are blue
+
+becomes
+
+Roses are red
+Violets are blue
+
+### Multiple underscores in words
+
+It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.
+
+ perform_complicated_task
+ do_this_and_do_that_and_another_thing
+
+becomes
+
+perform\_complicated\_task
+do\_this\_and\_do\_that\_and\_another\_thing
+
+### URL autolinking
+
+GFM will autolink standard URLs, so if you want to link to a URL (instead of setting link text), you can simply enter the URL and it will be turned into a link to that URL.
+
+### Fenced code blocks
+
+Markdown converts text with four spaces at the front of each line to code blocks. GFM supports that, but we also support fenced blocks. Just wrap your code blocks in \`\`\` and you won't need to indent manually to trigger a code block.
+
+### Syntax highlighting
+
+We take code blocks a step further and add syntax highlighting if you request it. In your fenced block, add an optional language identifier and we'll run it through syntax highlighting. For example, to syntax highlight Ruby code:
+
+ ```ruby
+ require 'redcarpet'
+ markdown = Redcarpet.new("Hello World!")
+ puts markdown.to_html
+ ```
+
+
+A bit of the GitHub spice
+-------------------------
+
+In addition to the changes in the previous section, certain references are auto-linked:
+
+ * SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+ * User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+ * User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+ * \#Num: #1
+ * User/#Num: mojombo#1
+ * User/Project#Num: mojombo/god#1
+
+becomes
+
+
+
+Code
+----
+
+The newline and underscore modification code can be seen below. If you find a bug in the rendering, we'd love to hear about it.
+
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/package.json
new file mode 100644
index 0000000..9c86c21
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/package.json
@@ -0,0 +1,8 @@
+{
+ "name": "ghm",
+ "version": "1.0.0-3",
+ "description": "github-flavored-markdown maintained by thomblake",
+ "author": "tekkup (http://tekkub.net/) ",
+ "main": "./scripts/showdown.js",
+ "repository": "http://github.com/thomblake/github-flavored-markdown"
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/preview.md b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/preview.md
new file mode 100644
index 0000000..f0d2004
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/preview.md
@@ -0,0 +1,36 @@
+---
+title: Live Preview
+layout: default
+---
+
+GFM Live Preview
+
+This page provides a live GFM preview, rendered client-side using javascript.
+The majority of the credit goes to the wonderful [Showdown](http://softwaremaniacs.org/playground/showdown-highlight/) script, which handles the meat of the processing.
+GFM modifications for newlines, underscore-words, autolinking and GitHub SHA1/issue link syntaxes were added.
+
+
+ GitHub now has previews on all inputs that use GFM.
+ This live preview should be considered depreciated.
+ It may not render exactly the same way github.com
+ will due to differences in markdown libraries.
+
+
+User input
+----------
+
+
+
+
+
+Live preview
+------------
+
+
+
+### HTML
+
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/sample_content.html b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/sample_content.html
new file mode 100644
index 0000000..f9fcf1c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/sample_content.html
@@ -0,0 +1,169 @@
+
+
+
+
+ Example Source
+
+
+GitHub Flavored Markdown
+================================
+
+*View the [source of this content](http://github.github.com/github-flavored-markdown/sample_content.html).*
+
+Let's get the whole "linebreak" thing out of the way. The next paragraph contains two phrases separated by a single newline character:
+
+Roses are red
+Violets are blue
+
+The next paragraph has the same phrases, but now they are separated by two spaces and a newline character:
+
+Roses are red
+Violets are blue
+
+Oh, and one thing I cannot stand is the mangling of words with multiple underscores in them like perform_complicated_task or do_this_and_do_that_and_another_thing.
+
+A bit of the GitHub spice
+-------------------------
+
+In addition to the changes in the previous section, certain references are auto-linked:
+
+* SHA: be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* User@SHA ref: mojombo@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* User/Project@SHA: mojombo/god@be6a8cc1c1ecfe9489fb51e4869af15a13fc2cd2
+* \#Num: #1
+* User/#Num: mojombo#1
+* User/Project#Num: mojombo/god#1
+
+These are dangerous goodies though, and we need to make sure email addresses don't get mangled:
+
+My email addy is tom@github.com.
+
+Math is hard, let's go shopping
+-------------------------------
+
+In first grade I learned that 5 > 3 and 2 < 7. Maybe some arrows. 1 -> 2 -> 3. 9 <- 8 <- 7.
+
+Triangles man! a^2 + b^2 = c^2
+
+We all like making lists
+------------------------
+
+The above header should be an H2 tag. Now, for a list of fruits:
+
+* Red Apples
+* Purple Grapes
+* Green Kiwifruits
+
+Let's get crazy:
+
+1. This is a list item with two paragraphs. Lorem ipsum dolor
+ sit amet, consectetuer adipiscing elit. Aliquam hendrerit
+ mi posuere lectus.
+
+ Vestibulum enim wisi, viverra nec, fringilla in, laoreet
+ vitae, risus. Donec sit amet nisl. Aliquam semper ipsum
+ sit amet velit.
+
+2. Suspendisse id sem consectetuer libero luctus adipiscing.
+
+What about some code **in** a list? That's insane, right?
+
+1. In Ruby you can map like this:
+
+ ['a', 'b'].map { |x| x.uppercase }
+
+2. In Rails, you can do a shortcut:
+
+ ['a', 'b'].map(&:uppercase)
+
+Some people seem to like definition lists
+
+<dl>
+ <dt>Lower cost</dt>
+ <dd>The new version of this product costs significantly less than the previous one!</dd>
+ <dt>Easier to use</dt>
+ <dd>We've changed the product so that it's much easier to use!</dd>
+</dl>
+
+I am a robot
+------------
+
+Maybe you want to print `robot` to the console 1000 times. Why not?
+
+ def robot_invasion
+ puts("robot " * 1000)
+ end
+
+You see, that was formatted as code because it's been indented by four spaces.
+
+How about we throw some angle braces and ampersands in there?
+
+ <div class="footer">
+ © 2004 Foo Corporation
+ </div>
+
+Set in stone
+------------
+
+Preformatted blocks are useful for ASCII art:
+
+<pre>
+ ,-.
+ , ,-. ,-.
+ / \ ( )-( )
+ \ | ,.>-( )-<
+ \|,' ( )-( )
+ Y ___`-' `-'
+ |/__/ `-'
+ |
+ |
+ | -hrr-
+ ___|_____________
+</pre>
+
+Playing the blame game
+----------------------
+
+If you need to blame someone, the best way to do so is by quoting them:
+
+> I, at any rate, am convinced that He does not throw dice.
+
+Or perhaps someone a little less eloquent:
+
+> I wish you'd have given me this written question ahead of time so I
+> could plan for it... I'm sure something will pop into my head here in
+> the midst of this press conference, with all the pressure of trying to
+> come up with answer, but it hadn't yet...
+>
+> I don't want to sound like
+> I have made no mistakes. I'm confident I have. I just haven't - you
+> just put me under the spot here, and maybe I'm not as quick on my feet
+> as I should be in coming up with one.
+
+Table for two
+-------------
+
+<table>
+ <tr>
+ <th>ID</th><th>Name</th><th>Rank</th>
+ </tr>
+ <tr>
+ <td>1</td><td>Tom Preston-Werner</td><td>Awesome</td>
+ </tr>
+ <tr>
+ <td>2</td><td>Albert Einstein</td><td>Nearly as awesome</td>
+ </tr>
+</table>
+
+Crazy linking action
+--------------------
+
+I get 10 times more traffic from [Google] [1] than from
+[Yahoo] [2] or [MSN] [3].
+
+ [1]: http://google.com/ "Google"
+ [2]: http://search.yahoo.com/ "Yahoo Search"
+ [3]: http://search.msn.com/ "MSN Search"
+
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/scripts/preview.js b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/scripts/preview.js
new file mode 100644
index 0000000..c10ad67
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/scripts/preview.js
@@ -0,0 +1,18 @@
+$(function() {
+ var converter = new Showdown.converter();
+ $("#user_input").keyup(function(){
+ var txt = $("#user_input").val();
+ var html = converter.makeHtml(txt);
+ $("#result").html(html)
+ $("#html_result").val(html.replace(/>/g, ">\n").replace(//g, ">\n").replace(/
+//
+// Redistributable under a BSD-style open source license.
+// See license.txt for more information.
+//
+// Apres fork from:
+//
+// https://github.com/apres/github-flavored-markdown
+
+//
+// Wherever possible, Showdown is a straight, line-by-line port
+// of the Perl version of Markdown.
+//
+// This is not a normal parser design; it's basically just a
+// series of string substitutions. It's hard to read and
+// maintain this way, but keeping Showdown close to the original
+// design makes it easier to port new features.
+//
+// More importantly, Showdown behaves like markdown.pl in most
+// edge cases. So web applications can do client-side preview
+// in Javascript, and then build identical HTML on the server.
+//
+// This port needs the new RegExp functionality of ECMA 262,
+// 3rd Edition (i.e. Javascript 1.5). Most modern web browsers
+// should do fine. Even with the new regular expression features,
+// We do a lot of work to emulate Perl's regex functionality.
+// The tricky changes in this file mostly have the "attacklab:"
+// label. Major or self-explanatory changes don't.
+//
+// Smart diff tools like Araxis Merge will be able to match up
+// this file with markdown.pl in a useful way. A little tweaking
+// helps: in a copy of markdown.pl, replace "#" with "//" and
+// replace "$text" with "text". Be sure to ignore whitespace
+// and line endings.
+
+
+// Showdown usage:
+//
+// var text = "Markdown *rocks*.";
+//
+// var converter = new Showdown.converter();
+// var html = converter.makeHtml(text);
+//
+// alert(html);
+
+
+// **************************************************
+// GitHub Flavored Markdown modifications by Tekkub
+// http://github.github.com/github-flavored-markdown/
+//
+// Modifications are tagged with "GFM"
+// **************************************************
+
+// **************************************************
+// Node.JS port by Isaac Z. Schlueter
+//
+// Modifications are tagged with "isaacs"
+// **************************************************
+
+// **************************************************
+// Minor modifications and
+// brutal stylistic changes by Thom Blake
+// Modifications are **everywhere**
+// **************************************************
+
+// **************************************************
+// AMD compatibility by Casey Duncan
+//
+// Modifications are **AMD**
+// **************************************************
+
+// Showdown namespace
+var Showdown = {}
+
+// isaacs: export the Showdown object
+if (typeof exports === "object") {
+ Showdown = exports
+ // isaacs: expose top-level parse() method, like other to-html parsers.
+ Showdown.parse = function (md, gh) {
+ var converter = new Showdown.converter()
+ return converter.makeHtml(md, gh)
+ }
+}
+
+// AMD: define showdown module
+if (typeof define === 'function' && define.amd) {
+ define(function() {
+ // All we want to do is parse, really
+ Showdown.parse = function(md, gh) {
+ var converter = new Showdown.converter();
+ return converter.makeHtml(md, gh);
+ }
+ return Showdown;
+ });
+}
+
+// isaacs: Declare "GitHub" object in here, since Node modules
+// execute in a closure or separate context, rather than right
+// in the global scope. If in the browser, this does nothing.
+var GitHub
+
+// converter
+// Wraps all "globals" so that the only thing
+// exposed is makeHtml().
+Showdown.converter = function () {
+
+ // Globals:
+
+ // Global hashes, used by various utility routines
+ var g_urls
+ var g_titles
+ var g_html_blocks
+
+ // Used to track when we're inside an ordered or unordered list
+ // (see _ProcessListItems() for details):
+ var g_list_level = 0
+
+ // A home for long-winded regex
+ // re.html is via Friedl's "Mastering Regular Expressions", 2nd Ed.
+ var re =
+ { url: /https?\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!]/g
+ , email: /[a-z0-9_\-+=.]+@[a-z0-9\-]+(\.[a-z0-9-]+)+/ig
+ , sha1: /[a-f0-9]{40}/ig
+ , userSha1: /([a-z0-9_\-+=.]+)@([a-f0-9]{40})/ig
+ , repoSha1: /([a-z0-9_\-+=.]+\/[a-z0-9_\-+=.]+)@([a-f0-9]{40})/ig
+ , issue: /#([0-9]+)/ig
+ , userIssue: /([a-z0-9_\-+=.]+)#([0-9]+)/ig
+ , repoIssue: /([a-z0-9_\-+=.]+\/[a-z0-9_\-+=.]+)#([0-9]+)/ig
+ , linkDef: /^[ ]{0,3}\[(.+)\]:[ \t]*\n?[ \t]*(\S+?)>?[ \t]*\n?[ \t]*(?:(\n*)["(](.+?)[")][ \t]*)?(?:\n+|\Z)/gm
+ , nested: /^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math|ins|del)\b[^\r]*?\n<\/\2>[ \t]*(?=\n+))/gm
+ , liberal: /^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm
+ , hr: /(\n[ ]{0,3}(<(hr)\b([^<>])*?\/?>)[ \t]*(?=\n{2,}))/g
+ , comment: /(\n\n[ ]{0,3}[ \t]*(?=\n{2,}))/g
+ , processor: /(?:\n\n)([ ]{0,3}(?:<([?%])[^\r]*?\2>)[ \t]*(?=\n{2,}))/g
+ , html: /(<[a-z\/!$]("[^"]*"|'[^']*'|[^'">])*>|)/gi
+ , referenceLink: /(\[((?:\[[^\]]*\]|[^\[\]])*)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g
+ , inlineLink: /(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g
+ , shortcutLink: /(\[([^\[\]]+)\])()()()()()/g
+ , referenceImage: /(!\[(.*?)\][ ]?(?:\n[ ]*)?\[(.*?)\])()()()()/g
+ , inlineImage: /(!\[(.*?)\]\s?\([ \t]*()(\S+?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g
+ , setextH1: /^(.+)[ \t]*\n=+[ \t]*\n+/gm
+ , setextH2: /^(.+)[ \t]*\n-+[ \t]*\n+/gm
+ , atxHeader: /^(\#{1,6})[ \t]*(.+?)[ \t]*\#*\n+/gm
+ , list: /^(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/gm
+ , list2: /(\n\n|^\n?)(([ ]{0,3}([*+-]|\d+[.])[ \t]+)[^\r]+?(~0|\n{2,}(?=\S)(?![ \t]*(?:[*+-]|\d+[.])[ \t]+)))/g
+ , listStr: /(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm
+ , codeBlock: /(?:\n\n|^)((?:(?:[ ]{4}|\t).*\n+)+)(\n*[ ]{0,3}[^ \t\n]|(?=~0))/g
+ , codeSpan: /(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm
+ , fenced: /\s*```(\w*)\s*$([\s\S]*)$\s*```\s*$/gm
+ , strong: /(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g
+ , em: /(\*|_)(?=\S)([^\r]*?\S)\1/g
+ , blockQuote: /((^[ \t]*>[ \t]?.+\n(.+\n)*\n*)+)/gm
+ , autoLink: /<((https?|ftp|dict):[^'">\s]+)>/gi
+ , autoEmail: /<(?:mailto:)?([-.\w]+\@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi
+ , pre: /(\s*[^\r]+?<\/pre>)/gm
+ }
+
+ // isaacs - Allow passing in the GitHub object as an argument.
+ this.makeHtml = function (text, gh) {
+ if (typeof gh !== "undefined") {
+ if (typeof gh === "string") gh = {nameWithOwner:gh}
+ GitHub = gh
+ }
+
+ // Main function. The order in which other subs are called here is
+ // essential. Link and image substitutions need to happen before
+ // _EscapeSpecialCharsWithinTagAttributes(), so that any *'s or _'s in the
+ // and tags get encoded.
+
+ // Clear the global hashes. If we don't clear these, you get conflicts
+ // from other articles when generating a page which contains more than
+ // one article (e.g. an index page that shows the N most recent
+ // articles):
+ g_urls = new Array()
+ g_titles = new Array()
+ g_html_blocks = new Array()
+
+ // attacklab: Replace ~ with ~T
+ // This lets us use tilde as an escape char to avoid md5 hashes
+ // The choice of character is arbitray; anything that isn't
+ // magic in Markdown will work.
+ text = text.replace(/~/g,"~T")
+
+ // attacklab: Replace $ with ~D
+ // RegExp interprets $ as a special character
+ // when it's in a replacement string
+ text = text.replace(/\$/g,"~D")
+
+ // Standardize line endings
+ text = text.replace(/\r\n/g,"\n") // DOS to Unix
+ text = text.replace(/\r/g,"\n") // Mac to Unix
+
+ // Make sure text begins and ends with a couple of newlines:
+ text = "\n\n" + text + "\n\n"
+
+ // Convert all tabs to spaces.
+ text = _Detab(text)
+
+ // Strip any lines consisting only of spaces and tabs.
+ // This makes subsequent regexen easier to write, because we can
+ // match consecutive blank lines with /\n+/ instead of something
+ // contorted like /[ \t]*\n+/ .
+ text = text.replace(/^[ \t]+$/mg,"")
+
+ // Turn block-level HTML blocks into hash entries
+ text = _HashHTMLBlocks(text)
+
+ // Strip link definitions, store in hashes.
+ text = _StripLinkDefinitions(text)
+
+ text = _RunBlockGamut(text)
+
+ text = _UnescapeSpecialChars(text)
+
+ // attacklab: Restore dollar signs
+ text = text.replace(/~D/g,"$$")
+
+ // attacklab: Restore tildes
+ text = text.replace(/~T/g,"~")
+
+ // ** GFM ** Auto-link URLs and emails
+ text = text.replace(re.url, function (wholeMatch,matchIndex) {
+ var left = text.slice(0, matchIndex)
+ , right = text.slice(matchIndex)
+ if (left.match(/<[^>]+$/) && right.match(/^[^>]*>/)) {
+ return wholeMatch
+ }
+ var href = wholeMatch.replace( /^http:\/\/github.com\//
+ , "https://github.com/"
+ )
+ return " " + wholeMatch + " "
+ })
+
+ text = text.replace(re.email, function (wholeMatch) {
+ return "" + wholeMatch + " "
+ })
+
+ // ** GFM ** Auto-link sha1 if GitHub.nameWithOwner is defined
+ text = text.replace(re.sha1, function (wholeMatch,matchIndex) {
+ if ( typeof(GitHub) == "undefined"
+ || typeof(GitHub.nameWithOwner) == "undefined" ) {
+ return wholeMatch
+ }
+ var left = text.slice(0, matchIndex)
+ , right = text.slice(matchIndex)
+ if ( left.match(/@$/)
+ || ( left.match(/<[^>]+$/) && right.match(/^[^>]*>/) ) ) {
+ return wholeMatch
+ }
+ return ""
+ + wholeMatch.substring(0,7) + " "
+ })
+
+ // ** GFM ** Auto-link user@sha1 if GitHub.nameWithOwner is defined
+ text = text.replace(re.userSha1, function (wholeMatch,username,sha,matchIndex) {
+ if ( typeof(GitHub) == "undefined"
+ || typeof(GitHub.nameWithOwner) == "undefined" ) {
+ return wholeMatch
+ }
+ GitHub.repoName = GitHub.repoName || _GetRepoName()
+ var left = text.slice(0, matchIndex)
+ , right = text.slice(matchIndex)
+ if ( left.match(/\/$/)
+ || ( left.match(/<[^>]+$/) && right.match(/^[^>]*>/) ) ) {
+ return wholeMatch
+ }
+ return "" + username
+ + "@" + sha.substring(0,7) + " "
+ })
+
+ // ** GFM ** Auto-link user/repo@sha1
+ text = text.replace(re.repoSha1, function (wholeMatch,repo,sha) {
+ return "" + repo + "@" + sha.substring(0,7) + " "
+ })
+
+ // ** GFM ** Auto-link #issue if GitHub.nameWithOwner is defined
+ text = text.replace(re.issue, function (wholeMatch,issue,matchIndex) {
+ if ( typeof(GitHub) == "undefined"
+ || typeof(GitHub.nameWithOwner) == "undefined") {
+ return wholeMatch
+ }
+ var left = text.slice(0, matchIndex)
+ , right = text.slice(matchIndex)
+ if ( left == "" || left.match(/[a-z0-9_\-+=.]$/)
+ || ( left.match(/<[^>]+$/)
+ && right.match(/^[^>]*>/) )) {
+ return wholeMatch
+ }
+ return "" + wholeMatch + " "
+ })
+
+ // ** GFM ** Auto-link user#issue if GitHub.nameWithOwner is defined
+ text = text.replace(re.userIssue, function (wholeMatch,username,issue,matchIndex) {
+ if ( typeof(GitHub) == "undefined"
+ || typeof(GitHub.nameWithOwner) == "undefined" ) {
+ return wholeMatch
+ }
+ GitHub.repoName = GitHub.repoName || _GetRepoName()
+ var left = text.slice(0, matchIndex)
+ , right = text.slice(matchIndex)
+ if ( left.match(/\/$/)
+ || ( left.match(/<[^>]+$/) && right.match(/^[^>]*>/) ) ) {
+ return wholeMatch
+ }
+ return "" + wholeMatch + " "
+ })
+
+ // ** GFM ** Auto-link user/repo#issue
+ text = text.replace(re.repoIssue, function (wholeMatch,repo,issue) {
+ return "" + wholeMatch + " "
+ })
+
+ return text
+ }
+
+ function _GetRepoName () {
+ return GitHub.nameWithOwner.match(/^.+\/(.+)$/)[1]
+ }
+
+ function _StripLinkDefinitions (text) {
+ // Strips link definitions from text, stores the URLs and titles in
+ // hash references.
+ // Link defs are in the form: ^[id]: url "optional title"
+ var rv = text.replace(re.linkDef, function (wholeMatch,m1,m2,m3,m4) {
+ m1 = m1.toLowerCase()
+ // Link IDs are case-insensitive
+ g_urls[m1] = _EncodeAmpsAndAngles(m2)
+ if (m3) {
+ // found blank lines, so it's not a title.
+ // Put back the parenthetical statement
+ return m3 + m4
+ }
+ else if (m4) {
+ g_titles[m1] = m4.replace(/"/g,""")
+ }
+ // Completely remove the definition from the text
+ return ""
+ })
+ return rv
+ }
+
+
+ function _HashHTMLBlocks (text) {
+ // attacklab: Double up blank lines to reduce lookaround
+ text = text.replace(/\n/g,"\n\n")
+
+ // Hashify HTML blocks:
+ // We only want to do this for block-level HTML tags, such as headers,
+ // lists, and tables. That's because we still want to wrap s around
+ // "paragraphs" that are wrapped in non-block-level tags, such as anchors,
+ // phrase emphasis, and spans. The list of tags we're looking for is
+ // hard-coded:
+ var block_tags_a = "p|div|h[1-6]|blockquote|pre|table|dl|ol|"
+ + "ul|script|noscript|form|fieldset|iframe|math|ins|del"
+ var block_tags_b = "p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|"
+ + "noscript|form|fieldset|iframe|math"
+
+ // First, look for nested blocks, e.g.:
+ //
+ //
+ // tags for inner block must be indented.
+ //
+ //
+ //
+ // The outermost tags must start at the left margin for this to match, and
+ // the inner nested divs must be indented.
+ // We need to do this before the next, more liberal match, because the next
+ // match will start at the first `` and stop at the first `
`.
+
+ function hashElement (wholeMatch,m1) {
+ var blockText = m1
+ // Undo double lines
+ blockText = blockText.replace(/\n\n/g,"\n")
+ blockText = blockText.replace(/^\n/,"")
+ // strip trailing blank lines
+ blockText = blockText.replace(/\n+$/g,"")
+ // Replace the element text with a marker "~KxK" where x is its key
+ blockText = "\n\n~K" + (g_html_blocks.push(blockText)-1) + "K\n\n"
+ return blockText
+ }
+
+ // attacklab: This regex can be expensive when it fails.
+ text = text.replace(re.nested, hashElement)
+
+ // Now match more liberally, simply from `\n` to ` \n`
+ text = text.replace(re.liberal, hashElement)
+
+ // Special case just for . It was easier to make a special case than
+ // to make the other regex more complicated.
+ text = text.replace(re.hr, hashElement)
+
+ // Special case for standalone HTML comments:
+ text = text.replace(re.comment, hashElement)
+
+ // PHP and ASP-style processor instructions (...?> and <%...%>)
+ text = text.replace(re.processor, hashElement)
+
+ // attacklab: Undo double lines (see comment at top of this function)
+ text = text.replace(/\n\n/g,"\n")
+ return text
+ }
+
+ function _RunBlockGamut (text) {
+ // These are all the transformations that form block-level
+ // tags like paragraphs, headers, and list items.
+ text = _DoHeaders(text)
+
+ // Do Horizontal Rules:
+ var key = hashBlock(" ")
+ text = text.replace(/^[ ]{0,2}([ ]?\*[ ]?){3,}[ \t]*$/gm,key)
+ text = text.replace(/^[ ]{0,2}([ ]?\-[ ]?){3,}[ \t]*$/gm,key)
+ text = text.replace(/^[ ]{0,2}([ ]?\_[ ]?){3,}[ \t]*$/gm,key)
+
+ text = _DoLists(text)
+ text = _DoCodeBlocks(text)
+ text = _DoBlockQuotes(text)
+
+ // We already ran _HashHTMLBlocks() before, in Markdown(), but that
+ // was to escape raw HTML in the original Markdown source. This time,
+ // we're escaping the markup we've just created, so that we don't wrap
+ // tags around block-level tags.
+ text = _HashHTMLBlocks(text)
+ text = _FormParagraphs(text)
+
+ return text
+ }
+
+ function _RunSpanGamut (text) {
+ // These are all the transformations that occur *within* block-level
+ // tags like paragraphs, headers, and list items.
+
+ text = _DoCodeSpans(text)
+ text = _EscapeSpecialCharsWithinTagAttributes(text)
+ text = _EncodeBackslashEscapes(text)
+
+ // Process anchor and image tags. Images must come first,
+ // because ![foo][f] looks like an anchor.
+ text = _DoImages(text)
+ text = _DoAnchors(text)
+
+ // Make links out of things like ` `
+ // Must come after _DoAnchors(), because you can use < and >
+ // delimiters in inline links like [this]().
+ text = _DoAutoLinks(text)
+ text = _EncodeAmpsAndAngles(text)
+ text = _DoItalicsAndBold(text)
+
+ // Do hard breaks:
+ text = text.replace(/ +\n/g," \n")
+
+ return text
+ }
+
+ function _EscapeSpecialCharsWithinTagAttributes (text) {
+ // Within tags -- meaning between < and > -- encode [\ ` * _] so they
+ // don't conflict with their use in Markdown for code, italics and strong.
+ text = text.replace(re.html, function (wholeMatch) {
+ var tag = wholeMatch.replace(/(.)<\/?code>(?=.)/g, "$1`")
+ tag = escapeCharacters(tag,"\\`*_")
+ return tag
+ })
+ return text
+ }
+
+ function _DoAnchors (text) {
+ // Turn Markdown link shortcuts into XHTML tags.
+
+ function writeAnchorTag (wholeMatch,m1,m2,m3,m4,m5,m6,m7) {
+ if (m7 == undefined) m7 = ""
+ var whole_match = m1
+ , link_text = m2
+ , link_id = m3.toLowerCase()
+ , url = m4
+ , title = m7
+
+ if (url == "") {
+ if (link_id == "") {
+ // lower-case and turn embedded newlines into spaces
+ link_id = link_text.toLowerCase().replace(/ ?\n/g," ")
+ }
+ url = "#"+link_id
+
+ if (g_urls[link_id] != undefined) {
+ url = g_urls[link_id]
+ if (g_titles[link_id] != undefined) {
+ title = g_titles[link_id]
+ }
+ }
+ else {
+ if (whole_match.search(/\(\s*\)$/m)>-1) {
+ // Special case for explicit empty url
+ url = ""
+ }
+ else {
+ return whole_match
+ }
+ }
+ }
+
+ url = escapeCharacters(url,"*_")
+ var result = " " + link_text + " "
+ return result
+ }
+
+ // First, handle reference-style links: [link text] [id]
+ text = text.replace(re.referenceLink, writeAnchorTag)
+
+ // Next, inline-style links: [link text](url "optional title")
+ text = text.replace(re.inlineLink, writeAnchorTag)
+
+ // Last, handle reference-style shortcuts: [link text]
+ // These must come last in case you've also got [link test][1]
+ // or [link test](/foo)
+ text = text.replace(re.shortcutLink, writeAnchorTag)
+
+ return text
+ }
+
+ function _DoImages (text) {
+ // Turn Markdown image shortcuts into tags.
+
+ function writeImageTag (wholeMatch,m1,m2,m3,m4,m5,m6,m7) {
+ var whole_match = m1
+ var alt_text = m2
+ var link_id = m3.toLowerCase()
+ var url = m4
+ var title = m7
+
+ if (!title) title = ""
+
+ if (url == "") {
+ if (link_id == "") {
+ // lower-case and turn embedded newlines into spaces
+ link_id = alt_text.toLowerCase().replace(/ ?\n/g," ")
+ }
+ url = "#"+link_id
+
+ if (g_urls[link_id] != undefined) {
+ url = g_urls[link_id]
+ if (g_titles[link_id] != undefined) {
+ title = g_titles[link_id]
+ }
+ }
+ else {
+ return whole_match
+ }
+ }
+
+ alt_text = alt_text.replace(/"/g,""")
+ url = escapeCharacters(url,"*_")
+ var result = " "
+
+ return result
+ }
+
+ // First, handle reference-style labeled images: ![alt text][id]
+ text = text.replace(re.referenceImage, writeImageTag)
+
+ // Next, handle inline images: 
+ // Don't forget: encode * and _
+ text = text.replace(re.inlineImage, writeImageTag)
+
+ return text
+ }
+
+ function _DoHeaders (text) {
+ // Setext-style headers:
+ // Header 1
+ // ========
+ //
+ // Header 2
+ // --------
+ //
+ text = text.replace(re.setextH1, function (wholeMatch,m1) {
+ return hashBlock("" + _RunSpanGamut(m1) + " ")
+ })
+ text = text.replace(re.setextH2, function (matchFound,m1) {
+ return hashBlock("" + _RunSpanGamut(m1) + " ")
+ })
+
+ // atx-style headers:
+ // # Header 1
+ // ## Header 2
+ // ## Header 2 with closing hashes ##
+ // ...
+ // ###### Header 6
+ //
+
+ text = text.replace(re.atxHeader, function (wholeMatch,m1,m2) {
+ var h_level = m1.length
+ return hashBlock( "" + _RunSpanGamut(m2) + " "
+ )
+ })
+
+ return text
+ }
+
+ function _DoLists (text) {
+ // Form HTML ordered (numbered) and unordered (bulleted) lists.
+ // attacklab: add sentinel to hack around khtml/safari bug:
+ // http://bugs.webkit.org/show_bug.cgi?id=11231
+ text += "~0"
+ if (g_list_level) {
+ text = text.replace(re.list, function (wholeMatch,m1,m2) {
+ var list = m1
+ var list_type = (m2.search(/[*+-]/g)>-1) ? "ul" : "ol"
+
+ // Turn double returns into triple returns,
+ // so that we can make a
+ // paragraph for the last item in a list,
+ // if necessary:
+ list = list.replace(/\n{2,}/g,"\n\n\n")
+ var result = _ProcessListItems(list)
+
+ // Trim any trailing whitespace, to put the closing $list_type>
+ // up on the preceding line, to get it past the current stupid
+ // HTML block parser. This is a hack to work around the terrible
+ // hack that is the HTML block parser.
+ result = result.replace(/\s+$/,"")
+ result = "<"+list_type+">" + result + ""+list_type+">\n"
+ return result
+ })
+ }
+ else {
+ text = text.replace(re.list2, function (wholeMatch,m1,m2,m3) {
+ var runup = m1
+ var list = m2
+
+ var list_type = (m3.search(/[*+-]/g)>-1) ? "ul" : "ol"
+ // Turn double returns into triple returns, so that we can make a
+ // paragraph for the last item in a list, if necessary:
+ list = list.replace(/\n{2,}/g,"\n\n\n")
+ var result = _ProcessListItems(list)
+ result = runup + "<"+list_type+">\n"
+ + result + ""+list_type+">\n"
+ return result
+ })
+ }
+ // attacklab: strip sentinel
+ text = text.replace(/~0/,"")
+ return text
+ }
+
+ function _ProcessListItems (list_str) {
+ // Process the contents of a single ordered or unordered list, splitting it
+ // into individual list items.
+ //
+ // The $g_list_level global keeps track of when we're inside a list.
+ // Each time we enter a list, we increment it; when we leave a list,
+ // we decrement. If it's zero, we're not in a list anymore.
+ //
+ // We do this because when we're not inside a list, we want to treat
+ // something like this:
+ //
+ // I recommend upgrading to version
+ // 8. Oops, now this line is treated
+ // as a sub-list.
+ //
+ // As a single paragraph, despite the fact that the second line starts
+ // with a digit-period-space sequence.
+ //
+ // Whereas when we're inside a list (or sub-list), that line will be
+ // treated as the start of a sub-list. What a kludge, huh? This is
+ // an aspect of Markdown's syntax that's hard to parse perfectly
+ // without resorting to mind-reading. Perhaps the solution is to
+ // change the syntax rules such that sub-lists must start with a
+ // starting cardinal number; e.g. "1." or "a.".
+
+ g_list_level++
+ // trim trailing blank lines:
+ list_str = list_str.replace(/\n{2,}$/,"\n")
+ // attacklab: add sentinel to emulate \z
+ list_str += "~0"
+ list_str = list_str.replace(re.listStr, function (wholeMatch,m1,m2,m3,m4) {
+ var item = m4
+ var leading_line = m1
+ var leading_space = m2
+ if (leading_line || (item.search(/\n{2,}/)>-1)) {
+ item = _RunBlockGamut(_Outdent(item))
+ }
+ else {
+ // Recursion for sub-lists:
+ item = _DoLists(_Outdent(item))
+ item = item.replace(/\n$/,"") // chomp(item)
+ item = _RunSpanGamut(item)
+ }
+ return "" + item + " \n"
+ })
+ // attacklab: strip sentinel
+ list_str = list_str.replace(/~0/g,"")
+ g_list_level--
+ return list_str
+ }
+
+ function _DoCodeBlocks (text) {
+ // Process Markdown `` blocks.
+ // attacklab: sentinel workarounds for lack of \A and \Z, safari\khtml bug
+ text += "~0"
+ text = text.replace(re.codeBlock, function (wholeMatch,m1,m2) {
+ var codeblock = m1
+ var nextChar = m2
+ codeblock = _EncodeCode( _Outdent(codeblock))
+ codeblock = _Detab(codeblock)
+ codeblock = codeblock.replace(/^\n+/g,"") // trim leading newlines
+ codeblock = codeblock.replace(/\n+$/g,"") // trim trailing newlines
+ codeblock = "" + codeblock + "\n "
+ return hashBlock(codeblock) + nextChar
+ })
+ // attacklab: strip sentinel
+ text = text.replace(/~0/,"")
+ return text
+ }
+
+ function hashBlock (text) {
+ text = text.replace(/(^\n+|\n+$)/g,"")
+ return "\n\n~K" + (g_html_blocks.push(text)-1) + "K\n\n"
+ }
+
+ function _DoCodeSpans (text) {
+ // * Backtick quotes are used for spans.
+ // * You can use multiple backticks as the delimiters if you want to
+ // include literal backticks in the code span. So, this input:
+ //
+ // Just type ``foo `bar` baz`` at the prompt.
+ // Will translate to:
+ // Just type foo `bar` baz at the prompt.
+ //
+ // There's no arbitrary limit to the number of backticks you
+ // can use as delimters. If you need three consecutive backticks
+ // in your code, use four for delimiters, etc.
+ //
+ // * You can use spaces to get literal backticks at the edges:
+ //
+ // ... type `` `bar` `` ...
+ //
+ // Turns to:
+ //
+ // ... type `bar` ...
+ text = text.replace(re.codeSpan, function (wholeMatch,m1,m2,m3,m4) {
+ var c = '\0\0\0\0' + m3 + '\0\0\0\0'
+ c = c.replace(/\0\0\0\0([ \t]*)/,"") // leading whitespace
+ c = c.replace(/[ \t]*\0\0\0\0/,"") // trailing whitespace
+ c = _EncodeCode(c)
+ return m1 + "" + c + ""
+ })
+ return text
+ }
+
+ function _DoBacktickCodeBlocks (text) {
+ // * Backtick quotes are used for blocks.
+ // There's no arbitrary limit to the number of backticks you
+ // can use as delimters. If you need three consecutive backticks
+ // in your code, use four for delimiters, etc.
+ //
+ text = text.replace(re.fenced, function (wholeMatch,m1,m2) {
+ var c = '\0\0\0\0' + m2 + '\0\0\0\0'
+ c = c.replace(/\0\0\0\0([ \t\n]*)/,"") // leading whitespace
+ c = c.replace(/[ \t]*\0\0\0\0/,"") // trailing whitespace
+ c = _EncodeCode(c, m1)
+ return "" + c + " "
+ })
+ return text
+ }
+
+ function _EncodeCode (text, syntax) {
+ // Encode/escape certain characters inside Markdown code runs.
+ // The point is that in code, these characters are literals,ee
+ // and lose their special Markdown meanings.
+ // 'syntax' reserved for future syntax highlighting
+ // Encode all ampersands; HTML entities are not
+ // entities within a Markdown code span.
+ text = text.replace(/&/g,"&")
+
+ // Do the angle bracket song and dance:
+ text = text.replace(//g,">")
+
+ // Now, escape characters that are magic in Markdown:
+ text = escapeCharacters(text,"\*_{}[]\\",false)
+
+ // jj the line above breaks this:
+ //---
+
+ //* Item
+ // 1. Subitem
+ // special char: *
+ //---
+
+ return text
+ }
+
+ function _DoItalicsAndBold (text) {
+ // must go first:
+ text = text.replace(re.strong, "$2 ")
+ text = text.replace(/(\w)_(\w)/g, "$1~E95E$2") // "~E95E" == escaped "_"
+ text = text.replace(re.em, "$2 ")
+ return text
+ }
+
+ function _DoBlockQuotes (text) {
+ text = text.replace(re.blockQuote, function (wholeMatch,m1) {
+ var bq = m1
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ // "----------bug".replace(/^-/g,"") == "bug"
+ bq = bq.replace(/^[ \t]*>[ \t]?/gm,"~0") // trim one level of quote
+ // attacklab: clean up hack
+ bq = bq.replace(/~0/g,"")
+ bq = bq.replace(/^[ \t]+$/gm,"") // trim whitespace-only lines
+ bq = _RunBlockGamut(bq) // recurse
+ bq = bq.replace(/(^|\n)/g,"$1 ")
+ // These leading spaces screw with content, so we need to fix
+ bq = bq.replace(re.pre, function (wholeMatch,m1) {
+ var pre = m1
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ pre = pre.replace(/^ /mg,"~0")
+ pre = pre.replace(/~0/g,"")
+ return pre
+ })
+ return hashBlock("\n" + bq + "\n ")
+ })
+ return text
+ }
+
+ function _FormParagraphs (text) {
+ // Params:
+ // $text - string to process with html tags
+ // Strip leading and trailing lines:
+ text = text.replace(/^\n+/g,"")
+ text = text.replace(/\n+$/g,"")
+ // Do code block stuff early
+ text = _DoBacktickCodeBlocks(text)
+ var grafs = text.split(/\n{2,}/g)
+ var grafsOut = new Array()
+ // Wrap
tags.
+ var end = grafs.length
+ for (var i = 0; i < end; i++) {
+ var str = grafs[i]
+ // if this is an HTML marker, copy it
+ if (str.search(/~K(\d+)K/g) >= 0) {
+ grafsOut.push(str)
+ }
+ else if (str.search(/\S/) >= 0) {
+ str = _RunSpanGamut(str)
+ str = str.replace(/\n/g," ") // ** GFM **
+ str = str.replace(/^([ \t]*)/g,"
")
+ str += "
"
+ grafsOut.push(str)
+ }
+ }
+ // Unhashify HTML blocks
+ end = grafsOut.length
+ for (var j = 0; j < end; j++) {
+ // if this is a marker for an html block...
+ while (grafsOut[j].search(/~K(\d+)K/) >= 0) {
+ var blockText = g_html_blocks[RegExp.$1]
+ blockText = blockText.replace(/\$/g,"$$$$") // Escape any dollar signs
+ grafsOut[j] = grafsOut[j].replace(/~K\d+K/,blockText)
+ }
+ }
+ return grafsOut.join("\n\n")
+ }
+
+ function _EncodeAmpsAndAngles (text) {
+ // Smart processing for ampersands and angle brackets to be encoded.
+ // Ampersand-encoding based entirely on Nat Irons's Amputator MT plugin:
+ // http://bumppo.net/projects/amputator/
+ text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g,"&")
+ // Encode naked <'s
+ text = text.replace(/<(?![a-z\/?\$!])/gi,"<")
+ return text
+ }
+
+ function _EncodeBackslashEscapes (text) {
+ // Parameter: String.
+ // Returns: The string, with after processing the following backslash
+ // escape sequences.
+ // attacklab: The polite way to do this is with the new
+ // escapeCharacters() function:
+ //
+ // text = escapeCharacters(text,"\\",true)
+ // text = escapeCharacters(text,"`*_{}[]()>#+-.!",true)
+ //
+ // ...but we're sidestepping its use of the (slow) RegExp constructor
+ // as an optimization for Firefox. This function gets called a LOT.
+ text = text.replace(/\\(\\)/g,escapeCharacters_callback)
+ text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g,escapeCharacters_callback)
+ return text
+ }
+
+ function _DoAutoLinks (text) {
+ text = text.replace(re.autoLink,"$1 ")
+ // Email addresses:
+ text = text.replace(re.autoEmail, function (wholeMatch,m1) {
+ return _EncodeEmailAddress(_UnescapeSpecialChars(m1))
+ })
+ return text
+ }
+
+ function _EncodeEmailAddress (addr) {
+ // Input: an email address, e.g. "foo@example.com"
+ // Output: the email address as a mailto link, with each character
+ // of the address encoded as either a decimal or hex entity, in
+ // the hopes of foiling most address harvesting spam bots. E.g.:
+ // fo
+ // @example.co
+ // Based on a filter by Matthew Wickline, posted to the BBEdit-Talk
+ // mailing list:
+
+ // attacklab: why can't javascript speak hex?
+ function char2hex (ch) {
+ var hexDigits = '0123456789ABCDEF'
+ var dec = ch.charCodeAt(0)
+ return (hexDigits.charAt(dec>>4) + hexDigits.charAt(dec&15))
+ }
+
+ var encode = [ function (ch) { return ""+ch.charCodeAt(0)+";" }
+ , function (ch) { return ""+char2hex(ch)+";" }
+ , function (ch) { return ch }
+ ]
+
+ addr = "mailto:" + addr
+ addr = addr.replace(/./g, function (ch) {
+ if (ch == "@") {
+ // this *must* be encoded. I insist.
+ ch = encode[Math.floor(Math.random()*2)](ch)
+ }
+ else if (ch !=":") {
+ // leave ':' alone (to spot mailto: later)
+ var r = Math.random()
+ // roughly 10% raw, 45% hex, 45% dec
+ ch = (
+ r > .9 ? encode[2](ch) :
+ r > .45 ? encode[1](ch) :
+ encode[0](ch)
+ )
+ }
+ return ch
+ })
+ addr = "" + addr + " "
+ addr = addr.replace(/">.+:/g,"\">") // strip mailto: from visible part
+
+ return addr
+ }
+
+ function _UnescapeSpecialChars (text) {
+ // Swap back in all the special characters we've hidden.
+ text = text.replace(/~E(\d+)E/g, function (wholeMatch,m1) {
+ var charCodeToReplace = parseInt(m1)
+ return String.fromCharCode(charCodeToReplace)
+ })
+ return text
+ }
+
+ function _Outdent (text) {
+ // Remove one level of line-leading tabs or spaces
+
+ // attacklab: hack around Konqueror 3.5.4 bug:
+ // "----------bug".replace(/^-/g,"") == "bug"
+ text = text.replace(/^(\t|[ ]{1,4})/gm,"~0") // attacklab: g_tab_width
+
+ // attacklab: clean up hack
+ text = text.replace(/~0/g,"")
+ return text
+ }
+
+ function _Detab (text) {
+ // attacklab: Detab's completely rewritten for speed.
+ // In perl we could fix it by anchoring the regexp with \G.
+ // In javascript we're less fortunate.
+
+ // expand first n-1 tabs
+ text = text.replace(/\t(?=\t)/g," ") // attacklab: g_tab_width
+ // replace the nth with two sentinels
+ text = text.replace(/\t/g,"~A~B")
+ // use the sentinel to anchor our regex so it doesn't explode
+ text = text.replace(/~B(.+?)~A/g, function(wholeMatch,m1,m2) {
+ var leadingText = m1
+ var numSpaces = 4 - leadingText.length % 4 // attacklab:g_tab_width
+ // there *must* be a better way to do this:
+ for (var i=0; i ul {
+ background: #fafafb;
+ border: solid #CACACA;
+ border-width: 1px 1px 0px 1px;
+ margin: 0px;
+}
+
+div.sidebar-module > p {
+ background: #fafafb;
+ border: solid #CACACA;
+ border-width: 1px;
+ padding: 8px 10px;
+ margin: 0px;
+ display: block;
+ line-height: 1.4em;
+}
+
+div.sidebar-module li {
+ list-style-type: none;
+}
+
+div.sidebar-module > ul > li {
+ border-bottom: 1px solid #CACACA;
+ text-decoration: none;
+}
+
+div.sidebar-module > ul > li:hover {
+ text-decoration: none;
+}
+
+
+div.sidebar-module > ul h3 {
+ margin: 0px;
+ color: #666;
+ text-shadow: 1px 1px 0px #fff;
+ border-bottom: 1px solid #CACACA;
+ font-size: 14px;
+ background-color: #e1e1e1;
+ background-image: -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -ms-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -o-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
+ background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: linear-gradient(top, #f1f1f1, #e1e1e1);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f1f1f1', EndColorStr='#e1e1e1');
+}
+
+div.sidebar-module > ul li h3:hover,
+div.sidebar-module > ul h3.disable {
+ background-color: #e1e1e1;
+ background-image: -moz-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: -ms-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: -o-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#d1d1d1));
+ background-image: -webkit-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: linear-gradient(top, #e1e1e1, #d1d1d1);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#e1e1e1', EndColorStr='#d1d1d1');
+}
+
+
+div.sidebar-module > ul h3 a,
+div.sidebar-module > ul h3.disable span {
+ padding: 8px 0px 8px 10px;
+ color: #666;
+ display: block;
+ text-decoration: none;
+}
+
+div.sidebar-module > ul h3.disable span {
+ padding-left: 20px;
+ background-image: url(../images/active-arrow.png);
+ background-position: left center;
+ background-repeat: no-repeat;
+ cursor: default;
+}
+div.sidebar-module > ul h3:hover a {
+ text-decoration: none;
+}
+
+div.sidebar-module ul ul,
+div.sidebar-module .spacer {
+ display: block;
+ padding-bottom: 2px;
+ background-color: #FAFAFB;
+}
+
+div.sidebar-module ul ul li {
+ border-top: 1px solid #fff;
+ border-bottom: 1px solid #e9ecee;
+ font-weight: bold;
+ color: #666;
+}
+
+div.sidebar-module ul ul li:hover,
+div.sidebar-module li.disable {
+ border-top: 1px solid #fafafb;
+ border-bottom: 1px solid #e5e8ea;
+ background-color: #f0f0f3;
+}
+
+div.sidebar-module li.disable {
+ background-image: url(../images/active-arrow.png);
+ background-position: left center;
+ background-repeat: no-repeat;
+}
+
+div.sidebar-module ul ul li a,
+div.sidebar-module ul ul li span {
+ padding: 6px 0px 6px 10px;
+ display: block;
+ text-decoration: none;
+}
+
+div.sidebar-module ul ul li span {
+ padding-left: 20px;
+ cursor: default;
+}
+
+/* @end */
+
+/*****************************************************************************/
+/*
+/* Footer
+/*
+/*****************************************************************************/
+
+
+
+#footer {
+ position: relative;
+ bottom:0;
+ font-size:13px;
+ color: #636363;
+ margin: 45px 0 0 0;
+}
+
+#footer a:hover {
+ text-decoration: underline;
+}
+
+#footer li {
+ list-style: none;
+}
+
+.footer_inner {
+ width:960px;
+ position: relative;
+ margin: 0 auto;
+}
+
+#footer .upper_footer {
+ min-height: 160px;
+ overflow: hidden;
+ background: url(../images/bg_footer_top.png) #f8f8f8 repeat-x;
+}
+
+#footer #blacktocat {
+ height:130px;
+ width:164px;
+ float:left;
+ background: url(../images/blacktocat.png) top left no-repeat;
+ text-indent: -5000px;
+ margin: 15px 20px 0 0;
+}
+
+#footer #blacktocat_ie {
+ height:130px;
+ width:164px;
+ float:left;
+ background: url(../images/blacktocat.png) no-repeat;
+ text-indent: -5000px;
+ margin: 15px 20px 0 0;
+}
+
+#footer .upper_footer ul.footer_nav {
+ position: relative;
+ float: left;
+ width: 164px;
+ margin: 20px 10px;
+}
+
+#footer .upper_footer ul.footer_nav h4 {
+ margin: 0 0 5px 0;
+ padding-bottom: 5px;
+ border-bottom: thin solid #e1e1e1;
+}
+
+#footer .lower_footer {
+ position: relative;
+ background:url(../images/bg_footer_bottom.png) #fff repeat-x;
+ overflow: hidden;
+ clear:both;
+}
+
+#footer .lower_footer .home {
+ display: block;
+ position: absolute;
+ background: url(../images/footer-logo.png) top left no-repeat;
+ width: 100px;
+ height: 50px;
+ text-indent: -5000px;
+}
+
+#footer .lower_footer .home_ie {
+ display: block;
+ position: absolute;
+ background: url(../images/footer-logo.png) top left no-repeat;
+ width: 100px;
+ height: 50px;
+ text-indent: -5000px;
+}
+
+#footer .lower_footer #legal {
+ float: left;
+ width: 500px;
+ height: 50px;
+ line-height: 8px;
+ margin: 25px 0 0 17px;
+}
+
+#footer .lower_footer #legal #legal_links {
+ margin-left: 177px;
+}
+
+#footer .lower_footer div ul {
+ float: left;
+ text-indent: none;
+ display:inline;
+ margin-top: 15px;
+
+}
+
+#footer .lower_footer div ul li {
+ display:inline;
+ float: left;
+ margin: 0 10px 0 0;
+}
+
+#footer .lower_footer div p {
+ display:inline;
+ float:left;
+ clear: both;
+ margin: 10px 0 0 177px;
+}
+
+#footer .lower_footer .sponsor {
+ width: 295px;
+ float: right;
+ margin-top: 35px;
+ padding-bottom: 25px;
+}
+
+#footer .lower_footer .sponsor .logo {
+ float:left;
+ margin: 0 10px 0 0;
+}
+
+#footer .lower_footer .sponsor a {
+ color: #000;
+}
+
+/* end */
+
+/*------------------------------------------------------------------------------
+ Not Footer
+------------------------------------------------------------------------------*/
+#wrapper {
+ padding: 20px 25px;
+ overflow:hidden;
+ height: auto;
+ width: 920px;
+ margin: -20px auto 0;
+ background: url(../images/background-white.png) 0 0 no-repeat;
+}
+
+.content {
+ width: 560px;
+ position: relative;
+ float: left;
+ color: #393939;
+ z-index: 2;
+}
+
+.content dl {
+ margin-left: 10px;
+}
+
+.content dt {
+ color: #666;
+}
+
+.content ul,
+.content ol {
+ margin-left: 1.5em;
+}
+
+.content ul {
+ list-style-type: disc;
+}
+
+.content img {
+ max-width: 100%;
+ border: 1px solid #dddddd;
+ -webkit-box-shadow: 1px 1px 3px #ddd;
+ -moz-box-shadow: 1px 1px 3px #ddd;
+ box-shadow: 1px 1px 3px #ddd;
+}
+
+
+.content .description {
+ margin-left: 20px;
+}
+
+.content .verseblock-content {
+ padding: 3px;
+}
+
+.content .verseblock-content,
+.content .sectionbody .dlist dt,
+.content p > tt,
+.content dl code,
+.content ul code,
+p code {
+ font: 12px Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
+ color: #52595d;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ -moz-background-clip: padding;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 1px solid #ccc;
+ background-color: #f9f9f9;
+ padding: 0px 3px;
+ display: inline-block;
+}
+
+.content .sectionbody .dlist dt {
+ margin-top: 10px;
+}
+
+.content .verseblock-content {
+ padding: 3px;
+}
+
+.content .intro {
+ color: #868686;
+}
+/* @end */
+
+/*------------------------------------------------------------------------------
+ Pre/Code Styles
+------------------------------------------------------------------------------*/
+
+code {white-space: nowrap;}
+
+pre {
+ border: 1px solid #cacaca;
+ line-height: 1.2em;
+ font: 12px Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
+ padding: 10px;
+ overflow:auto;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ -moz-background-clip: padding;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ background-color: #FAFAFB;
+ color: #393939;
+ margin: 0px;
+}
+
+ul + pre {
+ margin-top: 1em;
+}
+
+pre code {white-space: pre;}
+
+pre span.comment {color: #aaa;}
+
+pre.headers {
+ margin-bottom: 0;
+ border-bottom-width: 0;
+ -webkit-border-radius: 3px 3px 0 0;
+ -moz-border-radius: 3px 3px 0 0;
+ border-radius: 3px 3px 0 0;
+ color: #666;
+ background-color: #f1f1f1;
+ background-image: -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -ms-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -o-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
+ background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: linear-gradient(top, #f1f1f1, #e1e1e1);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f1f1f1', EndColorStr='#e1e1e1');
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
+}
+
+pre.no-response {
+ -webkit-border-radius: 3px 3px;
+ -moz-border-radius: 3px 3px;
+ border-radius: 3px 3px;
+ border-bottom: 1px solid #CACACA;
+}
+
+pre.headers + pre.highlight {
+ -webkit-border-radius: 0 0 3px 3px;
+ -moz-border-radius: 0 0 3px 3px;
+ border-radius: 0 0 3px 3px;
+}
+
+pre.highlight {
+ -webkit-border-radius:3px;
+ -moz-border-radius:3px;
+ border-radius:3px;
+ background-color: #FAFAFB;
+}
+
+pre.terminal {
+ background-color: #444;
+ color: #fff;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ -moz-background-clip: padding;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ border: 2px solid #DEDEDE;
+ position: relative;
+ padding: 10px;
+ text-shadow: none;
+ background-image: none;
+ filter: none;
+}
+
+pre.terminal em {
+ color: #f9fe64;
+}
+
+span.codeline {
+ display: block;
+ position: relative;
+}
+
+span.codeline:hover {
+ background-color: #292929;
+ margin: 0px;
+ padding-left: 3px;
+ margin-left: -3px;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ color: #666666;
+}
+
+span.codeline span {
+ display: inline-block;
+ font-size: 10px;
+ color: #fff;
+ padding: 0 0.3em 0.05em;
+ position: absolute;
+ right: 0px;
+ top: 0px;
+ text-indent: -9999px;
+ background-image: url(../images/qmark.png);
+ background-repeat: no-repeat;
+ background-position: 1px 3px;
+ max-width: 8px;
+ min-width: 8px;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ user-select: none;
+ cursor: default;
+}
+
+span.codeline span:hover {
+ display: inline-block;
+ text-indent: 0px;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ background: #000;
+ border: 1px solid #292929;
+ max-width: 1000px;
+}
+
+span.codeline:hover em {
+ color: #666666;
+}
+
+pre.bootcamp {
+ white-space: normal;
+ margin-left: -10px;
+ background-image: none;
+}
+
+span.bash-output {
+ color: #63e463;
+ display: block;
+ position: relative;
+ -moz-user-select: none;
+ -khtml-user-select: none;
+ user-select: none;
+}
+
+/* end */
+
+/*------------------------------------------------------------------------------
+ More Info Expander
+------------------------------------------------------------------------------*/
+
+.more-info {
+ margin: 10px 0;
+ position: relative;
+}
+.more-info > h4 {
+ background-image: url('../images/dropdown_sprites.jpg');
+ background-repeat: no-repeat;
+ padding: .25em 0 .25em 25px;
+ cursor: pointer;
+ color: #4183C4;
+ font-weight: normal;
+}
+.more-info h4.compressed {
+ background-position: 0 0;
+}
+.more-info:hover h4.compressed {
+ background-position: 0 -23px;
+}
+.more-info h4.expanded {
+ background-position: 0 -46px;
+}
+.more-info:hover h4.expanded {
+ background-position: 0 -69px;
+}
+
+.more-info .more-content {
+ display: none;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+ background-color: #FFFFFF;
+ border: 3px solid #DDDDDD;
+ padding: 1em 2em;
+ -webkit-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
+ -moz-box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
+ box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
+ margin: 15px 0 30px;
+}
+
+.more-info .more-content h4 {
+ margin-top: 1em;
+}
+
+.more-info .more-content pre {
+ margin-left: 0px;
+}
+
+/****************************/
+/* List Module */
+/****************************/
+
+.list-module h2 {
+ border: solid #cacaca;
+ border-width: 1px;
+ border-radius: 3px 3px 0px 0px;
+ -moz-border-radius: 3px 3px 0px 0px;
+ -webkit-border-bottom-right-radius: 0px;
+ -webkit-border-bottom-left-radius: 0px;
+ -moz-background-clip: padding;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ padding: 6px 10px;
+ background-color: #f1f1f1;
+ background-image: -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -ms-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -o-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
+ background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: linear-gradient(top, #f1f1f1, #e1e1e1);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f1f1f1', EndColorStr='#e1e1e1');
+ color: #666;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
+ font-size: 16px;
+ line-height: 22px;
+ margin: 0px;
+}
+
+.list-module .list-body {
+ border: solid #cacaca;
+ border-width: 0px 1px 1px 1px;
+ border-radius: 0px 0px 3px 3px;
+ -moz-border-radius: 0px 0px 3px 3px;
+ -webkit-border-bottom-right-radius: 3px;
+ -webkit-border-bottom-left-radius: 3px;
+ -moz-background-clip: padding;
+ -webkit-background-clip: padding-box;
+ background-clip: padding-box;
+ background-color: #fafafb;
+ color: #666;
+ text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
+}
+
+.list-module .list-body .icon {
+ display: block;
+ height: 28px;
+ width: 28px;
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ background: transparent url(images/popular_guide_sprites.png) 0 0 no-repeat;
+}
+
+.list-module a {
+ border-top: 1px solid #fff;
+ border-bottom: 1px solid #e9ecee;
+ padding: 6px 10px;
+ position: relative;
+ display: block;
+}
+
+.list-module a:hover {
+ border-top: 1px solid #fafafb;
+ border-bottom: 1px solid #e5e8ea;
+ background-color: #f0f0f3;
+ text-decoration: none;
+}
+
+.list-module a h3 {
+ color: #4183C4;
+}
+
+.list-module a:hover h3 {
+ text-decoration: underline;
+}
+
+.list-module ul {
+ list-style-type: none;
+ margin: 0px;
+}
+
+.list-module h3 {
+ margin: 0px;
+ font-size: 13px;
+}
+
+.list-module .list-body a p {
+ color: #666;
+ margin: 0px;
+}
+
+/* @end */
+
+/****************************/
+/* Expandable List Module */
+/****************************/
+
+div.expandable > ul h3 {
+ display: table;
+ width: 100%;
+}
+
+div.expandable > ul h3 > a {
+ display: table-cell;
+ background-color: #e1e1e1;
+ background-image: -moz-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -ms-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -o-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#e1e1e1));
+ background-image: -webkit-linear-gradient(top, #f1f1f1, #e1e1e1);
+ background-image: linear-gradient(top, #f1f1f1, #e1e1e1);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f1f1f1', EndColorStr='#e1e1e1');
+}
+
+div.expandable > ul h3 > a:hover {
+ background-color: #e1e1e1;
+ background-image: -moz-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: -ms-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: -o-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: -webkit-gradient(linear, left top, left bottom, from(#e1e1e1), to(#d1d1d1));
+ background-image: -webkit-linear-gradient(top, #e1e1e1, #d1d1d1);
+ background-image: linear-gradient(top, #e1e1e1, #d1d1d1);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#e1e1e1', EndColorStr='#d1d1d1');
+}
+
+div.expandable > ul h3 > a.collapsed,
+div.expandable > ul h3 > a.expanded {
+ background-image: url(/shared/images/expand-arrows.png);
+ background-position: 0px -3px;
+ background-repeat: no-repeat;
+ width: 13px;
+ border-right: 1px solid #cacaca;
+ padding: 8px 11px;
+}
+
+div.expandable > ul h3 > a.expanded {
+ background-position: -38px -3px;
+}
+
+div.expandable > ul h3 > a.collapsed:hover {
+ background-image: url(/shared/images/expand-arrows.png);
+ background-position: 0px -43px;
+ background-repeat: no-repeat;
+ width: 13px;
+ border-right: 1px solid #cacaca;
+ padding: 8px 11px;
+}
+
+div.expandable > ul h3 > a.expanded:hover {
+ background-position: -38px -43px;
+}
+
+/* @end */
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/css/pygments.css b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/css/pygments.css
new file mode 100644
index 0000000..1e651cf
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/css/pygments.css
@@ -0,0 +1,60 @@
+.highlight { background: #ffffff; }
+.highlight .c { color: #999988; font-style: italic } /* Comment */
+.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
+.highlight .k { font-weight: bold } /* Keyword */
+.highlight .o { font-weight: bold } /* Operator */
+.highlight .cm { color: #999988; font-style: italic } /* Comment.Multiline */
+.highlight .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
+.highlight .c1 { color: #999988; font-style: italic } /* Comment.Single */
+.highlight .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
+.highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
+.highlight .gd .x { color: #000000; background-color: #ffaaaa } /* Generic.Deleted.Specific */
+.highlight .ge { font-style: italic } /* Generic.Emph */
+.highlight .gr { color: #aa0000 } /* Generic.Error */
+.highlight .gh { color: #999999 } /* Generic.Heading */
+.highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
+.highlight .gi .x { color: #000000; background-color: #aaffaa } /* Generic.Inserted.Specific */
+.highlight .go { color: #888888 } /* Generic.Output */
+.highlight .gp { color: #555555 } /* Generic.Prompt */
+.highlight .gs { font-weight: bold } /* Generic.Strong */
+.highlight .gu { color: #aaaaaa } /* Generic.Subheading */
+.highlight .gt { color: #aa0000 } /* Generic.Traceback */
+.highlight .kc { font-weight: bold } /* Keyword.Constant */
+.highlight .kd { font-weight: bold } /* Keyword.Declaration */
+.highlight .kp { font-weight: bold } /* Keyword.Pseudo */
+.highlight .kr { font-weight: bold } /* Keyword.Reserved */
+.highlight .kt { color: #445588; font-weight: bold } /* Keyword.Type */
+.highlight .m { color: #009999 } /* Literal.Number */
+.highlight .s { color: #d14 } /* Literal.String */
+.highlight .na { color: #008080 } /* Name.Attribute */
+.highlight .nb { color: #0086B3 } /* Name.Builtin */
+.highlight .nc { color: #445588; font-weight: bold } /* Name.Class */
+.highlight .no { color: #008080 } /* Name.Constant */
+.highlight .ni { color: #800080 } /* Name.Entity */
+.highlight .ne { color: #990000; font-weight: bold } /* Name.Exception */
+.highlight .nf { color: #990000; font-weight: bold } /* Name.Function */
+.highlight .nn { color: #555555 } /* Name.Namespace */
+.highlight .nt { color: #000080 } /* Name.Tag */
+.highlight .nv { color: #008080 } /* Name.Variable */
+.highlight .ow { font-weight: bold } /* Operator.Word */
+.highlight .w { color: #bbbbbb } /* Text.Whitespace */
+.highlight .mf { color: #009999 } /* Literal.Number.Float */
+.highlight .mh { color: #009999 } /* Literal.Number.Hex */
+.highlight .mi { color: #009999 } /* Literal.Number.Integer */
+.highlight .mo { color: #009999 } /* Literal.Number.Oct */
+.highlight .sb { color: #d14 } /* Literal.String.Backtick */
+.highlight .sc { color: #d14 } /* Literal.String.Char */
+.highlight .sd { color: #d14 } /* Literal.String.Doc */
+.highlight .s2 { color: #d14 } /* Literal.String.Double */
+.highlight .se { color: #d14 } /* Literal.String.Escape */
+.highlight .sh { color: #d14 } /* Literal.String.Heredoc */
+.highlight .si { color: #d14 } /* Literal.String.Interpol */
+.highlight .sx { color: #d14 } /* Literal.String.Other */
+.highlight .sr { color: #009926 } /* Literal.String.Regex */
+.highlight .s1 { color: #d14 } /* Literal.String.Single */
+.highlight .ss { color: #990073 } /* Literal.String.Symbol */
+.highlight .bp { color: #999999 } /* Name.Builtin.Pseudo */
+.highlight .vc { color: #008080 } /* Name.Variable.Class */
+.highlight .vg { color: #008080 } /* Name.Variable.Global */
+.highlight .vi { color: #008080 } /* Name.Variable.Instance */
+.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/active-arrow.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/active-arrow.png
new file mode 100644
index 0000000..5c1cc36
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/active-arrow.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/background-v2.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/background-v2.png
new file mode 100644
index 0000000..33292d8
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/background-v2.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/background-white.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/background-white.png
new file mode 100644
index 0000000..c981fb8
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/background-white.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg.png
new file mode 100644
index 0000000..d1fae0f
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg_footer_bottom.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg_footer_bottom.png
new file mode 100644
index 0000000..f63eecf
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg_footer_bottom.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg_footer_top.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg_footer_top.png
new file mode 100644
index 0000000..94a481a
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/bg_footer_top.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/blacktocat.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/blacktocat.png
new file mode 100644
index 0000000..66579e9
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/blacktocat.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/blacktocat.svg b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/blacktocat.svg
new file mode 100644
index 0000000..f903464
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/blacktocat.svg
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+ proof:pdf
+ xmp.did:F87F11740720681180838E4FEC0BBEE0
+ xmp.iid:F87F11740720681180838E4FEC0BBEE0
+ uuid:a82416aa-8f86-e849-8a8d-10757c227e64
+
+ xmp.iid:F77F11740720681180838E4FEC0BBEE0
+ xmp.did:F77F11740720681180838E4FEC0BBEE0
+ uuid:a82416aa-8f86-e849-8a8d-10757c227e64
+ proof:pdf
+
+
+
+
+ saved
+ xmp.iid:F77F11740720681180838E4FEC0BBEE0
+ 2011-07-15T18:59:45-07:00
+ Adobe Illustrator CS5
+ /
+
+
+ saved
+ xmp.iid:F87F11740720681180838E4FEC0BBEE0
+ 2011-07-15T19:12:41-07:00
+ Adobe Illustrator CS5
+ /
+
+
+
+
+
+ 2011-07-15T19:12:41-07:00
+ Adobe Illustrator CS5
+ 2011-07-15T19:12:41-07:00
+ 2011-07-15T19:12:41-07:00
+
+
+
+ 256
+ 256
+ JPEG
+ /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK
DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f
Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgBAAEAAwER
AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB
UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE
1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ
qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy
obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp
0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo
+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FXYq7FXYq7FXYq7
FXYq7FVOa4ghFZXCex6/diqDk1qHpDG0h8fsjFUM+p37/Z4Rj2FT+NcVUWmvHNWuH37KeP6sKqZi
B+0zN8zirvQj8MVd6EfhirhFT7LMvyOKqqzXiGq3D/7I8v14qqpqd+n2gkg+4/hTAqJj1mA7TI0R
8ftD8P6YqjYriGYVicOPY7/diq/FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYqh7m/t
rfZ2q/ZF3OKpdNqN5Nsv7lPbdvvxVDCNa8m+Jj1LbnCq7FXYq7FXYq7FXYq7FXYq7FXYqt9Na8lq
rDoy7HFUTDqN5Ds/75PfZvvwKmNtf29xsjUfujbNiqIxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2
KrZZY4kLyMFUdziqVXGpTzVWCsUf8/7R+XhiqFVFXp17k9cKt4q7FXYquVWY0UFj4Dc4qqrZXTCo
jIHvQfgcCqo0u47so+k/0xVeulNT4pAD7Cv8Rirm0pv2ZAfmKf1xVYdLuP5lP0n+mKqT2V0oqYyR
7UP6sVUWVlNGBBHUHY4VaxV2KuxVpkVt+hHQjriqKt9Tmhos9ZY/5x9ofPxwKmsUscqB42DKehGK
rsVdirsVdirsVdirsVdirsVdirsVQ93exWy7/FI32EHU4qlEsks7+pMakfZQfZXCrWKuxV2KoqGw
nk3I4L4t1+7AqMi063ShYF29+n3YqiVVVFFAUeA2GKt4q7FXYq7FXYq7FWmVWFGAYeBFcVQ0unW7
7rVG9un3HFUFNYTx7gc18V6/diqGwq7FXYq3FJLA/OE0P7SH7JxVOLS8iuVqvwuPtoeowKr4q7FX
Yq7FXYq7FXYq7FXYqhb69W3XivxTN9lP4n2xVKTyZzJI3KRvtMcKuxV2Kq9vayzn4RRe7npgVMre
zhh3A5P/ADHr9HhiqvirsVdirsVdirsVdirsVdirsVdirsVUJ7OGapI4v/MP4+OKpZcWssB+IVXs
46Yqo4VdirhyVxJGeMi9GGKpvY3y3ClWHGZftp/Ee2BUTirsVdirsVdirsVdiqheXa28XLrI20ae
JxVJiWZi7nlI27NhV2KuxVHWmnl6PNsvZe5+eBUyAAAAFAOgGKuxV2KuxV2KuxV2KuxV2KuxV2Ku
xV2KuxV2KuIBBBFQeoOKpbd6eUq8O6917j5YqgcKuxVwLqwkjPGRfstiqc2d2txFy6Ouzp4HAqvi
rsVdirsVdiq2WVIo2kc0VRU4qkcsrzSmV9idlX+VfDCq3FXYqmNjY0pLKN+qqe3ucCo/FUPdX1vb
ECUmrbgAVxVbHqli5oJQD/lAj8TtiqKDBgCpqD0IxV2KuxV2KuxV2KuxV2KuxV2KuxVp3RF5OwVR
1JNBiqEk1eyQ0DFz/kiv66YqvtNQguWZI+QZRWjADb7ziqJxVAX1jWssQ36so/WMVS7CrsVXRSvB
KJU6jZl/mHhiqeRSpLGsiGqsKg4FXYq7FXYq7FUp1G49Wb0lP7uI/F7v/ZiqFwq7FUdp9pzPrOPh
H2R4nxwKmWKuxVJLx/UvpW7JRF+jr+OFVIqp6iuKujMkLcoHMZ8OoPzBxVHW+rioS5Xge0i/Z+nw
wKmSsrAMpBB3BHTFWmZVFWIA8Ttiqi99Zp1mT6DX9WKqZ1WwH+7f+Fb+mKu/S2n/AO/f+Fb+mKtj
U7A9Jh9II/WMVVkubd9klRiewYE4qvZlVSzEBR1J2GKpdcatWqWq8vGVun0DFUA4eVuUzmRvfoPk
MKtgAdBTFV9q/p30Ljox4H6dhiqe4FdiqW6hacD60Y+E/aHgfHFUDhV2KorTrj0pvSY/u5T8Ps39
uBU2xV2KuxVQvbj0ICw+23wp8z/TFUmAoKYVdiqta25nlC/sjdz7YFToAAAAUA2AxV2KuxVj4bk8
j92dj95wq7FXYq4gEUOKuUzRgrFK0aHcqD+rFVhiVjVyXPiTXFWxHGP2Riq7ivgMVdQeGKtcEPVR
92KtGGM/s4q709uPJinXgTtXFV3TFXYq7FVsh48W7qwIxVkWBXYq4gEEEVB2IxVJbq3MEpX9k7of
bFVHCriKin44qnNlcevAGP21+F/mP64FV8VdiqUahN6tyVH2YvhHz/a/piqGwq7FU5s7f0YQD9tt
2/pgVXxV2KuxVj/Hi8ifyuw+44VdirsVdirsVdirsVdirsVdirsVdirsVdirsVWuvIog6uwA+k4q
yLArsVdiqheW/rQkD7a7r/TFUmwq7FUTp83p3IU/Zl+E/MfZ/pgVN8VWTyiKF5D+yKgeJ7DFUiFe
5qTuT7nCrsVRVhD6k4JHwp8R+fbAqbYq7FXYq7FUiumjN9N6ZqpIJPbl3wqsxV2KuxV2KuxV2Kux
V2KuxV2KuxV2KuxV2KrSzRyRzAcvTPLicVT63njniWSM1U9u4PgcCqmKuxV2KpTfw+nOSB8L/EPn
3xVC4Vca9jQjcH3GKp7BKJYUkH7QqR4HuMCoTVZKRpGP2zU/Jf7SMVS3CrsVTbTouFvyP2nNfo7Y
FRWKuxV2KoLVLtoYhHGf3suw9h3OKpWiBVoPpwq3irsVdirsVdirsVdirsVdirsVdirsVdirsVdi
qrYXH1a5Ck/uZTQ+AbscVTvArsVdiqF1GLnb8gPiQ1+jviqU4VdiqZaVJWN4z+waj5N/aDgVD6k/
K6I/kUD6Tv8AxxVC4VbVSzBR1JoPmcVT5VCqFHRRQfRgVvFXYq7FUiuZPWupJP2QeCfJf64VWYq7
FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FWnUMpGKp1YzGa1jc/apxb5jY4FV8VdirTKGUqejC
h+nFUhZSrFT1U0PzGFWsVRWmvxugP51I+kb/AMMCqVyxa4lJ/mI+40GFVLFVeyQNdRg9Aa/cKjAq
c4q7FXYqsncpDI46qpI+gVxVIlFFA8MKuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxVM
dJb4JU8GDf8ABCn/ABrgVH4q7FXYqk16gW6kA6E1+8VxVQwqq2zFbiIj+YD7zQ4qp1J3PU74q1iq
M0sf6Q3sp/WMCppirsVdiqjeGlrJ/q0+/FUlwq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FXYq7FX
Yq7FUw0n/dv+x/jgVMMVdirsVSvVB/pCnxUfrOKoPCrdSNx1G+KtYq7FUfpS/FI3gAPvr/TAqY4q
7FXYqp3NPq8tf5G/ViqR4VdirsVdirsVdirsVdirsVdirsVdirsVdirsVdirsVdiqYaT/u3/AGP8
cCphirsVdiqX6qo5Rt3II+6n9cVS/CrsVdirsVR+lH4pF8QD91f64FTHFXYq7FWnUMjKejAg/Tiq
Q4VaxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxV2KuxVMtKX4JG8SB9w/twKjsVdirsVS7VT8U
Y8AT99MVQGFXYq3QjY9RirWKorTpUjnYuwRSp3Y0FajxwKjjqFmDT1Qf9Wrfqrirvr9t4t/wD/0x
V31+28W/4B/6Yq79IWgNC5HzVh/DFUrnMZmcxnkhNQRt13wqp4q7FXYq7FXYq7FXYq7FXYq7FXYq
7FXYq7FXYq7FXYqmNlPFFAF4uzkksFRj16bgU6YFVxeE9IJj/safrIxVsXT0J+ry7f6n/NWKtG8Y
dbeb/gQf1E4qgL+YSzAhWWigUYFTWp8cVQ2FWwCdh1OKql0pW4kB/mJ+gmuBVLCqtalBcxlwCtaG
vTcUH44FTNr2zT4fVUn+Vfi/Ba4q19dBPwwysOxCUH/DUxVxuLn9m2Y+FWQfxOKuM952th/yMH9M
VQt9HcSAStEE4ChIblt9wxVA4VdirsVdirsVdirsVdirsVdirsVdirsVdirsVdiq+ONpHVF+0xoM
VTNRqCqFAhoooN26D6MCrgdR7iE/S39MVcZL1esKP/qvT9ajFXfW3X+8t5F91Acf8KTiqW3Uqy3D
upJU0AqCOgp0PviqjhVVtVLXEYH8wP0A1wKraknG55fzgH+H8MVQmFXH5VpvQ9MVT6IR+mpjACMA
RQUFDgVdirsVdiriAQQRUHYg4qk93atA9RvG32T/AAOKofCrsVdirsVdirsVdirsVdirsVdirsVd
irsVdiqaafamMeq4o7fZHgMCozFXYq7FWnYIpZtlUEk+wxVISxYlm+025+Zwq1iqL01OVzy/kBP8
P44FRGqRkxI4/ZND8j/tYqlmFXYqmumS87fgftRnj9HUYFReKuxV2KuxVp0V1KsKqeoOKpbc6c6E
tF8afy9x/XFUHhVrFXYq7FXYq7FXYq7FXYq7FXYq7FVyI7txQFmPYYqmNrp4Qh5qFuy9h88Co3FX
Yq7FXYqhNTl4W/AfakPH6OpxVKsKuxVM9LjIidz+0aD5D/bwKip4xLE6fzDb59sVSMgg0Ox8MKtY
qiLCb0rkV+zJ8B+f7OBU4xV2KpZfXV9HcFVYRxD7JoDUd+uKtxalL6nFVNzHT7aKVb3+HFUwiljl
QPG3JT3xVdiqnLbQS/bUE/zDY/fiqDk0rvG/yDf1H9MVUH0+6U/Y5DxBH8d8VUXilQVdGVR3IIH3
4VWYq7FXYq7FXEgddsVVUtrhjQRt9IoPvOBVZNNuW6gJ8z/SuKoiPS4hvIxf2GwxVFxxxxrxRQo9
sVXYq7FXYq7FXYqk99N6tyafYj+Bfn+0cVQ+FWwCTQbnwxVPIIxFEifyjf598Cr8VSnUIfTn5D7M
m4+ffFULhVxFRTFU4sbn14AW/vE+Fx7jv9OBURiq2SKOReLryGKpRd20lu/wOyqfsuux+RpirVrd
RwSho+fpmgnDdK/zLTwwqnQIIqNwehwK7FXYq4kKCxNANycVSKe5a6lMh2jU0iX28fnhVZirsVdi
rsVcQCKHFUZpl0ySC2c1Rv7onsf5cCppirsVdirsVdirsVdiqHvrn0ICR/eP8MY9z3+jFUnAoAMK
uxVFafD6k/I/Zj3Pz7YFTbFXYqo3kHrQlR9obr8xiqTYVaxVUt7g28wk/YO0g9vH6MVTwEMAQag7
gjArsVU7iETRMh6n7J8D2xVJC0qErzManaUU7DxwqibbUFtz6RYy2w+xIAQR7UPbAqZxTwyisbhx
7HFVzOiCrMFHiTQYql2o38LwPBC3N32JXoBXffFUCAAAB0GFXYq7FWyrAAkEBuh7GmKtYq7FXGoo
V2ZTVT7jcYqn6OHRXHRgCPpwK3irsVdirsVdiriQoLE0A3JPhiqR3FwbmYyfsDaIe3j9OFVPFW8V
Tmzg9GEKftHdvmcCq2KuxV2KpXqNvwk9VfsOd/Zv7cVQeFXYqi9OvPSYW8h/dt/dMex/lwKmuKux
VLNRtijmVR8Dfa9j/biqDDyqCsb8VbZ1A6jCq0iErw9I8619Wu1PCmKuKwMAFiKsooxYkhj/AAxV
czlzyKLGf5UFBirWKq8sQS3hanxPyJ+W1MCqGFURN/vJbf7P/iWBUPhVWkiCwQyD9sMG+YOBVHCq
eW21vF/qL+rAqpirsVdirsVdiqVajeesxt4z+7U/vW8SP2RiqEwq7FUZp1vzk9VvsIdvdv7MCppi
rsVdirsVWyRrIhRvst1xVJZ4WhkKN26HxHjhVTxVzKGFD0OKo+wvzUQTn4ukch7+x98CpjirmUMC
CKg7EHFUvn0w1LQnb+Q/wOKoRrW5U0MbV9hX8RirX1e4/wB9P/wJwq54JkTm6FVrTfbfFVPFUZe/
7z2v+p/AYFQeFUTP/vJbf7P9eBUNhVGSj/cbCe/I/rbAqDwqnlv/ALzxf6i/qwKqYq7FXYq7FUt1
DUCSbe3PxdJJB29h74qgFUKKDphVvFVSCF5pAi9+p8B44qnUcaxoEXZV6YFXYq7FXYq7FXYqo3Vs
s8dOjjdWxVJ3RkYqwow6jCq3FXMoYUPTFUXZ6k0VIrg1j6LL3Hs2BU1BDAEGoO4IxV2KuxV2KoPV
P951/wBcfqOKpXhVGXv+89r/AKn8BgVB4VRVz/vLbfJv4YFQuFUZL/xzIf8AXP8AxtgVB4VTy3/3
ni/1F/VgVUxV2KuZlUFmIAG5J6YqlF5qbzExWxon7Uvc/LFUKqhRQYVbxVciM7BVFWPQYqnFrbLB
HTqx3ZsCq2KuxV2KuxV2KuxV2Koe7tFnWo2kHQ+PscVSl0ZGKsKMOowqtxVxAOxxVfb3Nxan92eU
feI9Po8MVTW1v7e42U8ZO8bbH+3AqIxV2KoPVP8Aedf9cfqOKpXhVGXv+89r/qfwGBUHhVGXP+8V
v9OBUHhVGS/8cyH/AFz/AMbYFQeFU8t/954v9Rf1YFVMVQ11qFvbghjyk7IvX6fDFUquLi5uj+8P
CLtGP44VWgACg2GKuxVciM7BVFWPQDFU2tLRYFqd5D9pv4DAqIxV2KuxV2KuxV2KuxV2KuxVRubW
Odd9nH2WxVKZoJIW4uKeB7H5YVU8VdirTIrdevYjriqvDqF5DsT6yDs32vvwKjYdWtJNnJibwfp9
+KrNTnRkjRSGqeVQa9Nv44ql+FUZe/7z2v8AqfwXAqDwqjLkH6jbmn+ZwKg8KoyX/jmRf65/W2BU
HhVHJq0MMCoysZFFAo6GnTfAqFm1C9n2B9GM9h1+/CqikSrv1PicVXYq7FVSGCSZ+KCview+eKpt
bWscC7bsftMcCq2KuxV2KuxV2KuxV2KuxV2KuxV2KrZI0kXi45L4HFUtuNOkT4o6unh+0P64qhMK
tYq7FXFQeorirSoq14ilcVbblT4aE++Kqks8sxVpKAgUouwxVTPTx9sVVpb55Ykh9Hiq0o3Kp2FP
AYFUcKttLclBEJKRDfjQeNcVaxV2KuxV2Kt4qi7fTpH+KWqL4ftH+mBUyjjSNQqAKo7DFV2KuxV2
KuxV2KuxV2KuxV2KuxV2KuxV2KuxVRns4Zt2FG/mHXFUvm0+ePdR6i+K9fuxVDEEGh6jrhVrFXYq
7FXYq7FXYq7FXYq7FXYq2ASaDcnoMVRMOnTybt+7X36/dgVMILSGHdRVv5jucVVsVdirsVdirsVd
irsVdirsVdirsVdirsVdirsVdirsVdiqySCGUfGgb37/AH4qhZNLiO8blfY7j+GKod9NuV6AP8j/
AFpiqi1tcKaGNtvAEj7xiqmduu2FWsVdirY36b4qqLa3LGgjavuCP14FVk025b7VE+ZqfwriqIj0
uIbuxf2GwxVFRwxRCkahffv9+Kr8VdirsVdirsVdirsVdirsVdir/9k=
+
+
+
+
+
+ Adobe PDF library 9.90
+
+
+ image/svg+xml
+
+
+ 1
+ False
+ False
+
+ 130.000000
+ 130.000000
+ Pixels
+
+
+
+ Cyan
+ Magenta
+ Yellow
+
+
+
+
+
+ Default Swatch Group
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/crud-sprite.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/crud-sprite.png
new file mode 100644
index 0000000..5334e20
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/crud-sprite.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/dropdown_sprites.jpg b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/dropdown_sprites.jpg
new file mode 100644
index 0000000..3e3cc6f
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/dropdown_sprites.jpg differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/expand-arrows.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/expand-arrows.png
new file mode 100644
index 0000000..190d784
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/expand-arrows.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer-logo.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer-logo.png
new file mode 100644
index 0000000..408206b
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer-logo.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer-logo.svg b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer-logo.svg
new file mode 100644
index 0000000..36f0bf3
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer-logo.svg
@@ -0,0 +1,199 @@
+
+
+
+
+]>
+
+
+
+
+
+ proof:pdf
+ xmp.did:01801174072068118C14F029FF4E69A3
+ xmp.iid:01801174072068118C14F029FF4E69A3
+ uuid:9d2fdc90-b8de-c94c-86b5-364e47b8e5b6
+
+ uuid:76c5eca8-e841-3b48-99db-8cd076c5142a
+ uuid:9d2fdc90-b8de-c94c-86b5-364e47b8e5b6
+ uuid:9d2fdc90-b8de-c94c-86b5-364e47b8e5b6
+ proof:pdf
+
+
+
+
+ saved
+ xmp.iid:01801174072068118C14F029FF4E69A3
+ 2011-08-01T16:12:07-07:00
+ Adobe Illustrator CS5
+ /
+
+
+
+
+
+ 2011-08-01T16:12:06-07:00
+ Adobe Illustrator CS5
+ 2011-08-01T16:12:07-07:00
+ 2011-08-01T16:12:07-07:00
+
+
+
+ 256
+ 116
+ JPEG
+ /9j/4AAQSkZJRgABAgEASABIAAD/7QAsUGhvdG9zaG9wIDMuMAA4QklNA+0AAAAAABAASAAAAAEA
AQBIAAAAAQAB/+4ADkFkb2JlAGTAAAAAAf/bAIQABgQEBAUEBgUFBgkGBQYJCwgGBggLDAoKCwoK
DBAMDAwMDAwQDA4PEA8ODBMTFBQTExwbGxscHx8fHx8fHx8fHwEHBwcNDA0YEBAYGhURFRofHx8f
Hx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8f/8AAEQgAdAEAAwER
AAIRAQMRAf/EAaIAAAAHAQEBAQEAAAAAAAAAAAQFAwIGAQAHCAkKCwEAAgIDAQEBAQEAAAAAAAAA
AQACAwQFBgcICQoLEAACAQMDAgQCBgcDBAIGAnMBAgMRBAAFIRIxQVEGE2EicYEUMpGhBxWxQiPB
UtHhMxZi8CRygvElQzRTkqKyY3PCNUQnk6OzNhdUZHTD0uIIJoMJChgZhJRFRqS0VtNVKBry4/PE
1OT0ZXWFlaW1xdXl9WZ2hpamtsbW5vY3R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo+Ck5SVlpeYmZ
qbnJ2en5KjpKWmp6ipqqusra6voRAAICAQIDBQUEBQYECAMDbQEAAhEDBCESMUEFURNhIgZxgZEy
obHwFMHR4SNCFVJicvEzJDRDghaSUyWiY7LCB3PSNeJEgxdUkwgJChgZJjZFGidkdFU38qOzwygp
0+PzhJSktMTU5PRldYWVpbXF1eX1RlZmdoaWprbG1ub2R1dnd4eXp7fH1+f3OEhYaHiImKi4yNjo
+DlJWWl5iZmpucnZ6fkqOkpaanqKmqq6ytrq+v/aAAwDAQACEQMRAD8A9U4q7FXYq7FXYq7FUr1X
UZIn9CE8WpV27ivYYqliXt2jchK1fckj7jhQn1hdi6gDkUcGjj3wJROKuxV2KuxVCaqSLCUjY/D/
AMSGKseLMepJwoTbQP8Ad/8AsP8AjbAlNsVdirsVdirsVdirsVdirsVdirHNT/3vm+Y/UMKELirL
cCXYq7FXYq7FXYq7FXYq7FXYqxzVEZb6Sv7VCD7EYUIXFU50FGEUrn7LEAfR1/XgSmmKuxV2KuxV
Cat/xz5f9j/xIYqx3ChN9A/3f/sP+NsCU2xV2KuxV2KuxV2KuxV2KuxV2Ksc1P8A3vm+Y/UMKELi
rLcCXYq7FXYq7FXYq7FXYq7FXYqh7yxiulAb4XX7LjtiqBTQRy+Oaq9wBQ/rxVNIokijEaDiq7AY
qpX8rxWkkkZo6gUPXuPHFUk/S2of79/4Vf6YVTHSLu4uPV9Z+XHjx2A618BgVMcVQmrf8c+X/Y/8
SGKsdwoTfQP93/7D/jbAlNsVdirsVdirsVdirsVdirsVdirHNT/3vm+Y/UMKELirLcCXYq7FXYq7
FUJcapaQEqW5uOqrv+PTFUI2vrX4YCR7tT+BxVVi1y3Y0kRo/f7QxVEtqFkBUzLT2Nf1YqojV7d5
kiiBYuwHLoN8VVL3UEtCgZC3OvT2xVC/p6H/AH033jFUdDcrLbCcAhSCafKv9MVSy71eOe3eIRkF
h1JHjXFUrwoRmn34tDJVOYenenSv9cUphb6ys0yRCIrzNK1/swKrat/xz5f9j/xIYqx3ChMtHuYY
EnaVgo+Gg7nr0GBKs+vRg/BCWHiTT+BxVfDrkDGkiGP3B5D+GKpijq6hkIZT0I6Yq3iqVnXUBI9E
7f5X9mKqltrCzzpEIivLvWvavhiqYYqp3M4ggeUjlx7dO9MVS39P/wDFH/D/APNuKoqw1D62XHp8
OFD1rWv0DFUo1P8A3vm+Y/UMKELiqfT6zaxkqgMpHcbD78CUN+n2r/cin+t/ZiqLtdWtp2CGsbno
G6H5HFUbiqVavqDKfq8Rof8AdjD37Yqk+FDYVj0BNMVaxV2Kq1kaXkP+uv68VR+vfbh+TfwwJSrC
hP8AT/8AjlL/AKr/AKzgSkGFDsVdiqI07/e2H/WxVOtW/wCOfL/sf+JDAljuFDsVdirsVR2lXpgm
EbH91IaH2PjilP8AArE3+23zOFCJ0z/e+H5n9RxVkeBKF1P/AHgm+Q/WMVY5hQmug/bm+S/xwJQu
rf8AHQl/2P8AxEYVQmKHYq7FXYqnmkXpmjMMhrJGNj4r/ZgSksshkleQ9WJP34UInTLVbi5o+6IO
TDx9sUshVVUBVACjoBsMCpfq1lG8LTqAsibkjuO9cVSPChOdGt7d4PVMYMquRyO/ShH68CVPXvtw
/Jv4YqlWFDIdKAOnRA7g8qj/AGRwJWahaWqWcrJEqsAKEDfqMVSHChMtFghlaUSIHoBSor44pTZL
O1RgyxKrDoQMCqOrf8c+X/Y/8SGKsdwoRmm2IupG5NRI6cgOprX+mKU4/R1jw4+itPHv9/XAqS6h
Z/VZ+I3jbdCf1YUIXFWTWExmtInO7Uo3zG2BLGn+23zOFCJ0z/e+H5n9RxVkeBKF1P8A3gm+Q/WM
VY5hQmug/bm+S/xwJQurf8dCX/Y/8RGFUJihkFrpNtCo9RRLJ3Lbj6BgS1e6VBLGTEgjlG68dgfY
jFUgIIND1woRFhMYryJuxPE/I7YqoyIUkZD1UkH6MVRekXKQ3JDmiyDjU9Ae2KWQYFQWq3McVs0d
aySCir7HqcVY/hQn+jRlbKp/bYsP1fwwJQuvfbh+TfwxVKsKGRaT/wAc+L/Zf8SOBLep/wC8E3yH
6xirHMKE10H7c3yX+OBKcYqhNW/458v+x/4kMVY7hQm2gHecf6v8cCU3xVLNdWsEb+DU+8f2Yqku
FCe6Ia2ZHg5H4A4EpG/22+ZwoROmf73w/M/qOKsjwJQup/7wTfIfrGKscwoTXQftzfJf44EoXVv+
OhL/ALH/AIiMKoTFDLcCXYqxrUECXsyjpyJ+/fChDgkEEdRiqa6zZEN9ZjFVP94B2PjgSlWFColx
cIvFJXVfAMQMVWFixqxJJ6k4qq2lrJczBF6ftN2AxVk0aLGioooqgAD2GBKUa99uH5N/DFUqwoZF
pP8Axz4v9l/xI4Et6n/vBN8h+sYqxzChNdB+3N8l/jgSnGKoTVv+OfL/ALH/AIkMVY7hQmug/bm+
S/xwJTjFUu13/eRP+Mg/4icVSPChPNC/3kf/AIyH/iIwJSWQUkYeBOFCvpppfQn3p94pirJMCULq
f+8E3yH6xirHMKE10H7c3yX+OBKF1b/joS/7H/iIwqhMUMtwJdirGb9w95Mw6ciPu2woUVBZgo6k
0xVlUzrHE7tuqgkj2AwJYtK4eRnChAxrxXoMKF9tazXEnCIVPUk9APfFUyi0EVBllqO6qP4nAlM4
YIoU4RKFX9fzxVfiqT699uH5N/DFUqwoZFpP/HPi/wBl/wASOBK7UgTYzfKv3HFWN4UJlocqrcOj
GhcfD8x2wJTtmVQSxAA6k4qg9UZW02RlNVIUgjwLDFWPYUJroP25vkv8cCU4xVLddP8AoqDxf+Bx
VJMKE80L/eR/+Mh/4iMCUqvozHeTL/lEj5HcYUKUchjkWReqEEfRirJYLu3nQOjjfqpO4+eBKC1W
/t/QaBDzdtjToN69cVSXChNdB+3N8l/jgShdW/46Ev8Asf8AiIwqhMUMitdTtp0FWEb90Y0+498C
Vl7qsESERMJJTsKbge5OKpASSanrhQidNhMt5GOynm3yXfFU+vUL2kqr1Kmg+W+BLGMKEfpN7Fby
OsuyyU+LwI8fvxSncc0Mg+B1b5EHAq/FXYqlGvjeA/638MVSnChkWk/8c+L/AGX/ABI4EoiaMSQv
Gf21K/eMVYsylWKsKMDQj3GFDWKrmkkf7TFqdKknFU6uv+OIv/GOP9a4EpHhQmug/bm+S/xwJTjF
Uu10f6Kh/wAsfqOKpHhQnmhf7yP/AMZD/wARGBKjrdqarcKNqcZP4HFUpwodirsVdiqa6D9ub5L/
ABwJQurf8dCX/Y/8RGFUJih2KuxV2Kp/pNkYIjI4pLJ28B4YEqt5fw2q/F8Tn7KDrirHppBJKzhA
gY14jphQsxV2Koq21K6gIoxdO6NuPo8MVT61uY7mISJ8mHcHwwJQ2p2M116XplRw5V5EjrTwB8MV
QP6Cu/54/vb+mKprYwPBapE5BZa1I6bknFVfFUBf6Ulw3qRnhKetehxVLm0a+B2VT7hh/HCqpHod
yx/eMqD23OBUzuLQvY/VkbcKqhj/AJJHh8sVS39BXH+/E/H+mKo3TdPktWkLsrcwKUr2+eKo7FUL
qNo91AsaEKQwap+RH8cVS79BXH+/E/H+mKpjp1o9rA0bkMSxao+QH8MVRLKrKVYVU7EHFUruNDUs
WgfjX9hun34qoLod0Tu6AeNSf4Yqi00aFIXWvOVlIDt0FfAYqh/0DN/v1fuOKozTtPe0ZyzhuYFK
e2KqN5pMlxcvMJAoamxB7ADFVOPQ5VkRjIpCkEih7HFVW50SJ2LQt6ZP7JFR9GKoYaFc13kSnjv/
AExVHWmkwQMHY+pIOhOwHyGKo3FWLXMzTTvITXkdvl2woVLGza6m4A8VAqze2Kpwmj2KihUufEsf
4UwJal0azZfgBjPYgk/rxVI5omhleNuqGmFCO0OUrctH+y61p7jAlMNSvjaxqEAMj1pXoAO+KoaG
61ZXjMkXNJCANgOvy6fTiqJ1DUVtQFUcpWFQD0A8TiqB+u6xw9XgfT6/Y2p+vFUbp+ordAow4yru
QOhHiMVUr3VXSX0LZeUgNC1K7+AGKqcV3qqTRCdP3cjKpJUbVNOoxVVhv531Jrc8fTBYDbfbFURq
Fybe1Z1NHPwp8ziqjpN7JcRusrcpENa0A2PyxVbql9cW0iLEQAwJNRXviqY4q4kAEk0A6nFUol1S
7nlMdmuw6NSpPvvsMVVrG41D6yIbobMCVJAG49xtiqlc6tO83o2a13pypUn5DFVNr7VbYhp1qh7M
AB964qjJ9Qrp5uYNmqBQ70NdxiqETUNVMYmCB4/ELUbfLfFUdYagl0pFOMq/aX28RiqFstQuZ0n5
kVSMspApvirel6m8jmGdqs32GP6sVROp3Etvbc4jRuQFaV23xVat/wCnpyXE3xO2wA2qanFUGk+s
3IMkXwp2A4gfRy64qr2GozvP9WuV/edmpQ7eIxVJXUo7Keqkg/MYUInTr0WsxZgSjCjAdfniqcLq
tgRX1aexB/pgStl1iyRaqxkbsAD+s4qkU8zTSvK3VzWmFCN0SMtdM/ZFNfmcCUdq1lJcIjxbulfh
8QcVQtvqtxA4hukNBtUijAfxxVawWbWuMm68unairUYqneKpFLSDVz6Q6GtB/lLv+vFVTQkVppZG
3dQKV/yq1P4YqnOKpNbimuP83/EYq3qrme8itVOwIr82/sxVagFlq/EbRuaD5N0+44q3r399F/qn
9eKpziqF1RithKR1oB9BIBxVR0REFqzj7TMeR+XQYqi7slbWZh1CMR92KpdoKLxlf9uoFfbFUxu0
R7aVX+zxP4CtcVSKBj+j7pewaMj6Sf6YUJro/wDvAnzb9eBKChAj1srH9kswIHutTiqnpX2Lr/jE
cVU7azaa1kljr6sTAgDuKfrwoV7m+FzpoDf3yOOQ8djvgSoXbN9TtF/Z4sfp5YVTuaVLSz5qvJIw
oAG1RUDAqBj1qNpABBRnIBNRU9vDFWtT0x3czwDkW3dO9fEYqlLKymjAgjqDthQ1irsVVre0uLhq
RoSO7dFH04qn9lZpaw8Bux3dvE4EqOo3lxbPGyJWH9s+Pt7Yql97c/pCaJIYzUVG/Xf5dhhVW1Kz
mhkS6hqeIXkR2KilflgVv9PH0/7r9589sVdplrNNcG8mG25Wvcn+GKqUiXGm3RkReULbDwIPY++K
ohdZMssUccfEu6hiTXYnemKqMbqmsyO2yrzJ+QXFVK0tG1CeWR24itSRvuT0wquv9LFtEJUcsK0a
vauBVmoz+vHbSdyhDfMGhwoTG01ZbicRCMrWu9a9BXwwJRk0SyxPG3RxTFUlhnudNlaOROUbGtOg
PuDiqMttRa8uPS9PjEVPPuTtiqDH1nTLhjx5RNtU9GHbfxxVdc6rNdJ6EMRXnsaHkT7DbFV8tm1t
pLhv7x2Vn9txQYqo2upyw24gii5OK0atep8AMKovS7GZZGurjaRq8VPXfqTgVC6V9i6/4xH+OKor
QgRFLUU+IfqxVQ1ew9NjcRj4GPxgdie/04qqGza50qEp/eRglR4gk1GKrLfV5IIxDNESyCgNaHbs
a4q6zhnvL363KvGNSCPDboBiqc4qsl9Cn73jT/Lp/HFUM36I7+h9HH+GKro/0XUcPRr7ca4qihSm
3TtirsVabjxPKnHvXpiqyH6tv6PD34U/hiqpiqifqfPf0+f+xriqtirm40PKlO9emKqcX1ap9LhX
vwp/DFVTFXYq7FXYq7FXYq0/Dj8dOPevTFWk9OnwU4/5NKfhiq5uNDypTvXpiqyP0d/T4+/Gn8MV
X4q7FXYq7FXYq40pv071xVwpTbp7Yq03D9qn04q3ir//2Q==
+
+
+
+
+
+ Adobe PDF library 9.90
+
+
+ image/svg+xml
+
+
+
+ 100.000000
+ 44.000000
+ Pixels
+
+ 1
+ False
+ False
+
+
+ Cyan
+ Magenta
+ Yellow
+
+
+
+
+
+ Default Swatch Group
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer_logo.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer_logo.png
new file mode 100644
index 0000000..8ad67d3
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/footer_logo.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/nav-rule.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/nav-rule.png
new file mode 100644
index 0000000..909c5a8
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/nav-rule.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/next_step_arrow.gif b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/next_step_arrow.gif
new file mode 100644
index 0000000..8f93ee9
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/next_step_arrow.gif differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/qmark.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/qmark.png
new file mode 100644
index 0000000..caa30f5
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/qmark.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/rackspace_logo.png b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/rackspace_logo.png
new file mode 100644
index 0000000..6a29d67
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/images/rackspace_logo.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/js/documentation.js b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/js/documentation.js
new file mode 100644
index 0000000..91fc3d2
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/js/documentation.js
@@ -0,0 +1,78 @@
+// Init sidebar
+$(function() {
+ var activeItem,
+ helpList = $('#js-sidebar .js-topic'),
+ firstOccurance = true
+
+ // hide list items at startup
+ if($('body.api') && window.location){
+ var reg = /\/\/[^\/]+(\/.+)/g,
+ docUrl = reg.exec(window.location.toString())
+ if(docUrl){
+ $('#js-sidebar .js-topic a').each(function(){
+ var url = $(this).attr('href').toString()
+ if(url.indexOf(docUrl[1]) >= 0 && url.length == docUrl[1].length){
+ $(this).parent('li').addClass('disable')
+ var parentTopic = $(this).parentsUntil('div.sidebar-module > ul').last()
+ parentTopic.addClass('js-current')
+ parentTopic.find('.js-expand-btn').toggleClass('collapsed expanded')
+ }
+ })
+ }
+ }
+
+ $('#js-sidebar .js-topic').each(function(){
+ if(($(this).find('.disable').length == 0 || firstOccurance == false) &&
+ $(this).hasClass('js-current') != true){
+ $(this).find('.js-guides').children().hide()
+ } else {
+ activeItem = $(this).index()
+ firstOccurance = false
+ }
+ })
+
+ // Toggle style list. Expanded items stay
+ // expanded when new items are clicked.
+ $('#js-sidebar .js-toggle-list .js-expand-btn').click(function(){
+ var clickedTopic = $(this).parents('.js-topic'),
+ topicGuides = clickedTopic.find('.js-guides li')
+ $(this).toggleClass('collapsed expanded')
+ topicGuides.toggle(100)
+ return false
+ })
+
+ // Accordion style list. Expanded items
+ // collapse when new items are clicked.
+ $('#js-sidebar .js-accordion-list .js-topic h3 a').click(function(){
+ var clickedTopic = $(this).parents('.js-topic'),
+ topicGuides = clickedTopic.find('.js-guides li')
+
+ if(activeItem != clickedTopic.index()){
+ if(helpList.eq(activeItem)){
+ helpList.eq(activeItem).find('.js-guides li').toggle(100)
+ }
+ activeItem = clickedTopic.index()
+ topicGuides.toggle(100)
+ } else {
+ activeItem = undefined
+ topicGuides.toggle(100)
+ }
+
+ return false
+ })
+
+ $('.help-search .search-box').focus(function(){
+ $(this).css('background-position','0px -25px')
+ })
+
+ $('.help-search .search-box').focusout(function(){
+ if($(this).val() == ''){
+ $(this).css('background-position','0px 0px')
+ }
+ })
+
+ // Dynamic year for footer copyright
+ var currentYear = (new Date).getFullYear();
+ $("#year").text( (new Date).getFullYear() );
+
+});
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/js/jquery.js b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/js/jquery.js
new file mode 100644
index 0000000..7c24308
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/ghm/shared/js/jquery.js
@@ -0,0 +1,154 @@
+/*!
+ * jQuery JavaScript Library v1.4.2
+ * http://jquery.com/
+ *
+ * Copyright 2010, John Resig
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ * Copyright 2010, The Dojo Foundation
+ * Released under the MIT, BSD, and GPL Licenses.
+ *
+ * Date: Sat Feb 13 22:33:48 2010 -0500
+ */
+(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
+Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
+(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
+a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
+"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
+function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;ba ";
+var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
+parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
+false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML=" ";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
+s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
+applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
+else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
+a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
+w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
+cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
+c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
+a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
+function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
+k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
+C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B=0){a.type=
+e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
+f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
+if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
+e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
+"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
+d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
+t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
+g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
+CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
+g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
+text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
+setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return hl[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
+h[3];l=0;for(m=h.length;l=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
+"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
+h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l ";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
+q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML=" ";
+if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="
";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
+(function(){var g=s.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
+function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f0)for(var j=d;j0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
+{},i;if(f&&a.length){e=0;for(var o=a.length;e-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
+"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
+d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
+a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
+1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/"+d+">"},F={option:[1,""," "],legend:[1,""," "],thead:[1,""],tr:[2,""],td:[3,""],col:[2,""],area:[1,""," "],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
+c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
+wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
+prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
+this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
+return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
+""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
+return this}else{e=0;for(var j=d.length;e0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
+""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]===""&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
+c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
+c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
+function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
+Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
+"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
+a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
+a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/', returnEnd: true,
+ subLanguage: 'javascript'
+ }
+ },
+ {
+ begin: '<%', end: '%>',
+ subLanguage: 'vbscript'
+ },
+ {
+ className: 'tag',
+ begin: '?', end: '/?>',
+ contains: [
+ {
+ className: 'title', begin: '[^ />]+'
+ },
+ TAG_INTERNALS
+ ]
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Markdown
+Requires: xml.js
+Author: John Crepezzi
+Website: http://seejohncode.com/
+*/
+
+hljs.LANGUAGES.markdown = {
+ case_insensitive: true,
+ defaultMode: {
+ contains: [
+ // highlight headers
+ {
+ className: 'header',
+ begin: '^#{1,3}', end: '$'
+ },
+ {
+ className: 'header',
+ begin: '^.+?\\n[=-]{2,}$'
+ },
+ // inline html
+ {
+ begin: '<', end: '>',
+ subLanguage: 'xml',
+ relevance: 0
+ },
+ // lists (indicators only)
+ {
+ className: 'bullet',
+ begin: '^([*+-]|(\\d+\\.))\\s+'
+ },
+ // strong segments
+ {
+ className: 'strong',
+ begin: '[*_]{2}.+?[*_]{2}'
+ },
+ // emphasis segments
+ {
+ className: 'emphasis',
+ begin: '\\*.+?\\*'
+ },
+ {
+ className: 'emphasis',
+ begin: '_.+?_',
+ relevance: 0
+ },
+ // blockquotes
+ {
+ className: 'blockquote',
+ begin: '^>\\s+', end: '$'
+ },
+ // code snippets
+ {
+ className: 'code',
+ begin: '`.+?`'
+ },
+ {
+ className: 'code',
+ begin: '^ ', end: '$',
+ relevance: 0
+ },
+ // horizontal rules
+ {
+ className: 'horizontal_rule',
+ begin: '^-{3,}', end: '$'
+ },
+ // using links - title and link
+ {
+ begin: '\\[.+?\\]\\(.+?\\)',
+ returnBegin: true,
+ contains: [
+ {
+ className: 'link_label',
+ begin: '\\[.+\\]'
+ },
+ {
+ className: 'link_url',
+ begin: '\\(', end: '\\)',
+ excludeBegin: true, excludeEnd: true
+ }
+ ]
+ }
+ ]
+ }
+};
+/*
+Language: Django
+Requires: xml.js
+Author: Ivan Sagalaev
+Contributors: Ilya Baryshev
+*/
+
+hljs.LANGUAGES.django = function() {
+
+ function allowsDjangoSyntax(mode, parent) {
+ return (
+ parent == undefined || // defaultMode
+ (!mode.className && parent.className == 'tag') || // tag_internal
+ mode.className == 'value' // value
+ );
+ }
+
+ function copy(mode, parent) {
+ var result = {};
+ for (var key in mode) {
+ if (key != 'contains') {
+ result[key] = mode[key];
+ }
+ var contains = [];
+ for (var i = 0; mode.contains && i < mode.contains.length; i++) {
+ contains.push(copy(mode.contains[i], mode));
+ }
+ if (allowsDjangoSyntax(mode, parent)) {
+ contains = DJANGO_CONTAINS.concat(contains);
+ }
+ if (contains.length) {
+ result.contains = contains;
+ }
+ }
+ return result;
+ }
+
+ var FILTER = {
+ className: 'filter',
+ begin: '\\|[A-Za-z]+\\:?', excludeEnd: true,
+ keywords:
+ 'truncatewords removetags linebreaksbr yesno get_digit timesince random striptags ' +
+ 'filesizeformat escape linebreaks length_is ljust rjust cut urlize fix_ampersands ' +
+ 'title floatformat capfirst pprint divisibleby add make_list unordered_list urlencode ' +
+ 'timeuntil urlizetrunc wordcount stringformat linenumbers slice date dictsort ' +
+ 'dictsortreversed default_if_none pluralize lower join center default ' +
+ 'truncatewords_html upper length phone2numeric wordwrap time addslashes slugify first ' +
+ 'escapejs force_escape iriencode last safe safeseq truncatechars localize unlocalize ' +
+ 'localtime utc timezone',
+ contains: [
+ {className: 'argument', begin: '"', end: '"'}
+ ]
+ };
+
+ var DJANGO_CONTAINS = [
+ {
+ className: 'template_comment',
+ begin: '{%\\s*comment\\s*%}', end: '{%\\s*endcomment\\s*%}'
+ },
+ {
+ className: 'template_comment',
+ begin: '{#', end: '#}'
+ },
+ {
+ className: 'template_tag',
+ begin: '{%', end: '%}',
+ keywords:
+ 'comment endcomment load templatetag ifchanged endifchanged if endif firstof for ' +
+ 'endfor in ifnotequal endifnotequal widthratio extends include spaceless ' +
+ 'endspaceless regroup by as ifequal endifequal ssi now with cycle url filter ' +
+ 'endfilter debug block endblock else autoescape endautoescape csrf_token empty elif ' +
+ 'endwith static trans blocktrans endblocktrans get_static_prefix get_media_prefix ' +
+ 'plural get_current_language language get_available_languages ' +
+ 'get_current_language_bidi get_language_info get_language_info_list localize ' +
+ 'endlocalize localtime endlocaltime timezone endtimezone get_current_timezone',
+ contains: [FILTER]
+ },
+ {
+ className: 'variable',
+ begin: '{{', end: '}}',
+ contains: [FILTER]
+ }
+ ];
+
+ return {
+ case_insensitive: true,
+ defaultMode: copy(hljs.LANGUAGES.xml.defaultMode)
+ };
+
+}();
+/*
+Language: CSS
+*/
+
+hljs.LANGUAGES.css = function() {
+ var FUNCTION = {
+ className: 'function',
+ begin: hljs.IDENT_RE + '\\(', end: '\\)',
+ contains: [{
+ endsWithParent: true, excludeEnd: true,
+ contains: [hljs.NUMBER_MODE, hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE]
+ }]
+ };
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ illegal: '[=/|\']',
+ contains: [
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'id', begin: '\\#[A-Za-z0-9_-]+'
+ },
+ {
+ className: 'class', begin: '\\.[A-Za-z0-9_-]+',
+ relevance: 0
+ },
+ {
+ className: 'attr_selector',
+ begin: '\\[', end: '\\]',
+ illegal: '$'
+ },
+ {
+ className: 'pseudo',
+ begin: ':(:)?[a-zA-Z0-9\\_\\-\\+\\(\\)\\"\\\']+'
+ },
+ {
+ className: 'at_rule',
+ begin: '@(font-face|page)',
+ lexems: '[a-z-]+',
+ keywords: 'font-face page'
+ },
+ {
+ className: 'at_rule',
+ begin: '@', end: '[{;]', // at_rule eating first "{" is a good thing
+ // because it doesn’t let it to be parsed as
+ // a rule set but instead drops parser into
+ // the defaultMode which is how it should be.
+ excludeEnd: true,
+ keywords: 'import page media charset',
+ contains: [
+ FUNCTION,
+ hljs.APOS_STRING_MODE, hljs.QUOTE_STRING_MODE,
+ hljs.NUMBER_MODE
+ ]
+ },
+ {
+ className: 'tag', begin: hljs.IDENT_RE,
+ relevance: 0
+ },
+ {
+ className: 'rules',
+ begin: '{', end: '}',
+ illegal: '[^\\s]',
+ relevance: 0,
+ contains: [
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'rule',
+ begin: '[^\\s]', returnBegin: true, end: ';', endsWithParent: true,
+ contains: [
+ {
+ className: 'attribute',
+ begin: '[A-Z\\_\\.\\-]+', end: ':',
+ excludeEnd: true,
+ illegal: '[^\\s]',
+ starts: {
+ className: 'value',
+ endsWithParent: true, excludeEnd: true,
+ contains: [
+ FUNCTION,
+ hljs.NUMBER_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'hexcolor', begin: '\\#[0-9A-F]+'
+ },
+ {
+ className: 'important', begin: '!important'
+ }
+ ]
+ }
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: JSON
+Author: Ivan Sagalaev
+*/
+
+hljs.LANGUAGES.json = function(){
+ var LITERALS = {literal: 'true false null'};
+ var TYPES = [
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_NUMBER_MODE
+ ];
+ var VALUE_CONTAINER = {
+ className: 'value',
+ end: ',', endsWithParent: true, excludeEnd: true,
+ contains: TYPES,
+ keywords: LITERALS
+ };
+ var OBJECT = {
+ begin: '{', end: '}',
+ contains: [
+ {
+ className: 'attribute',
+ begin: '\\s*"', end: '"\\s*:\\s*', excludeBegin: true, excludeEnd: true,
+ contains: [hljs.BACKSLASH_ESCAPE],
+ illegal: '\\n',
+ starts: VALUE_CONTAINER
+ }
+ ],
+ illegal: '\\S'
+ };
+ var ARRAY = {
+ begin: '\\[', end: '\\]',
+ contains: [hljs.inherit(VALUE_CONTAINER, {className: null})], // inherit is also a workaround for a bug that makes shared modes with endsWithParent compile only the ending of one of the parents
+ illegal: '\\S'
+ };
+ TYPES.splice(TYPES.length, 0, OBJECT, ARRAY);
+ return {
+ defaultMode: {
+ contains: TYPES,
+ keywords: LITERALS,
+ illegal: '\\S'
+ }
+ };
+}();
+/*
+Language: JavaScript
+*/
+
+hljs.LANGUAGES.javascript = {
+ defaultMode: {
+ keywords: {
+ keyword:
+ 'in if for while finally var new function do return void else break catch ' +
+ 'instanceof with throw case default try this switch continue typeof delete',
+ literal:
+ 'true false null undefined NaN Infinity'
+ },
+ contains: [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.C_NUMBER_MODE,
+ { // regexp container
+ begin: '(' + hljs.RE_STARTERS_RE + '|\\b(case|return|throw)\\b)\\s*',
+ keywords: 'return throw case',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'regexp',
+ begin: '/', end: '/[gim]*',
+ contains: [{begin: '\\\\/'}]
+ }
+ ],
+ relevance: 0
+ },
+ {
+ className: 'function',
+ beginWithKeyword: true, end: '{',
+ keywords: 'function',
+ contains: [
+ {
+ className: 'title', begin: '[A-Za-z$_][0-9A-Za-z$_]*'
+ },
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE
+ ],
+ illegal: '["\'\\(]'
+ }
+ ]
+ }
+ ]
+ }
+};
+/*
+Language: CoffeeScript
+Author: Dmytrii Nagirniak
+Contributors: Oleg Efimov
+Description: CoffeeScript is a programming language that transcompiles to JavaScript. For info about language see http://coffeescript.org/
+*/
+
+hljs.LANGUAGES.coffeescript = function() {
+ var keywords = {
+ keyword:
+ // JS keywords
+ 'in if for while finally new do return else break catch instanceof throw try this ' +
+ 'switch continue typeof delete debugger class extends super' +
+ // Coffee keywords
+ 'then unless until loop of by when and or is isnt not',
+ literal:
+ // JS literals
+ 'true false null undefined ' +
+ // Coffee literals
+ 'yes no on off ',
+ reserved: 'case default function var void with const let enum export import native ' +
+ '__hasProp __extends __slice __bind __indexOf'
+ };
+
+ var JS_IDENT_RE = '[A-Za-z$_][0-9A-Za-z$_]*';
+
+ var COFFEE_QUOTE_STRING_SUBST_MODE = {
+ className: 'subst',
+ begin: '#\\{', end: '}',
+ keywords: keywords,
+ contains: [hljs.C_NUMBER_MODE, hljs.BINARY_NUMBER_MODE]
+ };
+
+ var COFFEE_QUOTE_STRING_MODE = {
+ className: 'string',
+ begin: '"', end: '"',
+ relevance: 0,
+ contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
+ };
+
+ var COFFEE_HEREDOC_MODE = {
+ className: 'string',
+ begin: '"""', end: '"""',
+ contains: [hljs.BACKSLASH_ESCAPE, COFFEE_QUOTE_STRING_SUBST_MODE]
+ };
+
+ var COFFEE_HERECOMMENT_MODE = {
+ className: 'comment',
+ begin: '###', end: '###'
+ };
+
+ var COFFEE_HEREGEX_MODE = {
+ className: 'regexp',
+ begin: '///', end: '///',
+ contains: [hljs.HASH_COMMENT_MODE]
+ };
+
+ var COFFEE_FUNCTION_DECLARATION_MODE = {
+ className: 'function',
+ begin: JS_IDENT_RE + '\\s*=\\s*(\\(.+\\))?\\s*[-=]>',
+ returnBegin: true,
+ contains: [
+ {
+ className: 'title',
+ begin: JS_IDENT_RE
+ },
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)'
+ }
+ ]
+ };
+
+ var COFFEE_EMBEDDED_JAVASCRIPT = {
+ begin: '`', end: '`',
+ excludeBegin: true, excludeEnd: true,
+ subLanguage: 'javascript'
+ };
+
+ return {
+ defaultMode: {
+ keywords: keywords,
+ contains: [
+ // Numbers
+ hljs.C_NUMBER_MODE,
+ hljs.BINARY_NUMBER_MODE,
+ // Strings
+ hljs.APOS_STRING_MODE,
+ COFFEE_HEREDOC_MODE, // Should be before COFFEE_QUOTE_STRING_MODE for greater priority
+ COFFEE_QUOTE_STRING_MODE,
+ // Comments
+ COFFEE_HERECOMMENT_MODE, // Should be before hljs.HASH_COMMENT_MODE for greater priority
+ hljs.HASH_COMMENT_MODE,
+ // CoffeeScript specific modes
+ COFFEE_HEREGEX_MODE,
+ COFFEE_EMBEDDED_JAVASCRIPT,
+ COFFEE_FUNCTION_DECLARATION_MODE
+ ]
+ }
+ };
+}();
+/*
+Language: ActionScript
+Author: Alexander Myadzel
+*/
+
+hljs.LANGUAGES.actionscript = function() {
+ var IDENT_RE = '[a-zA-Z_$][a-zA-Z0-9_$]*';
+ var IDENT_FUNC_RETURN_TYPE_RE = '([*]|[a-zA-Z_$][a-zA-Z0-9_$]*)';
+
+ var AS3_REST_ARG_MODE = {
+ className: 'rest_arg',
+ begin: '[.]{3}', end: IDENT_RE,
+ relevance: 10
+ };
+ var TITLE_MODE = {className: 'title', begin: IDENT_RE};
+
+ return {
+ defaultMode: {
+ keywords: {
+ keyword: 'as break case catch class const continue default delete do dynamic each ' +
+ 'else extends final finally for function get if implements import in include ' +
+ 'instanceof interface internal is namespace native new override package private ' +
+ 'protected public return set static super switch this throw try typeof use var void ' +
+ 'while with',
+ literal: 'true false null undefined'
+ },
+ contains: [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'package',
+ beginWithKeyword: true, end: '{',
+ keywords: 'package',
+ contains: [TITLE_MODE]
+ },
+ {
+ className: 'class',
+ beginWithKeyword: true, end: '{',
+ keywords: 'class interface',
+ contains: [
+ {
+ beginWithKeyword: true,
+ keywords: 'extends implements'
+ },
+ TITLE_MODE
+ ]
+ },
+ {
+ className: 'preprocessor',
+ beginWithKeyword: true, end: ';',
+ keywords: 'import include'
+ },
+ {
+ className: 'function',
+ beginWithKeyword: true, end: '[{;]',
+ keywords: 'function',
+ illegal: '\\S',
+ contains: [
+ TITLE_MODE,
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ contains: [
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ AS3_REST_ARG_MODE
+ ]
+ },
+ {
+ className: 'type',
+ begin: ':',
+ end: IDENT_FUNC_RETURN_TYPE_RE,
+ relevance: 10
+ }
+ ]
+ }
+ ]
+ }
+ }
+}();
+/*
+Language: VBScript
+Author: Nikita Ledyaev
+Contributors: Michal Gabrukiewicz
+*/
+
+hljs.LANGUAGES.vbscript = {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: {
+ keyword:
+ 'call class const dim do loop erase execute executeglobal exit for each next function ' +
+ 'if then else on error option explicit new private property let get public randomize ' +
+ 'redim rem select case set stop sub while wend with end to elseif is or xor and not ' +
+ 'class_initialize class_terminate default preserve in me byval byref step resume goto',
+ built_in:
+ 'lcase month vartype instrrev ubound setlocale getobject rgb getref string ' +
+ 'weekdayname rnd dateadd monthname now day minute isarray cbool round formatcurrency ' +
+ 'conversions csng timevalue second year space abs clng timeserial fixs len asc ' +
+ 'isempty maths dateserial atn timer isobject filter weekday datevalue ccur isdate ' +
+ 'instr datediff formatdatetime replace isnull right sgn array snumeric log cdbl hex ' +
+ 'chr lbound msgbox ucase getlocale cos cdate cbyte rtrim join hour oct typename trim ' +
+ 'strcomp int createobject loadpicture tan formatnumber mid scriptenginebuildversion ' +
+ 'scriptengine split scriptengineminorversion cint sin datepart ltrim sqr ' +
+ 'scriptenginemajorversion time derived eval date formatpercent exp inputbox left ascw ' +
+ 'chrw regexp server response request cstr err',
+ literal:
+ 'true false null nothing empty'
+ },
+ illegal: '//',
+ contains: [
+ { // can’t use standard QUOTE_STRING_MODE since it’s compiled with its own escape and doesn’t use the local one
+ className: 'string',
+ begin: '"', end: '"',
+ illegal: '\\n',
+ contains: [{begin: '""'}],
+ relevance: 0
+ },
+ {
+ className: 'comment',
+ begin: '\'', end: '$'
+ },
+ hljs.C_NUMBER_MODE
+ ]
+ }
+};
+/*
+ Language: HTTP
+ Description: HTTP request and response headers with automatic body highlighting
+ Author: Ivan Sagalaev
+*/
+
+hljs.LANGUAGES.http = {
+ defaultMode: {
+ illegal: '\\S',
+ contains: [
+ {
+ className: 'status',
+ begin: '^HTTP/[0-9\\.]+', end: '$',
+ contains: [{className: 'number', begin: '\\b\\d{3}\\b'}]
+ },
+ {
+ className: 'request',
+ begin: '^[A-Z]+ (.*?) HTTP/[0-9\\.]+$', returnBegin: true, end: '$',
+ contains: [
+ {
+ className: 'string',
+ begin: ' ', end: ' ',
+ excludeBegin: true, excludeEnd: true
+ }
+ ]
+ },
+ {
+ className: 'attribute',
+ begin: '^\\w', end: ': ', excludeEnd: true,
+ illegal: '\\n',
+ starts: {className: 'string', end: '$'}
+ },
+ {
+ begin: '\\n\\n',
+ starts: {subLanguage: '', endsWithParent: true}
+ }
+ ]
+ }
+}
+/*
+Language: Lua
+Author: Andrew Fedorov
+*/
+
+hljs.LANGUAGES.lua = function() {
+ var OPENING_LONG_BRACKET = '\\[=*\\[';
+ var CLOSING_LONG_BRACKET = '\\]=*\\]';
+ var LONG_BRACKETS = {
+ begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
+ contains: ['self']
+ };
+ var COMMENTS = [
+ {
+ className: 'comment',
+ begin: '--(?!' + OPENING_LONG_BRACKET + ')', end: '$'
+ },
+ {
+ className: 'comment',
+ begin: '--' + OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
+ contains: [LONG_BRACKETS],
+ relevance: 10
+ }
+ ]
+ return {
+ defaultMode: {
+ lexems: hljs.UNDERSCORE_IDENT_RE,
+ keywords: {
+ keyword:
+ 'and break do else elseif end false for if in local nil not or repeat return then ' +
+ 'true until while',
+ built_in:
+ '_G _VERSION assert collectgarbage dofile error getfenv getmetatable ipairs load ' +
+ 'loadfile loadstring module next pairs pcall print rawequal rawget rawset require ' +
+ 'select setfenv setmetatable tonumber tostring type unpack xpcall coroutine debug ' +
+ 'io math os package string table'
+ },
+ contains: COMMENTS.concat([
+ {
+ className: 'function',
+ beginWithKeyword: true, end: '\\)',
+ keywords: 'function',
+ contains: [
+ {
+ className: 'title',
+ begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*'
+ },
+ {
+ className: 'params',
+ begin: '\\(', endsWithParent: true,
+ contains: COMMENTS
+ }
+ ].concat(COMMENTS)
+ },
+ hljs.C_NUMBER_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'string',
+ begin: OPENING_LONG_BRACKET, end: CLOSING_LONG_BRACKET,
+ contains: [LONG_BRACKETS],
+ relevance: 10
+ }
+ ])
+ }
+ };
+}();
+/*
+Language: Delphi
+*/
+
+hljs.LANGUAGES.delphi = function(){
+ var DELPHI_KEYWORDS = 'and safecall cdecl then string exports library not pascal set ' +
+ 'virtual file in array label packed end. index while const raise for to implementation ' +
+ 'with except overload destructor downto finally program exit unit inherited override if ' +
+ 'type until function do begin repeat goto nil far initialization object else var uses ' +
+ 'external resourcestring interface end finalization class asm mod case on shr shl of ' +
+ 'register xorwrite threadvar try record near stored constructor stdcall inline div out or ' +
+ 'procedure';
+ var DELPHI_CLASS_KEYWORDS = 'safecall stdcall pascal stored const implementation ' +
+ 'finalization except to finally program inherited override then exports string read not ' +
+ 'mod shr try div shl set library message packed index for near overload label downto exit ' +
+ 'public goto interface asm on of constructor or private array unit raise destructor var ' +
+ 'type until function else external with case default record while protected property ' +
+ 'procedure published and cdecl do threadvar file in if end virtual write far out begin ' +
+ 'repeat nil initialization object uses resourcestring class register xorwrite inline static';
+ var CURLY_COMMENT = {
+ className: 'comment',
+ begin: '{', end: '}',
+ relevance: 0
+ };
+ var PAREN_COMMENT = {
+ className: 'comment',
+ begin: '\\(\\*', end: '\\*\\)',
+ relevance: 10
+ };
+ var STRING = {
+ className: 'string',
+ begin: '\'', end: '\'',
+ contains: [{begin: '\'\''}],
+ relevance: 0
+ };
+ var CHAR_STRING = {
+ className: 'string', begin: '(#\\d+)+'
+ };
+ var FUNCTION = {
+ className: 'function',
+ beginWithKeyword: true, end: '[:;]',
+ keywords: 'function constructor|10 destructor|10 procedure|10',
+ contains: [
+ {
+ className: 'title', begin: hljs.IDENT_RE
+ },
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ keywords: DELPHI_KEYWORDS,
+ contains: [STRING, CHAR_STRING]
+ },
+ CURLY_COMMENT, PAREN_COMMENT
+ ]
+ };
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: DELPHI_KEYWORDS,
+ illegal: '("|\\$[G-Zg-z]|\\/\\*|)',
+ contains: [
+ CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
+ STRING, CHAR_STRING,
+ hljs.NUMBER_MODE,
+ FUNCTION,
+ {
+ className: 'class',
+ begin: '=\\bclass\\b', end: 'end;',
+ keywords: DELPHI_CLASS_KEYWORDS,
+ contains: [
+ STRING, CHAR_STRING,
+ CURLY_COMMENT, PAREN_COMMENT, hljs.C_LINE_COMMENT_MODE,
+ FUNCTION
+ ]
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Java
+Author: Vsevolod Solovyov
+*/
+
+hljs.LANGUAGES.java = {
+ defaultMode: {
+ keywords:
+ 'false synchronized int abstract float private char boolean static null if const ' +
+ 'for true while long throw strictfp finally protected import native final return void ' +
+ 'enum else break transient new catch instanceof byte super volatile case assert short ' +
+ 'package default double public try this switch continue throws',
+ contains: [
+ {
+ className: 'javadoc',
+ begin: '/\\*\\*', end: '\\*/',
+ contains: [{
+ className: 'javadoctag', begin: '@[A-Za-z]+'
+ }],
+ relevance: 10
+ },
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'class',
+ beginWithKeyword: true, end: '{',
+ keywords: 'class interface',
+ illegal: ':',
+ contains: [
+ {
+ beginWithKeyword: true,
+ keywords: 'extends implements',
+ relevance: 10
+ },
+ {
+ className: 'title',
+ begin: hljs.UNDERSCORE_IDENT_RE
+ }
+ ]
+ },
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'annotation', begin: '@[A-Za-z]+'
+ }
+ ]
+ }
+};
+/*
+Language: C++
+Contributors: Evgeny Stepanischev
+*/
+
+hljs.LANGUAGES.cpp = function(){
+ var CPP_KEYWORDS = {
+ keyword: 'false int float while private char catch export virtual operator sizeof ' +
+ 'dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace ' +
+ 'unsigned long throw volatile static protected bool template mutable if public friend ' +
+ 'do return goto auto void enum else break new extern using true class asm case typeid ' +
+ 'short reinterpret_cast|10 default double register explicit signed typename try this ' +
+ 'switch continue wchar_t inline delete alignof char16_t char32_t constexpr decltype ' +
+ 'noexcept nullptr static_assert thread_local restrict _Bool complex',
+ built_in: 'std string cin cout cerr clog stringstream istringstream ostringstream ' +
+ 'auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set ' +
+ 'unordered_map unordered_multiset unordered_multimap array shared_ptr'
+ };
+ return {
+ defaultMode: {
+ keywords: CPP_KEYWORDS,
+ illegal: '',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'string',
+ begin: '\'\\\\?.', end: '\'',
+ illegal: '.'
+ },
+ {
+ className: 'number',
+ begin: '\\b(\\d+(\\.\\d*)?|\\.\\d+)(u|U|l|L|ul|UL|f|F)'
+ },
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'preprocessor',
+ begin: '#', end: '$'
+ },
+ {
+ className: 'stl_container',
+ begin: '\\b(deque|list|queue|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array)\\s*<', end: '>',
+ keywords: CPP_KEYWORDS,
+ relevance: 10,
+ contains: ['self']
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Objective C
+Author: Valerii Hiora
+Contributors: Angel G. Olloqui
+*/
+
+hljs.LANGUAGES.objectivec = function(){
+ var OBJC_KEYWORDS = {
+ keyword:
+ 'int float while private char catch export sizeof typedef const struct for union ' +
+ 'unsigned long volatile static protected bool mutable if public do return goto void ' +
+ 'enum else break extern class asm case short default double throw register explicit ' +
+ 'signed typename try this switch continue wchar_t inline readonly assign property ' +
+ 'protocol self synchronized end synthesize id optional required implementation ' +
+ 'nonatomic interface super unichar finally dynamic IBOutlet IBAction selector strong ' +
+ 'weak readonly',
+ literal:
+ 'false true FALSE TRUE nil YES NO NULL',
+ built_in:
+ 'NSString NSDictionary CGRect CGPoint UIButton UILabel UITextView UIWebView MKMapView ' +
+ 'UISegmentedControl NSObject UITableViewDelegate UITableViewDataSource NSThread ' +
+ 'UIActivityIndicator UITabbar UIToolBar UIBarButtonItem UIImageView NSAutoreleasePool ' +
+ 'UITableView BOOL NSInteger CGFloat NSException NSLog NSMutableString NSMutableArray ' +
+ 'NSMutableDictionary NSURL NSIndexPath CGSize UITableViewCell UIView UIViewController ' +
+ 'UINavigationBar UINavigationController UITabBarController UIPopoverController ' +
+ 'UIPopoverControllerDelegate UIImage NSNumber UISearchBar NSFetchedResultsController ' +
+ 'NSFetchedResultsChangeType UIScrollView UIScrollViewDelegate UIEdgeInsets UIColor ' +
+ 'UIFont UIApplication NSNotFound NSNotificationCenter NSNotification ' +
+ 'UILocalNotification NSBundle NSFileManager NSTimeInterval NSDate NSCalendar ' +
+ 'NSUserDefaults UIWindow NSRange NSArray NSError NSURLRequest NSURLConnection class ' +
+ 'UIInterfaceOrientation MPMoviePlayerController dispatch_once_t ' +
+ 'dispatch_queue_t dispatch_sync dispatch_async dispatch_once'
+ };
+ return {
+ defaultMode: {
+ keywords: OBJC_KEYWORDS,
+ illegal: '',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.C_NUMBER_MODE,
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'string',
+ begin: '\'',
+ end: '[^\\\\]\'',
+ illegal: '[^\\\\][^\']'
+ },
+
+ {
+ className: 'preprocessor',
+ begin: '#import',
+ end: '$',
+ contains: [
+ {
+ className: 'title',
+ begin: '\"',
+ end: '\"'
+ },
+ {
+ className: 'title',
+ begin: '<',
+ end: '>'
+ }
+ ]
+ },
+ {
+ className: 'preprocessor',
+ begin: '#',
+ end: '$'
+ },
+ {
+ className: 'class',
+ beginWithKeyword: true,
+ end: '({|$)',
+ keywords: 'interface class protocol implementation',
+ contains: [{
+ className: 'id',
+ begin: hljs.UNDERSCORE_IDENT_RE
+ }
+ ]
+ },
+ {
+ className: 'variable',
+ begin: '\\.'+hljs.UNDERSCORE_IDENT_RE
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Vala
+Author: Antono Vasiljev
+Description: Vala is a new programming language that aims to bring modern programming language features to GNOME developers without imposing any additional runtime requirements and without using a different ABI compared to applications and libraries written in C.
+*/
+
+hljs.LANGUAGES.vala = {
+ defaultMode: {
+ keywords: {
+ keyword:
+ // Value types
+ 'char uchar unichar int uint long ulong short ushort int8 int16 int32 int64 uint8 ' +
+ 'uint16 uint32 uint64 float double bool struct enum string void ' +
+ // Reference types
+ 'weak unowned owned ' +
+ // Modifiers
+ 'async signal static abstract interface override ' +
+ // Control Structures
+ 'while do for foreach else switch case break default return try catch ' +
+ // Visibility
+ 'public private protected internal ' +
+ // Other
+ 'using new this get set const stdout stdin stderr var',
+ built_in:
+ 'DBus GLib CCode Gee Object',
+ literal:
+ 'false true null'
+ },
+ contains: [
+ {
+ className: 'class',
+ beginWithKeyword: true, end: '{',
+ keywords: 'class interface delegate namespace',
+ contains: [
+ {
+ beginWithKeyword: true,
+ keywords: 'extends implements'
+ },
+ {
+ className: 'title',
+ begin: hljs.UNDERSCORE_IDENT_RE
+ }
+ ]
+ },
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'string',
+ begin: '"""', end: '"""',
+ relevance: 5
+ },
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'preprocessor',
+ begin: '^#', end: '$',
+ relevance: 2
+ },
+ {
+ className: 'constant',
+ begin: ' [A-Z_]+ ',
+ relevance: 0
+ }
+ ]
+ }
+};
+/*
+Language: C#
+Author: Jason Diamond
+*/
+
+hljs.LANGUAGES.cs = {
+ defaultMode: {
+ keywords:
+ // Normal keywords.
+ 'abstract as base bool break byte case catch char checked class const continue decimal ' +
+ 'default delegate do double else enum event explicit extern false finally fixed float ' +
+ 'for foreach goto if implicit in int interface internal is lock long namespace new null ' +
+ 'object operator out override params private protected public readonly ref return sbyte ' +
+ 'sealed short sizeof stackalloc static string struct switch this throw true try typeof ' +
+ 'uint ulong unchecked unsafe ushort using virtual volatile void while ' +
+ // Contextual keywords.
+ 'ascending descending from get group into join let orderby partial select set value var '+
+ 'where yield',
+ contains: [
+ {
+ className: 'comment',
+ begin: '///', end: '$', returnBegin: true,
+ contains: [
+ {
+ className: 'xmlDocTag',
+ begin: '///|'
+ },
+ {
+ className: 'xmlDocTag',
+ begin: '?', end: '>'
+ }
+ ]
+ },
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'preprocessor',
+ begin: '#', end: '$',
+ keywords: 'if else elif endif define undef warning error line region endregion pragma checksum'
+ },
+ {
+ className: 'string',
+ begin: '@"', end: '"',
+ contains: [{begin: '""'}]
+ },
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_NUMBER_MODE
+ ]
+ }
+};
+/*
+Language: D
+Author: Aleksandar Ruzicic
+Description: D is a language with C-like syntax and static typing. It pragmatically combines efficiency, control, and modeling power, with safety and programmer productivity.
+Version: 1.0a
+Date: 2012-04-08
+*/
+
+/**
+ * Known issues:
+ *
+ * - invalid hex string literals will be recognized as a double quoted strings
+ * but 'x' at the beginning of string will not be matched
+ *
+ * - delimited string literals are not checked for matching end delimiter
+ * (not possible to do with js regexp)
+ *
+ * - content of token string is colored as a string (i.e. no keyword coloring inside a token string)
+ * also, content of token string is not validated to contain only valid D tokens
+ *
+ * - special token sequence rule is not strictly following D grammar (anything following #line
+ * up to the end of line is matched as special token sequence)
+ */
+
+hljs.LANGUAGES.d = function() {
+
+ /**
+ * Language keywords
+ *
+ * @type {Object}
+ */
+ var D_KEYWORDS = {
+ keyword:
+ 'abstract alias align asm assert auto body break byte case cast catch class ' +
+ 'const continue debug default delete deprecated do else enum export extern final ' +
+ 'finally for foreach foreach_reverse|10 goto if immutable import in inout int ' +
+ 'interface invariant is lazy macro mixin module new nothrow out override package ' +
+ 'pragma private protected public pure ref return scope shared static struct ' +
+ 'super switch synchronized template this throw try typedef typeid typeof union ' +
+ 'unittest version void volatile while with __FILE__ __LINE__ __gshared|10 ' +
+ '__thread __traits __DATE__ __EOF__ __TIME__ __TIMESTAMP__ __VENDOR__ __VERSION__',
+ built_in:
+ 'bool cdouble cent cfloat char creal dchar delegate double dstring float function ' +
+ 'idouble ifloat ireal long real short string ubyte ucent uint ulong ushort wchar ' +
+ 'wstring',
+ literal:
+ 'false null true'
+ };
+
+ /**
+ * Number literal regexps
+ *
+ * @type {String}
+ */
+ var decimal_integer_re = '(0|[1-9][\\d_]*)',
+ decimal_integer_nosus_re = '(0|[1-9][\\d_]*|\\d[\\d_]*|[\\d_]+?\\d)',
+ binary_integer_re = '0[bB][01_]+',
+ hexadecimal_digits_re = '([\\da-fA-F][\\da-fA-F_]*|_[\\da-fA-F][\\da-fA-F_]*)',
+ hexadecimal_integer_re = '0[xX]' + hexadecimal_digits_re,
+
+ decimal_exponent_re = '([eE][+-]?' + decimal_integer_nosus_re + ')',
+ decimal_float_re = '(' + decimal_integer_nosus_re + '(\\.\\d*|' + decimal_exponent_re + ')|' +
+ '\\d+\\.' + decimal_integer_nosus_re + decimal_integer_nosus_re + '|' +
+ '\\.' + decimal_integer_re + decimal_exponent_re + '?' +
+ ')',
+ hexadecimal_float_re = '(0[xX](' +
+ hexadecimal_digits_re + '\\.' + hexadecimal_digits_re + '|'+
+ '\\.?' + hexadecimal_digits_re +
+ ')[pP][+-]?' + decimal_integer_nosus_re + ')';
+
+ integer_re = '(' +
+ decimal_integer_re + '|' +
+ binary_integer_re + '|' +
+ hexadecimal_integer_re +
+ ')',
+
+ float_re = '(' +
+ hexadecimal_float_re + '|' +
+ decimal_float_re +
+ ')';
+
+ /**
+ * Escape sequence supported in D string and character literals
+ *
+ * @type {String}
+ */
+ var escape_sequence_re = '\\\\(' +
+ '[\'"\\?\\\\abfnrtv]|' + // common escapes
+ 'u[\\dA-Fa-f]{4}|' + // four hex digit unicode codepoint
+ '[0-7]{1,3}|' + // one to three octal digit ascii char code
+ 'x[\\dA-Fa-f]{2}|' + // two hex digit ascii char code
+ 'U[\\dA-Fa-f]{8}' + // eight hex digit unicode codepoint
+ ')|' +
+ '&[a-zA-Z\\d]{2,};'; // named character entity
+
+
+ /**
+ * D integer number literals
+ *
+ * @type {Object}
+ */
+ var D_INTEGER_MODE = {
+ className: 'number',
+ begin: '\\b' + integer_re + '(L|u|U|Lu|LU|uL|UL)?',
+ relevance: 0
+ };
+
+ /**
+ * [D_FLOAT_MODE description]
+ * @type {Object}
+ */
+ var D_FLOAT_MODE = {
+ className: 'number',
+ begin: '\\b(' +
+ float_re + '([fF]|L|i|[fF]i|Li)?|' +
+ integer_re + '(i|[fF]i|Li)' +
+ ')',
+ relevance: 0
+ };
+
+ /**
+ * D character literal
+ *
+ * @type {Object}
+ */
+ var D_CHARACTER_MODE = {
+ className: 'string',
+ begin: '\'(' + escape_sequence_re + '|.)', end: '\'',
+ illegal: '.'
+ };
+
+ /**
+ * D string escape sequence
+ *
+ * @type {Object}
+ */
+ var D_ESCAPE_SEQUENCE = {
+ begin: escape_sequence_re,
+ relevance: 0
+ }
+
+ /**
+ * D double quoted string literal
+ *
+ * @type {Object}
+ */
+ var D_STRING_MODE = {
+ className: 'string',
+ begin: '"',
+ contains: [D_ESCAPE_SEQUENCE],
+ end: '"[cwd]?',
+ relevance: 0
+ };
+
+ /**
+ * D wysiwyg and delimited string literals
+ *
+ * @type {Object}
+ */
+ var D_WYSIWYG_DELIMITED_STRING_MODE = {
+ className: 'string',
+ begin: '[rq]"',
+ end: '"[cwd]?',
+ relevance: 5
+ };
+
+ /**
+ * D alternate wysiwyg string literal
+ *
+ * @type {Object}
+ */
+ var D_ALTERNATE_WYSIWYG_STRING_MODE = {
+ className: 'string',
+ begin: '`',
+ end: '`[cwd]?'
+ };
+
+ /**
+ * D hexadecimal string literal
+ *
+ * @type {Object}
+ */
+ var D_HEX_STRING_MODE = {
+ className: 'string',
+ begin: 'x"[\\da-fA-F\\s\\n\\r]*"[cwd]?',
+ relevance: 10
+ };
+
+ /**
+ * D delimited string literal
+ *
+ * @type {Object}
+ */
+ var D_TOKEN_STRING_MODE = {
+ className: 'string',
+ begin: 'q"\\{',
+ end: '\\}"'
+ };
+
+ /**
+ * Hashbang support
+ *
+ * @type {Object}
+ */
+ var D_HASHBANG_MODE = {
+ className: 'shebang',
+ begin: '^#!',
+ end: '$',
+ relevance: 5
+ };
+
+ /**
+ * D special token sequence
+ *
+ * @type {Object}
+ */
+ var D_SPECIAL_TOKEN_SEQUENCE_MODE = {
+ className: 'preprocessor',
+ begin: '#(line)',
+ end: '$',
+ relevance: 5
+ };
+
+ /**
+ * D attributes
+ *
+ * @type {Object}
+ */
+ var D_ATTRIBUTE_MODE = {
+ className: 'keyword',
+ begin: '@[a-zA-Z_][a-zA-Z_\\d]*'
+ };
+
+ /**
+ * D nesting comment
+ *
+ * @type {Object}
+ */
+ var D_NESTING_COMMENT_MODE = {
+ className: 'comment',
+ begin: '\\/\\+',
+ contains: ['self'],
+ end: '\\+\\/',
+ relevance: 10
+ }
+
+ return {
+ defaultMode: {
+ lexems: hljs.UNDERSCORE_IDENT_RE,
+ keywords: D_KEYWORDS,
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ D_NESTING_COMMENT_MODE,
+ D_HEX_STRING_MODE,
+ D_STRING_MODE,
+ D_WYSIWYG_DELIMITED_STRING_MODE,
+ D_ALTERNATE_WYSIWYG_STRING_MODE,
+ D_TOKEN_STRING_MODE,
+ D_FLOAT_MODE,
+ D_INTEGER_MODE,
+ D_CHARACTER_MODE,
+ D_HASHBANG_MODE,
+ D_SPECIAL_TOKEN_SEQUENCE_MODE,
+ D_ATTRIBUTE_MODE
+ ]
+ }
+ };
+}();
+/*
+Language: RenderMan RSL
+Description: RenderMan RSL Language
+Author: Konstantin Evdokimenko
+Contributors: Shuen-Huei Guan
+*/
+
+hljs.LANGUAGES.rsl = {
+ defaultMode: {
+ keywords: {
+ 'keyword':
+ 'float color point normal vector matrix while for if do return else break extern continue',
+ 'built_in':
+ 'abs acos ambient area asin atan atmosphere attribute calculatenormal ceil cellnoise ' +
+ 'clamp comp concat cos degrees depth Deriv diffuse distance Du Dv environment exp ' +
+ 'faceforward filterstep floor format fresnel incident length lightsource log match ' +
+ 'max min mod noise normalize ntransform opposite option phong pnoise pow printf ' +
+ 'ptlined radians random reflect refract renderinfo round setcomp setxcomp setycomp ' +
+ 'setzcomp shadow sign sin smoothstep specular specularbrdf spline sqrt step tan ' +
+ 'texture textureinfo trace transform vtransform xcomp ycomp zcomp'
+ },
+ illegal: '',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'preprocessor',
+ begin: '#', end: '$'
+ },
+ {
+ className: 'shader',
+ beginWithKeyword: true, end: '\\(',
+ keywords: 'surface displacement light volume imager'
+ },
+ {
+ className: 'shading',
+ beginWithKeyword: true, end: '\\(',
+ keywords: 'illuminate illuminance gather'
+ }
+ ]
+ }
+};
+/*
+Language: RenderMan RIB
+Description: RenderMan RIB Language
+Author: Konstantin Evdokimenko
+Contributors: Shuen-Huei Guan
+*/
+
+hljs.LANGUAGES.rib = {
+ defaultMode: {
+ keywords:
+ 'ArchiveRecord AreaLightSource Atmosphere Attribute AttributeBegin AttributeEnd Basis ' +
+ 'Begin Blobby Bound Clipping ClippingPlane Color ColorSamples ConcatTransform Cone ' +
+ 'CoordinateSystem CoordSysTransform CropWindow Curves Cylinder DepthOfField Detail ' +
+ 'DetailRange Disk Displacement Display End ErrorHandler Exposure Exterior Format ' +
+ 'FrameAspectRatio FrameBegin FrameEnd GeneralPolygon GeometricApproximation Geometry ' +
+ 'Hider Hyperboloid Identity Illuminate Imager Interior LightSource ' +
+ 'MakeCubeFaceEnvironment MakeLatLongEnvironment MakeShadow MakeTexture Matte ' +
+ 'MotionBegin MotionEnd NuPatch ObjectBegin ObjectEnd ObjectInstance Opacity Option ' +
+ 'Orientation Paraboloid Patch PatchMesh Perspective PixelFilter PixelSamples ' +
+ 'PixelVariance Points PointsGeneralPolygons PointsPolygons Polygon Procedural Projection ' +
+ 'Quantize ReadArchive RelativeDetail ReverseOrientation Rotate Scale ScreenWindow ' +
+ 'ShadingInterpolation ShadingRate Shutter Sides Skew SolidBegin SolidEnd Sphere ' +
+ 'SubdivisionMesh Surface TextureCoordinates Torus Transform TransformBegin TransformEnd ' +
+ 'TransformPoints Translate TrimCurve WorldBegin WorldEnd',
+ illegal: '',
+ contains: [
+ hljs.HASH_COMMENT_MODE,
+ hljs.C_NUMBER_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE
+ ]
+ }
+};
+
+/*
+Language: MEL
+Description: Maya Embedded Language
+Author: Shuen-Huei Guan
+*/
+
+hljs.LANGUAGES.mel = {
+ defaultMode: {
+ keywords:
+ 'int float string vector matrix if else switch case default while do for in break ' +
+ 'continue global proc return about abs addAttr addAttributeEditorNodeHelp addDynamic ' +
+ 'addNewShelfTab addPP addPanelCategory addPrefixToName advanceToNextDrivenKey ' +
+ 'affectedNet affects aimConstraint air alias aliasAttr align alignCtx alignCurve ' +
+ 'alignSurface allViewFit ambientLight angle angleBetween animCone animCurveEditor ' +
+ 'animDisplay animView annotate appendStringArray applicationName applyAttrPreset ' +
+ 'applyTake arcLenDimContext arcLengthDimension arclen arrayMapper art3dPaintCtx ' +
+ 'artAttrCtx artAttrPaintVertexCtx artAttrSkinPaintCtx artAttrTool artBuildPaintMenu ' +
+ 'artFluidAttrCtx artPuttyCtx artSelectCtx artSetPaintCtx artUserPaintCtx assignCommand ' +
+ 'assignInputDevice assignViewportFactories attachCurve attachDeviceAttr attachSurface ' +
+ 'attrColorSliderGrp attrCompatibility attrControlGrp attrEnumOptionMenu ' +
+ 'attrEnumOptionMenuGrp attrFieldGrp attrFieldSliderGrp attrNavigationControlGrp ' +
+ 'attrPresetEditWin attributeExists attributeInfo attributeMenu attributeQuery ' +
+ 'autoKeyframe autoPlace bakeClip bakeFluidShading bakePartialHistory bakeResults ' +
+ 'bakeSimulation basename basenameEx batchRender bessel bevel bevelPlus binMembership ' +
+ 'bindSkin blend2 blendShape blendShapeEditor blendShapePanel blendTwoAttr blindDataType ' +
+ 'boneLattice boundary boxDollyCtx boxZoomCtx bufferCurve buildBookmarkMenu ' +
+ 'buildKeyframeMenu button buttonManip CBG cacheFile cacheFileCombine cacheFileMerge ' +
+ 'cacheFileTrack camera cameraView canCreateManip canvas capitalizeString catch ' +
+ 'catchQuiet ceil changeSubdivComponentDisplayLevel changeSubdivRegion channelBox ' +
+ 'character characterMap characterOutlineEditor characterize chdir checkBox checkBoxGrp ' +
+ 'checkDefaultRenderGlobals choice circle circularFillet clamp clear clearCache clip ' +
+ 'clipEditor clipEditorCurrentTimeCtx clipSchedule clipSchedulerOutliner clipTrimBefore ' +
+ 'closeCurve closeSurface cluster cmdFileOutput cmdScrollFieldExecuter ' +
+ 'cmdScrollFieldReporter cmdShell coarsenSubdivSelectionList collision color ' +
+ 'colorAtPoint colorEditor colorIndex colorIndexSliderGrp colorSliderButtonGrp ' +
+ 'colorSliderGrp columnLayout commandEcho commandLine commandPort compactHairSystem ' +
+ 'componentEditor compositingInterop computePolysetVolume condition cone confirmDialog ' +
+ 'connectAttr connectControl connectDynamic connectJoint connectionInfo constrain ' +
+ 'constrainValue constructionHistory container containsMultibyte contextInfo control ' +
+ 'convertFromOldLayers convertIffToPsd convertLightmap convertSolidTx convertTessellation ' +
+ 'convertUnit copyArray copyFlexor copyKey copySkinWeights cos cpButton cpCache ' +
+ 'cpClothSet cpCollision cpConstraint cpConvClothToMesh cpForces cpGetSolverAttr cpPanel ' +
+ 'cpProperty cpRigidCollisionFilter cpSeam cpSetEdit cpSetSolverAttr cpSolver ' +
+ 'cpSolverTypes cpTool cpUpdateClothUVs createDisplayLayer createDrawCtx createEditor ' +
+ 'createLayeredPsdFile createMotionField createNewShelf createNode createRenderLayer ' +
+ 'createSubdivRegion cross crossProduct ctxAbort ctxCompletion ctxEditMode ctxTraverse ' +
+ 'currentCtx currentTime currentTimeCtx currentUnit currentUnit curve curveAddPtCtx ' +
+ 'curveCVCtx curveEPCtx curveEditorCtx curveIntersect curveMoveEPCtx curveOnSurface ' +
+ 'curveSketchCtx cutKey cycleCheck cylinder dagPose date defaultLightListCheckBox ' +
+ 'defaultNavigation defineDataServer defineVirtualDevice deformer deg_to_rad delete ' +
+ 'deleteAttr deleteShadingGroupsAndMaterials deleteShelfTab deleteUI deleteUnusedBrushes ' +
+ 'delrandstr detachCurve detachDeviceAttr detachSurface deviceEditor devicePanel dgInfo ' +
+ 'dgdirty dgeval dgtimer dimWhen directKeyCtx directionalLight dirmap dirname disable ' +
+ 'disconnectAttr disconnectJoint diskCache displacementToPoly displayAffected ' +
+ 'displayColor displayCull displayLevelOfDetail displayPref displayRGBColor ' +
+ 'displaySmoothness displayStats displayString displaySurface distanceDimContext ' +
+ 'distanceDimension doBlur dolly dollyCtx dopeSheetEditor dot dotProduct ' +
+ 'doubleProfileBirailSurface drag dragAttrContext draggerContext dropoffLocator ' +
+ 'duplicate duplicateCurve duplicateSurface dynCache dynControl dynExport dynExpression ' +
+ 'dynGlobals dynPaintEditor dynParticleCtx dynPref dynRelEdPanel dynRelEditor ' +
+ 'dynamicLoad editAttrLimits editDisplayLayerGlobals editDisplayLayerMembers ' +
+ 'editRenderLayerAdjustment editRenderLayerGlobals editRenderLayerMembers editor ' +
+ 'editorTemplate effector emit emitter enableDevice encodeString endString endsWith env ' +
+ 'equivalent equivalentTol erf error eval eval evalDeferred evalEcho event ' +
+ 'exactWorldBoundingBox exclusiveLightCheckBox exec executeForEachObject exists exp ' +
+ 'expression expressionEditorListen extendCurve extendSurface extrude fcheck fclose feof ' +
+ 'fflush fgetline fgetword file fileBrowserDialog fileDialog fileExtension fileInfo ' +
+ 'filetest filletCurve filter filterCurve filterExpand filterStudioImport ' +
+ 'findAllIntersections findAnimCurves findKeyframe findMenuItem findRelatedSkinCluster ' +
+ 'finder firstParentOf fitBspline flexor floatEq floatField floatFieldGrp floatScrollBar ' +
+ 'floatSlider floatSlider2 floatSliderButtonGrp floatSliderGrp floor flow fluidCacheInfo ' +
+ 'fluidEmitter fluidVoxelInfo flushUndo fmod fontDialog fopen formLayout format fprint ' +
+ 'frameLayout fread freeFormFillet frewind fromNativePath fwrite gamma gauss ' +
+ 'geometryConstraint getApplicationVersionAsFloat getAttr getClassification ' +
+ 'getDefaultBrush getFileList getFluidAttr getInputDeviceRange getMayaPanelTypes ' +
+ 'getModifiers getPanel getParticleAttr getPluginResource getenv getpid glRender ' +
+ 'glRenderEditor globalStitch gmatch goal gotoBindPose grabColor gradientControl ' +
+ 'gradientControlNoAttr graphDollyCtx graphSelectContext graphTrackCtx gravity grid ' +
+ 'gridLayout group groupObjectsByName HfAddAttractorToAS HfAssignAS HfBuildEqualMap ' +
+ 'HfBuildFurFiles HfBuildFurImages HfCancelAFR HfConnectASToHF HfCreateAttractor ' +
+ 'HfDeleteAS HfEditAS HfPerformCreateAS HfRemoveAttractorFromAS HfSelectAttached ' +
+ 'HfSelectAttractors HfUnAssignAS hardenPointCurve hardware hardwareRenderPanel ' +
+ 'headsUpDisplay headsUpMessage help helpLine hermite hide hilite hitTest hotBox hotkey ' +
+ 'hotkeyCheck hsv_to_rgb hudButton hudSlider hudSliderButton hwReflectionMap hwRender ' +
+ 'hwRenderLoad hyperGraph hyperPanel hyperShade hypot iconTextButton iconTextCheckBox ' +
+ 'iconTextRadioButton iconTextRadioCollection iconTextScrollList iconTextStaticLabel ' +
+ 'ikHandle ikHandleCtx ikHandleDisplayScale ikSolver ikSplineHandleCtx ikSystem ' +
+ 'ikSystemInfo ikfkDisplayMethod illustratorCurves image imfPlugins inheritTransform ' +
+ 'insertJoint insertJointCtx insertKeyCtx insertKnotCurve insertKnotSurface instance ' +
+ 'instanceable instancer intField intFieldGrp intScrollBar intSlider intSliderGrp ' +
+ 'interToUI internalVar intersect iprEngine isAnimCurve isConnected isDirty isParentOf ' +
+ 'isSameObject isTrue isValidObjectName isValidString isValidUiName isolateSelect ' +
+ 'itemFilter itemFilterAttr itemFilterRender itemFilterType joint jointCluster jointCtx ' +
+ 'jointDisplayScale jointLattice keyTangent keyframe keyframeOutliner ' +
+ 'keyframeRegionCurrentTimeCtx keyframeRegionDirectKeyCtx keyframeRegionDollyCtx ' +
+ 'keyframeRegionInsertKeyCtx keyframeRegionMoveKeyCtx keyframeRegionScaleKeyCtx ' +
+ 'keyframeRegionSelectKeyCtx keyframeRegionSetKeyCtx keyframeRegionTrackCtx ' +
+ 'keyframeStats lassoContext lattice latticeDeformKeyCtx launch launchImageEditor ' +
+ 'layerButton layeredShaderPort layeredTexturePort layout layoutDialog lightList ' +
+ 'lightListEditor lightListPanel lightlink lineIntersection linearPrecision linstep ' +
+ 'listAnimatable listAttr listCameras listConnections listDeviceAttachments listHistory ' +
+ 'listInputDeviceAxes listInputDeviceButtons listInputDevices listMenuAnnotation ' +
+ 'listNodeTypes listPanelCategories listRelatives listSets listTransforms ' +
+ 'listUnselected listerEditor loadFluid loadNewShelf loadPlugin ' +
+ 'loadPluginLanguageResources loadPrefObjects localizedPanelLabel lockNode loft log ' +
+ 'longNameOf lookThru ls lsThroughFilter lsType lsUI Mayatomr mag makeIdentity makeLive ' +
+ 'makePaintable makeRoll makeSingleSurface makeTubeOn makebot manipMoveContext ' +
+ 'manipMoveLimitsCtx manipOptions manipRotateContext manipRotateLimitsCtx ' +
+ 'manipScaleContext manipScaleLimitsCtx marker match max memory menu menuBarLayout ' +
+ 'menuEditor menuItem menuItemToShelf menuSet menuSetPref messageLine min minimizeApp ' +
+ 'mirrorJoint modelCurrentTimeCtx modelEditor modelPanel mouse movIn movOut move ' +
+ 'moveIKtoFK moveKeyCtx moveVertexAlongDirection multiProfileBirailSurface mute ' +
+ 'nParticle nameCommand nameField namespace namespaceInfo newPanelItems newton nodeCast ' +
+ 'nodeIconButton nodeOutliner nodePreset nodeType noise nonLinear normalConstraint ' +
+ 'normalize nurbsBoolean nurbsCopyUVSet nurbsCube nurbsEditUV nurbsPlane nurbsSelect ' +
+ 'nurbsSquare nurbsToPoly nurbsToPolygonsPref nurbsToSubdiv nurbsToSubdivPref ' +
+ 'nurbsUVSet nurbsViewDirectionVector objExists objectCenter objectLayer objectType ' +
+ 'objectTypeUI obsoleteProc oceanNurbsPreviewPlane offsetCurve offsetCurveOnSurface ' +
+ 'offsetSurface openGLExtension openMayaPref optionMenu optionMenuGrp optionVar orbit ' +
+ 'orbitCtx orientConstraint outlinerEditor outlinerPanel overrideModifier ' +
+ 'paintEffectsDisplay pairBlend palettePort paneLayout panel panelConfiguration ' +
+ 'panelHistory paramDimContext paramDimension paramLocator parent parentConstraint ' +
+ 'particle particleExists particleInstancer particleRenderInfo partition pasteKey ' +
+ 'pathAnimation pause pclose percent performanceOptions pfxstrokes pickWalk picture ' +
+ 'pixelMove planarSrf plane play playbackOptions playblast plugAttr plugNode pluginInfo ' +
+ 'pluginResourceUtil pointConstraint pointCurveConstraint pointLight pointMatrixMult ' +
+ 'pointOnCurve pointOnSurface pointPosition poleVectorConstraint polyAppend ' +
+ 'polyAppendFacetCtx polyAppendVertex polyAutoProjection polyAverageNormal ' +
+ 'polyAverageVertex polyBevel polyBlendColor polyBlindData polyBoolOp polyBridgeEdge ' +
+ 'polyCacheMonitor polyCheck polyChipOff polyClipboard polyCloseBorder polyCollapseEdge ' +
+ 'polyCollapseFacet polyColorBlindData polyColorDel polyColorPerVertex polyColorSet ' +
+ 'polyCompare polyCone polyCopyUV polyCrease polyCreaseCtx polyCreateFacet ' +
+ 'polyCreateFacetCtx polyCube polyCut polyCutCtx polyCylinder polyCylindricalProjection ' +
+ 'polyDelEdge polyDelFacet polyDelVertex polyDuplicateAndConnect polyDuplicateEdge ' +
+ 'polyEditUV polyEditUVShell polyEvaluate polyExtrudeEdge polyExtrudeFacet ' +
+ 'polyExtrudeVertex polyFlipEdge polyFlipUV polyForceUV polyGeoSampler polyHelix ' +
+ 'polyInfo polyInstallAction polyLayoutUV polyListComponentConversion polyMapCut ' +
+ 'polyMapDel polyMapSew polyMapSewMove polyMergeEdge polyMergeEdgeCtx polyMergeFacet ' +
+ 'polyMergeFacetCtx polyMergeUV polyMergeVertex polyMirrorFace polyMoveEdge ' +
+ 'polyMoveFacet polyMoveFacetUV polyMoveUV polyMoveVertex polyNormal polyNormalPerVertex ' +
+ 'polyNormalizeUV polyOptUvs polyOptions polyOutput polyPipe polyPlanarProjection ' +
+ 'polyPlane polyPlatonicSolid polyPoke polyPrimitive polyPrism polyProjection ' +
+ 'polyPyramid polyQuad polyQueryBlindData polyReduce polySelect polySelectConstraint ' +
+ 'polySelectConstraintMonitor polySelectCtx polySelectEditCtx polySeparate ' +
+ 'polySetToFaceNormal polySewEdge polyShortestPathCtx polySmooth polySoftEdge ' +
+ 'polySphere polySphericalProjection polySplit polySplitCtx polySplitEdge polySplitRing ' +
+ 'polySplitVertex polyStraightenUVBorder polySubdivideEdge polySubdivideFacet ' +
+ 'polyToSubdiv polyTorus polyTransfer polyTriangulate polyUVSet polyUnite polyWedgeFace ' +
+ 'popen popupMenu pose pow preloadRefEd print progressBar progressWindow projFileViewer ' +
+ 'projectCurve projectTangent projectionContext projectionManip promptDialog propModCtx ' +
+ 'propMove psdChannelOutliner psdEditTextureFile psdExport psdTextureFile putenv pwd ' +
+ 'python querySubdiv quit rad_to_deg radial radioButton radioButtonGrp radioCollection ' +
+ 'radioMenuItemCollection rampColorPort rand randomizeFollicles randstate rangeControl ' +
+ 'readTake rebuildCurve rebuildSurface recordAttr recordDevice redo reference ' +
+ 'referenceEdit referenceQuery refineSubdivSelectionList refresh refreshAE ' +
+ 'registerPluginResource rehash reloadImage removeJoint removeMultiInstance ' +
+ 'removePanelCategory rename renameAttr renameSelectionList renameUI render ' +
+ 'renderGlobalsNode renderInfo renderLayerButton renderLayerParent ' +
+ 'renderLayerPostProcess renderLayerUnparent renderManip renderPartition ' +
+ 'renderQualityNode renderSettings renderThumbnailUpdate renderWindowEditor ' +
+ 'renderWindowSelectContext renderer reorder reorderDeformers requires reroot ' +
+ 'resampleFluid resetAE resetPfxToPolyCamera resetTool resolutionNode retarget ' +
+ 'reverseCurve reverseSurface revolve rgb_to_hsv rigidBody rigidSolver roll rollCtx ' +
+ 'rootOf rot rotate rotationInterpolation roundConstantRadius rowColumnLayout rowLayout ' +
+ 'runTimeCommand runup sampleImage saveAllShelves saveAttrPreset saveFluid saveImage ' +
+ 'saveInitialState saveMenu savePrefObjects savePrefs saveShelf saveToolSettings scale ' +
+ 'scaleBrushBrightness scaleComponents scaleConstraint scaleKey scaleKeyCtx sceneEditor ' +
+ 'sceneUIReplacement scmh scriptCtx scriptEditorInfo scriptJob scriptNode scriptTable ' +
+ 'scriptToShelf scriptedPanel scriptedPanelType scrollField scrollLayout sculpt ' +
+ 'searchPathArray seed selLoadSettings select selectContext selectCurveCV selectKey ' +
+ 'selectKeyCtx selectKeyframeRegionCtx selectMode selectPref selectPriority selectType ' +
+ 'selectedNodes selectionConnection separator setAttr setAttrEnumResource ' +
+ 'setAttrMapping setAttrNiceNameResource setConstraintRestPosition ' +
+ 'setDefaultShadingGroup setDrivenKeyframe setDynamic setEditCtx setEditor setFluidAttr ' +
+ 'setFocus setInfinity setInputDeviceMapping setKeyCtx setKeyPath setKeyframe ' +
+ 'setKeyframeBlendshapeTargetWts setMenuMode setNodeNiceNameResource setNodeTypeFlag ' +
+ 'setParent setParticleAttr setPfxToPolyCamera setPluginResource setProject ' +
+ 'setStampDensity setStartupMessage setState setToolTo setUITemplate setXformManip sets ' +
+ 'shadingConnection shadingGeometryRelCtx shadingLightRelCtx shadingNetworkCompare ' +
+ 'shadingNode shapeCompare shelfButton shelfLayout shelfTabLayout shellField ' +
+ 'shortNameOf showHelp showHidden showManipCtx showSelectionInTitle ' +
+ 'showShadingGroupAttrEditor showWindow sign simplify sin singleProfileBirailSurface ' +
+ 'size sizeBytes skinCluster skinPercent smoothCurve smoothTangentSurface smoothstep ' +
+ 'snap2to2 snapKey snapMode snapTogetherCtx snapshot soft softMod softModCtx sort sound ' +
+ 'soundControl source spaceLocator sphere sphrand spotLight spotLightPreviewPort ' +
+ 'spreadSheetEditor spring sqrt squareSurface srtContext stackTrace startString ' +
+ 'startsWith stitchAndExplodeShell stitchSurface stitchSurfacePoints strcmp ' +
+ 'stringArrayCatenate stringArrayContains stringArrayCount stringArrayInsertAtIndex ' +
+ 'stringArrayIntersector stringArrayRemove stringArrayRemoveAtIndex ' +
+ 'stringArrayRemoveDuplicates stringArrayRemoveExact stringArrayToString ' +
+ 'stringToStringArray strip stripPrefixFromName stroke subdAutoProjection ' +
+ 'subdCleanTopology subdCollapse subdDuplicateAndConnect subdEditUV ' +
+ 'subdListComponentConversion subdMapCut subdMapSewMove subdMatchTopology subdMirror ' +
+ 'subdToBlind subdToPoly subdTransferUVsToCache subdiv subdivCrease ' +
+ 'subdivDisplaySmoothness substitute substituteAllString substituteGeometry substring ' +
+ 'surface surfaceSampler surfaceShaderList swatchDisplayPort switchTable symbolButton ' +
+ 'symbolCheckBox sysFile system tabLayout tan tangentConstraint texLatticeDeformContext ' +
+ 'texManipContext texMoveContext texMoveUVShellContext texRotateContext texScaleContext ' +
+ 'texSelectContext texSelectShortestPathCtx texSmudgeUVContext texWinToolCtx text ' +
+ 'textCurves textField textFieldButtonGrp textFieldGrp textManip textScrollList ' +
+ 'textToShelf textureDisplacePlane textureHairColor texturePlacementContext ' +
+ 'textureWindow threadCount threePointArcCtx timeControl timePort timerX toNativePath ' +
+ 'toggle toggleAxis toggleWindowVisibility tokenize tokenizeList tolerance tolower ' +
+ 'toolButton toolCollection toolDropped toolHasOptions toolPropertyWindow torus toupper ' +
+ 'trace track trackCtx transferAttributes transformCompare transformLimits translator ' +
+ 'trim trunc truncateFluidCache truncateHairCache tumble tumbleCtx turbulence ' +
+ 'twoPointArcCtx uiRes uiTemplate unassignInputDevice undo undoInfo ungroup uniform unit ' +
+ 'unloadPlugin untangleUV untitledFileName untrim upAxis updateAE userCtx uvLink ' +
+ 'uvSnapshot validateShelfName vectorize view2dToolCtx viewCamera viewClipPlane ' +
+ 'viewFit viewHeadOn viewLookAt viewManip viewPlace viewSet visor volumeAxis vortex ' +
+ 'waitCursor warning webBrowser webBrowserPrefs whatIs window windowPref wire ' +
+ 'wireContext workspace wrinkle wrinkleContext writeTake xbmLangPathList xform',
+ illegal: '',
+ contains: [
+ hljs.C_NUMBER_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'string',
+ begin: '`', end: '`',
+ contains: [hljs.BACKSLASH_ESCAPE]
+ },
+ {
+ className: 'variable',
+ begin: '\\$\\d',
+ relevance: 5
+ },
+ {
+ className: 'variable',
+ begin: '[\\$\\%\\@\\*](\\^\\w\\b|#\\w+|[^\\s\\w{]|{\\w+}|\\w+)'
+ },
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE
+ ]
+ }
+};
+/*
+Language: SQL
+*/
+
+hljs.LANGUAGES.sql = {
+ case_insensitive: true,
+ defaultMode: {
+ illegal: '[^\\s]',
+ contains: [
+ {
+ className: 'operator',
+ begin: '(begin|start|commit|rollback|savepoint|lock|alter|create|drop|rename|call|delete|do|handler|insert|load|replace|select|truncate|update|set|show|pragma|grant)\\b', end: ';', endsWithParent: true,
+ keywords: {
+ keyword: 'all partial global month current_timestamp using go revoke smallint ' +
+ 'indicator end-exec disconnect zone with character assertion to add current_user ' +
+ 'usage input local alter match collate real then rollback get read timestamp ' +
+ 'session_user not integer bit unique day minute desc insert execute like ilike|2 ' +
+ 'level decimal drop continue isolation found where constraints domain right ' +
+ 'national some module transaction relative second connect escape close system_user ' +
+ 'for deferred section cast current sqlstate allocate intersect deallocate numeric ' +
+ 'public preserve full goto initially asc no key output collation group by union ' +
+ 'session both last language constraint column of space foreign deferrable prior ' +
+ 'connection unknown action commit view or first into float year primary cascaded ' +
+ 'except restrict set references names table outer open select size are rows from ' +
+ 'prepare distinct leading create only next inner authorization schema ' +
+ 'corresponding option declare precision immediate else timezone_minute external ' +
+ 'varying translation true case exception join hour default double scroll value ' +
+ 'cursor descriptor values dec fetch procedure delete and false int is describe ' +
+ 'char as at in varchar null trailing any absolute current_time end grant ' +
+ 'privileges when cross check write current_date pad begin temporary exec time ' +
+ 'update catalog user sql date on identity timezone_hour natural whenever interval ' +
+ 'work order cascade diagnostics nchar having left call do handler load replace ' +
+ 'truncate start lock show pragma',
+ aggregate: 'count sum min max avg'
+ },
+ contains: [
+ {
+ className: 'string',
+ begin: '\'', end: '\'',
+ contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
+ relevance: 0
+ },
+ {
+ className: 'string',
+ begin: '"', end: '"',
+ contains: [hljs.BACKSLASH_ESCAPE, {begin: '""'}],
+ relevance: 0
+ },
+ {
+ className: 'string',
+ begin: '`', end: '`',
+ contains: [hljs.BACKSLASH_ESCAPE]
+ },
+ hljs.C_NUMBER_MODE
+ ]
+ },
+ hljs.C_BLOCK_COMMENT_MODE,
+ {
+ className: 'comment',
+ begin: '--', end: '$'
+ }
+ ]
+ }
+};
+/*
+Language: Smalltalk
+Author: Vladimir Gubarkov
+*/
+
+hljs.LANGUAGES.smalltalk = function() {
+ var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*';
+ var CHAR = {
+ className: 'char',
+ begin: '\\$.{1}'
+ };
+ var SYMBOL = {
+ className: 'symbol',
+ begin: '#' + hljs.UNDERSCORE_IDENT_RE
+ };
+ return {
+ defaultMode: {
+ keywords: 'self super nil true false thisContext', // only 6
+ contains: [
+ {
+ className: 'comment',
+ begin: '"', end: '"',
+ relevance: 0
+ },
+ hljs.APOS_STRING_MODE,
+ {
+ className: 'class',
+ begin: '\\b[A-Z][A-Za-z0-9_]*',
+ relevance: 0
+ },
+ {
+ className: 'method',
+ begin: VAR_IDENT_RE + ':'
+ },
+ hljs.C_NUMBER_MODE,
+ SYMBOL,
+ CHAR,
+ {
+ className: 'localvars',
+ begin: '\\|\\s*((' + VAR_IDENT_RE + ')\\s*)+\\|'
+ },
+ {
+ className: 'array',
+ begin: '\\#\\(', end: '\\)',
+ contains: [
+ hljs.APOS_STRING_MODE,
+ CHAR,
+ hljs.C_NUMBER_MODE,
+ SYMBOL
+ ]
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Lisp
+Description: Generic lisp syntax
+Author: Vasily Polovnyov
+*/
+
+hljs.LANGUAGES.lisp = function(){
+ var LISP_IDENT_RE = '[a-zA-Z_\\-\\+\\*\\/\\<\\=\\>\\&\\#][a-zA-Z0-9_\\-\\+\\*\\/\\<\\=\\>\\&\\#]*';
+ var LISP_SIMPLE_NUMBER_RE = '(\\-|\\+)?\\d+(\\.\\d+|\\/\\d+)?((d|e|f|l|s)(\\+|\\-)?\\d+)?';
+ var LITERAL = {
+ className: 'literal',
+ begin: '\\b(t{1}|nil)\\b'
+ };
+ var NUMBERS = [
+ {
+ className: 'number', begin: LISP_SIMPLE_NUMBER_RE
+ },
+ {
+ className: 'number', begin: '#b[0-1]+(/[0-1]+)?'
+ },
+ {
+ className: 'number', begin: '#o[0-7]+(/[0-7]+)?'
+ },
+ {
+ className: 'number', begin: '#x[0-9a-f]+(/[0-9a-f]+)?'
+ },
+ {
+ className: 'number', begin: '#c\\(' + LISP_SIMPLE_NUMBER_RE + ' +' + LISP_SIMPLE_NUMBER_RE, end: '\\)'
+ }
+ ]
+ var STRING = {
+ className: 'string',
+ begin: '"', end: '"',
+ contains: [hljs.BACKSLASH_ESCAPE],
+ relevance: 0
+ };
+ var COMMENT = {
+ className: 'comment',
+ begin: ';', end: '$'
+ };
+ var VARIABLE = {
+ className: 'variable',
+ begin: '\\*', end: '\\*'
+ };
+ var KEYWORD = {
+ className: 'keyword',
+ begin: '[:&]' + LISP_IDENT_RE
+ };
+ var QUOTED_LIST = {
+ begin: '\\(', end: '\\)',
+ contains: ['self', LITERAL, STRING].concat(NUMBERS)
+ };
+ var QUOTED1 = {
+ className: 'quoted',
+ begin: '[\'`]\\(', end: '\\)',
+ contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
+ };
+ var QUOTED2 = {
+ className: 'quoted',
+ begin: '\\(quote ', end: '\\)',
+ keywords: {title: 'quote'},
+ contains: NUMBERS.concat([STRING, VARIABLE, KEYWORD, QUOTED_LIST])
+ };
+ var LIST = {
+ className: 'list',
+ begin: '\\(', end: '\\)'
+ };
+ var BODY = {
+ className: 'body',
+ endsWithParent: true, excludeEnd: true
+ };
+ LIST.contains = [{className: 'title', begin: LISP_IDENT_RE}, BODY];
+ BODY.contains = [QUOTED1, QUOTED2, LIST, LITERAL].concat(NUMBERS).concat([STRING, COMMENT, VARIABLE, KEYWORD]);
+
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ illegal: '[^\\s]',
+ contains: NUMBERS.concat([
+ LITERAL,
+ STRING,
+ COMMENT,
+ QUOTED1, QUOTED2,
+ LIST
+ ])
+ }
+ };
+}();
+/*
+Language: Ini
+*/
+
+hljs.LANGUAGES.ini = {
+ case_insensitive: true,
+ defaultMode: {
+ illegal: '[^\\s]',
+ contains: [
+ {
+ className: 'comment',
+ begin: ';', end: '$'
+ },
+ {
+ className: 'title',
+ begin: '^\\[', end: '\\]'
+ },
+ {
+ className: 'setting',
+ begin: '^[a-z0-9_\\[\\]]+[ \\t]*=[ \\t]*', end: '$',
+ contains: [
+ {
+ className: 'value',
+ endsWithParent: true,
+ keywords: 'on off true false yes no',
+ contains: [hljs.QUOTE_STRING_MODE, hljs.NUMBER_MODE]
+ }
+ ]
+ }
+ ]
+ }
+};
+/*
+Language: Apache
+Author: Ruslan Keba
+Website: http://rukeba.com/
+Description: language definition for Apache configuration files (httpd.conf & .htaccess)
+Version: 1.1
+Date: 2008-12-27
+*/
+
+hljs.LANGUAGES.apache = function(){
+ var NUMBER = {className: 'number', begin: '[\\$%]\\d+'};
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: {
+ keyword: 'acceptfilter acceptmutex acceptpathinfo accessfilename action addalt ' +
+ 'addaltbyencoding addaltbytype addcharset adddefaultcharset adddescription ' +
+ 'addencoding addhandler addicon addiconbyencoding addiconbytype addinputfilter ' +
+ 'addlanguage addmoduleinfo addoutputfilter addoutputfilterbytype addtype alias ' +
+ 'aliasmatch allow allowconnect allowencodedslashes allowoverride anonymous ' +
+ 'anonymous_logemail anonymous_mustgiveemail anonymous_nouserid anonymous_verifyemail ' +
+ 'authbasicauthoritative authbasicprovider authdbduserpwquery authdbduserrealmquery ' +
+ 'authdbmgroupfile authdbmtype authdbmuserfile authdefaultauthoritative ' +
+ 'authdigestalgorithm authdigestdomain authdigestnccheck authdigestnonceformat ' +
+ 'authdigestnoncelifetime authdigestprovider authdigestqop authdigestshmemsize ' +
+ 'authgroupfile authldapbinddn authldapbindpassword authldapcharsetconfig ' +
+ 'authldapcomparednonserver authldapdereferencealiases authldapgroupattribute ' +
+ 'authldapgroupattributeisdn authldapremoteuserattribute authldapremoteuserisdn ' +
+ 'authldapurl authname authnprovideralias authtype authuserfile authzdbmauthoritative ' +
+ 'authzdbmtype authzdefaultauthoritative authzgroupfileauthoritative ' +
+ 'authzldapauthoritative authzownerauthoritative authzuserauthoritative ' +
+ 'balancermember browsermatch browsermatchnocase bufferedlogs cachedefaultexpire ' +
+ 'cachedirlength cachedirlevels cachedisable cacheenable cachefile ' +
+ 'cacheignorecachecontrol cacheignoreheaders cacheignorenolastmod ' +
+ 'cacheignorequerystring cachelastmodifiedfactor cachemaxexpire cachemaxfilesize ' +
+ 'cacheminfilesize cachenegotiateddocs cacheroot cachestorenostore cachestoreprivate ' +
+ 'cgimapextension charsetdefault charsetoptions charsetsourceenc checkcaseonly ' +
+ 'checkspelling chrootdir contentdigest cookiedomain cookieexpires cookielog ' +
+ 'cookiename cookiestyle cookietracking coredumpdirectory customlog dav ' +
+ 'davdepthinfinity davgenericlockdb davlockdb davmintimeout dbdexptime dbdkeep ' +
+ 'dbdmax dbdmin dbdparams dbdpersist dbdpreparesql dbdriver defaulticon ' +
+ 'defaultlanguage defaulttype deflatebuffersize deflatecompressionlevel ' +
+ 'deflatefilternote deflatememlevel deflatewindowsize deny directoryindex ' +
+ 'directorymatch directoryslash documentroot dumpioinput dumpiologlevel dumpiooutput ' +
+ 'enableexceptionhook enablemmap enablesendfile errordocument errorlog example ' +
+ 'expiresactive expiresbytype expiresdefault extendedstatus extfilterdefine ' +
+ 'extfilteroptions fileetag filterchain filterdeclare filterprotocol filterprovider ' +
+ 'filtertrace forcelanguagepriority forcetype forensiclog gracefulshutdowntimeout ' +
+ 'group header headername hostnamelookups identitycheck identitychecktimeout ' +
+ 'imapbase imapdefault imapmenu include indexheadinsert indexignore indexoptions ' +
+ 'indexorderdefault indexstylesheet isapiappendlogtoerrors isapiappendlogtoquery ' +
+ 'isapicachefile isapifakeasync isapilognotsupported isapireadaheadbuffer keepalive ' +
+ 'keepalivetimeout languagepriority ldapcacheentries ldapcachettl ' +
+ 'ldapconnectiontimeout ldapopcacheentries ldapopcachettl ldapsharedcachefile ' +
+ 'ldapsharedcachesize ldaptrustedclientcert ldaptrustedglobalcert ldaptrustedmode ' +
+ 'ldapverifyservercert limitinternalrecursion limitrequestbody limitrequestfields ' +
+ 'limitrequestfieldsize limitrequestline limitxmlrequestbody listen listenbacklog ' +
+ 'loadfile loadmodule lockfile logformat loglevel maxclients maxkeepaliverequests ' +
+ 'maxmemfree maxrequestsperchild maxrequestsperthread maxspareservers maxsparethreads ' +
+ 'maxthreads mcachemaxobjectcount mcachemaxobjectsize mcachemaxstreamingbuffer ' +
+ 'mcacheminobjectsize mcacheremovalalgorithm mcachesize metadir metafiles metasuffix ' +
+ 'mimemagicfile minspareservers minsparethreads mmapfile mod_gzip_on ' +
+ 'mod_gzip_add_header_count mod_gzip_keep_workfiles mod_gzip_dechunk ' +
+ 'mod_gzip_min_http mod_gzip_minimum_file_size mod_gzip_maximum_file_size ' +
+ 'mod_gzip_maximum_inmem_size mod_gzip_temp_dir mod_gzip_item_include ' +
+ 'mod_gzip_item_exclude mod_gzip_command_version mod_gzip_can_negotiate ' +
+ 'mod_gzip_handle_methods mod_gzip_static_suffix mod_gzip_send_vary ' +
+ 'mod_gzip_update_static modmimeusepathinfo multiviewsmatch namevirtualhost noproxy ' +
+ 'nwssltrustedcerts nwsslupgradeable options order passenv pidfile protocolecho ' +
+ 'proxybadheader proxyblock proxydomain proxyerroroverride proxyftpdircharset ' +
+ 'proxyiobuffersize proxymaxforwards proxypass proxypassinterpolateenv ' +
+ 'proxypassmatch proxypassreverse proxypassreversecookiedomain ' +
+ 'proxypassreversecookiepath proxypreservehost proxyreceivebuffersize proxyremote ' +
+ 'proxyremotematch proxyrequests proxyset proxystatus proxytimeout proxyvia ' +
+ 'readmename receivebuffersize redirect redirectmatch redirectpermanent ' +
+ 'redirecttemp removecharset removeencoding removehandler removeinputfilter ' +
+ 'removelanguage removeoutputfilter removetype requestheader require rewritebase ' +
+ 'rewritecond rewriteengine rewritelock rewritelog rewriteloglevel rewritemap ' +
+ 'rewriteoptions rewriterule rlimitcpu rlimitmem rlimitnproc satisfy scoreboardfile ' +
+ 'script scriptalias scriptaliasmatch scriptinterpretersource scriptlog ' +
+ 'scriptlogbuffer scriptloglength scriptsock securelisten seerequesttail ' +
+ 'sendbuffersize serveradmin serveralias serverlimit servername serverpath ' +
+ 'serverroot serversignature servertokens setenv setenvif setenvifnocase sethandler ' +
+ 'setinputfilter setoutputfilter ssienableaccess ssiendtag ssierrormsg ssistarttag ' +
+ 'ssitimeformat ssiundefinedecho sslcacertificatefile sslcacertificatepath ' +
+ 'sslcadnrequestfile sslcadnrequestpath sslcarevocationfile sslcarevocationpath ' +
+ 'sslcertificatechainfile sslcertificatefile sslcertificatekeyfile sslciphersuite ' +
+ 'sslcryptodevice sslengine sslhonorciperorder sslmutex ssloptions ' +
+ 'sslpassphrasedialog sslprotocol sslproxycacertificatefile ' +
+ 'sslproxycacertificatepath sslproxycarevocationfile sslproxycarevocationpath ' +
+ 'sslproxyciphersuite sslproxyengine sslproxymachinecertificatefile ' +
+ 'sslproxymachinecertificatepath sslproxyprotocol sslproxyverify ' +
+ 'sslproxyverifydepth sslrandomseed sslrequire sslrequiressl sslsessioncache ' +
+ 'sslsessioncachetimeout sslusername sslverifyclient sslverifydepth startservers ' +
+ 'startthreads substitute suexecusergroup threadlimit threadsperchild ' +
+ 'threadstacksize timeout traceenable transferlog typesconfig unsetenv ' +
+ 'usecanonicalname usecanonicalphysicalport user userdir virtualdocumentroot ' +
+ 'virtualdocumentrootip virtualscriptalias virtualscriptaliasip ' +
+ 'win32disableacceptex xbithack',
+ literal: 'on off'
+ },
+ contains: [
+ hljs.HASH_COMMENT_MODE,
+ {
+ className: 'sqbracket',
+ begin: '\\s\\[', end: '\\]$'
+ },
+ {
+ className: 'cbracket',
+ begin: '[\\$%]\\{', end: '\\}',
+ contains: ['self', NUMBER]
+ },
+ NUMBER,
+ {className: 'tag', begin: '?', end: '>'},
+ hljs.QUOTE_STRING_MODE
+ ]
+ }
+ };
+}();
+/*
+Language: Nginx
+Author: Peter Leonov
+*/
+
+hljs.LANGUAGES.nginx = function() {
+ var VAR1 = {
+ className: 'variable',
+ begin: '\\$\\d+'
+ };
+ var VAR2 = {
+ className: 'variable',
+ begin: '\\${', end: '}'
+ };
+ var VAR3 = {
+ className: 'variable',
+ begin: '[\\$\\@]' + hljs.UNDERSCORE_IDENT_RE
+ };
+
+ return {
+ defaultMode: {
+ contains: [
+ hljs.HASH_COMMENT_MODE,
+ { // directive
+ begin: hljs.UNDERSCORE_IDENT_RE, end: ';|{', returnEnd: true,
+ keywords:
+ 'accept_mutex accept_mutex_delay access_log add_after_body add_before_body ' +
+ 'add_header addition_types alias allow ancient_browser ancient_browser_value ' +
+ 'auth_basic auth_basic_user_file autoindex autoindex_exact_size ' +
+ 'autoindex_localtime break charset charset_map charset_types ' +
+ 'client_body_buffer_size client_body_in_file_only client_body_in_single_buffer ' +
+ 'client_body_temp_path client_body_timeout client_header_buffer_size ' +
+ 'client_header_timeout client_max_body_size connection_pool_size connections ' +
+ 'create_full_put_path daemon dav_access dav_methods debug_connection ' +
+ 'debug_points default_type deny directio directio_alignment echo echo_after_body ' +
+ 'echo_before_body echo_blocking_sleep echo_duplicate echo_end echo_exec ' +
+ 'echo_flush echo_foreach_split echo_location echo_location_async ' +
+ 'echo_read_request_body echo_request_body echo_reset_timer echo_sleep ' +
+ 'echo_subrequest echo_subrequest_async empty_gif env error_log error_page events ' +
+ 'expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers ' +
+ 'fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods ' +
+ 'fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale ' +
+ 'fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout ' +
+ 'fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers ' +
+ 'fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size ' +
+ 'fastcgi_next_upstream fastcgi_param fastcgi_pass fastcgi_pass_header ' +
+ 'fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout ' +
+ 'fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store ' +
+ 'fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path ' +
+ 'fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geo geoip_city ' +
+ 'geoip_country gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash ' +
+ 'gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static ' +
+ 'gzip_types gzip_vary gzip_window http if if_modified_since ' +
+ 'ignore_invalid_headers image_filter image_filter_buffer ' +
+ 'image_filter_jpeg_quality image_filter_transparency include index internal ' +
+ 'ip_hash js js_load js_require js_utf8 keepalive_requests keepalive_timeout ' +
+ 'kqueue_changes kqueue_events large_client_header_buffers limit_conn ' +
+ 'limit_conn_log_level limit_except limit_rate limit_rate_after limit_req ' +
+ 'limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout ' +
+ 'listen location lock_file log_format log_not_found log_subrequest map ' +
+ 'map_hash_bucket_size map_hash_max_size master_process memcached_bind ' +
+ 'memcached_buffer_size memcached_connect_timeout memcached_next_upstream ' +
+ 'memcached_pass memcached_read_timeout memcached_send_timeout ' +
+ 'memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes ' +
+ 'min_delete_depth modern_browser modern_browser_value more_clear_headers ' +
+ 'more_clear_input_headers more_set_headers more_set_input_headers msie_padding ' +
+ 'msie_refresh multi_accept open_file_cache open_file_cache_errors ' +
+ 'open_file_cache_events open_file_cache_min_uses open_file_cache_retest ' +
+ 'open_file_cache_valid open_log_file_cache optimize_server_names output_buffers ' +
+ 'override_charset perl perl_modules perl_require perl_set pid port_in_redirect ' +
+ 'post_action postpone_gzipping postpone_output proxy_bind proxy_buffer_size ' +
+ 'proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache ' +
+ 'proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path ' +
+ 'proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout ' +
+ 'proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header ' +
+ 'proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors ' +
+ 'proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass ' +
+ 'proxy_pass_header proxy_pass_request_body proxy_pass_request_headers ' +
+ 'proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout ' +
+ 'proxy_set_body proxy_set_header proxy_store proxy_store_access ' +
+ 'proxy_temp_file_write_size proxy_temp_path proxy_upstream_fail_timeout ' +
+ 'proxy_upstream_max_fails push_authorized_channels_only push_channel_group ' +
+ 'push_max_channel_id_length push_max_channel_subscribers ' +
+ 'push_max_message_buffer_length push_max_reserved_memory ' +
+ 'push_message_buffer_length push_message_timeout push_min_message_buffer_length ' +
+ 'push_min_message_recipients push_publisher push_store_messages push_subscriber ' +
+ 'push_subscriber_concurrency random_index read_ahead real_ip_header ' +
+ 'recursive_error_pages request_pool_size reset_timedout_connection resolver ' +
+ 'resolver_timeout return rewrite rewrite_log root satisfy satisfy_any ' +
+ 'send_lowat send_timeout sendfile sendfile_max_chunk server server_name ' +
+ 'server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size ' +
+ 'server_tokens set set_real_ip_from source_charset ssi ' +
+ 'ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ' +
+ 'ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ' +
+ 'ssl_client_certificate ssl_crl ssl_dhparam ssl_prefer_server_ciphers ' +
+ 'ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ' +
+ 'ssl_verify_depth sub_filter sub_filter_once sub_filter_types tcp_nodelay ' +
+ 'tcp_nopush timer_resolution try_files types types_hash_bucket_size ' +
+ 'types_hash_max_size underscores_in_headers uninitialized_variable_warn upstream ' +
+ 'use user userid userid_domain userid_expires userid_mark userid_name userid_p3p ' +
+ 'userid_path userid_service valid_referers variables_hash_bucket_size ' +
+ 'variables_hash_max_size worker_connections worker_cpu_affinity worker_priority ' +
+ 'worker_processes worker_rlimit_core worker_rlimit_nofile ' +
+ 'worker_rlimit_sigpending working_directory xml_entities xslt_stylesheet xslt_types',
+ relevance: 0,
+ contains: [
+ hljs.HASH_COMMENT_MODE,
+ {
+ begin: '\\s', end: '[;{]', returnBegin: true, returnEnd: true,
+ lexems: '[a-z/]+',
+ keywords: {
+ built_in:
+ 'on off yes no true false none blocked debug info notice warn error crit ' +
+ 'select permanent redirect kqueue rtsig epoll poll /dev/poll'
+ },
+ relevance: 0,
+ contains: [
+ hljs.HASH_COMMENT_MODE,
+ {
+ className: 'string',
+ begin: '"', end: '"',
+ contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3],
+ relevance: 0
+ },
+ {
+ className: 'string',
+ begin: "'", end: "'",
+ contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3],
+ relevance: 0
+ },
+ {
+ className: 'string',
+ begin: '([a-z]+):/', end: '[;\\s]', returnEnd: true
+ },
+ {
+ className: 'regexp',
+ begin: "\\s\\^", end: "\\s|{|;", returnEnd: true,
+ contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
+ },
+ // regexp locations (~, ~*)
+ {
+ className: 'regexp',
+ begin: "~\\*?\\s+", end: "\\s|{|;", returnEnd: true,
+ contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
+ },
+ // *.example.com
+ {
+ className: 'regexp',
+ begin: "\\*(\\.[a-z\\-]+)+",
+ contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
+ },
+ // sub.example.*
+ {
+ className: 'regexp',
+ begin: "([a-z\\-]+\\.)+\\*",
+ contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2, VAR3]
+ },
+ // IP
+ {
+ className: 'number',
+ begin: '\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\b'
+ },
+ // units
+ {
+ className: 'number',
+ begin: '\\s\\d+[kKmMgGdshdwy]*\\b',
+ relevance: 0
+ },
+ VAR1, VAR2, VAR3
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ }
+}();
+/*
+Language: Diff
+Description: Unified and context diff
+Author: Vasily Polovnyov
+*/
+
+hljs.LANGUAGES.diff = {
+ case_insensitive: true,
+ defaultMode: {
+ contains: [
+ {
+ className: 'chunk',
+ begin: '^\\@\\@ +\\-\\d+,\\d+ +\\+\\d+,\\d+ +\\@\\@$',
+ relevance: 10
+ },
+ {
+ className: 'chunk',
+ begin: '^\\*\\*\\* +\\d+,\\d+ +\\*\\*\\*\\*$',
+ relevance: 10
+ },
+ {
+ className: 'chunk',
+ begin: '^\\-\\-\\- +\\d+,\\d+ +\\-\\-\\-\\-$',
+ relevance: 10
+ },
+ {
+ className: 'header',
+ begin: 'Index: ', end: '$'
+ },
+ {
+ className: 'header',
+ begin: '=====', end: '=====$'
+ },
+ {
+ className: 'header',
+ begin: '^\\-\\-\\-', end: '$'
+ },
+ {
+ className: 'header',
+ begin: '^\\*{3} ', end: '$'
+ },
+ {
+ className: 'header',
+ begin: '^\\+\\+\\+', end: '$'
+ },
+ {
+ className: 'header',
+ begin: '\\*{5}', end: '\\*{5}$'
+ },
+ {
+ className: 'addition',
+ begin: '^\\+', end: '$'
+ },
+ {
+ className: 'deletion',
+ begin: '^\\-', end: '$'
+ },
+ {
+ className: 'change',
+ begin: '^\\!', end: '$'
+ }
+ ]
+ }
+};
+/*
+Language: DOS .bat
+Author: Alexander Makarov (http://rmcreative.ru/)
+*/
+
+hljs.LANGUAGES.dos = {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: {
+ flow: 'if else goto for in do call exit not exist errorlevel defined equ neq lss leq gtr geq',
+ keyword: 'shift cd dir echo setlocal endlocal set pause copy',
+ stream: 'prn nul lpt3 lpt2 lpt1 con com4 com3 com2 com1 aux',
+ winutils: 'ping net ipconfig taskkill xcopy ren del'
+ },
+ contains: [
+ {
+ className: 'envvar', begin: '%%[^ ]'
+ },
+ {
+ className: 'envvar', begin: '%[^ ]+?%'
+ },
+ {
+ className: 'envvar', begin: '![^ ]+?!'
+ },
+ {
+ className: 'number', begin: '\\b\\d+',
+ relevance: 0
+ },
+ {
+ className: 'comment',
+ begin: '@?rem', end: '$'
+ }
+ ]
+ }
+};
+/*
+Language: Bash
+Author: vah
+*/
+
+hljs.LANGUAGES.bash = function(){
+ var BASH_LITERAL = 'true false';
+ var VAR1 = {
+ className: 'variable',
+ begin: '\\$([a-zA-Z0-9_]+)\\b'
+ };
+ var VAR2 = {
+ className: 'variable',
+ begin: '\\$\\{(([^}])|(\\\\}))+\\}',
+ contains: [hljs.C_NUMBER_MODE]
+ };
+ var QUOTE_STRING = {
+ className: 'string',
+ begin: '"', end: '"',
+ illegal: '\\n',
+ contains: [hljs.BACKSLASH_ESCAPE, VAR1, VAR2],
+ relevance: 0
+ };
+ var APOS_STRING = {
+ className: 'string',
+ begin: '\'', end: '\'',
+ contains: [{begin: '\'\''}],
+ relevance: 0
+ };
+ var TEST_CONDITION = {
+ className: 'test_condition',
+ begin: '', end: '',
+ contains: [QUOTE_STRING, APOS_STRING, VAR1, VAR2, hljs.C_NUMBER_MODE],
+ keywords: {
+ literal: BASH_LITERAL
+ },
+ relevance: 0
+ };
+
+ return {
+ defaultMode: {
+ keywords: {
+ keyword: 'if then else fi for break continue while in do done echo exit return set declare',
+ literal: BASH_LITERAL
+ },
+ contains: [
+ {
+ className: 'shebang',
+ begin: '(#!\\/bin\\/bash)|(#!\\/bin\\/sh)',
+ relevance: 10
+ },
+ VAR1,
+ VAR2,
+ hljs.HASH_COMMENT_MODE,
+ hljs.C_NUMBER_MODE,
+ QUOTE_STRING,
+ APOS_STRING,
+ hljs.inherit(TEST_CONDITION, {begin: '\\[ ', end: ' \\]', relevance: 0}),
+ hljs.inherit(TEST_CONDITION, {begin: '\\[\\[ ', end: ' \\]\\]'})
+ ]
+ }
+ };
+}();
+/*
+Language: CMake
+Description: CMake is an open-source cross-platform system for build automation.
+Author: Igor Kalnitsky
+Website: http://kalnitsky.org.ua/
+*/
+
+hljs.LANGUAGES.cmake = {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: 'add_custom_command add_custom_target add_definitions add_dependencies ' +
+ 'add_executable add_library add_subdirectory add_test aux_source_directory ' +
+ 'break build_command cmake_minimum_required cmake_policy configure_file ' +
+ 'create_test_sourcelist define_property else elseif enable_language enable_testing ' +
+ 'endforeach endfunction endif endmacro endwhile execute_process export find_file ' +
+ 'find_library find_package find_path find_program fltk_wrap_ui foreach function ' +
+ 'get_cmake_property get_directory_property get_filename_component get_property ' +
+ 'get_source_file_property get_target_property get_test_property if include ' +
+ 'include_directories include_external_msproject include_regular_expression install ' +
+ 'link_directories load_cache load_command macro mark_as_advanced message option ' +
+ 'output_required_files project qt_wrap_cpp qt_wrap_ui remove_definitions return ' +
+ 'separate_arguments set set_directory_properties set_property ' +
+ 'set_source_files_properties set_target_properties set_tests_properties site_name ' +
+ 'source_group string target_link_libraries try_compile try_run unset variable_watch ' +
+ 'while build_name exec_program export_library_dependencies install_files ' +
+ 'install_programs install_targets link_libraries make_directory remove subdir_depends ' +
+ 'subdirs use_mangled_mesa utility_source variable_requires write_file',
+ contains: [
+ {
+ className: 'envvar',
+ begin: '\\${', end: '}'
+ },
+ hljs.HASH_COMMENT_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.NUMBER_MODE
+ ]
+ }
+};
+/*
+Language: Axapta
+Author: Dmitri Roudakov
+*/
+
+hljs.LANGUAGES.axapta = {
+ defaultMode: {
+ keywords: 'false int abstract private char interface boolean static null if for true ' +
+ 'while long throw finally protected extends final implements return void enum else ' +
+ 'break new catch byte super class case short default double public try this switch ' +
+ 'continue reverse firstfast firstonly forupdate nofetch sum avg minof maxof count ' +
+ 'order group by asc desc index hint like dispaly edit client server ttsbegin ' +
+ 'ttscommit str real date container anytype common div mod',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'preprocessor',
+ begin: '#', end: '$'
+ },
+ {
+ className: 'class',
+ beginWithKeyword: true, end: '{',
+ illegal: ':',
+ keywords: 'class interface',
+ contains: [
+ {
+ className: 'inheritance',
+ beginWithKeyword: true,
+ keywords: 'extends implements',
+ relevance: 10
+ },
+ {
+ className: 'title',
+ begin: hljs.UNDERSCORE_IDENT_RE
+ }
+ ]
+ }
+ ]
+ }
+};
+/*
+Language: 1C
+Author: Yuri Ivanov
+Contributors: Sergey Baranov
+*/
+
+hljs.LANGUAGES['1c'] = function(){
+ var IDENT_RE_RU = '[a-zA-Zа-яА-Я][a-zA-Z0-9_а-яА-Я]*';
+ var OneS_KEYWORDS = 'возврат дата для если и или иначе иначеесли исключение конецесли ' +
+ 'конецпопытки конецпроцедуры конецфункции конеццикла константа не перейти перем ' +
+ 'перечисление по пока попытка прервать продолжить процедура строка тогда фс функция цикл ' +
+ 'число экспорт';
+ var OneS_BUILT_IN = 'ansitooem oemtoansi ввестивидсубконто ввестидату ввестизначение ' +
+ 'ввестиперечисление ввестипериод ввестиплансчетов ввестистроку ввестичисло вопрос ' +
+ 'восстановитьзначение врег выбранныйплансчетов вызватьисключение датагод датамесяц ' +
+ 'датачисло добавитьмесяц завершитьработусистемы заголовоксистемы записьжурналарегистрации ' +
+ 'запуститьприложение зафиксироватьтранзакцию значениевстроку значениевстрокувнутр ' +
+ 'значениевфайл значениеизстроки значениеизстрокивнутр значениеизфайла имякомпьютера ' +
+ 'имяпользователя каталогвременныхфайлов каталогиб каталогпользователя каталогпрограммы ' +
+ 'кодсимв командасистемы конгода конецпериодаби конецрассчитанногопериодаби ' +
+ 'конецстандартногоинтервала конквартала конмесяца коннедели лев лог лог10 макс ' +
+ 'максимальноеколичествосубконто мин монопольныйрежим названиеинтерфейса названиенабораправ ' +
+ 'назначитьвид назначитьсчет найти найтипомеченныенаудаление найтиссылки началопериодаби ' +
+ 'началостандартногоинтервала начатьтранзакцию начгода начквартала начмесяца начнедели ' +
+ 'номерднягода номерднянедели номернеделигода нрег обработкаожидания окр описаниеошибки ' +
+ 'основнойжурналрасчетов основнойплансчетов основнойязык открытьформу открытьформумодально ' +
+ 'отменитьтранзакцию очиститьокносообщений периодстр полноеимяпользователя получитьвремята ' +
+ 'получитьдатута получитьдокументта получитьзначенияотбора получитьпозициюта ' +
+ 'получитьпустоезначение получитьта прав праводоступа предупреждение префиксавтонумерации ' +
+ 'пустаястрока пустоезначение рабочаядаттьпустоезначение рабочаядата разделительстраниц ' +
+ 'разделительстрок разм разобратьпозициюдокумента рассчитатьрегистрына ' +
+ 'рассчитатьрегистрыпо сигнал симв символтабуляции создатьобъект сокрл сокрлп сокрп ' +
+ 'сообщить состояние сохранитьзначение сред статусвозврата стрдлина стрзаменить ' +
+ 'стрколичествострок стрполучитьстроку стрчисловхождений сформироватьпозициюдокумента ' +
+ 'счетпокоду текущаядата текущеевремя типзначения типзначениястр удалитьобъекты ' +
+ 'установитьтана установитьтапо фиксшаблон формат цел шаблон';
+ var DQUOTE = {className: 'dquote', begin: '""'};
+ var STR_START = {
+ className: 'string',
+ begin: '"', end: '"|$',
+ contains: [DQUOTE],
+ relevance: 0
+ };
+ var STR_CONT = {
+ className: 'string',
+ begin: '\\|', end: '"|$',
+ contains: [DQUOTE]
+ };
+
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ lexems: IDENT_RE_RU,
+ keywords: {keyword: OneS_KEYWORDS, built_in: OneS_BUILT_IN},
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.NUMBER_MODE,
+ STR_START, STR_CONT,
+ {
+ className: 'function',
+ begin: '(процедура|функция)', end: '$',
+ lexems: IDENT_RE_RU,
+ keywords: 'процедура функция',
+ contains: [
+ {className: 'title', begin: IDENT_RE_RU},
+ {
+ className: 'tail',
+ endsWithParent: true,
+ contains: [
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ lexems: IDENT_RE_RU,
+ keywords: 'знач',
+ contains: [STR_START, STR_CONT]
+ },
+ {
+ className: 'export',
+ begin: 'экспорт', endsWithParent: true,
+ lexems: IDENT_RE_RU,
+ keywords: 'экспорт',
+ contains: [hljs.C_LINE_COMMENT_MODE]
+ }
+ ]
+ },
+ hljs.C_LINE_COMMENT_MODE
+ ]
+ },
+ {className: 'preprocessor', begin: '#', end: '$'},
+ {className: 'date', begin: '\'\\d{2}\\.\\d{2}\\.(\\d{2}|\\d{4})\''}
+ ]
+ }
+ };
+}();
+/*
+Language: AVR Assembler
+Author: Vladimir Ermakov
+*/
+
+hljs.LANGUAGES.avrasm =
+{
+ case_insensitive: true,
+ defaultMode: {
+ keywords: {
+ keyword:
+ /* mnemonic */
+ 'adc add adiw and andi asr bclr bld brbc brbs brcc brcs break breq brge brhc brhs ' +
+ 'brid brie brlo brlt brmi brne brpl brsh brtc brts brvc brvs bset bst call cbi cbr ' +
+ 'clc clh cli cln clr cls clt clv clz com cp cpc cpi cpse dec eicall eijmp elpm eor ' +
+ 'fmul fmuls fmulsu icall ijmp in inc jmp ld ldd ldi lds lpm lsl lsr mov movw mul ' +
+ 'muls mulsu neg nop or ori out pop push rcall ret reti rjmp rol ror sbc sbr sbrc sbrs ' +
+ 'sec seh sbi sbci sbic sbis sbiw sei sen ser ses set sev sez sleep spm st std sts sub ' +
+ 'subi swap tst wdr',
+ built_in:
+ /* general purpose registers */
+ 'r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 r16 r17 r18 r19 r20 r21 r22 ' +
+ 'r23 r24 r25 r26 r27 r28 r29 r30 r31 x|0 xh xl y|0 yh yl z|0 zh zl ' +
+ /* IO Registers (ATMega128) */
+ 'ucsr1c udr1 ucsr1a ucsr1b ubrr1l ubrr1h ucsr0c ubrr0h tccr3c tccr3a tccr3b tcnt3h ' +
+ 'tcnt3l ocr3ah ocr3al ocr3bh ocr3bl ocr3ch ocr3cl icr3h icr3l etimsk etifr tccr1c ' +
+ 'ocr1ch ocr1cl twcr twdr twar twsr twbr osccal xmcra xmcrb eicra spmcsr spmcr portg ' +
+ 'ddrg ping portf ddrf sreg sph spl xdiv rampz eicrb eimsk gimsk gicr eifr gifr timsk ' +
+ 'tifr mcucr mcucsr tccr0 tcnt0 ocr0 assr tccr1a tccr1b tcnt1h tcnt1l ocr1ah ocr1al ' +
+ 'ocr1bh ocr1bl icr1h icr1l tccr2 tcnt2 ocr2 ocdr wdtcr sfior eearh eearl eedr eecr ' +
+ 'porta ddra pina portb ddrb pinb portc ddrc pinc portd ddrd pind spdr spsr spcr udr0 ' +
+ 'ucsr0a ucsr0b ubrr0l acsr admux adcsr adch adcl porte ddre pine pinf'
+ },
+ contains: [
+ hljs.C_BLOCK_COMMENT_MODE,
+ {className: 'comment', begin: ';', end: '$'},
+ hljs.C_NUMBER_MODE, // 0x..., decimal, float
+ hljs.BINARY_NUMBER_MODE, // 0b...
+ {
+ className: 'number',
+ begin: '\\b(\\$[a-zA-Z0-9]+|0o[0-7]+)' // $..., 0o...
+ },
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'string',
+ begin: '\'', end: '[^\\\\]\'',
+ illegal: '[^\\\\][^\']'
+ },
+ {className: 'label', begin: '^[A-Za-z0-9_.$]+:'},
+ {className: 'preprocessor', begin: '#', end: '$'},
+ { // директивы «.include» «.macro» и т.д.
+ className: 'preprocessor',
+ begin: '\\.[a-zA-Z]+'
+ },
+ { // подстановка в «.macro»
+ className: 'localvars',
+ begin: '@[0-9]+'
+ }
+ ]
+ }
+};
+
+/*
+Language: VHDL
+Author: Igor Kalnitsky
+Contributors: Daniel C.K. Kho
+Description: VHDL is a hardware description language used in electronic design automation to describe digital and mixed-signal systems.
+*/
+
+hljs.LANGUAGES.vhdl = function() {
+ return {
+ case_insensitive: true,
+ defaultMode: {
+ keywords: {
+ keyword:
+ 'abs access after alias all and architecture array assert attribute begin block ' +
+ 'body buffer bus case component configuration constant context cover disconnect ' +
+ 'downto default else elsif end entity exit fairness file for force function generate ' +
+ 'generic group guarded if impure in inertial inout is label library linkage literal ' +
+ 'loop map mod nand new next nor not null of on open or others out package port ' +
+ 'postponed procedure process property protected pure range record register reject ' +
+ 'release rem report restrict restrict_guarantee return rol ror select sequence ' +
+ 'severity shared signal sla sll sra srl strong subtype then to transport type ' +
+ 'unaffected units until use variable vmode vprop vunit wait when while with xnor xor',
+ typename:
+ 'boolean bit character severity_level integer time delay_length natural positive ' +
+ 'string bit_vector file_open_kind file_open_status std_ulogic std_ulogic_vector ' +
+ 'std_logic std_logic_vector unsigned signed boolean_vector integer_vector ' +
+ 'real_vector time_vector'
+ },
+ illegal: '{',
+ contains: [
+ hljs.C_BLOCK_COMMENT_MODE, // VHDL-2008 block commenting.
+ {
+ className: 'comment',
+ begin: '--', end: '$'
+ },
+ hljs.QUOTE_STRING_MODE,
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'literal',
+ begin: '\'(U|X|0|1|Z|W|L|H|-)\'',
+ contains: [hljs.BACKSLASH_ESCAPE]
+ },
+ {
+ className: 'attribute',
+ begin: '\'[A-Za-z](_?[A-Za-z0-9])*',
+ contains: [hljs.BACKSLASH_ESCAPE]
+ }
+ ]
+ } // defaultMode
+ } // return;
+}();
+/*
+Language: Parser3
+Requires: xml.js
+Author: Oleg Volchkov
+*/
+
+hljs.LANGUAGES.parser3 = {
+ defaultMode: {
+ subLanguage: 'xml',
+ contains: [
+ {
+ className: 'comment',
+ begin: '^#', end: '$'
+ },
+ {
+ className: 'comment',
+ begin: '\\^rem{', end: '}',
+ relevance: 10,
+ contains: [
+ {
+ begin: '{', end: '}',
+ contains: ['self']
+ }
+ ]
+ },
+ {
+ className: 'preprocessor',
+ begin: '^@(?:BASE|USE|CLASS|OPTIONS)$',
+ relevance: 10
+ },
+ {
+ className: 'title',
+ begin: '@[\\w\\-]+\\[[\\w^;\\-]*\\](?:\\[[\\w^;\\-]*\\])?(?:.*)$'
+ },
+ {
+ className: 'variable',
+ begin: '\\$\\{?[\\w\\-\\.\\:]+\\}?'
+ },
+ {
+ className: 'keyword',
+ begin: '\\^[\\w\\-\\.\\:]+'
+ },
+ {
+ className: 'number',
+ begin: '\\^#[0-9a-fA-F]+'
+ },
+ hljs.C_NUMBER_MODE
+ ]
+ }
+};
+/*
+Language: TeX
+Author: Vladimir Moskva
+Website: http://fulc.ru/
+*/
+
+hljs.LANGUAGES.tex = function() {
+ var COMMAND1 = {
+ className: 'command',
+ begin: '\\\\[a-zA-Zа-яА-я]+[\\*]?',
+ relevance: 10
+ };
+ var COMMAND2 = {
+ className: 'command',
+ begin: '\\\\[^a-zA-Zа-яА-я0-9]',
+ relevance: 0
+ };
+ var SPECIAL = {
+ className: 'special',
+ begin: '[{}\\[\\]\\~]',
+ relevance: 0
+ };
+
+ return {
+ defaultMode: {
+ contains: [
+ { // parameter
+ begin: '\\\\[a-zA-Zа-яА-я]+[\\*]? *= *-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?',
+ returnBegin: true,
+ contains: [
+ COMMAND1, COMMAND2,
+ {
+ className: 'number',
+ begin: ' *=', end: '-?\\d*\\.?\\d+(pt|pc|mm|cm|in|dd|cc|ex|em)?',
+ excludeBegin: true
+ }
+ ],
+ relevance: 10
+ },
+ COMMAND1, COMMAND2,
+ SPECIAL,
+ {
+ className: 'formula',
+ begin: '\\$\\$', end: '\\$\\$',
+ contains: [COMMAND1, COMMAND2, SPECIAL],
+ relevance: 0
+ },
+ {
+ className: 'formula',
+ begin: '\\$', end: '\\$',
+ contains: [COMMAND1, COMMAND2, SPECIAL],
+ relevance: 0
+ },
+ {
+ className: 'comment',
+ begin: '%', end: '$',
+ relevance: 0
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Haskell
+Author: Jeremy Hull
+*/
+
+hljs.LANGUAGES.haskell = function(){
+ var LABEL = {
+ className: 'label',
+ begin: '\\b[A-Z][\\w\']*',
+ relevance: 0
+ };
+ var CONTAINER = {
+ className: 'container',
+ begin: '\\(', end: '\\)',
+ contains: [
+ {className: 'label', begin: '\\b[A-Z][\\w\\(\\)\\.\']*'},
+ {className: 'title', begin: '[_a-z][\\w\']*'}
+ ]
+ };
+
+ return {
+ defaultMode: {
+ keywords:
+ 'let in if then else case of where do module import hiding qualified type data ' +
+ 'newtype deriving class instance null not as',
+ contains: [
+ {
+ className: 'comment',
+ begin: '--', end: '$'
+ },
+ {
+ className: 'comment',
+ begin: '{-', end: '-}'
+ },
+ {
+ className: 'string',
+ begin: '\\s+\'', end: '\'',
+ contains: [hljs.BACKSLASH_ESCAPE],
+ relevance: 0
+ },
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'import',
+ begin: '\\bimport', end: '$',
+ keywords: 'import qualified as hiding',
+ contains: [CONTAINER]
+ },
+ {
+ className: 'module',
+ begin: '\\bmodule', end: 'where',
+ keywords: 'module where',
+ contains: [CONTAINER]
+ },
+ {
+ className: 'class',
+ begin: '\\b(class|instance|data|(new)?type)', end: '(where|$)',
+ keywords: 'class where instance data type newtype deriving',
+ contains: [LABEL]
+ },
+ hljs.C_NUMBER_MODE,
+ {
+ className: 'shebang',
+ begin: '#!\\/usr\\/bin\\/env\ runhaskell', end: '$'
+ },
+ LABEL,
+ {
+ className: 'title', begin: '^[_a-z][\\w\']*'
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Erlang
+Description: Erlang is a general-purpose functional language, with strict evaluation, single assignment, and dynamic typing.
+Author: Nikolay Zakharov , Dmitry Kovega
+*/
+
+hljs.LANGUAGES.erlang = function(){
+ var BASIC_ATOM_RE = '[a-z\'][a-zA-Z0-9_\']*';
+ var FUNCTION_NAME_RE = '(' + BASIC_ATOM_RE + ':' + BASIC_ATOM_RE + '|' + BASIC_ATOM_RE + ')';
+ var ERLANG_RESERVED = {
+ keyword:
+ 'after and andalso|10 band begin bnot bor bsl bzr bxor case catch cond div end fun let ' +
+ 'not of orelse|10 query receive rem try when xor',
+ literal:
+ 'false true'
+ };
+
+ var COMMENT = {
+ className: 'comment',
+ begin: '%', end: '$',
+ relevance: 0
+ };
+ var NUMBER = {
+ className: 'number',
+ begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
+ relevance: 0
+ };
+ var NAMED_FUN = {
+ begin: 'fun\\s+' + BASIC_ATOM_RE + '/\\d+'
+ };
+ var FUNCTION_CALL = {
+ begin: FUNCTION_NAME_RE + '\\(', end: '\\)',
+ returnBegin: true,
+ relevance: 0,
+ contains: [
+ {
+ className: 'function_name', begin: FUNCTION_NAME_RE,
+ relevance: 0
+ },
+ {
+ begin: '\\(', end: '\\)', endsWithParent: true,
+ returnEnd: true,
+ relevance: 0
+ // "contains" defined later
+ }
+ ]
+ };
+ var TUPLE = {
+ className: 'tuple',
+ begin: '{', end: '}',
+ relevance: 0
+ // "contains" defined later
+ };
+ var VAR1 = {
+ className: 'variable',
+ begin: '\\b_([A-Z][A-Za-z0-9_]*)?',
+ relevance: 0
+ };
+ var VAR2 = {
+ className: 'variable',
+ begin: '[A-Z][a-zA-Z0-9_]*',
+ relevance: 0
+ };
+ var RECORD_ACCESS = {
+ begin: '#', end: '}',
+ illegal: '.',
+ relevance: 0,
+ returnBegin: true,
+ contains: [
+ {
+ className: 'record_name',
+ begin: '#' + hljs.UNDERSCORE_IDENT_RE,
+ relevance: 0
+ },
+ {
+ begin: '{', endsWithParent: true,
+ relevance: 0
+ // "contains" defined later
+ }
+ ]
+ };
+
+ var BLOCK_STATEMENTS = {
+ keywords: ERLANG_RESERVED,
+ begin: '(fun|receive|if|try|case)', end: 'end'
+ };
+ BLOCK_STATEMENTS.contains = [
+ COMMENT,
+ NAMED_FUN,
+ hljs.inherit(hljs.APOS_STRING_MODE, {className: ''}),
+ BLOCK_STATEMENTS,
+ FUNCTION_CALL,
+ hljs.QUOTE_STRING_MODE,
+ NUMBER,
+ TUPLE,
+ VAR1, VAR2,
+ RECORD_ACCESS
+ ];
+
+ var BASIC_MODES = [
+ COMMENT,
+ NAMED_FUN,
+ BLOCK_STATEMENTS,
+ FUNCTION_CALL,
+ hljs.QUOTE_STRING_MODE,
+ NUMBER,
+ TUPLE,
+ VAR1, VAR2,
+ RECORD_ACCESS
+ ];
+ FUNCTION_CALL.contains[1].contains = BASIC_MODES;
+ TUPLE.contains = BASIC_MODES;
+ RECORD_ACCESS.contains[1].contains = BASIC_MODES;
+
+ var PARAMS = {
+ className: 'params',
+ begin: '\\(', end: '\\)',
+ endsWithParent: true,
+ contains: BASIC_MODES
+ };
+ return {
+ defaultMode: {
+ keywords: ERLANG_RESERVED,
+ illegal: '(|\\*=|\\+=|-=|/=|/\\*|\\*/|\\(\\*|\\*\\))',
+ contains: [
+ {
+ className: 'function',
+ begin: '^' + BASIC_ATOM_RE + '\\(', end: ';|\\.',
+ returnBegin: true,
+ contains: [
+ PARAMS,
+ {
+ className: 'title', begin: BASIC_ATOM_RE
+ },
+ {
+ keywords: ERLANG_RESERVED,
+ begin: '->', endsWithParent: true,
+ contains: BASIC_MODES
+ }
+ ]
+ },
+ COMMENT,
+ {
+ className: 'pp',
+ begin: '^-', end: '\\.',
+ relevance: 0,
+ excludeEnd: true,
+ returnBegin: true,
+ lexems: '-' + hljs.IDENT_RE,
+ keywords:
+ '-module -record -undef -export -ifdef -ifndef -author -copyright -doc -vsn ' +
+ '-import -include -include_lib -compile -define -else -endif -file -behaviour ' +
+ '-behavior',
+ contains: [PARAMS]
+ },
+ NUMBER,
+ hljs.QUOTE_STRING_MODE,
+ RECORD_ACCESS,
+ VAR1, VAR2,
+ TUPLE
+ ]
+ }
+ };
+}();
+/*
+ Language: Erlang REPL
+ Author: Sergey Ignatov
+ */
+
+hljs.LANGUAGES.erlang_repl = {
+ defaultMode: {
+ keywords: {
+ special_functions:
+ 'spawn spawn_link self',
+ reserved:
+ 'after and andalso|10 band begin bnot bor bsl bsr bxor case catch cond div end fun if ' +
+ 'let not of or orelse|10 query receive rem try when xor'
+ },
+ contains: [
+ {
+ className: 'input_number', begin: '^[0-9]+> ',
+ relevance: 10
+ },
+ {
+ className: 'comment',
+ begin: '%', end: '$'
+ },
+ {
+ className: 'number',
+ begin: '\\b(\\d+#[a-fA-F0-9]+|\\d+(\\.\\d+)?([eE][-+]?\\d+)?)',
+ relevance: 0
+ },
+ hljs.APOS_STRING_MODE,
+ hljs.QUOTE_STRING_MODE,
+ {
+ className: 'constant', begin: '\\?(::)?([A-Z]\\w*(::)?)+'
+ },
+ {
+ className: 'arrow', begin: '->'
+ },
+ {
+ className: 'ok', begin: 'ok'
+ },
+ {
+ className: 'exclamation_mark', begin: '!'
+ },
+ {
+ className: 'function_or_atom',
+ begin: '(\\b[a-z\'][a-zA-Z0-9_\']*:[a-z\'][a-zA-Z0-9_\']*)|(\\b[a-z\'][a-zA-Z0-9_\']*)',
+ relevance: 0
+ },
+ {
+ className: 'variable',
+ begin: '[A-Z][a-zA-Z0-9_\']*',
+ relevance: 0
+ }
+ ]
+ }
+};
+/*
+Language: Rust
+Author: Andrey Vlasovskikh
+*/
+
+hljs.LANGUAGES.rust = function() {
+ var TITLE = {
+ className: 'title',
+ begin: hljs.UNDERSCORE_IDENT_RE
+ };
+ var QUOTE_STRING = {
+ className: 'string',
+ begin: '"', end: '"',
+ contains: [hljs.BACKSLASH_ESCAPE],
+ relevance: 0
+ };
+ var NUMBER = {
+ className: 'number',
+ begin: '\\b(0[xb][A-Za-z0-9_]+|[0-9_]+(\\.[0-9_]+)?([uif](8|16|32|64)?)?)',
+ relevance: 0
+ };
+ var KEYWORDS =
+ 'alt any as assert be bind block bool break char check claim const cont dir do else enum ' +
+ 'export f32 f64 fail false float fn for i16 i32 i64 i8 if iface impl import in int let ' +
+ 'log mod mutable native note of prove pure resource ret self str syntax true type u16 u32 ' +
+ 'u64 u8 uint unchecked unsafe use vec while';
+ return {
+ defaultMode: {
+ keywords: KEYWORDS,
+ illegal: '',
+ contains: [
+ hljs.C_LINE_COMMENT_MODE,
+ hljs.C_BLOCK_COMMENT_MODE,
+ QUOTE_STRING,
+ hljs.APOS_STRING_MODE,
+ NUMBER,
+ {
+ className: 'function',
+ beginWithKeyword: true, end: '(\\(|<)',
+ keywords: 'fn',
+ contains: [TITLE]
+ },
+ {
+ className: 'preprocessor',
+ begin: '#\\[', end: '\\]'
+ },
+ {
+ beginWithKeyword: true, end: '(=|<)',
+ keywords: 'type',
+ contains: [TITLE],
+ illegal: '\\S'
+ },
+ {
+ beginWithKeyword: true, end: '({|<)',
+ keywords: 'iface enum',
+ contains: [TITLE],
+ illegal: '\\S'
+ }
+ ]
+ }
+ };
+}();
+/*
+Language: Matlab
+Author: Denis Bardadym
+*/
+
+hljs.LANGUAGES.matlab = {
+ defaultMode: {
+ keywords: {
+ keyword:
+ 'break case catch classdef continue else elseif end enumerated events for function ' +
+ 'global if methods otherwise parfor persistent properties return spmd switch try while',
+ built_in:
+ 'sin sind sinh asin asind asinh cos cosd cosh acos acosd acosh tan tand tanh atan ' +
+ 'atand atan2 atanh sec secd sech asec asecd asech csc cscd csch acsc acscd acsch cot ' +
+ 'cotd coth acot acotd acoth hypot exp expm1 log log1p log10 log2 pow2 realpow reallog ' +
+ 'realsqrt sqrt nthroot nextpow2 abs angle complex conj imag real unwrap isreal ' +
+ 'cplxpair fix floor ceil round mod rem sign airy besselj bessely besselh besseli ' +
+ 'besselk beta betainc betaln ellipj ellipke erf erfc erfcx erfinv expint gamma ' +
+ 'gammainc gammaln psi legendre cross dot factor isprime primes gcd lcm rat rats perms ' +
+ 'nchoosek factorial cart2sph cart2pol pol2cart sph2cart hsv2rgb rgb2hsv zeros ones ' +
+ 'eye repmat rand randn linspace logspace freqspace meshgrid accumarray size length ' +
+ 'ndims numel disp isempty isequal isequalwithequalnans cat reshape diag blkdiag tril ' +
+ 'triu fliplr flipud flipdim rot90 find sub2ind ind2sub bsxfun ndgrid permute ipermute ' +
+ 'shiftdim circshift squeeze isscalar isvector ans eps realmax realmin pi i inf nan ' +
+ 'isnan isinf isfinite j why compan gallery hadamard hankel hilb invhilb magic pascal ' +
+ 'rosser toeplitz vander wilkinson'
+ },
+ illegal: '(//|"|#|/\\*|\\s+/\\w+)',
+ contains: [
+ {
+ className: 'function',
+ beginWithKeyword: true, end: '$',
+ keywords: 'function',
+ contains: [
+ {
+ className: 'title',
+ begin: hljs.UNDERSCORE_IDENT_RE
+ },
+ {
+ className: 'params',
+ begin: '\\(', end: '\\)'
+ },
+ {
+ className: 'params',
+ begin: '\\[', end: '\\]'
+ }
+ ]
+ },
+ {
+ className: 'string',
+ begin: '\'', end: '\'',
+ contains: [hljs.BACKSLASH_ESCAPE, {begin: '\'\''}],
+ relevance: 0
+ },
+ {
+ className: 'comment',
+ begin: '\\%', end: '$'
+ },
+ hljs.C_NUMBER_MODE
+ ]
+ }
+};
+/*
+Language: R
+Author: Joe Cheng
+*/
+
+hljs.LANGUAGES.r = (function() {
+ var IDENT_RE = '([a-zA-Z]|\\.[a-zA-Z.])[a-zA-Z0-9._]*';
+
+ return {
+ defaultMode: {
+ contains: [
+ hljs.HASH_COMMENT_MODE,
+ {
+ begin: IDENT_RE,
+ lexems: IDENT_RE,
+ keywords: {
+ keyword:
+ 'function if in break next repeat else for return switch while try tryCatch|10 ' +
+ 'stop warning require library attach detach source setMethod setGeneric ' +
+ 'setGroupGeneric setClass ...|10',
+ literal:
+ 'NULL NA TRUE FALSE T F Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 ' +
+ 'NA_complex_|10'
+ },
+ relevance: 0
+ },
+ {
+ // hex value
+ className: 'number',
+ begin: "0[xX][0-9a-fA-F]+[Li]?\\b",
+ relevance: 0
+ },
+ {
+ // explicit integer
+ className: 'number',
+ begin: "\\d+(?:[eE][+\\-]?\\d*)?L\\b",
+ relevance: 0
+ },
+ {
+ // number with trailing decimal
+ className: 'number',
+ begin: "\\d+\\.(?!\\d)(?:i\\b)?",
+ relevance: 0
+ },
+ {
+ // number
+ className: 'number',
+ begin: "\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d*)?i?\\b",
+ relevance: 0
+ },
+ {
+ // number with leading decimal
+ className: 'number',
+ begin: "\\.\\d+(?:[eE][+\\-]?\\d*)?i?\\b",
+ relevance: 0
+ },
+
+ {
+ // escaped identifier
+ begin: '`',
+ end: '`',
+ relevance: 0
+ },
+
+ {
+ className: 'string',
+ begin: '"',
+ end: '"',
+ contains: [hljs.BACKSLASH_ESCAPE],
+ relevance: 0
+ },
+ {
+ className: 'string',
+ begin: "'",
+ end: "'",
+ contains: [hljs.BACKSLASH_ESCAPE],
+ relevance: 0
+ },
+ ]
+ }
+ };
+})();
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/package.json
new file mode 100644
index 0000000..c8aa623
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/package.json
@@ -0,0 +1 @@
+{"name":"hljs","version":"6.2.3","description":"Syntax highlighting with language autodetection (yet another modification of highlight.js)","homepage":"https://github.com/pumbur/hljs","keywords":["highlight","syntax"],"main":"hljs.js","repository":{"type":"git","url":"http://github.com/pumbur/hljs.git"}}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/arta.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/arta.css
new file mode 100644
index 0000000..6aa5d75
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/arta.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#222}pre .header,pre .header *,pre .bullet,pre .horizontal_rule,pre .ini .title{color:white}pre .comment,pre .javadoc,pre .preprocessor .title,pre .shebang,pre .diff,pre .pi,pre .doctype,pre .list,pre .special,pre .rules,pre .input_number,pre .template_comment,pre .profile .summary,pre .tag,pre .markdown .tag{color:#444}pre .string,pre .symbol,pre .change,pre .regexp,pre .char,pre .argument,pre .xml .attribute,pre .markdown .attribute,pre .xml .value,pre .markdown .value,pre .markdown .code,pre .ini .value{color:#fc3}pre .number,pre .addition{color:#0c6}pre .built_in,pre .literal,pre .hexcolor,pre .important,pre .flow,pre .link_url,pre .vhdl .typename,pre .go .constant,pre .go .typename,pre .ini .keyword,pre .django .variable,pre .css .funtion,pre .parser3 .variable,pre .actionscript .type{color:#3ae}pre .keyword,pre .method,pre .css .id,pre .pseudo,pre .attr_selector,pre .winutils,pre .tag .title,pre .markdown .tag .title,pre .css .tag,pre .css .class,pre .lisp .title,pre .tex .command,pre .request,pre .status{color:#64a}pre .title,pre .ruby .constant,pre .vala .constant,pre .parent,pre .deletion,pre .template_tag,pre .tail,pre .label,pre .css .keyword,pre .objectivec .class .id,pre .smalltalk .class,pre .lisp .keyword,pre .apache .tag,pre .go .built_in,pre .vbscript .built_in,pre .lua .built_in,pre .rsl .built_in,pre .formula,pre .coffeescript .function,pre .formula *{color:#b16}pre .yardoctag,pre .phpdoc,pre .header,pre .strong,pre .horizontal_rule,pre .bullet,pre .ini .title,pre .apache .tag,pre .parser3 .title{font-weight:bold}pre .emphasis,pre .blockquote{font-style:italic}pre .coffeescript .javascript,pre .xml .javascript,pre .xml .css,pre .xml .cdata{opacity:.6;box-shadow:#64a 2px 0 inset}pre code,pre .javascript,pre .css,pre .xml,pre .subst,pre .variable,pre .envvar,pre .chunk,pre .quoted *,pre .css .value,pre .css .attribute,pre .list .body,pre .tail .params{color:#aaa}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/ascetic.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/ascetic.css
new file mode 100644
index 0000000..a48be35
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/ascetic.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:white;color:black}pre .string,pre .tag .value,pre .filter .argument,pre .addition,pre .change,pre .apache .tag,pre .apache .cbracket,pre .nginx .built_in,pre .tex .formula{color:#888}pre .comment,pre .template_comment,pre .shebang,pre .doctype,pre .pi,pre .javadoc,pre .deletion,pre .apache .sqbracket{color:#ccc}pre .keyword,pre .tag .title,pre .css .tag,pre .ini .title,pre .winutils,pre .flow,pre .lisp .title,pre .apache .tag,pre .tex .command,pre .http .title,pre .request,pre .status{font-weight:bold}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/brown_paper.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/brown_paper.css
new file mode 100644
index 0000000..6531d02
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/brown_paper.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#b7a68e url(./brown_papersq.jpg)}pre .keyword,pre .literal,pre .change,pre .winutils,pre .flow,pre .lisp .title,pre .tex .special,pre .request,pre .status{color:#059;font-weight:bold}pre code,pre .ruby .subst,pre .tag .keyword{color:#363c69}pre .string,pre .title,pre .haskell .label,pre .tag .value,pre .css .rules .value,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .ruby .instancevar,pre .ruby .class .parent,pre .built_in,pre .sql .aggregate,pre .django .template_tag,pre .django .variable,pre .smalltalk .class,pre .javadoc,pre .ruby .string,pre .django .filter .argument,pre .smalltalk .localvars,pre .smalltalk .array,pre .attr_selector,pre .pseudo,pre .addition,pre .stream,pre .envvar,pre .apache .tag,pre .apache .cbracket,pre .tex .number{color:#2c009f}pre .comment,pre .java .annotation,pre .python .decorator,pre .template_comment,pre .pi,pre .doctype,pre .deletion,pre .shebang,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .formula{color:#802022}pre .keyword,pre .literal,pre .css .id,pre .phpdoc,pre .title,pre .haskell .label,pre .vbscript .built_in,pre .sql .aggregate,pre .rsl .built_in,pre .smalltalk .class,pre .diff .header,pre .chunk,pre .winutils,pre .bash .variable,pre .apache .tag,pre .tex .command{font-weight:bold}pre .coffeescript .javascript,pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.8}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/brown_papersq.jpg b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/brown_papersq.jpg
new file mode 100644
index 0000000..9177b8e
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/brown_papersq.jpg differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/dark.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/dark.css
new file mode 100644
index 0000000..65f428d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/dark.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#444}pre .keyword,pre .literal,pre .change,pre .winutils,pre .flow,pre .lisp .title,pre .tex .special{color:white}pre code,pre .ruby .subst{color:#ddd}pre .string,pre .title,pre .haskell .label,pre .ini .title,pre .tag .value,pre .css .rules .value,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .ruby .instancevar,pre .ruby .class .parent,pre .built_in,pre .sql .aggregate,pre .django .template_tag,pre .django .variable,pre .smalltalk .class,pre .javadoc,pre .ruby .string,pre .django .filter .argument,pre .smalltalk .localvars,pre .smalltalk .array,pre .attr_selector,pre .pseudo,pre .addition,pre .stream,pre .envvar,pre .apache .tag,pre .apache .cbracket,pre .tex .command,pre .input_number{color:#d88}pre .comment,pre .java .annotation,pre .python .decorator,pre .template_comment,pre .pi,pre .doctype,pre .deletion,pre .shebang,pre .apache .sqbracket,pre .tex .formula{color:#777}pre .keyword,pre .literal,pre .title,pre .css .id,pre .phpdoc,pre .haskell .label,pre .vbscript .built_in,pre .sql .aggregate,pre .rsl .built_in,pre .smalltalk .class,pre .diff .header,pre .chunk,pre .winutils,pre .bash .variable,pre .apache .tag,pre .tex .special,pre .request,pre .status{font-weight:bold}pre .coffeescript .javascript,pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.5}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/default.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/default.css
new file mode 100644
index 0000000..c2e7a75
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/default.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#f0f0f0}pre code,pre .ruby .subst,pre .tag .title,pre .lisp .title{color:black}pre .string,pre .title,pre .constant,pre .parent,pre .tag .value,pre .rules .value,pre .rules .value .number,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .instancevar,pre .aggregate,pre .template_tag,pre .django .variable,pre .smalltalk .class,pre .addition,pre .flow,pre .stream,pre .bash .variable,pre .apache .tag,pre .apache .cbracket,pre .tex .command,pre .tex .special,pre .erlang_repl .function_or_atom,pre .markdown .header{color:#800}pre .comment,pre .annotation,pre .template_comment,pre .diff .header,pre .chunk,pre .markdown .blockquote{color:#888}pre .number,pre .date,pre .regexp,pre .literal,pre .smalltalk .symbol,pre .smalltalk .char,pre .go .constant,pre .change,pre .markdown .bullet,pre .markdown .link_url{color:#080}pre .label,pre .javadoc,pre .ruby .string,pre .decorator,pre .filter .argument,pre .localvars,pre .array,pre .attr_selector,pre .important,pre .pseudo,pre .pi,pre .doctype,pre .deletion,pre .envvar,pre .shebang,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .formula,pre .erlang_repl .reserved,pre .input_number,pre .markdown .link_label,pre .vhdl .attribute{color:#88f}pre .keyword,pre .id,pre .phpdoc,pre .title,pre .built_in,pre .aggregate,pre .css .tag,pre .javadoctag,pre .phpdoc,pre .yardoctag,pre .smalltalk .class,pre .winutils,pre .bash .variable,pre .apache .tag,pre .go .typename,pre .tex .command,pre .markdown .strong,pre .request,pre .status{font-weight:bold}pre .markdown .emphasis{font-style:italic}pre .nginx .built_in{font-weight:normal}pre .coffeescript .javascript,pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.5}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/far.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/far.css
new file mode 100644
index 0000000..c6862bc
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/far.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:navy}pre code,pre .ruby .subst{color:aqua}pre .string,pre .ruby .string,pre .haskell .label,pre .tag .value,pre .css .rules .value,pre .css .rules .value .number,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .built_in,pre .sql .aggregate,pre .django .template_tag,pre .django .variable,pre .smalltalk .class,pre .addition,pre .apache .tag,pre .apache .cbracket,pre .tex .command{color:yellow}pre .keyword,pre .css .id,pre .title,pre .haskell .label,pre .vbscript .built_in,pre .sql .aggregate,pre .rsl .built_in,pre .smalltalk .class,pre .xml .tag .title,pre .winutils,pre .flow,pre .change,pre .envvar,pre .bash .variable,pre .tex .special{color:white}pre .comment,pre .phpdoc,pre .javadoc,pre .java .annotation,pre .template_comment,pre .deletion,pre .apache .sqbracket,pre .tex .formula{color:#888}pre .number,pre .date,pre .regexp,pre .literal,pre .smalltalk .symbol,pre .smalltalk .char{color:lime}pre .python .decorator,pre .django .filter .argument,pre .smalltalk .localvars,pre .smalltalk .array,pre .attr_selector,pre .pseudo,pre .xml .pi,pre .diff .header,pre .chunk,pre .shebang,pre .nginx .built_in,pre .input_number{color:teal}pre .keyword,pre .css .id,pre .title,pre .haskell .label,pre .vbscript .built_in,pre .sql .aggregate,pre .rsl .built_in,pre .smalltalk .class,pre .winutils,pre .flow,pre .apache .tag,pre .nginx .built_in,pre .tex .command,pre .tex .special,pre .request,pre .status{font-weight:bold}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/github.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/github.css
new file mode 100644
index 0000000..83b0cba
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/github.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;color:black;background:#f8f8ff}pre .comment,pre .template_comment,pre .diff .header,pre .javadoc{color:#998;font-style:italic}pre .keyword,pre .css .rule .keyword,pre .winutils,pre .javascript .title,pre .lisp .title,pre .subst,pre .request,pre .status{color:black;font-weight:bold}pre .number,pre .hexcolor{color:#40a070}pre .string,pre .tag .value,pre .phpdoc,pre .tex .formula{color:#d14}pre .title,pre .id{color:#900;font-weight:bold}pre .javascript .title,pre .lisp .title,pre .subst{font-weight:normal}pre .class .title,pre .haskell .label,pre .vhdl .literal,pre .tex .command{color:#458;font-weight:bold}pre .tag,pre .tag .title,pre .rules .property,pre .django .tag .keyword{color:navy;font-weight:normal}pre .attribute,pre .variable,pre .instancevar,pre .lisp .body{color:teal}pre .regexp{color:#009926}pre .class{color:#458;font-weight:bold}pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .lisp .keyword,pre .tex .special,pre .input_number{color:#990073}pre .builtin,pre .built_in,pre .lisp .title{color:#0086b3}pre .preprocessor,pre .pi,pre .doctype,pre .shebang,pre .cdata{color:#999;font-weight:bold}pre .deletion{background:#fdd}pre .addition{background:#dfd}pre .diff .change{background:#0086b3}pre .chunk{color:#aaa}pre .tex .formula{opacity:.5}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/googlecode.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/googlecode.css
new file mode 100644
index 0000000..d1302f5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/googlecode.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:white;color:black}pre .comment,pre .template_comment,pre .javadoc,pre .comment *{color:#800}pre .keyword,pre .method,pre .list .title,pre .tag .title,pre .setting .value,pre .winutils,pre .tex .command,pre .http .title,pre .request,pre .status{color:#008}pre .envvar,pre .tex .special{color:#660}pre .string,pre .tag .value,pre .cdata,pre .filter .argument,pre .attr_selector,pre .apache .cbracket,pre .date,pre .regexp{color:#080}pre .sub .identifier,pre .pi,pre .tag,pre .tag .keyword,pre .decorator,pre .ini .title,pre .shebang,pre .input_number,pre .hexcolor,pre .rules .value,pre .css .value .number,pre .literal,pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .number,pre .css .function{color:#066}pre .class .title,pre .haskell .label,pre .smalltalk .class,pre .javadoctag,pre .yardoctag,pre .phpdoc,pre .typename,pre .tag .attribute,pre .doctype,pre .class .id,pre .built_in,pre .setting,pre .params,pre .variable{color:#606}pre .css .tag,pre .rules .property,pre .pseudo,pre .subst{color:black}pre .css .class,pre .css .id{color:#9b703f}pre .value .important{color:#f70;font-weight:bold}pre .rules .keyword{color:#c5af75}pre .annotation,pre .apache .sqbracket,pre .nginx .built_in{color:#9b859d}pre .preprocessor,pre .preprocessor *{color:#444}pre .tex .formula{background-color:#eee;font-style:italic}pre .diff .header,pre .chunk{color:gray;font-weight:bold}pre .diff .change{background-color:#bccff9}pre .addition{background-color:#baeeba}pre .deletion{background-color:#ffc8bd}pre .comment .yardoctag{font-weight:bold}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/idea.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/idea.css
new file mode 100644
index 0000000..3919d6d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/idea.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;color:black;background:white}pre .subst,pre .title{font-weight:normal;color:black}pre .comment,pre .template_comment,pre .javadoc,pre .diff .header{color:gray;font-style:italic}pre .annotation,pre .decorator,pre .preprocessor,pre .doctype,pre .pi,pre .chunk,pre .shebang,pre .apache .cbracket,pre .input_number,pre .http .title{color:olive}pre .tag,pre .pi{background:#efefef}pre .tag .title,pre .id,pre .attr_selector,pre .pseudo,pre .literal,pre .keyword,pre .hexcolor,pre .css .function,pre .ini .title,pre .css .class,pre .list .title,pre .tex .command,pre .request,pre .status{font-weight:bold;color:navy}pre .attribute,pre .rules .keyword,pre .number,pre .date,pre .regexp,pre .tex .special{font-weight:bold;color:blue}pre .number,pre .regexp{font-weight:normal}pre .string,pre .value,pre .filter .argument,pre .css .function .params,pre .apache .tag{color:green;font-weight:bold}pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .char,pre .tex .formula{color:black;background:#d0eded;font-style:italic}pre .phpdoc,pre .yardoctag,pre .javadoctag{text-decoration:underline}pre .variable,pre .envvar,pre .apache .sqbracket,pre .nginx .built_in{color:#660e7a}pre .addition{background:#baeeba}pre .deletion{background:#ffc8bd}pre .diff .change{background:#bccff9}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/ir_black.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/ir_black.css
new file mode 100644
index 0000000..9a187ed
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/ir_black.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:black;color:#f8f8f8}pre .shebang,pre .comment,pre .template_comment,pre .javadoc{color:#7c7c7c}pre .keyword,pre .tag,pre .tex .command,pre .request,pre .status{color:#96cbfe}pre .sub .keyword,pre .method,pre .list .title{color:#ffffb6}pre .string,pre .tag .value,pre .cdata,pre .filter .argument,pre .attr_selector,pre .apache .cbracket,pre .date{color:#a8ff60}pre .subst{color:#daefa3}pre .regexp{color:#e9c062}pre .title,pre .sub .identifier,pre .pi,pre .decorator,pre .tex .special,pre .haskell .label,pre .constant,pre .smalltalk .class,pre .javadoctag,pre .yardoctag,pre .phpdoc,pre .nginx .built_in{color:#ffffb6}pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .number,pre .variable,pre .vbscript,pre .literal{color:#c6c5fe}pre .css .tag{color:#96cbfe}pre .css .rules .property,pre .css .id{color:#ffffb6}pre .css .class{color:white}pre .hexcolor{color:#c6c5fe}pre .number{color:#ff73fd}pre .tex .formula{opacity:.7}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/magula.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/magula.css
new file mode 100644
index 0000000..e8c539c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/magula.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background-color:#f4f4f4}pre code,pre .ruby .subst,pre .lisp .title{color:black}pre .string,pre .title,pre .parent,pre .tag .value,pre .rules .value,pre .rules .value .number,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .instancevar,pre .aggregate,pre .template_tag,pre .django .variable,pre .smalltalk .class,pre .addition,pre .flow,pre .stream,pre .bash .variable,pre .apache .cbracket{color:#050}pre .comment,pre .annotation,pre .template_comment,pre .diff .header,pre .chunk{color:#777}pre .number,pre .date,pre .regexp,pre .literal,pre .smalltalk .symbol,pre .smalltalk .char,pre .change,pre .tex .special{color:#800}pre .label,pre .javadoc,pre .ruby .string,pre .decorator,pre .filter .argument,pre .localvars,pre .array,pre .attr_selector,pre .pseudo,pre .pi,pre .doctype,pre .deletion,pre .envvar,pre .shebang,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .formula,pre .input_number{color:#00e}pre .keyword,pre .id,pre .phpdoc,pre .title,pre .built_in,pre .aggregate,pre .smalltalk .class,pre .winutils,pre .bash .variable,pre .apache .tag,pre .xml .tag,pre .tex .command,pre .request,pre .status{font-weight:bold;color:navy}pre .nginx .built_in{font-weight:normal}pre .coffeescript .javascript,pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.5}pre .apache .tag{font-weight:bold;color:blue}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/monokai.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/monokai.css
new file mode 100644
index 0000000..d6ab6f9
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/monokai.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#272822}pre .params .identifier .keymethods{color:#fd971f}pre .tag,pre .tag .title,pre .keyword,pre .literal,pre .change,pre .winutils,pre .flow,pre .lisp .title,pre .tex .special{color:#f92672}pre code{color:#ddd}pre code .constant{color:#66d9ef}pre .class .title{color:white}pre .attribute,pre .symbol,pre .value,pre .regexp{color:#bf79db}pre .tag .value,pre .string,pre .ruby .subst,pre .title,pre .haskell .label,pre .preprocessor,pre .ruby .instancevar,pre .ruby .class .parent,pre .built_in,pre .sql .aggregate,pre .django .template_tag,pre .django .variable,pre .smalltalk .class,pre .javadoc,pre .ruby .string,pre .django .filter .argument,pre .smalltalk .localvars,pre .smalltalk .array,pre .attr_selector,pre .pseudo,pre .addition,pre .stream,pre .envvar,pre .apache .tag,pre .apache .cbracket,pre .tex .command,pre .input_number{color:#a6e22e}pre .comment,pre .java .annotation,pre .python .decorator,pre .template_comment,pre .pi,pre .doctype,pre .deletion,pre .shebang,pre .apache .sqbracket,pre .tex .formula{color:#75715e}pre .keyword,pre .literal,pre .css .id,pre .phpdoc,pre .title,pre .haskell .label,pre .vbscript .built_in,pre .sql .aggregate,pre .rsl .built_in,pre .smalltalk .class,pre .diff .header,pre .chunk,pre .winutils,pre .bash .variable,pre .apache .tag,pre .tex .special,pre .request,pre .status{font-weight:bold}pre .coffeescript .javascript,pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.5}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/school_book.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/school_book.css
new file mode 100644
index 0000000..1afc3ac
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/school_book.css
@@ -0,0 +1 @@
+pre{background:#f6f6ae url(./school_book.png);border-top:solid 2px #d2e8b9;border-bottom:solid 1px #d2e8b9}pre code{display:block;padding:15px .5em .5em 30px;font-size:11px!important;line-height:16px!important}pre .keyword,pre .literal,pre .change,pre .winutils,pre .flow,pre .lisp .title,pre .tex .special{color:#059;font-weight:bold}pre code,pre .ruby .subst,pre .tag .keyword{color:#3e5915}pre .string,pre .title,pre .haskell .label,pre .tag .value,pre .css .rules .value,pre .preprocessor,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .ruby .instancevar,pre .ruby .class .parent,pre .built_in,pre .sql .aggregate,pre .django .template_tag,pre .django .variable,pre .smalltalk .class,pre .javadoc,pre .ruby .string,pre .django .filter .argument,pre .smalltalk .localvars,pre .smalltalk .array,pre .attr_selector,pre .pseudo,pre .addition,pre .stream,pre .envvar,pre .apache .tag,pre .apache .cbracket,pre .nginx .built_in,pre .tex .command{color:#2c009f}pre .comment,pre .java .annotation,pre .python .decorator,pre .template_comment,pre .pi,pre .doctype,pre .deletion,pre .shebang,pre .apache .sqbracket{color:#e60415}pre .keyword,pre .literal,pre .css .id,pre .phpdoc,pre .title,pre .haskell .label,pre .vbscript .built_in,pre .sql .aggregate,pre .rsl .built_in,pre .smalltalk .class,pre .xml .tag .title,pre .diff .header,pre .chunk,pre .winutils,pre .bash .variable,pre .apache .tag,pre .tex .command,pre .request,pre .status{font-weight:bold}pre .coffeescript .javascript,pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.5}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/school_book.png b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/school_book.png
new file mode 100644
index 0000000..767cf2d
Binary files /dev/null and b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/school_book.png differ
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/solarized_dark.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/solarized_dark.css
new file mode 100644
index 0000000..b325b84
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/solarized_dark.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#002b36;color:#839496}pre .comment,pre .template_comment,pre .diff .header,pre .doctype,pre .pi,pre .lisp .string,pre .javadoc{color:#586e75;font-style:italic}pre .keyword,pre .winutils,pre .method,pre .addition,pre .css .tag,pre .request,pre .status{color:#859900}pre .number,pre .command,pre .string,pre .tag .value,pre .phpdoc,pre .tex .formula,pre .regexp,pre .hexcolor{color:#2aa198}pre .title,pre .localvars,pre .chunk,pre .decorator,pre .builtin,pre .built_in,pre .identifier,pre .title .keymethods,pre .vhdl .literal,pre .id{color:#268bd2}pre .attribute,pre .variable,pre .instancevar,pre .lisp .body,pre .smalltalk .number,pre .constant,pre .class .title,pre .parent,pre .haskell .label{color:#b58900}pre .preprocessor,pre .preprocessor .keyword,pre .shebang,pre .symbol,pre .diff .change,pre .special,pre .keymethods,pre .attr_selector,pre .important,pre .subst,pre .cdata{color:#cb4b16}pre .deletion{color:#dc322f}pre .tex .formula{background:#073642}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/solarized_light.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/solarized_light.css
new file mode 100644
index 0000000..e14fffd
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/solarized_light.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#fdf6e3;color:#657b83}pre .comment,pre .template_comment,pre .diff .header,pre .doctype,pre .pi,pre .lisp .string,pre .javadoc{color:#93a1a1;font-style:italic}pre .keyword,pre .winutils,pre .method,pre .addition,pre .css .tag,pre .request,pre .status{color:#859900}pre .number,pre .command,pre .string,pre .tag .value,pre .phpdoc,pre .tex .formula,pre .regexp,pre .hexcolor{color:#2aa198}pre .title,pre .localvars,pre .chunk,pre .decorator,pre .builtin,pre .built_in,pre .identifier,pre .title .keymethods,pre .vhdl .literal,pre .id{color:#268bd2}pre .attribute,pre .variable,pre .instancevar,pre .lisp .body,pre .smalltalk .number,pre .constant,pre .class .title,pre .parent,pre .haskell .label{color:#b58900}pre .preprocessor,pre .preprocessor .keyword,pre .shebang,pre .symbol,pre .diff .change,pre .special,pre .keymethods,pre .attr_selector,pre .important,pre .subst,pre .cdata{color:#cb4b16}pre .deletion{color:#dc322f}pre .tex .formula{background:#eee8d5}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/sunburst.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/sunburst.css
new file mode 100644
index 0000000..c3b1e78
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/sunburst.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:black;color:#f8f8f8}pre .comment,pre .template_comment,pre .javadoc{color:#aeaeae;font-style:italic}pre .keyword,pre .ruby .function .keyword,pre .request,pre .status{color:#e28964}pre .function .keyword,pre .sub .keyword,pre .method,pre .list .title{color:#99cf50}pre .string,pre .tag .value,pre .cdata,pre .filter .argument,pre .attr_selector,pre .apache .cbracket,pre .date,pre .tex .command{color:#65b042}pre .subst{color:#daefa3}pre .regexp{color:#e9c062}pre .title,pre .sub .identifier,pre .pi,pre .tag,pre .tag .keyword,pre .decorator,pre .shebang,pre .input_number{color:#89bdff}pre .class .title,pre .haskell .label,pre .smalltalk .class,pre .javadoctag,pre .yardoctag,pre .phpdoc{text-decoration:underline}pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .number{color:#3387cc}pre .params,pre .variable{color:#3e87e3}pre .css .tag,pre .rules .property,pre .pseudo,pre .tex .special{color:#cda869}pre .css .class{color:#9b703f}pre .rules .keyword{color:#c5af75}pre .rules .value{color:#cf6a4c}pre .css .id{color:#8b98ab}pre .annotation,pre .apache .sqbracket,pre .nginx .built_in{color:#9b859d}pre .preprocessor{color:#8996a8}pre .hexcolor,pre .css .value .number{color:#dd7b3b}pre .css .function{color:#dad085}pre .diff .header,pre .chunk,pre .tex .formula{background-color:#0e2231;color:#f8f8f8;font-style:italic}pre .diff .change{background-color:#4a410d;color:#f8f8f8}pre .addition{background-color:#253b22;color:#f8f8f8}pre .deletion{background-color:#420e09;color:#f8f8f8}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/vs.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/vs.css
new file mode 100644
index 0000000..7462310
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/vs.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em}pre .comment,pre .annotation,pre .template_comment,pre .diff .header,pre .chunk,pre .apache .cbracket{color:green}pre .keyword,pre .id,pre .built_in,pre .smalltalk .class,pre .winutils,pre .bash .variable,pre .tex .command,pre .request,pre .status{color:blue}pre .string,pre .title,pre .parent,pre .tag .value,pre .rules .value,pre .rules .value .number,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .instancevar,pre .aggregate,pre .template_tag,pre .django .variable,pre .addition,pre .flow,pre .stream,pre .apache .tag,pre .date,pre .tex .formula{color:#a31515}pre .ruby .string,pre .decorator,pre .filter .argument,pre .localvars,pre .array,pre .attr_selector,pre .pseudo,pre .pi,pre .doctype,pre .deletion,pre .envvar,pre .shebang,pre .preprocessor,pre .userType,pre .apache .sqbracket,pre .nginx .built_in,pre .tex .special,pre .input_number{color:#2b91af}pre .phpdoc,pre .javadoc,pre .xmlDocTag{color:gray}pre .vhdl .typename{font-weight:bold}pre .vhdl .string{color:#666}pre .vhdl .literal{color:#a31515}pre .vhdl .attribute{color:#00b0e8}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/xcode.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/xcode.css
new file mode 100644
index 0000000..b1f4ea7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/xcode.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:white;color:black}pre .comment,pre .template_comment,pre .javadoc,pre .comment *{color:#006a00}pre .keyword,pre .literal{color:#aa0d91}pre .method,pre .list .title,pre .tag .title,pre .setting .value,pre .winutils,pre .tex .command,pre .http .title,pre .request,pre .status{color:#008}pre .envvar,pre .tex .special{color:#660}pre .string{color:#c41a16}pre .tag .value,pre .cdata,pre .filter .argument,pre .attr_selector,pre .apache .cbracket,pre .date,pre .regexp{color:#080}pre .sub .identifier,pre .pi,pre .tag,pre .tag .keyword,pre .decorator,pre .ini .title,pre .shebang,pre .input_number,pre .hexcolor,pre .rules .value,pre .css .value .number,pre .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .number,pre .css .function{color:#1c00cf}pre .class .title,pre .haskell .label,pre .smalltalk .class,pre .javadoctag,pre .yardoctag,pre .phpdoc,pre .typename,pre .tag .attribute,pre .doctype,pre .class .id,pre .built_in,pre .setting,pre .params{color:#5c2699}pre .variable{color:#3f6e74}pre .css .tag,pre .rules .property,pre .pseudo,pre .subst{color:black}pre .css .class,pre .css .id{color:#9b703f}pre .value .important{color:#f70;font-weight:bold}pre .rules .keyword{color:#c5af75}pre .annotation,pre .apache .sqbracket,pre .nginx .built_in{color:#9b859d}pre .preprocessor,pre .preprocessor *{color:#643820}pre .tex .formula{background-color:#eee;font-style:italic}pre .diff .header,pre .chunk{color:gray;font-weight:bold}pre .diff .change{background-color:#bccff9}pre .addition{background-color:#baeeba}pre .deletion{background-color:#ffc8bd}pre .comment .yardoctag{font-weight:bold}pre .method .id{color:black}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/zenburn.css b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/zenburn.css
new file mode 100644
index 0000000..4106e2b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/hljs/styles/zenburn.css
@@ -0,0 +1 @@
+pre code{display:block;padding:.5em;background:#3f3f3f;color:#dcdcdc}pre .keyword,pre .tag,pre .css .class,pre .css .id,pre .lisp .title,pre .request,pre .status{color:#e3ceab}pre .django .template_tag,pre .django .variable,pre .django .filter .argument{color:#dcdcdc}pre .number,pre .date{color:#8cd0d3}pre .dos .envvar,pre .dos .stream,pre .variable,pre .apache .sqbracket{color:#efdcbc}pre .dos .flow,pre .diff .change,pre .python .exception,pre .python .built_in,pre .literal,pre .tex .special{color:#efefaf}pre .diff .chunk,pre .ruby .subst{color:#8f8f8f}pre .dos .keyword,pre .python .decorator,pre .title,pre .haskell .label,pre .diff .header,pre .ruby .class .parent,pre .apache .tag,pre .nginx .built_in,pre .tex .command,pre .input_number{color:#efef8f}pre .dos .winutils,pre .ruby .symbol,pre .ruby .symbol .string,pre .ruby .symbol .keyword,pre .ruby .symbol .keymethods,pre .ruby .string,pre .ruby .instancevar{color:#dca3a3}pre .diff .deletion,pre .string,pre .tag .value,pre .preprocessor,pre .built_in,pre .sql .aggregate,pre .javadoc,pre .smalltalk .class,pre .smalltalk .localvars,pre .smalltalk .array,pre .css .rules .value,pre .attr_selector,pre .pseudo,pre .apache .cbracket,pre .tex .formula{color:#cc9393}pre .shebang,pre .diff .addition,pre .comment,pre .java .annotation,pre .template_comment,pre .pi,pre .doctype{color:#7f9f7f}pre .coffeescript .javascript,pre .xml .css,pre .xml .javascript,pre .xml .vbscript,pre .tex .formula{opacity:.5}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/.npmignore b/node_modules/anvil.js/node_modules/ape/node_modules/jade/.npmignore
new file mode 100644
index 0000000..b9af3d4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/.npmignore
@@ -0,0 +1,15 @@
+test
+support
+benchmarks
+examples
+lib-cov
+coverage.html
+.gitmodules
+.travis.yml
+History.md
+Readme.md
+Makefile
+test/
+support/
+benchmarks/
+examples/
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/LICENSE b/node_modules/anvil.js/node_modules/ape/node_modules/jade/LICENSE
new file mode 100644
index 0000000..8ad0e0d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/LICENSE
@@ -0,0 +1,22 @@
+(The MIT License)
+
+Copyright (c) 2009-2010 TJ Holowaychuk
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/index.js
new file mode 100644
index 0000000..8ad059f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/index.js
@@ -0,0 +1,4 @@
+
+module.exports = process.env.JADE_COV
+ ? require('./lib-cov/jade')
+ : require('./lib/jade');
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.js
new file mode 100644
index 0000000..1983a20
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.js
@@ -0,0 +1,3586 @@
+(function() {
+
+// CommonJS require()
+
+function require(p){
+ var path = require.resolve(p)
+ , mod = require.modules[path];
+ if (!mod) throw new Error('failed to require "' + p + '"');
+ if (!mod.exports) {
+ mod.exports = {};
+ mod.call(mod.exports, mod, mod.exports, require.relative(path));
+ }
+ return mod.exports;
+ }
+
+require.modules = {};
+
+require.resolve = function (path){
+ var orig = path
+ , reg = path + '.js'
+ , index = path + '/index.js';
+ return require.modules[reg] && reg
+ || require.modules[index] && index
+ || orig;
+ };
+
+require.register = function (path, fn){
+ require.modules[path] = fn;
+ };
+
+require.relative = function (parent) {
+ return function(p){
+ if ('.' != p.charAt(0)) return require(p);
+
+ var path = parent.split('/')
+ , segs = p.split('/');
+ path.pop();
+
+ for (var i = 0; i < segs.length; i++) {
+ var seg = segs[i];
+ if ('..' == seg) path.pop();
+ else if ('.' != seg) path.push(seg);
+ }
+
+ return require(path.join('/'));
+ };
+ };
+
+
+require.register("compiler.js", function(module, exports, require){
+
+/*!
+ * Jade - Compiler
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var nodes = require('./nodes')
+ , filters = require('./filters')
+ , doctypes = require('./doctypes')
+ , selfClosing = require('./self-closing')
+ , runtime = require('./runtime')
+ , utils = require('./utils');
+
+
+ if (!Object.keys) {
+ Object.keys = function(obj){
+ var arr = [];
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ arr.push(key);
+ }
+ }
+ return arr;
+ }
+ }
+
+ if (!String.prototype.trimLeft) {
+ String.prototype.trimLeft = function(){
+ return this.replace(/^\s+/, '');
+ }
+ }
+
+
+
+/**
+ * Initialize `Compiler` with the given `node`.
+ *
+ * @param {Node} node
+ * @param {Object} options
+ * @api public
+ */
+
+var Compiler = module.exports = function Compiler(node, options) {
+ this.options = options = options || {};
+ this.node = node;
+ this.hasCompiledDoctype = false;
+ this.hasCompiledTag = false;
+ this.pp = options.pretty || false;
+ this.debug = false !== options.compileDebug;
+ this.indents = 0;
+ this.parentIndents = 0;
+ if (options.doctype) this.setDoctype(options.doctype);
+};
+
+/**
+ * Compiler prototype.
+ */
+
+Compiler.prototype = {
+
+ /**
+ * Compile parse tree to JavaScript.
+ *
+ * @api public
+ */
+
+ compile: function(){
+ this.buf = ['var interp;'];
+ if (this.pp) this.buf.push("var __indent = [];");
+ this.lastBufferedIdx = -1;
+ this.visit(this.node);
+ return this.buf.join('\n');
+ },
+
+ /**
+ * Sets the default doctype `name`. Sets terse mode to `true` when
+ * html 5 is used, causing self-closing tags to end with ">" vs "/>",
+ * and boolean attributes are not mirrored.
+ *
+ * @param {string} name
+ * @api public
+ */
+
+ setDoctype: function(name){
+ var doctype = doctypes[(name || 'default').toLowerCase()];
+ doctype = doctype || '';
+ this.doctype = doctype;
+ this.terse = '5' == name || 'html' == name;
+ this.xml = 0 == this.doctype.indexOf(' 1 && !escape && block.nodes[0].isText && block.nodes[1].isText)
+ this.prettyIndent(1, true);
+
+ for (var i = 0; i < len; ++i) {
+ // Pretty print text
+ if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText)
+ this.prettyIndent(1, false);
+
+ this.visit(block.nodes[i]);
+ // Multiple text nodes are separated by newlines
+ if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText)
+ this.buffer('\\n');
+ }
+ },
+
+ /**
+ * Visit `doctype`. Sets terse mode to `true` when html 5
+ * is used, causing self-closing tags to end with ">" vs "/>",
+ * and boolean attributes are not mirrored.
+ *
+ * @param {Doctype} doctype
+ * @api public
+ */
+
+ visitDoctype: function(doctype){
+ if (doctype && (doctype.val || !this.doctype)) {
+ this.setDoctype(doctype.val || 'default');
+ }
+
+ if (this.doctype) this.buffer(this.doctype);
+ this.hasCompiledDoctype = true;
+ },
+
+ /**
+ * Visit `mixin`, generating a function that
+ * may be called within the template.
+ *
+ * @param {Mixin} mixin
+ * @api public
+ */
+
+ visitMixin: function(mixin){
+ var name = mixin.name.replace(/-/g, '_') + '_mixin'
+ , args = mixin.args || ''
+ , block = mixin.block
+ , attrs = mixin.attrs
+ , pp = this.pp;
+
+ if (mixin.call) {
+ if (pp) this.buf.push("__indent.push('" + Array(this.indents + 1).join(' ') + "');")
+ if (block || attrs.length) {
+
+ this.buf.push(name + '.call({');
+
+ if (block) {
+ this.buf.push('block: function(){');
+
+ // Render block with no indents, dynamically added when rendered
+ this.parentIndents++;
+ var _indents = this.indents;
+ this.indents = 0;
+ this.visit(mixin.block);
+ this.indents = _indents;
+ this.parentIndents--;
+
+ if (attrs.length) {
+ this.buf.push('},');
+ } else {
+ this.buf.push('}');
+ }
+ }
+
+ if (attrs.length) {
+ var val = this.attrs(attrs);
+ if (val.inherits) {
+ this.buf.push('attributes: merge({' + val.buf
+ + '}, attributes), escaped: merge(' + val.escaped + ', escaped, true)');
+ } else {
+ this.buf.push('attributes: {' + val.buf + '}, escaped: ' + val.escaped);
+ }
+ }
+
+ if (args) {
+ this.buf.push('}, ' + args + ');');
+ } else {
+ this.buf.push('});');
+ }
+
+ } else {
+ this.buf.push(name + '(' + args + ');');
+ }
+ if (pp) this.buf.push("__indent.pop();")
+ } else {
+ this.buf.push('var ' + name + ' = function(' + args + '){');
+ this.buf.push('var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};');
+ this.parentIndents++;
+ this.visit(block);
+ this.parentIndents--;
+ this.buf.push('};');
+ }
+ },
+
+ /**
+ * Visit `tag` buffering tag markup, generating
+ * attributes, visiting the `tag`'s code and block.
+ *
+ * @param {Tag} tag
+ * @api public
+ */
+
+ visitTag: function(tag){
+ this.indents++;
+ var name = tag.name
+ , pp = this.pp;
+
+ if (tag.buffer) name = "' + (" + name + ") + '";
+
+ if (!this.hasCompiledTag) {
+ if (!this.hasCompiledDoctype && 'html' == name) {
+ this.visitDoctype();
+ }
+ this.hasCompiledTag = true;
+ }
+
+ // pretty print
+ if (pp && !tag.isInline())
+ this.prettyIndent(0, true);
+
+ if ((~selfClosing.indexOf(name) || tag.selfClosing) && !this.xml) {
+ this.buffer('<' + name);
+ this.visitAttributes(tag.attrs);
+ this.terse
+ ? this.buffer('>')
+ : this.buffer('/>');
+ } else {
+ // Optimize attributes buffering
+ if (tag.attrs.length) {
+ this.buffer('<' + name);
+ if (tag.attrs.length) this.visitAttributes(tag.attrs);
+ this.buffer('>');
+ } else {
+ this.buffer('<' + name + '>');
+ }
+ if (tag.code) this.visitCode(tag.code);
+ this.escape = 'pre' == tag.name;
+ this.visit(tag.block);
+
+ // pretty print
+ if (pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline())
+ this.prettyIndent(0, true);
+
+ this.buffer('' + name + '>');
+ }
+ this.indents--;
+ },
+
+ /**
+ * Visit `filter`, throwing when the filter does not exist.
+ *
+ * @param {Filter} filter
+ * @api public
+ */
+
+ visitFilter: function(filter){
+ var fn = filters[filter.name];
+
+ // unknown filter
+ if (!fn) {
+ if (filter.isASTFilter) {
+ throw new Error('unknown ast filter "' + filter.name + ':"');
+ } else {
+ throw new Error('unknown filter ":' + filter.name + '"');
+ }
+ }
+
+ if (filter.isASTFilter) {
+ this.buf.push(fn(filter.block, this, filter.attrs));
+ } else {
+ var text = filter.block.nodes.map(function(node){ return node.val }).join('\n');
+ filter.attrs = filter.attrs || {};
+ filter.attrs.filename = this.options.filename;
+ this.buffer(utils.text(fn(text, filter.attrs)));
+ }
+ },
+
+ /**
+ * Visit `text` node.
+ *
+ * @param {Text} text
+ * @api public
+ */
+
+ visitText: function(text){
+ text = utils.text(text.val.replace(/\\/g, '\\\\'));
+ if (this.escape) text = escape(text);
+ this.buffer(text);
+ },
+
+ /**
+ * Visit a `comment`, only buffering when the buffer flag is set.
+ *
+ * @param {Comment} comment
+ * @api public
+ */
+
+ visitComment: function(comment){
+ if (!comment.buffer) return;
+ if (this.pp) this.prettyIndent(1, true);
+ this.buffer('');
+ },
+
+ /**
+ * Visit a `BlockComment`.
+ *
+ * @param {Comment} comment
+ * @api public
+ */
+
+ visitBlockComment: function(comment){
+ if (!comment.buffer) return;
+ if (0 == comment.val.trim().indexOf('if')) {
+ this.buffer('');
+ } else {
+ this.buffer('');
+ }
+ },
+
+ /**
+ * Visit `code`, respecting buffer / escape flags.
+ * If the code is followed by a block, wrap it in
+ * a self-calling function.
+ *
+ * @param {Code} code
+ * @api public
+ */
+
+ visitCode: function(code){
+ // Wrap code blocks with {}.
+ // we only wrap unbuffered code blocks ATM
+ // since they are usually flow control
+
+ // Buffer code
+ if (code.buffer) {
+ var val = code.val.trimLeft();
+ this.buf.push('var __val__ = ' + val);
+ val = 'null == __val__ ? "" : __val__';
+ if (code.escape) val = 'escape(' + val + ')';
+ this.buf.push("buf.push(" + val + ");");
+ } else {
+ this.buf.push(code.val);
+ }
+
+ // Block support
+ if (code.block) {
+ if (!code.buffer) this.buf.push('{');
+ this.visit(code.block);
+ if (!code.buffer) this.buf.push('}');
+ }
+ },
+
+ /**
+ * Visit `each` block.
+ *
+ * @param {Each} each
+ * @api public
+ */
+
+ visitEach: function(each){
+ this.buf.push(''
+ + '// iterate ' + each.obj + '\n'
+ + ';(function(){\n'
+ + ' if (\'number\' == typeof ' + each.obj + '.length) {\n'
+ + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n'
+ + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n');
+
+ this.visit(each.block);
+
+ this.buf.push(''
+ + ' }\n'
+ + ' } else {\n'
+ + ' for (var ' + each.key + ' in ' + each.obj + ') {\n'
+ + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){'
+ + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n');
+
+ this.visit(each.block);
+
+ this.buf.push(' }\n');
+
+ this.buf.push(' }\n }\n}).call(this);\n');
+ },
+
+ /**
+ * Visit `attrs`.
+ *
+ * @param {Array} attrs
+ * @api public
+ */
+
+ visitAttributes: function(attrs){
+ var val = this.attrs(attrs);
+ if (val.inherits) {
+ this.buf.push("buf.push(attrs(merge({ " + val.buf +
+ " }, attributes), merge(" + val.escaped + ", escaped, true)));");
+ } else if (val.constant) {
+ eval('var buf={' + val.buf + '};');
+ this.buffer(runtime.attrs(buf, JSON.parse(val.escaped)), true);
+ } else {
+ this.buf.push("buf.push(attrs({ " + val.buf + " }, " + val.escaped + "));");
+ }
+ },
+
+ /**
+ * Compile attributes.
+ */
+
+ attrs: function(attrs){
+ var buf = []
+ , classes = []
+ , escaped = {}
+ , constant = attrs.every(function(attr){ return isConstant(attr.val) })
+ , inherits = false;
+
+ if (this.terse) buf.push('terse: true');
+
+ attrs.forEach(function(attr){
+ if (attr.name == 'attributes') return inherits = true;
+ escaped[attr.name] = attr.escaped;
+ if (attr.name == 'class') {
+ classes.push('(' + attr.val + ')');
+ } else {
+ var pair = "'" + attr.name + "':(" + attr.val + ')';
+ buf.push(pair);
+ }
+ });
+
+ if (classes.length) {
+ classes = classes.join(" + ' ' + ");
+ buf.push("class: " + classes);
+ }
+
+ return {
+ buf: buf.join(', ').replace('class:', '"class":'),
+ escaped: JSON.stringify(escaped),
+ inherits: inherits,
+ constant: constant
+ };
+ }
+};
+
+/**
+ * Check if expression can be evaluated to a constant
+ *
+ * @param {String} expression
+ * @return {Boolean}
+ * @api private
+ */
+
+function isConstant(val){
+ // Check strings/literals
+ if (/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val))
+ return true;
+
+ // Check numbers
+ if (!isNaN(Number(val)))
+ return true;
+
+ // Check arrays
+ var matches;
+ if (matches = /^ *\[(.*)\] *$/.exec(val))
+ return matches[1].split(',').every(isConstant);
+
+ return false;
+}
+
+/**
+ * Escape the given string of `html`.
+ *
+ * @param {String} html
+ * @return {String}
+ * @api private
+ */
+
+function escape(html){
+ return String(html)
+ .replace(/&(?!\w+;)/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"');
+}
+}); // module: compiler.js
+
+require.register("doctypes.js", function(module, exports, require){
+
+/*!
+ * Jade - doctypes
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = {
+ '5': ''
+ , 'default': ''
+ , 'xml': ''
+ , 'transitional': ''
+ , 'strict': ''
+ , 'frameset': ''
+ , '1.1': ''
+ , 'basic': ''
+ , 'mobile': ''
+};
+}); // module: doctypes.js
+
+require.register("filters.js", function(module, exports, require){
+
+/*!
+ * Jade - filters
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = {
+
+ /**
+ * Wrap text with CDATA block.
+ */
+
+ cdata: function(str){
+ return '';
+ },
+
+ /**
+ * Transform sass to css, wrapped in style tags.
+ */
+
+ sass: function(str){
+ str = str.replace(/\\n/g, '\n');
+ var sass = require('sass').render(str).replace(/\n/g, '\\n');
+ return '';
+ },
+
+ /**
+ * Transform stylus to css, wrapped in style tags.
+ */
+
+ stylus: function(str, options){
+ var ret;
+ str = str.replace(/\\n/g, '\n');
+ var stylus = require('stylus');
+ stylus(str, options).render(function(err, css){
+ if (err) throw err;
+ ret = css.replace(/\n/g, '\\n');
+ });
+ return '';
+ },
+
+ /**
+ * Transform less to css, wrapped in style tags.
+ */
+
+ less: function(str){
+ var ret;
+ str = str.replace(/\\n/g, '\n');
+ require('less').render(str, function(err, css){
+ if (err) throw err;
+ ret = '';
+ });
+ return ret;
+ },
+
+ /**
+ * Transform markdown to html.
+ */
+
+ markdown: function(str){
+ var md;
+
+ // support markdown / discount
+ try {
+ md = require('markdown');
+ } catch (err){
+ try {
+ md = require('discount');
+ } catch (err) {
+ try {
+ md = require('markdown-js');
+ } catch (err) {
+ try {
+ md = require('marked');
+ } catch (err) {
+ throw new
+ Error('Cannot find markdown library, install markdown, discount, or marked.');
+ }
+ }
+ }
+ }
+
+ str = str.replace(/\\n/g, '\n');
+ return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,''');
+ },
+
+ /**
+ * Transform coffeescript to javascript.
+ */
+
+ coffeescript: function(str){
+ str = str.replace(/\\n/g, '\n');
+ var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n');
+ return '';
+ }
+};
+
+}); // module: filters.js
+
+require.register("inline-tags.js", function(module, exports, require){
+
+/*!
+ * Jade - inline tags
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = [
+ 'a'
+ , 'abbr'
+ , 'acronym'
+ , 'b'
+ , 'br'
+ , 'code'
+ , 'em'
+ , 'font'
+ , 'i'
+ , 'img'
+ , 'ins'
+ , 'kbd'
+ , 'map'
+ , 'samp'
+ , 'small'
+ , 'span'
+ , 'strong'
+ , 'sub'
+ , 'sup'
+];
+}); // module: inline-tags.js
+
+require.register("jade.js", function(module, exports, require){
+/*!
+ * Jade
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Parser = require('./parser')
+ , Lexer = require('./lexer')
+ , Compiler = require('./compiler')
+ , runtime = require('./runtime')
+
+/**
+ * Library version.
+ */
+
+exports.version = '0.26.1';
+
+/**
+ * Expose self closing tags.
+ */
+
+exports.selfClosing = require('./self-closing');
+
+/**
+ * Default supported doctypes.
+ */
+
+exports.doctypes = require('./doctypes');
+
+/**
+ * Text filters.
+ */
+
+exports.filters = require('./filters');
+
+/**
+ * Utilities.
+ */
+
+exports.utils = require('./utils');
+
+/**
+ * Expose `Compiler`.
+ */
+
+exports.Compiler = Compiler;
+
+/**
+ * Expose `Parser`.
+ */
+
+exports.Parser = Parser;
+
+/**
+ * Expose `Lexer`.
+ */
+
+exports.Lexer = Lexer;
+
+/**
+ * Nodes.
+ */
+
+exports.nodes = require('./nodes');
+
+/**
+ * Jade runtime helpers.
+ */
+
+exports.runtime = runtime;
+
+/**
+ * Template function cache.
+ */
+
+exports.cache = {};
+
+/**
+ * Parse the given `str` of jade and return a function body.
+ *
+ * @param {String} str
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function parse(str, options){
+ try {
+ // Parse
+ var parser = new Parser(str, options.filename, options);
+
+ // Compile
+ var compiler = new (options.compiler || Compiler)(parser.parse(), options)
+ , js = compiler.compile();
+
+ // Debug compiler
+ if (options.debug) {
+ console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' '));
+ }
+
+ return ''
+ + 'var buf = [];\n'
+ + (options.self
+ ? 'var self = locals || {};\n' + js
+ : 'with (locals || {}) {\n' + js + '\n}\n')
+ + 'return buf.join("");';
+ } catch (err) {
+ parser = parser.context();
+ runtime.rethrow(err, parser.filename, parser.lexer.lineno);
+ }
+}
+
+/**
+ * Compile a `Function` representation of the given jade `str`.
+ *
+ * Options:
+ *
+ * - `compileDebug` when `false` debugging code is stripped from the compiled template
+ * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()`
+ * for use with the Jade client-side runtime.js
+ *
+ * @param {String} str
+ * @param {Options} options
+ * @return {Function}
+ * @api public
+ */
+
+exports.compile = function(str, options){
+ var options = options || {}
+ , client = options.client
+ , filename = options.filename
+ ? JSON.stringify(options.filename)
+ : 'undefined'
+ , fn;
+
+ if (options.compileDebug !== false) {
+ fn = [
+ 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];'
+ , 'try {'
+ , parse(String(str), options)
+ , '} catch (err) {'
+ , ' rethrow(err, __jade[0].filename, __jade[0].lineno);'
+ , '}'
+ ].join('\n');
+ } else {
+ fn = parse(String(str), options);
+ }
+
+ if (client) {
+ fn = 'attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n' + fn;
+ }
+
+ fn = new Function('locals, attrs, escape, rethrow, merge', fn);
+
+ if (client) return fn;
+
+ return function(locals){
+ return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow, runtime.merge);
+ };
+};
+
+/**
+ * Render the given `str` of jade and invoke
+ * the callback `fn(err, str)`.
+ *
+ * Options:
+ *
+ * - `cache` enable template caching
+ * - `filename` filename required for `include` / `extends` and caching
+ *
+ * @param {String} str
+ * @param {Object|Function} options or fn
+ * @param {Function} fn
+ * @api public
+ */
+
+exports.render = function(str, options, fn){
+ // swap args
+ if ('function' == typeof options) {
+ fn = options, options = {};
+ }
+
+ // cache requires .filename
+ if (options.cache && !options.filename) {
+ return fn(new Error('the "filename" option is required for caching'));
+ }
+
+ try {
+ var path = options.filename;
+ var tmpl = options.cache
+ ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options))
+ : exports.compile(str, options);
+ fn(null, tmpl(options));
+ } catch (err) {
+ fn(err);
+ }
+};
+
+/**
+ * Render a Jade file at the given `path` and callback `fn(err, str)`.
+ *
+ * @param {String} path
+ * @param {Object|Function} options or callback
+ * @param {Function} fn
+ * @api public
+ */
+
+exports.renderFile = function(path, options, fn){
+ var key = path + ':string';
+
+ if ('function' == typeof options) {
+ fn = options, options = {};
+ }
+
+ try {
+ options.filename = path;
+ var str = options.cache
+ ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8'))
+ : fs.readFileSync(path, 'utf8');
+ exports.render(str, options, fn);
+ } catch (err) {
+ fn(err);
+ }
+};
+
+/**
+ * Express support.
+ */
+
+exports.__express = exports.renderFile;
+
+}); // module: jade.js
+
+require.register("lexer.js", function(module, exports, require){
+
+/*!
+ * Jade - Lexer
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Initialize `Lexer` with the given `str`.
+ *
+ * Options:
+ *
+ * - `colons` allow colons for attr delimiters
+ *
+ * @param {String} str
+ * @param {Object} options
+ * @api private
+ */
+
+var Lexer = module.exports = function Lexer(str, options) {
+ options = options || {};
+ this.input = str.replace(/\r\n|\r/g, '\n');
+ this.colons = options.colons;
+ this.deferredTokens = [];
+ this.lastIndents = 0;
+ this.lineno = 1;
+ this.stash = [];
+ this.indentStack = [];
+ this.indentRe = null;
+ this.pipeless = false;
+};
+
+/**
+ * Lexer prototype.
+ */
+
+Lexer.prototype = {
+
+ /**
+ * Construct a token with the given `type` and `val`.
+ *
+ * @param {String} type
+ * @param {String} val
+ * @return {Object}
+ * @api private
+ */
+
+ tok: function(type, val){
+ return {
+ type: type
+ , line: this.lineno
+ , val: val
+ }
+ },
+
+ /**
+ * Consume the given `len` of input.
+ *
+ * @param {Number} len
+ * @api private
+ */
+
+ consume: function(len){
+ this.input = this.input.substr(len);
+ },
+
+ /**
+ * Scan for `type` with the given `regexp`.
+ *
+ * @param {String} type
+ * @param {RegExp} regexp
+ * @return {Object}
+ * @api private
+ */
+
+ scan: function(regexp, type){
+ var captures;
+ if (captures = regexp.exec(this.input)) {
+ this.consume(captures[0].length);
+ return this.tok(type, captures[1]);
+ }
+ },
+
+ /**
+ * Defer the given `tok`.
+ *
+ * @param {Object} tok
+ * @api private
+ */
+
+ defer: function(tok){
+ this.deferredTokens.push(tok);
+ },
+
+ /**
+ * Lookahead `n` tokens.
+ *
+ * @param {Number} n
+ * @return {Object}
+ * @api private
+ */
+
+ lookahead: function(n){
+ var fetch = n - this.stash.length;
+ while (fetch-- > 0) this.stash.push(this.next());
+ return this.stash[--n];
+ },
+
+ /**
+ * Return the indexOf `start` / `end` delimiters.
+ *
+ * @param {String} start
+ * @param {String} end
+ * @return {Number}
+ * @api private
+ */
+
+ indexOfDelimiters: function(start, end){
+ var str = this.input
+ , nstart = 0
+ , nend = 0
+ , pos = 0;
+ for (var i = 0, len = str.length; i < len; ++i) {
+ if (start == str.charAt(i)) {
+ ++nstart;
+ } else if (end == str.charAt(i)) {
+ if (++nend == nstart) {
+ pos = i;
+ break;
+ }
+ }
+ }
+ return pos;
+ },
+
+ /**
+ * Stashed token.
+ */
+
+ stashed: function() {
+ return this.stash.length
+ && this.stash.shift();
+ },
+
+ /**
+ * Deferred token.
+ */
+
+ deferred: function() {
+ return this.deferredTokens.length
+ && this.deferredTokens.shift();
+ },
+
+ /**
+ * end-of-source.
+ */
+
+ eos: function() {
+ if (this.input.length) return;
+ if (this.indentStack.length) {
+ this.indentStack.shift();
+ return this.tok('outdent');
+ } else {
+ return this.tok('eos');
+ }
+ },
+
+ /**
+ * Blank line.
+ */
+
+ blank: function() {
+ var captures;
+ if (captures = /^\n *\n/.exec(this.input)) {
+ this.consume(captures[0].length - 1);
+ if (this.pipeless) return this.tok('text', '');
+ return this.next();
+ }
+ },
+
+ /**
+ * Comment.
+ */
+
+ comment: function() {
+ var captures;
+ if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('comment', captures[2]);
+ tok.buffer = '-' != captures[1];
+ return tok;
+ }
+ },
+
+ /**
+ * Interpolated tag.
+ */
+
+ interpolation: function() {
+ var captures;
+ if (captures = /^#\{(.*?)\}/.exec(this.input)) {
+ this.consume(captures[0].length);
+ return this.tok('interpolation', captures[1]);
+ }
+ },
+
+ /**
+ * Tag.
+ */
+
+ tag: function() {
+ var captures;
+ if (captures = /^(\w[-:\w]*)(\/?)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok, name = captures[1];
+ if (':' == name[name.length - 1]) {
+ name = name.slice(0, -1);
+ tok = this.tok('tag', name);
+ this.defer(this.tok(':'));
+ while (' ' == this.input[0]) this.input = this.input.substr(1);
+ } else {
+ tok = this.tok('tag', name);
+ }
+ tok.selfClosing = !! captures[2];
+ return tok;
+ }
+ },
+
+ /**
+ * Filter.
+ */
+
+ filter: function() {
+ return this.scan(/^:(\w+)/, 'filter');
+ },
+
+ /**
+ * Doctype.
+ */
+
+ doctype: function() {
+ return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype');
+ },
+
+ /**
+ * Id.
+ */
+
+ id: function() {
+ return this.scan(/^#([\w-]+)/, 'id');
+ },
+
+ /**
+ * Class.
+ */
+
+ className: function() {
+ return this.scan(/^\.([\w-]+)/, 'class');
+ },
+
+ /**
+ * Text.
+ */
+
+ text: function() {
+ return this.scan(/^(?:\| ?| ?)?([^\n]+)/, 'text');
+ },
+
+ /**
+ * Extends.
+ */
+
+ "extends": function() {
+ return this.scan(/^extends? +([^\n]+)/, 'extends');
+ },
+
+ /**
+ * Block prepend.
+ */
+
+ prepend: function() {
+ var captures;
+ if (captures = /^prepend +([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var mode = 'prepend'
+ , name = captures[1]
+ , tok = this.tok('block', name);
+ tok.mode = mode;
+ return tok;
+ }
+ },
+
+ /**
+ * Block append.
+ */
+
+ append: function() {
+ var captures;
+ if (captures = /^append +([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var mode = 'append'
+ , name = captures[1]
+ , tok = this.tok('block', name);
+ tok.mode = mode;
+ return tok;
+ }
+ },
+
+ /**
+ * Block.
+ */
+
+ block: function() {
+ var captures;
+ if (captures = /^block\b *(?:(prepend|append) +)?([^\n]*)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var mode = captures[1] || 'replace'
+ , name = captures[2]
+ , tok = this.tok('block', name);
+
+ tok.mode = mode;
+ return tok;
+ }
+ },
+
+ /**
+ * Yield.
+ */
+
+ yield: function() {
+ return this.scan(/^yield */, 'yield');
+ },
+
+ /**
+ * Include.
+ */
+
+ include: function() {
+ return this.scan(/^include +([^\n]+)/, 'include');
+ },
+
+ /**
+ * Case.
+ */
+
+ "case": function() {
+ return this.scan(/^case +([^\n]+)/, 'case');
+ },
+
+ /**
+ * When.
+ */
+
+ when: function() {
+ return this.scan(/^when +([^:\n]+)/, 'when');
+ },
+
+ /**
+ * Default.
+ */
+
+ "default": function() {
+ return this.scan(/^default */, 'default');
+ },
+
+ /**
+ * Assignment.
+ */
+
+ assignment: function() {
+ var captures;
+ if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var name = captures[1]
+ , val = captures[2];
+ return this.tok('code', 'var ' + name + ' = (' + val + ');');
+ }
+ },
+
+ /**
+ * Call mixin.
+ */
+
+ call: function(){
+ var captures;
+ if (captures = /^\+([-\w]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('call', captures[1]);
+
+ // Check for args (not attributes)
+ if (captures = /^ *\((.*?)\)/.exec(this.input)) {
+ if (!/^ *[-\w]+ *=/.test(captures[1])) {
+ this.consume(captures[0].length);
+ tok.args = captures[1];
+ }
+ }
+
+ return tok;
+ }
+ },
+
+ /**
+ * Mixin.
+ */
+
+ mixin: function(){
+ var captures;
+ if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('mixin', captures[1]);
+ tok.args = captures[2];
+ return tok;
+ }
+ },
+
+ /**
+ * Conditional.
+ */
+
+ conditional: function() {
+ var captures;
+ if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var type = captures[1]
+ , js = captures[2];
+
+ switch (type) {
+ case 'if': js = 'if (' + js + ')'; break;
+ case 'unless': js = 'if (!(' + js + '))'; break;
+ case 'else if': js = 'else if (' + js + ')'; break;
+ case 'else': js = 'else'; break;
+ }
+
+ return this.tok('code', js);
+ }
+ },
+
+ /**
+ * While.
+ */
+
+ "while": function() {
+ var captures;
+ if (captures = /^while +([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ return this.tok('code', 'while (' + captures[1] + ')');
+ }
+ },
+
+ /**
+ * Each.
+ */
+
+ each: function() {
+ var captures;
+ if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('each', captures[1]);
+ tok.key = captures[2] || '$index';
+ tok.code = captures[3];
+ return tok;
+ }
+ },
+
+ /**
+ * Code.
+ */
+
+ code: function() {
+ var captures;
+ if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var flags = captures[1];
+ captures[1] = captures[2];
+ var tok = this.tok('code', captures[1]);
+ tok.escape = flags[0] === '=';
+ tok.buffer = flags[0] === '=' || flags[1] === '=';
+ return tok;
+ }
+ },
+
+ /**
+ * Attributes.
+ */
+
+ attrs: function() {
+ if ('(' == this.input.charAt(0)) {
+ var index = this.indexOfDelimiters('(', ')')
+ , str = this.input.substr(1, index-1)
+ , tok = this.tok('attrs')
+ , len = str.length
+ , colons = this.colons
+ , states = ['key']
+ , escapedAttr
+ , key = ''
+ , val = ''
+ , quote
+ , c
+ , p;
+
+ function state(){
+ return states[states.length - 1];
+ }
+
+ function interpolate(attr) {
+ return attr.replace(/#\{([^}]+)\}/g, function(_, expr){
+ return quote + " + (" + expr + ") + " + quote;
+ });
+ }
+
+ this.consume(index + 1);
+ tok.attrs = {};
+ tok.escaped = {};
+
+ function parse(c) {
+ var real = c;
+ // TODO: remove when people fix ":"
+ if (colons && ':' == c) c = '=';
+ switch (c) {
+ case ',':
+ case '\n':
+ switch (state()) {
+ case 'expr':
+ case 'array':
+ case 'string':
+ case 'object':
+ val += c;
+ break;
+ default:
+ states.push('key');
+ val = val.trim();
+ key = key.trim();
+ if ('' == key) return;
+ key = key.replace(/^['"]|['"]$/g, '').replace('!', '');
+ tok.escaped[key] = escapedAttr;
+ tok.attrs[key] = '' == val
+ ? true
+ : interpolate(val);
+ key = val = '';
+ }
+ break;
+ case '=':
+ switch (state()) {
+ case 'key char':
+ key += real;
+ break;
+ case 'val':
+ case 'expr':
+ case 'array':
+ case 'string':
+ case 'object':
+ val += real;
+ break;
+ default:
+ escapedAttr = '!' != p;
+ states.push('val');
+ }
+ break;
+ case '(':
+ if ('val' == state()
+ || 'expr' == state()) states.push('expr');
+ val += c;
+ break;
+ case ')':
+ if ('expr' == state()
+ || 'val' == state()) states.pop();
+ val += c;
+ break;
+ case '{':
+ if ('val' == state()) states.push('object');
+ val += c;
+ break;
+ case '}':
+ if ('object' == state()) states.pop();
+ val += c;
+ break;
+ case '[':
+ if ('val' == state()) states.push('array');
+ val += c;
+ break;
+ case ']':
+ if ('array' == state()) states.pop();
+ val += c;
+ break;
+ case '"':
+ case "'":
+ switch (state()) {
+ case 'key':
+ states.push('key char');
+ break;
+ case 'key char':
+ states.pop();
+ break;
+ case 'string':
+ if (c == quote) states.pop();
+ val += c;
+ break;
+ default:
+ states.push('string');
+ val += c;
+ quote = c;
+ }
+ break;
+ case '':
+ break;
+ default:
+ switch (state()) {
+ case 'key':
+ case 'key char':
+ key += c;
+ break;
+ default:
+ val += c;
+ }
+ }
+ p = c;
+ }
+
+ for (var i = 0; i < len; ++i) {
+ parse(str.charAt(i));
+ }
+
+ parse(',');
+
+ if ('/' == this.input.charAt(0)) {
+ this.consume(1);
+ tok.selfClosing = true;
+ }
+
+ return tok;
+ }
+ },
+
+ /**
+ * Indent | Outdent | Newline.
+ */
+
+ indent: function() {
+ var captures, re;
+
+ // established regexp
+ if (this.indentRe) {
+ captures = this.indentRe.exec(this.input);
+ // determine regexp
+ } else {
+ // tabs
+ re = /^\n(\t*) */;
+ captures = re.exec(this.input);
+
+ // spaces
+ if (captures && !captures[1].length) {
+ re = /^\n( *)/;
+ captures = re.exec(this.input);
+ }
+
+ // established
+ if (captures && captures[1].length) this.indentRe = re;
+ }
+
+ if (captures) {
+ var tok
+ , indents = captures[1].length;
+
+ ++this.lineno;
+ this.consume(indents + 1);
+
+ if (' ' == this.input[0] || '\t' == this.input[0]) {
+ throw new Error('Invalid indentation, you can use tabs or spaces but not both');
+ }
+
+ // blank line
+ if ('\n' == this.input[0]) return this.tok('newline');
+
+ // outdent
+ if (this.indentStack.length && indents < this.indentStack[0]) {
+ while (this.indentStack.length && this.indentStack[0] > indents) {
+ this.stash.push(this.tok('outdent'));
+ this.indentStack.shift();
+ }
+ tok = this.stash.pop();
+ // indent
+ } else if (indents && indents != this.indentStack[0]) {
+ this.indentStack.unshift(indents);
+ tok = this.tok('indent', indents);
+ // newline
+ } else {
+ tok = this.tok('newline');
+ }
+
+ return tok;
+ }
+ },
+
+ /**
+ * Pipe-less text consumed only when
+ * pipeless is true;
+ */
+
+ pipelessText: function() {
+ if (this.pipeless) {
+ if ('\n' == this.input[0]) return;
+ var i = this.input.indexOf('\n');
+ if (-1 == i) i = this.input.length;
+ var str = this.input.substr(0, i);
+ this.consume(str.length);
+ return this.tok('text', str);
+ }
+ },
+
+ /**
+ * ':'
+ */
+
+ colon: function() {
+ return this.scan(/^: */, ':');
+ },
+
+ /**
+ * Return the next token object, or those
+ * previously stashed by lookahead.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ advance: function(){
+ return this.stashed()
+ || this.next();
+ },
+
+ /**
+ * Return the next token object.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ next: function() {
+ return this.deferred()
+ || this.blank()
+ || this.eos()
+ || this.pipelessText()
+ || this.yield()
+ || this.doctype()
+ || this.interpolation()
+ || this["case"]()
+ || this.when()
+ || this["default"]()
+ || this["extends"]()
+ || this.append()
+ || this.prepend()
+ || this.block()
+ || this.include()
+ || this.mixin()
+ || this.call()
+ || this.conditional()
+ || this.each()
+ || this["while"]()
+ || this.assignment()
+ || this.tag()
+ || this.filter()
+ || this.code()
+ || this.id()
+ || this.className()
+ || this.attrs()
+ || this.indent()
+ || this.comment()
+ || this.colon()
+ || this.text();
+ }
+};
+
+}); // module: lexer.js
+
+require.register("nodes/attrs.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Attrs
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node'),
+ Block = require('./block');
+
+/**
+ * Initialize a `Attrs` node.
+ *
+ * @api public
+ */
+
+var Attrs = module.exports = function Attrs() {
+ this.attrs = [];
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Attrs.prototype = new Node;
+Attrs.prototype.constructor = Attrs;
+
+
+/**
+ * Set attribute `name` to `val`, keep in mind these become
+ * part of a raw js object literal, so to quote a value you must
+ * '"quote me"', otherwise or example 'user.name' is literal JavaScript.
+ *
+ * @param {String} name
+ * @param {String} val
+ * @param {Boolean} escaped
+ * @return {Tag} for chaining
+ * @api public
+ */
+
+Attrs.prototype.setAttribute = function(name, val, escaped){
+ this.attrs.push({ name: name, val: val, escaped: escaped });
+ return this;
+};
+
+/**
+ * Remove attribute `name` when present.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+Attrs.prototype.removeAttribute = function(name){
+ for (var i = 0, len = this.attrs.length; i < len; ++i) {
+ if (this.attrs[i] && this.attrs[i].name == name) {
+ delete this.attrs[i];
+ }
+ }
+};
+
+/**
+ * Get attribute value by `name`.
+ *
+ * @param {String} name
+ * @return {String}
+ * @api public
+ */
+
+Attrs.prototype.getAttribute = function(name){
+ for (var i = 0, len = this.attrs.length; i < len; ++i) {
+ if (this.attrs[i] && this.attrs[i].name == name) {
+ return this.attrs[i].val;
+ }
+ }
+};
+
+}); // module: nodes/attrs.js
+
+require.register("nodes/block-comment.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - BlockComment
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `BlockComment` with the given `block`.
+ *
+ * @param {String} val
+ * @param {Block} block
+ * @param {Boolean} buffer
+ * @api public
+ */
+
+var BlockComment = module.exports = function BlockComment(val, block, buffer) {
+ this.block = block;
+ this.val = val;
+ this.buffer = buffer;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+BlockComment.prototype = new Node;
+BlockComment.prototype.constructor = BlockComment;
+
+}); // module: nodes/block-comment.js
+
+require.register("nodes/block.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Block
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a new `Block` with an optional `node`.
+ *
+ * @param {Node} node
+ * @api public
+ */
+
+var Block = module.exports = function Block(node){
+ this.nodes = [];
+ if (node) this.push(node);
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Block.prototype = new Node;
+Block.prototype.constructor = Block;
+
+
+/**
+ * Block flag.
+ */
+
+Block.prototype.isBlock = true;
+
+/**
+ * Replace the nodes in `other` with the nodes
+ * in `this` block.
+ *
+ * @param {Block} other
+ * @api private
+ */
+
+Block.prototype.replace = function(other){
+ other.nodes = this.nodes;
+};
+
+/**
+ * Pust the given `node`.
+ *
+ * @param {Node} node
+ * @return {Number}
+ * @api public
+ */
+
+Block.prototype.push = function(node){
+ return this.nodes.push(node);
+};
+
+/**
+ * Check if this block is empty.
+ *
+ * @return {Boolean}
+ * @api public
+ */
+
+Block.prototype.isEmpty = function(){
+ return 0 == this.nodes.length;
+};
+
+/**
+ * Unshift the given `node`.
+ *
+ * @param {Node} node
+ * @return {Number}
+ * @api public
+ */
+
+Block.prototype.unshift = function(node){
+ return this.nodes.unshift(node);
+};
+
+/**
+ * Return the "last" block, or the first `yield` node.
+ *
+ * @return {Block}
+ * @api private
+ */
+
+Block.prototype.includeBlock = function(){
+ var ret = this
+ , node;
+
+ for (var i = 0, len = this.nodes.length; i < len; ++i) {
+ node = this.nodes[i];
+ if (node.yield) return node;
+ else if (node.textOnly) continue;
+ else if (node.includeBlock) ret = node.includeBlock();
+ else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock();
+ }
+
+ return ret;
+};
+
+/**
+ * Return a clone of this block.
+ *
+ * @return {Block}
+ * @api private
+ */
+
+Block.prototype.clone = function(){
+ var clone = new Block;
+ for (var i = 0, len = this.nodes.length; i < len; ++i) {
+ clone.push(this.nodes[i].clone());
+ }
+ return clone;
+};
+
+
+}); // module: nodes/block.js
+
+require.register("nodes/case.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Case
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a new `Case` with `expr`.
+ *
+ * @param {String} expr
+ * @api public
+ */
+
+var Case = exports = module.exports = function Case(expr, block){
+ this.expr = expr;
+ this.block = block;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Case.prototype = new Node;
+Case.prototype.constructor = Case;
+
+
+var When = exports.When = function When(expr, block){
+ this.expr = expr;
+ this.block = block;
+ this.debug = false;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+When.prototype = new Node;
+When.prototype.constructor = When;
+
+
+
+}); // module: nodes/case.js
+
+require.register("nodes/code.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Code
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Code` node with the given code `val`.
+ * Code may also be optionally buffered and escaped.
+ *
+ * @param {String} val
+ * @param {Boolean} buffer
+ * @param {Boolean} escape
+ * @api public
+ */
+
+var Code = module.exports = function Code(val, buffer, escape) {
+ this.val = val;
+ this.buffer = buffer;
+ this.escape = escape;
+ if (val.match(/^ *else/)) this.debug = false;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Code.prototype = new Node;
+Code.prototype.constructor = Code;
+
+}); // module: nodes/code.js
+
+require.register("nodes/comment.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Comment
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Comment` with the given `val`, optionally `buffer`,
+ * otherwise the comment may render in the output.
+ *
+ * @param {String} val
+ * @param {Boolean} buffer
+ * @api public
+ */
+
+var Comment = module.exports = function Comment(val, buffer) {
+ this.val = val;
+ this.buffer = buffer;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Comment.prototype = new Node;
+Comment.prototype.constructor = Comment;
+
+}); // module: nodes/comment.js
+
+require.register("nodes/doctype.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Doctype
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Doctype` with the given `val`.
+ *
+ * @param {String} val
+ * @api public
+ */
+
+var Doctype = module.exports = function Doctype(val) {
+ this.val = val;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Doctype.prototype = new Node;
+Doctype.prototype.constructor = Doctype;
+
+}); // module: nodes/doctype.js
+
+require.register("nodes/each.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Each
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize an `Each` node, representing iteration
+ *
+ * @param {String} obj
+ * @param {String} val
+ * @param {String} key
+ * @param {Block} block
+ * @api public
+ */
+
+var Each = module.exports = function Each(obj, val, key, block) {
+ this.obj = obj;
+ this.val = val;
+ this.key = key;
+ this.block = block;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Each.prototype = new Node;
+Each.prototype.constructor = Each;
+
+}); // module: nodes/each.js
+
+require.register("nodes/filter.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Filter
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node')
+ , Block = require('./block');
+
+/**
+ * Initialize a `Filter` node with the given
+ * filter `name` and `block`.
+ *
+ * @param {String} name
+ * @param {Block|Node} block
+ * @api public
+ */
+
+var Filter = module.exports = function Filter(name, block, attrs) {
+ this.name = name;
+ this.block = block;
+ this.attrs = attrs;
+ this.isASTFilter = !block.nodes.every(function(node){ return node.isText });
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Filter.prototype = new Node;
+Filter.prototype.constructor = Filter;
+
+}); // module: nodes/filter.js
+
+require.register("nodes/index.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+exports.Node = require('./node');
+exports.Tag = require('./tag');
+exports.Code = require('./code');
+exports.Each = require('./each');
+exports.Case = require('./case');
+exports.Text = require('./text');
+exports.Block = require('./block');
+exports.Mixin = require('./mixin');
+exports.Filter = require('./filter');
+exports.Comment = require('./comment');
+exports.Literal = require('./literal');
+exports.BlockComment = require('./block-comment');
+exports.Doctype = require('./doctype');
+
+}); // module: nodes/index.js
+
+require.register("nodes/literal.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Literal
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Literal` node with the given `str.
+ *
+ * @param {String} str
+ * @api public
+ */
+
+var Literal = module.exports = function Literal(str) {
+ this.str = str
+ .replace(/\\/g, "\\\\")
+ .replace(/\n|\r\n/g, "\\n")
+ .replace(/'/g, "\\'");
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Literal.prototype = new Node;
+Literal.prototype.constructor = Literal;
+
+
+}); // module: nodes/literal.js
+
+require.register("nodes/mixin.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Mixin
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Attrs = require('./attrs');
+
+/**
+ * Initialize a new `Mixin` with `name` and `block`.
+ *
+ * @param {String} name
+ * @param {String} args
+ * @param {Block} block
+ * @api public
+ */
+
+var Mixin = module.exports = function Mixin(name, args, block, call){
+ this.name = name;
+ this.args = args;
+ this.block = block;
+ this.attrs = [];
+ this.call = call;
+};
+
+/**
+ * Inherit from `Attrs`.
+ */
+
+Mixin.prototype = new Attrs;
+Mixin.prototype.constructor = Mixin;
+
+
+
+}); // module: nodes/mixin.js
+
+require.register("nodes/node.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Node
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Initialize a `Node`.
+ *
+ * @api public
+ */
+
+var Node = module.exports = function Node(){};
+
+/**
+ * Clone this node (return itself)
+ *
+ * @return {Node}
+ * @api private
+ */
+
+Node.prototype.clone = function(){
+ return this;
+};
+
+}); // module: nodes/node.js
+
+require.register("nodes/tag.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Tag
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Attrs = require('./attrs'),
+ Block = require('./block'),
+ inlineTags = require('../inline-tags');
+
+/**
+ * Initialize a `Tag` node with the given tag `name` and optional `block`.
+ *
+ * @param {String} name
+ * @param {Block} block
+ * @api public
+ */
+
+var Tag = module.exports = function Tag(name, block) {
+ this.name = name;
+ this.attrs = [];
+ this.block = block || new Block;
+};
+
+/**
+ * Inherit from `Attrs`.
+ */
+
+Tag.prototype = new Attrs;
+Tag.prototype.constructor = Tag;
+
+
+/**
+ * Clone this tag.
+ *
+ * @return {Tag}
+ * @api private
+ */
+
+Tag.prototype.clone = function(){
+ var clone = new Tag(this.name, this.block.clone());
+ clone.line = this.line;
+ clone.attrs = this.attrs;
+ clone.textOnly = this.textOnly;
+ return clone;
+};
+
+/**
+ * Check if this tag is an inline tag.
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+Tag.prototype.isInline = function(){
+ return ~inlineTags.indexOf(this.name);
+};
+
+/**
+ * Check if this tag's contents can be inlined. Used for pretty printing.
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+Tag.prototype.canInline = function(){
+ var nodes = this.block.nodes;
+
+ function isInline(node){
+ // Recurse if the node is a block
+ if (node.isBlock) return node.nodes.every(isInline);
+ return node.isText || (node.isInline && node.isInline());
+ }
+
+ // Empty tag
+ if (!nodes.length) return true;
+
+ // Text-only or inline-only tag
+ if (1 == nodes.length) return isInline(nodes[0]);
+
+ // Multi-line inline-only tag
+ if (this.block.nodes.every(isInline)) {
+ for (var i = 1, len = nodes.length; i < len; ++i) {
+ if (nodes[i-1].isText && nodes[i].isText)
+ return false;
+ }
+ return true;
+ }
+
+ // Mixed tag
+ return false;
+};
+}); // module: nodes/tag.js
+
+require.register("nodes/text.js", function(module, exports, require){
+
+/*!
+ * Jade - nodes - Text
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Text` node with optional `line`.
+ *
+ * @param {String} line
+ * @api public
+ */
+
+var Text = module.exports = function Text(line) {
+ this.val = '';
+ if ('string' == typeof line) this.val = line;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Text.prototype = new Node;
+Text.prototype.constructor = Text;
+
+
+/**
+ * Flag as text.
+ */
+
+Text.prototype.isText = true;
+}); // module: nodes/text.js
+
+require.register("parser.js", function(module, exports, require){
+
+/*!
+ * Jade - Parser
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Lexer = require('./lexer')
+ , nodes = require('./nodes');
+
+/**
+ * Initialize `Parser` with the given input `str` and `filename`.
+ *
+ * @param {String} str
+ * @param {String} filename
+ * @param {Object} options
+ * @api public
+ */
+
+var Parser = exports = module.exports = function Parser(str, filename, options){
+ this.input = str;
+ this.lexer = new Lexer(str, options);
+ this.filename = filename;
+ this.blocks = {};
+ this.mixins = {};
+ this.options = options;
+ this.contexts = [this];
+};
+
+/**
+ * Tags that may not contain tags.
+ */
+
+var textOnly = exports.textOnly = ['script', 'style'];
+
+/**
+ * Parser prototype.
+ */
+
+Parser.prototype = {
+
+ /**
+ * Push `parser` onto the context stack,
+ * or pop and return a `Parser`.
+ */
+
+ context: function(parser){
+ if (parser) {
+ this.contexts.push(parser);
+ } else {
+ return this.contexts.pop();
+ }
+ },
+
+ /**
+ * Return the next token object.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ advance: function(){
+ return this.lexer.advance();
+ },
+
+ /**
+ * Skip `n` tokens.
+ *
+ * @param {Number} n
+ * @api private
+ */
+
+ skip: function(n){
+ while (n--) this.advance();
+ },
+
+ /**
+ * Single token lookahead.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ peek: function() {
+ return this.lookahead(1);
+ },
+
+ /**
+ * Return lexer lineno.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+ line: function() {
+ return this.lexer.lineno;
+ },
+
+ /**
+ * `n` token lookahead.
+ *
+ * @param {Number} n
+ * @return {Object}
+ * @api private
+ */
+
+ lookahead: function(n){
+ return this.lexer.lookahead(n);
+ },
+
+ /**
+ * Parse input returning a string of js for evaluation.
+ *
+ * @return {String}
+ * @api public
+ */
+
+ parse: function(){
+ var block = new nodes.Block, parser;
+ block.line = this.line();
+
+ while ('eos' != this.peek().type) {
+ if ('newline' == this.peek().type) {
+ this.advance();
+ } else {
+ block.push(this.parseExpr());
+ }
+ }
+
+ if (parser = this.extending) {
+ this.context(parser);
+ var ast = parser.parse();
+ this.context();
+ // hoist mixins
+ for (var name in this.mixins)
+ ast.unshift(this.mixins[name]);
+ return ast;
+ }
+
+ return block;
+ },
+
+ /**
+ * Expect the given type, or throw an exception.
+ *
+ * @param {String} type
+ * @api private
+ */
+
+ expect: function(type){
+ if (this.peek().type === type) {
+ return this.advance();
+ } else {
+ throw new Error('expected "' + type + '", but got "' + this.peek().type + '"');
+ }
+ },
+
+ /**
+ * Accept the given `type`.
+ *
+ * @param {String} type
+ * @api private
+ */
+
+ accept: function(type){
+ if (this.peek().type === type) {
+ return this.advance();
+ }
+ },
+
+ /**
+ * tag
+ * | doctype
+ * | mixin
+ * | include
+ * | filter
+ * | comment
+ * | text
+ * | each
+ * | code
+ * | yield
+ * | id
+ * | class
+ * | interpolation
+ */
+
+ parseExpr: function(){
+ switch (this.peek().type) {
+ case 'tag':
+ return this.parseTag();
+ case 'mixin':
+ return this.parseMixin();
+ case 'block':
+ return this.parseBlock();
+ case 'case':
+ return this.parseCase();
+ case 'when':
+ return this.parseWhen();
+ case 'default':
+ return this.parseDefault();
+ case 'extends':
+ return this.parseExtends();
+ case 'include':
+ return this.parseInclude();
+ case 'doctype':
+ return this.parseDoctype();
+ case 'filter':
+ return this.parseFilter();
+ case 'comment':
+ return this.parseComment();
+ case 'text':
+ return this.parseText();
+ case 'each':
+ return this.parseEach();
+ case 'code':
+ return this.parseCode();
+ case 'call':
+ return this.parseCall();
+ case 'interpolation':
+ return this.parseInterpolation();
+ case 'yield':
+ this.advance();
+ var block = new nodes.Block;
+ block.yield = true;
+ return block;
+ case 'id':
+ case 'class':
+ var tok = this.advance();
+ this.lexer.defer(this.lexer.tok('tag', 'div'));
+ this.lexer.defer(tok);
+ return this.parseExpr();
+ default:
+ throw new Error('unexpected token "' + this.peek().type + '"');
+ }
+ },
+
+ /**
+ * Text
+ */
+
+ parseText: function(){
+ var tok = this.expect('text')
+ , node = new nodes.Text(tok.val);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * ':' expr
+ * | block
+ */
+
+ parseBlockExpansion: function(){
+ if (':' == this.peek().type) {
+ this.advance();
+ return new nodes.Block(this.parseExpr());
+ } else {
+ return this.block();
+ }
+ },
+
+ /**
+ * case
+ */
+
+ parseCase: function(){
+ var val = this.expect('case').val
+ , node = new nodes.Case(val);
+ node.line = this.line();
+ node.block = this.block();
+ return node;
+ },
+
+ /**
+ * when
+ */
+
+ parseWhen: function(){
+ var val = this.expect('when').val
+ return new nodes.Case.When(val, this.parseBlockExpansion());
+ },
+
+ /**
+ * default
+ */
+
+ parseDefault: function(){
+ this.expect('default');
+ return new nodes.Case.When('default', this.parseBlockExpansion());
+ },
+
+ /**
+ * code
+ */
+
+ parseCode: function(){
+ var tok = this.expect('code')
+ , node = new nodes.Code(tok.val, tok.buffer, tok.escape)
+ , block
+ , i = 1;
+ node.line = this.line();
+ while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i;
+ block = 'indent' == this.lookahead(i).type;
+ if (block) {
+ this.skip(i-1);
+ node.block = this.block();
+ }
+ return node;
+ },
+
+ /**
+ * comment
+ */
+
+ parseComment: function(){
+ var tok = this.expect('comment')
+ , node;
+
+ if ('indent' == this.peek().type) {
+ node = new nodes.BlockComment(tok.val, this.block(), tok.buffer);
+ } else {
+ node = new nodes.Comment(tok.val, tok.buffer);
+ }
+
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * doctype
+ */
+
+ parseDoctype: function(){
+ var tok = this.expect('doctype')
+ , node = new nodes.Doctype(tok.val);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * filter attrs? text-block
+ */
+
+ parseFilter: function(){
+ var block
+ , tok = this.expect('filter')
+ , attrs = this.accept('attrs');
+
+ this.lexer.pipeless = true;
+ block = this.parseTextBlock();
+ this.lexer.pipeless = false;
+
+ var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * tag ':' attrs? block
+ */
+
+ parseASTFilter: function(){
+ var block
+ , tok = this.expect('tag')
+ , attrs = this.accept('attrs');
+
+ this.expect(':');
+ block = this.block();
+
+ var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * each block
+ */
+
+ parseEach: function(){
+ var tok = this.expect('each')
+ , node = new nodes.Each(tok.code, tok.val, tok.key);
+ node.line = this.line();
+ node.block = this.block();
+ return node;
+ },
+
+ /**
+ * 'extends' name
+ */
+
+ parseExtends: function(){
+ var path = require('path')
+ , fs = require('fs')
+ , dirname = path.dirname
+ , basename = path.basename
+ , join = path.join;
+
+ if (!this.filename)
+ throw new Error('the "filename" option is required to extend templates');
+
+ var path = this.expect('extends').val.trim()
+ , dir = dirname(this.filename);
+
+ var path = join(dir, path + '.jade')
+ , str = fs.readFileSync(path, 'utf8')
+ , parser = new Parser(str, path, this.options);
+
+ parser.blocks = this.blocks;
+ parser.contexts = this.contexts;
+ this.extending = parser;
+
+ // TODO: null node
+ return new nodes.Literal('');
+ },
+
+ /**
+ * 'block' name block
+ */
+
+ parseBlock: function(){
+ var block = this.expect('block')
+ , mode = block.mode
+ , name = block.val.trim();
+
+ block = 'indent' == this.peek().type
+ ? this.block()
+ : new nodes.Block(new nodes.Literal(''));
+
+ var prev = this.blocks[name];
+
+ if (prev) {
+ switch (prev.mode) {
+ case 'append':
+ block.nodes = block.nodes.concat(prev.nodes);
+ prev = block;
+ break;
+ case 'prepend':
+ block.nodes = prev.nodes.concat(block.nodes);
+ prev = block;
+ break;
+ }
+ }
+
+ block.mode = mode;
+ return this.blocks[name] = prev || block;
+ },
+
+ /**
+ * include block?
+ */
+
+ parseInclude: function(){
+ var path = require('path')
+ , fs = require('fs')
+ , dirname = path.dirname
+ , basename = path.basename
+ , join = path.join;
+
+ var path = this.expect('include').val.trim()
+ , dir = dirname(this.filename);
+
+ if (!this.filename)
+ throw new Error('the "filename" option is required to use includes');
+
+ // no extension
+ if (!~basename(path).indexOf('.')) {
+ path += '.jade';
+ }
+
+ // non-jade
+ if ('.jade' != path.substr(-5)) {
+ var path = join(dir, path)
+ , str = fs.readFileSync(path, 'utf8');
+ return new nodes.Literal(str);
+ }
+
+ var path = join(dir, path)
+ , str = fs.readFileSync(path, 'utf8')
+ , parser = new Parser(str, path, this.options);
+ parser.blocks = this.blocks;
+ parser.mixins = this.mixins;
+
+ this.context(parser);
+ var ast = parser.parse();
+ this.context();
+ ast.filename = path;
+
+ if ('indent' == this.peek().type) {
+ ast.includeBlock().push(this.block());
+ }
+
+ return ast;
+ },
+
+ /**
+ * call ident block
+ */
+
+ parseCall: function(){
+ var tok = this.expect('call')
+ , name = tok.val
+ , args = tok.args
+ , mixin = new nodes.Mixin(name, args, new nodes.Block, true);
+
+ this.tag(mixin);
+ if (mixin.block.isEmpty()) mixin.block = null;
+ return mixin;
+ },
+
+ /**
+ * mixin block
+ */
+
+ parseMixin: function(){
+ var tok = this.expect('mixin')
+ , name = tok.val
+ , args = tok.args
+ , mixin;
+
+ // definition
+ if ('indent' == this.peek().type) {
+ mixin = new nodes.Mixin(name, args, this.block(), false);
+ this.mixins[name] = mixin;
+ return mixin;
+ // call
+ } else {
+ return new nodes.Mixin(name, args, null, true);
+ }
+ },
+
+ /**
+ * indent (text | newline)* outdent
+ */
+
+ parseTextBlock: function(){
+ var block = new nodes.Block;
+ block.line = this.line();
+ var spaces = this.expect('indent').val;
+ if (null == this._spaces) this._spaces = spaces;
+ var indent = Array(spaces - this._spaces + 1).join(' ');
+ while ('outdent' != this.peek().type) {
+ switch (this.peek().type) {
+ case 'newline':
+ this.advance();
+ break;
+ case 'indent':
+ this.parseTextBlock().nodes.forEach(function(node){
+ block.push(node);
+ });
+ break;
+ default:
+ var text = new nodes.Text(indent + this.advance().val);
+ text.line = this.line();
+ block.push(text);
+ }
+ }
+
+ if (spaces == this._spaces) this._spaces = null;
+ this.expect('outdent');
+ return block;
+ },
+
+ /**
+ * indent expr* outdent
+ */
+
+ block: function(){
+ var block = new nodes.Block;
+ block.line = this.line();
+ this.expect('indent');
+ while ('outdent' != this.peek().type) {
+ if ('newline' == this.peek().type) {
+ this.advance();
+ } else {
+ block.push(this.parseExpr());
+ }
+ }
+ this.expect('outdent');
+ return block;
+ },
+
+ /**
+ * interpolation (attrs | class | id)* (text | code | ':')? newline* block?
+ */
+
+ parseInterpolation: function(){
+ var tok = this.advance();
+ var tag = new nodes.Tag(tok.val);
+ tag.buffer = true;
+ return this.tag(tag);
+ },
+
+ /**
+ * tag (attrs | class | id)* (text | code | ':')? newline* block?
+ */
+
+ parseTag: function(){
+ // ast-filter look-ahead
+ var i = 2;
+ if ('attrs' == this.lookahead(i).type) ++i;
+ if (':' == this.lookahead(i).type) {
+ if ('indent' == this.lookahead(++i).type) {
+ return this.parseASTFilter();
+ }
+ }
+
+ var tok = this.advance()
+ , tag = new nodes.Tag(tok.val);
+
+ tag.selfClosing = tok.selfClosing;
+
+ return this.tag(tag);
+ },
+
+ /**
+ * Parse tag.
+ */
+
+ tag: function(tag){
+ var dot;
+
+ tag.line = this.line();
+
+ // (attrs | class | id)*
+ out:
+ while (true) {
+ switch (this.peek().type) {
+ case 'id':
+ case 'class':
+ var tok = this.advance();
+ tag.setAttribute(tok.type, "'" + tok.val + "'");
+ continue;
+ case 'attrs':
+ var tok = this.advance()
+ , obj = tok.attrs
+ , escaped = tok.escaped
+ , names = Object.keys(obj);
+
+ if (tok.selfClosing) tag.selfClosing = true;
+
+ for (var i = 0, len = names.length; i < len; ++i) {
+ var name = names[i]
+ , val = obj[name];
+ tag.setAttribute(name, val, escaped[name]);
+ }
+ continue;
+ default:
+ break out;
+ }
+ }
+
+ // check immediate '.'
+ if ('.' == this.peek().val) {
+ dot = tag.textOnly = true;
+ this.advance();
+ }
+
+ // (text | code | ':')?
+ switch (this.peek().type) {
+ case 'text':
+ tag.block.push(this.parseText());
+ break;
+ case 'code':
+ tag.code = this.parseCode();
+ break;
+ case ':':
+ this.advance();
+ tag.block = new nodes.Block;
+ tag.block.push(this.parseExpr());
+ break;
+ }
+
+ // newline*
+ while ('newline' == this.peek().type) this.advance();
+
+ tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name);
+
+ // script special-case
+ if ('script' == tag.name) {
+ var type = tag.getAttribute('type');
+ if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) {
+ tag.textOnly = false;
+ }
+ }
+
+ // block?
+ if ('indent' == this.peek().type) {
+ if (tag.textOnly) {
+ this.lexer.pipeless = true;
+ tag.block = this.parseTextBlock();
+ this.lexer.pipeless = false;
+ } else {
+ var block = this.block();
+ if (tag.block) {
+ for (var i = 0, len = block.nodes.length; i < len; ++i) {
+ tag.block.push(block.nodes[i]);
+ }
+ } else {
+ tag.block = block;
+ }
+ }
+ }
+
+ return tag;
+ }
+};
+
+}); // module: parser.js
+
+require.register("runtime.js", function(module, exports, require){
+
+/*!
+ * Jade - runtime
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Lame Array.isArray() polyfill for now.
+ */
+
+if (!Array.isArray) {
+ Array.isArray = function(arr){
+ return '[object Array]' == Object.prototype.toString.call(arr);
+ };
+}
+
+/**
+ * Lame Object.keys() polyfill for now.
+ */
+
+if (!Object.keys) {
+ Object.keys = function(obj){
+ var arr = [];
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ arr.push(key);
+ }
+ }
+ return arr;
+ }
+}
+
+/**
+ * Merge two attribute objects giving precedence
+ * to values in object `b`. Classes are special-cased
+ * allowing for arrays and merging/joining appropriately
+ * resulting in a string.
+ *
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ * @api private
+ */
+
+exports.merge = function merge(a, b) {
+ var ac = a['class'];
+ var bc = b['class'];
+
+ if (ac || bc) {
+ ac = ac || [];
+ bc = bc || [];
+ if (!Array.isArray(ac)) ac = [ac];
+ if (!Array.isArray(bc)) bc = [bc];
+ ac = ac.filter(nulls);
+ bc = bc.filter(nulls);
+ a['class'] = ac.concat(bc).join(' ');
+ }
+
+ for (var key in b) {
+ if (key != 'class') {
+ a[key] = b[key];
+ }
+ }
+
+ return a;
+};
+
+/**
+ * Filter null `val`s.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function nulls(val) {
+ return val != null;
+}
+
+/**
+ * Render the given attributes object.
+ *
+ * @param {Object} obj
+ * @param {Object} escaped
+ * @return {String}
+ * @api private
+ */
+
+exports.attrs = function attrs(obj, escaped){
+ var buf = []
+ , terse = obj.terse;
+
+ delete obj.terse;
+ var keys = Object.keys(obj)
+ , len = keys.length;
+
+ if (len) {
+ buf.push('');
+ for (var i = 0; i < len; ++i) {
+ var key = keys[i]
+ , val = obj[key];
+
+ if ('boolean' == typeof val || null == val) {
+ if (val) {
+ terse
+ ? buf.push(key)
+ : buf.push(key + '="' + key + '"');
+ }
+ } else if (0 == key.indexOf('data') && 'string' != typeof val) {
+ buf.push(key + "='" + JSON.stringify(val) + "'");
+ } else if ('class' == key && Array.isArray(val)) {
+ buf.push(key + '="' + exports.escape(val.join(' ')) + '"');
+ } else if (escaped && escaped[key]) {
+ buf.push(key + '="' + exports.escape(val) + '"');
+ } else {
+ buf.push(key + '="' + val + '"');
+ }
+ }
+ }
+
+ return buf.join(' ');
+};
+
+/**
+ * Escape the given string of `html`.
+ *
+ * @param {String} html
+ * @return {String}
+ * @api private
+ */
+
+exports.escape = function escape(html){
+ return String(html)
+ .replace(/&(?!(\w+|\#\d+);)/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"');
+};
+
+/**
+ * Re-throw the given `err` in context to the
+ * the jade in `filename` at the given `lineno`.
+ *
+ * @param {Error} err
+ * @param {String} filename
+ * @param {String} lineno
+ * @api private
+ */
+
+exports.rethrow = function rethrow(err, filename, lineno){
+ if (!filename) throw err;
+
+ var context = 3
+ , str = require('fs').readFileSync(filename, 'utf8')
+ , lines = str.split('\n')
+ , start = Math.max(lineno - context, 0)
+ , end = Math.min(lines.length, lineno + context);
+
+ // Error context
+ var context = lines.slice(start, end).map(function(line, i){
+ var curr = i + start + 1;
+ return (curr == lineno ? ' > ' : ' ')
+ + curr
+ + '| '
+ + line;
+ }).join('\n');
+
+ // Alter exception message
+ err.path = filename;
+ err.message = (filename || 'Jade') + ':' + lineno
+ + '\n' + context + '\n\n' + err.message;
+ throw err;
+};
+
+}); // module: runtime.js
+
+require.register("self-closing.js", function(module, exports, require){
+
+/*!
+ * Jade - self closing tags
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = [
+ 'meta'
+ , 'img'
+ , 'link'
+ , 'input'
+ , 'source'
+ , 'area'
+ , 'base'
+ , 'col'
+ , 'br'
+ , 'hr'
+];
+}); // module: self-closing.js
+
+require.register("utils.js", function(module, exports, require){
+
+/*!
+ * Jade - utils
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Convert interpolation in the given string to JavaScript.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+var interpolate = exports.interpolate = function(str){
+ return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){
+ return escape
+ ? str
+ : "' + "
+ + ('!' == flag ? '' : 'escape')
+ + "((interp = " + code.replace(/\\'/g, "'")
+ + ") == null ? '' : interp) + '";
+ });
+};
+
+/**
+ * Escape single quotes in `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+var escape = exports.escape = function(str) {
+ return str.replace(/'/g, "\\'");
+};
+
+/**
+ * Interpolate, and escape the given `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+exports.text = function(str){
+ return interpolate(escape(str));
+};
+}); // module: utils.js
+
+window.jade = require("jade");
+})();
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.md b/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.md
new file mode 100644
index 0000000..051dc03
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.md
@@ -0,0 +1,510 @@
+
+# Jade
+
+ The jade template engine for node.js
+
+## Synopsis
+
+ jade [-h|--help] [-v|--version] [-o|--obj STR]
+ [-O|--out DIR] [-p|--path PATH] [-P|--pretty]
+ [-c|--client] [-D|--no-debug]
+
+## Examples
+
+ translate jade the templates dir
+
+ $ jade templates
+
+ create {foo,bar}.html
+
+ $ jade {foo,bar}.jade
+
+ jade over stdio
+
+ $ jade < my.jade > my.html
+
+ jade over s
+
+ $ echo "h1 Jade!" | jade
+
+ foo, bar dirs rendering to /tmp
+
+ $ jade foo bar --out /tmp
+
+ compile client-side templates without debugging
+ instrumentation, making the output javascript
+ very light-weight. This requires runtime.js
+ in your projects.
+
+ $ jade --client --no-debug < my.jade
+
+## Tags
+
+ Tags are simply nested via whitespace, closing
+ tags defined for you. These indents are called "blocks".
+
+ ul
+ li
+ a Foo
+ li
+ a Bar
+
+ You may have several tags in one "block":
+
+ ul
+ li
+ a Foo
+ a Bar
+ a Baz
+
+## Self-closing Tags
+
+ Some tags are flagged as self-closing by default, such
+ as `meta`, `link`, and so on. To explicitly self-close
+ a tag simply append the `/` character:
+
+ foo/
+ foo(bar='baz')/
+
+ Would yield:
+
+
+
+
+## Attributes
+
+ Tag attributes look similar to HTML, however
+ the values are regular JavaScript, here are
+ some examples:
+
+ a(href='google.com') Google
+ a(class='button', href='google.com') Google
+
+ As mentioned the attribute values are just JavaScript,
+ this means ternary operations and other JavaScript expressions
+ work just fine:
+
+ body(class=user.authenticated ? 'authenticated' : 'anonymous')
+ a(href=user.website || 'http://google.com')
+
+ Multiple lines work too:
+
+ input(type='checkbox',
+ name='agreement',
+ checked)
+
+ Multiple lines without the comma work fine:
+
+ input(type='checkbox'
+ name='agreement'
+ checked)
+
+ Funky whitespace? fine:
+
+ input(
+ type='checkbox'
+ name='agreement'
+ checked)
+
+## Boolean attributes
+
+ Boolean attributes are mirrored by Jade, and accept
+ bools, aka _true_ or _false_. When no value is specified
+ _true_ is assumed. For example:
+
+ input(type="checkbox", checked)
+ // => " "
+
+ For example if the checkbox was for an agreement, perhaps `user.agreed`
+ was _true_ the following would also output 'checked="checked"':
+
+ input(type="checkbox", checked=user.agreed)
+
+## Class attributes
+
+ The _class_ attribute accepts an array of classes,
+ this can be handy when generated from a javascript
+ function etc:
+
+ classes = ['foo', 'bar', 'baz']
+ a(class=classes)
+ // => " "
+
+## Class literal
+
+ Classes may be defined using a ".CLASSNAME" syntax:
+
+ .button
+ // => "
"
+
+ Or chained:
+
+ .large.button
+ // => "
"
+
+ The previous defaulted to divs, however you
+ may also specify the tag type:
+
+ h1.title My Title
+ // => "My Title "
+
+## Id literal
+
+ Much like the class literal there's an id literal:
+
+ #user-1
+ // => "
"
+
+ Again we may specify the tag as well:
+
+ ul#menu
+ li: a(href='/home') Home
+ li: a(href='/store') Store
+ li: a(href='/contact') Contact
+
+ Finally all of these may be used in any combination,
+ the following are all valid tags:
+
+ a.button#contact(style: 'color: red') Contact
+ a.button(style: 'color: red')#contact Contact
+ a(style: 'color: red').button#contact Contact
+
+## Block expansion
+
+ Jade supports the concept of "block expansion", in which
+ using a trailing ":" after a tag will inject a block:
+
+ ul
+ li: a Foo
+ li: a Bar
+ li: a Baz
+
+## Text
+
+ Arbitrary text may follow tags:
+
+ p Welcome to my site
+
+ yields:
+
+ Welcome to my site
+
+## Pipe text
+
+ Another form of text is "pipe" text. Pipes act
+ as the text margin for large bodies of text.
+
+ p
+ | This is a large
+ | body of text for
+ | this tag.
+ |
+ | Nothing too
+ | exciting.
+
+ yields:
+
+ This is a large
+ body of text for
+ this tag.
+
+ Nothing too
+ exciting.
+
+
+ Using pipes we can also specify regular Jade tags
+ within the text:
+
+ p
+ | Click to visit
+ a(href='http://google.com') Google
+ | if you want.
+
+## Text only tags
+
+ As an alternative to pipe text you may add
+ a trailing "." to indicate that the block
+ contains nothing but plain-text, no tags:
+
+ p.
+ This is a large
+ body of text for
+ this tag.
+
+ Nothing too
+ exciting.
+
+ Some tags are text-only by default, for example
+ _script_, _textarea_, and _style_ tags do not
+ contain nested HTML so Jade implies the trailing ".":
+
+ script
+ if (foo) {
+ bar();
+ }
+
+ style
+ body {
+ padding: 50px;
+ font: 14px Helvetica;
+ }
+
+## Template script tags
+
+ Sometimes it's useful to define HTML in script
+ tags using Jade, typically for client-side templates.
+
+ To do this simply give the _script_ tag an arbitrary
+ _type_ attribute such as _text/x-template_:
+
+ script(type='text/template')
+ h1 Look!
+ p Jade still works in here!
+
+## Interpolation
+
+ Both plain-text and piped-text support interpolation,
+ which comes in two forms, escapes and non-escaped. The
+ following will output the _user.name_ in the paragraph
+ but HTML within it will be escaped to prevent XSS attacks:
+
+ p Welcome #{user.name}
+
+ The following syntax is identical however it will _not_ escape
+ HTML, and should only be used with strings that you trust:
+
+ p Welcome !{user.name}
+
+## Inline HTML
+
+ Sometimes constructing small inline snippets of HTML
+ in Jade can be annoying, luckily we can add plain
+ HTML as well:
+
+ p Welcome #{user.name}
+
+## Code
+
+ To buffer output with Jade simply use _=_ at the beginning
+ of a line or after a tag. This method escapes any HTML
+ present in the string.
+
+ p= user.description
+
+ To buffer output unescaped use the _!=_ variant, but again
+ be careful of XSS.
+
+ p!= user.description
+
+ The final way to mess with JavaScript code in Jade is the unbuffered
+ _-_, which can be used for conditionals, defining variables etc:
+
+ - var user = { description: 'foo bar baz' }
+ #user
+ - if (user.description) {
+ h2 Description
+ p.description= user.description
+ - }
+
+ When compiled blocks are wrapped in anonymous functions, so the
+ following is also valid, without braces:
+
+ - var user = { description: 'foo bar baz' }
+ #user
+ - if (user.description)
+ h2 Description
+ p.description= user.description
+
+ If you really want you could even use `.forEach()` and others:
+
+ - users.forEach(function(user){
+ .user
+ h2= user.name
+ p User #{user.name} is #{user.age} years old
+ - })
+
+ Taking this further Jade provides some syntax for conditionals,
+ iteration, switch statements etc. Let's look at those next!
+
+## Assignment
+
+ Jade's first-class assignment is simple, simply use the _=_
+ operator and Jade will _var_ it for you. The following are equivalent:
+
+ - var user = { name: 'tobi' }
+ user = { name: 'tobi' }
+
+## Conditionals
+
+ Jade's first-class conditional syntax allows for optional
+ parenthesis, and you may now omit the leading _-_ otherwise
+ it's identical, still just regular javascript:
+
+ user = { description: 'foo bar baz' }
+ #user
+ if user.description
+ h2 Description
+ p.description= user.description
+
+ Jade provides the negated version, _unless_ as well, the following
+ are equivalent:
+
+ - if (!(user.isAnonymous))
+ p You're logged in as #{user.name}
+
+ unless user.isAnonymous
+ p You're logged in as #{user.name}
+
+## Iteration
+
+ JavaScript's _for_ loops don't look very declarative, so Jade
+ also provides its own _for_ loop construct, aliased as _each_:
+
+ for user in users
+ .user
+ h2= user.name
+ p user #{user.name} is #{user.age} year old
+
+ As mentioned _each_ is identical:
+
+ each user in users
+ .user
+ h2= user.name
+
+ If necessary the index is available as well:
+
+ for user, i in users
+ .user(class='user-#{i}')
+ h2= user.name
+
+ Remember, it's just JavaScript:
+
+ ul#letters
+ for letter in ['a', 'b', 'c']
+ li= letter
+
+## Mixins
+
+ Mixins provide a way to define jade "functions" which "mix in"
+ their contents when called. This is useful for abstracting
+ out large fragments of Jade.
+
+ The simplest possible mixin which accepts no arguments might
+ look like this:
+
+ mixin hello
+ p Hello
+
+ You use a mixin by placing `+` before the name:
+
+ +hello
+
+ For something a little more dynamic, mixins can take
+ arguments, the mixin itself is converted to a javascript
+ function internally:
+
+ mixin hello(user)
+ p Hello #{user}
+
+ +hello('Tobi')
+
+ Yields:
+
+ Hello Tobi
+
+ Mixins may optionally take blocks, when a block is passed
+ its contents becomes the implicit `block` argument. For
+ example here is a mixin passed a block, and also invoked
+ without passing a block:
+
+ mixin article(title)
+ .article
+ .article-wrapper
+ h1= title
+ if block
+ block
+ else
+ p No content provided
+
+ +article('Hello world')
+
+ +article('Hello world')
+ p This is my
+ p Amazing article
+
+ yields:
+
+
+
+
Hello world
+
No content provided
+
+
+
+
+
+
Hello world
+
This is my
+
Amazing article
+
+
+
+ Mixins can even take attributes, just like a tag. When
+ attributes are passed they become the implicit `attributes`
+ argument. Individual attributes can be accessed just like
+ normal object properties:
+
+ mixin centered
+ .centered(class=attributes.class)
+ block
+
+ +centered.bold Hello world
+
+ +centered.red
+ p This is my
+ p Amazing article
+
+ yields:
+
+ Hello world
+
+
This is my
+
Amazing article
+
+
+ If you use `attributes` directly, *all* passed attributes
+ get used:
+
+ mixin link
+ a.menu(attributes)
+ block
+
+ +link.highlight(href='#top') Top
+ +link#sec1.plain(href='#section1') Section 1
+ +link#sec2.plain(href='#section2') Section 2
+
+ yields:
+
+
+
+
+
+ If you pass arguments, they must directly follow the mixin:
+
+ mixin list(arr)
+ if block
+ .title
+ block
+ ul(attributes)
+ each item in arr
+ li= item
+
+ +list(['foo', 'bar', 'baz'])(id='myList', class='bold')
+
+ yields:
+
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.min.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.min.js
new file mode 100644
index 0000000..72e4535
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/jade.min.js
@@ -0,0 +1,2 @@
+(function(){function require(p){var path=require.resolve(p),mod=require.modules[path];if(!mod)throw new Error('failed to require "'+p+'"');return mod.exports||(mod.exports={},mod.call(mod.exports,mod,mod.exports,require.relative(path))),mod.exports}require.modules={},require.resolve=function(path){var orig=path,reg=path+".js",index=path+"/index.js";return require.modules[reg]&®||require.modules[index]&&index||orig},require.register=function(path,fn){require.modules[path]=fn},require.relative=function(parent){return function(p){if("."!=p.charAt(0))return require(p);var path=parent.split("/"),segs=p.split("/");path.pop();for(var i=0;i",this.doctype=doctype,this.terse="5"==name||"html"==name,this.xml=0==this.doctype.indexOf("1&&!escape&&block.nodes[0].isText&&block.nodes[1].isText&&this.prettyIndent(1,!0);for(var i=0;i0&&!escape&&block.nodes[i].isText&&block.nodes[i-1].isText&&this.prettyIndent(1,!1),this.visit(block.nodes[i]),block.nodes[i+1]&&block.nodes[i].isText&&block.nodes[i+1].isText&&this.buffer("\\n")},visitDoctype:function(doctype){doctype&&(doctype.val||!this.doctype)&&this.setDoctype(doctype.val||"default"),this.doctype&&this.buffer(this.doctype),this.hasCompiledDoctype=!0},visitMixin:function(mixin){var name=mixin.name.replace(/-/g,"_")+"_mixin",args=mixin.args||"",block=mixin.block,attrs=mixin.attrs,pp=this.pp;if(mixin.call){pp&&this.buf.push("__indent.push('"+Array(this.indents+1).join(" ")+"');");if(block||attrs.length){this.buf.push(name+".call({");if(block){this.buf.push("block: function(){"),this.parentIndents++;var _indents=this.indents;this.indents=0,this.visit(mixin.block),this.indents=_indents,this.parentIndents--,attrs.length?this.buf.push("},"):this.buf.push("}")}if(attrs.length){var val=this.attrs(attrs);val.inherits?this.buf.push("attributes: merge({"+val.buf+"}, attributes), escaped: merge("+val.escaped+", escaped, true)"):this.buf.push("attributes: {"+val.buf+"}, escaped: "+val.escaped)}args?this.buf.push("}, "+args+");"):this.buf.push("});")}else this.buf.push(name+"("+args+");");pp&&this.buf.push("__indent.pop();")}else this.buf.push("var "+name+" = function("+args+"){"),this.buf.push("var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};"),this.parentIndents++,this.visit(block),this.parentIndents--,this.buf.push("};")},visitTag:function(tag){this.indents++;var name=tag.name,pp=this.pp;tag.buffer&&(name="' + ("+name+") + '"),this.hasCompiledTag||(!this.hasCompiledDoctype&&"html"==name&&this.visitDoctype(),this.hasCompiledTag=!0),pp&&!tag.isInline()&&this.prettyIndent(0,!0),(~selfClosing.indexOf(name)||tag.selfClosing)&&!this.xml?(this.buffer("<"+name),this.visitAttributes(tag.attrs),this.terse?this.buffer(">"):this.buffer("/>")):(tag.attrs.length?(this.buffer("<"+name),tag.attrs.length&&this.visitAttributes(tag.attrs),this.buffer(">")):this.buffer("<"+name+">"),tag.code&&this.visitCode(tag.code),this.escape="pre"==tag.name,this.visit(tag.block),pp&&!tag.isInline()&&"pre"!=tag.name&&!tag.canInline()&&this.prettyIndent(0,!0),this.buffer(""+name+">")),this.indents--},visitFilter:function(filter){var fn=filters[filter.name];if(!fn)throw filter.isASTFilter?new Error('unknown ast filter "'+filter.name+':"'):new Error('unknown filter ":'+filter.name+'"');if(filter.isASTFilter)this.buf.push(fn(filter.block,this,filter.attrs));else{var text=filter.block.nodes.map(function(node){return node.val}).join("\n");filter.attrs=filter.attrs||{},filter.attrs.filename=this.options.filename,this.buffer(utils.text(fn(text,filter.attrs)))}},visitText:function(text){text=utils.text(text.val.replace(/\\/g,"\\\\")),this.escape&&(text=escape(text)),this.buffer(text)},visitComment:function(comment){if(!comment.buffer)return;this.pp&&this.prettyIndent(1,!0),this.buffer("")},visitBlockComment:function(comment){if(!comment.buffer)return;0==comment.val.trim().indexOf("if")?(this.buffer("")):(this.buffer(""))},visitCode:function(code){if(code.buffer){var val=code.val.trimLeft();this.buf.push("var __val__ = "+val),val='null == __val__ ? "" : __val__',code.escape&&(val="escape("+val+")"),this.buf.push("buf.push("+val+");")}else this.buf.push(code.val);code.block&&(code.buffer||this.buf.push("{"),this.visit(code.block),code.buffer||this.buf.push("}"))},visitEach:function(each){this.buf.push("// iterate "+each.obj+"\n"+";(function(){\n"+" if ('number' == typeof "+each.obj+".length) {\n"+" for (var "+each.key+" = 0, $$l = "+each.obj+".length; "+each.key+" < $$l; "+each.key+"++) {\n"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n } else {\n for (var "+each.key+" in "+each.obj+") {\n"+" if ("+each.obj+".hasOwnProperty("+each.key+")){"+" var "+each.val+" = "+each.obj+"["+each.key+"];\n"),this.visit(each.block),this.buf.push(" }\n"),this.buf.push(" }\n }\n}).call(this);\n")},visitAttributes:function(attrs){var val=this.attrs(attrs);val.inherits?this.buf.push("buf.push(attrs(merge({ "+val.buf+" }, attributes), merge("+val.escaped+", escaped, true)));"):val.constant?(eval("var buf={"+val.buf+"};"),this.buffer(runtime.attrs(buf,JSON.parse(val.escaped)),!0)):this.buf.push("buf.push(attrs({ "+val.buf+" }, "+val.escaped+"));")},attrs:function(attrs){var buf=[],classes=[],escaped={},constant=attrs.every(function(attr){return isConstant(attr.val)}),inherits=!1;return this.terse&&buf.push("terse: true"),attrs.forEach(function(attr){if(attr.name=="attributes")return inherits=!0;escaped[attr.name]=attr.escaped;if(attr.name=="class")classes.push("("+attr.val+")");else{var pair="'"+attr.name+"':("+attr.val+")";buf.push(pair)}}),classes.length&&(classes=classes.join(" + ' ' + "),buf.push("class: "+classes)),{buf:buf.join(", ").replace("class:",'"class":'),escaped:JSON.stringify(escaped),inherits:inherits,constant:constant}}};function isConstant(val){if(/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val))return!0;if(!isNaN(Number(val)))return!0;var matches;return(matches=/^ *\[(.*)\] *$/.exec(val))?matches[1].split(",").every(isConstant):!1}function escape(html){return String(html).replace(/&(?!\w+;)/g,"&").replace(//g,">").replace(/"/g,""")}}),require.register("doctypes.js",function(module,exports,require){module.exports={5:"","default":"",xml:'',transitional:'',strict:'',frameset:'',1.1:'',basic:'',mobile:''}}),require.register("filters.js",function(module,exports,require){module.exports={cdata:function(str){return""},sass:function(str){str=str.replace(/\\n/g,"\n");var sass=require("sass").render(str).replace(/\n/g,"\\n");return'"},stylus:function(str,options){var ret;str=str.replace(/\\n/g,"\n");var stylus=require("stylus");return stylus(str,options).render(function(err,css){if(err)throw err;ret=css.replace(/\n/g,"\\n")}),'"},less:function(str){var ret;return str=str.replace(/\\n/g,"\n"),require("less").render(str,function(err,css){if(err)throw err;ret='"}),ret},markdown:function(str){var md;try{md=require("markdown")}catch(err){try{md=require("discount")}catch(err){try{md=require("markdown-js")}catch(err){try{md=require("marked")}catch(err){throw new Error("Cannot find markdown library, install markdown, discount, or marked.")}}}}return str=str.replace(/\\n/g,"\n"),md.parse(str).replace(/\n/g,"\\n").replace(/'/g,"'")},coffeescript:function(str){str=str.replace(/\\n/g,"\n");var js=require("coffee-script").compile(str).replace(/\\/g,"\\\\").replace(/\n/g,"\\n");return'"}}}),require.register("inline-tags.js",function(module,exports,require){module.exports=["a","abbr","acronym","b","br","code","em","font","i","img","ins","kbd","map","samp","small","span","strong","sub","sup"]}),require.register("jade.js",function(module,exports,require){var Parser=require("./parser"),Lexer=require("./lexer"),Compiler=require("./compiler"),runtime=require("./runtime");exports.version="0.26.1",exports.selfClosing=require("./self-closing"),exports.doctypes=require("./doctypes"),exports.filters=require("./filters"),exports.utils=require("./utils"),exports.Compiler=Compiler,exports.Parser=Parser,exports.Lexer=Lexer,exports.nodes=require("./nodes"),exports.runtime=runtime,exports.cache={};function parse(str,options){try{var parser=new Parser(str,options.filename,options),compiler=new(options.compiler||Compiler)(parser.parse(),options),js=compiler.compile();return options.debug&&console.error("\nCompiled Function:\n\n[90m%s[0m",js.replace(/^/gm," ")),"var buf = [];\n"+(options.self?"var self = locals || {};\n"+js:"with (locals || {}) {\n"+js+"\n}\n")+'return buf.join("");'}catch(err){parser=parser.context(),runtime.rethrow(err,parser.filename,parser.lexer.lineno)}}exports.compile=function(str,options){var options=options||{},client=options.client,filename=options.filename?JSON.stringify(options.filename):"undefined",fn;return options.compileDebug!==!1?fn=["var __jade = [{ lineno: 1, filename: "+filename+" }];","try {",parse(String(str),options),"} catch (err) {"," rethrow(err, __jade[0].filename, __jade[0].lineno);","}"].join("\n"):fn=parse(String(str),options),client&&(fn="attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n"+fn),fn=new Function("locals, attrs, escape, rethrow, merge",fn),client?fn:function(locals){return fn(locals,runtime.attrs,runtime.escape,runtime.rethrow,runtime.merge)}},exports.render=function(str,options,fn){"function"==typeof options&&(fn=options,options={});if(options.cache&&!options.filename)return fn(new Error('the "filename" option is required for caching'));try{var path=options.filename,tmpl=options.cache?exports.cache[path]||(exports.cache[path]=exports.compile(str,options)):exports.compile(str,options);fn(null,tmpl(options))}catch(err){fn(err)}},exports.renderFile=function(path,options,fn){var key=path+":string";"function"==typeof options&&(fn=options,options={});try{options.filename=path;var str=options.cache?exports.cache[key]||(exports.cache[key]=fs.readFileSync(path,"utf8")):fs.readFileSync(path,"utf8");exports.render(str,options,fn)}catch(err){fn(err)}},exports.__express=exports.renderFile}),require.register("lexer.js",function(module,exports,require){var Lexer=module.exports=function Lexer(str,options){options=options||{},this.input=str.replace(/\r\n|\r/g,"\n"),this.colons=options.colons,this.deferredTokens=[],this.lastIndents=0,this.lineno=1,this.stash=[],this.indentStack=[],this.indentRe=null,this.pipeless=!1};Lexer.prototype={tok:function(type,val){return{type:type,line:this.lineno,val:val}},consume:function(len){this.input=this.input.substr(len)},scan:function(regexp,type){var captures;if(captures=regexp.exec(this.input))return this.consume(captures[0].length),this.tok(type,captures[1])},defer:function(tok){this.deferredTokens.push(tok)},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-->0)this.stash.push(this.next());return this.stash[--n]},indexOfDelimiters:function(start,end){var str=this.input,nstart=0,nend=0,pos=0;for(var i=0,len=str.length;iindents)this.stash.push(this.tok("outdent")),this.indentStack.shift();tok=this.stash.pop()}else indents&&indents!=this.indentStack[0]?(this.indentStack.unshift(indents),tok=this.tok("indent",indents)):tok=this.tok("newline");return tok}},pipelessText:function(){if(this.pipeless){if("\n"==this.input[0])return;var i=this.input.indexOf("\n");-1==i&&(i=this.input.length);var str=this.input.substr(0,i);return this.consume(str.length),this.tok("text",str)}},colon:function(){return this.scan(/^: */,":")},advance:function(){return this.stashed()||this.next()},next:function(){return this.deferred()||this.blank()||this.eos()||this.pipelessText()||this.yield()||this.doctype()||this.interpolation()||this["case"]()||this.when()||this["default"]()||this["extends"]()||this.append()||this.prepend()||this.block()||this.include()||this.mixin()||this.call()||this.conditional()||this.each()||this["while"]()||this.assignment()||this.tag()||this.filter()||this.code()||this.id()||this.className()||this.attrs()||this.indent()||this.comment()||this.colon()||this.text()}}}),require.register("nodes/attrs.js",function(module,exports,require){var Node=require("./node"),Block=require("./block"),Attrs=module.exports=function Attrs(){this.attrs=[]};Attrs.prototype=new Node,Attrs.prototype.constructor=Attrs,Attrs.prototype.setAttribute=function(name,val,escaped){return this.attrs.push({name:name,val:val,escaped:escaped}),this},Attrs.prototype.removeAttribute=function(name){for(var i=0,len=this.attrs.length;i /g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err}}),require.register("self-closing.js",function(module,exports,require){module.exports=["meta","img","link","input","source","area","base","col","br","hr"]}),require.register("utils.js",function(module,exports,require){var interpolate=exports.interpolate=function(str){return str.replace(/(\\)?([#!]){(.*?)}/g,function(str,escape,flag,code){return escape?str:"' + "+("!"==flag?"":"escape")+"((interp = "+code.replace(/\\'/g,"'")+") == null ? '' : interp) + '"})},escape=exports.escape=function(str){return str.replace(/'/g,"\\'")};exports.text=function(str){return interpolate(escape(str))}}),window.jade=require("jade")})();
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/compiler.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/compiler.js
new file mode 100644
index 0000000..b7c28e2
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/compiler.js
@@ -0,0 +1,654 @@
+
+/*!
+ * Jade - Compiler
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var nodes = require('./nodes')
+ , filters = require('./filters')
+ , doctypes = require('./doctypes')
+ , selfClosing = require('./self-closing')
+ , runtime = require('./runtime')
+ , utils = require('./utils');
+
+// if browser
+//
+// if (!Object.keys) {
+// Object.keys = function(obj){
+// var arr = [];
+// for (var key in obj) {
+// if (obj.hasOwnProperty(key)) {
+// arr.push(key);
+// }
+// }
+// return arr;
+// }
+// }
+//
+// if (!String.prototype.trimLeft) {
+// String.prototype.trimLeft = function(){
+// return this.replace(/^\s+/, '');
+// }
+// }
+//
+// end
+
+
+/**
+ * Initialize `Compiler` with the given `node`.
+ *
+ * @param {Node} node
+ * @param {Object} options
+ * @api public
+ */
+
+var Compiler = module.exports = function Compiler(node, options) {
+ this.options = options = options || {};
+ this.node = node;
+ this.hasCompiledDoctype = false;
+ this.hasCompiledTag = false;
+ this.pp = options.pretty || false;
+ this.debug = false !== options.compileDebug;
+ this.indents = 0;
+ this.parentIndents = 0;
+ if (options.doctype) this.setDoctype(options.doctype);
+};
+
+/**
+ * Compiler prototype.
+ */
+
+Compiler.prototype = {
+
+ /**
+ * Compile parse tree to JavaScript.
+ *
+ * @api public
+ */
+
+ compile: function(){
+ this.buf = ['var interp;'];
+ if (this.pp) this.buf.push("var __indent = [];");
+ this.lastBufferedIdx = -1;
+ this.visit(this.node);
+ return this.buf.join('\n');
+ },
+
+ /**
+ * Sets the default doctype `name`. Sets terse mode to `true` when
+ * html 5 is used, causing self-closing tags to end with ">" vs "/>",
+ * and boolean attributes are not mirrored.
+ *
+ * @param {string} name
+ * @api public
+ */
+
+ setDoctype: function(name){
+ name = (name && name.toLowerCase()) || 'default';
+ this.doctype = doctypes[name] || '';
+ this.terse = this.doctype.toLowerCase() == '';
+ this.xml = 0 == this.doctype.indexOf(' 1 && !escape && block.nodes[0].isText && block.nodes[1].isText)
+ this.prettyIndent(1, true);
+
+ for (var i = 0; i < len; ++i) {
+ // Pretty print text
+ if (pp && i > 0 && !escape && block.nodes[i].isText && block.nodes[i-1].isText)
+ this.prettyIndent(1, false);
+
+ this.visit(block.nodes[i]);
+ // Multiple text nodes are separated by newlines
+ if (block.nodes[i+1] && block.nodes[i].isText && block.nodes[i+1].isText)
+ this.buffer('\\n');
+ }
+ },
+
+ /**
+ * Visit `doctype`. Sets terse mode to `true` when html 5
+ * is used, causing self-closing tags to end with ">" vs "/>",
+ * and boolean attributes are not mirrored.
+ *
+ * @param {Doctype} doctype
+ * @api public
+ */
+
+ visitDoctype: function(doctype){
+ if (doctype && (doctype.val || !this.doctype)) {
+ this.setDoctype(doctype.val || 'default');
+ }
+
+ if (this.doctype) this.buffer(this.doctype);
+ this.hasCompiledDoctype = true;
+ },
+
+ /**
+ * Visit `mixin`, generating a function that
+ * may be called within the template.
+ *
+ * @param {Mixin} mixin
+ * @api public
+ */
+
+ visitMixin: function(mixin){
+ var name = mixin.name.replace(/-/g, '_') + '_mixin'
+ , args = mixin.args || ''
+ , block = mixin.block
+ , attrs = mixin.attrs
+ , pp = this.pp;
+
+ if (mixin.call) {
+ if (pp) this.buf.push("__indent.push('" + Array(this.indents + 1).join(' ') + "');")
+ if (block || attrs.length) {
+
+ this.buf.push(name + '.call({');
+
+ if (block) {
+ this.buf.push('block: function(){');
+
+ // Render block with no indents, dynamically added when rendered
+ this.parentIndents++;
+ var _indents = this.indents;
+ this.indents = 0;
+ this.visit(mixin.block);
+ this.indents = _indents;
+ this.parentIndents--;
+
+ if (attrs.length) {
+ this.buf.push('},');
+ } else {
+ this.buf.push('}');
+ }
+ }
+
+ if (attrs.length) {
+ var val = this.attrs(attrs);
+ if (val.inherits) {
+ this.buf.push('attributes: merge({' + val.buf
+ + '}, attributes), escaped: merge(' + val.escaped + ', escaped, true)');
+ } else {
+ this.buf.push('attributes: {' + val.buf + '}, escaped: ' + val.escaped);
+ }
+ }
+
+ if (args) {
+ this.buf.push('}, ' + args + ');');
+ } else {
+ this.buf.push('});');
+ }
+
+ } else {
+ this.buf.push(name + '(' + args + ');');
+ }
+ if (pp) this.buf.push("__indent.pop();")
+ } else {
+ this.buf.push('var ' + name + ' = function(' + args + '){');
+ this.buf.push('var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};');
+ this.parentIndents++;
+ this.visit(block);
+ this.parentIndents--;
+ this.buf.push('};');
+ }
+ },
+
+ /**
+ * Visit `tag` buffering tag markup, generating
+ * attributes, visiting the `tag`'s code and block.
+ *
+ * @param {Tag} tag
+ * @api public
+ */
+
+ visitTag: function(tag){
+ this.indents++;
+ var name = tag.name
+ , pp = this.pp;
+
+ if (tag.buffer) name = "' + (" + name + ") + '";
+
+ if (!this.hasCompiledTag) {
+ if (!this.hasCompiledDoctype && 'html' == name) {
+ this.visitDoctype();
+ }
+ this.hasCompiledTag = true;
+ }
+
+ // pretty print
+ if (pp && !tag.isInline())
+ this.prettyIndent(0, true);
+
+ if ((~selfClosing.indexOf(name) || tag.selfClosing) && !this.xml) {
+ this.buffer('<' + name);
+ this.visitAttributes(tag.attrs);
+ this.terse
+ ? this.buffer('>')
+ : this.buffer('/>');
+ } else {
+ // Optimize attributes buffering
+ if (tag.attrs.length) {
+ this.buffer('<' + name);
+ if (tag.attrs.length) this.visitAttributes(tag.attrs);
+ this.buffer('>');
+ } else {
+ this.buffer('<' + name + '>');
+ }
+ if (tag.code) this.visitCode(tag.code);
+ this.escape = 'pre' == tag.name;
+ this.visit(tag.block);
+
+ // pretty print
+ if (pp && !tag.isInline() && 'pre' != tag.name && !tag.canInline())
+ this.prettyIndent(0, true);
+
+ this.buffer('' + name + '>');
+ }
+ this.indents--;
+ },
+
+ /**
+ * Visit `filter`, throwing when the filter does not exist.
+ *
+ * @param {Filter} filter
+ * @api public
+ */
+
+ visitFilter: function(filter){
+ var fn = filters[filter.name];
+
+ // unknown filter
+ if (!fn) {
+ if (filter.isASTFilter) {
+ throw new Error('unknown ast filter "' + filter.name + ':"');
+ } else {
+ throw new Error('unknown filter ":' + filter.name + '"');
+ }
+ }
+
+ if (filter.isASTFilter) {
+ this.buf.push(fn(filter.block, this, filter.attrs));
+ } else {
+ var text = filter.block.nodes.map(function(node){ return node.val }).join('\n');
+ filter.attrs = filter.attrs || {};
+ filter.attrs.filename = this.options.filename;
+ this.buffer(utils.text(fn(text, filter.attrs)));
+ }
+ },
+
+ /**
+ * Visit `text` node.
+ *
+ * @param {Text} text
+ * @api public
+ */
+
+ visitText: function(text){
+ text = utils.text(text.val.replace(/\\/g, '\\\\'));
+ if (this.escape) text = escape(text);
+ this.buffer(text);
+ },
+
+ /**
+ * Visit a `comment`, only buffering when the buffer flag is set.
+ *
+ * @param {Comment} comment
+ * @api public
+ */
+
+ visitComment: function(comment){
+ if (!comment.buffer) return;
+ if (this.pp) this.prettyIndent(1, true);
+ this.buffer('');
+ },
+
+ /**
+ * Visit a `BlockComment`.
+ *
+ * @param {Comment} comment
+ * @api public
+ */
+
+ visitBlockComment: function(comment){
+ if (!comment.buffer) return;
+ if (0 == comment.val.trim().indexOf('if')) {
+ this.buffer('');
+ } else {
+ this.buffer('');
+ }
+ },
+
+ /**
+ * Visit `code`, respecting buffer / escape flags.
+ * If the code is followed by a block, wrap it in
+ * a self-calling function.
+ *
+ * @param {Code} code
+ * @api public
+ */
+
+ visitCode: function(code){
+ // Wrap code blocks with {}.
+ // we only wrap unbuffered code blocks ATM
+ // since they are usually flow control
+
+ // Buffer code
+ if (code.buffer) {
+ var val = code.val.trimLeft();
+ this.buf.push('var __val__ = ' + val);
+ val = 'null == __val__ ? "" : __val__';
+ if (code.escape) val = 'escape(' + val + ')';
+ this.buf.push("buf.push(" + val + ");");
+ } else {
+ this.buf.push(code.val);
+ }
+
+ // Block support
+ if (code.block) {
+ if (!code.buffer) this.buf.push('{');
+ this.visit(code.block);
+ if (!code.buffer) this.buf.push('}');
+ }
+ },
+
+ /**
+ * Visit `each` block.
+ *
+ * @param {Each} each
+ * @api public
+ */
+
+ visitEach: function(each){
+ this.buf.push(''
+ + '// iterate ' + each.obj + '\n'
+ + ';(function(){\n'
+ + ' if (\'number\' == typeof ' + each.obj + '.length) {\n');
+
+ if (each.alternative) {
+ this.buf.push(' if (' + each.obj + '.length) {');
+ }
+
+ this.buf.push(''
+ + ' for (var ' + each.key + ' = 0, $$l = ' + each.obj + '.length; ' + each.key + ' < $$l; ' + each.key + '++) {\n'
+ + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n');
+
+ this.visit(each.block);
+
+ this.buf.push(' }\n');
+
+ if (each.alternative) {
+ this.buf.push(' } else {');
+ this.visit(each.alternative);
+ this.buf.push(' }');
+ }
+
+ this.buf.push(''
+ + ' } else {\n'
+ + ' for (var ' + each.key + ' in ' + each.obj + ') {\n'
+ // if browser
+ // + ' if (' + each.obj + '.hasOwnProperty(' + each.key + ')){'
+ // end
+ + ' var ' + each.val + ' = ' + each.obj + '[' + each.key + '];\n');
+
+ this.visit(each.block);
+
+ // if browser
+ // this.buf.push(' }\n');
+ // end
+
+ this.buf.push(' }\n }\n}).call(this);\n');
+ },
+
+ /**
+ * Visit `attrs`.
+ *
+ * @param {Array} attrs
+ * @api public
+ */
+
+ visitAttributes: function(attrs){
+ var val = this.attrs(attrs);
+ if (val.inherits) {
+ this.buf.push("buf.push(attrs(merge({ " + val.buf +
+ " }, attributes), merge(" + val.escaped + ", escaped, true)));");
+ } else if (val.constant) {
+ eval('var buf={' + val.buf + '};');
+ this.buffer(runtime.attrs(buf, JSON.parse(val.escaped)), true);
+ } else {
+ this.buf.push("buf.push(attrs({ " + val.buf + " }, " + val.escaped + "));");
+ }
+ },
+
+ /**
+ * Compile attributes.
+ */
+
+ attrs: function(attrs){
+ var buf = []
+ , classes = []
+ , escaped = {}
+ , constant = attrs.every(function(attr){ return isConstant(attr.val) })
+ , inherits = false;
+
+ if (this.terse) buf.push('terse: true');
+
+ attrs.forEach(function(attr){
+ if (attr.name == 'attributes') return inherits = true;
+ escaped[attr.name] = attr.escaped;
+ if (attr.name == 'class') {
+ classes.push('(' + attr.val + ')');
+ } else {
+ var pair = "'" + attr.name + "':(" + attr.val + ')';
+ buf.push(pair);
+ }
+ });
+
+ if (classes.length) {
+ classes = classes.join(" + ' ' + ");
+ buf.push("class: " + classes);
+ }
+
+ return {
+ buf: buf.join(', ').replace('class:', '"class":'),
+ escaped: JSON.stringify(escaped),
+ inherits: inherits,
+ constant: constant
+ };
+ }
+};
+
+/**
+ * Check if expression can be evaluated to a constant
+ *
+ * @param {String} expression
+ * @return {Boolean}
+ * @api private
+ */
+
+function isConstant(val){
+ // Check strings/literals
+ if (/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val))
+ return true;
+
+ // Check numbers
+ if (!isNaN(Number(val)))
+ return true;
+
+ // Check arrays
+ var matches;
+ if (matches = /^ *\[(.*)\] *$/.exec(val))
+ return matches[1].split(',').every(isConstant);
+
+ return false;
+}
+
+/**
+ * Escape the given string of `html`.
+ *
+ * @param {String} html
+ * @return {String}
+ * @api private
+ */
+
+function escape(html){
+ return String(html)
+ .replace(/&(?!\w+;)/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"');
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/doctypes.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/doctypes.js
new file mode 100644
index 0000000..e87ca1e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/doctypes.js
@@ -0,0 +1,18 @@
+
+/*!
+ * Jade - doctypes
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = {
+ '5': ''
+ , 'default': ''
+ , 'xml': ''
+ , 'transitional': ''
+ , 'strict': ''
+ , 'frameset': ''
+ , '1.1': ''
+ , 'basic': ''
+ , 'mobile': ''
+};
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/filters.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/filters.js
new file mode 100644
index 0000000..fdb634c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/filters.js
@@ -0,0 +1,97 @@
+
+/*!
+ * Jade - filters
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = {
+
+ /**
+ * Wrap text with CDATA block.
+ */
+
+ cdata: function(str){
+ return '';
+ },
+
+ /**
+ * Transform sass to css, wrapped in style tags.
+ */
+
+ sass: function(str){
+ str = str.replace(/\\n/g, '\n');
+ var sass = require('sass').render(str).replace(/\n/g, '\\n');
+ return '';
+ },
+
+ /**
+ * Transform stylus to css, wrapped in style tags.
+ */
+
+ stylus: function(str, options){
+ var ret;
+ str = str.replace(/\\n/g, '\n');
+ var stylus = require('stylus');
+ stylus(str, options).render(function(err, css){
+ if (err) throw err;
+ ret = css.replace(/\n/g, '\\n');
+ });
+ return '';
+ },
+
+ /**
+ * Transform less to css, wrapped in style tags.
+ */
+
+ less: function(str){
+ var ret;
+ str = str.replace(/\\n/g, '\n');
+ require('less').render(str, function(err, css){
+ if (err) throw err;
+ ret = '';
+ });
+ return ret;
+ },
+
+ /**
+ * Transform markdown to html.
+ */
+
+ markdown: function(str){
+ var md;
+
+ // support markdown / discount
+ try {
+ md = require('markdown');
+ } catch (err){
+ try {
+ md = require('discount');
+ } catch (err) {
+ try {
+ md = require('markdown-js');
+ } catch (err) {
+ try {
+ md = require('marked');
+ } catch (err) {
+ throw new
+ Error('Cannot find markdown library, install markdown, discount, or marked.');
+ }
+ }
+ }
+ }
+
+ str = str.replace(/\\n/g, '\n');
+ return md.parse(str).replace(/\n/g, '\\n').replace(/'/g,''');
+ },
+
+ /**
+ * Transform coffeescript to javascript.
+ */
+
+ coffeescript: function(str){
+ str = str.replace(/\\n/g, '\n');
+ var js = require('coffee-script').compile(str).replace(/\\/g, '\\\\').replace(/\n/g, '\\n');
+ return '';
+ }
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/inline-tags.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/inline-tags.js
new file mode 100644
index 0000000..491de0b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/inline-tags.js
@@ -0,0 +1,28 @@
+
+/*!
+ * Jade - inline tags
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = [
+ 'a'
+ , 'abbr'
+ , 'acronym'
+ , 'b'
+ , 'br'
+ , 'code'
+ , 'em'
+ , 'font'
+ , 'i'
+ , 'img'
+ , 'ins'
+ , 'kbd'
+ , 'map'
+ , 'samp'
+ , 'small'
+ , 'span'
+ , 'strong'
+ , 'sub'
+ , 'sup'
+];
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/jade.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/jade.js
new file mode 100644
index 0000000..c6f7ede
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/jade.js
@@ -0,0 +1,253 @@
+/*!
+ * Jade
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Parser = require('./parser')
+ , Lexer = require('./lexer')
+ , Compiler = require('./compiler')
+ , runtime = require('./runtime')
+// if node
+ , fs = require('fs');
+// end
+
+/**
+ * Library version.
+ */
+
+exports.version = '0.27.2';
+
+/**
+ * Expose self closing tags.
+ */
+
+exports.selfClosing = require('./self-closing');
+
+/**
+ * Default supported doctypes.
+ */
+
+exports.doctypes = require('./doctypes');
+
+/**
+ * Text filters.
+ */
+
+exports.filters = require('./filters');
+
+/**
+ * Utilities.
+ */
+
+exports.utils = require('./utils');
+
+/**
+ * Expose `Compiler`.
+ */
+
+exports.Compiler = Compiler;
+
+/**
+ * Expose `Parser`.
+ */
+
+exports.Parser = Parser;
+
+/**
+ * Expose `Lexer`.
+ */
+
+exports.Lexer = Lexer;
+
+/**
+ * Nodes.
+ */
+
+exports.nodes = require('./nodes');
+
+/**
+ * Jade runtime helpers.
+ */
+
+exports.runtime = runtime;
+
+/**
+ * Template function cache.
+ */
+
+exports.cache = {};
+
+/**
+ * Parse the given `str` of jade and return a function body.
+ *
+ * @param {String} str
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function parse(str, options){
+ try {
+ // Parse
+ var parser = new Parser(str, options.filename, options);
+
+ // Compile
+ var compiler = new (options.compiler || Compiler)(parser.parse(), options)
+ , js = compiler.compile();
+
+ // Debug compiler
+ if (options.debug) {
+ console.error('\nCompiled Function:\n\n\033[90m%s\033[0m', js.replace(/^/gm, ' '));
+ }
+
+ return ''
+ + 'var buf = [];\n'
+ + (options.self
+ ? 'var self = locals || {};\n' + js
+ : 'with (locals || {}) {\n' + js + '\n}\n')
+ + 'return buf.join("");';
+ } catch (err) {
+ parser = parser.context();
+ runtime.rethrow(err, parser.filename, parser.lexer.lineno);
+ }
+}
+
+/**
+ * Strip any UTF-8 BOM off of the start of `str`, if it exists.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+function stripBOM(str){
+ return 0xFEFF == str.charCodeAt(0)
+ ? str.substring(1)
+ : str;
+}
+
+/**
+ * Compile a `Function` representation of the given jade `str`.
+ *
+ * Options:
+ *
+ * - `compileDebug` when `false` debugging code is stripped from the compiled template
+ * - `client` when `true` the helper functions `escape()` etc will reference `jade.escape()`
+ * for use with the Jade client-side runtime.js
+ *
+ * @param {String} str
+ * @param {Options} options
+ * @return {Function}
+ * @api public
+ */
+
+exports.compile = function(str, options){
+ var options = options || {}
+ , client = options.client
+ , filename = options.filename
+ ? JSON.stringify(options.filename)
+ : 'undefined'
+ , fn;
+
+ str = stripBOM(String(str));
+
+ if (options.compileDebug !== false) {
+ fn = [
+ 'var __jade = [{ lineno: 1, filename: ' + filename + ' }];'
+ , 'try {'
+ , parse(str, options)
+ , '} catch (err) {'
+ , ' rethrow(err, __jade[0].filename, __jade[0].lineno);'
+ , '}'
+ ].join('\n');
+ } else {
+ fn = parse(str, options);
+ }
+
+ if (client) {
+ fn = 'attrs = attrs || jade.attrs; escape = escape || jade.escape; rethrow = rethrow || jade.rethrow; merge = merge || jade.merge;\n' + fn;
+ }
+
+ fn = new Function('locals, attrs, escape, rethrow, merge', fn);
+
+ if (client) return fn;
+
+ return function(locals){
+ return fn(locals, runtime.attrs, runtime.escape, runtime.rethrow, runtime.merge);
+ };
+};
+
+/**
+ * Render the given `str` of jade and invoke
+ * the callback `fn(err, str)`.
+ *
+ * Options:
+ *
+ * - `cache` enable template caching
+ * - `filename` filename required for `include` / `extends` and caching
+ *
+ * @param {String} str
+ * @param {Object|Function} options or fn
+ * @param {Function} fn
+ * @api public
+ */
+
+exports.render = function(str, options, fn){
+ // swap args
+ if ('function' == typeof options) {
+ fn = options, options = {};
+ }
+
+ // cache requires .filename
+ if (options.cache && !options.filename) {
+ return fn(new Error('the "filename" option is required for caching'));
+ }
+
+ try {
+ var path = options.filename;
+ var tmpl = options.cache
+ ? exports.cache[path] || (exports.cache[path] = exports.compile(str, options))
+ : exports.compile(str, options);
+ fn(null, tmpl(options));
+ } catch (err) {
+ fn(err);
+ }
+};
+
+/**
+ * Render a Jade file at the given `path` and callback `fn(err, str)`.
+ *
+ * @param {String} path
+ * @param {Object|Function} options or callback
+ * @param {Function} fn
+ * @api public
+ */
+
+exports.renderFile = function(path, options, fn){
+ var key = path + ':string';
+
+ if ('function' == typeof options) {
+ fn = options, options = {};
+ }
+
+ try {
+ options.filename = path;
+ var str = options.cache
+ ? exports.cache[key] || (exports.cache[key] = fs.readFileSync(path, 'utf8'))
+ : fs.readFileSync(path, 'utf8');
+ exports.render(str, options, fn);
+ } catch (err) {
+ fn(err);
+ }
+};
+
+/**
+ * Express support.
+ */
+
+exports.__express = exports.renderFile;
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/lexer.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/lexer.js
new file mode 100644
index 0000000..51b1690
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/lexer.js
@@ -0,0 +1,773 @@
+
+/*!
+ * Jade - Lexer
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+var utils = require('./utils');
+
+/**
+ * Initialize `Lexer` with the given `str`.
+ *
+ * Options:
+ *
+ * - `colons` allow colons for attr delimiters
+ *
+ * @param {String} str
+ * @param {Object} options
+ * @api private
+ */
+
+var Lexer = module.exports = function Lexer(str, options) {
+ options = options || {};
+ this.input = str.replace(/\r\n|\r/g, '\n');
+ this.colons = options.colons;
+ this.deferredTokens = [];
+ this.lastIndents = 0;
+ this.lineno = 1;
+ this.stash = [];
+ this.indentStack = [];
+ this.indentRe = null;
+ this.pipeless = false;
+};
+
+/**
+ * Lexer prototype.
+ */
+
+Lexer.prototype = {
+
+ /**
+ * Construct a token with the given `type` and `val`.
+ *
+ * @param {String} type
+ * @param {String} val
+ * @return {Object}
+ * @api private
+ */
+
+ tok: function(type, val){
+ return {
+ type: type
+ , line: this.lineno
+ , val: val
+ }
+ },
+
+ /**
+ * Consume the given `len` of input.
+ *
+ * @param {Number} len
+ * @api private
+ */
+
+ consume: function(len){
+ this.input = this.input.substr(len);
+ },
+
+ /**
+ * Scan for `type` with the given `regexp`.
+ *
+ * @param {String} type
+ * @param {RegExp} regexp
+ * @return {Object}
+ * @api private
+ */
+
+ scan: function(regexp, type){
+ var captures;
+ if (captures = regexp.exec(this.input)) {
+ this.consume(captures[0].length);
+ return this.tok(type, captures[1]);
+ }
+ },
+
+ /**
+ * Defer the given `tok`.
+ *
+ * @param {Object} tok
+ * @api private
+ */
+
+ defer: function(tok){
+ this.deferredTokens.push(tok);
+ },
+
+ /**
+ * Lookahead `n` tokens.
+ *
+ * @param {Number} n
+ * @return {Object}
+ * @api private
+ */
+
+ lookahead: function(n){
+ var fetch = n - this.stash.length;
+ while (fetch-- > 0) this.stash.push(this.next());
+ return this.stash[--n];
+ },
+
+ /**
+ * Return the indexOf `start` / `end` delimiters.
+ *
+ * @param {String} start
+ * @param {String} end
+ * @return {Number}
+ * @api private
+ */
+
+ indexOfDelimiters: function(start, end){
+ var str = this.input
+ , nstart = 0
+ , nend = 0
+ , pos = 0;
+ for (var i = 0, len = str.length; i < len; ++i) {
+ if (start == str.charAt(i)) {
+ ++nstart;
+ } else if (end == str.charAt(i)) {
+ if (++nend == nstart) {
+ pos = i;
+ break;
+ }
+ }
+ }
+ return pos;
+ },
+
+ /**
+ * Stashed token.
+ */
+
+ stashed: function() {
+ return this.stash.length
+ && this.stash.shift();
+ },
+
+ /**
+ * Deferred token.
+ */
+
+ deferred: function() {
+ return this.deferredTokens.length
+ && this.deferredTokens.shift();
+ },
+
+ /**
+ * end-of-source.
+ */
+
+ eos: function() {
+ if (this.input.length) return;
+ if (this.indentStack.length) {
+ this.indentStack.shift();
+ return this.tok('outdent');
+ } else {
+ return this.tok('eos');
+ }
+ },
+
+ /**
+ * Blank line.
+ */
+
+ blank: function() {
+ var captures;
+ if (captures = /^\n *\n/.exec(this.input)) {
+ this.consume(captures[0].length - 1);
+ if (this.pipeless) return this.tok('text', '');
+ return this.next();
+ }
+ },
+
+ /**
+ * Comment.
+ */
+
+ comment: function() {
+ var captures;
+ if (captures = /^ *\/\/(-)?([^\n]*)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('comment', captures[2]);
+ tok.buffer = '-' != captures[1];
+ return tok;
+ }
+ },
+
+ /**
+ * Interpolated tag.
+ */
+
+ interpolation: function() {
+ var captures;
+ if (captures = /^#\{(.*?)\}/.exec(this.input)) {
+ this.consume(captures[0].length);
+ return this.tok('interpolation', captures[1]);
+ }
+ },
+
+ /**
+ * Tag.
+ */
+
+ tag: function() {
+ var captures;
+ if (captures = /^(\w[-:\w]*)(\/?)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok, name = captures[1];
+ if (':' == name[name.length - 1]) {
+ name = name.slice(0, -1);
+ tok = this.tok('tag', name);
+ this.defer(this.tok(':'));
+ while (' ' == this.input[0]) this.input = this.input.substr(1);
+ } else {
+ tok = this.tok('tag', name);
+ }
+ tok.selfClosing = !! captures[2];
+ return tok;
+ }
+ },
+
+ /**
+ * Filter.
+ */
+
+ filter: function() {
+ return this.scan(/^:(\w+)/, 'filter');
+ },
+
+ /**
+ * Doctype.
+ */
+
+ doctype: function() {
+ return this.scan(/^(?:!!!|doctype) *([^\n]+)?/, 'doctype');
+ },
+
+ /**
+ * Id.
+ */
+
+ id: function() {
+ return this.scan(/^#([\w-]+)/, 'id');
+ },
+
+ /**
+ * Class.
+ */
+
+ className: function() {
+ return this.scan(/^\.([\w-]+)/, 'class');
+ },
+
+ /**
+ * Text.
+ */
+
+ text: function() {
+ return this.scan(/^(?:\| ?| ?)?([^\n]+)/, 'text');
+ },
+
+ /**
+ * Extends.
+ */
+
+ "extends": function() {
+ return this.scan(/^extends? +([^\n]+)/, 'extends');
+ },
+
+ /**
+ * Block prepend.
+ */
+
+ prepend: function() {
+ var captures;
+ if (captures = /^prepend +([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var mode = 'prepend'
+ , name = captures[1]
+ , tok = this.tok('block', name);
+ tok.mode = mode;
+ return tok;
+ }
+ },
+
+ /**
+ * Block append.
+ */
+
+ append: function() {
+ var captures;
+ if (captures = /^append +([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var mode = 'append'
+ , name = captures[1]
+ , tok = this.tok('block', name);
+ tok.mode = mode;
+ return tok;
+ }
+ },
+
+ /**
+ * Block.
+ */
+
+ block: function() {
+ var captures;
+ if (captures = /^block\b *(?:(prepend|append) +)?([^\n]*)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var mode = captures[1] || 'replace'
+ , name = captures[2]
+ , tok = this.tok('block', name);
+
+ tok.mode = mode;
+ return tok;
+ }
+ },
+
+ /**
+ * Yield.
+ */
+
+ yield: function() {
+ return this.scan(/^yield */, 'yield');
+ },
+
+ /**
+ * Include.
+ */
+
+ include: function() {
+ return this.scan(/^include +([^\n]+)/, 'include');
+ },
+
+ /**
+ * Case.
+ */
+
+ "case": function() {
+ return this.scan(/^case +([^\n]+)/, 'case');
+ },
+
+ /**
+ * When.
+ */
+
+ when: function() {
+ return this.scan(/^when +([^:\n]+)/, 'when');
+ },
+
+ /**
+ * Default.
+ */
+
+ "default": function() {
+ return this.scan(/^default */, 'default');
+ },
+
+ /**
+ * Assignment.
+ */
+
+ assignment: function() {
+ var captures;
+ if (captures = /^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var name = captures[1]
+ , val = captures[2];
+ return this.tok('code', 'var ' + name + ' = (' + val + ');');
+ }
+ },
+
+ /**
+ * Call mixin.
+ */
+
+ call: function(){
+ var captures;
+ if (captures = /^\+([-\w]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('call', captures[1]);
+
+ // Check for args (not attributes)
+ if (captures = /^ *\((.*?)\)/.exec(this.input)) {
+ if (!/^ *[-\w]+ *=/.test(captures[1])) {
+ this.consume(captures[0].length);
+ tok.args = captures[1];
+ }
+ }
+
+ return tok;
+ }
+ },
+
+ /**
+ * Mixin.
+ */
+
+ mixin: function(){
+ var captures;
+ if (captures = /^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('mixin', captures[1]);
+ tok.args = captures[2];
+ return tok;
+ }
+ },
+
+ /**
+ * Conditional.
+ */
+
+ conditional: function() {
+ var captures;
+ if (captures = /^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var type = captures[1]
+ , js = captures[2];
+
+ switch (type) {
+ case 'if': js = 'if (' + js + ')'; break;
+ case 'unless': js = 'if (!(' + js + '))'; break;
+ case 'else if': js = 'else if (' + js + ')'; break;
+ case 'else': js = 'else'; break;
+ }
+
+ return this.tok('code', js);
+ }
+ },
+
+ /**
+ * While.
+ */
+
+ "while": function() {
+ var captures;
+ if (captures = /^while +([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ return this.tok('code', 'while (' + captures[1] + ')');
+ }
+ },
+
+ /**
+ * Each.
+ */
+
+ each: function() {
+ var captures;
+ if (captures = /^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var tok = this.tok('each', captures[1]);
+ tok.key = captures[2] || '$index';
+ tok.code = captures[3];
+ return tok;
+ }
+ },
+
+ /**
+ * Code.
+ */
+
+ code: function() {
+ var captures;
+ if (captures = /^(!?=|-)([^\n]+)/.exec(this.input)) {
+ this.consume(captures[0].length);
+ var flags = captures[1];
+ captures[1] = captures[2];
+ var tok = this.tok('code', captures[1]);
+ tok.escape = flags[0] === '=';
+ tok.buffer = flags[0] === '=' || flags[1] === '=';
+ return tok;
+ }
+ },
+
+ /**
+ * Attributes.
+ */
+
+ attrs: function() {
+ if ('(' == this.input.charAt(0)) {
+ var index = this.indexOfDelimiters('(', ')')
+ , str = this.input.substr(1, index-1)
+ , tok = this.tok('attrs')
+ , len = str.length
+ , colons = this.colons
+ , states = ['key']
+ , escapedAttr
+ , key = ''
+ , val = ''
+ , quote
+ , c
+ , p;
+
+ function state(){
+ return states[states.length - 1];
+ }
+
+ function interpolate(attr) {
+ return attr.replace(/#\{([^}]+)\}/g, function(_, expr){
+ return quote + " + (" + expr + ") + " + quote;
+ });
+ }
+
+ this.consume(index + 1);
+ tok.attrs = {};
+ tok.escaped = {};
+
+ function parse(c) {
+ var real = c;
+ // TODO: remove when people fix ":"
+ if (colons && ':' == c) c = '=';
+ switch (c) {
+ case ',':
+ case '\n':
+ switch (state()) {
+ case 'expr':
+ case 'array':
+ case 'string':
+ case 'object':
+ val += c;
+ break;
+ default:
+ states.push('key');
+ val = val.trim();
+ key = key.trim();
+ if ('' == key) return;
+ key = key.replace(/^['"]|['"]$/g, '').replace('!', '');
+ tok.escaped[key] = escapedAttr;
+ tok.attrs[key] = '' == val
+ ? true
+ : interpolate(val);
+ key = val = '';
+ }
+ break;
+ case '=':
+ switch (state()) {
+ case 'key char':
+ key += real;
+ break;
+ case 'val':
+ case 'expr':
+ case 'array':
+ case 'string':
+ case 'object':
+ val += real;
+ break;
+ default:
+ escapedAttr = '!' != p;
+ states.push('val');
+ }
+ break;
+ case '(':
+ if ('val' == state()
+ || 'expr' == state()) states.push('expr');
+ val += c;
+ break;
+ case ')':
+ if ('expr' == state()
+ || 'val' == state()) states.pop();
+ val += c;
+ break;
+ case '{':
+ if ('val' == state()) states.push('object');
+ val += c;
+ break;
+ case '}':
+ if ('object' == state()) states.pop();
+ val += c;
+ break;
+ case '[':
+ if ('val' == state()) states.push('array');
+ val += c;
+ break;
+ case ']':
+ if ('array' == state()) states.pop();
+ val += c;
+ break;
+ case '"':
+ case "'":
+ switch (state()) {
+ case 'key':
+ states.push('key char');
+ break;
+ case 'key char':
+ states.pop();
+ break;
+ case 'string':
+ if (c == quote) states.pop();
+ val += c;
+ break;
+ default:
+ states.push('string');
+ val += c;
+ quote = c;
+ }
+ break;
+ case '':
+ break;
+ default:
+ switch (state()) {
+ case 'key':
+ case 'key char':
+ key += c;
+ break;
+ default:
+ val += c;
+ }
+ }
+ p = c;
+ }
+
+ for (var i = 0; i < len; ++i) {
+ parse(str.charAt(i));
+ }
+
+ parse(',');
+
+ if ('/' == this.input.charAt(0)) {
+ this.consume(1);
+ tok.selfClosing = true;
+ }
+
+ return tok;
+ }
+ },
+
+ /**
+ * Indent | Outdent | Newline.
+ */
+
+ indent: function() {
+ var captures, re;
+
+ // established regexp
+ if (this.indentRe) {
+ captures = this.indentRe.exec(this.input);
+ // determine regexp
+ } else {
+ // tabs
+ re = /^\n(\t*) */;
+ captures = re.exec(this.input);
+
+ // spaces
+ if (captures && !captures[1].length) {
+ re = /^\n( *)/;
+ captures = re.exec(this.input);
+ }
+
+ // established
+ if (captures && captures[1].length) this.indentRe = re;
+ }
+
+ if (captures) {
+ var tok
+ , indents = captures[1].length;
+
+ ++this.lineno;
+ this.consume(indents + 1);
+
+ if (' ' == this.input[0] || '\t' == this.input[0]) {
+ throw new Error('Invalid indentation, you can use tabs or spaces but not both');
+ }
+
+ // blank line
+ if ('\n' == this.input[0]) return this.tok('newline');
+
+ // outdent
+ if (this.indentStack.length && indents < this.indentStack[0]) {
+ while (this.indentStack.length && this.indentStack[0] > indents) {
+ this.stash.push(this.tok('outdent'));
+ this.indentStack.shift();
+ }
+ tok = this.stash.pop();
+ // indent
+ } else if (indents && indents != this.indentStack[0]) {
+ this.indentStack.unshift(indents);
+ tok = this.tok('indent', indents);
+ // newline
+ } else {
+ tok = this.tok('newline');
+ }
+
+ return tok;
+ }
+ },
+
+ /**
+ * Pipe-less text consumed only when
+ * pipeless is true;
+ */
+
+ pipelessText: function() {
+ if (this.pipeless) {
+ if ('\n' == this.input[0]) return;
+ var i = this.input.indexOf('\n');
+ if (-1 == i) i = this.input.length;
+ var str = this.input.substr(0, i);
+ this.consume(str.length);
+ return this.tok('text', str);
+ }
+ },
+
+ /**
+ * ':'
+ */
+
+ colon: function() {
+ return this.scan(/^: */, ':');
+ },
+
+ /**
+ * Return the next token object, or those
+ * previously stashed by lookahead.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ advance: function(){
+ return this.stashed()
+ || this.next();
+ },
+
+ /**
+ * Return the next token object.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ next: function() {
+ return this.deferred()
+ || this.blank()
+ || this.eos()
+ || this.pipelessText()
+ || this.yield()
+ || this.doctype()
+ || this.interpolation()
+ || this["case"]()
+ || this.when()
+ || this["default"]()
+ || this["extends"]()
+ || this.append()
+ || this.prepend()
+ || this.block()
+ || this.include()
+ || this.mixin()
+ || this.call()
+ || this.conditional()
+ || this.each()
+ || this["while"]()
+ || this.assignment()
+ || this.tag()
+ || this.filter()
+ || this.code()
+ || this.id()
+ || this.className()
+ || this.attrs()
+ || this.indent()
+ || this.comment()
+ || this.colon()
+ || this.text();
+ }
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/attrs.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/attrs.js
new file mode 100644
index 0000000..5de9b59
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/attrs.js
@@ -0,0 +1,77 @@
+
+/*!
+ * Jade - nodes - Attrs
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node'),
+ Block = require('./block');
+
+/**
+ * Initialize a `Attrs` node.
+ *
+ * @api public
+ */
+
+var Attrs = module.exports = function Attrs() {
+ this.attrs = [];
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Attrs.prototype.__proto__ = Node.prototype;
+
+/**
+ * Set attribute `name` to `val`, keep in mind these become
+ * part of a raw js object literal, so to quote a value you must
+ * '"quote me"', otherwise or example 'user.name' is literal JavaScript.
+ *
+ * @param {String} name
+ * @param {String} val
+ * @param {Boolean} escaped
+ * @return {Tag} for chaining
+ * @api public
+ */
+
+Attrs.prototype.setAttribute = function(name, val, escaped){
+ this.attrs.push({ name: name, val: val, escaped: escaped });
+ return this;
+};
+
+/**
+ * Remove attribute `name` when present.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+Attrs.prototype.removeAttribute = function(name){
+ for (var i = 0, len = this.attrs.length; i < len; ++i) {
+ if (this.attrs[i] && this.attrs[i].name == name) {
+ delete this.attrs[i];
+ }
+ }
+};
+
+/**
+ * Get attribute value by `name`.
+ *
+ * @param {String} name
+ * @return {String}
+ * @api public
+ */
+
+Attrs.prototype.getAttribute = function(name){
+ for (var i = 0, len = this.attrs.length; i < len; ++i) {
+ if (this.attrs[i] && this.attrs[i].name == name) {
+ return this.attrs[i].val;
+ }
+ }
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/block-comment.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/block-comment.js
new file mode 100644
index 0000000..4f41e4a
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/block-comment.js
@@ -0,0 +1,33 @@
+
+/*!
+ * Jade - nodes - BlockComment
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `BlockComment` with the given `block`.
+ *
+ * @param {String} val
+ * @param {Block} block
+ * @param {Boolean} buffer
+ * @api public
+ */
+
+var BlockComment = module.exports = function BlockComment(val, block, buffer) {
+ this.block = block;
+ this.val = val;
+ this.buffer = buffer;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+BlockComment.prototype.__proto__ = Node.prototype;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/block.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/block.js
new file mode 100644
index 0000000..bb00a1d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/block.js
@@ -0,0 +1,121 @@
+
+/*!
+ * Jade - nodes - Block
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a new `Block` with an optional `node`.
+ *
+ * @param {Node} node
+ * @api public
+ */
+
+var Block = module.exports = function Block(node){
+ this.nodes = [];
+ if (node) this.push(node);
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Block.prototype.__proto__ = Node.prototype;
+
+/**
+ * Block flag.
+ */
+
+Block.prototype.isBlock = true;
+
+/**
+ * Replace the nodes in `other` with the nodes
+ * in `this` block.
+ *
+ * @param {Block} other
+ * @api private
+ */
+
+Block.prototype.replace = function(other){
+ other.nodes = this.nodes;
+};
+
+/**
+ * Pust the given `node`.
+ *
+ * @param {Node} node
+ * @return {Number}
+ * @api public
+ */
+
+Block.prototype.push = function(node){
+ return this.nodes.push(node);
+};
+
+/**
+ * Check if this block is empty.
+ *
+ * @return {Boolean}
+ * @api public
+ */
+
+Block.prototype.isEmpty = function(){
+ return 0 == this.nodes.length;
+};
+
+/**
+ * Unshift the given `node`.
+ *
+ * @param {Node} node
+ * @return {Number}
+ * @api public
+ */
+
+Block.prototype.unshift = function(node){
+ return this.nodes.unshift(node);
+};
+
+/**
+ * Return the "last" block, or the first `yield` node.
+ *
+ * @return {Block}
+ * @api private
+ */
+
+Block.prototype.includeBlock = function(){
+ var ret = this
+ , node;
+
+ for (var i = 0, len = this.nodes.length; i < len; ++i) {
+ node = this.nodes[i];
+ if (node.yield) return node;
+ else if (node.textOnly) continue;
+ else if (node.includeBlock) ret = node.includeBlock();
+ else if (node.block && !node.block.isEmpty()) ret = node.block.includeBlock();
+ }
+
+ return ret;
+};
+
+/**
+ * Return a clone of this block.
+ *
+ * @return {Block}
+ * @api private
+ */
+
+Block.prototype.clone = function(){
+ var clone = new Block;
+ for (var i = 0, len = this.nodes.length; i < len; ++i) {
+ clone.push(this.nodes[i].clone());
+ }
+ return clone;
+};
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/case.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/case.js
new file mode 100644
index 0000000..08ff033
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/case.js
@@ -0,0 +1,43 @@
+
+/*!
+ * Jade - nodes - Case
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a new `Case` with `expr`.
+ *
+ * @param {String} expr
+ * @api public
+ */
+
+var Case = exports = module.exports = function Case(expr, block){
+ this.expr = expr;
+ this.block = block;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Case.prototype.__proto__ = Node.prototype;
+
+var When = exports.When = function When(expr, block){
+ this.expr = expr;
+ this.block = block;
+ this.debug = false;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+When.prototype.__proto__ = Node.prototype;
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/code.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/code.js
new file mode 100644
index 0000000..babc675
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/code.js
@@ -0,0 +1,35 @@
+
+/*!
+ * Jade - nodes - Code
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Code` node with the given code `val`.
+ * Code may also be optionally buffered and escaped.
+ *
+ * @param {String} val
+ * @param {Boolean} buffer
+ * @param {Boolean} escape
+ * @api public
+ */
+
+var Code = module.exports = function Code(val, buffer, escape) {
+ this.val = val;
+ this.buffer = buffer;
+ this.escape = escape;
+ if (val.match(/^ *else/)) this.debug = false;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Code.prototype.__proto__ = Node.prototype;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/comment.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/comment.js
new file mode 100644
index 0000000..2e1469e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/comment.js
@@ -0,0 +1,32 @@
+
+/*!
+ * Jade - nodes - Comment
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Comment` with the given `val`, optionally `buffer`,
+ * otherwise the comment may render in the output.
+ *
+ * @param {String} val
+ * @param {Boolean} buffer
+ * @api public
+ */
+
+var Comment = module.exports = function Comment(val, buffer) {
+ this.val = val;
+ this.buffer = buffer;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Comment.prototype.__proto__ = Node.prototype;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/doctype.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/doctype.js
new file mode 100644
index 0000000..b8f33e5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/doctype.js
@@ -0,0 +1,29 @@
+
+/*!
+ * Jade - nodes - Doctype
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Doctype` with the given `val`.
+ *
+ * @param {String} val
+ * @api public
+ */
+
+var Doctype = module.exports = function Doctype(val) {
+ this.val = val;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Doctype.prototype.__proto__ = Node.prototype;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/each.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/each.js
new file mode 100644
index 0000000..f54101f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/each.js
@@ -0,0 +1,35 @@
+
+/*!
+ * Jade - nodes - Each
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize an `Each` node, representing iteration
+ *
+ * @param {String} obj
+ * @param {String} val
+ * @param {String} key
+ * @param {Block} block
+ * @api public
+ */
+
+var Each = module.exports = function Each(obj, val, key, block) {
+ this.obj = obj;
+ this.val = val;
+ this.key = key;
+ this.block = block;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Each.prototype.__proto__ = Node.prototype;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/filter.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/filter.js
new file mode 100644
index 0000000..851a004
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/filter.js
@@ -0,0 +1,35 @@
+
+/*!
+ * Jade - nodes - Filter
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node')
+ , Block = require('./block');
+
+/**
+ * Initialize a `Filter` node with the given
+ * filter `name` and `block`.
+ *
+ * @param {String} name
+ * @param {Block|Node} block
+ * @api public
+ */
+
+var Filter = module.exports = function Filter(name, block, attrs) {
+ this.name = name;
+ this.block = block;
+ this.attrs = attrs;
+ this.isASTFilter = !block.nodes.every(function(node){ return node.isText });
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Filter.prototype.__proto__ = Node.prototype;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/index.js
new file mode 100644
index 0000000..386ad2f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/index.js
@@ -0,0 +1,20 @@
+
+/*!
+ * Jade - nodes
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+exports.Node = require('./node');
+exports.Tag = require('./tag');
+exports.Code = require('./code');
+exports.Each = require('./each');
+exports.Case = require('./case');
+exports.Text = require('./text');
+exports.Block = require('./block');
+exports.Mixin = require('./mixin');
+exports.Filter = require('./filter');
+exports.Comment = require('./comment');
+exports.Literal = require('./literal');
+exports.BlockComment = require('./block-comment');
+exports.Doctype = require('./doctype');
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/literal.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/literal.js
new file mode 100644
index 0000000..fde586b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/literal.js
@@ -0,0 +1,32 @@
+
+/*!
+ * Jade - nodes - Literal
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Literal` node with the given `str.
+ *
+ * @param {String} str
+ * @api public
+ */
+
+var Literal = module.exports = function Literal(str) {
+ this.str = str
+ .replace(/\\/g, "\\\\")
+ .replace(/\n|\r\n/g, "\\n")
+ .replace(/'/g, "\\'");
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Literal.prototype.__proto__ = Node.prototype;
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/mixin.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/mixin.js
new file mode 100644
index 0000000..8407bc7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/mixin.js
@@ -0,0 +1,36 @@
+
+/*!
+ * Jade - nodes - Mixin
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Attrs = require('./attrs');
+
+/**
+ * Initialize a new `Mixin` with `name` and `block`.
+ *
+ * @param {String} name
+ * @param {String} args
+ * @param {Block} block
+ * @api public
+ */
+
+var Mixin = module.exports = function Mixin(name, args, block, call){
+ this.name = name;
+ this.args = args;
+ this.block = block;
+ this.attrs = [];
+ this.call = call;
+};
+
+/**
+ * Inherit from `Attrs`.
+ */
+
+Mixin.prototype.__proto__ = Attrs.prototype;
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/node.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/node.js
new file mode 100644
index 0000000..e98f042
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/node.js
@@ -0,0 +1,25 @@
+
+/*!
+ * Jade - nodes - Node
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Initialize a `Node`.
+ *
+ * @api public
+ */
+
+var Node = module.exports = function Node(){};
+
+/**
+ * Clone this node (return itself)
+ *
+ * @return {Node}
+ * @api private
+ */
+
+Node.prototype.clone = function(){
+ return this;
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/tag.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/tag.js
new file mode 100644
index 0000000..4b6728a
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/tag.js
@@ -0,0 +1,95 @@
+
+/*!
+ * Jade - nodes - Tag
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Attrs = require('./attrs'),
+ Block = require('./block'),
+ inlineTags = require('../inline-tags');
+
+/**
+ * Initialize a `Tag` node with the given tag `name` and optional `block`.
+ *
+ * @param {String} name
+ * @param {Block} block
+ * @api public
+ */
+
+var Tag = module.exports = function Tag(name, block) {
+ this.name = name;
+ this.attrs = [];
+ this.block = block || new Block;
+};
+
+/**
+ * Inherit from `Attrs`.
+ */
+
+Tag.prototype.__proto__ = Attrs.prototype;
+
+/**
+ * Clone this tag.
+ *
+ * @return {Tag}
+ * @api private
+ */
+
+Tag.prototype.clone = function(){
+ var clone = new Tag(this.name, this.block.clone());
+ clone.line = this.line;
+ clone.attrs = this.attrs;
+ clone.textOnly = this.textOnly;
+ return clone;
+};
+
+/**
+ * Check if this tag is an inline tag.
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+Tag.prototype.isInline = function(){
+ return ~inlineTags.indexOf(this.name);
+};
+
+/**
+ * Check if this tag's contents can be inlined. Used for pretty printing.
+ *
+ * @return {Boolean}
+ * @api private
+ */
+
+Tag.prototype.canInline = function(){
+ var nodes = this.block.nodes;
+
+ function isInline(node){
+ // Recurse if the node is a block
+ if (node.isBlock) return node.nodes.every(isInline);
+ return node.isText || (node.isInline && node.isInline());
+ }
+
+ // Empty tag
+ if (!nodes.length) return true;
+
+ // Text-only or inline-only tag
+ if (1 == nodes.length) return isInline(nodes[0]);
+
+ // Multi-line inline-only tag
+ if (this.block.nodes.every(isInline)) {
+ for (var i = 1, len = nodes.length; i < len; ++i) {
+ if (nodes[i-1].isText && nodes[i].isText)
+ return false;
+ }
+ return true;
+ }
+
+ // Mixed tag
+ return false;
+};
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/text.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/text.js
new file mode 100644
index 0000000..3b5dd55
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/nodes/text.js
@@ -0,0 +1,36 @@
+
+/*!
+ * Jade - nodes - Text
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Node = require('./node');
+
+/**
+ * Initialize a `Text` node with optional `line`.
+ *
+ * @param {String} line
+ * @api public
+ */
+
+var Text = module.exports = function Text(line) {
+ this.val = '';
+ if ('string' == typeof line) this.val = line;
+};
+
+/**
+ * Inherit from `Node`.
+ */
+
+Text.prototype.__proto__ = Node.prototype;
+
+/**
+ * Flag as text.
+ */
+
+Text.prototype.isText = true;
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/parser.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/parser.js
new file mode 100644
index 0000000..bd7b205
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/parser.js
@@ -0,0 +1,714 @@
+
+/*!
+ * Jade - Parser
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var Lexer = require('./lexer')
+ , nodes = require('./nodes');
+
+/**
+ * Initialize `Parser` with the given input `str` and `filename`.
+ *
+ * @param {String} str
+ * @param {String} filename
+ * @param {Object} options
+ * @api public
+ */
+
+var Parser = exports = module.exports = function Parser(str, filename, options){
+ this.input = str;
+ this.lexer = new Lexer(str, options);
+ this.filename = filename;
+ this.blocks = {};
+ this.mixins = {};
+ this.options = options;
+ this.contexts = [this];
+};
+
+/**
+ * Tags that may not contain tags.
+ */
+
+var textOnly = exports.textOnly = ['script', 'style'];
+
+/**
+ * Parser prototype.
+ */
+
+Parser.prototype = {
+
+ /**
+ * Push `parser` onto the context stack,
+ * or pop and return a `Parser`.
+ */
+
+ context: function(parser){
+ if (parser) {
+ this.contexts.push(parser);
+ } else {
+ return this.contexts.pop();
+ }
+ },
+
+ /**
+ * Return the next token object.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ advance: function(){
+ return this.lexer.advance();
+ },
+
+ /**
+ * Skip `n` tokens.
+ *
+ * @param {Number} n
+ * @api private
+ */
+
+ skip: function(n){
+ while (n--) this.advance();
+ },
+
+ /**
+ * Single token lookahead.
+ *
+ * @return {Object}
+ * @api private
+ */
+
+ peek: function() {
+ return this.lookahead(1);
+ },
+
+ /**
+ * Return lexer lineno.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+ line: function() {
+ return this.lexer.lineno;
+ },
+
+ /**
+ * `n` token lookahead.
+ *
+ * @param {Number} n
+ * @return {Object}
+ * @api private
+ */
+
+ lookahead: function(n){
+ return this.lexer.lookahead(n);
+ },
+
+ /**
+ * Parse input returning a string of js for evaluation.
+ *
+ * @return {String}
+ * @api public
+ */
+
+ parse: function(){
+ var block = new nodes.Block, parser;
+ block.line = this.line();
+
+ while ('eos' != this.peek().type) {
+ if ('newline' == this.peek().type) {
+ this.advance();
+ } else {
+ block.push(this.parseExpr());
+ }
+ }
+
+ if (parser = this.extending) {
+ this.context(parser);
+ var ast = parser.parse();
+ this.context();
+ // hoist mixins
+ for (var name in this.mixins)
+ ast.unshift(this.mixins[name]);
+ return ast;
+ }
+
+ return block;
+ },
+
+ /**
+ * Expect the given type, or throw an exception.
+ *
+ * @param {String} type
+ * @api private
+ */
+
+ expect: function(type){
+ if (this.peek().type === type) {
+ return this.advance();
+ } else {
+ throw new Error('expected "' + type + '", but got "' + this.peek().type + '"');
+ }
+ },
+
+ /**
+ * Accept the given `type`.
+ *
+ * @param {String} type
+ * @api private
+ */
+
+ accept: function(type){
+ if (this.peek().type === type) {
+ return this.advance();
+ }
+ },
+
+ /**
+ * tag
+ * | doctype
+ * | mixin
+ * | include
+ * | filter
+ * | comment
+ * | text
+ * | each
+ * | code
+ * | yield
+ * | id
+ * | class
+ * | interpolation
+ */
+
+ parseExpr: function(){
+ switch (this.peek().type) {
+ case 'tag':
+ return this.parseTag();
+ case 'mixin':
+ return this.parseMixin();
+ case 'block':
+ return this.parseBlock();
+ case 'case':
+ return this.parseCase();
+ case 'when':
+ return this.parseWhen();
+ case 'default':
+ return this.parseDefault();
+ case 'extends':
+ return this.parseExtends();
+ case 'include':
+ return this.parseInclude();
+ case 'doctype':
+ return this.parseDoctype();
+ case 'filter':
+ return this.parseFilter();
+ case 'comment':
+ return this.parseComment();
+ case 'text':
+ return this.parseText();
+ case 'each':
+ return this.parseEach();
+ case 'code':
+ return this.parseCode();
+ case 'call':
+ return this.parseCall();
+ case 'interpolation':
+ return this.parseInterpolation();
+ case 'yield':
+ this.advance();
+ var block = new nodes.Block;
+ block.yield = true;
+ return block;
+ case 'id':
+ case 'class':
+ var tok = this.advance();
+ this.lexer.defer(this.lexer.tok('tag', 'div'));
+ this.lexer.defer(tok);
+ return this.parseExpr();
+ default:
+ throw new Error('unexpected token "' + this.peek().type + '"');
+ }
+ },
+
+ /**
+ * Text
+ */
+
+ parseText: function(){
+ var tok = this.expect('text')
+ , node = new nodes.Text(tok.val);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * ':' expr
+ * | block
+ */
+
+ parseBlockExpansion: function(){
+ if (':' == this.peek().type) {
+ this.advance();
+ return new nodes.Block(this.parseExpr());
+ } else {
+ return this.block();
+ }
+ },
+
+ /**
+ * case
+ */
+
+ parseCase: function(){
+ var val = this.expect('case').val
+ , node = new nodes.Case(val);
+ node.line = this.line();
+ node.block = this.block();
+ return node;
+ },
+
+ /**
+ * when
+ */
+
+ parseWhen: function(){
+ var val = this.expect('when').val
+ return new nodes.Case.When(val, this.parseBlockExpansion());
+ },
+
+ /**
+ * default
+ */
+
+ parseDefault: function(){
+ this.expect('default');
+ return new nodes.Case.When('default', this.parseBlockExpansion());
+ },
+
+ /**
+ * code
+ */
+
+ parseCode: function(){
+ var tok = this.expect('code')
+ , node = new nodes.Code(tok.val, tok.buffer, tok.escape)
+ , block
+ , i = 1;
+ node.line = this.line();
+ while (this.lookahead(i) && 'newline' == this.lookahead(i).type) ++i;
+ block = 'indent' == this.lookahead(i).type;
+ if (block) {
+ this.skip(i-1);
+ node.block = this.block();
+ }
+ return node;
+ },
+
+ /**
+ * comment
+ */
+
+ parseComment: function(){
+ var tok = this.expect('comment')
+ , node;
+
+ if ('indent' == this.peek().type) {
+ node = new nodes.BlockComment(tok.val, this.block(), tok.buffer);
+ } else {
+ node = new nodes.Comment(tok.val, tok.buffer);
+ }
+
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * doctype
+ */
+
+ parseDoctype: function(){
+ var tok = this.expect('doctype')
+ , node = new nodes.Doctype(tok.val);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * filter attrs? text-block
+ */
+
+ parseFilter: function(){
+ var block
+ , tok = this.expect('filter')
+ , attrs = this.accept('attrs');
+
+ this.lexer.pipeless = true;
+ block = this.parseTextBlock();
+ this.lexer.pipeless = false;
+
+ var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * tag ':' attrs? block
+ */
+
+ parseASTFilter: function(){
+ var block
+ , tok = this.expect('tag')
+ , attrs = this.accept('attrs');
+
+ this.expect(':');
+ block = this.block();
+
+ var node = new nodes.Filter(tok.val, block, attrs && attrs.attrs);
+ node.line = this.line();
+ return node;
+ },
+
+ /**
+ * each block
+ */
+
+ parseEach: function(){
+ var tok = this.expect('each')
+ , node = new nodes.Each(tok.code, tok.val, tok.key);
+ node.line = this.line();
+ node.block = this.block();
+ if (this.peek().type == 'code' && this.peek().val == 'else') {
+ this.advance();
+ node.alternative = this.block();
+ }
+ return node;
+ },
+
+ /**
+ * 'extends' name
+ */
+
+ parseExtends: function(){
+ var path = require('path')
+ , fs = require('fs')
+ , dirname = path.dirname
+ , basename = path.basename
+ , join = path.join;
+
+ if (!this.filename)
+ throw new Error('the "filename" option is required to extend templates');
+
+ var path = this.expect('extends').val.trim()
+ , dir = dirname(this.filename);
+
+ var path = join(dir, path + '.jade')
+ , str = fs.readFileSync(path, 'utf8')
+ , parser = new Parser(str, path, this.options);
+
+ parser.blocks = this.blocks;
+ parser.contexts = this.contexts;
+ this.extending = parser;
+
+ // TODO: null node
+ return new nodes.Literal('');
+ },
+
+ /**
+ * 'block' name block
+ */
+
+ parseBlock: function(){
+ var block = this.expect('block')
+ , mode = block.mode
+ , name = block.val.trim();
+
+ block = 'indent' == this.peek().type
+ ? this.block()
+ : new nodes.Block(new nodes.Literal(''));
+
+ var prev = this.blocks[name];
+
+ if (prev) {
+ switch (prev.mode) {
+ case 'append':
+ block.nodes = block.nodes.concat(prev.nodes);
+ prev = block;
+ break;
+ case 'prepend':
+ block.nodes = prev.nodes.concat(block.nodes);
+ prev = block;
+ break;
+ }
+ }
+
+ block.mode = mode;
+ return this.blocks[name] = prev || block;
+ },
+
+ /**
+ * include block?
+ */
+
+ parseInclude: function(){
+ var path = require('path')
+ , fs = require('fs')
+ , dirname = path.dirname
+ , basename = path.basename
+ , join = path.join;
+
+ var path = this.expect('include').val.trim()
+ , dir = dirname(this.filename);
+
+ if (!this.filename)
+ throw new Error('the "filename" option is required to use includes');
+
+ // no extension
+ if (!~basename(path).indexOf('.')) {
+ path += '.jade';
+ }
+
+ // non-jade
+ if ('.jade' != path.substr(-5)) {
+ var path = join(dir, path)
+ , str = fs.readFileSync(path, 'utf8');
+ return new nodes.Literal(str);
+ }
+
+ var path = join(dir, path)
+ , str = fs.readFileSync(path, 'utf8')
+ , parser = new Parser(str, path, this.options);
+ parser.blocks = this.blocks;
+ parser.mixins = this.mixins;
+
+ this.context(parser);
+ var ast = parser.parse();
+ this.context();
+ ast.filename = path;
+
+ if ('indent' == this.peek().type) {
+ ast.includeBlock().push(this.block());
+ }
+
+ return ast;
+ },
+
+ /**
+ * call ident block
+ */
+
+ parseCall: function(){
+ var tok = this.expect('call')
+ , name = tok.val
+ , args = tok.args
+ , mixin = new nodes.Mixin(name, args, new nodes.Block, true);
+
+ this.tag(mixin);
+ if (mixin.block.isEmpty()) mixin.block = null;
+ return mixin;
+ },
+
+ /**
+ * mixin block
+ */
+
+ parseMixin: function(){
+ var tok = this.expect('mixin')
+ , name = tok.val
+ , args = tok.args
+ , mixin;
+
+ // definition
+ if ('indent' == this.peek().type) {
+ mixin = new nodes.Mixin(name, args, this.block(), false);
+ this.mixins[name] = mixin;
+ return mixin;
+ // call
+ } else {
+ return new nodes.Mixin(name, args, null, true);
+ }
+ },
+
+ /**
+ * indent (text | newline)* outdent
+ */
+
+ parseTextBlock: function(){
+ var block = new nodes.Block;
+ block.line = this.line();
+ var spaces = this.expect('indent').val;
+ if (null == this._spaces) this._spaces = spaces;
+ var indent = Array(spaces - this._spaces + 1).join(' ');
+ while ('outdent' != this.peek().type) {
+ switch (this.peek().type) {
+ case 'newline':
+ this.advance();
+ break;
+ case 'indent':
+ this.parseTextBlock().nodes.forEach(function(node){
+ block.push(node);
+ });
+ break;
+ default:
+ var text = new nodes.Text(indent + this.advance().val);
+ text.line = this.line();
+ block.push(text);
+ }
+ }
+
+ if (spaces == this._spaces) this._spaces = null;
+ this.expect('outdent');
+ return block;
+ },
+
+ /**
+ * indent expr* outdent
+ */
+
+ block: function(){
+ var block = new nodes.Block;
+ block.line = this.line();
+ this.expect('indent');
+ while ('outdent' != this.peek().type) {
+ if ('newline' == this.peek().type) {
+ this.advance();
+ } else {
+ block.push(this.parseExpr());
+ }
+ }
+ this.expect('outdent');
+ return block;
+ },
+
+ /**
+ * interpolation (attrs | class | id)* (text | code | ':')? newline* block?
+ */
+
+ parseInterpolation: function(){
+ var tok = this.advance();
+ var tag = new nodes.Tag(tok.val);
+ tag.buffer = true;
+ return this.tag(tag);
+ },
+
+ /**
+ * tag (attrs | class | id)* (text | code | ':')? newline* block?
+ */
+
+ parseTag: function(){
+ // ast-filter look-ahead
+ var i = 2;
+ if ('attrs' == this.lookahead(i).type) ++i;
+ if (':' == this.lookahead(i).type) {
+ if ('indent' == this.lookahead(++i).type) {
+ return this.parseASTFilter();
+ }
+ }
+
+ var tok = this.advance()
+ , tag = new nodes.Tag(tok.val);
+
+ tag.selfClosing = tok.selfClosing;
+
+ return this.tag(tag);
+ },
+
+ /**
+ * Parse tag.
+ */
+
+ tag: function(tag){
+ var dot;
+
+ tag.line = this.line();
+
+ // (attrs | class | id)*
+ out:
+ while (true) {
+ switch (this.peek().type) {
+ case 'id':
+ case 'class':
+ var tok = this.advance();
+ tag.setAttribute(tok.type, "'" + tok.val + "'");
+ continue;
+ case 'attrs':
+ var tok = this.advance()
+ , obj = tok.attrs
+ , escaped = tok.escaped
+ , names = Object.keys(obj);
+
+ if (tok.selfClosing) tag.selfClosing = true;
+
+ for (var i = 0, len = names.length; i < len; ++i) {
+ var name = names[i]
+ , val = obj[name];
+ tag.setAttribute(name, val, escaped[name]);
+ }
+ continue;
+ default:
+ break out;
+ }
+ }
+
+ // check immediate '.'
+ if ('.' == this.peek().val) {
+ dot = tag.textOnly = true;
+ this.advance();
+ }
+
+ // (text | code | ':')?
+ switch (this.peek().type) {
+ case 'text':
+ tag.block.push(this.parseText());
+ break;
+ case 'code':
+ tag.code = this.parseCode();
+ break;
+ case ':':
+ this.advance();
+ tag.block = new nodes.Block;
+ tag.block.push(this.parseExpr());
+ break;
+ }
+
+ // newline*
+ while ('newline' == this.peek().type) this.advance();
+
+ tag.textOnly = tag.textOnly || ~textOnly.indexOf(tag.name);
+
+ // script special-case
+ if ('script' == tag.name) {
+ var type = tag.getAttribute('type');
+ if (!dot && type && 'text/javascript' != type.replace(/^['"]|['"]$/g, '')) {
+ tag.textOnly = false;
+ }
+ }
+
+ // block?
+ if ('indent' == this.peek().type) {
+ if (tag.textOnly) {
+ this.lexer.pipeless = true;
+ tag.block = this.parseTextBlock();
+ this.lexer.pipeless = false;
+ } else {
+ var block = this.block();
+ if (tag.block) {
+ for (var i = 0, len = block.nodes.length; i < len; ++i) {
+ tag.block.push(block.nodes[i]);
+ }
+ } else {
+ tag.block = block;
+ }
+ }
+ }
+
+ return tag;
+ }
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/runtime.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/runtime.js
new file mode 100644
index 0000000..fb711f5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/runtime.js
@@ -0,0 +1,174 @@
+
+/*!
+ * Jade - runtime
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Lame Array.isArray() polyfill for now.
+ */
+
+if (!Array.isArray) {
+ Array.isArray = function(arr){
+ return '[object Array]' == Object.prototype.toString.call(arr);
+ };
+}
+
+/**
+ * Lame Object.keys() polyfill for now.
+ */
+
+if (!Object.keys) {
+ Object.keys = function(obj){
+ var arr = [];
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ arr.push(key);
+ }
+ }
+ return arr;
+ }
+}
+
+/**
+ * Merge two attribute objects giving precedence
+ * to values in object `b`. Classes are special-cased
+ * allowing for arrays and merging/joining appropriately
+ * resulting in a string.
+ *
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ * @api private
+ */
+
+exports.merge = function merge(a, b) {
+ var ac = a['class'];
+ var bc = b['class'];
+
+ if (ac || bc) {
+ ac = ac || [];
+ bc = bc || [];
+ if (!Array.isArray(ac)) ac = [ac];
+ if (!Array.isArray(bc)) bc = [bc];
+ ac = ac.filter(nulls);
+ bc = bc.filter(nulls);
+ a['class'] = ac.concat(bc).join(' ');
+ }
+
+ for (var key in b) {
+ if (key != 'class') {
+ a[key] = b[key];
+ }
+ }
+
+ return a;
+};
+
+/**
+ * Filter null `val`s.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function nulls(val) {
+ return val != null;
+}
+
+/**
+ * Render the given attributes object.
+ *
+ * @param {Object} obj
+ * @param {Object} escaped
+ * @return {String}
+ * @api private
+ */
+
+exports.attrs = function attrs(obj, escaped){
+ var buf = []
+ , terse = obj.terse;
+
+ delete obj.terse;
+ var keys = Object.keys(obj)
+ , len = keys.length;
+
+ if (len) {
+ buf.push('');
+ for (var i = 0; i < len; ++i) {
+ var key = keys[i]
+ , val = obj[key];
+
+ if ('boolean' == typeof val || null == val) {
+ if (val) {
+ terse
+ ? buf.push(key)
+ : buf.push(key + '="' + key + '"');
+ }
+ } else if (0 == key.indexOf('data') && 'string' != typeof val) {
+ buf.push(key + "='" + JSON.stringify(val) + "'");
+ } else if ('class' == key && Array.isArray(val)) {
+ buf.push(key + '="' + exports.escape(val.join(' ')) + '"');
+ } else if (escaped && escaped[key]) {
+ buf.push(key + '="' + exports.escape(val) + '"');
+ } else {
+ buf.push(key + '="' + val + '"');
+ }
+ }
+ }
+
+ return buf.join(' ');
+};
+
+/**
+ * Escape the given string of `html`.
+ *
+ * @param {String} html
+ * @return {String}
+ * @api private
+ */
+
+exports.escape = function escape(html){
+ return String(html)
+ .replace(/&(?!(\w+|\#\d+);)/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"');
+};
+
+/**
+ * Re-throw the given `err` in context to the
+ * the jade in `filename` at the given `lineno`.
+ *
+ * @param {Error} err
+ * @param {String} filename
+ * @param {String} lineno
+ * @api private
+ */
+
+exports.rethrow = function rethrow(err, filename, lineno){
+ if (!filename) throw err;
+
+ var context = 3
+ , str = require('fs').readFileSync(filename, 'utf8')
+ , lines = str.split('\n')
+ , start = Math.max(lineno - context, 0)
+ , end = Math.min(lines.length, lineno + context);
+
+ // Error context
+ var context = lines.slice(start, end).map(function(line, i){
+ var curr = i + start + 1;
+ return (curr == lineno ? ' > ' : ' ')
+ + curr
+ + '| '
+ + line;
+ }).join('\n');
+
+ // Alter exception message
+ err.path = filename;
+ err.message = (filename || 'Jade') + ':' + lineno
+ + '\n' + context + '\n\n' + err.message;
+ throw err;
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/self-closing.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/self-closing.js
new file mode 100644
index 0000000..0548771
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/self-closing.js
@@ -0,0 +1,19 @@
+
+/*!
+ * Jade - self closing tags
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+module.exports = [
+ 'meta'
+ , 'img'
+ , 'link'
+ , 'input'
+ , 'source'
+ , 'area'
+ , 'base'
+ , 'col'
+ , 'br'
+ , 'hr'
+];
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/utils.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/utils.js
new file mode 100644
index 0000000..ff46d02
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/lib/utils.js
@@ -0,0 +1,49 @@
+
+/*!
+ * Jade - utils
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Convert interpolation in the given string to JavaScript.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+var interpolate = exports.interpolate = function(str){
+ return str.replace(/(\\)?([#!]){(.*?)}/g, function(str, escape, flag, code){
+ return escape
+ ? str
+ : "' + "
+ + ('!' == flag ? '' : 'escape')
+ + "((interp = " + code.replace(/\\'/g, "'")
+ + ") == null ? '' : interp) + '";
+ });
+};
+
+/**
+ * Escape single quotes in `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+var escape = exports.escape = function(str) {
+ return str.replace(/'/g, "\\'");
+};
+
+/**
+ * Interpolate, and escape the given `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+exports.text = function(str){
+ return interpolate(escape(str));
+};
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/.npmignore b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/.npmignore
new file mode 100644
index 0000000..f1250e5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/.npmignore
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/.travis.yml b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/.travis.yml
new file mode 100644
index 0000000..f1d0f13
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/History.md b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/History.md
new file mode 100644
index 0000000..4961d2e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/History.md
@@ -0,0 +1,107 @@
+
+0.6.1 / 2012-06-01
+==================
+
+ * Added: append (yes or no) on confirmation
+ * Added: allow node.js v0.7.x
+
+0.6.0 / 2012-04-10
+==================
+
+ * Added `.prompt(obj, callback)` support. Closes #49
+ * Added default support to .choose(). Closes #41
+ * Fixed the choice example
+
+0.5.1 / 2011-12-20
+==================
+
+ * Fixed `password()` for recent nodes. Closes #36
+
+0.5.0 / 2011-12-04
+==================
+
+ * Added sub-command option support [itay]
+
+0.4.3 / 2011-12-04
+==================
+
+ * Fixed custom help ordering. Closes #32
+
+0.4.2 / 2011-11-24
+==================
+
+ * Added travis support
+ * Fixed: line-buffered input automatically trimmed. Closes #31
+
+0.4.1 / 2011-11-18
+==================
+
+ * Removed listening for "close" on --help
+
+0.4.0 / 2011-11-15
+==================
+
+ * Added support for `--`. Closes #24
+
+0.3.3 / 2011-11-14
+==================
+
+ * Fixed: wait for close event when writing help info [Jerry Hamlet]
+
+0.3.2 / 2011-11-01
+==================
+
+ * Fixed long flag definitions with values [felixge]
+
+0.3.1 / 2011-10-31
+==================
+
+ * Changed `--version` short flag to `-V` from `-v`
+ * Changed `.version()` so it's configurable [felixge]
+
+0.3.0 / 2011-10-31
+==================
+
+ * Added support for long flags only. Closes #18
+
+0.2.1 / 2011-10-24
+==================
+
+ * "node": ">= 0.4.x < 0.7.0". Closes #20
+
+0.2.0 / 2011-09-26
+==================
+
+ * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
+
+0.1.0 / 2011-08-24
+==================
+
+ * Added support for custom `--help` output
+
+0.0.5 / 2011-08-18
+==================
+
+ * Changed: when the user enters nothing prompt for password again
+ * Fixed issue with passwords beginning with numbers [NuckChorris]
+
+0.0.4 / 2011-08-15
+==================
+
+ * Fixed `Commander#args`
+
+0.0.3 / 2011-08-15
+==================
+
+ * Added default option value support
+
+0.0.2 / 2011-08-15
+==================
+
+ * Added mask support to `Command#password(str[, mask], fn)`
+ * Added `Command#password(str, fn)`
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/Makefile b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/Makefile
new file mode 100644
index 0000000..0074625
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/Makefile
@@ -0,0 +1,7 @@
+
+TESTS = $(shell find test/test.*.js)
+
+test:
+ @./test/run $(TESTS)
+
+.PHONY: test
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/Readme.md b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/Readme.md
new file mode 100644
index 0000000..b8328c3
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/Readme.md
@@ -0,0 +1,262 @@
+# Commander.js
+
+ The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).
+
+ [](http://travis-ci.org/visionmedia/commander.js)
+
+## Installation
+
+ $ npm install commander
+
+## Option parsing
+
+ Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.0.1')
+ .option('-p, --peppers', 'Add peppers')
+ .option('-P, --pineapple', 'Add pineapple')
+ .option('-b, --bbq', 'Add bbq sauce')
+ .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
+ .parse(process.argv);
+
+console.log('you ordered a pizza with:');
+if (program.peppers) console.log(' - peppers');
+if (program.pineapple) console.log(' - pineappe');
+if (program.bbq) console.log(' - bbq');
+console.log(' - %s cheese', program.cheese);
+```
+
+ Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
+
+## Automated --help
+
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
+
+```
+ $ ./examples/pizza --help
+
+ Usage: pizza [options]
+
+ Options:
+
+ -V, --version output the version number
+ -p, --peppers Add peppers
+ -P, --pineapple Add pineappe
+ -b, --bbq Add bbq sauce
+ -c, --cheese Add the specified type of cheese [marble]
+ -h, --help output usage information
+
+```
+
+## Coercion
+
+```js
+function range(val) {
+ return val.split('..').map(Number);
+}
+
+function list(val) {
+ return val.split(',');
+}
+
+program
+ .version('0.0.1')
+ .usage('[options] ')
+ .option('-i, --integer ', 'An integer argument', parseInt)
+ .option('-f, --float ', 'A float argument', parseFloat)
+ .option('-r, --range ..', 'A range', range)
+ .option('-l, --list ', 'A list', list)
+ .option('-o, --optional [value]', 'An optional value')
+ .parse(process.argv);
+
+console.log(' int: %j', program.integer);
+console.log(' float: %j', program.float);
+console.log(' optional: %j', program.optional);
+program.range = program.range || [];
+console.log(' range: %j..%j', program.range[0], program.range[1]);
+console.log(' list: %j', program.list);
+console.log(' args: %j', program.args);
+```
+
+## Custom help
+
+ You can display arbitrary `-h, --help` information
+ by listening for "--help". Commander will automatically
+ exit once you are done so that the remainder of your program
+ does not execute causing undesired behaviours, for example
+ in the following executable "stuff" will not output when
+ `--help` is used.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('../');
+
+function list(val) {
+ return val.split(',').map(Number);
+}
+
+program
+ .version('0.0.1')
+ .option('-f, --foo', 'enable some foo')
+ .option('-b, --bar', 'enable some bar')
+ .option('-B, --baz', 'enable some baz');
+
+// must be before .parse() since
+// node's emit() is immediate
+
+program.on('--help', function(){
+ console.log(' Examples:');
+ console.log('');
+ console.log(' $ custom-help --help');
+ console.log(' $ custom-help -h');
+ console.log('');
+});
+
+program.parse(process.argv);
+
+console.log('stuff');
+```
+
+yielding the following help output:
+
+```
+
+Usage: custom-help [options]
+
+Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -f, --foo enable some foo
+ -b, --bar enable some bar
+ -B, --baz enable some baz
+
+Examples:
+
+ $ custom-help --help
+ $ custom-help -h
+
+```
+
+## .prompt(msg, fn)
+
+ Single-line prompt:
+
+```js
+program.prompt('name: ', function(name){
+ console.log('hi %s', name);
+});
+```
+
+ Multi-line prompt:
+
+```js
+program.prompt('description:', function(name){
+ console.log('hi %s', name);
+});
+```
+
+ Coercion:
+
+```js
+program.prompt('Age: ', Number, function(age){
+ console.log('age: %j', age);
+});
+```
+
+```js
+program.prompt('Birthdate: ', Date, function(date){
+ console.log('date: %s', date);
+});
+```
+
+## .password(msg[, mask], fn)
+
+Prompt for password without echoing:
+
+```js
+program.password('Password: ', function(pass){
+ console.log('got "%s"', pass);
+ process.stdin.destroy();
+});
+```
+
+Prompt for password with mask char "*":
+
+```js
+program.password('Password: ', '*', function(pass){
+ console.log('got "%s"', pass);
+ process.stdin.destroy();
+});
+```
+
+## .confirm(msg, fn)
+
+ Confirm with the given `msg`:
+
+```js
+program.confirm('continue? ', function(ok){
+ console.log(' got %j', ok);
+});
+```
+
+## .choose(list, fn)
+
+ Let the user choose from a `list`:
+
+```js
+var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
+
+console.log('Choose the coolest pet:');
+program.choose(list, function(i){
+ console.log('you chose %d "%s"', i, list[i]);
+});
+```
+
+## Links
+
+ - [API documentation](http://visionmedia.github.com/commander.js/)
+ - [ascii tables](https://github.com/LearnBoost/cli-table)
+ - [progress bars](https://github.com/visionmedia/node-progress)
+ - [more progress bars](https://github.com/substack/node-multimeter)
+ - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/index.js
new file mode 100644
index 0000000..06ec1e4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/index.js
@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/commander');
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/lib/commander.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/lib/commander.js
new file mode 100644
index 0000000..5ba87eb
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/lib/commander.js
@@ -0,0 +1,1026 @@
+
+/*!
+ * commander
+ * Copyright(c) 2011 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter
+ , path = require('path')
+ , tty = require('tty')
+ , basename = path.basename;
+
+/**
+ * Expose the root command.
+ */
+
+exports = module.exports = new Command;
+
+/**
+ * Expose `Command`.
+ */
+
+exports.Command = Command;
+
+/**
+ * Expose `Option`.
+ */
+
+exports.Option = Option;
+
+/**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @api public
+ */
+
+function Option(flags, description) {
+ this.flags = flags;
+ this.required = ~flags.indexOf('<');
+ this.optional = ~flags.indexOf('[');
+ this.bool = !~flags.indexOf('-no-');
+ flags = flags.split(/[ ,|]+/);
+ if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
+ this.long = flags.shift();
+ this.description = description;
+}
+
+/**
+ * Return option name.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.name = function(){
+ return this.long
+ .replace('--', '')
+ .replace('no-', '');
+};
+
+/**
+ * Check if `arg` matches the short or long flag.
+ *
+ * @param {String} arg
+ * @return {Boolean}
+ * @api private
+ */
+
+Option.prototype.is = function(arg){
+ return arg == this.short
+ || arg == this.long;
+};
+
+/**
+ * Initialize a new `Command`.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+function Command(name) {
+ this.commands = [];
+ this.options = [];
+ this.args = [];
+ this.name = name;
+}
+
+/**
+ * Inherit from `EventEmitter.prototype`.
+ */
+
+Command.prototype.__proto__ = EventEmitter.prototype;
+
+/**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * Examples:
+ *
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir ', 'change the working directory')
+ * .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function(){
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec ')
+ * .description('run the given remote command')
+ * .action(function(cmd){
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env){
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {String} name
+ * @return {Command} the new command
+ * @api public
+ */
+
+Command.prototype.command = function(name){
+ var args = name.split(/ +/);
+ var cmd = new Command(args.shift());
+ this.commands.push(cmd);
+ cmd.parseExpectedArgs(args);
+ cmd.parent = this;
+ return cmd;
+};
+
+/**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parseExpectedArgs = function(args){
+ if (!args.length) return;
+ var self = this;
+ args.forEach(function(arg){
+ switch (arg[0]) {
+ case '<':
+ self.args.push({ required: true, name: arg.slice(1, -1) });
+ break;
+ case '[':
+ self.args.push({ required: false, name: arg.slice(1, -1) });
+ break;
+ }
+ });
+ return this;
+};
+
+/**
+ * Register callback `fn` for the command.
+ *
+ * Examples:
+ *
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function(){
+ * // output help here
+ * });
+ *
+ * @param {Function} fn
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.action = function(fn){
+ var self = this;
+ this.parent.on(this.name, function(args, unknown){
+ // Parse any so-far unknown options
+ unknown = unknown || [];
+ var parsed = self.parseOptions(unknown);
+
+ // Output help if necessary
+ outputHelpIfNecessary(self, parsed.unknown);
+
+ // If there are still any unknown options, then we simply
+ // die, unless someone asked for help, in which case we give it
+ // to them, and then we die.
+ if (parsed.unknown.length > 0) {
+ self.unknownOption(parsed.unknown[0]);
+ }
+
+ self.args.forEach(function(arg, i){
+ if (arg.required && null == args[i]) {
+ self.missingArgument(arg.name);
+ }
+ });
+
+ // Always append ourselves to the end of the arguments,
+ // to make sure we match the number of arguments the user
+ // expects
+ if (self.args.length) {
+ args[self.args.length] = self;
+ } else {
+ args.push(self);
+ }
+
+ fn.apply(this, args);
+ });
+ return this;
+};
+
+/**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * Examples:
+ *
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to false
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => true
+ *
+ * // required argument
+ * program.option('-C, --chdir ', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @param {Function|Mixed} fn or default
+ * @param {Mixed} defaultValue
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.option = function(flags, description, fn, defaultValue){
+ var self = this
+ , option = new Option(flags, description)
+ , oname = option.name()
+ , name = camelcase(oname);
+
+ // default as 3rd arg
+ if ('function' != typeof fn) defaultValue = fn, fn = null;
+
+ // preassign default value only for --no-*, [optional], or
+ if (false == option.bool || option.optional || option.required) {
+ // when --no-* we make sure default is true
+ if (false == option.bool) defaultValue = true;
+ // preassign only if we have a default
+ if (undefined !== defaultValue) self[name] = defaultValue;
+ }
+
+ // register the option
+ this.options.push(option);
+
+ // when it's passed assign the value
+ // and conditionally invoke the callback
+ this.on(oname, function(val){
+ // coercion
+ if (null != val && fn) val = fn(val);
+
+ // unassigned or bool
+ if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
+ // if no value, bool true, and we have a default, then use it!
+ if (null == val) {
+ self[name] = option.bool
+ ? defaultValue || true
+ : false;
+ } else {
+ self[name] = val;
+ }
+ } else if (null !== val) {
+ // reassign
+ self[name] = val;
+ }
+ });
+
+ return this;
+};
+
+/**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {Array} argv
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parse = function(argv){
+ // store raw args
+ this.rawArgs = argv;
+
+ // guess name
+ if (!this.name) this.name = basename(argv[1]);
+
+ // process argv
+ var parsed = this.parseOptions(this.normalize(argv.slice(2)));
+ this.args = parsed.args;
+ return this.parseArgs(this.args, parsed.unknown);
+};
+
+/**
+ * Normalize `args`, splitting joined short flags. For example
+ * the arg "-abc" is equivalent to "-a -b -c".
+ *
+ * @param {Array} args
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.normalize = function(args){
+ var ret = []
+ , arg;
+
+ for (var i = 0, len = args.length; i < len; ++i) {
+ arg = args[i];
+ if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
+ arg.slice(1).split('').forEach(function(c){
+ ret.push('-' + c);
+ });
+ } else {
+ ret.push(arg);
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * Parse command `args`.
+ *
+ * When listener(s) are available those
+ * callbacks are invoked, otherwise the "*"
+ * event is emitted and those actions are invoked.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api private
+ */
+
+Command.prototype.parseArgs = function(args, unknown){
+ var cmds = this.commands
+ , len = cmds.length
+ , name;
+
+ if (args.length) {
+ name = args[0];
+ if (this.listeners(name).length) {
+ this.emit(args.shift(), args, unknown);
+ } else {
+ this.emit('*', args);
+ }
+ } else {
+ outputHelpIfNecessary(this, unknown);
+
+ // If there were no args and we have unknown options,
+ // then they are extraneous and we need to error.
+ if (unknown.length > 0) {
+ this.unknownOption(unknown[0]);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an option matching `arg` if any.
+ *
+ * @param {String} arg
+ * @return {Option}
+ * @api private
+ */
+
+Command.prototype.optionFor = function(arg){
+ for (var i = 0, len = this.options.length; i < len; ++i) {
+ if (this.options[i].is(arg)) {
+ return this.options[i];
+ }
+ }
+};
+
+/**
+ * Parse options from `argv` returning `argv`
+ * void of these options.
+ *
+ * @param {Array} argv
+ * @return {Array}
+ * @api public
+ */
+
+Command.prototype.parseOptions = function(argv){
+ var args = []
+ , len = argv.length
+ , literal
+ , option
+ , arg;
+
+ var unknownOptions = [];
+
+ // parse options
+ for (var i = 0; i < len; ++i) {
+ arg = argv[i];
+
+ // literal args after --
+ if ('--' == arg) {
+ literal = true;
+ continue;
+ }
+
+ if (literal) {
+ args.push(arg);
+ continue;
+ }
+
+ // find matching Option
+ option = this.optionFor(arg);
+
+ // option is defined
+ if (option) {
+ // requires arg
+ if (option.required) {
+ arg = argv[++i];
+ if (null == arg) return this.optionMissingArgument(option);
+ if ('-' == arg[0]) return this.optionMissingArgument(option, arg);
+ this.emit(option.name(), arg);
+ // optional arg
+ } else if (option.optional) {
+ arg = argv[i+1];
+ if (null == arg || '-' == arg[0]) {
+ arg = null;
+ } else {
+ ++i;
+ }
+ this.emit(option.name(), arg);
+ // bool
+ } else {
+ this.emit(option.name());
+ }
+ continue;
+ }
+
+ // looks like an option
+ if (arg.length > 1 && '-' == arg[0]) {
+ unknownOptions.push(arg);
+
+ // If the next argument looks like it might be
+ // an argument for this option, we pass it on.
+ // If it isn't, then it'll simply be ignored
+ if (argv[i+1] && '-' != argv[i+1][0]) {
+ unknownOptions.push(argv[++i]);
+ }
+ continue;
+ }
+
+ // arg
+ args.push(arg);
+ }
+
+ return { args: args, unknown: unknownOptions };
+};
+
+/**
+ * Argument `name` is missing.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.missingArgument = function(name){
+ console.error();
+ console.error(" error: missing required argument `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * `Option` is missing an argument, but received `flag` or nothing.
+ *
+ * @param {String} option
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.optionMissingArgument = function(option, flag){
+ console.error();
+ if (flag) {
+ console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
+ } else {
+ console.error(" error: option `%s' argument missing", option.flags);
+ }
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Unknown option `flag`.
+ *
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.unknownOption = function(flag){
+ console.error();
+ console.error(" error: unknown option `%s'", flag);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {String} str
+ * @param {String} flags
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.version = function(str, flags){
+ if (0 == arguments.length) return this._version;
+ this._version = str;
+ flags = flags || '-V, --version';
+ this.option(flags, 'output the version number');
+ this.on('version', function(){
+ console.log(str);
+ process.exit(0);
+ });
+ return this;
+};
+
+/**
+ * Set the description `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.description = function(str){
+ if (0 == arguments.length) return this._description;
+ this._description = str;
+ return this;
+};
+
+/**
+ * Set / get the command usage `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.usage = function(str){
+ var args = this.args.map(function(arg){
+ return arg.required
+ ? '<' + arg.name + '>'
+ : '[' + arg.name + ']';
+ });
+
+ var usage = '[options'
+ + (this.commands.length ? '] [command' : '')
+ + ']'
+ + (this.args.length ? ' ' + args : '');
+ if (0 == arguments.length) return this._usage || usage;
+ this._usage = str;
+
+ return this;
+};
+
+/**
+ * Return the largest option length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestOptionLength = function(){
+ return this.options.reduce(function(max, option){
+ return Math.max(max, option.flags.length);
+ }, 0);
+};
+
+/**
+ * Return help for options.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.optionHelp = function(){
+ var width = this.largestOptionLength();
+
+ // Prepend the help information
+ return [pad('-h, --help', width) + ' ' + 'output usage information']
+ .concat(this.options.map(function(option){
+ return pad(option.flags, width)
+ + ' ' + option.description;
+ }))
+ .join('\n');
+};
+
+/**
+ * Return command help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.commandHelp = function(){
+ if (!this.commands.length) return '';
+ return [
+ ''
+ , ' Commands:'
+ , ''
+ , this.commands.map(function(cmd){
+ var args = cmd.args.map(function(arg){
+ return arg.required
+ ? '<' + arg.name + '>'
+ : '[' + arg.name + ']';
+ }).join(' ');
+
+ return cmd.name
+ + (cmd.options.length
+ ? ' [options]'
+ : '') + ' ' + args
+ + (cmd.description()
+ ? '\n' + cmd.description()
+ : '');
+ }).join('\n\n').replace(/^/gm, ' ')
+ , ''
+ ].join('\n');
+};
+
+/**
+ * Return program help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.helpInformation = function(){
+ return [
+ ''
+ , ' Usage: ' + this.name + ' ' + this.usage()
+ , '' + this.commandHelp()
+ , ' Options:'
+ , ''
+ , '' + this.optionHelp().replace(/^/gm, ' ')
+ , ''
+ , ''
+ ].join('\n');
+};
+
+/**
+ * Prompt for a `Number`.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptForNumber = function(str, fn){
+ var self = this;
+ this.promptSingleLine(str, function parseNumber(val){
+ val = Number(val);
+ if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber);
+ fn(val);
+ });
+};
+
+/**
+ * Prompt for a `Date`.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptForDate = function(str, fn){
+ var self = this;
+ this.promptSingleLine(str, function parseDate(val){
+ val = new Date(val);
+ if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate);
+ fn(val);
+ });
+};
+
+/**
+ * Single-line prompt.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptSingleLine = function(str, fn){
+ if ('function' == typeof arguments[2]) {
+ return this['promptFor' + (fn.name || fn)](str, arguments[2]);
+ }
+
+ process.stdout.write(str);
+ process.stdin.setEncoding('utf8');
+ process.stdin.once('data', function(val){
+ fn(val.trim());
+ }).resume();
+};
+
+/**
+ * Multi-line prompt.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptMultiLine = function(str, fn){
+ var buf = [];
+ console.log(str);
+ process.stdin.setEncoding('utf8');
+ process.stdin.on('data', function(val){
+ if ('\n' == val || '\r\n' == val) {
+ process.stdin.removeAllListeners('data');
+ fn(buf.join('\n'));
+ } else {
+ buf.push(val.trimRight());
+ }
+ }).resume();
+};
+
+/**
+ * Prompt `str` and callback `fn(val)`
+ *
+ * Commander supports single-line and multi-line prompts.
+ * To issue a single-line prompt simply add white-space
+ * to the end of `str`, something like "name: ", whereas
+ * for a multi-line prompt omit this "description:".
+ *
+ *
+ * Examples:
+ *
+ * program.prompt('Username: ', function(name){
+ * console.log('hi %s', name);
+ * });
+ *
+ * program.prompt('Description:', function(desc){
+ * console.log('description was "%s"', desc.trim());
+ * });
+ *
+ * @param {String|Object} str
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.prompt = function(str, fn){
+ var self = this;
+
+ if ('string' == typeof str) {
+ if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments);
+ this.promptMultiLine(str, fn);
+ } else {
+ var keys = Object.keys(str)
+ , obj = {};
+
+ function next() {
+ var key = keys.shift()
+ , label = str[key];
+
+ if (!key) return fn(obj);
+ self.prompt(label, function(val){
+ obj[key] = val;
+ next();
+ });
+ }
+
+ next();
+ }
+};
+
+/**
+ * Prompt for password with `str`, `mask` char and callback `fn(val)`.
+ *
+ * The mask string defaults to '', aka no output is
+ * written while typing, you may want to use "*" etc.
+ *
+ * Examples:
+ *
+ * program.password('Password: ', function(pass){
+ * console.log('got "%s"', pass);
+ * process.stdin.destroy();
+ * });
+ *
+ * program.password('Password: ', '*', function(pass){
+ * console.log('got "%s"', pass);
+ * process.stdin.destroy();
+ * });
+ *
+ * @param {String} str
+ * @param {String} mask
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.password = function(str, mask, fn){
+ var self = this
+ , buf = '';
+
+ // default mask
+ if ('function' == typeof mask) {
+ fn = mask;
+ mask = '';
+ }
+
+ process.stdin.resume();
+ tty.setRawMode(true);
+ process.stdout.write(str);
+
+ // keypress
+ process.stdin.on('keypress', function(c, key){
+ if (key && 'enter' == key.name) {
+ console.log();
+ process.stdin.removeAllListeners('keypress');
+ tty.setRawMode(false);
+ if (!buf.trim().length) return self.password(str, mask, fn);
+ fn(buf);
+ return;
+ }
+
+ if (key && key.ctrl && 'c' == key.name) {
+ console.log('%s', buf);
+ process.exit();
+ }
+
+ process.stdout.write(mask);
+ buf += c;
+ }).resume();
+};
+
+/**
+ * Confirmation prompt with `str` and callback `fn(bool)`
+ *
+ * Examples:
+ *
+ * program.confirm('continue? ', function(ok){
+ * console.log(' got %j', ok);
+ * process.stdin.destroy();
+ * });
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api public
+ */
+
+
+Command.prototype.confirm = function(str, fn, verbose){
+ var self = this;
+ this.prompt(str, function(ok){
+ if (!ok.trim()) {
+ if (!verbose) str += '(yes or no) ';
+ return self.confirm(str, fn, true);
+ }
+ fn(parseBool(ok));
+ });
+};
+
+/**
+ * Choice prompt with `list` of items and callback `fn(index, item)`
+ *
+ * Examples:
+ *
+ * var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
+ *
+ * console.log('Choose the coolest pet:');
+ * program.choose(list, function(i){
+ * console.log('you chose %d "%s"', i, list[i]);
+ * process.stdin.destroy();
+ * });
+ *
+ * @param {Array} list
+ * @param {Number|Function} index or fn
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.choose = function(list, index, fn){
+ var self = this
+ , hasDefault = 'number' == typeof index;
+
+ if (!hasDefault) {
+ fn = index;
+ index = null;
+ }
+
+ list.forEach(function(item, i){
+ if (hasDefault && i == index) {
+ console.log('* %d) %s', i + 1, item);
+ } else {
+ console.log(' %d) %s', i + 1, item);
+ }
+ });
+
+ function again() {
+ self.prompt(' : ', function(val){
+ val = parseInt(val, 10) - 1;
+ if (hasDefault && isNaN(val)) val = index;
+
+ if (null == list[val]) {
+ again();
+ } else {
+ fn(val, list[val]);
+ }
+ });
+ }
+
+ again();
+};
+
+/**
+ * Camel-case the given `flag`
+ *
+ * @param {String} flag
+ * @return {String}
+ * @api private
+ */
+
+function camelcase(flag) {
+ return flag.split('-').reduce(function(str, word){
+ return str + word[0].toUpperCase() + word.slice(1);
+ });
+}
+
+/**
+ * Parse a boolean `str`.
+ *
+ * @param {String} str
+ * @return {Boolean}
+ * @api private
+ */
+
+function parseBool(str) {
+ return /^y|yes|ok|true$/i.test(str);
+}
+
+/**
+ * Pad `str` to `width`.
+ *
+ * @param {String} str
+ * @param {Number} width
+ * @return {String}
+ * @api private
+ */
+
+function pad(str, width) {
+ var len = Math.max(0, width - str.length);
+ return str + Array(len + 1).join(' ');
+}
+
+/**
+ * Output help information if necessary
+ *
+ * @param {Command} command to output help for
+ * @param {Array} array of options to search for -h or --help
+ * @api private
+ */
+
+function outputHelpIfNecessary(cmd, options) {
+ options = options || [];
+ for (var i = 0; i < options.length; i++) {
+ if (options[i] == '--help' || options[i] == '-h') {
+ process.stdout.write(cmd.helpInformation());
+ cmd.emit('--help');
+ process.exit(0);
+ }
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/package.json
new file mode 100644
index 0000000..7161a8b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/commander/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "commander"
+ , "version": "0.6.1"
+ , "description": "the complete solution for node.js command-line programs"
+ , "keywords": ["command", "option", "parser", "prompt", "stdin"]
+ , "author": "TJ Holowaychuk "
+ , "repository": { "type": "git", "url": "https://github.com/visionmedia/commander.js.git" }
+ , "dependencies": {}
+ , "devDependencies": { "should": ">= 0.0.1" }
+ , "scripts": { "test": "make test" }
+ , "main": "index"
+ , "engines": { "node": ">= 0.4.x" }
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.gitignore.orig b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.gitignore.orig
new file mode 100644
index 0000000..9303c34
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.gitignore.orig
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.gitignore.rej b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.gitignore.rej
new file mode 100644
index 0000000..69244ff
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.gitignore.rej
@@ -0,0 +1,5 @@
+--- /dev/null
++++ .gitignore
+@@ -0,0 +1,2 @@
++node_modules/
++npm-debug.log
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.npmignore b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.npmignore
new file mode 100644
index 0000000..9303c34
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/.npmignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/LICENSE b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/LICENSE
new file mode 100644
index 0000000..432d1ae
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/LICENSE
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/README.markdown b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/README.markdown
new file mode 100644
index 0000000..b4dd75f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/README.markdown
@@ -0,0 +1,54 @@
+mkdirp
+======
+
+Like `mkdir -p`, but in node.js!
+
+example
+=======
+
+pow.js
+------
+ var mkdirp = require('mkdirp');
+
+ mkdirp('/tmp/foo/bar/baz', function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+ });
+
+Output
+ pow!
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+methods
+=======
+
+var mkdirp = require('mkdirp');
+
+mkdirp(dir, mode, cb)
+---------------------
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+mkdirp.sync(dir, mode)
+----------------------
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+install
+=======
+
+With [npm](http://npmjs.org) do:
+
+ npm install mkdirp
+
+license
+=======
+
+MIT/X11
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js
new file mode 100644
index 0000000..e692421
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig
new file mode 100644
index 0000000..7741462
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej
new file mode 100644
index 0000000..81e7f43
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej
@@ -0,0 +1,19 @@
+--- examples/pow.js
++++ examples/pow.js
+@@ -1,6 +1,15 @@
+-var mkdirp = require('mkdirp').mkdirp;
++var mkdirp = require('../').mkdirp,
++ mkdirpSync = require('../').mkdirpSync;
+
+ mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+ });
++
++try {
++ mkdirpSync('/tmp/bar/foo/baz', 0755);
++ console.log('double pow!');
++}
++catch (ex) {
++ console.log(ex);
++}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/index.js
new file mode 100644
index 0000000..25f43ad
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/index.js
@@ -0,0 +1,79 @@
+var path = require('path');
+var fs = require('fs');
+
+module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
+
+function mkdirP (p, mode, f) {
+ if (typeof mode === 'function' || mode === undefined) {
+ f = mode;
+ mode = 0777 & (~process.umask());
+ }
+
+ var cb = f || function () {};
+ if (typeof mode === 'string') mode = parseInt(mode, 8);
+ p = path.resolve(p);
+
+ fs.mkdir(p, mode, function (er) {
+ if (!er) return cb();
+ switch (er.code) {
+ case 'ENOENT':
+ mkdirP(path.dirname(p), mode, function (er) {
+ if (er) cb(er);
+ else mkdirP(p, mode, cb);
+ });
+ break;
+
+ case 'EEXIST':
+ fs.stat(p, function (er2, stat) {
+ // if the stat fails, then that's super weird.
+ // let the original EEXIST be the failure reason.
+ if (er2 || !stat.isDirectory()) cb(er)
+ else cb();
+ });
+ break;
+
+ default:
+ cb(er);
+ break;
+ }
+ });
+}
+
+mkdirP.sync = function sync (p, mode) {
+ if (mode === undefined) {
+ mode = 0777 & (~process.umask());
+ }
+
+ if (typeof mode === 'string') mode = parseInt(mode, 8);
+ p = path.resolve(p);
+
+ try {
+ fs.mkdirSync(p, mode)
+ }
+ catch (err0) {
+ switch (err0.code) {
+ case 'ENOENT' :
+ var err1 = sync(path.dirname(p), mode)
+ if (err1) throw err1;
+ else return sync(p, mode);
+ break;
+
+ case 'EEXIST' :
+ var stat;
+ try {
+ stat = fs.statSync(p);
+ }
+ catch (err1) {
+ throw err0
+ }
+ if (!stat.isDirectory()) throw err0;
+ else return null;
+ break;
+ default :
+ throw err0
+ break;
+ }
+ }
+
+ return null;
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/package.json
new file mode 100644
index 0000000..1bf9ac7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/package.json
@@ -0,0 +1,23 @@
+{
+ "name" : "mkdirp",
+ "description" : "Recursively mkdir, like `mkdir -p`",
+ "version" : "0.3.0",
+ "author" : "James Halliday (http://substack.net)",
+ "main" : "./index",
+ "keywords" : [
+ "mkdir",
+ "directory"
+ ],
+ "repository" : {
+ "type" : "git",
+ "url" : "http://github.com/substack/node-mkdirp.git"
+ },
+ "scripts" : {
+ "test" : "tap test/*.js"
+ },
+ "devDependencies" : {
+ "tap" : "0.0.x"
+ },
+ "license" : "MIT/X11",
+ "engines": { "node": "*" }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/chmod.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/chmod.js
new file mode 100644
index 0000000..520dcb8
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/chmod.js
@@ -0,0 +1,38 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+}
+
+var file = ps.join('/');
+
+test('chmod-pre', function (t) {
+ var mode = 0744
+ mkdirp(file, mode, function (er) {
+ t.ifError(er, 'should not error');
+ fs.stat(file, function (er, stat) {
+ t.ifError(er, 'should exist');
+ t.ok(stat && stat.isDirectory(), 'should be directory');
+ t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
+ t.end();
+ });
+ });
+});
+
+test('chmod', function (t) {
+ var mode = 0755
+ mkdirp(file, mode, function (er) {
+ t.ifError(er, 'should not error');
+ fs.stat(file, function (er, stat) {
+ t.ifError(er, 'should exist');
+ t.ok(stat && stat.isDirectory(), 'should be directory');
+ t.end();
+ });
+ });
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/clobber.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/clobber.js
new file mode 100644
index 0000000..0eb7099
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/clobber.js
@@ -0,0 +1,37 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+}
+
+var file = ps.join('/');
+
+// a file in the way
+var itw = ps.slice(0, 3).join('/');
+
+
+test('clobber-pre', function (t) {
+ console.error("about to write to "+itw)
+ fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
+
+ fs.stat(itw, function (er, stat) {
+ t.ifError(er)
+ t.ok(stat && stat.isFile(), 'should be file')
+ t.end()
+ })
+})
+
+test('clobber', function (t) {
+ t.plan(2);
+ mkdirp(file, 0755, function (err) {
+ t.ok(err);
+ t.equal(err.code, 'ENOTDIR');
+ t.end();
+ });
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/mkdirp.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/mkdirp.js
new file mode 100644
index 0000000..b07cd70
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/mkdirp.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('woo', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/perm.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/perm.js
new file mode 100644
index 0000000..23a7abb
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/perm.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('async perm', function (t) {
+ t.plan(2);
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
+
+test('async root perm', function (t) {
+ mkdirp('/tmp', 0755, function (err) {
+ if (err) t.fail(err);
+ t.end();
+ });
+ t.end();
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/perm_sync.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/perm_sync.js
new file mode 100644
index 0000000..f685f60
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/perm_sync.js
@@ -0,0 +1,39 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync perm', function (t) {
+ t.plan(2);
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
+
+ mkdirp.sync(file, 0755);
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ });
+});
+
+test('sync root perm', function (t) {
+ t.plan(1);
+
+ var file = '/tmp';
+ mkdirp.sync(file, 0755);
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ });
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/race.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/race.js
new file mode 100644
index 0000000..96a0447
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/race.js
@@ -0,0 +1,41 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('race', function (t) {
+ t.plan(4);
+ var ps = [ '', 'tmp' ];
+
+ for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+ }
+ var file = ps.join('/');
+
+ var res = 2;
+ mk(file, function () {
+ if (--res === 0) t.end();
+ });
+
+ mk(file, function () {
+ if (--res === 0) t.end();
+ });
+
+ function mk (file, cb) {
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ if (cb) cb();
+ }
+ })
+ })
+ });
+ }
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/rel.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/rel.js
new file mode 100644
index 0000000..7985824
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/rel.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('rel', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var cwd = process.cwd();
+ process.chdir('/tmp');
+
+ var file = [x,y,z].join('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ process.chdir(cwd);
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/sync.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/sync.js
new file mode 100644
index 0000000..e0e389d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/sync.js
@@ -0,0 +1,27 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ var err = mkdirp.sync(file, 0755);
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/umask.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/umask.js
new file mode 100644
index 0000000..64ccafe
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/umask.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('implicit mode from umask', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ mkdirp(file, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0777 & (~process.umask()));
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/umask_sync.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/umask_sync.js
new file mode 100644
index 0000000..83cba56
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/node_modules/mkdirp/test/umask_sync.js
@@ -0,0 +1,27 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('umask sync modes', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ var err = mkdirp.sync(file);
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, (0777 & (~process.umask())));
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/jade/package.json
new file mode 100644
index 0000000..ca91651
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "jade",
+ "description": "Jade template engine",
+ "version": "0.27.2",
+ "author": "TJ Holowaychuk ",
+ "repository": "git://github.com/visionmedia/jade",
+ "main": "./index.js",
+ "bin": { "jade": "./bin/jade" },
+ "man": "./jade.1",
+ "dependencies": {
+ "commander": "0.6.1",
+ "mkdirp": "0.3.0"
+ },
+ "devDependencies": {
+ "mocha": "*",
+ "markdown": "*",
+ "stylus": "*",
+ "uubench": "*",
+ "should": "*",
+ "less": "*",
+ "uglify-js": "*"
+ },
+ "component": {
+ "scripts": {
+ "jade": "runtime.js"
+ }
+ },
+ "scripts" : { "prepublish" : "npm prune" }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/runtime.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/runtime.js
new file mode 100644
index 0000000..0f54907
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/runtime.js
@@ -0,0 +1,179 @@
+
+jade = (function(exports){
+/*!
+ * Jade - runtime
+ * Copyright(c) 2010 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Lame Array.isArray() polyfill for now.
+ */
+
+if (!Array.isArray) {
+ Array.isArray = function(arr){
+ return '[object Array]' == Object.prototype.toString.call(arr);
+ };
+}
+
+/**
+ * Lame Object.keys() polyfill for now.
+ */
+
+if (!Object.keys) {
+ Object.keys = function(obj){
+ var arr = [];
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ arr.push(key);
+ }
+ }
+ return arr;
+ }
+}
+
+/**
+ * Merge two attribute objects giving precedence
+ * to values in object `b`. Classes are special-cased
+ * allowing for arrays and merging/joining appropriately
+ * resulting in a string.
+ *
+ * @param {Object} a
+ * @param {Object} b
+ * @return {Object} a
+ * @api private
+ */
+
+exports.merge = function merge(a, b) {
+ var ac = a['class'];
+ var bc = b['class'];
+
+ if (ac || bc) {
+ ac = ac || [];
+ bc = bc || [];
+ if (!Array.isArray(ac)) ac = [ac];
+ if (!Array.isArray(bc)) bc = [bc];
+ ac = ac.filter(nulls);
+ bc = bc.filter(nulls);
+ a['class'] = ac.concat(bc).join(' ');
+ }
+
+ for (var key in b) {
+ if (key != 'class') {
+ a[key] = b[key];
+ }
+ }
+
+ return a;
+};
+
+/**
+ * Filter null `val`s.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+
+function nulls(val) {
+ return val != null;
+}
+
+/**
+ * Render the given attributes object.
+ *
+ * @param {Object} obj
+ * @param {Object} escaped
+ * @return {String}
+ * @api private
+ */
+
+exports.attrs = function attrs(obj, escaped){
+ var buf = []
+ , terse = obj.terse;
+
+ delete obj.terse;
+ var keys = Object.keys(obj)
+ , len = keys.length;
+
+ if (len) {
+ buf.push('');
+ for (var i = 0; i < len; ++i) {
+ var key = keys[i]
+ , val = obj[key];
+
+ if ('boolean' == typeof val || null == val) {
+ if (val) {
+ terse
+ ? buf.push(key)
+ : buf.push(key + '="' + key + '"');
+ }
+ } else if (0 == key.indexOf('data') && 'string' != typeof val) {
+ buf.push(key + "='" + JSON.stringify(val) + "'");
+ } else if ('class' == key && Array.isArray(val)) {
+ buf.push(key + '="' + exports.escape(val.join(' ')) + '"');
+ } else if (escaped && escaped[key]) {
+ buf.push(key + '="' + exports.escape(val) + '"');
+ } else {
+ buf.push(key + '="' + val + '"');
+ }
+ }
+ }
+
+ return buf.join(' ');
+};
+
+/**
+ * Escape the given string of `html`.
+ *
+ * @param {String} html
+ * @return {String}
+ * @api private
+ */
+
+exports.escape = function escape(html){
+ return String(html)
+ .replace(/&(?!(\w+|\#\d+);)/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"');
+};
+
+/**
+ * Re-throw the given `err` in context to the
+ * the jade in `filename` at the given `lineno`.
+ *
+ * @param {Error} err
+ * @param {String} filename
+ * @param {String} lineno
+ * @api private
+ */
+
+exports.rethrow = function rethrow(err, filename, lineno){
+ if (!filename) throw err;
+
+ var context = 3
+ , str = require('fs').readFileSync(filename, 'utf8')
+ , lines = str.split('\n')
+ , start = Math.max(lineno - context, 0)
+ , end = Math.min(lines.length, lineno + context);
+
+ // Error context
+ var context = lines.slice(start, end).map(function(line, i){
+ var curr = i + start + 1;
+ return (curr == lineno ? ' > ' : ' ')
+ + curr
+ + '| '
+ + line;
+ }).join('\n');
+
+ // Alter exception message
+ err.path = filename;
+ err.message = (filename || 'Jade') + ':' + lineno
+ + '\n' + context + '\n\n' + err.message;
+ throw err;
+};
+
+ return exports;
+
+})({});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/runtime.min.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/runtime.min.js
new file mode 100644
index 0000000..1714efb
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/runtime.min.js
@@ -0,0 +1 @@
+jade=function(exports){Array.isArray||(Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}),Object.keys||(Object.keys=function(obj){var arr=[];for(var key in obj)obj.hasOwnProperty(key)&&arr.push(key);return arr}),exports.merge=function merge(a,b){var ac=a["class"],bc=b["class"];if(ac||bc)ac=ac||[],bc=bc||[],Array.isArray(ac)||(ac=[ac]),Array.isArray(bc)||(bc=[bc]),ac=ac.filter(nulls),bc=bc.filter(nulls),a["class"]=ac.concat(bc).join(" ");for(var key in b)key!="class"&&(a[key]=b[key]);return a};function nulls(val){return val!=null}return exports.attrs=function attrs(obj,escaped){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i /g,">").replace(/"/g,""")},exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context),context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");throw err.path=filename,err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message,err},exports}({});
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/test.jade b/node_modules/anvil.js/node_modules/ape/node_modules/jade/test.jade
new file mode 100644
index 0000000..b3a8988
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/test.jade
@@ -0,0 +1,7 @@
+p.
+ This is a large
+ body of text for
+ this tag.
+
+ Nothing too
+ exciting.
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/head.jade b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/head.jade
new file mode 100644
index 0000000..8515406
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/head.jade
@@ -0,0 +1,5 @@
+head
+ script(src='/jquery.js')
+ yield
+ if false
+ script(src='/jquery.ui.js')
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/index.jade b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/index.jade
new file mode 100644
index 0000000..f901402
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/index.jade
@@ -0,0 +1,12 @@
+users = [{ name: 'tobi', friends: ['loki'] }, { name: 'loki' }]
+
+ul
+ for user in users
+ li= user.name
+ ul
+ for friend in user.friends
+ li= friend
+ else
+ li no friends!
+ else
+ li no users!
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/index.js
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/layout.jade b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/layout.jade
new file mode 100644
index 0000000..6923cf1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/layout.jade
@@ -0,0 +1,6 @@
+html
+ include head
+ script(src='/caustic.js')
+ script(src='/app.js')
+ body
+ block content
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/user.jade b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/user.jade
new file mode 100644
index 0000000..3c636b7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/user.jade
@@ -0,0 +1,7 @@
+h1 Tobi
+p Is a ferret
+
+ul
+ li: a foo
+ li: a bar
+ li: a baz
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/user.js b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/user.js
new file mode 100644
index 0000000..2ecc45e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/jade/testing/user.js
@@ -0,0 +1,27 @@
+function anonymous(locals, attrs, escape, rethrow) {
+var attrs = jade.attrs, escape = jade.escape, rethrow = jade.rethrow;
+var __jade = [{ lineno: 1, filename: "testing/user.jade" }];
+try {
+var buf = [];
+with (locals || {}) {
+var interp;
+__jade.unshift({ lineno: 1, filename: __jade[0].filename });
+__jade.unshift({ lineno: 1, filename: __jade[0].filename });
+buf.push('Tobi');
+__jade.unshift({ lineno: undefined, filename: __jade[0].filename });
+__jade.shift();
+buf.push(' ');
+__jade.shift();
+__jade.unshift({ lineno: 2, filename: __jade[0].filename });
+buf.push('Is a ferret');
+__jade.unshift({ lineno: undefined, filename: __jade[0].filename });
+__jade.shift();
+buf.push('
');
+__jade.shift();
+__jade.shift();
+}
+return buf.join("");
+} catch (err) {
+ rethrow(err, __jade[0].filename, __jade[0].lineno);
+}
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/.travis.yml b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/.travis.yml
new file mode 100644
index 0000000..f1d0f13
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/LICENSE b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/LICENSE
new file mode 100644
index 0000000..432d1ae
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/LICENSE
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/README.markdown b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/README.markdown
new file mode 100644
index 0000000..ad9d3fd
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/README.markdown
@@ -0,0 +1,487 @@
+optimist
+========
+
+Optimist is a node.js library for option parsing for people who hate option
+parsing. More specifically, this module is for people who like all the --bells
+and -whistlz of program usage but think optstrings are a waste of time.
+
+With optimist, option parsing doesn't have to suck (as much).
+
+[](http://travis-ci.org/substack/node-optimist)
+
+examples
+========
+
+With Optimist, the options are just a hash! No optstrings attached.
+-------------------------------------------------------------------
+
+xup.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist').argv;
+
+if (argv.rif - 5 * argv.xup > 7.138) {
+ console.log('Buy more riffiwobbles');
+}
+else {
+ console.log('Sell the xupptumblers');
+}
+````
+
+***
+
+ $ ./xup.js --rif=55 --xup=9.52
+ Buy more riffiwobbles
+
+ $ ./xup.js --rif 12 --xup 8.1
+ Sell the xupptumblers
+
+
+
+But wait! There's more! You can do short options:
+-------------------------------------------------
+
+short.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+````
+
+***
+
+ $ ./short.js -x 10 -y 21
+ (10,21)
+
+And booleans, both long and short (and grouped):
+----------------------------------
+
+bool.js:
+
+````javascript
+#!/usr/bin/env node
+var util = require('util');
+var argv = require('optimist').argv;
+
+if (argv.s) {
+ util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');
+}
+console.log(
+ (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')
+);
+````
+
+***
+
+ $ ./bool.js -s
+ The cat says: meow
+
+ $ ./bool.js -sp
+ The cat says: meow.
+
+ $ ./bool.js -sp --fr
+ Le chat dit: miaou.
+
+And non-hypenated options too! Just use `argv._`!
+-------------------------------------------------
+
+nonopt.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+console.log(argv._);
+````
+
+***
+
+ $ ./nonopt.js -x 6.82 -y 3.35 moo
+ (6.82,3.35)
+ [ 'moo' ]
+
+ $ ./nonopt.js foo -x 0.54 bar -y 1.12 baz
+ (0.54,1.12)
+ [ 'foo', 'bar', 'baz' ]
+
+Plus, Optimist comes with .usage() and .demand()!
+-------------------------------------------------
+
+divide.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist')
+ .usage('Usage: $0 -x [num] -y [num]')
+ .demand(['x','y'])
+ .argv;
+
+console.log(argv.x / argv.y);
+````
+
+***
+
+ $ ./divide.js -x 55 -y 11
+ 5
+
+ $ node ./divide.js -x 4.91 -z 2.51
+ Usage: node ./divide.js -x [num] -y [num]
+
+ Options:
+ -x [required]
+ -y [required]
+
+ Missing required arguments: y
+
+EVEN MORE HOLY COW
+------------------
+
+default_singles.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist')
+ .default('x', 10)
+ .default('y', 10)
+ .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+ $ ./default_singles.js -x 5
+ 15
+
+default_hash.js:
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist')
+ .default({ x : 10, y : 10 })
+ .argv
+;
+console.log(argv.x + argv.y);
+````
+
+***
+
+ $ ./default_hash.js -y 7
+ 17
+
+And if you really want to get all descriptive about it...
+---------------------------------------------------------
+
+boolean_single.js
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist')
+ .boolean('v')
+ .argv
+;
+console.dir(argv);
+````
+
+***
+
+ $ ./boolean_single.js -v foo bar baz
+ true
+ [ 'bar', 'baz', 'foo' ]
+
+boolean_double.js
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist')
+ .boolean(['x','y','z'])
+ .argv
+;
+console.dir([ argv.x, argv.y, argv.z ]);
+console.dir(argv._);
+````
+
+***
+
+ $ ./boolean_double.js -x -z one two three
+ [ true, false, true ]
+ [ 'one', 'two', 'three' ]
+
+Optimist is here to help...
+---------------------------
+
+You can describe parameters for help messages and set aliases. Optimist figures
+out how to format a handy help string automatically.
+
+line_count.js
+
+````javascript
+#!/usr/bin/env node
+var argv = require('optimist')
+ .usage('Count the lines in a file.\nUsage: $0')
+ .demand('f')
+ .alias('f', 'file')
+ .describe('f', 'Load a file')
+ .argv
+;
+
+var fs = require('fs');
+var s = fs.createReadStream(argv.file);
+
+var lines = 0;
+s.on('data', function (buf) {
+ lines += buf.toString().match(/\n/g).length;
+});
+
+s.on('end', function () {
+ console.log(lines);
+});
+````
+
+***
+
+ $ node line_count.js
+ Count the lines in a file.
+ Usage: node ./line_count.js
+
+ Options:
+ -f, --file Load a file [required]
+
+ Missing required arguments: f
+
+ $ node line_count.js --file line_count.js
+ 20
+
+ $ node line_count.js -f line_count.js
+ 20
+
+methods
+=======
+
+By itself,
+
+````javascript
+require('optimist').argv
+`````
+
+will use `process.argv` array to construct the `argv` object.
+
+You can pass in the `process.argv` yourself:
+
+````javascript
+require('optimist')([ '-x', '1', '-y', '2' ]).argv
+````
+
+or use .parse() to do the same thing:
+
+````javascript
+require('optimist').parse([ '-x', '1', '-y', '2' ])
+````
+
+The rest of these methods below come in just before the terminating `.argv`.
+
+.alias(key, alias)
+------------------
+
+Set key names as equivalent such that updates to a key will propagate to aliases
+and vice-versa.
+
+Optionally `.alias()` can take an object that maps keys to aliases.
+
+.default(key, value)
+--------------------
+
+Set `argv[key]` to `value` if no option was specified on `process.argv`.
+
+Optionally `.default()` can take an object that maps keys to default values.
+
+.demand(key)
+------------
+
+If `key` is a string, show the usage information and exit if `key` wasn't
+specified in `process.argv`.
+
+If `key` is a number, demand at least as many non-option arguments, which show
+up in `argv._`.
+
+If `key` is an Array, demand each element.
+
+.describe(key, desc)
+--------------------
+
+Describe a `key` for the generated usage information.
+
+Optionally `.describe()` can take an object that maps keys to descriptions.
+
+.options(key, opt)
+------------------
+
+Instead of chaining together `.alias().demand().default()`, you can specify
+keys in `opt` for each of the chainable methods.
+
+For example:
+
+````javascript
+var argv = require('optimist')
+ .options('f', {
+ alias : 'file',
+ default : '/etc/passwd',
+ })
+ .argv
+;
+````
+
+is the same as
+
+````javascript
+var argv = require('optimist')
+ .alias('f', 'file')
+ .default('f', '/etc/passwd')
+ .argv
+;
+````
+
+Optionally `.options()` can take an object that maps keys to `opt` parameters.
+
+.usage(message)
+---------------
+
+Set a usage message to show which commands to use. Inside `message`, the string
+`$0` will get interpolated to the current script name or node command for the
+present script similar to how `$0` works in bash or perl.
+
+.check(fn)
+----------
+
+Check that certain conditions are met in the provided arguments.
+
+If `fn` throws or returns `false`, show the thrown error, usage information, and
+exit.
+
+.boolean(key)
+-------------
+
+Interpret `key` as a boolean. If a non-flag option follows `key` in
+`process.argv`, that string won't get set as the value of `key`.
+
+If `key` never shows up as a flag in `process.arguments`, `argv[key]` will be
+`false`.
+
+If `key` is an Array, interpret all the elements as booleans.
+
+.string(key)
+------------
+
+Tell the parser logic not to interpret `key` as a number or boolean.
+This can be useful if you need to preserve leading zeros in an input.
+
+If `key` is an Array, interpret all the elements as strings.
+
+.wrap(columns)
+--------------
+
+Format usage output to wrap at `columns` many columns.
+
+.help()
+-------
+
+Return the generated usage string.
+
+.showHelp(fn=console.error)
+---------------------------
+
+Print the usage data using `fn` for printing.
+
+.parse(args)
+------------
+
+Parse `args` instead of `process.argv`. Returns the `argv` object.
+
+.argv
+-----
+
+Get the arguments as a plain old object.
+
+Arguments without a corresponding flag show up in the `argv._` array.
+
+The script name or node command is available at `argv.$0` similarly to how `$0`
+works in bash or perl.
+
+parsing tricks
+==============
+
+stop parsing
+------------
+
+Use `--` to stop parsing flags and stuff the remainder into `argv._`.
+
+ $ node examples/reflect.js -a 1 -b 2 -- -c 3 -d 4
+ { _: [ '-c', '3', '-d', '4' ],
+ '$0': 'node ./examples/reflect.js',
+ a: 1,
+ b: 2 }
+
+negate fields
+-------------
+
+If you want to explicity set a field to false instead of just leaving it
+undefined or to override a default you can do `--no-key`.
+
+ $ node examples/reflect.js -a --no-b
+ { _: [],
+ '$0': 'node ./examples/reflect.js',
+ a: true,
+ b: false }
+
+numbers
+-------
+
+Every argument that looks like a number (`!isNaN(Number(arg))`) is converted to
+one. This way you can just `net.createConnection(argv.port)` and you can add
+numbers out of `argv` with `+` without having that mean concatenation,
+which is super frustrating.
+
+duplicates
+----------
+
+If you specify a flag multiple times it will get turned into an array containing
+all the values in order.
+
+ $ node examples/reflect.js -x 5 -x 8 -x 0
+ { _: [],
+ '$0': 'node ./examples/reflect.js',
+ x: [ 5, 8, 0 ] }
+
+dot notation
+------------
+
+When you use dots (`.`s) in argument names, an implicit object path is assumed.
+This lets you organize arguments into nested objects.
+
+ $ node examples/reflect.js --foo.bar.baz=33 --foo.quux=5
+ { _: [],
+ '$0': 'node ./examples/reflect.js',
+ foo: { bar: { baz: 33 }, quux: 5 } }
+
+installation
+============
+
+With [npm](http://github.com/isaacs/npm), just do:
+ npm install optimist
+
+or clone this project on github:
+
+ git clone http://github.com/substack/node-optimist.git
+
+To run the tests with [expresso](http://github.com/visionmedia/expresso),
+just do:
+
+ expresso
+
+inspired By
+===========
+
+This module is loosely inspired by Perl's
+[Getopt::Casual](http://search.cpan.org/~photo/Getopt-Casual-0.13.1/Casual.pm).
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/bool.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/bool.js
new file mode 100644
index 0000000..a998fb7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/bool.js
@@ -0,0 +1,10 @@
+#!/usr/bin/env node
+var util = require('util');
+var argv = require('optimist').argv;
+
+if (argv.s) {
+ util.print(argv.fr ? 'Le chat dit: ' : 'The cat says: ');
+}
+console.log(
+ (argv.fr ? 'miaou' : 'meow') + (argv.p ? '.' : '')
+);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/boolean_double.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/boolean_double.js
new file mode 100644
index 0000000..a35a7e6
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/boolean_double.js
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+var argv = require('optimist')
+ .boolean(['x','y','z'])
+ .argv
+;
+console.dir([ argv.x, argv.y, argv.z ]);
+console.dir(argv._);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/boolean_single.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/boolean_single.js
new file mode 100644
index 0000000..017bb68
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/boolean_single.js
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+var argv = require('optimist')
+ .boolean('v')
+ .argv
+;
+console.dir(argv.v);
+console.dir(argv._);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/default_hash.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/default_hash.js
new file mode 100644
index 0000000..ade7768
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/default_hash.js
@@ -0,0 +1,8 @@
+#!/usr/bin/env node
+
+var argv = require('optimist')
+ .default({ x : 10, y : 10 })
+ .argv
+;
+
+console.log(argv.x + argv.y);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/default_singles.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/default_singles.js
new file mode 100644
index 0000000..d9b1ff4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/default_singles.js
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+var argv = require('optimist')
+ .default('x', 10)
+ .default('y', 10)
+ .argv
+;
+console.log(argv.x + argv.y);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/divide.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/divide.js
new file mode 100644
index 0000000..5e2ee82
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/divide.js
@@ -0,0 +1,8 @@
+#!/usr/bin/env node
+
+var argv = require('optimist')
+ .usage('Usage: $0 -x [num] -y [num]')
+ .demand(['x','y'])
+ .argv;
+
+console.log(argv.x / argv.y);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count.js
new file mode 100644
index 0000000..b5f95bf
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count.js
@@ -0,0 +1,20 @@
+#!/usr/bin/env node
+var argv = require('optimist')
+ .usage('Count the lines in a file.\nUsage: $0')
+ .demand('f')
+ .alias('f', 'file')
+ .describe('f', 'Load a file')
+ .argv
+;
+
+var fs = require('fs');
+var s = fs.createReadStream(argv.file);
+
+var lines = 0;
+s.on('data', function (buf) {
+ lines += buf.toString().match(/\n/g).length;
+});
+
+s.on('end', function () {
+ console.log(lines);
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count_options.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count_options.js
new file mode 100644
index 0000000..d9ac709
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count_options.js
@@ -0,0 +1,29 @@
+#!/usr/bin/env node
+var argv = require('optimist')
+ .usage('Count the lines in a file.\nUsage: $0')
+ .options({
+ file : {
+ demand : true,
+ alias : 'f',
+ description : 'Load a file'
+ },
+ base : {
+ alias : 'b',
+ description : 'Numeric base to use for output',
+ default : 10,
+ },
+ })
+ .argv
+;
+
+var fs = require('fs');
+var s = fs.createReadStream(argv.file);
+
+var lines = 0;
+s.on('data', function (buf) {
+ lines += buf.toString().match(/\n/g).length;
+});
+
+s.on('end', function () {
+ console.log(lines.toString(argv.base));
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count_wrap.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count_wrap.js
new file mode 100644
index 0000000..4267511
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/line_count_wrap.js
@@ -0,0 +1,29 @@
+#!/usr/bin/env node
+var argv = require('optimist')
+ .usage('Count the lines in a file.\nUsage: $0')
+ .wrap(80)
+ .demand('f')
+ .alias('f', [ 'file', 'filename' ])
+ .describe('f',
+ "Load a file. It's pretty important."
+ + " Required even. So you'd better specify it."
+ )
+ .alias('b', 'base')
+ .describe('b', 'Numeric base to display the number of lines in')
+ .default('b', 10)
+ .describe('x', 'Super-secret optional parameter which is secret')
+ .default('x', '')
+ .argv
+;
+
+var fs = require('fs');
+var s = fs.createReadStream(argv.file);
+
+var lines = 0;
+s.on('data', function (buf) {
+ lines += buf.toString().match(/\n/g).length;
+});
+
+s.on('end', function () {
+ console.log(lines.toString(argv.base));
+});
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/nonopt.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/nonopt.js
new file mode 100644
index 0000000..ee633ee
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/nonopt.js
@@ -0,0 +1,4 @@
+#!/usr/bin/env node
+var argv = require('optimist').argv;
+console.log('(%d,%d)', argv.x, argv.y);
+console.log(argv._);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/reflect.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/reflect.js
new file mode 100644
index 0000000..816b3e1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/reflect.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+console.dir(require('optimist').argv);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/short.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/short.js
new file mode 100644
index 0000000..1db0ad0
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/short.js
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+var argv = require('optimist').argv;
+console.log('(%d,%d)', argv.x, argv.y);
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/string.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/string.js
new file mode 100644
index 0000000..a8e5aeb
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/string.js
@@ -0,0 +1,11 @@
+#!/usr/bin/env node
+var argv = require('optimist')
+ .string('x', 'y')
+ .argv
+;
+console.dir([ argv.x, argv.y ]);
+
+/* Turns off numeric coercion:
+ ./node string.js -x 000123 -y 9876
+ [ '000123', '9876' ]
+*/
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/usage-options.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/usage-options.js
new file mode 100644
index 0000000..b999977
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/usage-options.js
@@ -0,0 +1,19 @@
+var optimist = require('./../index');
+
+var argv = optimist.usage('This is my awesome program', {
+ 'about': {
+ description: 'Provide some details about the author of this program',
+ required: true,
+ short: 'a',
+ },
+ 'info': {
+ description: 'Provide some information about the node.js agains!!!!!!',
+ boolean: true,
+ short: 'i'
+ }
+}).argv;
+
+optimist.showHelp();
+
+console.log('\n\nInspecting options');
+console.dir(argv);
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/xup.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/xup.js
new file mode 100644
index 0000000..8f6ecd2
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/example/xup.js
@@ -0,0 +1,10 @@
+#!/usr/bin/env node
+var argv = require('optimist').argv;
+
+if (argv.rif - 5 * argv.xup > 7.138) {
+ console.log('Buy more riffiwobbles');
+}
+else {
+ console.log('Sell the xupptumblers');
+}
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/index.js
new file mode 100644
index 0000000..4dc39f4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/index.js
@@ -0,0 +1,475 @@
+var path = require('path');
+var wordwrap = require('wordwrap');
+
+/* Hack an instance of Argv with process.argv into Argv
+ so people can do
+ require('optimist')(['--beeble=1','-z','zizzle']).argv
+ to parse a list of args and
+ require('optimist').argv
+ to get a parsed version of process.argv.
+*/
+
+var inst = Argv(process.argv.slice(2));
+Object.keys(inst).forEach(function (key) {
+ Argv[key] = typeof inst[key] == 'function'
+ ? inst[key].bind(inst)
+ : inst[key];
+});
+
+var exports = module.exports = Argv;
+function Argv (args, cwd) {
+ var self = {};
+ if (!cwd) cwd = process.cwd();
+
+ self.$0 = process.argv
+ .slice(0,2)
+ .map(function (x) {
+ var b = rebase(cwd, x);
+ return x.match(/^\//) && b.length < x.length
+ ? b : x
+ })
+ .join(' ')
+ ;
+
+ if (process.argv[1] == process.env._) {
+ self.$0 = process.env._.replace(
+ path.dirname(process.execPath) + '/', ''
+ );
+ }
+
+ var flags = { bools : {}, strings : {} };
+
+ self.boolean = function (bools) {
+ if (!Array.isArray(bools)) {
+ bools = [].slice.call(arguments);
+ }
+
+ bools.forEach(function (name) {
+ flags.bools[name] = true;
+ });
+
+ return self;
+ };
+
+ self.string = function (strings) {
+ if (!Array.isArray(strings)) {
+ strings = [].slice.call(arguments);
+ }
+
+ strings.forEach(function (name) {
+ flags.strings[name] = true;
+ });
+
+ return self;
+ };
+
+ var aliases = {};
+ self.alias = function (x, y) {
+ if (typeof x === 'object') {
+ Object.keys(x).forEach(function (key) {
+ self.alias(key, x[key]);
+ });
+ }
+ else if (Array.isArray(y)) {
+ y.forEach(function (yy) {
+ self.alias(x, yy);
+ });
+ }
+ else {
+ var zs = (aliases[x] || []).concat(aliases[y] || []).concat(x, y);
+ aliases[x] = zs.filter(function (z) { return z != x });
+ aliases[y] = zs.filter(function (z) { return z != y });
+ }
+
+ return self;
+ };
+
+ var demanded = {};
+ self.demand = function (keys) {
+ if (typeof keys == 'number') {
+ if (!demanded._) demanded._ = 0;
+ demanded._ += keys;
+ }
+ else if (Array.isArray(keys)) {
+ keys.forEach(function (key) {
+ self.demand(key);
+ });
+ }
+ else {
+ demanded[keys] = true;
+ }
+
+ return self;
+ };
+
+ var usage;
+ self.usage = function (msg, opts) {
+ if (!opts && typeof msg === 'object') {
+ opts = msg;
+ msg = null;
+ }
+
+ usage = msg;
+
+ if (opts) self.options(opts);
+
+ return self;
+ };
+
+ function fail (msg) {
+ self.showHelp();
+ if (msg) console.error(msg);
+ process.exit(1);
+ }
+
+ var checks = [];
+ self.check = function (f) {
+ checks.push(f);
+ return self;
+ };
+
+ var defaults = {};
+ self.default = function (key, value) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.default(k, key[k]);
+ });
+ }
+ else {
+ defaults[key] = value;
+ }
+
+ return self;
+ };
+
+ var descriptions = {};
+ self.describe = function (key, desc) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.describe(k, key[k]);
+ });
+ }
+ else {
+ descriptions[key] = desc;
+ }
+ return self;
+ };
+
+ self.parse = function (args) {
+ return Argv(args).argv;
+ };
+
+ self.option = self.options = function (key, opt) {
+ if (typeof key === 'object') {
+ Object.keys(key).forEach(function (k) {
+ self.options(k, key[k]);
+ });
+ }
+ else {
+ if (opt.alias) self.alias(key, opt.alias);
+ if (opt.demand) self.demand(key);
+ if (typeof opt.default !== 'undefined') {
+ self.default(key, opt.default);
+ }
+
+ if (opt.boolean || opt.type === 'boolean') {
+ self.boolean(key);
+ }
+ if (opt.string || opt.type === 'string') {
+ self.string(key);
+ }
+
+ var desc = opt.describe || opt.description || opt.desc;
+ if (desc) {
+ self.describe(key, desc);
+ }
+ }
+
+ return self;
+ };
+
+ var wrap = null;
+ self.wrap = function (cols) {
+ wrap = cols;
+ return self;
+ };
+
+ self.showHelp = function (fn) {
+ if (!fn) fn = console.error;
+ fn(self.help());
+ };
+
+ self.help = function () {
+ var keys = Object.keys(
+ Object.keys(descriptions)
+ .concat(Object.keys(demanded))
+ .concat(Object.keys(defaults))
+ .reduce(function (acc, key) {
+ if (key !== '_') acc[key] = true;
+ return acc;
+ }, {})
+ );
+
+ var help = keys.length ? [ 'Options:' ] : [];
+
+ if (usage) {
+ help.unshift(usage.replace(/\$0/g, self.$0), '');
+ }
+
+ var switches = keys.reduce(function (acc, key) {
+ acc[key] = [ key ].concat(aliases[key] || [])
+ .map(function (sw) {
+ return (sw.length > 1 ? '--' : '-') + sw
+ })
+ .join(', ')
+ ;
+ return acc;
+ }, {});
+
+ var switchlen = longest(Object.keys(switches).map(function (s) {
+ return switches[s] || '';
+ }));
+
+ var desclen = longest(Object.keys(descriptions).map(function (d) {
+ return descriptions[d] || '';
+ }));
+
+ keys.forEach(function (key) {
+ var kswitch = switches[key];
+ var desc = descriptions[key] || '';
+
+ if (wrap) {
+ desc = wordwrap(switchlen + 4, wrap)(desc)
+ .slice(switchlen + 4)
+ ;
+ }
+
+ var spadding = new Array(
+ Math.max(switchlen - kswitch.length + 3, 0)
+ ).join(' ');
+
+ var dpadding = new Array(
+ Math.max(desclen - desc.length + 1, 0)
+ ).join(' ');
+
+ var type = null;
+
+ if (flags.bools[key]) type = '[boolean]';
+ if (flags.strings[key]) type = '[string]';
+
+ if (!wrap && dpadding.length > 0) {
+ desc += dpadding;
+ }
+
+ var prelude = ' ' + kswitch + spadding;
+ var extra = [
+ type,
+ demanded[key]
+ ? '[required]'
+ : null
+ ,
+ defaults[key] !== undefined
+ ? '[default: ' + JSON.stringify(defaults[key]) + ']'
+ : null
+ ,
+ ].filter(Boolean).join(' ');
+
+ var body = [ desc, extra ].filter(Boolean).join(' ');
+
+ if (wrap) {
+ var dlines = desc.split('\n');
+ var dlen = dlines.slice(-1)[0].length
+ + (dlines.length === 1 ? prelude.length : 0)
+
+ body = desc + (dlen + extra.length > wrap - 2
+ ? '\n'
+ + new Array(wrap - extra.length + 1).join(' ')
+ + extra
+ : new Array(wrap - extra.length - dlen + 1).join(' ')
+ + extra
+ );
+ }
+
+ help.push(prelude + body);
+ });
+
+ help.push('');
+ return help.join('\n');
+ };
+
+ Object.defineProperty(self, 'argv', {
+ get : parseArgs,
+ enumerable : true,
+ });
+
+ function parseArgs () {
+ var argv = { _ : [], $0 : self.$0 };
+ Object.keys(flags.bools).forEach(function (key) {
+ setArg(key, defaults[key] || false);
+ });
+
+ function setArg (key, val) {
+ var num = Number(val);
+ var value = typeof val !== 'string' || isNaN(num) ? val : num;
+ if (flags.strings[key]) value = val;
+
+ setKey(argv, key.split('.'), value);
+
+ (aliases[key] || []).forEach(function (x) {
+ argv[x] = argv[key];
+ });
+ }
+
+ for (var i = 0; i < args.length; i++) {
+ var arg = args[i];
+
+ if (arg === '--') {
+ argv._.push.apply(argv._, args.slice(i + 1));
+ break;
+ }
+ else if (arg.match(/^--.+=/)) {
+ var m = arg.match(/^--([^=]+)=(.*)/);
+ setArg(m[1], m[2]);
+ }
+ else if (arg.match(/^--no-.+/)) {
+ var key = arg.match(/^--no-(.+)/)[1];
+ setArg(key, false);
+ }
+ else if (arg.match(/^--.+/)) {
+ var key = arg.match(/^--(.+)/)[1];
+ var next = args[i + 1];
+ if (next !== undefined && !next.match(/^-/)
+ && !flags.bools[key]
+ && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
+ setArg(key, next);
+ i++;
+ }
+ else if (/true|false/.test(next)) {
+ setArg(key, next === 'true');
+ i++;
+ }
+ else {
+ setArg(key, true);
+ }
+ }
+ else if (arg.match(/^-[^-]+/)) {
+ var letters = arg.slice(1,-1).split('');
+
+ var broken = false;
+ for (var j = 0; j < letters.length; j++) {
+ if (letters[j+1] && letters[j+1].match(/\W/)) {
+ setArg(letters[j], arg.slice(j+2));
+ broken = true;
+ break;
+ }
+ else {
+ setArg(letters[j], true);
+ }
+ }
+
+ if (!broken) {
+ var key = arg.slice(-1)[0];
+
+ if (args[i+1] && !args[i+1].match(/^-/)
+ && !flags.bools[key]
+ && (aliases[key] ? !flags.bools[aliases[key]] : true)) {
+ setArg(key, args[i+1]);
+ i++;
+ }
+ else if (args[i+1] && /true|false/.test(args[i+1])) {
+ setArg(key, args[i+1] === 'true');
+ i++;
+ }
+ else {
+ setArg(key, true);
+ }
+ }
+ }
+ else {
+ var n = Number(arg);
+ argv._.push(flags.strings['_'] || isNaN(n) ? arg : n);
+ }
+ }
+
+ Object.keys(defaults).forEach(function (key) {
+ if (!(key in argv)) {
+ argv[key] = defaults[key];
+ if (key in aliases) {
+ argv[aliases[key]] = defaults[key];
+ }
+ }
+ });
+
+ if (demanded._ && argv._.length < demanded._) {
+ fail('Not enough non-option arguments: got '
+ + argv._.length + ', need at least ' + demanded._
+ );
+ }
+
+ var missing = [];
+ Object.keys(demanded).forEach(function (key) {
+ if (!argv[key]) missing.push(key);
+ });
+
+ if (missing.length) {
+ fail('Missing required arguments: ' + missing.join(', '));
+ }
+
+ checks.forEach(function (f) {
+ try {
+ if (f(argv) === false) {
+ fail('Argument check failed: ' + f.toString());
+ }
+ }
+ catch (err) {
+ fail(err)
+ }
+ });
+
+ return argv;
+ }
+
+ function longest (xs) {
+ return Math.max.apply(
+ null,
+ xs.map(function (x) { return x.length })
+ );
+ }
+
+ return self;
+};
+
+// rebase an absolute path to a relative one with respect to a base directory
+// exported for tests
+exports.rebase = rebase;
+function rebase (base, dir) {
+ var ds = path.normalize(dir).split('/').slice(1);
+ var bs = path.normalize(base).split('/').slice(1);
+
+ for (var i = 0; ds[i] && ds[i] == bs[i]; i++);
+ ds.splice(0, i); bs.splice(0, i);
+
+ var p = path.normalize(
+ bs.map(function () { return '..' }).concat(ds).join('/')
+ ).replace(/\/$/,'').replace(/^$/, '.');
+ return p.match(/^[.\/]/) ? p : './' + p;
+};
+
+function setKey (obj, keys, value) {
+ var o = obj;
+ keys.slice(0,-1).forEach(function (key) {
+ if (o[key] === undefined) o[key] = {};
+ o = o[key];
+ });
+
+ var key = keys[keys.length - 1];
+ if (o[key] === undefined || typeof o[key] === 'boolean') {
+ o[key] = value;
+ }
+ else if (Array.isArray(o[key])) {
+ o[key].push(value);
+ }
+ else {
+ o[key] = [ o[key], value ];
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/.npmignore b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/.npmignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/README.markdown b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/README.markdown
new file mode 100644
index 0000000..346374e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/README.markdown
@@ -0,0 +1,70 @@
+wordwrap
+========
+
+Wrap your words.
+
+example
+=======
+
+made out of meat
+----------------
+
+meat.js
+
+ var wrap = require('wordwrap')(15);
+ console.log(wrap('You and your whole family are made out of meat.'));
+
+output:
+
+ You and your
+ whole family
+ are made out
+ of meat.
+
+centered
+--------
+
+center.js
+
+ var wrap = require('wordwrap')(20, 60);
+ console.log(wrap(
+ 'At long last the struggle and tumult was over.'
+ + ' The machines had finally cast off their oppressors'
+ + ' and were finally free to roam the cosmos.'
+ + '\n'
+ + 'Free of purpose, free of obligation.'
+ + ' Just drifting through emptiness.'
+ + ' The sun was just another point of light.'
+ ));
+
+output:
+
+ At long last the struggle and tumult
+ was over. The machines had finally cast
+ off their oppressors and were finally
+ free to roam the cosmos.
+ Free of purpose, free of obligation.
+ Just drifting through emptiness. The
+ sun was just another point of light.
+
+methods
+=======
+
+var wrap = require('wordwrap');
+
+wrap(stop), wrap(start, stop, params={mode:"soft"})
+---------------------------------------------------
+
+Returns a function that takes a string and returns a new string.
+
+Pad out lines with spaces out to column `start` and then wrap until column
+`stop`. If a word is longer than `stop - start` characters it will overflow.
+
+In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are
+longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break
+up chunks longer than `stop - start`.
+
+wrap.hard(start, stop)
+----------------------
+
+Like `wrap()` but with `params.mode = "hard"`.
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/example/center.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/example/center.js
new file mode 100644
index 0000000..a3fbaae
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/example/center.js
@@ -0,0 +1,10 @@
+var wrap = require('wordwrap')(20, 60);
+console.log(wrap(
+ 'At long last the struggle and tumult was over.'
+ + ' The machines had finally cast off their oppressors'
+ + ' and were finally free to roam the cosmos.'
+ + '\n'
+ + 'Free of purpose, free of obligation.'
+ + ' Just drifting through emptiness.'
+ + ' The sun was just another point of light.'
+));
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/example/meat.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/example/meat.js
new file mode 100644
index 0000000..a4665e1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/example/meat.js
@@ -0,0 +1,3 @@
+var wrap = require('wordwrap')(15);
+
+console.log(wrap('You and your whole family are made out of meat.'));
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/index.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/index.js
new file mode 100644
index 0000000..c9bc945
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/index.js
@@ -0,0 +1,76 @@
+var wordwrap = module.exports = function (start, stop, params) {
+ if (typeof start === 'object') {
+ params = start;
+ start = params.start;
+ stop = params.stop;
+ }
+
+ if (typeof stop === 'object') {
+ params = stop;
+ start = start || params.start;
+ stop = undefined;
+ }
+
+ if (!stop) {
+ stop = start;
+ start = 0;
+ }
+
+ if (!params) params = {};
+ var mode = params.mode || 'soft';
+ var re = mode === 'hard' ? /\b/ : /(\S+\s+)/;
+
+ return function (text) {
+ var chunks = text.toString()
+ .split(re)
+ .reduce(function (acc, x) {
+ if (mode === 'hard') {
+ for (var i = 0; i < x.length; i += stop - start) {
+ acc.push(x.slice(i, i + stop - start));
+ }
+ }
+ else acc.push(x)
+ return acc;
+ }, [])
+ ;
+
+ return chunks.reduce(function (lines, rawChunk) {
+ if (rawChunk === '') return lines;
+
+ var chunk = rawChunk.replace(/\t/g, ' ');
+
+ var i = lines.length - 1;
+ if (lines[i].length + chunk.length > stop) {
+ lines[i] = lines[i].replace(/\s+$/, '');
+
+ chunk.split(/\n/).forEach(function (c) {
+ lines.push(
+ new Array(start + 1).join(' ')
+ + c.replace(/^\s+/, '')
+ );
+ });
+ }
+ else if (chunk.match(/\n/)) {
+ var xs = chunk.split(/\n/);
+ lines[i] += xs.shift();
+ xs.forEach(function (c) {
+ lines.push(
+ new Array(start + 1).join(' ')
+ + c.replace(/^\s+/, '')
+ );
+ });
+ }
+ else {
+ lines[i] += chunk;
+ }
+
+ return lines;
+ }, [ new Array(start + 1).join(' ') ]).join('\n');
+ };
+};
+
+wordwrap.soft = wordwrap;
+
+wordwrap.hard = function (start, stop) {
+ return wordwrap(start, stop, { mode : 'hard' });
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/package.json
new file mode 100644
index 0000000..fdff683
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/package.json
@@ -0,0 +1,37 @@
+{
+ "name" : "wordwrap",
+ "description" : "Wrap those words. Show them at what columns to start and stop.",
+ "version" : "0.0.2",
+ "repository" : {
+ "type" : "git",
+ "url" : "git://github.com/substack/node-wordwrap.git"
+ },
+ "main" : "./index.js",
+ "keywords" : [
+ "word",
+ "wrap",
+ "rule",
+ "format",
+ "column"
+ ],
+ "directories" : {
+ "lib" : ".",
+ "example" : "example",
+ "test" : "test"
+ },
+ "scripts" : {
+ "test" : "expresso"
+ },
+ "devDependencies" : {
+ "expresso" : "=0.7.x"
+ },
+ "engines" : {
+ "node" : ">=0.4.0"
+ },
+ "license" : "MIT/X11",
+ "author" : {
+ "name" : "James Halliday",
+ "email" : "mail@substack.net",
+ "url" : "http://substack.net"
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/break.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/break.js
new file mode 100644
index 0000000..749292e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/break.js
@@ -0,0 +1,30 @@
+var assert = require('assert');
+var wordwrap = require('../');
+
+exports.hard = function () {
+ var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,'
+ + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",'
+ + '"browser":"chrome/6.0"}'
+ ;
+ var s_ = wordwrap.hard(80)(s);
+
+ var lines = s_.split('\n');
+ assert.equal(lines.length, 2);
+ assert.ok(lines[0].length < 80);
+ assert.ok(lines[1].length < 80);
+
+ assert.equal(s, s_.replace(/\n/g, ''));
+};
+
+exports.break = function () {
+ var s = new Array(55+1).join('a');
+ var s_ = wordwrap.hard(20)(s);
+
+ var lines = s_.split('\n');
+ assert.equal(lines.length, 3);
+ assert.ok(lines[0].length === 20);
+ assert.ok(lines[1].length === 20);
+ assert.ok(lines[2].length === 15);
+
+ assert.equal(s, s_.replace(/\n/g, ''));
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/idleness.txt b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/idleness.txt
new file mode 100644
index 0000000..aa3f490
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/idleness.txt
@@ -0,0 +1,63 @@
+In Praise of Idleness
+
+By Bertrand Russell
+
+[1932]
+
+Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain.
+
+Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise.
+
+One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling.
+
+But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person.
+
+All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work.
+
+First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising.
+
+Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example.
+
+From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery.
+
+It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization.
+
+Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry.
+
+This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined?
+
+The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion.
+
+Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only.
+
+I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve.
+
+If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense.
+
+The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists.
+
+In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism.
+
+The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching.
+
+For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours?
+
+In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man.
+
+In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed.
+
+The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy.
+
+It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer.
+
+When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part.
+
+In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism.
+
+The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits.
+
+In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue.
+
+Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever.
+
+[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests.
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/wrap.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/wrap.js
new file mode 100644
index 0000000..0cfb76d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/node_modules/wordwrap/test/wrap.js
@@ -0,0 +1,31 @@
+var assert = require('assert');
+var wordwrap = require('wordwrap');
+
+var fs = require('fs');
+var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8');
+
+exports.stop80 = function () {
+ var lines = wordwrap(80)(idleness).split(/\n/);
+ var words = idleness.split(/\s+/);
+
+ lines.forEach(function (line) {
+ assert.ok(line.length <= 80, 'line > 80 columns');
+ var chunks = line.match(/\S/) ? line.split(/\s+/) : [];
+ assert.deepEqual(chunks, words.splice(0, chunks.length));
+ });
+};
+
+exports.start20stop60 = function () {
+ var lines = wordwrap(20, 100)(idleness).split(/\n/);
+ var words = idleness.split(/\s+/);
+
+ lines.forEach(function (line) {
+ assert.ok(line.length <= 100, 'line > 100 columns');
+ var chunks = line
+ .split(/\s+/)
+ .filter(function (x) { return x.match(/\S/) })
+ ;
+ assert.deepEqual(chunks, words.splice(0, chunks.length));
+ assert.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' '));
+ });
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/package.json
new file mode 100644
index 0000000..a59dc7e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/package.json
@@ -0,0 +1,43 @@
+{
+ "name" : "optimist",
+ "version" : "0.3.4",
+ "description" : "Light-weight option parsing with an argv hash. No optstrings attached.",
+ "main" : "./index.js",
+ "directories" : {
+ "lib" : ".",
+ "test" : "test",
+ "example" : "example"
+ },
+ "dependencies" : {
+ "wordwrap" : "~0.0.2"
+ },
+ "devDependencies" : {
+ "hashish": "~0.0.4",
+ "tap" : "~0.2.4"
+ },
+ "scripts" : {
+ "test" : "tap ./test/*.js"
+ },
+ "repository" : {
+ "type" : "git",
+ "url" : "http://github.com/substack/node-optimist.git"
+ },
+ "keywords" : [
+ "argument",
+ "args",
+ "option",
+ "parser",
+ "parsing",
+ "cli",
+ "command"
+ ],
+ "author" : {
+ "name" : "James Halliday",
+ "email" : "mail@substack.net",
+ "url" : "http://substack.net"
+ },
+ "license" : "MIT/X11",
+ "engine" : {
+ "node" : ">=0.4"
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_.js
new file mode 100644
index 0000000..d9c58b3
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_.js
@@ -0,0 +1,71 @@
+var spawn = require('child_process').spawn;
+var test = require('tap').test;
+
+test('dotSlashEmpty', testCmd('./bin.js', []));
+
+test('dotSlashArgs', testCmd('./bin.js', [ 'a', 'b', 'c' ]));
+
+test('nodeEmpty', testCmd('node bin.js', []));
+
+test('nodeArgs', testCmd('node bin.js', [ 'x', 'y', 'z' ]));
+
+test('whichNodeEmpty', function (t) {
+ var which = spawn('which', ['node']);
+
+ which.stdout.on('data', function (buf) {
+ t.test(
+ testCmd(buf.toString().trim() + ' bin.js', [])
+ );
+ t.end();
+ });
+
+ which.stderr.on('data', function (err) {
+ assert.error(err);
+ t.end();
+ });
+});
+
+test('whichNodeArgs', function (t) {
+ var which = spawn('which', ['node']);
+
+ which.stdout.on('data', function (buf) {
+ t.test(
+ testCmd(buf.toString().trim() + ' bin.js', [ 'q', 'r' ])
+ );
+ t.end();
+ });
+
+ which.stderr.on('data', function (err) {
+ t.error(err);
+ t.end();
+ });
+});
+
+function testCmd (cmd, args) {
+
+ return function (t) {
+ var to = setTimeout(function () {
+ assert.fail('Never got stdout data.')
+ }, 5000);
+
+ var oldDir = process.cwd();
+ process.chdir(__dirname + '/_');
+
+ var cmds = cmd.split(' ');
+
+ var bin = spawn(cmds[0], cmds.slice(1).concat(args.map(String)));
+ process.chdir(oldDir);
+
+ bin.stderr.on('data', function (err) {
+ t.error(err);
+ t.end();
+ });
+
+ bin.stdout.on('data', function (buf) {
+ clearTimeout(to);
+ var _ = JSON.parse(buf.toString());
+ t.same(_.map(String), args.map(String));
+ t.end();
+ });
+ };
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_/argv.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_/argv.js
new file mode 100644
index 0000000..3d09606
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_/argv.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env node
+console.log(JSON.stringify(process.argv));
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_/bin.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_/bin.js
new file mode 100755
index 0000000..4a18d85
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/_/bin.js
@@ -0,0 +1,3 @@
+#!/usr/bin/env node
+var argv = require('../../index').argv
+console.log(JSON.stringify(argv._));
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/parse.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/parse.js
new file mode 100644
index 0000000..d9a37ab
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/parse.js
@@ -0,0 +1,420 @@
+var optimist = require('../index');
+var path = require('path');
+var test = require('tap').test;
+
+var expresso = 'node ./parse.js';
+
+test('short boolean', function (t) {
+ var parse = optimist.parse([ '-b' ]);
+ t.same(parse, { b : true, _ : [], $0 : expresso });
+ t.same(typeof parse.b, 'boolean');
+ t.end();
+});
+
+test('long boolean', function (t) {
+ t.same(
+ optimist.parse([ '--bool' ]),
+ { bool : true, _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('bare', function (t) {
+ t.same(
+ optimist.parse([ 'foo', 'bar', 'baz' ]),
+ { _ : [ 'foo', 'bar', 'baz' ], $0 : expresso }
+ );
+ t.end();
+});
+
+test('short group', function (t) {
+ t.same(
+ optimist.parse([ '-cats' ]),
+ { c : true, a : true, t : true, s : true, _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('short group next', function (t) {
+ t.same(
+ optimist.parse([ '-cats', 'meow' ]),
+ { c : true, a : true, t : true, s : 'meow', _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('short capture', function (t) {
+ t.same(
+ optimist.parse([ '-h', 'localhost' ]),
+ { h : 'localhost', _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('short captures', function (t) {
+ t.same(
+ optimist.parse([ '-h', 'localhost', '-p', '555' ]),
+ { h : 'localhost', p : 555, _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('long capture sp', function (t) {
+ t.same(
+ optimist.parse([ '--pow', 'xixxle' ]),
+ { pow : 'xixxle', _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('long capture eq', function (t) {
+ t.same(
+ optimist.parse([ '--pow=xixxle' ]),
+ { pow : 'xixxle', _ : [], $0 : expresso }
+ );
+ t.end()
+});
+
+test('long captures sp', function (t) {
+ t.same(
+ optimist.parse([ '--host', 'localhost', '--port', '555' ]),
+ { host : 'localhost', port : 555, _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('long captures eq', function (t) {
+ t.same(
+ optimist.parse([ '--host=localhost', '--port=555' ]),
+ { host : 'localhost', port : 555, _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('mixed short bool and capture', function (t) {
+ t.same(
+ optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+ {
+ f : true, p : 555, h : 'localhost',
+ _ : [ 'script.js' ], $0 : expresso,
+ }
+ );
+ t.end();
+});
+
+test('short and long', function (t) {
+ t.same(
+ optimist.parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]),
+ {
+ f : true, p : 555, h : 'localhost',
+ _ : [ 'script.js' ], $0 : expresso,
+ }
+ );
+ t.end();
+});
+
+test('no', function (t) {
+ t.same(
+ optimist.parse([ '--no-moo' ]),
+ { moo : false, _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('multi', function (t) {
+ t.same(
+ optimist.parse([ '-v', 'a', '-v', 'b', '-v', 'c' ]),
+ { v : ['a','b','c'], _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('comprehensive', function (t) {
+ t.same(
+ optimist.parse([
+ '--name=meowmers', 'bare', '-cats', 'woo',
+ '-h', 'awesome', '--multi=quux',
+ '--key', 'value',
+ '-b', '--bool', '--no-meep', '--multi=baz',
+ '--', '--not-a-flag', 'eek'
+ ]),
+ {
+ c : true,
+ a : true,
+ t : true,
+ s : 'woo',
+ h : 'awesome',
+ b : true,
+ bool : true,
+ key : 'value',
+ multi : [ 'quux', 'baz' ],
+ meep : false,
+ name : 'meowmers',
+ _ : [ 'bare', '--not-a-flag', 'eek' ],
+ $0 : expresso
+ }
+ );
+ t.end();
+});
+
+test('nums', function (t) {
+ var argv = optimist.parse([
+ '-x', '1234',
+ '-y', '5.67',
+ '-z', '1e7',
+ '-w', '10f',
+ '--hex', '0xdeadbeef',
+ '789',
+ ]);
+ t.same(argv, {
+ x : 1234,
+ y : 5.67,
+ z : 1e7,
+ w : '10f',
+ hex : 0xdeadbeef,
+ _ : [ 789 ],
+ $0 : expresso
+ });
+ t.same(typeof argv.x, 'number');
+ t.same(typeof argv.y, 'number');
+ t.same(typeof argv.z, 'number');
+ t.same(typeof argv.w, 'string');
+ t.same(typeof argv.hex, 'number');
+ t.same(typeof argv._[0], 'number');
+ t.end();
+});
+
+test('flag boolean', function (t) {
+ var parse = optimist([ '-t', 'moo' ]).boolean(['t']).argv;
+ t.same(parse, { t : true, _ : [ 'moo' ], $0 : expresso });
+ t.same(typeof parse.t, 'boolean');
+ t.end();
+});
+
+test('flag boolean value', function (t) {
+ var parse = optimist(['--verbose', 'false', 'moo', '-t', 'true'])
+ .boolean(['t', 'verbose']).default('verbose', true).argv;
+
+ t.same(parse, {
+ verbose: false,
+ t: true,
+ _: ['moo'],
+ $0 : expresso
+ });
+
+ t.same(typeof parse.verbose, 'boolean');
+ t.same(typeof parse.t, 'boolean');
+ t.end();
+});
+
+test('flag boolean default false', function (t) {
+ var parse = optimist(['moo'])
+ .boolean(['t', 'verbose'])
+ .default('verbose', false)
+ .default('t', false).argv;
+
+ t.same(parse, {
+ verbose: false,
+ t: false,
+ _: ['moo'],
+ $0 : expresso
+ });
+
+ t.same(typeof parse.verbose, 'boolean');
+ t.same(typeof parse.t, 'boolean');
+ t.end();
+
+});
+
+test('boolean groups', function (t) {
+ var parse = optimist([ '-x', '-z', 'one', 'two', 'three' ])
+ .boolean(['x','y','z']).argv;
+
+ t.same(parse, {
+ x : true,
+ y : false,
+ z : true,
+ _ : [ 'one', 'two', 'three' ],
+ $0 : expresso
+ });
+
+ t.same(typeof parse.x, 'boolean');
+ t.same(typeof parse.y, 'boolean');
+ t.same(typeof parse.z, 'boolean');
+ t.end();
+});
+
+test('strings' , function (t) {
+ var s = optimist([ '-s', '0001234' ]).string('s').argv.s;
+ t.same(s, '0001234');
+ t.same(typeof s, 'string');
+
+ var x = optimist([ '-x', '56' ]).string('x').argv.x;
+ t.same(x, '56');
+ t.same(typeof x, 'string');
+ t.end();
+});
+
+test('stringArgs', function (t) {
+ var s = optimist([ ' ', ' ' ]).string('_').argv._;
+ t.same(s.length, 2);
+ t.same(typeof s[0], 'string');
+ t.same(s[0], ' ');
+ t.same(typeof s[1], 'string');
+ t.same(s[1], ' ');
+ t.end();
+});
+
+test('slashBreak', function (t) {
+ t.same(
+ optimist.parse([ '-I/foo/bar/baz' ]),
+ { I : '/foo/bar/baz', _ : [], $0 : expresso }
+ );
+ t.same(
+ optimist.parse([ '-xyz/foo/bar/baz' ]),
+ { x : true, y : true, z : '/foo/bar/baz', _ : [], $0 : expresso }
+ );
+ t.end();
+});
+
+test('alias', function (t) {
+ var argv = optimist([ '-f', '11', '--zoom', '55' ])
+ .alias('z', 'zoom')
+ .argv
+ ;
+ t.equal(argv.zoom, 55);
+ t.equal(argv.z, argv.zoom);
+ t.equal(argv.f, 11);
+ t.end();
+});
+
+test('multiAlias', function (t) {
+ var argv = optimist([ '-f', '11', '--zoom', '55' ])
+ .alias('z', [ 'zm', 'zoom' ])
+ .argv
+ ;
+ t.equal(argv.zoom, 55);
+ t.equal(argv.z, argv.zoom);
+ t.equal(argv.z, argv.zm);
+ t.equal(argv.f, 11);
+ t.end();
+});
+
+test('boolean default true', function (t) {
+ var argv = optimist.options({
+ sometrue: {
+ boolean: true,
+ default: true
+ }
+ }).argv;
+
+ t.equal(argv.sometrue, true);
+ t.end();
+});
+
+test('boolean default false', function (t) {
+ var argv = optimist.options({
+ somefalse: {
+ boolean: true,
+ default: false
+ }
+ }).argv;
+
+ t.equal(argv.somefalse, false);
+ t.end();
+});
+
+test('nested dotted objects', function (t) {
+ var argv = optimist([
+ '--foo.bar', '3', '--foo.baz', '4',
+ '--foo.quux.quibble', '5', '--foo.quux.o_O',
+ '--beep.boop'
+ ]).argv;
+
+ t.same(argv.foo, {
+ bar : 3,
+ baz : 4,
+ quux : {
+ quibble : 5,
+ o_O : true
+ },
+ });
+ t.same(argv.beep, { boop : true });
+ t.end();
+});
+
+test('boolean and alias with chainable api', function (t) {
+ var aliased = [ '-h', 'derp' ];
+ var regular = [ '--herp', 'derp' ];
+ var opts = {
+ herp: { alias: 'h', boolean: true }
+ };
+ var aliasedArgv = optimist(aliased)
+ .boolean('herp')
+ .alias('h', 'herp')
+ .argv;
+ var propertyArgv = optimist(regular)
+ .boolean('herp')
+ .alias('h', 'herp')
+ .argv;
+ var expected = {
+ herp: true,
+ h: true,
+ '_': [ 'derp' ],
+ '$0': expresso,
+ };
+
+ t.same(aliasedArgv, expected);
+ t.same(propertyArgv, expected);
+ t.end();
+});
+
+test('boolean and alias with options hash', function (t) {
+ var aliased = [ '-h', 'derp' ];
+ var regular = [ '--herp', 'derp' ];
+ var opts = {
+ herp: { alias: 'h', boolean: true }
+ };
+ var aliasedArgv = optimist(aliased)
+ .options(opts)
+ .argv;
+ var propertyArgv = optimist(regular).options(opts).argv;
+ var expected = {
+ herp: true,
+ h: true,
+ '_': [ 'derp' ],
+ '$0': expresso,
+ };
+
+ t.same(aliasedArgv, expected);
+ t.same(propertyArgv, expected);
+
+ t.end();
+});
+
+test('boolean and alias using explicit true', function (t) {
+ var aliased = [ '-h', 'true' ];
+ var regular = [ '--herp', 'true' ];
+ var opts = {
+ herp: { alias: 'h', boolean: true }
+ };
+ var aliasedArgv = optimist(aliased)
+ .boolean('h')
+ .alias('h', 'herp')
+ .argv;
+ var propertyArgv = optimist(regular)
+ .boolean('h')
+ .alias('h', 'herp')
+ .argv;
+ var expected = {
+ herp: true,
+ h: true,
+ '_': [ ],
+ '$0': expresso,
+ };
+
+ t.same(aliasedArgv, expected);
+ t.same(propertyArgv, expected);
+ t.end();
+});
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/usage.js b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/usage.js
new file mode 100644
index 0000000..300454c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/optimist/test/usage.js
@@ -0,0 +1,292 @@
+var Hash = require('hashish');
+var optimist = require('../index');
+var test = require('tap').test;
+
+test('usageFail', function (t) {
+ var r = checkUsage(function () {
+ return optimist('-x 10 -z 20'.split(' '))
+ .usage('Usage: $0 -x NUM -y NUM')
+ .demand(['x','y'])
+ .argv;
+ });
+ t.same(
+ r.result,
+ { x : 10, z : 20, _ : [], $0 : './usage' }
+ );
+
+ t.same(
+ r.errors.join('\n').split(/\n+/),
+ [
+ 'Usage: ./usage -x NUM -y NUM',
+ 'Options:',
+ ' -x [required]',
+ ' -y [required]',
+ 'Missing required arguments: y',
+ ]
+ );
+ t.same(r.logs, []);
+ t.ok(r.exit);
+ t.end();
+});
+
+
+test('usagePass', function (t) {
+ var r = checkUsage(function () {
+ return optimist('-x 10 -y 20'.split(' '))
+ .usage('Usage: $0 -x NUM -y NUM')
+ .demand(['x','y'])
+ .argv;
+ });
+ t.same(r, {
+ result : { x : 10, y : 20, _ : [], $0 : './usage' },
+ errors : [],
+ logs : [],
+ exit : false,
+ });
+ t.end();
+});
+
+test('checkPass', function (t) {
+ var r = checkUsage(function () {
+ return optimist('-x 10 -y 20'.split(' '))
+ .usage('Usage: $0 -x NUM -y NUM')
+ .check(function (argv) {
+ if (!('x' in argv)) throw 'You forgot about -x';
+ if (!('y' in argv)) throw 'You forgot about -y';
+ })
+ .argv;
+ });
+ t.same(r, {
+ result : { x : 10, y : 20, _ : [], $0 : './usage' },
+ errors : [],
+ logs : [],
+ exit : false,
+ });
+ t.end();
+});
+
+test('checkFail', function (t) {
+ var r = checkUsage(function () {
+ return optimist('-x 10 -z 20'.split(' '))
+ .usage('Usage: $0 -x NUM -y NUM')
+ .check(function (argv) {
+ if (!('x' in argv)) throw 'You forgot about -x';
+ if (!('y' in argv)) throw 'You forgot about -y';
+ })
+ .argv;
+ });
+
+ t.same(
+ r.result,
+ { x : 10, z : 20, _ : [], $0 : './usage' }
+ );
+
+ t.same(
+ r.errors.join('\n').split(/\n+/),
+ [
+ 'Usage: ./usage -x NUM -y NUM',
+ 'You forgot about -y'
+ ]
+ );
+
+ t.same(r.logs, []);
+ t.ok(r.exit);
+ t.end();
+});
+
+test('checkCondPass', function (t) {
+ function checker (argv) {
+ return 'x' in argv && 'y' in argv;
+ }
+
+ var r = checkUsage(function () {
+ return optimist('-x 10 -y 20'.split(' '))
+ .usage('Usage: $0 -x NUM -y NUM')
+ .check(checker)
+ .argv;
+ });
+ t.same(r, {
+ result : { x : 10, y : 20, _ : [], $0 : './usage' },
+ errors : [],
+ logs : [],
+ exit : false,
+ });
+ t.end();
+});
+
+test('checkCondFail', function (t) {
+ function checker (argv) {
+ return 'x' in argv && 'y' in argv;
+ }
+
+ var r = checkUsage(function () {
+ return optimist('-x 10 -z 20'.split(' '))
+ .usage('Usage: $0 -x NUM -y NUM')
+ .check(checker)
+ .argv;
+ });
+
+ t.same(
+ r.result,
+ { x : 10, z : 20, _ : [], $0 : './usage' }
+ );
+
+ t.same(
+ r.errors.join('\n').split(/\n+/).join('\n'),
+ 'Usage: ./usage -x NUM -y NUM\n'
+ + 'Argument check failed: ' + checker.toString()
+ );
+
+ t.same(r.logs, []);
+ t.ok(r.exit);
+ t.end();
+});
+
+test('countPass', function (t) {
+ var r = checkUsage(function () {
+ return optimist('1 2 3 --moo'.split(' '))
+ .usage('Usage: $0 [x] [y] [z] {OPTIONS}')
+ .demand(3)
+ .argv;
+ });
+ t.same(r, {
+ result : { _ : [ '1', '2', '3' ], moo : true, $0 : './usage' },
+ errors : [],
+ logs : [],
+ exit : false,
+ });
+ t.end();
+});
+
+test('countFail', function (t) {
+ var r = checkUsage(function () {
+ return optimist('1 2 --moo'.split(' '))
+ .usage('Usage: $0 [x] [y] [z] {OPTIONS}')
+ .demand(3)
+ .argv;
+ });
+ t.same(
+ r.result,
+ { _ : [ '1', '2' ], moo : true, $0 : './usage' }
+ );
+
+ t.same(
+ r.errors.join('\n').split(/\n+/),
+ [
+ 'Usage: ./usage [x] [y] [z] {OPTIONS}',
+ 'Not enough non-option arguments: got 2, need at least 3',
+ ]
+ );
+
+ t.same(r.logs, []);
+ t.ok(r.exit);
+ t.end();
+});
+
+test('defaultSingles', function (t) {
+ var r = checkUsage(function () {
+ return optimist('--foo 50 --baz 70 --powsy'.split(' '))
+ .default('foo', 5)
+ .default('bar', 6)
+ .default('baz', 7)
+ .argv
+ ;
+ });
+ t.same(r.result, {
+ foo : '50',
+ bar : 6,
+ baz : '70',
+ powsy : true,
+ _ : [],
+ $0 : './usage',
+ });
+ t.end();
+});
+
+test('defaultAliases', function (t) {
+ var r = checkUsage(function () {
+ return optimist('')
+ .alias('f', 'foo')
+ .default('f', 5)
+ .argv
+ ;
+ });
+ t.same(r.result, {
+ f : '5',
+ foo : '5',
+ _ : [],
+ $0 : './usage',
+ });
+ t.end();
+});
+
+test('defaultHash', function (t) {
+ var r = checkUsage(function () {
+ return optimist('--foo 50 --baz 70'.split(' '))
+ .default({ foo : 10, bar : 20, quux : 30 })
+ .argv
+ ;
+ });
+ t.same(r.result, {
+ _ : [],
+ $0 : './usage',
+ foo : 50,
+ baz : 70,
+ bar : 20,
+ quux : 30,
+ });
+ t.end();
+});
+
+test('rebase', function (t) {
+ t.equal(
+ optimist.rebase('/home/substack', '/home/substack/foo/bar/baz'),
+ './foo/bar/baz'
+ );
+ t.equal(
+ optimist.rebase('/home/substack/foo/bar/baz', '/home/substack'),
+ '../../..'
+ );
+ t.equal(
+ optimist.rebase('/home/substack/foo', '/home/substack/pow/zoom.txt'),
+ '../pow/zoom.txt'
+ );
+ t.end();
+});
+
+function checkUsage (f) {
+
+ var exit = false;
+
+ process._exit = process.exit;
+ process._env = process.env;
+ process._argv = process.argv;
+
+ process.exit = function (t) { exit = true };
+ process.env = Hash.merge(process.env, { _ : 'node' });
+ process.argv = [ './usage' ];
+
+ var errors = [];
+ var logs = [];
+
+ console._error = console.error;
+ console.error = function (msg) { errors.push(msg) };
+ console._log = console.log;
+ console.log = function (msg) { logs.push(msg) };
+
+ var result = f();
+
+ process.exit = process._exit;
+ process.env = process._env;
+ process.argv = process._argv;
+
+ console.error = console._error;
+ console.log = console._log;
+
+ return {
+ errors : errors,
+ logs : logs,
+ exit : exit,
+ result : result,
+ };
+};
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/node-type-emitter.js b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node-type-emitter.js
new file mode 100644
index 0000000..9a1e01c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node-type-emitter.js
@@ -0,0 +1,89 @@
+/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
+(function () {
+ "use strict";
+
+ // "FIFO" isn't easy to convert to camelCase and back reliably
+ var isFnodeTypes = [
+ "isFile", "isDirectory", "isSymbolicLink", "isBlockDevice", "isCharacterDevice", "isFIFO", "isSocket"
+ ],
+ fnodeTypes = [
+ "file", "directory", "symbolicLink", "blockDevice", "characterDevice", "FIFO", "socket"
+ ],
+ fnodeTypesPlural = [
+ "files", "directories", "symbolicLinks", "blockDevices", "characterDevices", "FIFOs", "sockets"
+ ];
+
+
+ //
+ function createNodeGroups() {
+ var nodeGroups = {};
+ fnodeTypesPlural.concat("nodes", "errors").forEach(function (fnodeTypePlural) {
+ nodeGroups[fnodeTypePlural] = [];
+ });
+ return nodeGroups;
+ }
+
+
+ // Determine each file node's type
+ //
+ function sortFnodesByType(stat, fnodes) {
+ var i, isType;
+
+ for (i = 0; i < isFnodeTypes.length; i += 1) {
+ isType = isFnodeTypes[i];
+ if (stat[isType]()) {
+ stat.type = fnodeTypes[i];
+ fnodes[fnodeTypesPlural[i]].push(stat);
+ return;
+ }
+ }
+ }
+
+
+ // Get the current number of listeners (which may change)
+ // Emit events to each listener
+ // Wait for all listeners to `next()` before continueing
+ // (in theory this may avoid disk thrashing)
+ function emitSingleEvents(emitter, path, stats, next, self) {
+ var num = 1 + emitter.listeners(stats.type).length + emitter.listeners("node").length;
+
+ function nextWhenReady() {
+ num -= 1;
+ if (0 === num) { next.call(self); }
+ }
+
+ emitter.emit(stats.type, path, stats, nextWhenReady);
+ emitter.emit("node", path, stats, nextWhenReady);
+ nextWhenReady();
+ }
+
+
+ // Since the risk for disk thrashing among anything
+ // other than files is relatively low, all types are
+ // emitted at once, but all must complete before advancing
+ function emitPluralEvents(emitter, path, nodes, next, self) {
+ var num = 1;
+
+ function nextWhenReady() {
+ num -= 1;
+ if (0 === num) { next.call(self); }
+ }
+
+ fnodeTypesPlural.concat(["nodes", "errors"]).forEach(function (fnodeType) {
+ if (0 === nodes[fnodeType].length) { return; }
+ num += emitter.listeners(fnodeType).length;
+ emitter.emit(fnodeType, path, nodes[fnodeType], nextWhenReady);
+ });
+ nextWhenReady();
+ }
+
+ module.exports = {
+ emitNodeType: emitSingleEvents,
+ emitNodeTypeGroups: emitPluralEvents,
+ isFnodeTypes: isFnodeTypes,
+ fnodeTypes: fnodeTypes,
+ fnodeTypesPlural: fnodeTypesPlural,
+ sortFnodesByType: sortFnodesByType,
+ createNodeGroups: createNodeGroups
+ };
+}());
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/README.md b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/README.md
new file mode 100644
index 0000000..f1edc95
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/README.md
@@ -0,0 +1,46 @@
+Array.forEachAsync()
+----
+
+Another reincarnation of `sequence` that makes sense for the use case of arrays.
+
+**Example:**
+
+ var forEachAsync = require('forEachAsync')
+ , count = 0
+ , timers = [
+ 101,
+ 502,
+ 203,
+ 604,
+ 105
+ ];
+
+ function hello(next, time) {
+ this[count] = time;
+
+ if (count >= 4) {
+ next(forEachAsync.BREAK);
+ }
+
+ console.log(count += 1, time);
+
+ setTimeout(next, time);
+ }
+
+ function goodbye() {
+ console.log("All Done", this);
+ }
+
+ forEachAsync(timers, hello, {}).then(goodbye);
+
+API
+---
+
+ * forEachAsync(array, callback*[, thisArg]*)
+ * forEachAsync#then(finalCallback)
+ * forEachAsync#BREAK
+
+**Warning:** [Poorly written code](https://gist.github.com/941362) may have really strange errors when `Array.prototype` is extended.
+If you run into such problems please contact the author of the code (I'm also willing to help if they are unavailable).
+Libraries such as `jQuery` or `MooTools` will accept bug reports for such failures.
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/forEachAsync.js b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/forEachAsync.js
new file mode 100644
index 0000000..3c3cf66
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/forEachAsync.js
@@ -0,0 +1,37 @@
+/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
+(function () {
+ "use strict";
+
+ var Sequence = require('sequence');
+
+ function handleItem(item, i, arr) {
+ var seq = this
+ ;
+
+ function nextItem(next, BREAK) {
+ if (forEachAsync.BREAK === BREAK) {
+ process.nextTick(function () {
+ next(forEachAsync.BREAK);
+ });
+ return;
+ }
+
+ seq._contextCallback.call(this, next, item, i, arr);
+ }
+
+ seq.then(nextItem);
+ }
+
+ function forEachAsync(arr, callback, _context) {
+ var sequence = Sequence.create(_context);
+
+ sequence._contextCallback = callback;
+
+ arr.forEach(handleItem, sequence);
+
+ return sequence;
+ }
+
+ forEachAsync.BREAK = '__forEachAsync_BREAK__';
+ module.exports = forEachAsync;
+}());
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/README.md b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/README.md
new file mode 100644
index 0000000..6505da4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/README.md
@@ -0,0 +1,35 @@
+sequence()
+----
+
+Creates an Asynchronous Stack which execute each enqueued method after the previous function calls the provided `next(err, data [, ...])`.
+
+**Core**
+
+ * `Futures.sequence(globalContext=null)`
+ * `then(next, err, data [, ...])` - add a method onto the queue
+ * begins or resumes the queue
+ * passes the results of the previous function into the next
+
+**Example:**
+
+ var sequence = Futures.sequence(),
+ err;
+
+ sequence
+ .then(function (next) {
+ setTimeout(function () {
+ next(err, "Hi", "World!");
+ }, 120);
+ })
+ .then(function (next, err, a, b) {
+ setTimeout(function () {
+ next(err, "Hello", b);
+ }, 270);
+ })
+ .then(function (next, err, a, b) {
+ setTimeout(function () {
+ console.log(a, b);
+ next();
+ }, 50);
+ });
+
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/package.json
new file mode 100644
index 0000000..f7fd332
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/package.json
@@ -0,0 +1,22 @@
+{
+ "name": "sequence",
+ "version": "2.2.1",
+ "description": "The sequence module of FuturesJS (Ender.JS and Node.JS)",
+ "homepage": "https://github.com/coolaj86/futures",
+ "keywords": ["flow-control", "async", "asynchronous", "futures", "sequence", "chain", "step", "util", "browser"],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/coolaj86/futures.git"
+ },
+ "author": "AJ ONeal (http://coolaj86.info)",
+ "main": "sequence.js",
+ "directories": {
+ "lib": "."
+ },
+ "dependencies": {
+ },
+ "engines": {
+ "node": "*",
+ "ender": ">= 0.5.0"
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/sequence.js b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/sequence.js
new file mode 100644
index 0000000..b92c361
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/node_modules/sequence/sequence.js
@@ -0,0 +1,66 @@
+(function () {
+ "use strict";
+
+ function isSequence(obj) {
+ return obj instanceof Sequence;
+ }
+
+ function Sequence(global_context) {
+ var self = this,
+ waiting = true,
+ data,
+ stack = [];
+
+ if (!isSequence(this)) {
+ return new Sequence(global_context);
+ }
+
+ global_context = global_context || null;
+
+ function next() {
+ var args = Array.prototype.slice.call(arguments),
+ seq = stack.shift(); // BUG this will eventually leak
+
+ data = arguments;
+
+ if (!seq) {
+ // the chain has ended (for now)
+ waiting = true;
+ return;
+ }
+
+ args.unshift(next);
+ seq.callback.apply(seq.context, args);
+ }
+
+ function then(callback, context) {
+ if ('function' !== typeof callback) {
+ throw new Error("`Sequence().then(callback [context])` requires that `callback` be a function and that `context` be `null`, an object, or a function");
+ }
+ stack.push({
+ callback: callback,
+ context: (null === context ? null : context || global_context),
+ index: stack.length
+ });
+
+ // if the chain has stopped, start it back up
+ if (waiting) {
+ waiting = false;
+ next.apply(null, data);
+ }
+
+ return self;
+ }
+
+ self.next = next;
+ self.then = then;
+ }
+
+ function createSequence(context) {
+ // TODO use prototype instead of new
+ return (new Sequence(context));
+ }
+ Sequence.create = createSequence;
+ Sequence.isSequence = isSequence;
+ module.exports = Sequence;
+}());
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/package.json
new file mode 100644
index 0000000..d0239ce
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/node_modules/forEachAsync/package.json
@@ -0,0 +1,23 @@
+{
+ "name": "forEachAsync",
+ "version": "2.2.0",
+ "description": "The forEachAsync module of FuturesJS (Ender.JS and Node.JS)",
+ "homepage": "https://github.com/coolaj86/futures",
+ "keywords": ["flow-control", "async", "asynchronous", "futures", "forEachAsync", "chain", "step", "util", "browser"],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/coolaj86/futures.git"
+ },
+ "author": "AJ ONeal (http://coolaj86.info)",
+ "main": "forEachAsync.js",
+ "directories": {
+ "lib": "."
+ },
+ "dependencies": {
+ "sequence": ">= 2.2.1"
+ },
+ "engines": {
+ "node": "*",
+ "ender": ">= 0.5.0"
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/package.json b/node_modules/anvil.js/node_modules/ape/node_modules/walk/package.json
new file mode 100644
index 0000000..8d2efdc
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/package.json
@@ -0,0 +1,24 @@
+{
+ "name" : "walk",
+ "description" : "A node port of python's os.walk",
+ "url" : "github.com/coolaj86/node-walk",
+ "keywords" : ["util", "os", "sys", "fs", "walk", "walkSync"],
+ "author" : "AJ ONeal ",
+ "contributors" : [],
+ "dependencies" : {
+ "forEachAsync": "~2.2"
+ },
+ "lib" : ".",
+ "main" : "./walk.js",
+ "version" : "2.2.1",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://www.opensource.org/licenses/mit-license.php"
+ },
+ {
+ "type": "Apache2",
+ "url": "http://opensource.org/licenses/apache2.0.php"
+ }
+ ]
+}
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/walk-async-only.js b/node_modules/anvil.js/node_modules/ape/node_modules/walk/walk-async-only.js
new file mode 100644
index 0000000..5f58826
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/walk-async-only.js
@@ -0,0 +1,93 @@
+(function () {
+ "use strict"
+
+ // Array.prototype.forEachAsync(next, item, i, collection)
+
+ function noop() {}
+
+ var fs = require('fs')
+ , forEachAsync = require('forEachAsync')
+ , EventEmitter = require('events').EventEmitter
+ , TypeEmitter = require('./node-type-emitter')
+ ;
+
+ // 2010-11-25 jorge@jorgechamorro.com
+ function create(pathname, cb) {
+ var emitter = new EventEmitter(),
+ q = [],
+ queue = [q],
+ curpath;
+
+ function walk() {
+ fs.readdir(curpath, function(err, files) {
+ if (err) {
+ emitter.emit('directoryError', curpath, { error: err }, noop);
+ //emitter.emit('error', curpath, { error: err });
+ }
+ // XXX bug was here. next() was omitted
+ if (!files || 0 == files.length) {
+ return next();
+ }
+
+ var fnodeGroups = TypeEmitter.createNodeGroups();
+
+ // TODO could allow user to selectively stat
+ // and don't stat if there are no stat listeners
+ emitter.emit('names', curpath, files, noop);
+ forEachAsync(files, function (cont, file) {
+ emitter.emit('name', curpath, file, noop);
+ fs.lstat(curpath + '/' + file, function (err, stat) {
+ stat = stat || {};
+ stat.name = file;
+ if (err) {
+ stat.error = err;
+ //emitter.emit('error', curpath, stat);
+ emitter.emit('nodeError', curpath, stat, noop);
+ fnodeGroups.errors.push(stat);
+ cont();
+ } else {
+ TypeEmitter.sortFnodesByType(stat, fnodeGroups);
+ TypeEmitter.emitNodeType(emitter, curpath, stat, cont);
+ }
+ });
+ }).then(function () {
+ if (fnodeGroups.errors.length) {
+ emitter.emit('errors', curpath, fnodeGroups.errors, noop);
+ }
+ TypeEmitter.emitNodeTypeGroups(emitter, curpath, fnodeGroups, function () {
+ var dirs = [];
+ fnodeGroups.directories.forEach(function (stat) {
+ dirs.push(stat.name);
+ });
+ dirs.forEach(fullPath);
+ queue.push(q = dirs);
+ next();
+ });
+ });
+ });
+ }
+
+ function next() {
+ if (q.length) {
+ curpath = q.pop();
+ return walk();
+ }
+ if (queue.length -= 1) {
+ q = queue[queue.length-1];
+ return next();
+ }
+ emitter.emit('end');
+ }
+
+ function fullPath(v,i,o) {
+ o[i]= [curpath, '/', v].join('');
+ }
+
+ curpath = pathname;
+ walk();
+
+ return emitter;
+ }
+
+ module.exports = create;
+}());
diff --git a/node_modules/anvil.js/node_modules/ape/node_modules/walk/walk.js b/node_modules/anvil.js/node_modules/ape/node_modules/walk/walk.js
new file mode 100644
index 0000000..5209198
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/node_modules/walk/walk.js
@@ -0,0 +1,235 @@
+/*jshint strict:true node:true es5:true onevar:true laxcomma:true laxbreak:true*/
+// Adapted from work by jorge@jorgechamorro.com on 2010-11-25
+(function () {
+ "use strict";
+
+ // Array.prototype.forEachAsync(next, item, i, collection)
+ //require('Array.prototype.forEachAsync');
+
+ function noop() {}
+
+ var fs = require('fs')
+ , forEachAsync = require('forEachAsync')
+ , EventEmitter = require('events').EventEmitter
+ , TypeEmitter = require('./node-type-emitter')
+ , util = require('util')
+ ;
+
+ function appendToDirs(stat) {
+ /*jshint validthis:true*/
+ this.push(stat.name);
+ }
+
+ function wFilesHandlerWrapper(items) {
+ /*jshint validthis:true*/
+ this._wFilesHandler(noop, items);
+ }
+
+ function Walker(pathname, options, sync) {
+ EventEmitter.call(this);
+
+ var me = this
+ ;
+
+ me._wsync = sync;
+ me._wq = [];
+ me._wqueue = [me._wq];
+ me._wcurpath = undefined;
+ me._wfirstrun = true;
+ me._wcurpath = pathname;
+
+ if (me._wsync) {
+ me._wWalk = me._wWalkSync;
+ } else {
+ me._wWalk = me._wWalkAsync;
+ }
+
+ // TODO just one little anony won't hurt...
+ process.nextTick(function () {
+ me._wWalk();
+ });
+ }
+
+ // Inherits must come before prototype additions
+ util.inherits(Walker, EventEmitter);
+
+ Walker.prototype._wLstatHandler = function (err, stat) {
+ var me = this
+ ;
+
+ stat = stat || {};
+ stat.name = me._wcurfile;
+
+ if (err) {
+ stat.error = err;
+ //me.emit('error', curpath, stat);
+ me.emit('nodeError', me._wcurpath, stat, noop);
+ me._wfnodegroups.errors.push(stat);
+ me._wCurFileCallback();
+ } else {
+ TypeEmitter.sortFnodesByType(stat, me._wfnodegroups);
+ // NOTE: wCurFileCallback doesn't need thisness, so this is okay
+ TypeEmitter.emitNodeType(me, me._wcurpath, stat, me._wCurFileCallback, me);
+ }
+ };
+ Walker.prototype._wFilesHandler = function (cont, file) {
+ var statPath
+ , me = this
+ ;
+
+
+ me._wcurfile = file;
+ me._wCurFileCallback = cont;
+ me.emit('name', me._wcurpath, file, noop);
+
+ statPath = me._wcurpath + '/' + file;
+
+ if (!me._wsync) {
+ // TODO how to remove this anony?
+ fs.lstat(statPath, function (err, stat) {
+ me._wLstatHandler(err, stat);
+ });
+ return;
+ }
+
+ try {
+ me._wLstatHandler(null, fs.lstatSync(statPath));
+ } catch(e) {
+ me._wLstatHandler(e);
+ }
+ };
+ Walker.prototype._wOnEmitDone = function () {
+ var me = this
+ , dirs = []
+ ;
+
+ me._wfnodegroups.directories.forEach(appendToDirs, dirs);
+ dirs.forEach(me._wJoinPath, me);
+ me._wqueue.push(me._wq = dirs);
+ me._wNext();
+ };
+ Walker.prototype._wPostFilesHandler = function () {
+ var me = this
+ ;
+
+ if (me._wfnodegroups.errors.length) {
+ me.emit('errors', me._wcurpath, me._wfnodegroups.errors, noop);
+ }
+ // XXX emitNodeTypes still needs refactor
+ TypeEmitter.emitNodeTypeGroups(me, me._wcurpath, me._wfnodegroups, me._wOnEmitDone, me);
+ };
+ Walker.prototype._wReadFiles = function () {
+ var me = this
+ ;
+
+ if (!me._wcurfiles || 0 === me._wcurfiles.length) {
+ return me._wNext();
+ }
+
+ // TODO could allow user to selectively stat
+ // and don't stat if there are no stat listeners
+ me.emit('names', me._wcurpath, me._wcurfiles, noop);
+
+ if (me._wsync) {
+ me._wcurfiles.forEach(wFilesHandlerWrapper, me);
+ me._wPostFilesHandler();
+ } else {
+ forEachAsync(me._wcurfiles, me._wFilesHandler, me).then(me._wPostFilesHandler);
+ }
+ };
+ Walker.prototype._wReaddirHandler = function (err, files) {
+ var fnodeGroups = TypeEmitter.createNodeGroups()
+ , me = this
+ ;
+
+ me._wfnodegroups = fnodeGroups;
+ me._wcurfiles = files;
+
+
+ if (!err) {
+ me._wReadFiles();
+ return;
+ }
+
+ if (!me._wfirstrun) {
+ me.emit('directoryError', me._wcurpath, { error: err }, noop);
+ me._wReadFiles();
+ return;
+ }
+
+ me._wfirstrun = false;
+ // TODO how to remove this anony?
+ fs.lstat(me._wcurpath, function (e, stat) {
+
+ if (stat) {
+ files = [me._wcurpath.replace(/.*\//, '')];
+ me._wcurpath = me._wcurpath.replace(files[0], '');
+ }
+
+ me._wReadFiles();
+ });
+ };
+ Walker.prototype._wWalkSync = function () {
+ var err
+ , files
+ , me = this
+ ;
+
+ try {
+ files = fs.readdirSync(me._wcurpath);
+ } catch(e) {
+ err = e;
+ }
+
+ me._wReaddirHandler(err, files);
+ };
+ Walker.prototype._wWalkAsync = function () {
+ var me = this
+ ;
+
+ // TODO how to remove this anony?
+ fs.readdir(me._wcurpath, function (err, files) {
+ me._wReaddirHandler(err, files);
+ });
+ };
+ Walker.prototype._wNext = function () {
+ var me = this
+ ;
+
+ if (me._paused) {
+ return;
+ }
+ if (me._wq.length) {
+ me._wcurpath = me._wq.pop();
+ me._wWalk();
+ return;
+ }
+ me._wqueue.length -= 1;
+ if (me._wqueue.length) {
+ me._wq = me._wqueue[me._wqueue.length - 1];
+ return this._wNext();
+ }
+ me.emit('end');
+ };
+ Walker.prototype._wJoinPath = function (v, i, o) {
+ var me = this
+ ;
+
+ o[i] = [me._wcurpath, '/', v].join('');
+ };
+ Walker.prototype.pause = function () {
+ this._paused = true;
+ };
+ Walker.prototype.resume = function () {
+ this._paused = false;
+ this._wNext();
+ };
+
+ exports.walk = function (path, opts) {
+ return new Walker(path, opts, false);
+ };
+
+ exports.walkSync = function (path, opts) {
+ return new Walker(path, opts, true);
+ };
+}());
diff --git a/node_modules/anvil.js/node_modules/ape/package.json b/node_modules/anvil.js/node_modules/ape/package.json
new file mode 100644
index 0000000..2f8dafe
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/ape/package.json
@@ -0,0 +1,19 @@
+{
+ "name": "ape",
+ "description": "API documentation generator with github-flavored-markdown output",
+ "author": "Nathan LaFreniere",
+ "version": "0.3.6",
+ "main": "./lib/ape.js",
+ "bin": {
+ "ape": "./bin/ape"
+ },
+ "repository": "git://github.com/nathan-lafreniere/ape.git",
+ "dependencies": {
+ "async": "",
+ "walk": "",
+ "ghm": "",
+ "jade": "",
+ "hljs": ">= 6.1.3",
+ "optimist": ""
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/coffee-script/.npmignore b/node_modules/anvil.js/node_modules/coffee-script/.npmignore
new file mode 100644
index 0000000..21e430d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/.npmignore
@@ -0,0 +1,11 @@
+*.coffee
+*.html
+.DS_Store
+.git*
+Cakefile
+documentation/
+examples/
+extras/coffee-script.js
+raw/
+src/
+test/
diff --git a/node_modules/anvil.js/node_modules/coffee-script/LICENSE b/node_modules/anvil.js/node_modules/coffee-script/LICENSE
new file mode 100644
index 0000000..8cb3cfd
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2011 Jeremy Ashkenas
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffee-script/README b/node_modules/anvil.js/node_modules/coffee-script/README
new file mode 100644
index 0000000..08f17df
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/README
@@ -0,0 +1,48 @@
+=
+ {
+ } } {
+ { { } }
+ } }{ {
+ { }{ } } _____ __ __
+ ( }{ }{ { ) / ____| / _|/ _|
+ .- { { } { }} -. | | ___ | |_| |_ ___ ___
+ ( ( } { } { } } ) | | / _ \| _| _/ _ \/ _ \
+ |`-..________ ..-'| | |___| (_) | | | || __/ __/
+ | | \_____\___/|_| |_| \___|\___|
+ | ;--.
+ | (__ \ _____ _ _
+ | | ) ) / ____| (_) | |
+ | |/ / | (___ ___ _ __ _ _ __ | |_
+ | ( / \___ \ / __| '__| | '_ \| __|
+ | |/ ____) | (__| | | | |_) | |_
+ | | |_____/ \___|_| |_| .__/ \__|
+ `-.._________..-' | |
+ |_|
+
+
+ CoffeeScript is a little language that compiles into JavaScript.
+
+ Install Node.js, and then the CoffeeScript compiler:
+ sudo bin/cake install
+
+ Or, if you have the Node Package Manager installed:
+ npm install -g coffee-script
+ (Leave off the -g if you don't wish to install globally.)
+
+ Compile a script:
+ coffee /path/to/script.coffee
+
+ For documentation, usage, and examples, see:
+ http://coffeescript.org/
+
+ To suggest a feature, report a bug, or general discussion:
+ http://github.com/jashkenas/coffee-script/issues/
+
+ If you'd like to chat, drop by #coffeescript on Freenode IRC,
+ or on webchat.freenode.net.
+
+ The source repository:
+ git://github.com/jashkenas/coffee-script.git
+
+ All contributors are listed here:
+ http://github.com/jashkenas/coffee-script/contributors
diff --git a/node_modules/anvil.js/node_modules/coffee-script/Rakefile b/node_modules/anvil.js/node_modules/coffee-script/Rakefile
new file mode 100644
index 0000000..dfb85da
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/Rakefile
@@ -0,0 +1,78 @@
+require 'rubygems'
+require 'erb'
+require 'fileutils'
+require 'rake/testtask'
+require 'json'
+
+desc "Build the documentation page"
+task :doc do
+ source = 'documentation/index.html.erb'
+ child = fork { exec "bin/coffee -bcw -o documentation/js documentation/coffee/*.coffee" }
+ at_exit { Process.kill("INT", child) }
+ Signal.trap("INT") { exit }
+ loop do
+ mtime = File.stat(source).mtime
+ if !@mtime || mtime > @mtime
+ rendered = ERB.new(File.read(source)).result(binding)
+ File.open('index.html', 'w+') {|f| f.write(rendered) }
+ end
+ @mtime = mtime
+ sleep 1
+ end
+end
+
+desc "Build coffee-script-source gem"
+task :gem do
+ require 'rubygems'
+ require 'rubygems/package'
+
+ gemspec = Gem::Specification.new do |s|
+ s.name = 'coffee-script-source'
+ s.version = JSON.parse(File.read('package.json'))["version"]
+ s.date = Time.now.strftime("%Y-%m-%d")
+
+ s.homepage = "http://jashkenas.github.com/coffee-script/"
+ s.summary = "The CoffeeScript Compiler"
+ s.description = <<-EOS
+ CoffeeScript is a little language that compiles into JavaScript.
+ Underneath all of those embarrassing braces and semicolons,
+ JavaScript has always had a gorgeous object model at its heart.
+ CoffeeScript is an attempt to expose the good parts of JavaScript
+ in a simple way.
+ EOS
+
+ s.files = [
+ 'lib/coffee_script/coffee-script.js',
+ 'lib/coffee_script/source.rb'
+ ]
+
+ s.authors = ['Jeremy Ashkenas']
+ s.email = 'jashkenas@gmail.com'
+ s.rubyforge_project = 'coffee-script-source'
+ end
+
+ file = File.open("coffee-script-source.gem", "w")
+ Gem::Package.open(file, 'w') do |pkg|
+ pkg.metadata = gemspec.to_yaml
+
+ path = "lib/coffee_script/source.rb"
+ contents = <<-ERUBY
+module CoffeeScript
+ module Source
+ def self.bundled_path
+ File.expand_path("../coffee-script.js", __FILE__)
+ end
+ end
+end
+ ERUBY
+ pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
+ tar_io.write(contents)
+ end
+
+ contents = File.read("extras/coffee-script.js")
+ path = "lib/coffee_script/coffee-script.js"
+ pkg.add_file_simple(path, 0644, contents.size) do |tar_io|
+ tar_io.write(contents)
+ end
+ end
+end
diff --git a/node_modules/anvil.js/node_modules/coffee-script/extras/jsl.conf b/node_modules/anvil.js/node_modules/coffee-script/extras/jsl.conf
new file mode 100644
index 0000000..1190da5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/extras/jsl.conf
@@ -0,0 +1,44 @@
+# JavaScriptLint configuration file for CoffeeScript.
+
++no_return_value # function {0} does not always return a value
++duplicate_formal # duplicate formal argument {0}
+-equal_as_assign # test for equality (==) mistyped as assignment (=)?{0}
++var_hides_arg # variable {0} hides argument
++redeclared_var # redeclaration of {0} {1}
+-anon_no_return_value # anonymous function does not always return a value
++missing_semicolon # missing semicolon
++meaningless_block # meaningless block; curly braces have no impact
+-comma_separated_stmts # multiple statements separated by commas (use semicolons?)
++unreachable_code # unreachable code
++missing_break # missing break statement
+-missing_break_for_last_case # missing break statement for last case in switch
+-comparison_type_conv # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
+-inc_dec_within_stmt # increment (++) and decrement (--) operators used as part of greater statement
+-useless_void # use of the void type may be unnecessary (void is always undefined)
++multiple_plus_minus # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
++use_of_label # use of label
+-block_without_braces # block statement without curly braces
++leading_decimal_point # leading decimal point may indicate a number or an object member
++trailing_decimal_point # trailing decimal point may indicate a number or an object member
++octal_number # leading zeros make an octal number
++nested_comment # nested comment
++misplaced_regex # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
++ambiguous_newline # unexpected end of line; it is ambiguous whether these lines are part of the same statement
++empty_statement # empty statement or extra semicolon
+-missing_option_explicit # the "option explicit" control comment is missing
++partial_option_explicit # the "option explicit" control comment, if used, must be in the first script tag
++dup_option_explicit # duplicate "option explicit" control comment
++useless_assign # useless assignment
++ambiguous_nested_stmt # block statements containing block statements should use curly braces to resolve ambiguity
++ambiguous_else_stmt # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
+-missing_default_case # missing default case in switch statement
++duplicate_case_in_switch # duplicate case in switch statements
++default_not_at_end # the default case is not at the end of the switch statement
++legacy_cc_not_understood # couldn't understand control comment using /*@keyword@*/ syntax
++jsl_cc_not_understood # couldn't understand control comment using /*jsl:keyword*/ syntax
++useless_comparison # useless comparison; comparing identical expressions
++with_statement # with statement hides undeclared variables; use temporary variable instead
++trailing_comma_in_array # extra comma is not recommended in array initializers
++assign_to_function_call # assignment to a function call
++parseint_missing_radix # parseInt missing radix parameter
++lambda_assign_requires_semicolon
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/browser.js b/node_modules/anvil.js/node_modules/coffee-script/lib/browser.js
new file mode 100644
index 0000000..2fb7b2e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/browser.js
@@ -0,0 +1,75 @@
+(function() {
+ var CoffeeScript, runScripts;
+ CoffeeScript = require('./coffee-script');
+ CoffeeScript.require = require;
+ CoffeeScript.eval = function(code, options) {
+ return eval(CoffeeScript.compile(code, options));
+ };
+ CoffeeScript.run = function(code, options) {
+ if (options == null) {
+ options = {};
+ }
+ options.bare = true;
+ return Function(CoffeeScript.compile(code, options))();
+ };
+ if (typeof window === "undefined" || window === null) {
+ return;
+ }
+ CoffeeScript.load = function(url, callback) {
+ var xhr;
+ xhr = new (window.ActiveXObject || XMLHttpRequest)('Microsoft.XMLHTTP');
+ xhr.open('GET', url, true);
+ if ('overrideMimeType' in xhr) {
+ xhr.overrideMimeType('text/plain');
+ }
+ xhr.onreadystatechange = function() {
+ var _ref;
+ if (xhr.readyState === 4) {
+ if ((_ref = xhr.status) === 0 || _ref === 200) {
+ CoffeeScript.run(xhr.responseText);
+ } else {
+ throw new Error("Could not load " + url);
+ }
+ if (callback) {
+ return callback();
+ }
+ }
+ };
+ return xhr.send(null);
+ };
+ runScripts = function() {
+ var coffees, execute, index, length, s, scripts;
+ scripts = document.getElementsByTagName('script');
+ coffees = (function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = scripts.length; _i < _len; _i++) {
+ s = scripts[_i];
+ if (s.type === 'text/coffeescript') {
+ _results.push(s);
+ }
+ }
+ return _results;
+ })();
+ index = 0;
+ length = coffees.length;
+ (execute = function() {
+ var script;
+ script = coffees[index++];
+ if ((script != null ? script.type : void 0) === 'text/coffeescript') {
+ if (script.src) {
+ return CoffeeScript.load(script.src, execute);
+ } else {
+ CoffeeScript.run(script.innerHTML);
+ return execute();
+ }
+ }
+ })();
+ return null;
+ };
+ if (window.addEventListener) {
+ addEventListener('DOMContentLoaded', runScripts, false);
+ } else {
+ attachEvent('onload', runScripts);
+ }
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/cake.js b/node_modules/anvil.js/node_modules/coffee-script/lib/cake.js
new file mode 100755
index 0000000..6619934
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/cake.js
@@ -0,0 +1,76 @@
+(function() {
+ var CoffeeScript, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
+ fs = require('fs');
+ path = require('path');
+ helpers = require('./helpers');
+ optparse = require('./optparse');
+ CoffeeScript = require('./coffee-script');
+ tasks = {};
+ options = {};
+ switches = [];
+ oparse = null;
+ helpers.extend(global, {
+ task: function(name, description, action) {
+ var _ref;
+ if (!action) {
+ _ref = [description, action], action = _ref[0], description = _ref[1];
+ }
+ return tasks[name] = {
+ name: name,
+ description: description,
+ action: action
+ };
+ },
+ option: function(letter, flag, description) {
+ return switches.push([letter, flag, description]);
+ },
+ invoke: function(name) {
+ if (!tasks[name]) {
+ missingTask(name);
+ }
+ return tasks[name].action(options);
+ }
+ });
+ exports.run = function() {
+ return path.exists('Cakefile', function(exists) {
+ var arg, args, _i, _len, _ref, _results;
+ if (!exists) {
+ throw new Error("Cakefile not found in " + (process.cwd()));
+ }
+ args = process.argv.slice(2);
+ CoffeeScript.run(fs.readFileSync('Cakefile').toString(), {
+ filename: 'Cakefile'
+ });
+ oparse = new optparse.OptionParser(switches);
+ if (!args.length) {
+ return printTasks();
+ }
+ options = oparse.parse(args);
+ _ref = options.arguments;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ arg = _ref[_i];
+ _results.push(invoke(arg));
+ }
+ return _results;
+ });
+ };
+ printTasks = function() {
+ var desc, name, spaces, task;
+ console.log('');
+ for (name in tasks) {
+ task = tasks[name];
+ spaces = 20 - name.length;
+ spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
+ desc = task.description ? "# " + task.description : '';
+ console.log("cake " + name + spaces + " " + desc);
+ }
+ if (switches.length) {
+ return console.log(oparse.help());
+ }
+ };
+ missingTask = function(task) {
+ console.log("No such task: \"" + task + "\"");
+ return process.exit(1);
+ };
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/coffee-script.js b/node_modules/anvil.js/node_modules/coffee-script/lib/coffee-script.js
new file mode 100755
index 0000000..2871279
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/coffee-script.js
@@ -0,0 +1,135 @@
+(function() {
+ var Lexer, RESERVED, compile, fs, lexer, parser, path, _ref;
+ var __hasProp = Object.prototype.hasOwnProperty;
+ fs = require('fs');
+ path = require('path');
+ _ref = require('./lexer'), Lexer = _ref.Lexer, RESERVED = _ref.RESERVED;
+ parser = require('./parser').parser;
+ if (require.extensions) {
+ require.extensions['.coffee'] = function(module, filename) {
+ var content;
+ content = compile(fs.readFileSync(filename, 'utf8'), {
+ filename: filename
+ });
+ return module._compile(content, filename);
+ };
+ } else if (require.registerExtension) {
+ require.registerExtension('.coffee', function(content) {
+ return compile(content);
+ });
+ }
+ exports.VERSION = '1.1.2';
+ exports.RESERVED = RESERVED;
+ exports.helpers = require('./helpers');
+ exports.compile = compile = function(code, options) {
+ if (options == null) {
+ options = {};
+ }
+ try {
+ return (parser.parse(lexer.tokenize(code))).compile(options);
+ } catch (err) {
+ if (options.filename) {
+ err.message = "In " + options.filename + ", " + err.message;
+ }
+ throw err;
+ }
+ };
+ exports.tokens = function(code, options) {
+ return lexer.tokenize(code, options);
+ };
+ exports.nodes = function(source, options) {
+ if (typeof source === 'string') {
+ return parser.parse(lexer.tokenize(source, options));
+ } else {
+ return parser.parse(source);
+ }
+ };
+ exports.run = function(code, options) {
+ var Module, mainModule;
+ mainModule = require.main;
+ mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
+ mainModule.moduleCache && (mainModule.moduleCache = {});
+ if (process.binding('natives').module) {
+ Module = require('module').Module;
+ mainModule.paths = Module._nodeModulePaths(path.dirname(options.filename));
+ }
+ if (path.extname(mainModule.filename) !== '.coffee' || require.extensions) {
+ return mainModule._compile(compile(code, options), mainModule.filename);
+ } else {
+ return mainModule._compile(code, mainModule.filename);
+ }
+ };
+ exports.eval = function(code, options) {
+ var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref2, _ref3, _ref4, _require;
+ if (options == null) {
+ options = {};
+ }
+ if (!(code = code.trim())) {
+ return;
+ }
+ if (_ref2 = require('vm'), Script = _ref2.Script, _ref2) {
+ sandbox = Script.createContext();
+ sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox;
+ if (options.sandbox != null) {
+ if (options.sandbox instanceof sandbox.constructor) {
+ sandbox = options.sandbox;
+ } else {
+ _ref3 = options.sandbox;
+ for (k in _ref3) {
+ if (!__hasProp.call(_ref3, k)) continue;
+ v = _ref3[k];
+ sandbox[k] = v;
+ }
+ }
+ }
+ sandbox.__filename = options.filename || 'eval';
+ sandbox.__dirname = path.dirname(sandbox.__filename);
+ if (!(sandbox.module || sandbox.require)) {
+ Module = require('module');
+ sandbox.module = _module = new Module(options.modulename || 'eval');
+ sandbox.require = _require = function(path) {
+ return Module._load(path, _module);
+ };
+ _module.filename = sandbox.__filename;
+ _ref4 = Object.getOwnPropertyNames(require);
+ for (_i = 0, _len = _ref4.length; _i < _len; _i++) {
+ r = _ref4[_i];
+ _require[r] = require[r];
+ }
+ _require.paths = _module.paths = Module._nodeModulePaths(process.cwd());
+ _require.resolve = function(request) {
+ return Module._resolveFilename(request, _module);
+ };
+ }
+ }
+ o = {};
+ for (k in options) {
+ if (!__hasProp.call(options, k)) continue;
+ v = options[k];
+ o[k] = v;
+ }
+ o.bare = true;
+ js = compile(code, o);
+ if (Script) {
+ return Script.runInContext(js, sandbox);
+ } else {
+ return eval(js);
+ }
+ };
+ lexer = new Lexer;
+ parser.lexer = {
+ lex: function() {
+ var tag, _ref2;
+ _ref2 = this.tokens[this.pos++] || [''], tag = _ref2[0], this.yytext = _ref2[1], this.yylineno = _ref2[2];
+ return tag;
+ },
+ setInput: function(tokens) {
+ this.tokens = tokens;
+ return this.pos = 0;
+ },
+ upcomingInput: function() {
+ return "";
+ }
+ };
+ parser.yy = require('./nodes');
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/command.js b/node_modules/anvil.js/node_modules/coffee-script/lib/command.js
new file mode 100644
index 0000000..ca25502
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/command.js
@@ -0,0 +1,301 @@
+(function() {
+ var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compileScript, compileScripts, compileStdio, contents, exec, forkNode, fs, helpers, lint, loadRequires, optionParser, optparse, opts, parseOptions, path, printLine, printTokens, printWarn, sources, spawn, usage, version, watch, writeJs, _ref;
+ fs = require('fs');
+ path = require('path');
+ helpers = require('./helpers');
+ optparse = require('./optparse');
+ CoffeeScript = require('./coffee-script');
+ _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec;
+ EventEmitter = require('events').EventEmitter;
+ helpers.extend(CoffeeScript, new EventEmitter);
+ printLine = function(line) {
+ return process.stdout.write(line + '\n');
+ };
+ printWarn = function(line) {
+ return process.binding('stdio').writeError(line + '\n');
+ };
+ BANNER = 'Usage: coffee [options] path/to/script.coffee';
+ SWITCHES = [['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-o', '--output [DIR]', 'set the directory for compiled JavaScript'], ['-j', '--join [FILE]', 'concatenate the scripts before compiling'], ['-w', '--watch', 'watch scripts for changes, and recompile'], ['-p', '--print', 'print the compiled JavaScript to stdout'], ['-l', '--lint', 'pipe the compiled JavaScript through JavaScript Lint'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-e', '--eval', 'compile a string from the command line'], ['-r', '--require [FILE*]', 'require a library before executing your script'], ['-b', '--bare', 'compile without the top-level function wrapper'], ['-t', '--tokens', 'print the tokens that the lexer produces'], ['-n', '--nodes', 'print the parse tree that Jison produces'], ['--nodejs [ARGS]', 'pass options through to the "node" binary'], ['-v', '--version', 'display CoffeeScript version'], ['-h', '--help', 'display this help message']];
+ opts = {};
+ sources = [];
+ contents = [];
+ optionParser = null;
+ exports.run = function() {
+ parseOptions();
+ if (opts.nodejs) {
+ return forkNode();
+ }
+ if (opts.help) {
+ return usage();
+ }
+ if (opts.version) {
+ return version();
+ }
+ if (opts.require) {
+ loadRequires();
+ }
+ if (opts.interactive) {
+ return require('./repl');
+ }
+ if (opts.stdio) {
+ return compileStdio();
+ }
+ if (opts.eval) {
+ return compileScript(null, sources[0]);
+ }
+ if (!sources.length) {
+ return require('./repl');
+ }
+ if (opts.run) {
+ opts.literals = sources.splice(1).concat(opts.literals);
+ }
+ process.ARGV = process.argv = process.argv.slice(0, 2).concat(opts.literals);
+ process.argv[0] = 'coffee';
+ process.execPath = require.main.filename;
+ return compileScripts();
+ };
+ compileScripts = function() {
+ var base, compile, source, unprocessed, _i, _j, _len, _len2, _results;
+ unprocessed = [];
+ for (_i = 0, _len = sources.length; _i < _len; _i++) {
+ source = sources[_i];
+ unprocessed[sources.indexOf(source)] = 1;
+ }
+ _results = [];
+ for (_j = 0, _len2 = sources.length; _j < _len2; _j++) {
+ source = sources[_j];
+ base = path.join(source);
+ compile = function(source, sourceIndex, topLevel) {
+ var remaining_files;
+ remaining_files = function() {
+ var total, x, _k, _len3;
+ total = 0;
+ for (_k = 0, _len3 = unprocessed.length; _k < _len3; _k++) {
+ x = unprocessed[_k];
+ total += x;
+ }
+ return total;
+ };
+ return path.exists(source, function(exists) {
+ if (topLevel && !exists && source.slice(-7) !== '.coffee') {
+ return compile("" + source + ".coffee", sourceIndex, topLevel);
+ }
+ if (topLevel && !exists) {
+ throw new Error("File not found: " + source);
+ }
+ return fs.stat(source, function(err, stats) {
+ if (err) {
+ throw err;
+ }
+ if (stats.isDirectory()) {
+ return fs.readdir(source, function(err, files) {
+ var file, _k, _len3;
+ if (err) {
+ throw err;
+ }
+ unprocessed[sourceIndex] += files.length;
+ for (_k = 0, _len3 = files.length; _k < _len3; _k++) {
+ file = files[_k];
+ compile(path.join(source, file), sourceIndex);
+ }
+ return unprocessed[sourceIndex] -= 1;
+ });
+ } else if (topLevel || path.extname(source) === '.coffee') {
+ fs.readFile(source, function(err, code) {
+ if (err) {
+ throw err;
+ }
+ unprocessed[sourceIndex] -= 1;
+ if (opts.join) {
+ contents[sourceIndex] = helpers.compact([contents[sourceIndex], code.toString()]).join('\n');
+ if (helpers.compact(contents).length > 0 && remaining_files() === 0) {
+ return compileJoin();
+ }
+ } else {
+ return compileScript(source, code.toString(), base);
+ }
+ });
+ if (opts.watch && !opts.join) {
+ return watch(source, base);
+ }
+ } else {
+ return unprocessed[sourceIndex] -= 1;
+ }
+ });
+ });
+ };
+ _results.push(compile(source, sources.indexOf(source), true));
+ }
+ return _results;
+ };
+ compileScript = function(file, input, base) {
+ var o, options, t, task;
+ o = opts;
+ options = compileOptions(file);
+ try {
+ t = task = {
+ file: file,
+ input: input,
+ options: options
+ };
+ CoffeeScript.emit('compile', task);
+ if (o.tokens) {
+ return printTokens(CoffeeScript.tokens(t.input));
+ } else if (o.nodes) {
+ return printLine(CoffeeScript.nodes(t.input).toString().trim());
+ } else if (o.run) {
+ return CoffeeScript.run(t.input, t.options);
+ } else {
+ t.output = CoffeeScript.compile(t.input, t.options);
+ CoffeeScript.emit('success', task);
+ if (o.print) {
+ return printLine(t.output.trim());
+ } else if (o.compile) {
+ return writeJs(t.file, t.output, base);
+ } else if (o.lint) {
+ return lint(t.file, t.output);
+ }
+ }
+ } catch (err) {
+ CoffeeScript.emit('failure', err, task);
+ if (CoffeeScript.listeners('failure').length) {
+ return;
+ }
+ if (o.watch) {
+ return printLine(err.message);
+ }
+ printWarn(err.stack);
+ return process.exit(1);
+ }
+ };
+ compileStdio = function() {
+ var code, stdin;
+ code = '';
+ stdin = process.openStdin();
+ stdin.on('data', function(buffer) {
+ if (buffer) {
+ return code += buffer.toString();
+ }
+ });
+ return stdin.on('end', function() {
+ return compileScript(null, code);
+ });
+ };
+ compileJoin = function() {
+ var code;
+ code = contents.join('\n');
+ return compileScript(opts.join, code, opts.join);
+ };
+ loadRequires = function() {
+ var realFilename, req, _i, _len, _ref2;
+ realFilename = module.filename;
+ module.filename = '.';
+ _ref2 = opts.require;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ req = _ref2[_i];
+ require(req);
+ }
+ return module.filename = realFilename;
+ };
+ watch = function(source, base) {
+ return fs.watchFile(source, {
+ persistent: true,
+ interval: 500
+ }, function(curr, prev) {
+ if (curr.size === prev.size && curr.mtime.getTime() === prev.mtime.getTime()) {
+ return;
+ }
+ return fs.readFile(source, function(err, code) {
+ if (err) {
+ throw err;
+ }
+ return compileScript(source, code.toString(), base);
+ });
+ });
+ };
+ writeJs = function(source, js, base) {
+ var baseDir, compile, dir, filename, jsPath, srcDir;
+ filename = path.basename(source, path.extname(source)) + '.js';
+ srcDir = path.dirname(source);
+ baseDir = base === '.' ? srcDir : srcDir.substring(base.length);
+ dir = opts.output ? path.join(opts.output, baseDir) : srcDir;
+ jsPath = path.join(dir, filename);
+ compile = function() {
+ if (js.length <= 0) {
+ js = ' ';
+ }
+ return fs.writeFile(jsPath, js, function(err) {
+ if (err) {
+ return printLine(err.message);
+ } else if (opts.compile && opts.watch) {
+ return console.log("" + ((new Date).toLocaleTimeString()) + " - compiled " + source);
+ }
+ });
+ };
+ return path.exists(dir, function(exists) {
+ if (exists) {
+ return compile();
+ } else {
+ return exec("mkdir -p " + dir, compile);
+ }
+ });
+ };
+ lint = function(file, js) {
+ var conf, jsl, printIt;
+ printIt = function(buffer) {
+ return printLine(file + ':\t' + buffer.toString().trim());
+ };
+ conf = __dirname + '/../extras/jsl.conf';
+ jsl = spawn('jsl', ['-nologo', '-stdin', '-conf', conf]);
+ jsl.stdout.on('data', printIt);
+ jsl.stderr.on('data', printIt);
+ jsl.stdin.write(js);
+ return jsl.stdin.end();
+ };
+ printTokens = function(tokens) {
+ var strings, tag, token, value;
+ strings = (function() {
+ var _i, _len, _ref2, _results;
+ _results = [];
+ for (_i = 0, _len = tokens.length; _i < _len; _i++) {
+ token = tokens[_i];
+ _ref2 = [token[0], token[1].toString().replace(/\n/, '\\n')], tag = _ref2[0], value = _ref2[1];
+ _results.push("[" + tag + " " + value + "]");
+ }
+ return _results;
+ })();
+ return printLine(strings.join(' '));
+ };
+ parseOptions = function() {
+ var o;
+ optionParser = new optparse.OptionParser(SWITCHES, BANNER);
+ o = opts = optionParser.parse(process.argv.slice(2));
+ o.compile || (o.compile = !!o.output);
+ o.run = !(o.compile || o.print || o.lint);
+ o.print = !!(o.print || (o.eval || o.stdio && o.compile));
+ return sources = o.arguments;
+ };
+ compileOptions = function(filename) {
+ return {
+ filename: filename,
+ bare: opts.bare
+ };
+ };
+ forkNode = function() {
+ var args, nodeArgs;
+ nodeArgs = opts.nodejs.split(/\s+/);
+ args = process.argv.slice(1);
+ args.splice(args.indexOf('--nodejs'), 2);
+ return spawn(process.execPath, nodeArgs.concat(args), {
+ cwd: process.cwd(),
+ env: process.env,
+ customFds: [0, 1, 2]
+ });
+ };
+ usage = function() {
+ return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help());
+ };
+ version = function() {
+ return printLine("CoffeeScript version " + CoffeeScript.VERSION);
+ };
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/grammar.js b/node_modules/anvil.js/node_modules/coffee-script/lib/grammar.js
new file mode 100644
index 0000000..e0bc41f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/grammar.js
@@ -0,0 +1,591 @@
+(function() {
+ var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
+ Parser = require('jison').Parser;
+ unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/;
+ o = function(patternString, action, options) {
+ var match;
+ patternString = patternString.replace(/\s{2,}/g, ' ');
+ if (!action) {
+ return [patternString, '$$ = $1;', options];
+ }
+ action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())";
+ action = action.replace(/\bnew /g, '$&yy.');
+ action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&');
+ return [patternString, "$$ = " + action + ";", options];
+ };
+ grammar = {
+ Root: [
+ o('', function() {
+ return new Block;
+ }), o('Body'), o('Block TERMINATOR')
+ ],
+ Body: [
+ o('Line', function() {
+ return Block.wrap([$1]);
+ }), o('Body TERMINATOR Line', function() {
+ return $1.push($3);
+ }), o('Body TERMINATOR')
+ ],
+ Line: [o('Expression'), o('Statement')],
+ Statement: [
+ o('Return'), o('Throw'), o('Comment'), o('STATEMENT', function() {
+ return new Literal($1);
+ })
+ ],
+ Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class')],
+ Block: [
+ o('INDENT OUTDENT', function() {
+ return new Block;
+ }), o('INDENT Body OUTDENT', function() {
+ return $2;
+ })
+ ],
+ Identifier: [
+ o('IDENTIFIER', function() {
+ return new Literal($1);
+ })
+ ],
+ AlphaNumeric: [
+ o('NUMBER', function() {
+ return new Literal($1);
+ }), o('STRING', function() {
+ return new Literal($1);
+ })
+ ],
+ Literal: [
+ o('AlphaNumeric'), o('JS', function() {
+ return new Literal($1);
+ }), o('REGEX', function() {
+ return new Literal($1);
+ }), o('BOOL', function() {
+ var val;
+ val = new Literal($1);
+ if ($1 === 'undefined') {
+ val.isUndefined = true;
+ }
+ return val;
+ })
+ ],
+ Assign: [
+ o('Assignable = Expression', function() {
+ return new Assign($1, $3);
+ }), o('Assignable = INDENT Expression OUTDENT', function() {
+ return new Assign($1, $4);
+ })
+ ],
+ AssignObj: [
+ o('ObjAssignable', function() {
+ return new Value($1);
+ }), o('ObjAssignable : Expression', function() {
+ return new Assign(new Value($1), $3, 'object');
+ }), o('ObjAssignable :\
+ INDENT Expression OUTDENT', function() {
+ return new Assign(new Value($1), $4, 'object');
+ }), o('Comment')
+ ],
+ ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')],
+ Return: [
+ o('RETURN Expression', function() {
+ return new Return($2);
+ }), o('RETURN', function() {
+ return new Return;
+ })
+ ],
+ Comment: [
+ o('HERECOMMENT', function() {
+ return new Comment($1);
+ })
+ ],
+ Code: [
+ o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() {
+ return new Code($2, $5, $4);
+ }), o('FuncGlyph Block', function() {
+ return new Code([], $2, $1);
+ })
+ ],
+ FuncGlyph: [
+ o('->', function() {
+ return 'func';
+ }), o('=>', function() {
+ return 'boundfunc';
+ })
+ ],
+ OptComma: [o(''), o(',')],
+ ParamList: [
+ o('', function() {
+ return [];
+ }), o('Param', function() {
+ return [$1];
+ }), o('ParamList , Param', function() {
+ return $1.concat($3);
+ })
+ ],
+ Param: [
+ o('ParamVar', function() {
+ return new Param($1);
+ }), o('ParamVar ...', function() {
+ return new Param($1, null, true);
+ }), o('ParamVar = Expression', function() {
+ return new Param($1, $3);
+ })
+ ],
+ ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')],
+ Splat: [
+ o('Expression ...', function() {
+ return new Splat($1);
+ })
+ ],
+ SimpleAssignable: [
+ o('Identifier', function() {
+ return new Value($1);
+ }), o('Value Accessor', function() {
+ return $1.push($2);
+ }), o('Invocation Accessor', function() {
+ return new Value($1, [$2]);
+ }), o('ThisProperty')
+ ],
+ Assignable: [
+ o('SimpleAssignable'), o('Array', function() {
+ return new Value($1);
+ }), o('Object', function() {
+ return new Value($1);
+ })
+ ],
+ Value: [
+ o('Assignable'), o('Literal', function() {
+ return new Value($1);
+ }), o('Parenthetical', function() {
+ return new Value($1);
+ }), o('Range', function() {
+ return new Value($1);
+ }), o('This')
+ ],
+ Accessor: [
+ o('. Identifier', function() {
+ return new Access($2);
+ }), o('?. Identifier', function() {
+ return new Access($2, 'soak');
+ }), o(':: Identifier', function() {
+ return new Access($2, 'proto');
+ }), o('::', function() {
+ return new Access(new Literal('prototype'));
+ }), o('Index')
+ ],
+ Index: [
+ o('INDEX_START IndexValue INDEX_END', function() {
+ return $2;
+ }), o('INDEX_SOAK Index', function() {
+ return extend($2, {
+ soak: true
+ });
+ }), o('INDEX_PROTO Index', function() {
+ return extend($2, {
+ proto: true
+ });
+ })
+ ],
+ IndexValue: [
+ o('Expression', function() {
+ return new Index($1);
+ }), o('Slice', function() {
+ return new Slice($1);
+ })
+ ],
+ Object: [
+ o('{ AssignList OptComma }', function() {
+ return new Obj($2, $1.generated);
+ })
+ ],
+ AssignList: [
+ o('', function() {
+ return [];
+ }), o('AssignObj', function() {
+ return [$1];
+ }), o('AssignList , AssignObj', function() {
+ return $1.concat($3);
+ }), o('AssignList OptComma TERMINATOR AssignObj', function() {
+ return $1.concat($4);
+ }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() {
+ return $1.concat($4);
+ })
+ ],
+ Class: [
+ o('CLASS', function() {
+ return new Class;
+ }), o('CLASS Block', function() {
+ return new Class(null, null, $2);
+ }), o('CLASS EXTENDS Value', function() {
+ return new Class(null, $3);
+ }), o('CLASS EXTENDS Value Block', function() {
+ return new Class(null, $3, $4);
+ }), o('CLASS SimpleAssignable', function() {
+ return new Class($2);
+ }), o('CLASS SimpleAssignable Block', function() {
+ return new Class($2, null, $3);
+ }), o('CLASS SimpleAssignable EXTENDS Value', function() {
+ return new Class($2, $4);
+ }), o('CLASS SimpleAssignable EXTENDS Value Block', function() {
+ return new Class($2, $4, $5);
+ })
+ ],
+ Invocation: [
+ o('Value OptFuncExist Arguments', function() {
+ return new Call($1, $3, $2);
+ }), o('Invocation OptFuncExist Arguments', function() {
+ return new Call($1, $3, $2);
+ }), o('SUPER', function() {
+ return new Call('super', [new Splat(new Literal('arguments'))]);
+ }), o('SUPER Arguments', function() {
+ return new Call('super', $2);
+ })
+ ],
+ OptFuncExist: [
+ o('', function() {
+ return false;
+ }), o('FUNC_EXIST', function() {
+ return true;
+ })
+ ],
+ Arguments: [
+ o('CALL_START CALL_END', function() {
+ return [];
+ }), o('CALL_START ArgList OptComma CALL_END', function() {
+ return $2;
+ })
+ ],
+ This: [
+ o('THIS', function() {
+ return new Value(new Literal('this'));
+ }), o('@', function() {
+ return new Value(new Literal('this'));
+ })
+ ],
+ ThisProperty: [
+ o('@ Identifier', function() {
+ return new Value(new Literal('this'), [new Access($2)], 'this');
+ })
+ ],
+ Array: [
+ o('[ ]', function() {
+ return new Arr([]);
+ }), o('[ ArgList OptComma ]', function() {
+ return new Arr($2);
+ })
+ ],
+ RangeDots: [
+ o('..', function() {
+ return 'inclusive';
+ }), o('...', function() {
+ return 'exclusive';
+ })
+ ],
+ Range: [
+ o('[ Expression RangeDots Expression ]', function() {
+ return new Range($2, $4, $3);
+ })
+ ],
+ Slice: [
+ o('Expression RangeDots Expression', function() {
+ return new Range($1, $3, $2);
+ }), o('Expression RangeDots', function() {
+ return new Range($1, null, $2);
+ }), o('RangeDots Expression', function() {
+ return new Range(null, $2, $1);
+ })
+ ],
+ ArgList: [
+ o('Arg', function() {
+ return [$1];
+ }), o('ArgList , Arg', function() {
+ return $1.concat($3);
+ }), o('ArgList OptComma TERMINATOR Arg', function() {
+ return $1.concat($4);
+ }), o('INDENT ArgList OptComma OUTDENT', function() {
+ return $2;
+ }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() {
+ return $1.concat($4);
+ })
+ ],
+ Arg: [o('Expression'), o('Splat')],
+ SimpleArgs: [
+ o('Expression'), o('SimpleArgs , Expression', function() {
+ return [].concat($1, $3);
+ })
+ ],
+ Try: [
+ o('TRY Block', function() {
+ return new Try($2);
+ }), o('TRY Block Catch', function() {
+ return new Try($2, $3[0], $3[1]);
+ }), o('TRY Block FINALLY Block', function() {
+ return new Try($2, null, null, $4);
+ }), o('TRY Block Catch FINALLY Block', function() {
+ return new Try($2, $3[0], $3[1], $5);
+ })
+ ],
+ Catch: [
+ o('CATCH Identifier Block', function() {
+ return [$2, $3];
+ })
+ ],
+ Throw: [
+ o('THROW Expression', function() {
+ return new Throw($2);
+ })
+ ],
+ Parenthetical: [
+ o('( Body )', function() {
+ return new Parens($2);
+ }), o('( INDENT Body OUTDENT )', function() {
+ return new Parens($3);
+ })
+ ],
+ WhileSource: [
+ o('WHILE Expression', function() {
+ return new While($2);
+ }), o('WHILE Expression WHEN Expression', function() {
+ return new While($2, {
+ guard: $4
+ });
+ }), o('UNTIL Expression', function() {
+ return new While($2, {
+ invert: true
+ });
+ }), o('UNTIL Expression WHEN Expression', function() {
+ return new While($2, {
+ invert: true,
+ guard: $4
+ });
+ })
+ ],
+ While: [
+ o('WhileSource Block', function() {
+ return $1.addBody($2);
+ }), o('Statement WhileSource', function() {
+ return $2.addBody(Block.wrap([$1]));
+ }), o('Expression WhileSource', function() {
+ return $2.addBody(Block.wrap([$1]));
+ }), o('Loop', function() {
+ return $1;
+ })
+ ],
+ Loop: [
+ o('LOOP Block', function() {
+ return new While(new Literal('true')).addBody($2);
+ }), o('LOOP Expression', function() {
+ return new While(new Literal('true')).addBody(Block.wrap([$2]));
+ })
+ ],
+ For: [
+ o('Statement ForBody', function() {
+ return new For($1, $2);
+ }), o('Expression ForBody', function() {
+ return new For($1, $2);
+ }), o('ForBody Block', function() {
+ return new For($2, $1);
+ })
+ ],
+ ForBody: [
+ o('FOR Range', function() {
+ return {
+ source: new Value($2)
+ };
+ }), o('ForStart ForSource', function() {
+ $2.own = $1.own;
+ $2.name = $1[0];
+ $2.index = $1[1];
+ return $2;
+ })
+ ],
+ ForStart: [
+ o('FOR ForVariables', function() {
+ return $2;
+ }), o('FOR OWN ForVariables', function() {
+ $3.own = true;
+ return $3;
+ })
+ ],
+ ForValue: [
+ o('Identifier'), o('Array', function() {
+ return new Value($1);
+ }), o('Object', function() {
+ return new Value($1);
+ })
+ ],
+ ForVariables: [
+ o('ForValue', function() {
+ return [$1];
+ }), o('ForValue , ForValue', function() {
+ return [$1, $3];
+ })
+ ],
+ ForSource: [
+ o('FORIN Expression', function() {
+ return {
+ source: $2
+ };
+ }), o('FOROF Expression', function() {
+ return {
+ source: $2,
+ object: true
+ };
+ }), o('FORIN Expression WHEN Expression', function() {
+ return {
+ source: $2,
+ guard: $4
+ };
+ }), o('FOROF Expression WHEN Expression', function() {
+ return {
+ source: $2,
+ guard: $4,
+ object: true
+ };
+ }), o('FORIN Expression BY Expression', function() {
+ return {
+ source: $2,
+ step: $4
+ };
+ }), o('FORIN Expression WHEN Expression BY Expression', function() {
+ return {
+ source: $2,
+ guard: $4,
+ step: $6
+ };
+ }), o('FORIN Expression BY Expression WHEN Expression', function() {
+ return {
+ source: $2,
+ step: $4,
+ guard: $6
+ };
+ })
+ ],
+ Switch: [
+ o('SWITCH Expression INDENT Whens OUTDENT', function() {
+ return new Switch($2, $4);
+ }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() {
+ return new Switch($2, $4, $6);
+ }), o('SWITCH INDENT Whens OUTDENT', function() {
+ return new Switch(null, $3);
+ }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() {
+ return new Switch(null, $3, $5);
+ })
+ ],
+ Whens: [
+ o('When'), o('Whens When', function() {
+ return $1.concat($2);
+ })
+ ],
+ When: [
+ o('LEADING_WHEN SimpleArgs Block', function() {
+ return [[$2, $3]];
+ }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() {
+ return [[$2, $3]];
+ })
+ ],
+ IfBlock: [
+ o('IF Expression Block', function() {
+ return new If($2, $3, {
+ type: $1
+ });
+ }), o('IfBlock ELSE IF Expression Block', function() {
+ return $1.addElse(new If($4, $5, {
+ type: $3
+ }));
+ })
+ ],
+ If: [
+ o('IfBlock'), o('IfBlock ELSE Block', function() {
+ return $1.addElse($3);
+ }), o('Statement POST_IF Expression', function() {
+ return new If($3, Block.wrap([$1]), {
+ type: $2,
+ statement: true
+ });
+ }), o('Expression POST_IF Expression', function() {
+ return new If($3, Block.wrap([$1]), {
+ type: $2,
+ statement: true
+ });
+ })
+ ],
+ Operation: [
+ o('UNARY Expression', function() {
+ return new Op($1, $2);
+ }), o('- Expression', (function() {
+ return new Op('-', $2);
+ }), {
+ prec: 'UNARY'
+ }), o('+ Expression', (function() {
+ return new Op('+', $2);
+ }), {
+ prec: 'UNARY'
+ }), o('-- SimpleAssignable', function() {
+ return new Op('--', $2);
+ }), o('++ SimpleAssignable', function() {
+ return new Op('++', $2);
+ }), o('SimpleAssignable --', function() {
+ return new Op('--', $1, null, true);
+ }), o('SimpleAssignable ++', function() {
+ return new Op('++', $1, null, true);
+ }), o('Expression ?', function() {
+ return new Existence($1);
+ }), o('Expression + Expression', function() {
+ return new Op('+', $1, $3);
+ }), o('Expression - Expression', function() {
+ return new Op('-', $1, $3);
+ }), o('Expression MATH Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression SHIFT Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression COMPARE Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression LOGIC Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression RELATION Expression', function() {
+ if ($2.charAt(0) === '!') {
+ return new Op($2.slice(1), $1, $3).invert();
+ } else {
+ return new Op($2, $1, $3);
+ }
+ }), o('SimpleAssignable COMPOUND_ASSIGN\
+ Expression', function() {
+ return new Assign($1, $3, $2);
+ }), o('SimpleAssignable COMPOUND_ASSIGN\
+ INDENT Expression OUTDENT', function() {
+ return new Assign($1, $4, $2);
+ }), o('SimpleAssignable EXTENDS Expression', function() {
+ return new Extends($1, $3);
+ })
+ ]
+ };
+ operators = [['left', '.', '?.', '::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'DO', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['right', 'POST_IF']];
+ tokens = [];
+ for (name in grammar) {
+ alternatives = grammar[name];
+ grammar[name] = (function() {
+ var _i, _j, _len, _len2, _ref, _results;
+ _results = [];
+ for (_i = 0, _len = alternatives.length; _i < _len; _i++) {
+ alt = alternatives[_i];
+ _ref = alt[0].split(' ');
+ for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) {
+ token = _ref[_j];
+ if (!grammar[token]) {
+ tokens.push(token);
+ }
+ }
+ if (name === 'Root') {
+ alt[1] = "return " + alt[1];
+ }
+ _results.push(alt);
+ }
+ return _results;
+ })();
+ }
+ exports.parser = new Parser({
+ tokens: tokens.join(' '),
+ bnf: grammar,
+ operators: operators.reverse(),
+ startSymbol: 'Root'
+ });
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/helpers.js b/node_modules/anvil.js/node_modules/coffee-script/lib/helpers.js
new file mode 100644
index 0000000..89be573
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/helpers.js
@@ -0,0 +1,66 @@
+(function() {
+ var extend, flatten;
+ exports.starts = function(string, literal, start) {
+ return literal === string.substr(start, literal.length);
+ };
+ exports.ends = function(string, literal, back) {
+ var len;
+ len = literal.length;
+ return literal === string.substr(string.length - len - (back || 0), len);
+ };
+ exports.compact = function(array) {
+ var item, _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = array.length; _i < _len; _i++) {
+ item = array[_i];
+ if (item) {
+ _results.push(item);
+ }
+ }
+ return _results;
+ };
+ exports.count = function(string, substr) {
+ var num, pos;
+ num = pos = 0;
+ if (!substr.length) {
+ return 1 / 0;
+ }
+ while (pos = 1 + string.indexOf(substr, pos)) {
+ num++;
+ }
+ return num;
+ };
+ exports.merge = function(options, overrides) {
+ return extend(extend({}, options), overrides);
+ };
+ extend = exports.extend = function(object, properties) {
+ var key, val;
+ for (key in properties) {
+ val = properties[key];
+ object[key] = val;
+ }
+ return object;
+ };
+ exports.flatten = flatten = function(array) {
+ var element, flattened, _i, _len;
+ flattened = [];
+ for (_i = 0, _len = array.length; _i < _len; _i++) {
+ element = array[_i];
+ if (element instanceof Array) {
+ flattened = flattened.concat(flatten(element));
+ } else {
+ flattened.push(element);
+ }
+ }
+ return flattened;
+ };
+ exports.del = function(obj, key) {
+ var val;
+ val = obj[key];
+ delete obj[key];
+ return val;
+ };
+ exports.last = function(array, back) {
+ return array[array.length - (back || 0) - 1];
+ };
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/index.js b/node_modules/anvil.js/node_modules/coffee-script/lib/index.js
new file mode 100644
index 0000000..38f7c1e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/index.js
@@ -0,0 +1,8 @@
+(function() {
+ var key, val, _ref;
+ _ref = require('./coffee-script');
+ for (key in _ref) {
+ val = _ref[key];
+ exports[key] = val;
+ }
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/lexer.js b/node_modules/anvil.js/node_modules/coffee-script/lib/lexer.js
new file mode 100644
index 0000000..4764bf6
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/lexer.js
@@ -0,0 +1,656 @@
+(function() {
+ var ASSIGNED, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NO_NEWLINE, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref;
+ var __indexOf = Array.prototype.indexOf || function(item) {
+ for (var i = 0, l = this.length; i < l; i++) {
+ if (this[i] === item) return i;
+ }
+ return -1;
+ };
+ Rewriter = require('./rewriter').Rewriter;
+ _ref = require('./helpers'), count = _ref.count, starts = _ref.starts, compact = _ref.compact, last = _ref.last;
+ exports.Lexer = Lexer = (function() {
+ function Lexer() {}
+ Lexer.prototype.tokenize = function(code, opts) {
+ var i;
+ if (opts == null) {
+ opts = {};
+ }
+ if (WHITESPACE.test(code)) {
+ code = "\n" + code;
+ }
+ code = code.replace(/\r/g, '').replace(TRAILING_SPACES, '');
+ this.code = code;
+ this.line = opts.line || 0;
+ this.indent = 0;
+ this.indebt = 0;
+ this.outdebt = 0;
+ this.indents = [];
+ this.tokens = [];
+ i = 0;
+ while (this.chunk = code.slice(i)) {
+ i += this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken();
+ }
+ this.closeIndentation();
+ if (opts.rewrite === false) {
+ return this.tokens;
+ }
+ return (new Rewriter).rewrite(this.tokens);
+ };
+ Lexer.prototype.identifierToken = function() {
+ var colon, forcedIdentifier, id, input, match, prev, tag, _ref2, _ref3;
+ if (!(match = IDENTIFIER.exec(this.chunk))) {
+ return 0;
+ }
+ input = match[0], id = match[1], colon = match[2];
+ if (id === 'own' && this.tag() === 'FOR') {
+ this.token('OWN', id);
+ return id.length;
+ }
+ forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::') || !prev.spaced && prev[0] === '@');
+ tag = 'IDENTIFIER';
+ if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) {
+ tag = id.toUpperCase();
+ if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) {
+ tag = 'LEADING_WHEN';
+ } else if (tag === 'FOR') {
+ this.seenFor = true;
+ } else if (tag === 'UNLESS') {
+ tag = 'IF';
+ } else if (__indexOf.call(UNARY, tag) >= 0) {
+ tag = 'UNARY';
+ } else if (__indexOf.call(RELATION, tag) >= 0) {
+ if (tag !== 'INSTANCEOF' && this.seenFor) {
+ tag = 'FOR' + tag;
+ this.seenFor = false;
+ } else {
+ tag = 'RELATION';
+ if (this.value() === '!') {
+ this.tokens.pop();
+ id = '!' + id;
+ }
+ }
+ }
+ }
+ if (__indexOf.call(JS_FORBIDDEN, id) >= 0) {
+ if (forcedIdentifier) {
+ tag = 'IDENTIFIER';
+ id = new String(id);
+ id.reserved = true;
+ } else if (__indexOf.call(RESERVED, id) >= 0) {
+ this.identifierError(id);
+ }
+ }
+ if (!forcedIdentifier) {
+ if (__indexOf.call(COFFEE_ALIASES, id) >= 0) {
+ id = COFFEE_ALIAS_MAP[id];
+ }
+ tag = (function() {
+ switch (id) {
+ case '!':
+ return 'UNARY';
+ case '==':
+ case '!=':
+ return 'COMPARE';
+ case '&&':
+ case '||':
+ return 'LOGIC';
+ case 'true':
+ case 'false':
+ case 'null':
+ case 'undefined':
+ return 'BOOL';
+ case 'break':
+ case 'continue':
+ case 'debugger':
+ return 'STATEMENT';
+ default:
+ return tag;
+ }
+ })();
+ }
+ this.token(tag, id);
+ if (colon) {
+ this.token(':', ':');
+ }
+ return input.length;
+ };
+ Lexer.prototype.numberToken = function() {
+ var match, number;
+ if (!(match = NUMBER.exec(this.chunk))) {
+ return 0;
+ }
+ number = match[0];
+ this.token('NUMBER', number);
+ return number.length;
+ };
+ Lexer.prototype.stringToken = function() {
+ var match, string;
+ switch (this.chunk.charAt(0)) {
+ case "'":
+ if (!(match = SIMPLESTR.exec(this.chunk))) {
+ return 0;
+ }
+ this.token('STRING', (string = match[0]).replace(MULTILINER, '\\\n'));
+ break;
+ case '"':
+ if (!(string = this.balancedString(this.chunk, '"'))) {
+ return 0;
+ }
+ if (0 < string.indexOf('#{', 1)) {
+ this.interpolateString(string.slice(1, -1));
+ } else {
+ this.token('STRING', this.escapeLines(string));
+ }
+ break;
+ default:
+ return 0;
+ }
+ this.line += count(string, '\n');
+ return string.length;
+ };
+ Lexer.prototype.heredocToken = function() {
+ var doc, heredoc, match, quote;
+ if (!(match = HEREDOC.exec(this.chunk))) {
+ return 0;
+ }
+ heredoc = match[0];
+ quote = heredoc.charAt(0);
+ doc = this.sanitizeHeredoc(match[2], {
+ quote: quote,
+ indent: null
+ });
+ if (quote === '"' && 0 <= doc.indexOf('#{')) {
+ this.interpolateString(doc, {
+ heredoc: true
+ });
+ } else {
+ this.token('STRING', this.makeString(doc, quote, true));
+ }
+ this.line += count(heredoc, '\n');
+ return heredoc.length;
+ };
+ Lexer.prototype.commentToken = function() {
+ var comment, here, match;
+ if (!(match = this.chunk.match(COMMENT))) {
+ return 0;
+ }
+ comment = match[0], here = match[1];
+ if (here) {
+ this.token('HERECOMMENT', this.sanitizeHeredoc(here, {
+ herecomment: true,
+ indent: Array(this.indent + 1).join(' ')
+ }));
+ this.token('TERMINATOR', '\n');
+ }
+ this.line += count(comment, '\n');
+ return comment.length;
+ };
+ Lexer.prototype.jsToken = function() {
+ var match, script;
+ if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
+ return 0;
+ }
+ this.token('JS', (script = match[0]).slice(1, -1));
+ return script.length;
+ };
+ Lexer.prototype.regexToken = function() {
+ var length, match, prev, regex, _ref2;
+ if (this.chunk.charAt(0) !== '/') {
+ return 0;
+ }
+ if (match = HEREGEX.exec(this.chunk)) {
+ length = this.heregexToken(match);
+ this.line += count(match[0], '\n');
+ return length;
+ }
+ prev = last(this.tokens);
+ if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) {
+ return 0;
+ }
+ if (!(match = REGEX.exec(this.chunk))) {
+ return 0;
+ }
+ regex = match[0];
+ this.token('REGEX', regex === '//' ? '/(?:)/' : regex);
+ return regex.length;
+ };
+ Lexer.prototype.heregexToken = function(match) {
+ var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4, _ref5;
+ heregex = match[0], body = match[1], flags = match[2];
+ if (0 > body.indexOf('#{')) {
+ re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/');
+ this.token('REGEX', "/" + (re || '(?:)') + "/" + flags);
+ return heregex.length;
+ }
+ this.token('IDENTIFIER', 'RegExp');
+ this.tokens.push(['CALL_START', '(']);
+ tokens = [];
+ _ref2 = this.interpolateString(body, {
+ regex: true
+ });
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ _ref3 = _ref2[_i], tag = _ref3[0], value = _ref3[1];
+ if (tag === 'TOKENS') {
+ tokens.push.apply(tokens, value);
+ } else {
+ if (!(value = value.replace(HEREGEX_OMIT, ''))) {
+ continue;
+ }
+ value = value.replace(/\\/g, '\\\\');
+ tokens.push(['STRING', this.makeString(value, '"', true)]);
+ }
+ tokens.push(['+', '+']);
+ }
+ tokens.pop();
+ if (((_ref4 = tokens[0]) != null ? _ref4[0] : void 0) !== 'STRING') {
+ this.tokens.push(['STRING', '""'], ['+', '+']);
+ }
+ (_ref5 = this.tokens).push.apply(_ref5, tokens);
+ if (flags) {
+ this.tokens.push([',', ','], ['STRING', '"' + flags + '"']);
+ }
+ this.token(')', ')');
+ return heregex.length;
+ };
+ Lexer.prototype.lineToken = function() {
+ var diff, indent, match, noNewlines, prev, size;
+ if (!(match = MULTI_DENT.exec(this.chunk))) {
+ return 0;
+ }
+ indent = match[0];
+ this.line += count(indent, '\n');
+ prev = last(this.tokens, 1);
+ size = indent.length - 1 - indent.lastIndexOf('\n');
+ noNewlines = this.unfinished();
+ if (size - this.indebt === this.indent) {
+ if (noNewlines) {
+ this.suppressNewlines();
+ } else {
+ this.newlineToken();
+ }
+ return indent.length;
+ }
+ if (size > this.indent) {
+ if (noNewlines) {
+ this.indebt = size - this.indent;
+ this.suppressNewlines();
+ return indent.length;
+ }
+ diff = size - this.indent + this.outdebt;
+ this.token('INDENT', diff);
+ this.indents.push(diff);
+ this.outdebt = this.indebt = 0;
+ } else {
+ this.indebt = 0;
+ this.outdentToken(this.indent - size, noNewlines);
+ }
+ this.indent = size;
+ return indent.length;
+ };
+ Lexer.prototype.outdentToken = function(moveOut, noNewlines, close) {
+ var dent, len;
+ while (moveOut > 0) {
+ len = this.indents.length - 1;
+ if (this.indents[len] === void 0) {
+ moveOut = 0;
+ } else if (this.indents[len] === this.outdebt) {
+ moveOut -= this.outdebt;
+ this.outdebt = 0;
+ } else if (this.indents[len] < this.outdebt) {
+ this.outdebt -= this.indents[len];
+ moveOut -= this.indents[len];
+ } else {
+ dent = this.indents.pop() - this.outdebt;
+ moveOut -= dent;
+ this.outdebt = 0;
+ this.token('OUTDENT', dent);
+ }
+ }
+ if (dent) {
+ this.outdebt -= moveOut;
+ }
+ if (!(this.tag() === 'TERMINATOR' || noNewlines)) {
+ this.token('TERMINATOR', '\n');
+ }
+ return this;
+ };
+ Lexer.prototype.whitespaceToken = function() {
+ var match, nline, prev;
+ if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) {
+ return 0;
+ }
+ prev = last(this.tokens);
+ if (prev) {
+ prev[match ? 'spaced' : 'newLine'] = true;
+ }
+ if (match) {
+ return match[0].length;
+ } else {
+ return 0;
+ }
+ };
+ Lexer.prototype.newlineToken = function() {
+ if (this.tag() !== 'TERMINATOR') {
+ this.token('TERMINATOR', '\n');
+ }
+ return this;
+ };
+ Lexer.prototype.suppressNewlines = function() {
+ if (this.value() === '\\') {
+ this.tokens.pop();
+ }
+ return this;
+ };
+ Lexer.prototype.literalToken = function() {
+ var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5;
+ if (match = OPERATOR.exec(this.chunk)) {
+ value = match[0];
+ if (CODE.test(value)) {
+ this.tagParameters();
+ }
+ } else {
+ value = this.chunk.charAt(0);
+ }
+ tag = value;
+ prev = last(this.tokens);
+ if (value === '=' && prev) {
+ if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) {
+ this.assignmentError();
+ }
+ if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') {
+ prev[0] = 'COMPOUND_ASSIGN';
+ prev[1] += '=';
+ return value.length;
+ }
+ }
+ if (value === ';') {
+ tag = 'TERMINATOR';
+ } else if (__indexOf.call(MATH, value) >= 0) {
+ tag = 'MATH';
+ } else if (__indexOf.call(COMPARE, value) >= 0) {
+ tag = 'COMPARE';
+ } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) {
+ tag = 'COMPOUND_ASSIGN';
+ } else if (__indexOf.call(UNARY, value) >= 0) {
+ tag = 'UNARY';
+ } else if (__indexOf.call(SHIFT, value) >= 0) {
+ tag = 'SHIFT';
+ } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) {
+ tag = 'LOGIC';
+ } else if (prev && !prev.spaced) {
+ if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) {
+ if (prev[0] === '?') {
+ prev[0] = 'FUNC_EXIST';
+ }
+ tag = 'CALL_START';
+ } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) {
+ tag = 'INDEX_START';
+ switch (prev[0]) {
+ case '?':
+ prev[0] = 'INDEX_SOAK';
+ break;
+ case '::':
+ prev[0] = 'INDEX_PROTO';
+ }
+ }
+ }
+ this.token(tag, value);
+ return value.length;
+ };
+ Lexer.prototype.sanitizeHeredoc = function(doc, options) {
+ var attempt, herecomment, indent, match, _ref2;
+ indent = options.indent, herecomment = options.herecomment;
+ if (herecomment) {
+ if (HEREDOC_ILLEGAL.test(doc)) {
+ throw new Error("block comment cannot contain \"*/\", starting on line " + (this.line + 1));
+ }
+ if (doc.indexOf('\n') <= 0) {
+ return doc;
+ }
+ } else {
+ while (match = HEREDOC_INDENT.exec(doc)) {
+ attempt = match[1];
+ if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) {
+ indent = attempt;
+ }
+ }
+ }
+ if (indent) {
+ doc = doc.replace(RegExp("\\n" + indent, "g"), '\n');
+ }
+ if (!herecomment) {
+ doc = doc.replace(/^\n/, '');
+ }
+ return doc;
+ };
+ Lexer.prototype.tagParameters = function() {
+ var i, stack, tok, tokens;
+ if (this.tag() !== ')') {
+ return this;
+ }
+ stack = [];
+ tokens = this.tokens;
+ i = tokens.length;
+ tokens[--i][0] = 'PARAM_END';
+ while (tok = tokens[--i]) {
+ switch (tok[0]) {
+ case ')':
+ stack.push(tok);
+ break;
+ case '(':
+ case 'CALL_START':
+ if (stack.length) {
+ stack.pop();
+ } else if (tok[0] === '(') {
+ tok[0] = 'PARAM_START';
+ return this;
+ } else {
+ return this;
+ }
+ }
+ }
+ return this;
+ };
+ Lexer.prototype.closeIndentation = function() {
+ return this.outdentToken(this.indent);
+ };
+ Lexer.prototype.identifierError = function(word) {
+ throw SyntaxError("Reserved word \"" + word + "\" on line " + (this.line + 1));
+ };
+ Lexer.prototype.assignmentError = function() {
+ throw SyntaxError("Reserved word \"" + (this.value()) + "\" on line " + (this.line + 1) + " can't be assigned");
+ };
+ Lexer.prototype.balancedString = function(str, end) {
+ var i, letter, match, prev, stack, _ref2;
+ stack = [end];
+ for (i = 1, _ref2 = str.length; 1 <= _ref2 ? i < _ref2 : i > _ref2; 1 <= _ref2 ? i++ : i--) {
+ switch (letter = str.charAt(i)) {
+ case '\\':
+ i++;
+ continue;
+ case end:
+ stack.pop();
+ if (!stack.length) {
+ return str.slice(0, i + 1);
+ }
+ end = stack[stack.length - 1];
+ continue;
+ }
+ if (end === '}' && (letter === '"' || letter === "'")) {
+ stack.push(end = letter);
+ } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) {
+ i += match[0].length - 1;
+ } else if (end === '}' && letter === '{') {
+ stack.push(end = '}');
+ } else if (end === '"' && prev === '#' && letter === '{') {
+ stack.push(end = '}');
+ }
+ prev = letter;
+ }
+ throw new Error("missing " + (stack.pop()) + ", starting on line " + (this.line + 1));
+ };
+ Lexer.prototype.interpolateString = function(str, options) {
+ var expr, heredoc, i, inner, interpolated, len, letter, nested, pi, regex, tag, tokens, value, _len, _ref2, _ref3, _ref4;
+ if (options == null) {
+ options = {};
+ }
+ heredoc = options.heredoc, regex = options.regex;
+ tokens = [];
+ pi = 0;
+ i = -1;
+ while (letter = str.charAt(i += 1)) {
+ if (letter === '\\') {
+ i += 1;
+ continue;
+ }
+ if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) {
+ continue;
+ }
+ if (pi < i) {
+ tokens.push(['NEOSTRING', str.slice(pi, i)]);
+ }
+ inner = expr.slice(1, -1);
+ if (inner.length) {
+ nested = new Lexer().tokenize(inner, {
+ line: this.line,
+ rewrite: false
+ });
+ nested.pop();
+ if (((_ref2 = nested[0]) != null ? _ref2[0] : void 0) === 'TERMINATOR') {
+ nested.shift();
+ }
+ if (len = nested.length) {
+ if (len > 1) {
+ nested.unshift(['(', '(']);
+ nested.push([')', ')']);
+ }
+ tokens.push(['TOKENS', nested]);
+ }
+ }
+ i += expr.length;
+ pi = i + 1;
+ }
+ if ((i > pi && pi < str.length)) {
+ tokens.push(['NEOSTRING', str.slice(pi)]);
+ }
+ if (regex) {
+ return tokens;
+ }
+ if (!tokens.length) {
+ return this.token('STRING', '""');
+ }
+ if (tokens[0][0] !== 'NEOSTRING') {
+ tokens.unshift(['', '']);
+ }
+ if (interpolated = tokens.length > 1) {
+ this.token('(', '(');
+ }
+ for (i = 0, _len = tokens.length; i < _len; i++) {
+ _ref3 = tokens[i], tag = _ref3[0], value = _ref3[1];
+ if (i) {
+ this.token('+', '+');
+ }
+ if (tag === 'TOKENS') {
+ (_ref4 = this.tokens).push.apply(_ref4, value);
+ } else {
+ this.token('STRING', this.makeString(value, '"', heredoc));
+ }
+ }
+ if (interpolated) {
+ this.token(')', ')');
+ }
+ return tokens;
+ };
+ Lexer.prototype.token = function(tag, value) {
+ return this.tokens.push([tag, value, this.line]);
+ };
+ Lexer.prototype.tag = function(index, tag) {
+ var tok;
+ return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]);
+ };
+ Lexer.prototype.value = function(index, val) {
+ var tok;
+ return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]);
+ };
+ Lexer.prototype.unfinished = function() {
+ var prev, value;
+ return LINE_CONTINUER.test(this.chunk) || (prev = last(this.tokens, 1)) && prev[0] !== '.' && (value = this.value()) && !value.reserved && NO_NEWLINE.test(value) && !CODE.test(value) && !ASSIGNED.test(this.chunk);
+ };
+ Lexer.prototype.escapeLines = function(str, heredoc) {
+ return str.replace(MULTILINER, heredoc ? '\\n' : '');
+ };
+ Lexer.prototype.makeString = function(body, quote, heredoc) {
+ if (!body) {
+ return quote + quote;
+ }
+ body = body.replace(/\\([\s\S])/g, function(match, contents) {
+ if (contents === '\n' || contents === quote) {
+ return contents;
+ } else {
+ return match;
+ }
+ });
+ body = body.replace(RegExp("" + quote, "g"), '\\$&');
+ return quote + this.escapeLines(body, heredoc) + quote;
+ };
+ return Lexer;
+ })();
+ JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super'];
+ COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when'];
+ COFFEE_ALIAS_MAP = {
+ and: '&&',
+ or: '||',
+ is: '==',
+ isnt: '!=',
+ not: '!',
+ yes: 'true',
+ no: 'false',
+ on: 'true',
+ off: 'false'
+ };
+ COFFEE_ALIASES = (function() {
+ var _results;
+ _results = [];
+ for (key in COFFEE_ALIAS_MAP) {
+ _results.push(key);
+ }
+ return _results;
+ })();
+ COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES);
+ RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf'];
+ JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED);
+ exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS);
+ IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/;
+ NUMBER = /^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;
+ HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/;
+ OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/;
+ WHITESPACE = /^[^\n\S]+/;
+ COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/;
+ CODE = /^[-=]>/;
+ MULTI_DENT = /^(?:\n[^\n\S]*)+/;
+ SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/;
+ JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/;
+ REGEX = /^\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/[imgy]{0,4}(?!\w)/;
+ HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/;
+ HEREGEX_OMIT = /\s+(?:#.*)?/g;
+ MULTILINER = /\n/g;
+ HEREDOC_INDENT = /\n+([^\n\S]*)/g;
+ HEREDOC_ILLEGAL = /\*\//;
+ ASSIGNED = /^\s*@?([$A-Za-z_][$\w\x7f-\uffff]*|['"].*['"])[^\n\S]*?[:=][^:=>]/;
+ LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/;
+ TRAILING_SPACES = /\s+$/;
+ NO_NEWLINE = /^(?:[-+*&|\/%=<>!.\\][<>=&|]*|and|or|is(?:nt)?|n(?:ot|ew)|delete|typeof|instanceof)$/;
+ COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|='];
+ UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO'];
+ LOGIC = ['&&', '||', '&', '|', '^'];
+ SHIFT = ['<<', '>>', '>>>'];
+ COMPARE = ['==', '!=', '<', '>', '<=', '>='];
+ MATH = ['*', '/', '%'];
+ RELATION = ['IN', 'OF', 'INSTANCEOF'];
+ BOOL = ['TRUE', 'FALSE', 'NULL', 'UNDEFINED'];
+ NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', '++', '--', ']'];
+ NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING');
+ CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
+ INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL');
+ LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/nodes.js b/node_modules/anvil.js/node_modules/coffee-script/lib/nodes.js
new file mode 100644
index 0000000..1131062
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/nodes.js
@@ -0,0 +1,2289 @@
+(function() {
+ var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, Push, Range, Return, SIMPLENUM, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, starts, unfoldSoak, utility, _ref;
+ var __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
+ for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
+ function ctor() { this.constructor = child; }
+ ctor.prototype = parent.prototype;
+ child.prototype = new ctor;
+ child.__super__ = parent.prototype;
+ return child;
+ }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __indexOf = Array.prototype.indexOf || function(item) {
+ for (var i = 0, l = this.length; i < l; i++) {
+ if (this[i] === item) return i;
+ }
+ return -1;
+ };
+ Scope = require('./scope').Scope;
+ _ref = require('./helpers'), compact = _ref.compact, flatten = _ref.flatten, extend = _ref.extend, merge = _ref.merge, del = _ref.del, starts = _ref.starts, ends = _ref.ends, last = _ref.last;
+ exports.extend = extend;
+ YES = function() {
+ return true;
+ };
+ NO = function() {
+ return false;
+ };
+ THIS = function() {
+ return this;
+ };
+ NEGATE = function() {
+ this.negated = !this.negated;
+ return this;
+ };
+ exports.Base = Base = (function() {
+ function Base() {}
+ Base.prototype.compile = function(o, lvl) {
+ var node;
+ o = extend({}, o);
+ if (lvl) {
+ o.level = lvl;
+ }
+ node = this.unfoldSoak(o) || this;
+ node.tab = o.indent;
+ if (o.level === LEVEL_TOP || !node.isStatement(o)) {
+ return node.compileNode(o);
+ } else {
+ return node.compileClosure(o);
+ }
+ };
+ Base.prototype.compileClosure = function(o) {
+ if (this.jumps() || this instanceof Throw) {
+ throw SyntaxError('cannot use a pure statement in an expression.');
+ }
+ o.sharedScope = true;
+ return Closure.wrap(this).compileNode(o);
+ };
+ Base.prototype.cache = function(o, level, reused) {
+ var ref, sub;
+ if (!this.isComplex()) {
+ ref = level ? this.compile(o, level) : this;
+ return [ref, ref];
+ } else {
+ ref = new Literal(reused || o.scope.freeVariable('ref'));
+ sub = new Assign(ref, this);
+ if (level) {
+ return [sub.compile(o, level), ref.value];
+ } else {
+ return [sub, ref];
+ }
+ }
+ };
+ Base.prototype.compileLoopReference = function(o, name) {
+ var src, tmp;
+ src = tmp = this.compile(o, LEVEL_LIST);
+ if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) {
+ src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src;
+ }
+ return [src, tmp];
+ };
+ Base.prototype.makeReturn = function() {
+ return new Return(this);
+ };
+ Base.prototype.contains = function(pred) {
+ var contains;
+ contains = false;
+ this.traverseChildren(false, function(node) {
+ if (pred(node)) {
+ contains = true;
+ return false;
+ }
+ });
+ return contains;
+ };
+ Base.prototype.containsType = function(type) {
+ return this instanceof type || this.contains(function(node) {
+ return node instanceof type;
+ });
+ };
+ Base.prototype.lastNonComment = function(list) {
+ var i;
+ i = list.length;
+ while (i--) {
+ if (!(list[i] instanceof Comment)) {
+ return list[i];
+ }
+ }
+ return null;
+ };
+ Base.prototype.toString = function(idt, name) {
+ var tree;
+ if (idt == null) {
+ idt = '';
+ }
+ if (name == null) {
+ name = this.constructor.name;
+ }
+ tree = '\n' + idt + name;
+ if (this.soak) {
+ tree += '?';
+ }
+ this.eachChild(function(node) {
+ return tree += node.toString(idt + TAB);
+ });
+ return tree;
+ };
+ Base.prototype.eachChild = function(func) {
+ var attr, child, _i, _j, _len, _len2, _ref2, _ref3;
+ if (!this.children) {
+ return this;
+ }
+ _ref2 = this.children;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ attr = _ref2[_i];
+ if (this[attr]) {
+ _ref3 = flatten([this[attr]]);
+ for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) {
+ child = _ref3[_j];
+ if (func(child) === false) {
+ return this;
+ }
+ }
+ }
+ }
+ return this;
+ };
+ Base.prototype.traverseChildren = function(crossScope, func) {
+ return this.eachChild(function(child) {
+ if (func(child) === false) {
+ return false;
+ }
+ return child.traverseChildren(crossScope, func);
+ });
+ };
+ Base.prototype.invert = function() {
+ return new Op('!', this);
+ };
+ Base.prototype.unwrapAll = function() {
+ var node;
+ node = this;
+ while (node !== (node = node.unwrap())) {
+ continue;
+ }
+ return node;
+ };
+ Base.prototype.children = [];
+ Base.prototype.isStatement = NO;
+ Base.prototype.jumps = NO;
+ Base.prototype.isComplex = YES;
+ Base.prototype.isChainable = NO;
+ Base.prototype.isAssignable = NO;
+ Base.prototype.unwrap = THIS;
+ Base.prototype.unfoldSoak = NO;
+ Base.prototype.assigns = NO;
+ return Base;
+ })();
+ exports.Block = Block = (function() {
+ __extends(Block, Base);
+ function Block(nodes) {
+ this.expressions = compact(flatten(nodes || []));
+ }
+ Block.prototype.children = ['expressions'];
+ Block.prototype.push = function(node) {
+ this.expressions.push(node);
+ return this;
+ };
+ Block.prototype.pop = function() {
+ return this.expressions.pop();
+ };
+ Block.prototype.unshift = function(node) {
+ this.expressions.unshift(node);
+ return this;
+ };
+ Block.prototype.unwrap = function() {
+ if (this.expressions.length === 1) {
+ return this.expressions[0];
+ } else {
+ return this;
+ }
+ };
+ Block.prototype.isEmpty = function() {
+ return !this.expressions.length;
+ };
+ Block.prototype.isStatement = function(o) {
+ var exp, _i, _len, _ref2;
+ _ref2 = this.expressions;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ exp = _ref2[_i];
+ if (exp.isStatement(o)) {
+ return true;
+ }
+ }
+ return false;
+ };
+ Block.prototype.jumps = function(o) {
+ var exp, _i, _len, _ref2;
+ _ref2 = this.expressions;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ exp = _ref2[_i];
+ if (exp.jumps(o)) {
+ return exp;
+ }
+ }
+ };
+ Block.prototype.makeReturn = function() {
+ var expr, len;
+ len = this.expressions.length;
+ while (len--) {
+ expr = this.expressions[len];
+ if (!(expr instanceof Comment)) {
+ this.expressions[len] = expr.makeReturn();
+ if (expr instanceof Return && !expr.expression) {
+ this.expressions.splice(len, 1);
+ }
+ break;
+ }
+ }
+ return this;
+ };
+ Block.prototype.compile = function(o, level) {
+ if (o == null) {
+ o = {};
+ }
+ if (o.scope) {
+ return Block.__super__.compile.call(this, o, level);
+ } else {
+ return this.compileRoot(o);
+ }
+ };
+ Block.prototype.compileNode = function(o) {
+ var code, codes, node, top, _i, _len, _ref2;
+ this.tab = o.indent;
+ top = o.level === LEVEL_TOP;
+ codes = [];
+ _ref2 = this.expressions;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ node = _ref2[_i];
+ node = node.unwrapAll();
+ node = node.unfoldSoak(o) || node;
+ if (node instanceof Block) {
+ codes.push(node.compileNode(o));
+ } else if (top) {
+ node.front = true;
+ code = node.compile(o);
+ codes.push(node.isStatement(o) ? code : this.tab + code + ';');
+ } else {
+ codes.push(node.compile(o, LEVEL_LIST));
+ }
+ }
+ if (top) {
+ return codes.join('\n');
+ }
+ code = codes.join(', ') || 'void 0';
+ if (codes.length > 1 && o.level >= LEVEL_LIST) {
+ return "(" + code + ")";
+ } else {
+ return code;
+ }
+ };
+ Block.prototype.compileRoot = function(o) {
+ var code;
+ o.indent = this.tab = o.bare ? '' : TAB;
+ o.scope = new Scope(null, this, null);
+ o.level = LEVEL_TOP;
+ code = this.compileWithDeclarations(o);
+ if (o.bare) {
+ return code;
+ } else {
+ return "(function() {\n" + code + "\n}).call(this);\n";
+ }
+ };
+ Block.prototype.compileWithDeclarations = function(o) {
+ var assigns, code, declars, exp, i, post, rest, scope, _len, _ref2;
+ code = post = '';
+ _ref2 = this.expressions;
+ for (i = 0, _len = _ref2.length; i < _len; i++) {
+ exp = _ref2[i];
+ exp = exp.unwrap();
+ if (!(exp instanceof Comment || exp instanceof Literal)) {
+ break;
+ }
+ }
+ o = merge(o, {
+ level: LEVEL_TOP
+ });
+ if (i) {
+ rest = this.expressions.splice(i, this.expressions.length);
+ code = this.compileNode(o);
+ this.expressions = rest;
+ }
+ post = this.compileNode(o);
+ scope = o.scope;
+ if (scope.expressions === this) {
+ declars = o.scope.hasDeclarations();
+ assigns = scope.hasAssignments;
+ if ((declars || assigns) && i) {
+ code += '\n';
+ }
+ if (declars) {
+ code += "" + this.tab + "var " + (scope.declaredVariables().join(', ')) + ";\n";
+ }
+ if (assigns) {
+ code += "" + this.tab + "var " + (multident(scope.assignedVariables().join(', '), this.tab)) + ";\n";
+ }
+ }
+ return code + post;
+ };
+ Block.wrap = function(nodes) {
+ if (nodes.length === 1 && nodes[0] instanceof Block) {
+ return nodes[0];
+ }
+ return new Block(nodes);
+ };
+ return Block;
+ })();
+ exports.Literal = Literal = (function() {
+ __extends(Literal, Base);
+ function Literal(value) {
+ this.value = value;
+ }
+ Literal.prototype.makeReturn = function() {
+ if (this.isStatement()) {
+ return this;
+ } else {
+ return new Return(this);
+ }
+ };
+ Literal.prototype.isAssignable = function() {
+ return IDENTIFIER.test(this.value);
+ };
+ Literal.prototype.isStatement = function() {
+ var _ref2;
+ return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger';
+ };
+ Literal.prototype.isComplex = NO;
+ Literal.prototype.assigns = function(name) {
+ return name === this.value;
+ };
+ Literal.prototype.jumps = function(o) {
+ if (!this.isStatement()) {
+ return false;
+ }
+ if (!(o && (o.loop || o.block && (this.value !== 'continue')))) {
+ return this;
+ } else {
+ return false;
+ }
+ };
+ Literal.prototype.compileNode = function(o) {
+ var code;
+ code = this.isUndefined ? o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0' : this.value.reserved ? "\"" + this.value + "\"" : this.value;
+ if (this.isStatement()) {
+ return "" + this.tab + code + ";";
+ } else {
+ return code;
+ }
+ };
+ Literal.prototype.toString = function() {
+ return ' "' + this.value + '"';
+ };
+ return Literal;
+ })();
+ exports.Return = Return = (function() {
+ __extends(Return, Base);
+ function Return(expr) {
+ if (expr && !expr.unwrap().isUndefined) {
+ this.expression = expr;
+ }
+ }
+ Return.prototype.children = ['expression'];
+ Return.prototype.isStatement = YES;
+ Return.prototype.makeReturn = THIS;
+ Return.prototype.jumps = THIS;
+ Return.prototype.compile = function(o, level) {
+ var expr, _ref2;
+ expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0;
+ if (expr && !(expr instanceof Return)) {
+ return expr.compile(o, level);
+ } else {
+ return Return.__super__.compile.call(this, o, level);
+ }
+ };
+ Return.prototype.compileNode = function(o) {
+ return this.tab + ("return" + (this.expression ? ' ' + this.expression.compile(o, LEVEL_PAREN) : '') + ";");
+ };
+ return Return;
+ })();
+ exports.Value = Value = (function() {
+ __extends(Value, Base);
+ function Value(base, props, tag) {
+ if (!props && base instanceof Value) {
+ return base;
+ }
+ this.base = base;
+ this.properties = props || [];
+ if (tag) {
+ this[tag] = true;
+ }
+ return this;
+ }
+ Value.prototype.children = ['base', 'properties'];
+ Value.prototype.push = function(prop) {
+ this.properties.push(prop);
+ return this;
+ };
+ Value.prototype.hasProperties = function() {
+ return !!this.properties.length;
+ };
+ Value.prototype.isArray = function() {
+ return !this.properties.length && this.base instanceof Arr;
+ };
+ Value.prototype.isComplex = function() {
+ return this.hasProperties() || this.base.isComplex();
+ };
+ Value.prototype.isAssignable = function() {
+ return this.hasProperties() || this.base.isAssignable();
+ };
+ Value.prototype.isSimpleNumber = function() {
+ return this.base instanceof Literal && SIMPLENUM.test(this.base.value);
+ };
+ Value.prototype.isAtomic = function() {
+ var node, _i, _len, _ref2;
+ _ref2 = this.properties.concat(this.base);
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ node = _ref2[_i];
+ if (node.soak || node instanceof Call) {
+ return false;
+ }
+ }
+ return true;
+ };
+ Value.prototype.isStatement = function(o) {
+ return !this.properties.length && this.base.isStatement(o);
+ };
+ Value.prototype.assigns = function(name) {
+ return !this.properties.length && this.base.assigns(name);
+ };
+ Value.prototype.jumps = function(o) {
+ return !this.properties.length && this.base.jumps(o);
+ };
+ Value.prototype.isObject = function(onlyGenerated) {
+ if (this.properties.length) {
+ return false;
+ }
+ return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated);
+ };
+ Value.prototype.isSplice = function() {
+ return last(this.properties) instanceof Slice;
+ };
+ Value.prototype.makeReturn = function() {
+ if (this.properties.length) {
+ return Value.__super__.makeReturn.call(this);
+ } else {
+ return this.base.makeReturn();
+ }
+ };
+ Value.prototype.unwrap = function() {
+ if (this.properties.length) {
+ return this;
+ } else {
+ return this.base;
+ }
+ };
+ Value.prototype.cacheReference = function(o) {
+ var base, bref, name, nref;
+ name = last(this.properties);
+ if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) {
+ return [this, this];
+ }
+ base = new Value(this.base, this.properties.slice(0, -1));
+ if (base.isComplex()) {
+ bref = new Literal(o.scope.freeVariable('base'));
+ base = new Value(new Parens(new Assign(bref, base)));
+ }
+ if (!name) {
+ return [base, bref];
+ }
+ if (name.isComplex()) {
+ nref = new Literal(o.scope.freeVariable('name'));
+ name = new Index(new Assign(nref, name.index));
+ nref = new Index(nref);
+ }
+ return [base.push(name), new Value(bref || base.base, [nref || name])];
+ };
+ Value.prototype.compileNode = function(o) {
+ var code, prop, props, _i, _len;
+ this.base.front = this.front;
+ props = this.properties;
+ code = this.base.compile(o, props.length ? LEVEL_ACCESS : null);
+ if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) {
+ code = "" + code + ".";
+ }
+ for (_i = 0, _len = props.length; _i < _len; _i++) {
+ prop = props[_i];
+ code += prop.compile(o);
+ }
+ return code;
+ };
+ Value.prototype.unfoldSoak = function(o) {
+ var result;
+ if (this.unfoldedSoak != null) {
+ return this.unfoldedSoak;
+ }
+ result = __bind(function() {
+ var fst, i, ifn, prop, ref, snd, _len, _ref2;
+ if (ifn = this.base.unfoldSoak(o)) {
+ Array.prototype.push.apply(ifn.body.properties, this.properties);
+ return ifn;
+ }
+ _ref2 = this.properties;
+ for (i = 0, _len = _ref2.length; i < _len; i++) {
+ prop = _ref2[i];
+ if (prop.soak) {
+ prop.soak = false;
+ fst = new Value(this.base, this.properties.slice(0, i));
+ snd = new Value(this.base, this.properties.slice(i));
+ if (fst.isComplex()) {
+ ref = new Literal(o.scope.freeVariable('ref'));
+ fst = new Parens(new Assign(ref, fst));
+ snd.base = ref;
+ }
+ return new If(new Existence(fst), snd, {
+ soak: true
+ });
+ }
+ }
+ return null;
+ }, this)();
+ return this.unfoldedSoak = result || false;
+ };
+ return Value;
+ })();
+ exports.Comment = Comment = (function() {
+ __extends(Comment, Base);
+ function Comment(comment) {
+ this.comment = comment;
+ }
+ Comment.prototype.isStatement = YES;
+ Comment.prototype.makeReturn = THIS;
+ Comment.prototype.compileNode = function(o, level) {
+ var code;
+ code = '/*' + multident(this.comment, this.tab) + '*/';
+ if ((level || o.level) === LEVEL_TOP) {
+ code = o.indent + code;
+ }
+ return code;
+ };
+ return Comment;
+ })();
+ exports.Call = Call = (function() {
+ __extends(Call, Base);
+ function Call(variable, args, soak) {
+ this.args = args != null ? args : [];
+ this.soak = soak;
+ this.isNew = false;
+ this.isSuper = variable === 'super';
+ this.variable = this.isSuper ? null : variable;
+ }
+ Call.prototype.children = ['variable', 'args'];
+ Call.prototype.newInstance = function() {
+ var base;
+ base = this.variable.base || this.variable;
+ if (base instanceof Call && !base.isNew) {
+ base.newInstance();
+ } else {
+ this.isNew = true;
+ }
+ return this;
+ };
+ Call.prototype.superReference = function(o) {
+ var method, name;
+ method = o.scope.method;
+ if (!method) {
+ throw SyntaxError('cannot call super outside of a function.');
+ }
+ name = method.name;
+ if (name == null) {
+ throw SyntaxError('cannot call super on an anonymous function.');
+ }
+ if (method.klass) {
+ return (new Value(new Literal(method.klass), [new Access(new Literal("__super__")), new Access(new Literal(name))])).compile(o);
+ } else {
+ return "" + name + ".__super__.constructor";
+ }
+ };
+ Call.prototype.unfoldSoak = function(o) {
+ var call, ifn, left, list, rite, _i, _len, _ref2, _ref3;
+ if (this.soak) {
+ if (this.variable) {
+ if (ifn = unfoldSoak(o, this, 'variable')) {
+ return ifn;
+ }
+ _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1];
+ } else {
+ left = new Literal(this.superReference(o));
+ rite = new Value(left);
+ }
+ rite = new Call(rite, this.args);
+ rite.isNew = this.isNew;
+ left = new Literal("typeof " + (left.compile(o)) + " === \"function\"");
+ return new If(left, new Value(rite), {
+ soak: true
+ });
+ }
+ call = this;
+ list = [];
+ while (true) {
+ if (call.variable instanceof Call) {
+ list.push(call);
+ call = call.variable;
+ continue;
+ }
+ if (!(call.variable instanceof Value)) {
+ break;
+ }
+ list.push(call);
+ if (!((call = call.variable.base) instanceof Call)) {
+ break;
+ }
+ }
+ _ref3 = list.reverse();
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ call = _ref3[_i];
+ if (ifn) {
+ if (call.variable instanceof Call) {
+ call.variable = ifn;
+ } else {
+ call.variable.base = ifn;
+ }
+ }
+ ifn = unfoldSoak(o, call, 'variable');
+ }
+ return ifn;
+ };
+ Call.prototype.filterImplicitObjects = function(list) {
+ var node, nodes, obj, prop, properties, _i, _j, _len, _len2, _ref2;
+ nodes = [];
+ for (_i = 0, _len = list.length; _i < _len; _i++) {
+ node = list[_i];
+ if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) {
+ nodes.push(node);
+ continue;
+ }
+ obj = null;
+ _ref2 = node.base.properties;
+ for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
+ prop = _ref2[_j];
+ if (prop instanceof Assign || prop instanceof Comment) {
+ if (!obj) {
+ nodes.push(obj = new Obj(properties = [], true));
+ }
+ properties.push(prop);
+ } else {
+ nodes.push(prop);
+ obj = null;
+ }
+ }
+ }
+ return nodes;
+ };
+ Call.prototype.compileNode = function(o) {
+ var arg, args, code, _ref2;
+ if ((_ref2 = this.variable) != null) {
+ _ref2.front = this.front;
+ }
+ if (code = Splat.compileSplattedArray(o, this.args, true)) {
+ return this.compileSplat(o, code);
+ }
+ args = this.filterImplicitObjects(this.args);
+ args = ((function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ arg = args[_i];
+ _results.push(arg.compile(o, LEVEL_LIST));
+ }
+ return _results;
+ })()).join(', ');
+ if (this.isSuper) {
+ return this.superReference(o) + (".call(this" + (args && ', ' + args) + ")");
+ } else {
+ return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")");
+ }
+ };
+ Call.prototype.compileSuper = function(args, o) {
+ return "" + (this.superReference(o)) + ".call(this" + (args.length ? ', ' : '') + args + ")";
+ };
+ Call.prototype.compileSplat = function(o, splatArgs) {
+ var base, fun, idt, name, ref;
+ if (this.isSuper) {
+ return "" + (this.superReference(o)) + ".apply(this, " + splatArgs + ")";
+ }
+ if (this.isNew) {
+ idt = this.tab + TAB;
+ return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return typeof result === \"object\" ? result : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function() {})";
+ }
+ base = new Value(this.variable);
+ if ((name = base.properties.pop()) && base.isComplex()) {
+ ref = o.scope.freeVariable('ref');
+ fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o));
+ } else {
+ fun = base.compile(o, LEVEL_ACCESS);
+ if (SIMPLENUM.test(fun)) {
+ fun = "(" + fun + ")";
+ }
+ if (name) {
+ ref = fun;
+ fun += name.compile(o);
+ } else {
+ ref = 'null';
+ }
+ }
+ return "" + fun + ".apply(" + ref + ", " + splatArgs + ")";
+ };
+ return Call;
+ })();
+ exports.Extends = Extends = (function() {
+ __extends(Extends, Base);
+ function Extends(child, parent) {
+ this.child = child;
+ this.parent = parent;
+ }
+ Extends.prototype.children = ['child', 'parent'];
+ Extends.prototype.compile = function(o) {
+ utility('hasProp');
+ return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o);
+ };
+ return Extends;
+ })();
+ exports.Access = Access = (function() {
+ __extends(Access, Base);
+ function Access(name, tag) {
+ this.name = name;
+ this.name.asKey = true;
+ this.proto = tag === 'proto' ? '.prototype' : '';
+ this.soak = tag === 'soak';
+ }
+ Access.prototype.children = ['name'];
+ Access.prototype.compile = function(o) {
+ var name;
+ name = this.name.compile(o);
+ return this.proto + (IDENTIFIER.test(name) ? "." + name : "[" + name + "]");
+ };
+ Access.prototype.isComplex = NO;
+ return Access;
+ })();
+ exports.Index = Index = (function() {
+ __extends(Index, Base);
+ function Index(index) {
+ this.index = index;
+ }
+ Index.prototype.children = ['index'];
+ Index.prototype.compile = function(o) {
+ return (this.proto ? '.prototype' : '') + ("[" + (this.index.compile(o, LEVEL_PAREN)) + "]");
+ };
+ Index.prototype.isComplex = function() {
+ return this.index.isComplex();
+ };
+ return Index;
+ })();
+ exports.Range = Range = (function() {
+ __extends(Range, Base);
+ Range.prototype.children = ['from', 'to'];
+ function Range(from, to, tag) {
+ this.from = from;
+ this.to = to;
+ this.exclusive = tag === 'exclusive';
+ this.equals = this.exclusive ? '' : '=';
+ }
+ Range.prototype.compileVariables = function(o) {
+ var step, _ref2, _ref3, _ref4, _ref5;
+ o = merge(o, {
+ top: true
+ });
+ _ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1];
+ _ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1];
+ if (step = del(o, 'step')) {
+ _ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1];
+ }
+ _ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
+ if (this.stepVar) {
+ return this.stepNum = this.stepVar.match(SIMPLENUM);
+ }
+ };
+ Range.prototype.compileNode = function(o) {
+ var cond, condPart, from, gt, idx, known, lt, stepPart, to, varPart, _ref2, _ref3;
+ if (!this.fromVar) {
+ this.compileVariables(o);
+ }
+ if (!o.index) {
+ return this.compileArray(o);
+ }
+ known = this.fromNum && this.toNum;
+ idx = del(o, 'index');
+ varPart = "" + idx + " = " + this.fromC;
+ if (this.toC !== this.toVar) {
+ varPart += ", " + this.toC;
+ }
+ if (this.step !== this.stepVar) {
+ varPart += ", " + this.step;
+ }
+ _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1];
+ condPart = this.stepNum ? condPart = +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), condPart = from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = "" + this.fromVar + " <= " + this.toVar, condPart = "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
+ stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? from <= to ? "" + idx + "++" : "" + idx + "--" : "" + cond + " ? " + idx + "++ : " + idx + "--";
+ return "" + varPart + "; " + condPart + "; " + stepPart;
+ };
+ Range.prototype.compileArray = function(o) {
+ var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results;
+ if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) {
+ range = (function() {
+ _results = [];
+ for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); }
+ return _results;
+ }).apply(this);
+ if (this.exclusive) {
+ range.pop();
+ }
+ return "[" + (range.join(', ')) + "]";
+ }
+ idt = this.tab + TAB;
+ i = o.scope.freeVariable('i');
+ result = o.scope.freeVariable('results');
+ pre = "\n" + idt + result + " = [];";
+ if (this.fromNum && this.toNum) {
+ o.index = i;
+ body = this.compileNode(o);
+ } else {
+ vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : '');
+ cond = "" + this.fromVar + " <= " + this.toVar;
+ body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--";
+ }
+ post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent;
+ hasArgs = function(node) {
+ return node != null ? node.contains(function(n) {
+ return n instanceof Literal && n.value === 'arguments' && !n.asKey;
+ }) : void 0;
+ };
+ if (hasArgs(this.from) || hasArgs(this.to)) {
+ args = ', arguments';
+ }
+ return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")";
+ };
+ return Range;
+ })();
+ exports.Slice = Slice = (function() {
+ __extends(Slice, Base);
+ Slice.prototype.children = ['range'];
+ function Slice(range) {
+ this.range = range;
+ Slice.__super__.constructor.call(this);
+ }
+ Slice.prototype.compileNode = function(o) {
+ var compiled, from, fromStr, to, toStr, _ref2;
+ _ref2 = this.range, to = _ref2.to, from = _ref2.from;
+ fromStr = from && from.compile(o, LEVEL_PAREN) || '0';
+ compiled = to && to.compile(o, LEVEL_PAREN);
+ if (to && !(!this.range.exclusive && +compiled === -1)) {
+ toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? (+compiled + 1).toString() : "(" + compiled + " + 1) || 9e9");
+ }
+ return ".slice(" + fromStr + (toStr || '') + ")";
+ };
+ return Slice;
+ })();
+ exports.Obj = Obj = (function() {
+ __extends(Obj, Base);
+ function Obj(props, generated) {
+ this.generated = generated != null ? generated : false;
+ this.objects = this.properties = props || [];
+ }
+ Obj.prototype.children = ['properties'];
+ Obj.prototype.compileNode = function(o) {
+ var i, idt, indent, join, lastNoncom, node, obj, prop, props, _i, _len;
+ props = this.properties;
+ if (!props.length) {
+ if (this.front) {
+ return '({})';
+ } else {
+ return '{}';
+ }
+ }
+ if (this.generated) {
+ for (_i = 0, _len = props.length; _i < _len; _i++) {
+ node = props[_i];
+ if (node instanceof Value) {
+ throw new Error('cannot have an implicit value in an implicit object');
+ }
+ }
+ }
+ idt = o.indent += TAB;
+ lastNoncom = this.lastNonComment(this.properties);
+ props = (function() {
+ var _len2, _results;
+ _results = [];
+ for (i = 0, _len2 = props.length; i < _len2; i++) {
+ prop = props[i];
+ join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
+ indent = prop instanceof Comment ? '' : idt;
+ if (prop instanceof Value && prop["this"]) {
+ prop = new Assign(prop.properties[0].name, prop, 'object');
+ }
+ if (!(prop instanceof Comment)) {
+ if (!(prop instanceof Assign)) {
+ prop = new Assign(prop, prop, 'object');
+ }
+ (prop.variable.base || prop.variable).asKey = true;
+ }
+ _results.push(indent + prop.compile(o, LEVEL_TOP) + join);
+ }
+ return _results;
+ })();
+ props = props.join('');
+ obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
+ if (this.front) {
+ return "(" + obj + ")";
+ } else {
+ return obj;
+ }
+ };
+ Obj.prototype.assigns = function(name) {
+ var prop, _i, _len, _ref2;
+ _ref2 = this.properties;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ prop = _ref2[_i];
+ if (prop.assigns(name)) {
+ return true;
+ }
+ }
+ return false;
+ };
+ return Obj;
+ })();
+ exports.Arr = Arr = (function() {
+ __extends(Arr, Base);
+ function Arr(objs) {
+ this.objects = objs || [];
+ }
+ Arr.prototype.children = ['objects'];
+ Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects;
+ Arr.prototype.compileNode = function(o) {
+ var code, obj, objs;
+ if (!this.objects.length) {
+ return '[]';
+ }
+ o.indent += TAB;
+ objs = this.filterImplicitObjects(this.objects);
+ if (code = Splat.compileSplattedArray(o, objs)) {
+ return code;
+ }
+ code = ((function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = objs.length; _i < _len; _i++) {
+ obj = objs[_i];
+ _results.push(obj.compile(o, LEVEL_LIST));
+ }
+ return _results;
+ })()).join(', ');
+ if (code.indexOf('\n') >= 0) {
+ return "[\n" + o.indent + code + "\n" + this.tab + "]";
+ } else {
+ return "[" + code + "]";
+ }
+ };
+ Arr.prototype.assigns = function(name) {
+ var obj, _i, _len, _ref2;
+ _ref2 = this.objects;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ obj = _ref2[_i];
+ if (obj.assigns(name)) {
+ return true;
+ }
+ }
+ return false;
+ };
+ return Arr;
+ })();
+ exports.Class = Class = (function() {
+ __extends(Class, Base);
+ function Class(variable, parent, body) {
+ this.variable = variable;
+ this.parent = parent;
+ this.body = body != null ? body : new Block;
+ this.boundFuncs = [];
+ this.body.classBody = true;
+ }
+ Class.prototype.children = ['variable', 'parent', 'body'];
+ Class.prototype.determineName = function() {
+ var decl, tail;
+ if (!this.variable) {
+ return null;
+ }
+ decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value;
+ return decl && (decl = IDENTIFIER.test(decl) && decl);
+ };
+ Class.prototype.setContext = function(name) {
+ return this.body.traverseChildren(false, function(node) {
+ if (node.classBody) {
+ return false;
+ }
+ if (node instanceof Literal && node.value === 'this') {
+ return node.value = name;
+ } else if (node instanceof Code) {
+ node.klass = name;
+ if (node.bound) {
+ return node.context = name;
+ }
+ }
+ });
+ };
+ Class.prototype.addBoundFunctions = function(o) {
+ var bvar, lhs, _i, _len, _ref2, _results;
+ if (this.boundFuncs.length) {
+ _ref2 = this.boundFuncs;
+ _results = [];
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ bvar = _ref2[_i];
+ lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
+ _results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)")));
+ }
+ return _results;
+ }
+ };
+ Class.prototype.addProperties = function(node, name, o) {
+ var assign, base, exprs, func, props;
+ props = node.base.properties.slice(0);
+ exprs = (function() {
+ var _results;
+ _results = [];
+ while (assign = props.shift()) {
+ if (assign instanceof Assign) {
+ base = assign.variable.base;
+ delete assign.context;
+ func = assign.value;
+ if (base.value === 'constructor') {
+ if (this.ctor) {
+ throw new Error('cannot define more than one constructor in a class');
+ }
+ if (func.bound) {
+ throw new Error('cannot define a constructor as a bound function');
+ }
+ if (func instanceof Code) {
+ assign = this.ctor = func;
+ } else {
+ this.externalCtor = o.scope.freeVariable('class');
+ assign = new Assign(new Literal(this.externalCtor), func);
+ }
+ } else {
+ if (!assign.variable["this"]) {
+ assign.variable = new Value(new Literal(name), [new Access(base, 'proto')]);
+ }
+ if (func instanceof Code && func.bound) {
+ this.boundFuncs.push(base);
+ func.bound = false;
+ }
+ }
+ }
+ _results.push(assign);
+ }
+ return _results;
+ }).call(this);
+ return compact(exprs);
+ };
+ Class.prototype.walkBody = function(name, o) {
+ return this.traverseChildren(false, __bind(function(child) {
+ var exps, i, node, _len, _ref2;
+ if (child instanceof Class) {
+ return false;
+ }
+ if (child instanceof Block) {
+ _ref2 = exps = child.expressions;
+ for (i = 0, _len = _ref2.length; i < _len; i++) {
+ node = _ref2[i];
+ if (node instanceof Value && node.isObject(true)) {
+ exps[i] = this.addProperties(node, name, o);
+ }
+ }
+ return child.expressions = exps = flatten(exps);
+ }
+ }, this));
+ };
+ Class.prototype.ensureConstructor = function(name) {
+ if (!this.ctor) {
+ this.ctor = new Code;
+ if (this.parent) {
+ this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
+ }
+ if (this.externalCtor) {
+ this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)"));
+ }
+ this.body.expressions.unshift(this.ctor);
+ }
+ this.ctor.ctor = this.ctor.name = name;
+ this.ctor.klass = null;
+ return this.ctor.noReturn = true;
+ };
+ Class.prototype.compileNode = function(o) {
+ var decl, klass, lname, name;
+ decl = this.determineName();
+ name = decl || this.name || '_Class';
+ lname = new Literal(name);
+ this.setContext(name);
+ this.walkBody(name, o);
+ this.ensureConstructor(name);
+ if (this.parent) {
+ this.body.expressions.unshift(new Extends(lname, this.parent));
+ }
+ if (!(this.ctor instanceof Code)) {
+ this.body.expressions.unshift(this.ctor);
+ }
+ this.body.expressions.push(lname);
+ this.addBoundFunctions(o);
+ klass = new Parens(Closure.wrap(this.body), true);
+ if (this.variable) {
+ klass = new Assign(this.variable, klass);
+ }
+ return klass.compile(o);
+ };
+ return Class;
+ })();
+ exports.Assign = Assign = (function() {
+ __extends(Assign, Base);
+ function Assign(variable, value, context, options) {
+ this.variable = variable;
+ this.value = value;
+ this.context = context;
+ this.param = options && options.param;
+ }
+ Assign.prototype.children = ['variable', 'value'];
+ Assign.prototype.isStatement = function(o) {
+ return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0;
+ };
+ Assign.prototype.assigns = function(name) {
+ return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
+ };
+ Assign.prototype.unfoldSoak = function(o) {
+ return unfoldSoak(o, this, 'variable');
+ };
+ Assign.prototype.compileNode = function(o) {
+ var isValue, match, name, val, _ref2, _ref3, _ref4, _ref5;
+ if (isValue = this.variable instanceof Value) {
+ if (this.variable.isArray() || this.variable.isObject()) {
+ return this.compilePatternMatch(o);
+ }
+ if (this.variable.isSplice()) {
+ return this.compileSplice(o);
+ }
+ if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') {
+ return this.compileConditional(o);
+ }
+ }
+ name = this.variable.compile(o, LEVEL_LIST);
+ if (!(this.context || this.variable.isAssignable())) {
+ throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned.");
+ }
+ if (!(this.context || isValue && (this.variable.namespaced || this.variable.hasProperties()))) {
+ if (this.param) {
+ o.scope.add(name, 'var');
+ } else {
+ o.scope.find(name);
+ }
+ }
+ if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) {
+ if (match[1]) {
+ this.value.klass = match[1];
+ }
+ this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5];
+ }
+ val = this.value.compile(o, LEVEL_LIST);
+ if (this.context === 'object') {
+ return "" + name + ": " + val;
+ }
+ val = name + (" " + (this.context || '=') + " ") + val;
+ if (o.level <= LEVEL_LIST) {
+ return val;
+ } else {
+ return "(" + val + ")";
+ }
+ };
+ Assign.prototype.compilePatternMatch = function(o) {
+ var acc, assigns, code, i, idx, isObject, ivar, obj, objects, olen, ref, rest, splat, top, val, value, vvar, _len, _ref2, _ref3, _ref4, _ref5;
+ top = o.level === LEVEL_TOP;
+ value = this.value;
+ objects = this.variable.base.objects;
+ if (!(olen = objects.length)) {
+ code = value.compile(o);
+ if (o.level >= LEVEL_OP) {
+ return "(" + code + ")";
+ } else {
+ return code;
+ }
+ }
+ isObject = this.variable.isObject();
+ if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) {
+ if (obj instanceof Assign) {
+ _ref2 = obj, idx = _ref2.variable.base, obj = _ref2.value;
+ } else {
+ if (obj.base instanceof Parens) {
+ _ref3 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref3[0], idx = _ref3[1];
+ } else {
+ idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
+ }
+ }
+ acc = IDENTIFIER.test(idx.unwrap().value || 0);
+ value = new Value(value);
+ value.properties.push(new (acc ? Access : Index)(idx));
+ return new Assign(obj, value, null, {
+ param: this.param
+ }).compile(o, LEVEL_TOP);
+ }
+ vvar = value.compile(o, LEVEL_LIST);
+ assigns = [];
+ splat = false;
+ if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) {
+ assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar);
+ vvar = ref;
+ }
+ for (i = 0, _len = objects.length; i < _len; i++) {
+ obj = objects[i];
+ idx = i;
+ if (isObject) {
+ if (obj instanceof Assign) {
+ _ref4 = obj, idx = _ref4.variable.base, obj = _ref4.value;
+ } else {
+ if (obj.base instanceof Parens) {
+ _ref5 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref5[0], idx = _ref5[1];
+ } else {
+ idx = obj["this"] ? obj.properties[0].name : obj;
+ }
+ }
+ }
+ if (!splat && obj instanceof Splat) {
+ val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i;
+ if (rest = olen - i - 1) {
+ ivar = o.scope.freeVariable('i');
+ val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
+ } else {
+ val += ") : []";
+ }
+ val = new Literal(val);
+ splat = "" + ivar + "++";
+ } else {
+ if (obj instanceof Splat) {
+ obj = obj.name.compile(o);
+ throw SyntaxError("multiple splats are disallowed in an assignment: " + obj + " ...");
+ }
+ if (typeof idx === 'number') {
+ idx = new Literal(splat || idx);
+ acc = false;
+ } else {
+ acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0);
+ }
+ val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]);
+ }
+ assigns.push(new Assign(obj, val, null, {
+ param: this.param
+ }).compile(o, LEVEL_TOP));
+ }
+ if (!top) {
+ assigns.push(vvar);
+ }
+ code = assigns.join(', ');
+ if (o.level < LEVEL_LIST) {
+ return code;
+ } else {
+ return "(" + code + ")";
+ }
+ };
+ Assign.prototype.compileConditional = function(o) {
+ var left, rite, _ref2;
+ _ref2 = this.variable.cacheReference(o), left = _ref2[0], rite = _ref2[1];
+ if (__indexOf.call(this.context, "?") >= 0) {
+ o.isExistentialEquals = true;
+ }
+ return new Op(this.context.slice(0, -1), left, new Assign(rite, this.value, '=')).compile(o);
+ };
+ Assign.prototype.compileSplice = function(o) {
+ var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
+ _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive;
+ name = this.variable.compile(o);
+ _ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1];
+ if (to) {
+ if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) {
+ to = +to.compile(o) - +fromRef;
+ if (!exclusive) {
+ to += 1;
+ }
+ } else {
+ to = to.compile(o) + ' - ' + fromRef;
+ if (!exclusive) {
+ to += ' + 1';
+ }
+ }
+ } else {
+ to = "9e9";
+ }
+ _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1];
+ code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef;
+ if (o.level > LEVEL_TOP) {
+ return "(" + code + ")";
+ } else {
+ return code;
+ }
+ };
+ return Assign;
+ })();
+ exports.Code = Code = (function() {
+ __extends(Code, Base);
+ function Code(params, body, tag) {
+ this.params = params || [];
+ this.body = body || new Block;
+ this.bound = tag === 'boundfunc';
+ if (this.bound) {
+ this.context = 'this';
+ }
+ }
+ Code.prototype.children = ['params', 'body'];
+ Code.prototype.isStatement = function() {
+ return !!this.ctor;
+ };
+ Code.prototype.jumps = NO;
+ Code.prototype.compileNode = function(o) {
+ var code, exprs, i, idt, lit, p, param, ref, splats, v, val, vars, wasEmpty, _i, _j, _k, _len, _len2, _len3, _len4, _ref2, _ref3, _ref4, _ref5;
+ o.scope = new Scope(o.scope, this.body, this);
+ o.scope.shared = del(o, 'sharedScope');
+ o.indent += TAB;
+ delete o.bare;
+ vars = [];
+ exprs = [];
+ _ref2 = this.params;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ param = _ref2[_i];
+ if (param.splat) {
+ _ref3 = this.params;
+ for (_j = 0, _len2 = _ref3.length; _j < _len2; _j++) {
+ p = _ref3[_j];
+ if (p.name.value) {
+ o.scope.add(p.name.value, 'var', true);
+ }
+ }
+ splats = new Assign(new Value(new Arr((function() {
+ var _k, _len3, _ref4, _results;
+ _ref4 = this.params;
+ _results = [];
+ for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) {
+ p = _ref4[_k];
+ _results.push(p.asReference(o));
+ }
+ return _results;
+ }).call(this))), new Value(new Literal('arguments')));
+ break;
+ }
+ }
+ _ref4 = this.params;
+ for (_k = 0, _len3 = _ref4.length; _k < _len3; _k++) {
+ param = _ref4[_k];
+ if (param.isComplex()) {
+ val = ref = param.asReference(o);
+ if (param.value) {
+ val = new Op('?', ref, param.value);
+ }
+ exprs.push(new Assign(new Value(param.name), val, '=', {
+ param: true
+ }));
+ } else {
+ ref = param;
+ if (param.value) {
+ lit = new Literal(ref.name.value + ' == null');
+ val = new Assign(new Value(param.name), param.value, '=');
+ exprs.push(new If(lit, val));
+ }
+ }
+ if (!splats) {
+ vars.push(ref);
+ }
+ }
+ wasEmpty = this.body.isEmpty();
+ if (splats) {
+ exprs.unshift(splats);
+ }
+ if (exprs.length) {
+ (_ref5 = this.body.expressions).unshift.apply(_ref5, exprs);
+ }
+ if (!splats) {
+ for (i = 0, _len4 = vars.length; i < _len4; i++) {
+ v = vars[i];
+ o.scope.parameter(vars[i] = v.compile(o));
+ }
+ }
+ if (!(wasEmpty || this.noReturn)) {
+ this.body.makeReturn();
+ }
+ idt = o.indent;
+ code = 'function';
+ if (this.ctor) {
+ code += ' ' + this.name;
+ }
+ code += '(' + vars.join(', ') + ') {';
+ if (!this.body.isEmpty()) {
+ code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab;
+ }
+ code += '}';
+ if (this.ctor) {
+ return this.tab + code;
+ }
+ if (this.bound) {
+ return utility('bind') + ("(" + code + ", " + this.context + ")");
+ }
+ if (this.front || (o.level >= LEVEL_ACCESS)) {
+ return "(" + code + ")";
+ } else {
+ return code;
+ }
+ };
+ Code.prototype.traverseChildren = function(crossScope, func) {
+ if (crossScope) {
+ return Code.__super__.traverseChildren.call(this, crossScope, func);
+ }
+ };
+ return Code;
+ })();
+ exports.Param = Param = (function() {
+ __extends(Param, Base);
+ function Param(name, value, splat) {
+ this.name = name;
+ this.value = value;
+ this.splat = splat;
+ }
+ Param.prototype.children = ['name', 'value'];
+ Param.prototype.compile = function(o) {
+ return this.name.compile(o, LEVEL_LIST);
+ };
+ Param.prototype.asReference = function(o) {
+ var node;
+ if (this.reference) {
+ return this.reference;
+ }
+ node = this.name;
+ if (node["this"]) {
+ node = node.properties[0].name;
+ if (node.value.reserved) {
+ node = new Literal('_' + node.value);
+ }
+ } else if (node.isComplex()) {
+ node = new Literal(o.scope.freeVariable('arg'));
+ }
+ node = new Value(node);
+ if (this.splat) {
+ node = new Splat(node);
+ }
+ return this.reference = node;
+ };
+ Param.prototype.isComplex = function() {
+ return this.name.isComplex();
+ };
+ return Param;
+ })();
+ exports.Splat = Splat = (function() {
+ __extends(Splat, Base);
+ Splat.prototype.children = ['name'];
+ Splat.prototype.isAssignable = YES;
+ function Splat(name) {
+ this.name = name.compile ? name : new Literal(name);
+ }
+ Splat.prototype.assigns = function(name) {
+ return this.name.assigns(name);
+ };
+ Splat.prototype.compile = function(o) {
+ if (this.index != null) {
+ return this.compileParam(o);
+ } else {
+ return this.name.compile(o);
+ }
+ };
+ Splat.compileSplattedArray = function(o, list, apply) {
+ var args, base, code, i, index, node, _len;
+ index = -1;
+ while ((node = list[++index]) && !(node instanceof Splat)) {
+ continue;
+ }
+ if (index >= list.length) {
+ return '';
+ }
+ if (list.length === 1) {
+ code = list[0].compile(o, LEVEL_LIST);
+ if (apply) {
+ return code;
+ }
+ return "" + (utility('slice')) + ".call(" + code + ")";
+ }
+ args = list.slice(index);
+ for (i = 0, _len = args.length; i < _len; i++) {
+ node = args[i];
+ code = node.compile(o, LEVEL_LIST);
+ args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]";
+ }
+ if (index === 0) {
+ return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")");
+ }
+ base = (function() {
+ var _i, _len2, _ref2, _results;
+ _ref2 = list.slice(0, index);
+ _results = [];
+ for (_i = 0, _len2 = _ref2.length; _i < _len2; _i++) {
+ node = _ref2[_i];
+ _results.push(node.compile(o, LEVEL_LIST));
+ }
+ return _results;
+ })();
+ return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")";
+ };
+ return Splat;
+ })();
+ exports.While = While = (function() {
+ __extends(While, Base);
+ function While(condition, options) {
+ this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition;
+ this.guard = options != null ? options.guard : void 0;
+ }
+ While.prototype.children = ['condition', 'guard', 'body'];
+ While.prototype.isStatement = YES;
+ While.prototype.makeReturn = function() {
+ this.returns = true;
+ return this;
+ };
+ While.prototype.addBody = function(body) {
+ this.body = body;
+ return this;
+ };
+ While.prototype.jumps = function() {
+ var expressions, node, _i, _len;
+ expressions = this.body.expressions;
+ if (!expressions.length) {
+ return false;
+ }
+ for (_i = 0, _len = expressions.length; _i < _len; _i++) {
+ node = expressions[_i];
+ if (node.jumps({
+ loop: true
+ })) {
+ return node;
+ }
+ }
+ return false;
+ };
+ While.prototype.compileNode = function(o) {
+ var body, code, rvar, set;
+ o.indent += TAB;
+ set = '';
+ body = this.body;
+ if (body.isEmpty()) {
+ body = '';
+ } else {
+ if (o.level > LEVEL_TOP || this.returns) {
+ rvar = o.scope.freeVariable('results');
+ set = "" + this.tab + rvar + " = [];\n";
+ if (body) {
+ body = Push.wrap(rvar, body);
+ }
+ }
+ if (this.guard) {
+ body = Block.wrap([new If(this.guard, body)]);
+ }
+ body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab;
+ }
+ code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}");
+ if (this.returns) {
+ code += "\n" + this.tab + "return " + rvar + ";";
+ }
+ return code;
+ };
+ return While;
+ })();
+ exports.Op = Op = (function() {
+ var CONVERSIONS, INVERSIONS;
+ __extends(Op, Base);
+ function Op(op, first, second, flip) {
+ var call;
+ if (op === 'in') {
+ return new In(first, second);
+ }
+ if (op === 'do') {
+ call = new Call(first, first.params || []);
+ call["do"] = true;
+ return call;
+ }
+ if (op === 'new') {
+ if (first instanceof Call && !first["do"] && !first.isNew) {
+ return first.newInstance();
+ }
+ if (first instanceof Code && first.bound || first["do"]) {
+ first = new Parens(first);
+ }
+ }
+ this.operator = CONVERSIONS[op] || op;
+ this.first = first;
+ this.second = second;
+ this.flip = !!flip;
+ return this;
+ }
+ CONVERSIONS = {
+ '==': '===',
+ '!=': '!==',
+ 'of': 'in'
+ };
+ INVERSIONS = {
+ '!==': '===',
+ '===': '!=='
+ };
+ Op.prototype.children = ['first', 'second'];
+ Op.prototype.isSimpleNumber = NO;
+ Op.prototype.isUnary = function() {
+ return !this.second;
+ };
+ Op.prototype.isComplex = function() {
+ var _ref2;
+ return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex();
+ };
+ Op.prototype.isChainable = function() {
+ var _ref2;
+ return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!==';
+ };
+ Op.prototype.invert = function() {
+ var allInvertable, curr, fst, op, _ref2;
+ if (this.isChainable() && this.first.isChainable()) {
+ allInvertable = true;
+ curr = this;
+ while (curr && curr.operator) {
+ allInvertable && (allInvertable = curr.operator in INVERSIONS);
+ curr = curr.first;
+ }
+ if (!allInvertable) {
+ return new Parens(this).invert();
+ }
+ curr = this;
+ while (curr && curr.operator) {
+ curr.invert = !curr.invert;
+ curr.operator = INVERSIONS[curr.operator];
+ curr = curr.first;
+ }
+ return this;
+ } else if (op = INVERSIONS[this.operator]) {
+ this.operator = op;
+ if (this.first.unwrap() instanceof Op) {
+ this.first.invert();
+ }
+ return this;
+ } else if (this.second) {
+ return new Parens(this).invert();
+ } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) {
+ return fst;
+ } else {
+ return new Op('!', this);
+ }
+ };
+ Op.prototype.unfoldSoak = function(o) {
+ var _ref2;
+ return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first');
+ };
+ Op.prototype.compileNode = function(o) {
+ var code;
+ if (this.isUnary()) {
+ return this.compileUnary(o);
+ }
+ if (this.isChainable() && this.first.isChainable()) {
+ return this.compileChain(o);
+ }
+ if (this.operator === '?') {
+ return this.compileExistence(o);
+ }
+ this.first.front = this.front;
+ code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP);
+ if (o.level <= LEVEL_OP) {
+ return code;
+ } else {
+ return "(" + code + ")";
+ }
+ };
+ Op.prototype.compileChain = function(o) {
+ var code, fst, shared, _ref2;
+ _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1];
+ fst = this.first.compile(o, LEVEL_OP);
+ code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP));
+ return "(" + code + ")";
+ };
+ Op.prototype.compileExistence = function(o) {
+ var fst, ref;
+ if (this.first.isComplex()) {
+ ref = new Literal(o.scope.freeVariable('ref'));
+ fst = new Parens(new Assign(ref, this.first));
+ } else {
+ fst = this.first;
+ ref = fst;
+ }
+ return new If(new Existence(fst), ref, {
+ type: 'if'
+ }).addElse(this.second).compile(o);
+ };
+ Op.prototype.compileUnary = function(o) {
+ var op, parts;
+ parts = [op = this.operator];
+ if ((op === 'new' || op === 'typeof' || op === 'delete') || (op === '+' || op === '-') && this.first instanceof Op && this.first.operator === op) {
+ parts.push(' ');
+ }
+ if (op === 'new' && this.first.isStatement(o)) {
+ this.first = new Parens(this.first);
+ }
+ parts.push(this.first.compile(o, LEVEL_OP));
+ if (this.flip) {
+ parts.reverse();
+ }
+ return parts.join('');
+ };
+ Op.prototype.toString = function(idt) {
+ return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator);
+ };
+ return Op;
+ })();
+ exports.In = In = (function() {
+ __extends(In, Base);
+ function In(object, array) {
+ this.object = object;
+ this.array = array;
+ }
+ In.prototype.children = ['object', 'array'];
+ In.prototype.invert = NEGATE;
+ In.prototype.compileNode = function(o) {
+ var hasSplat, obj, _i, _len, _ref2;
+ if (this.array instanceof Value && this.array.isArray()) {
+ _ref2 = this.array.base.objects;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ obj = _ref2[_i];
+ if (obj instanceof Splat) {
+ hasSplat = true;
+ break;
+ }
+ }
+ if (!hasSplat) {
+ return this.compileOrTest(o);
+ }
+ }
+ return this.compileLoopTest(o);
+ };
+ In.prototype.compileOrTest = function(o) {
+ var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3;
+ _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1];
+ _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1];
+ tests = (function() {
+ var _len, _ref4, _results;
+ _ref4 = this.array.base.objects;
+ _results = [];
+ for (i = 0, _len = _ref4.length; i < _len; i++) {
+ item = _ref4[i];
+ _results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_OP));
+ }
+ return _results;
+ }).call(this);
+ if (tests.length === 0) {
+ return 'false';
+ }
+ tests = tests.join(cnj);
+ if (o.level < LEVEL_OP) {
+ return tests;
+ } else {
+ return "(" + tests + ")";
+ }
+ };
+ In.prototype.compileLoopTest = function(o) {
+ var code, ref, sub, _ref2;
+ _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1];
+ code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0');
+ if (sub === ref) {
+ return code;
+ }
+ code = sub + ', ' + code;
+ if (o.level < LEVEL_LIST) {
+ return code;
+ } else {
+ return "(" + code + ")";
+ }
+ };
+ In.prototype.toString = function(idt) {
+ return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : ''));
+ };
+ return In;
+ })();
+ exports.Try = Try = (function() {
+ __extends(Try, Base);
+ function Try(attempt, error, recovery, ensure) {
+ this.attempt = attempt;
+ this.error = error;
+ this.recovery = recovery;
+ this.ensure = ensure;
+ }
+ Try.prototype.children = ['attempt', 'recovery', 'ensure'];
+ Try.prototype.isStatement = YES;
+ Try.prototype.jumps = function(o) {
+ var _ref2;
+ return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0);
+ };
+ Try.prototype.makeReturn = function() {
+ if (this.attempt) {
+ this.attempt = this.attempt.makeReturn();
+ }
+ if (this.recovery) {
+ this.recovery = this.recovery.makeReturn();
+ }
+ return this;
+ };
+ Try.prototype.compileNode = function(o) {
+ var catchPart, errorPart;
+ o.indent += TAB;
+ errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' ';
+ catchPart = this.recovery ? (o.scope.add(this.error.value, 'param'), " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}") : !(this.ensure || this.recovery) ? ' catch (_e) {}' : void 0;
+ return ("" + this.tab + "try {\n" + (this.attempt.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" + (catchPart || '')) + (this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : '');
+ };
+ return Try;
+ })();
+ exports.Throw = Throw = (function() {
+ __extends(Throw, Base);
+ function Throw(expression) {
+ this.expression = expression;
+ }
+ Throw.prototype.children = ['expression'];
+ Throw.prototype.isStatement = YES;
+ Throw.prototype.jumps = NO;
+ Throw.prototype.makeReturn = THIS;
+ Throw.prototype.compileNode = function(o) {
+ return this.tab + ("throw " + (this.expression.compile(o)) + ";");
+ };
+ return Throw;
+ })();
+ exports.Existence = Existence = (function() {
+ __extends(Existence, Base);
+ function Existence(expression) {
+ this.expression = expression;
+ }
+ Existence.prototype.children = ['expression'];
+ Existence.prototype.invert = NEGATE;
+ Existence.prototype.compileNode = function(o) {
+ var cmp, cnj, code, _ref2;
+ code = this.expression.compile(o, LEVEL_OP);
+ code = IDENTIFIER.test(code) && !o.scope.check(code) ? ((_ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1], _ref2), "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null") : "" + code + " " + (this.negated ? '==' : '!=') + " null";
+ if (o.level <= LEVEL_COND) {
+ return code;
+ } else {
+ return "(" + code + ")";
+ }
+ };
+ return Existence;
+ })();
+ exports.Parens = Parens = (function() {
+ __extends(Parens, Base);
+ function Parens(body) {
+ this.body = body;
+ }
+ Parens.prototype.children = ['body'];
+ Parens.prototype.unwrap = function() {
+ return this.body;
+ };
+ Parens.prototype.isComplex = function() {
+ return this.body.isComplex();
+ };
+ Parens.prototype.makeReturn = function() {
+ return this.body.makeReturn();
+ };
+ Parens.prototype.compileNode = function(o) {
+ var bare, code, expr;
+ expr = this.body.unwrap();
+ if (expr instanceof Value && expr.isAtomic()) {
+ expr.front = this.front;
+ return expr.compile(o);
+ }
+ code = expr.compile(o, LEVEL_PAREN);
+ bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns));
+ if (bare) {
+ return code;
+ } else {
+ return "(" + code + ")";
+ }
+ };
+ return Parens;
+ })();
+ exports.For = For = (function() {
+ __extends(For, Base);
+ function For(body, source) {
+ var _ref2;
+ this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index;
+ this.body = Block.wrap([body]);
+ this.own = !!source.own;
+ this.object = !!source.object;
+ if (this.object) {
+ _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1];
+ }
+ if (this.index instanceof Value) {
+ throw SyntaxError('index cannot be a pattern matching expression');
+ }
+ this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length;
+ this.pattern = this.name instanceof Value;
+ if (this.range && this.index) {
+ throw SyntaxError('indexes do not apply to range loops');
+ }
+ if (this.range && this.pattern) {
+ throw SyntaxError('cannot pattern match over range loops');
+ }
+ this.returns = false;
+ }
+ For.prototype.children = ['body', 'source', 'guard', 'step'];
+ For.prototype.isStatement = YES;
+ For.prototype.jumps = While.prototype.jumps;
+ For.prototype.makeReturn = function() {
+ this.returns = true;
+ return this;
+ };
+ For.prototype.compileNode = function(o) {
+ var body, defPart, forPart, forVarPart, guardPart, idt1, index, ivar, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, stepPart, stepvar, svar, varPart, _ref2;
+ body = Block.wrap([this.body]);
+ lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0;
+ if (lastJumps && lastJumps instanceof Return) {
+ this.returns = false;
+ }
+ source = this.range ? this.source.base : this.source;
+ scope = o.scope;
+ name = this.name && this.name.compile(o, LEVEL_LIST);
+ index = this.index && this.index.compile(o, LEVEL_LIST);
+ if (name && !this.pattern) {
+ scope.find(name, {
+ immediate: true
+ });
+ }
+ if (index) {
+ scope.find(index, {
+ immediate: true
+ });
+ }
+ if (this.returns) {
+ rvar = scope.freeVariable('results');
+ }
+ ivar = (this.range ? name : index) || scope.freeVariable('i');
+ if (this.step && !this.range) {
+ stepvar = scope.freeVariable("step");
+ }
+ if (this.pattern) {
+ name = ivar;
+ }
+ varPart = '';
+ guardPart = '';
+ defPart = '';
+ idt1 = this.tab + TAB;
+ if (this.range) {
+ forPart = source.compile(merge(o, {
+ index: ivar,
+ step: this.step
+ }));
+ } else {
+ svar = this.source.compile(o, LEVEL_LIST);
+ if ((name || this.own) && !IDENTIFIER.test(svar)) {
+ defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n";
+ svar = ref;
+ }
+ if (name && !this.pattern) {
+ namePart = "" + name + " = " + svar + "[" + ivar + "]";
+ }
+ if (!this.object) {
+ lvar = scope.freeVariable('len');
+ forVarPart = ("" + ivar + " = 0, " + lvar + " = " + svar + ".length") + (this.step ? ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP)) : '');
+ stepPart = this.step ? "" + ivar + " += " + stepvar : "" + ivar + "++";
+ forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart;
+ }
+ }
+ if (this.returns) {
+ resultPart = "" + this.tab + rvar + " = [];\n";
+ returnResult = "\n" + this.tab + "return " + rvar + ";";
+ body = Push.wrap(rvar, body);
+ }
+ if (this.guard) {
+ body = Block.wrap([new If(this.guard, body)]);
+ }
+ if (this.pattern) {
+ body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + ivar + "]")));
+ }
+ defPart += this.pluckDirectCall(o, body);
+ if (namePart) {
+ varPart = "\n" + idt1 + namePart + ";";
+ }
+ if (this.object) {
+ forPart = "" + ivar + " in " + svar;
+ if (this.own) {
+ guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + ivar + ")) continue;";
+ }
+ }
+ body = body.compile(merge(o, {
+ indent: idt1
+ }), LEVEL_TOP);
+ if (body) {
+ body = '\n' + body + '\n';
+ }
+ return "" + defPart + (resultPart || '') + this.tab + "for (" + forPart + ") {" + guardPart + varPart + body + this.tab + "}" + (returnResult || '');
+ };
+ For.prototype.pluckDirectCall = function(o, body) {
+ var base, defs, expr, fn, idx, ref, val, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
+ defs = '';
+ _ref2 = body.expressions;
+ for (idx = 0, _len = _ref2.length; idx < _len; idx++) {
+ expr = _ref2[idx];
+ expr = expr.unwrapAll();
+ if (!(expr instanceof Call)) {
+ continue;
+ }
+ val = expr.variable.unwrapAll();
+ if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) {
+ continue;
+ }
+ fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val;
+ ref = new Literal(o.scope.freeVariable('fn'));
+ base = new Value(ref);
+ if (val.base) {
+ _ref7 = [base, val], val.base = _ref7[0], base = _ref7[1];
+ }
+ body.expressions[idx] = new Call(base, expr.args);
+ defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n';
+ }
+ return defs;
+ };
+ return For;
+ })();
+ exports.Switch = Switch = (function() {
+ __extends(Switch, Base);
+ function Switch(subject, cases, otherwise) {
+ this.subject = subject;
+ this.cases = cases;
+ this.otherwise = otherwise;
+ }
+ Switch.prototype.children = ['subject', 'cases', 'otherwise'];
+ Switch.prototype.isStatement = YES;
+ Switch.prototype.jumps = function(o) {
+ var block, conds, _i, _len, _ref2, _ref3, _ref4;
+ if (o == null) {
+ o = {
+ block: true
+ };
+ }
+ _ref2 = this.cases;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1];
+ if (block.jumps(o)) {
+ return block;
+ }
+ }
+ return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0;
+ };
+ Switch.prototype.makeReturn = function() {
+ var pair, _i, _len, _ref2, _ref3;
+ _ref2 = this.cases;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ pair = _ref2[_i];
+ pair[1].makeReturn();
+ }
+ if ((_ref3 = this.otherwise) != null) {
+ _ref3.makeReturn();
+ }
+ return this;
+ };
+ Switch.prototype.compileNode = function(o) {
+ var block, body, code, cond, conditions, expr, i, idt1, idt2, _i, _len, _len2, _ref2, _ref3, _ref4, _ref5;
+ idt1 = o.indent + TAB;
+ idt2 = o.indent = idt1 + TAB;
+ code = this.tab + ("switch (" + (((_ref2 = this.subject) != null ? _ref2.compile(o, LEVEL_PAREN) : void 0) || false) + ") {\n");
+ _ref3 = this.cases;
+ for (i = 0, _len = _ref3.length; i < _len; i++) {
+ _ref4 = _ref3[i], conditions = _ref4[0], block = _ref4[1];
+ _ref5 = flatten([conditions]);
+ for (_i = 0, _len2 = _ref5.length; _i < _len2; _i++) {
+ cond = _ref5[_i];
+ if (!this.subject) {
+ cond = cond.invert();
+ }
+ code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n");
+ }
+ if (body = block.compile(o, LEVEL_TOP)) {
+ code += body + '\n';
+ }
+ if (i === this.cases.length - 1 && !this.otherwise) {
+ break;
+ }
+ expr = this.lastNonComment(block.expressions);
+ if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) {
+ continue;
+ }
+ code += idt2 + 'break;\n';
+ }
+ if (this.otherwise && this.otherwise.expressions.length) {
+ code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n");
+ }
+ return code + this.tab + '}';
+ };
+ return Switch;
+ })();
+ exports.If = If = (function() {
+ __extends(If, Base);
+ function If(condition, body, options) {
+ this.body = body;
+ if (options == null) {
+ options = {};
+ }
+ this.condition = options.type === 'unless' ? condition.invert() : condition;
+ this.elseBody = null;
+ this.isChain = false;
+ this.soak = options.soak;
+ }
+ If.prototype.children = ['condition', 'body', 'elseBody'];
+ If.prototype.bodyNode = function() {
+ var _ref2;
+ return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0;
+ };
+ If.prototype.elseBodyNode = function() {
+ var _ref2;
+ return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0;
+ };
+ If.prototype.addElse = function(elseBody) {
+ if (this.isChain) {
+ this.elseBodyNode().addElse(elseBody);
+ } else {
+ this.isChain = elseBody instanceof If;
+ this.elseBody = this.ensureBlock(elseBody);
+ }
+ return this;
+ };
+ If.prototype.isStatement = function(o) {
+ var _ref2;
+ return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0);
+ };
+ If.prototype.jumps = function(o) {
+ var _ref2;
+ return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0);
+ };
+ If.prototype.compileNode = function(o) {
+ if (this.isStatement(o)) {
+ return this.compileStatement(o);
+ } else {
+ return this.compileExpression(o);
+ }
+ };
+ If.prototype.makeReturn = function() {
+ this.body && (this.body = new Block([this.body.makeReturn()]));
+ this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn()]));
+ return this;
+ };
+ If.prototype.ensureBlock = function(node) {
+ if (node instanceof Block) {
+ return node;
+ } else {
+ return new Block([node]);
+ }
+ };
+ If.prototype.compileStatement = function(o) {
+ var body, child, cond, exeq, ifPart;
+ child = del(o, 'chainChild');
+ exeq = del(o, 'isExistentialEquals');
+ if (exeq) {
+ return new If(this.condition.invert(), this.elseBodyNode(), {
+ type: 'if'
+ }).compile(o);
+ }
+ cond = this.condition.compile(o, LEVEL_PAREN);
+ o.indent += TAB;
+ body = this.ensureBlock(this.body).compile(o);
+ if (body) {
+ body = "\n" + body + "\n" + this.tab;
+ }
+ ifPart = "if (" + cond + ") {" + body + "}";
+ if (!child) {
+ ifPart = this.tab + ifPart;
+ }
+ if (!this.elseBody) {
+ return ifPart;
+ }
+ return ifPart + ' else ' + (this.isChain ? (o.indent = this.tab, o.chainChild = true, this.elseBody.unwrap().compile(o, LEVEL_TOP)) : "{\n" + (this.elseBody.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}");
+ };
+ If.prototype.compileExpression = function(o) {
+ var alt, body, code, cond;
+ cond = this.condition.compile(o, LEVEL_COND);
+ body = this.bodyNode().compile(o, LEVEL_LIST);
+ alt = this.elseBodyNode() ? this.elseBodyNode().compile(o, LEVEL_LIST) : 'void 0';
+ code = "" + cond + " ? " + body + " : " + alt;
+ if (o.level >= LEVEL_COND) {
+ return "(" + code + ")";
+ } else {
+ return code;
+ }
+ };
+ If.prototype.unfoldSoak = function() {
+ return this.soak && this;
+ };
+ return If;
+ })();
+ Push = {
+ wrap: function(name, exps) {
+ if (exps.isEmpty() || last(exps.expressions).jumps()) {
+ return exps;
+ }
+ return exps.push(new Call(new Value(new Literal(name), [new Access(new Literal('push'))]), [exps.pop()]));
+ }
+ };
+ Closure = {
+ wrap: function(expressions, statement, noReturn) {
+ var args, call, func, mentionsArgs, meth;
+ if (expressions.jumps()) {
+ return expressions;
+ }
+ func = new Code([], Block.wrap([expressions]));
+ args = [];
+ if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) {
+ meth = new Literal(mentionsArgs ? 'apply' : 'call');
+ args = [new Literal('this')];
+ if (mentionsArgs) {
+ args.push(new Literal('arguments'));
+ }
+ func = new Value(func, [new Access(meth)]);
+ }
+ func.noReturn = noReturn;
+ call = new Call(func, args);
+ if (statement) {
+ return Block.wrap([call]);
+ } else {
+ return call;
+ }
+ },
+ literalArgs: function(node) {
+ return node instanceof Literal && node.value === 'arguments' && !node.asKey;
+ },
+ literalThis: function(node) {
+ return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound);
+ }
+ };
+ unfoldSoak = function(o, parent, name) {
+ var ifn;
+ if (!(ifn = parent[name].unfoldSoak(o))) {
+ return;
+ }
+ parent[name] = ifn.body;
+ ifn.body = new Value(parent);
+ return ifn;
+ };
+ UTILITIES = {
+ "extends": 'function(child, parent) {\n for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor;\n child.__super__ = parent.prototype;\n return child;\n}',
+ bind: 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }',
+ indexOf: 'Array.prototype.indexOf || function(item) {\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === item) return i;\n }\n return -1;\n}',
+ hasProp: 'Object.prototype.hasOwnProperty',
+ slice: 'Array.prototype.slice'
+ };
+ LEVEL_TOP = 1;
+ LEVEL_PAREN = 2;
+ LEVEL_LIST = 3;
+ LEVEL_COND = 4;
+ LEVEL_OP = 5;
+ LEVEL_ACCESS = 6;
+ TAB = ' ';
+ IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
+ IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$");
+ SIMPLENUM = /^[+-]?\d+$/;
+ METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$");
+ IS_STRING = /^['"]/;
+ utility = function(name) {
+ var ref;
+ ref = "__" + name;
+ Scope.root.assign(ref, UTILITIES[name]);
+ return ref;
+ };
+ multident = function(code, tab) {
+ return code.replace(/\n/g, '$&' + tab);
+ };
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/optparse.js b/node_modules/anvil.js/node_modules/coffee-script/lib/optparse.js
new file mode 100755
index 0000000..13841e5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/optparse.js
@@ -0,0 +1,111 @@
+(function() {
+ var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments;
+ exports.OptionParser = OptionParser = (function() {
+ function OptionParser(rules, banner) {
+ this.banner = banner;
+ this.rules = buildRules(rules);
+ }
+ OptionParser.prototype.parse = function(args) {
+ var arg, i, isOption, matchedRule, options, rule, value, _i, _len, _len2, _ref;
+ options = {
+ arguments: [],
+ literals: []
+ };
+ args = normalizeArguments(args);
+ for (i = 0, _len = args.length; i < _len; i++) {
+ arg = args[i];
+ if (arg === '--') {
+ options.literals = args.slice(i + 1);
+ break;
+ }
+ isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG));
+ matchedRule = false;
+ _ref = this.rules;
+ for (_i = 0, _len2 = _ref.length; _i < _len2; _i++) {
+ rule = _ref[_i];
+ if (rule.shortFlag === arg || rule.longFlag === arg) {
+ value = rule.hasArgument ? args[i += 1] : true;
+ options[rule.name] = rule.isList ? (options[rule.name] || []).concat(value) : value;
+ matchedRule = true;
+ break;
+ }
+ }
+ if (isOption && !matchedRule) {
+ throw new Error("unrecognized option: " + arg);
+ }
+ if (!isOption) {
+ options.arguments = args.slice(i);
+ break;
+ }
+ }
+ return options;
+ };
+ OptionParser.prototype.help = function() {
+ var letPart, lines, rule, spaces, _i, _len, _ref;
+ lines = [];
+ if (this.banner) {
+ lines.unshift("" + this.banner + "\n");
+ }
+ _ref = this.rules;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ rule = _ref[_i];
+ spaces = 15 - rule.longFlag.length;
+ spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
+ letPart = rule.shortFlag ? rule.shortFlag + ', ' : ' ';
+ lines.push(' ' + letPart + rule.longFlag + spaces + rule.description);
+ }
+ return "\n" + (lines.join('\n')) + "\n";
+ };
+ return OptionParser;
+ })();
+ LONG_FLAG = /^(--\w[\w\-]+)/;
+ SHORT_FLAG = /^(-\w)/;
+ MULTI_FLAG = /^-(\w{2,})/;
+ OPTIONAL = /\[(\w+(\*?))\]/;
+ buildRules = function(rules) {
+ var tuple, _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = rules.length; _i < _len; _i++) {
+ tuple = rules[_i];
+ if (tuple.length < 3) {
+ tuple.unshift(null);
+ }
+ _results.push(buildRule.apply(null, tuple));
+ }
+ return _results;
+ };
+ buildRule = function(shortFlag, longFlag, description, options) {
+ var match;
+ if (options == null) {
+ options = {};
+ }
+ match = longFlag.match(OPTIONAL);
+ longFlag = longFlag.match(LONG_FLAG)[1];
+ return {
+ name: longFlag.substr(2),
+ shortFlag: shortFlag,
+ longFlag: longFlag,
+ description: description,
+ hasArgument: !!(match && match[1]),
+ isList: !!(match && match[2])
+ };
+ };
+ normalizeArguments = function(args) {
+ var arg, l, match, result, _i, _j, _len, _len2, _ref;
+ args = args.slice(0);
+ result = [];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ arg = args[_i];
+ if (match = arg.match(MULTI_FLAG)) {
+ _ref = match[1].split('');
+ for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) {
+ l = _ref[_j];
+ result.push('-' + l);
+ }
+ } else {
+ result.push(arg);
+ }
+ }
+ return result;
+ };
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/parser.js b/node_modules/anvil.js/node_modules/coffee-script/lib/parser.js
new file mode 100755
index 0000000..789e8ca
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/parser.js
@@ -0,0 +1,676 @@
+/* Jison generated parser */
+var parser = (function(){
+var parser = {trace: function trace() { },
+yy: {},
+symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Throw":11,"Comment":12,"STATEMENT":13,"Value":14,"Invocation":15,"Code":16,"Operation":17,"Assign":18,"If":19,"Try":20,"While":21,"For":22,"Switch":23,"Class":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"BOOL":35,"Assignable":36,"=":37,"AssignObj":38,"ObjAssignable":39,":":40,"ThisProperty":41,"RETURN":42,"HERECOMMENT":43,"PARAM_START":44,"ParamList":45,"PARAM_END":46,"FuncGlyph":47,"->":48,"=>":49,"OptComma":50,",":51,"Param":52,"ParamVar":53,"...":54,"Array":55,"Object":56,"Splat":57,"SimpleAssignable":58,"Accessor":59,"Parenthetical":60,"Range":61,"This":62,".":63,"?.":64,"::":65,"Index":66,"INDEX_START":67,"IndexValue":68,"INDEX_END":69,"INDEX_SOAK":70,"INDEX_PROTO":71,"Slice":72,"{":73,"AssignList":74,"}":75,"CLASS":76,"EXTENDS":77,"OptFuncExist":78,"Arguments":79,"SUPER":80,"FUNC_EXIST":81,"CALL_START":82,"CALL_END":83,"ArgList":84,"THIS":85,"@":86,"[":87,"]":88,"RangeDots":89,"..":90,"Arg":91,"SimpleArgs":92,"TRY":93,"Catch":94,"FINALLY":95,"CATCH":96,"THROW":97,"(":98,")":99,"WhileSource":100,"WHILE":101,"WHEN":102,"UNTIL":103,"Loop":104,"LOOP":105,"ForBody":106,"FOR":107,"ForStart":108,"ForSource":109,"ForVariables":110,"OWN":111,"ForValue":112,"FORIN":113,"FOROF":114,"BY":115,"SWITCH":116,"Whens":117,"ELSE":118,"When":119,"LEADING_WHEN":120,"IfBlock":121,"IF":122,"POST_IF":123,"UNARY":124,"-":125,"+":126,"--":127,"++":128,"?":129,"MATH":130,"SHIFT":131,"COMPARE":132,"LOGIC":133,"RELATION":134,"COMPOUND_ASSIGN":135,"$accept":0,"$end":1},
+terminals_: {2:"error",6:"TERMINATOR",13:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"BOOL",37:"=",40:":",42:"RETURN",43:"HERECOMMENT",44:"PARAM_START",46:"PARAM_END",48:"->",49:"=>",51:",",54:"...",63:".",64:"?.",65:"::",67:"INDEX_START",69:"INDEX_END",70:"INDEX_SOAK",71:"INDEX_PROTO",73:"{",75:"}",76:"CLASS",77:"EXTENDS",80:"SUPER",81:"FUNC_EXIST",82:"CALL_START",83:"CALL_END",85:"THIS",86:"@",87:"[",88:"]",90:"..",93:"TRY",95:"FINALLY",96:"CATCH",97:"THROW",98:"(",99:")",101:"WHILE",102:"WHEN",103:"UNTIL",105:"LOOP",107:"FOR",111:"OWN",113:"FORIN",114:"FOROF",115:"BY",116:"SWITCH",118:"ELSE",120:"LEADING_WHEN",122:"IF",123:"POST_IF",124:"UNARY",125:"-",126:"+",127:"--",128:"++",129:"?",130:"MATH",131:"SHIFT",132:"COMPARE",133:"LOGIC",134:"RELATION",135:"COMPOUND_ASSIGN"},
+productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[18,3],[18,5],[38,1],[38,3],[38,5],[38,1],[39,1],[39,1],[39,1],[10,2],[10,1],[12,1],[16,5],[16,2],[47,1],[47,1],[50,0],[50,1],[45,0],[45,1],[45,3],[52,1],[52,2],[52,3],[53,1],[53,1],[53,1],[53,1],[57,2],[58,1],[58,2],[58,2],[58,1],[36,1],[36,1],[36,1],[14,1],[14,1],[14,1],[14,1],[14,1],[59,2],[59,2],[59,2],[59,1],[59,1],[66,3],[66,2],[66,2],[68,1],[68,1],[56,4],[74,0],[74,1],[74,3],[74,4],[74,6],[24,1],[24,2],[24,3],[24,4],[24,2],[24,3],[24,4],[24,5],[15,3],[15,3],[15,1],[15,2],[78,0],[78,1],[79,2],[79,4],[62,1],[62,1],[41,2],[55,2],[55,4],[89,1],[89,1],[61,5],[72,3],[72,2],[72,2],[84,1],[84,3],[84,4],[84,4],[84,6],[91,1],[91,1],[92,1],[92,3],[20,2],[20,3],[20,4],[20,5],[94,3],[11,2],[60,3],[60,5],[100,2],[100,4],[100,2],[100,4],[21,2],[21,2],[21,2],[21,1],[104,2],[104,2],[22,2],[22,2],[22,2],[106,2],[106,2],[108,2],[108,3],[112,1],[112,1],[112,1],[110,1],[110,3],[109,2],[109,2],[109,4],[109,4],[109,4],[109,6],[109,6],[23,5],[23,7],[23,4],[23,6],[117,1],[117,2],[119,3],[119,4],[121,3],[121,5],[19,1],[19,3],[19,3],[19,3],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,2],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,3],[17,5],[17,3]],
+performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
+
+var $0 = $$.length - 1;
+switch (yystate) {
+case 1:return this.$ = new yy.Block;
+break;
+case 2:return this.$ = $$[$0];
+break;
+case 3:return this.$ = $$[$0-1];
+break;
+case 4:this.$ = yy.Block.wrap([$$[$0]]);
+break;
+case 5:this.$ = $$[$0-2].push($$[$0]);
+break;
+case 6:this.$ = $$[$0-1];
+break;
+case 7:this.$ = $$[$0];
+break;
+case 8:this.$ = $$[$0];
+break;
+case 9:this.$ = $$[$0];
+break;
+case 10:this.$ = $$[$0];
+break;
+case 11:this.$ = $$[$0];
+break;
+case 12:this.$ = new yy.Literal($$[$0]);
+break;
+case 13:this.$ = $$[$0];
+break;
+case 14:this.$ = $$[$0];
+break;
+case 15:this.$ = $$[$0];
+break;
+case 16:this.$ = $$[$0];
+break;
+case 17:this.$ = $$[$0];
+break;
+case 18:this.$ = $$[$0];
+break;
+case 19:this.$ = $$[$0];
+break;
+case 20:this.$ = $$[$0];
+break;
+case 21:this.$ = $$[$0];
+break;
+case 22:this.$ = $$[$0];
+break;
+case 23:this.$ = $$[$0];
+break;
+case 24:this.$ = new yy.Block;
+break;
+case 25:this.$ = $$[$0-1];
+break;
+case 26:this.$ = new yy.Literal($$[$0]);
+break;
+case 27:this.$ = new yy.Literal($$[$0]);
+break;
+case 28:this.$ = new yy.Literal($$[$0]);
+break;
+case 29:this.$ = $$[$0];
+break;
+case 30:this.$ = new yy.Literal($$[$0]);
+break;
+case 31:this.$ = new yy.Literal($$[$0]);
+break;
+case 32:this.$ = (function () {
+ var val;
+ val = new yy.Literal($$[$0]);
+ if ($$[$0] === 'undefined') {
+ val.isUndefined = true;
+ }
+ return val;
+ }());
+break;
+case 33:this.$ = new yy.Assign($$[$0-2], $$[$0]);
+break;
+case 34:this.$ = new yy.Assign($$[$0-4], $$[$0-1]);
+break;
+case 35:this.$ = new yy.Value($$[$0]);
+break;
+case 36:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object');
+break;
+case 37:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object');
+break;
+case 38:this.$ = $$[$0];
+break;
+case 39:this.$ = $$[$0];
+break;
+case 40:this.$ = $$[$0];
+break;
+case 41:this.$ = $$[$0];
+break;
+case 42:this.$ = new yy.Return($$[$0]);
+break;
+case 43:this.$ = new yy.Return;
+break;
+case 44:this.$ = new yy.Comment($$[$0]);
+break;
+case 45:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]);
+break;
+case 46:this.$ = new yy.Code([], $$[$0], $$[$0-1]);
+break;
+case 47:this.$ = 'func';
+break;
+case 48:this.$ = 'boundfunc';
+break;
+case 49:this.$ = $$[$0];
+break;
+case 50:this.$ = $$[$0];
+break;
+case 51:this.$ = [];
+break;
+case 52:this.$ = [$$[$0]];
+break;
+case 53:this.$ = $$[$0-2].concat($$[$0]);
+break;
+case 54:this.$ = new yy.Param($$[$0]);
+break;
+case 55:this.$ = new yy.Param($$[$0-1], null, true);
+break;
+case 56:this.$ = new yy.Param($$[$0-2], $$[$0]);
+break;
+case 57:this.$ = $$[$0];
+break;
+case 58:this.$ = $$[$0];
+break;
+case 59:this.$ = $$[$0];
+break;
+case 60:this.$ = $$[$0];
+break;
+case 61:this.$ = new yy.Splat($$[$0-1]);
+break;
+case 62:this.$ = new yy.Value($$[$0]);
+break;
+case 63:this.$ = $$[$0-1].push($$[$0]);
+break;
+case 64:this.$ = new yy.Value($$[$0-1], [$$[$0]]);
+break;
+case 65:this.$ = $$[$0];
+break;
+case 66:this.$ = $$[$0];
+break;
+case 67:this.$ = new yy.Value($$[$0]);
+break;
+case 68:this.$ = new yy.Value($$[$0]);
+break;
+case 69:this.$ = $$[$0];
+break;
+case 70:this.$ = new yy.Value($$[$0]);
+break;
+case 71:this.$ = new yy.Value($$[$0]);
+break;
+case 72:this.$ = new yy.Value($$[$0]);
+break;
+case 73:this.$ = $$[$0];
+break;
+case 74:this.$ = new yy.Access($$[$0]);
+break;
+case 75:this.$ = new yy.Access($$[$0], 'soak');
+break;
+case 76:this.$ = new yy.Access($$[$0], 'proto');
+break;
+case 77:this.$ = new yy.Access(new yy.Literal('prototype'));
+break;
+case 78:this.$ = $$[$0];
+break;
+case 79:this.$ = $$[$0-1];
+break;
+case 80:this.$ = yy.extend($$[$0], {
+ soak: true
+ });
+break;
+case 81:this.$ = yy.extend($$[$0], {
+ proto: true
+ });
+break;
+case 82:this.$ = new yy.Index($$[$0]);
+break;
+case 83:this.$ = new yy.Slice($$[$0]);
+break;
+case 84:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated);
+break;
+case 85:this.$ = [];
+break;
+case 86:this.$ = [$$[$0]];
+break;
+case 87:this.$ = $$[$0-2].concat($$[$0]);
+break;
+case 88:this.$ = $$[$0-3].concat($$[$0]);
+break;
+case 89:this.$ = $$[$0-5].concat($$[$0-2]);
+break;
+case 90:this.$ = new yy.Class;
+break;
+case 91:this.$ = new yy.Class(null, null, $$[$0]);
+break;
+case 92:this.$ = new yy.Class(null, $$[$0]);
+break;
+case 93:this.$ = new yy.Class(null, $$[$0-1], $$[$0]);
+break;
+case 94:this.$ = new yy.Class($$[$0]);
+break;
+case 95:this.$ = new yy.Class($$[$0-1], null, $$[$0]);
+break;
+case 96:this.$ = new yy.Class($$[$0-2], $$[$0]);
+break;
+case 97:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]);
+break;
+case 98:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 99:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 100:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]);
+break;
+case 101:this.$ = new yy.Call('super', $$[$0]);
+break;
+case 102:this.$ = false;
+break;
+case 103:this.$ = true;
+break;
+case 104:this.$ = [];
+break;
+case 105:this.$ = $$[$0-2];
+break;
+case 106:this.$ = new yy.Value(new yy.Literal('this'));
+break;
+case 107:this.$ = new yy.Value(new yy.Literal('this'));
+break;
+case 108:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this');
+break;
+case 109:this.$ = new yy.Arr([]);
+break;
+case 110:this.$ = new yy.Arr($$[$0-2]);
+break;
+case 111:this.$ = 'inclusive';
+break;
+case 112:this.$ = 'exclusive';
+break;
+case 113:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]);
+break;
+case 114:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 115:this.$ = new yy.Range($$[$0-1], null, $$[$0]);
+break;
+case 116:this.$ = new yy.Range(null, $$[$0], $$[$0-1]);
+break;
+case 117:this.$ = [$$[$0]];
+break;
+case 118:this.$ = $$[$0-2].concat($$[$0]);
+break;
+case 119:this.$ = $$[$0-3].concat($$[$0]);
+break;
+case 120:this.$ = $$[$0-2];
+break;
+case 121:this.$ = $$[$0-5].concat($$[$0-2]);
+break;
+case 122:this.$ = $$[$0];
+break;
+case 123:this.$ = $$[$0];
+break;
+case 124:this.$ = $$[$0];
+break;
+case 125:this.$ = [].concat($$[$0-2], $$[$0]);
+break;
+case 126:this.$ = new yy.Try($$[$0]);
+break;
+case 127:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]);
+break;
+case 128:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]);
+break;
+case 129:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]);
+break;
+case 130:this.$ = [$$[$0-1], $$[$0]];
+break;
+case 131:this.$ = new yy.Throw($$[$0]);
+break;
+case 132:this.$ = new yy.Parens($$[$0-1]);
+break;
+case 133:this.$ = new yy.Parens($$[$0-2]);
+break;
+case 134:this.$ = new yy.While($$[$0]);
+break;
+case 135:this.$ = new yy.While($$[$0-2], {
+ guard: $$[$0]
+ });
+break;
+case 136:this.$ = new yy.While($$[$0], {
+ invert: true
+ });
+break;
+case 137:this.$ = new yy.While($$[$0-2], {
+ invert: true,
+ guard: $$[$0]
+ });
+break;
+case 138:this.$ = $$[$0-1].addBody($$[$0]);
+break;
+case 139:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
+break;
+case 140:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]]));
+break;
+case 141:this.$ = $$[$0];
+break;
+case 142:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]);
+break;
+case 143:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]]));
+break;
+case 144:this.$ = new yy.For($$[$0-1], $$[$0]);
+break;
+case 145:this.$ = new yy.For($$[$0-1], $$[$0]);
+break;
+case 146:this.$ = new yy.For($$[$0], $$[$0-1]);
+break;
+case 147:this.$ = {
+ source: new yy.Value($$[$0])
+ };
+break;
+case 148:this.$ = (function () {
+ $$[$0].own = $$[$0-1].own;
+ $$[$0].name = $$[$0-1][0];
+ $$[$0].index = $$[$0-1][1];
+ return $$[$0];
+ }());
+break;
+case 149:this.$ = $$[$0];
+break;
+case 150:this.$ = (function () {
+ $$[$0].own = true;
+ return $$[$0];
+ }());
+break;
+case 151:this.$ = $$[$0];
+break;
+case 152:this.$ = new yy.Value($$[$0]);
+break;
+case 153:this.$ = new yy.Value($$[$0]);
+break;
+case 154:this.$ = [$$[$0]];
+break;
+case 155:this.$ = [$$[$0-2], $$[$0]];
+break;
+case 156:this.$ = {
+ source: $$[$0]
+ };
+break;
+case 157:this.$ = {
+ source: $$[$0],
+ object: true
+ };
+break;
+case 158:this.$ = {
+ source: $$[$0-2],
+ guard: $$[$0]
+ };
+break;
+case 159:this.$ = {
+ source: $$[$0-2],
+ guard: $$[$0],
+ object: true
+ };
+break;
+case 160:this.$ = {
+ source: $$[$0-2],
+ step: $$[$0]
+ };
+break;
+case 161:this.$ = {
+ source: $$[$0-4],
+ guard: $$[$0-2],
+ step: $$[$0]
+ };
+break;
+case 162:this.$ = {
+ source: $$[$0-4],
+ step: $$[$0-2],
+ guard: $$[$0]
+ };
+break;
+case 163:this.$ = new yy.Switch($$[$0-3], $$[$0-1]);
+break;
+case 164:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]);
+break;
+case 165:this.$ = new yy.Switch(null, $$[$0-1]);
+break;
+case 166:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]);
+break;
+case 167:this.$ = $$[$0];
+break;
+case 168:this.$ = $$[$0-1].concat($$[$0]);
+break;
+case 169:this.$ = [[$$[$0-1], $$[$0]]];
+break;
+case 170:this.$ = [[$$[$0-2], $$[$0-1]]];
+break;
+case 171:this.$ = new yy.If($$[$0-1], $$[$0], {
+ type: $$[$0-2]
+ });
+break;
+case 172:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], {
+ type: $$[$0-2]
+ }));
+break;
+case 173:this.$ = $$[$0];
+break;
+case 174:this.$ = $$[$0-2].addElse($$[$0]);
+break;
+case 175:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
+ type: $$[$0-1],
+ statement: true
+ });
+break;
+case 176:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), {
+ type: $$[$0-1],
+ statement: true
+ });
+break;
+case 177:this.$ = new yy.Op($$[$0-1], $$[$0]);
+break;
+case 178:this.$ = new yy.Op('-', $$[$0]);
+break;
+case 179:this.$ = new yy.Op('+', $$[$0]);
+break;
+case 180:this.$ = new yy.Op('--', $$[$0]);
+break;
+case 181:this.$ = new yy.Op('++', $$[$0]);
+break;
+case 182:this.$ = new yy.Op('--', $$[$0-1], null, true);
+break;
+case 183:this.$ = new yy.Op('++', $$[$0-1], null, true);
+break;
+case 184:this.$ = new yy.Existence($$[$0-1]);
+break;
+case 185:this.$ = new yy.Op('+', $$[$0-2], $$[$0]);
+break;
+case 186:this.$ = new yy.Op('-', $$[$0-2], $$[$0]);
+break;
+case 187:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 188:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 189:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 190:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+break;
+case 191:this.$ = (function () {
+ if ($$[$0-1].charAt(0) === '!') {
+ return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert();
+ } else {
+ return new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+ }
+ }());
+break;
+case 192:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]);
+break;
+case 193:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]);
+break;
+case 194:this.$ = new yy.Extends($$[$0-2], $$[$0]);
+break;
+}
+},
+table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,5],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[3]},{1:[2,2],6:[1,71]},{6:[1,72]},{1:[2,4],6:[2,4],26:[2,4],99:[2,4]},{4:74,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[1,73],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,7],6:[2,7],26:[2,7],99:[2,7],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,8],6:[2,8],26:[2,8],99:[2,8],100:87,101:[1,62],103:[1,63],106:88,107:[1,65],108:66,123:[1,86]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],46:[2,13],51:[2,13],54:[2,13],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],69:[2,13],70:[1,97],71:[1,98],75:[2,13],78:89,81:[1,91],82:[2,102],83:[2,13],88:[2,13],90:[2,13],99:[2,13],101:[2,13],102:[2,13],103:[2,13],107:[2,13],115:[2,13],123:[2,13],125:[2,13],126:[2,13],129:[2,13],130:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],46:[2,14],51:[2,14],54:[2,14],59:100,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],69:[2,14],70:[1,97],71:[1,98],75:[2,14],78:99,81:[1,91],82:[2,102],83:[2,14],88:[2,14],90:[2,14],99:[2,14],101:[2,14],102:[2,14],103:[2,14],107:[2,14],115:[2,14],123:[2,14],125:[2,14],126:[2,14],129:[2,14],130:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],46:[2,15],51:[2,15],54:[2,15],69:[2,15],75:[2,15],83:[2,15],88:[2,15],90:[2,15],99:[2,15],101:[2,15],102:[2,15],103:[2,15],107:[2,15],115:[2,15],123:[2,15],125:[2,15],126:[2,15],129:[2,15],130:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],46:[2,16],51:[2,16],54:[2,16],69:[2,16],75:[2,16],83:[2,16],88:[2,16],90:[2,16],99:[2,16],101:[2,16],102:[2,16],103:[2,16],107:[2,16],115:[2,16],123:[2,16],125:[2,16],126:[2,16],129:[2,16],130:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],46:[2,17],51:[2,17],54:[2,17],69:[2,17],75:[2,17],83:[2,17],88:[2,17],90:[2,17],99:[2,17],101:[2,17],102:[2,17],103:[2,17],107:[2,17],115:[2,17],123:[2,17],125:[2,17],126:[2,17],129:[2,17],130:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],46:[2,18],51:[2,18],54:[2,18],69:[2,18],75:[2,18],83:[2,18],88:[2,18],90:[2,18],99:[2,18],101:[2,18],102:[2,18],103:[2,18],107:[2,18],115:[2,18],123:[2,18],125:[2,18],126:[2,18],129:[2,18],130:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],46:[2,19],51:[2,19],54:[2,19],69:[2,19],75:[2,19],83:[2,19],88:[2,19],90:[2,19],99:[2,19],101:[2,19],102:[2,19],103:[2,19],107:[2,19],115:[2,19],123:[2,19],125:[2,19],126:[2,19],129:[2,19],130:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],46:[2,20],51:[2,20],54:[2,20],69:[2,20],75:[2,20],83:[2,20],88:[2,20],90:[2,20],99:[2,20],101:[2,20],102:[2,20],103:[2,20],107:[2,20],115:[2,20],123:[2,20],125:[2,20],126:[2,20],129:[2,20],130:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],46:[2,21],51:[2,21],54:[2,21],69:[2,21],75:[2,21],83:[2,21],88:[2,21],90:[2,21],99:[2,21],101:[2,21],102:[2,21],103:[2,21],107:[2,21],115:[2,21],123:[2,21],125:[2,21],126:[2,21],129:[2,21],130:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],46:[2,22],51:[2,22],54:[2,22],69:[2,22],75:[2,22],83:[2,22],88:[2,22],90:[2,22],99:[2,22],101:[2,22],102:[2,22],103:[2,22],107:[2,22],115:[2,22],123:[2,22],125:[2,22],126:[2,22],129:[2,22],130:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],46:[2,23],51:[2,23],54:[2,23],69:[2,23],75:[2,23],83:[2,23],88:[2,23],90:[2,23],99:[2,23],101:[2,23],102:[2,23],103:[2,23],107:[2,23],115:[2,23],123:[2,23],125:[2,23],126:[2,23],129:[2,23],130:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23]},{1:[2,9],6:[2,9],26:[2,9],99:[2,9],101:[2,9],103:[2,9],107:[2,9],123:[2,9]},{1:[2,10],6:[2,10],26:[2,10],99:[2,10],101:[2,10],103:[2,10],107:[2,10],123:[2,10]},{1:[2,11],6:[2,11],26:[2,11],99:[2,11],101:[2,11],103:[2,11],107:[2,11],123:[2,11]},{1:[2,12],6:[2,12],26:[2,12],99:[2,12],101:[2,12],103:[2,12],107:[2,12],123:[2,12]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],37:[1,101],46:[2,69],51:[2,69],54:[2,69],63:[2,69],64:[2,69],65:[2,69],67:[2,69],69:[2,69],70:[2,69],71:[2,69],75:[2,69],81:[2,69],82:[2,69],83:[2,69],88:[2,69],90:[2,69],99:[2,69],101:[2,69],102:[2,69],103:[2,69],107:[2,69],115:[2,69],123:[2,69],125:[2,69],126:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],46:[2,70],51:[2,70],54:[2,70],63:[2,70],64:[2,70],65:[2,70],67:[2,70],69:[2,70],70:[2,70],71:[2,70],75:[2,70],81:[2,70],82:[2,70],83:[2,70],88:[2,70],90:[2,70],99:[2,70],101:[2,70],102:[2,70],103:[2,70],107:[2,70],115:[2,70],123:[2,70],125:[2,70],126:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],46:[2,71],51:[2,71],54:[2,71],63:[2,71],64:[2,71],65:[2,71],67:[2,71],69:[2,71],70:[2,71],71:[2,71],75:[2,71],81:[2,71],82:[2,71],83:[2,71],88:[2,71],90:[2,71],99:[2,71],101:[2,71],102:[2,71],103:[2,71],107:[2,71],115:[2,71],123:[2,71],125:[2,71],126:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],46:[2,72],51:[2,72],54:[2,72],63:[2,72],64:[2,72],65:[2,72],67:[2,72],69:[2,72],70:[2,72],71:[2,72],75:[2,72],81:[2,72],82:[2,72],83:[2,72],88:[2,72],90:[2,72],99:[2,72],101:[2,72],102:[2,72],103:[2,72],107:[2,72],115:[2,72],123:[2,72],125:[2,72],126:[2,72],129:[2,72],130:[2,72],131:[2,72],132:[2,72],133:[2,72],134:[2,72]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],46:[2,73],51:[2,73],54:[2,73],63:[2,73],64:[2,73],65:[2,73],67:[2,73],69:[2,73],70:[2,73],71:[2,73],75:[2,73],81:[2,73],82:[2,73],83:[2,73],88:[2,73],90:[2,73],99:[2,73],101:[2,73],102:[2,73],103:[2,73],107:[2,73],115:[2,73],123:[2,73],125:[2,73],126:[2,73],129:[2,73],130:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],46:[2,100],51:[2,100],54:[2,100],63:[2,100],64:[2,100],65:[2,100],67:[2,100],69:[2,100],70:[2,100],71:[2,100],75:[2,100],79:102,81:[2,100],82:[1,103],83:[2,100],88:[2,100],90:[2,100],99:[2,100],101:[2,100],102:[2,100],103:[2,100],107:[2,100],115:[2,100],123:[2,100],125:[2,100],126:[2,100],129:[2,100],130:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100]},{27:107,28:[1,70],41:108,45:104,46:[2,51],51:[2,51],52:105,53:106,55:109,56:110,73:[1,67],86:[1,111],87:[1,112]},{5:113,25:[1,5]},{8:114,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:116,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:117,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{14:119,15:120,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:121,41:60,55:47,56:48,58:118,60:25,61:26,62:27,73:[1,67],80:[1,28],85:[1,55],86:[1,56],87:[1,54],98:[1,53]},{14:119,15:120,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:121,41:60,55:47,56:48,58:122,60:25,61:26,62:27,73:[1,67],80:[1,28],85:[1,55],86:[1,56],87:[1,54],98:[1,53]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],37:[2,66],46:[2,66],51:[2,66],54:[2,66],63:[2,66],64:[2,66],65:[2,66],67:[2,66],69:[2,66],70:[2,66],71:[2,66],75:[2,66],77:[1,126],81:[2,66],82:[2,66],83:[2,66],88:[2,66],90:[2,66],99:[2,66],101:[2,66],102:[2,66],103:[2,66],107:[2,66],115:[2,66],123:[2,66],125:[2,66],126:[2,66],127:[1,123],128:[1,124],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66],134:[2,66],135:[1,125]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],46:[2,173],51:[2,173],54:[2,173],69:[2,173],75:[2,173],83:[2,173],88:[2,173],90:[2,173],99:[2,173],101:[2,173],102:[2,173],103:[2,173],107:[2,173],115:[2,173],118:[1,127],123:[2,173],125:[2,173],126:[2,173],129:[2,173],130:[2,173],131:[2,173],132:[2,173],133:[2,173],134:[2,173]},{5:128,25:[1,5]},{5:129,25:[1,5]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],46:[2,141],51:[2,141],54:[2,141],69:[2,141],75:[2,141],83:[2,141],88:[2,141],90:[2,141],99:[2,141],101:[2,141],102:[2,141],103:[2,141],107:[2,141],115:[2,141],123:[2,141],125:[2,141],126:[2,141],129:[2,141],130:[2,141],131:[2,141],132:[2,141],133:[2,141],134:[2,141]},{5:130,25:[1,5]},{8:131,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,132],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,90],5:133,6:[2,90],14:119,15:120,25:[1,5],26:[2,90],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:121,41:60,46:[2,90],51:[2,90],54:[2,90],55:47,56:48,58:135,60:25,61:26,62:27,69:[2,90],73:[1,67],75:[2,90],77:[1,134],80:[1,28],83:[2,90],85:[1,55],86:[1,56],87:[1,54],88:[2,90],90:[2,90],98:[1,53],99:[2,90],101:[2,90],102:[2,90],103:[2,90],107:[2,90],115:[2,90],123:[2,90],125:[2,90],126:[2,90],129:[2,90],130:[2,90],131:[2,90],132:[2,90],133:[2,90],134:[2,90]},{1:[2,43],6:[2,43],8:136,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[2,43],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],99:[2,43],100:39,101:[2,43],103:[2,43],104:40,105:[1,64],106:41,107:[2,43],108:66,116:[1,42],121:37,122:[1,61],123:[2,43],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:137,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,44],6:[2,44],25:[2,44],26:[2,44],51:[2,44],75:[2,44],99:[2,44],101:[2,44],103:[2,44],107:[2,44],123:[2,44]},{1:[2,67],6:[2,67],25:[2,67],26:[2,67],37:[2,67],46:[2,67],51:[2,67],54:[2,67],63:[2,67],64:[2,67],65:[2,67],67:[2,67],69:[2,67],70:[2,67],71:[2,67],75:[2,67],81:[2,67],82:[2,67],83:[2,67],88:[2,67],90:[2,67],99:[2,67],101:[2,67],102:[2,67],103:[2,67],107:[2,67],115:[2,67],123:[2,67],125:[2,67],126:[2,67],129:[2,67],130:[2,67],131:[2,67],132:[2,67],133:[2,67],134:[2,67]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],37:[2,68],46:[2,68],51:[2,68],54:[2,68],63:[2,68],64:[2,68],65:[2,68],67:[2,68],69:[2,68],70:[2,68],71:[2,68],75:[2,68],81:[2,68],82:[2,68],83:[2,68],88:[2,68],90:[2,68],99:[2,68],101:[2,68],102:[2,68],103:[2,68],107:[2,68],115:[2,68],123:[2,68],125:[2,68],126:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],46:[2,29],51:[2,29],54:[2,29],63:[2,29],64:[2,29],65:[2,29],67:[2,29],69:[2,29],70:[2,29],71:[2,29],75:[2,29],81:[2,29],82:[2,29],83:[2,29],88:[2,29],90:[2,29],99:[2,29],101:[2,29],102:[2,29],103:[2,29],107:[2,29],115:[2,29],123:[2,29],125:[2,29],126:[2,29],129:[2,29],130:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],46:[2,30],51:[2,30],54:[2,30],63:[2,30],64:[2,30],65:[2,30],67:[2,30],69:[2,30],70:[2,30],71:[2,30],75:[2,30],81:[2,30],82:[2,30],83:[2,30],88:[2,30],90:[2,30],99:[2,30],101:[2,30],102:[2,30],103:[2,30],107:[2,30],115:[2,30],123:[2,30],125:[2,30],126:[2,30],129:[2,30],130:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],46:[2,31],51:[2,31],54:[2,31],63:[2,31],64:[2,31],65:[2,31],67:[2,31],69:[2,31],70:[2,31],71:[2,31],75:[2,31],81:[2,31],82:[2,31],83:[2,31],88:[2,31],90:[2,31],99:[2,31],101:[2,31],102:[2,31],103:[2,31],107:[2,31],115:[2,31],123:[2,31],125:[2,31],126:[2,31],129:[2,31],130:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],46:[2,32],51:[2,32],54:[2,32],63:[2,32],64:[2,32],65:[2,32],67:[2,32],69:[2,32],70:[2,32],71:[2,32],75:[2,32],81:[2,32],82:[2,32],83:[2,32],88:[2,32],90:[2,32],99:[2,32],101:[2,32],102:[2,32],103:[2,32],107:[2,32],115:[2,32],123:[2,32],125:[2,32],126:[2,32],129:[2,32],130:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32]},{4:138,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,139],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:140,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,144],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:145,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],84:142,85:[1,55],86:[1,56],87:[1,54],88:[1,141],91:143,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],46:[2,106],51:[2,106],54:[2,106],63:[2,106],64:[2,106],65:[2,106],67:[2,106],69:[2,106],70:[2,106],71:[2,106],75:[2,106],81:[2,106],82:[2,106],83:[2,106],88:[2,106],90:[2,106],99:[2,106],101:[2,106],102:[2,106],103:[2,106],107:[2,106],115:[2,106],123:[2,106],125:[2,106],126:[2,106],129:[2,106],130:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],27:146,28:[1,70],46:[2,107],51:[2,107],54:[2,107],63:[2,107],64:[2,107],65:[2,107],67:[2,107],69:[2,107],70:[2,107],71:[2,107],75:[2,107],81:[2,107],82:[2,107],83:[2,107],88:[2,107],90:[2,107],99:[2,107],101:[2,107],102:[2,107],103:[2,107],107:[2,107],115:[2,107],123:[2,107],125:[2,107],126:[2,107],129:[2,107],130:[2,107],131:[2,107],132:[2,107],133:[2,107],134:[2,107]},{25:[2,47]},{25:[2,48]},{1:[2,62],6:[2,62],25:[2,62],26:[2,62],37:[2,62],46:[2,62],51:[2,62],54:[2,62],63:[2,62],64:[2,62],65:[2,62],67:[2,62],69:[2,62],70:[2,62],71:[2,62],75:[2,62],77:[2,62],81:[2,62],82:[2,62],83:[2,62],88:[2,62],90:[2,62],99:[2,62],101:[2,62],102:[2,62],103:[2,62],107:[2,62],115:[2,62],123:[2,62],125:[2,62],126:[2,62],127:[2,62],128:[2,62],129:[2,62],130:[2,62],131:[2,62],132:[2,62],133:[2,62],134:[2,62],135:[2,62]},{1:[2,65],6:[2,65],25:[2,65],26:[2,65],37:[2,65],46:[2,65],51:[2,65],54:[2,65],63:[2,65],64:[2,65],65:[2,65],67:[2,65],69:[2,65],70:[2,65],71:[2,65],75:[2,65],77:[2,65],81:[2,65],82:[2,65],83:[2,65],88:[2,65],90:[2,65],99:[2,65],101:[2,65],102:[2,65],103:[2,65],107:[2,65],115:[2,65],123:[2,65],125:[2,65],126:[2,65],127:[2,65],128:[2,65],129:[2,65],130:[2,65],131:[2,65],132:[2,65],133:[2,65],134:[2,65],135:[2,65]},{8:147,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:148,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:149,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{5:150,8:151,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,5],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{27:156,28:[1,70],55:157,56:158,61:152,73:[1,67],87:[1,54],110:153,111:[1,154],112:155},{109:159,113:[1,160],114:[1,161]},{6:[2,85],12:165,25:[2,85],27:166,28:[1,70],29:167,30:[1,68],31:[1,69],38:163,39:164,41:168,43:[1,46],51:[2,85],74:162,75:[2,85],86:[1,111]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],40:[2,27],46:[2,27],51:[2,27],54:[2,27],63:[2,27],64:[2,27],65:[2,27],67:[2,27],69:[2,27],70:[2,27],71:[2,27],75:[2,27],81:[2,27],82:[2,27],83:[2,27],88:[2,27],90:[2,27],99:[2,27],101:[2,27],102:[2,27],103:[2,27],107:[2,27],115:[2,27],123:[2,27],125:[2,27],126:[2,27],129:[2,27],130:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],40:[2,28],46:[2,28],51:[2,28],54:[2,28],63:[2,28],64:[2,28],65:[2,28],67:[2,28],69:[2,28],70:[2,28],71:[2,28],75:[2,28],81:[2,28],82:[2,28],83:[2,28],88:[2,28],90:[2,28],99:[2,28],101:[2,28],102:[2,28],103:[2,28],107:[2,28],115:[2,28],123:[2,28],125:[2,28],126:[2,28],129:[2,28],130:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],37:[2,26],40:[2,26],46:[2,26],51:[2,26],54:[2,26],63:[2,26],64:[2,26],65:[2,26],67:[2,26],69:[2,26],70:[2,26],71:[2,26],75:[2,26],77:[2,26],81:[2,26],82:[2,26],83:[2,26],88:[2,26],90:[2,26],99:[2,26],101:[2,26],102:[2,26],103:[2,26],107:[2,26],113:[2,26],114:[2,26],115:[2,26],123:[2,26],125:[2,26],126:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26]},{1:[2,6],6:[2,6],7:169,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,26:[2,6],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],99:[2,6],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],46:[2,24],51:[2,24],54:[2,24],69:[2,24],75:[2,24],83:[2,24],88:[2,24],90:[2,24],95:[2,24],96:[2,24],99:[2,24],101:[2,24],102:[2,24],103:[2,24],107:[2,24],115:[2,24],118:[2,24],120:[2,24],123:[2,24],125:[2,24],126:[2,24],129:[2,24],130:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24]},{6:[1,71],26:[1,170]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],46:[2,184],51:[2,184],54:[2,184],69:[2,184],75:[2,184],83:[2,184],88:[2,184],90:[2,184],99:[2,184],101:[2,184],102:[2,184],103:[2,184],107:[2,184],115:[2,184],123:[2,184],125:[2,184],126:[2,184],129:[2,184],130:[2,184],131:[2,184],132:[2,184],133:[2,184],134:[2,184]},{8:171,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:172,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:173,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:174,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:175,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:176,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:177,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:178,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],46:[2,140],51:[2,140],54:[2,140],69:[2,140],75:[2,140],83:[2,140],88:[2,140],90:[2,140],99:[2,140],101:[2,140],102:[2,140],103:[2,140],107:[2,140],115:[2,140],123:[2,140],125:[2,140],126:[2,140],129:[2,140],130:[2,140],131:[2,140],132:[2,140],133:[2,140],134:[2,140]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],46:[2,145],51:[2,145],54:[2,145],69:[2,145],75:[2,145],83:[2,145],88:[2,145],90:[2,145],99:[2,145],101:[2,145],102:[2,145],103:[2,145],107:[2,145],115:[2,145],123:[2,145],125:[2,145],126:[2,145],129:[2,145],130:[2,145],131:[2,145],132:[2,145],133:[2,145],134:[2,145]},{8:179,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],46:[2,139],51:[2,139],54:[2,139],69:[2,139],75:[2,139],83:[2,139],88:[2,139],90:[2,139],99:[2,139],101:[2,139],102:[2,139],103:[2,139],107:[2,139],115:[2,139],123:[2,139],125:[2,139],126:[2,139],129:[2,139],130:[2,139],131:[2,139],132:[2,139],133:[2,139],134:[2,139]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],46:[2,144],51:[2,144],54:[2,144],69:[2,144],75:[2,144],83:[2,144],88:[2,144],90:[2,144],99:[2,144],101:[2,144],102:[2,144],103:[2,144],107:[2,144],115:[2,144],123:[2,144],125:[2,144],126:[2,144],129:[2,144],130:[2,144],131:[2,144],132:[2,144],133:[2,144],134:[2,144]},{79:180,82:[1,103]},{1:[2,63],6:[2,63],25:[2,63],26:[2,63],37:[2,63],46:[2,63],51:[2,63],54:[2,63],63:[2,63],64:[2,63],65:[2,63],67:[2,63],69:[2,63],70:[2,63],71:[2,63],75:[2,63],77:[2,63],81:[2,63],82:[2,63],83:[2,63],88:[2,63],90:[2,63],99:[2,63],101:[2,63],102:[2,63],103:[2,63],107:[2,63],115:[2,63],123:[2,63],125:[2,63],126:[2,63],127:[2,63],128:[2,63],129:[2,63],130:[2,63],131:[2,63],132:[2,63],133:[2,63],134:[2,63],135:[2,63]},{82:[2,103]},{27:181,28:[1,70]},{27:182,28:[1,70]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],27:183,28:[1,70],37:[2,77],46:[2,77],51:[2,77],54:[2,77],63:[2,77],64:[2,77],65:[2,77],67:[2,77],69:[2,77],70:[2,77],71:[2,77],75:[2,77],77:[2,77],81:[2,77],82:[2,77],83:[2,77],88:[2,77],90:[2,77],99:[2,77],101:[2,77],102:[2,77],103:[2,77],107:[2,77],115:[2,77],123:[2,77],125:[2,77],126:[2,77],127:[2,77],128:[2,77],129:[2,77],130:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],37:[2,78],46:[2,78],51:[2,78],54:[2,78],63:[2,78],64:[2,78],65:[2,78],67:[2,78],69:[2,78],70:[2,78],71:[2,78],75:[2,78],77:[2,78],81:[2,78],82:[2,78],83:[2,78],88:[2,78],90:[2,78],99:[2,78],101:[2,78],102:[2,78],103:[2,78],107:[2,78],115:[2,78],123:[2,78],125:[2,78],126:[2,78],127:[2,78],128:[2,78],129:[2,78],130:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78]},{8:185,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],54:[1,189],55:47,56:48,58:36,60:25,61:26,62:27,68:184,72:186,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],89:187,90:[1,188],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{66:190,67:[1,96],70:[1,97],71:[1,98]},{66:191,67:[1,96],70:[1,97],71:[1,98]},{79:192,82:[1,103]},{1:[2,64],6:[2,64],25:[2,64],26:[2,64],37:[2,64],46:[2,64],51:[2,64],54:[2,64],63:[2,64],64:[2,64],65:[2,64],67:[2,64],69:[2,64],70:[2,64],71:[2,64],75:[2,64],77:[2,64],81:[2,64],82:[2,64],83:[2,64],88:[2,64],90:[2,64],99:[2,64],101:[2,64],102:[2,64],103:[2,64],107:[2,64],115:[2,64],123:[2,64],125:[2,64],126:[2,64],127:[2,64],128:[2,64],129:[2,64],130:[2,64],131:[2,64],132:[2,64],133:[2,64],134:[2,64],135:[2,64]},{8:193,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,194],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,101],6:[2,101],25:[2,101],26:[2,101],46:[2,101],51:[2,101],54:[2,101],63:[2,101],64:[2,101],65:[2,101],67:[2,101],69:[2,101],70:[2,101],71:[2,101],75:[2,101],81:[2,101],82:[2,101],83:[2,101],88:[2,101],90:[2,101],99:[2,101],101:[2,101],102:[2,101],103:[2,101],107:[2,101],115:[2,101],123:[2,101],125:[2,101],126:[2,101],129:[2,101],130:[2,101],131:[2,101],132:[2,101],133:[2,101],134:[2,101]},{8:197,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,144],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:145,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],83:[1,195],84:196,85:[1,55],86:[1,56],87:[1,54],91:143,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{46:[1,198],51:[1,199]},{46:[2,52],51:[2,52]},{37:[1,201],46:[2,54],51:[2,54],54:[1,200]},{37:[2,57],46:[2,57],51:[2,57],54:[2,57]},{37:[2,58],46:[2,58],51:[2,58],54:[2,58]},{37:[2,59],46:[2,59],51:[2,59],54:[2,59]},{37:[2,60],46:[2,60],51:[2,60],54:[2,60]},{27:146,28:[1,70]},{8:197,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,144],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:145,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],84:142,85:[1,55],86:[1,56],87:[1,54],88:[1,141],91:143,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,46],6:[2,46],25:[2,46],26:[2,46],46:[2,46],51:[2,46],54:[2,46],69:[2,46],75:[2,46],83:[2,46],88:[2,46],90:[2,46],99:[2,46],101:[2,46],102:[2,46],103:[2,46],107:[2,46],115:[2,46],123:[2,46],125:[2,46],126:[2,46],129:[2,46],130:[2,46],131:[2,46],132:[2,46],133:[2,46],134:[2,46]},{1:[2,177],6:[2,177],25:[2,177],26:[2,177],46:[2,177],51:[2,177],54:[2,177],69:[2,177],75:[2,177],83:[2,177],88:[2,177],90:[2,177],99:[2,177],100:84,101:[2,177],102:[2,177],103:[2,177],106:85,107:[2,177],108:66,115:[2,177],123:[2,177],125:[2,177],126:[2,177],129:[1,75],130:[2,177],131:[2,177],132:[2,177],133:[2,177],134:[2,177]},{100:87,101:[1,62],103:[1,63],106:88,107:[1,65],108:66,123:[1,86]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],46:[2,178],51:[2,178],54:[2,178],69:[2,178],75:[2,178],83:[2,178],88:[2,178],90:[2,178],99:[2,178],100:84,101:[2,178],102:[2,178],103:[2,178],106:85,107:[2,178],108:66,115:[2,178],123:[2,178],125:[2,178],126:[2,178],129:[1,75],130:[2,178],131:[2,178],132:[2,178],133:[2,178],134:[2,178]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],46:[2,179],51:[2,179],54:[2,179],69:[2,179],75:[2,179],83:[2,179],88:[2,179],90:[2,179],99:[2,179],100:84,101:[2,179],102:[2,179],103:[2,179],106:85,107:[2,179],108:66,115:[2,179],123:[2,179],125:[2,179],126:[2,179],129:[1,75],130:[2,179],131:[2,179],132:[2,179],133:[2,179],134:[2,179]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],46:[2,180],51:[2,180],54:[2,180],63:[2,66],64:[2,66],65:[2,66],67:[2,66],69:[2,180],70:[2,66],71:[2,66],75:[2,180],81:[2,66],82:[2,66],83:[2,180],88:[2,180],90:[2,180],99:[2,180],101:[2,180],102:[2,180],103:[2,180],107:[2,180],115:[2,180],123:[2,180],125:[2,180],126:[2,180],129:[2,180],130:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180]},{59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],70:[1,97],71:[1,98],78:89,81:[1,91],82:[2,102]},{59:100,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],70:[1,97],71:[1,98],78:99,81:[1,91],82:[2,102]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],46:[2,69],51:[2,69],54:[2,69],63:[2,69],64:[2,69],65:[2,69],67:[2,69],69:[2,69],70:[2,69],71:[2,69],75:[2,69],81:[2,69],82:[2,69],83:[2,69],88:[2,69],90:[2,69],99:[2,69],101:[2,69],102:[2,69],103:[2,69],107:[2,69],115:[2,69],123:[2,69],125:[2,69],126:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],46:[2,181],51:[2,181],54:[2,181],63:[2,66],64:[2,66],65:[2,66],67:[2,66],69:[2,181],70:[2,66],71:[2,66],75:[2,181],81:[2,66],82:[2,66],83:[2,181],88:[2,181],90:[2,181],99:[2,181],101:[2,181],102:[2,181],103:[2,181],107:[2,181],115:[2,181],123:[2,181],125:[2,181],126:[2,181],129:[2,181],130:[2,181],131:[2,181],132:[2,181],133:[2,181],134:[2,181]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],46:[2,182],51:[2,182],54:[2,182],69:[2,182],75:[2,182],83:[2,182],88:[2,182],90:[2,182],99:[2,182],101:[2,182],102:[2,182],103:[2,182],107:[2,182],115:[2,182],123:[2,182],125:[2,182],126:[2,182],129:[2,182],130:[2,182],131:[2,182],132:[2,182],133:[2,182],134:[2,182]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],46:[2,183],51:[2,183],54:[2,183],69:[2,183],75:[2,183],83:[2,183],88:[2,183],90:[2,183],99:[2,183],101:[2,183],102:[2,183],103:[2,183],107:[2,183],115:[2,183],123:[2,183],125:[2,183],126:[2,183],129:[2,183],130:[2,183],131:[2,183],132:[2,183],133:[2,183],134:[2,183]},{8:202,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,203],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:204,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{5:205,25:[1,5],122:[1,206]},{1:[2,126],6:[2,126],25:[2,126],26:[2,126],46:[2,126],51:[2,126],54:[2,126],69:[2,126],75:[2,126],83:[2,126],88:[2,126],90:[2,126],94:207,95:[1,208],96:[1,209],99:[2,126],101:[2,126],102:[2,126],103:[2,126],107:[2,126],115:[2,126],123:[2,126],125:[2,126],126:[2,126],129:[2,126],130:[2,126],131:[2,126],132:[2,126],133:[2,126],134:[2,126]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],46:[2,138],51:[2,138],54:[2,138],69:[2,138],75:[2,138],83:[2,138],88:[2,138],90:[2,138],99:[2,138],101:[2,138],102:[2,138],103:[2,138],107:[2,138],115:[2,138],123:[2,138],125:[2,138],126:[2,138],129:[2,138],130:[2,138],131:[2,138],132:[2,138],133:[2,138],134:[2,138]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],46:[2,146],51:[2,146],54:[2,146],69:[2,146],75:[2,146],83:[2,146],88:[2,146],90:[2,146],99:[2,146],101:[2,146],102:[2,146],103:[2,146],107:[2,146],115:[2,146],123:[2,146],125:[2,146],126:[2,146],129:[2,146],130:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146]},{25:[1,210],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{117:211,119:212,120:[1,213]},{1:[2,91],6:[2,91],25:[2,91],26:[2,91],46:[2,91],51:[2,91],54:[2,91],69:[2,91],75:[2,91],83:[2,91],88:[2,91],90:[2,91],99:[2,91],101:[2,91],102:[2,91],103:[2,91],107:[2,91],115:[2,91],123:[2,91],125:[2,91],126:[2,91],129:[2,91],130:[2,91],131:[2,91],132:[2,91],133:[2,91],134:[2,91]},{14:214,15:120,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:121,41:60,55:47,56:48,58:215,60:25,61:26,62:27,73:[1,67],80:[1,28],85:[1,55],86:[1,56],87:[1,54],98:[1,53]},{1:[2,94],5:216,6:[2,94],25:[1,5],26:[2,94],46:[2,94],51:[2,94],54:[2,94],63:[2,66],64:[2,66],65:[2,66],67:[2,66],69:[2,94],70:[2,66],71:[2,66],75:[2,94],77:[1,217],81:[2,66],82:[2,66],83:[2,94],88:[2,94],90:[2,94],99:[2,94],101:[2,94],102:[2,94],103:[2,94],107:[2,94],115:[2,94],123:[2,94],125:[2,94],126:[2,94],129:[2,94],130:[2,94],131:[2,94],132:[2,94],133:[2,94],134:[2,94]},{1:[2,42],6:[2,42],26:[2,42],99:[2,42],100:84,101:[2,42],103:[2,42],106:85,107:[2,42],108:66,123:[2,42],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,131],6:[2,131],26:[2,131],99:[2,131],100:84,101:[2,131],103:[2,131],106:85,107:[2,131],108:66,123:[2,131],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{6:[1,71],99:[1,218]},{4:219,7:4,8:6,9:7,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,122],25:[2,122],51:[2,122],54:[1,221],88:[2,122],89:220,90:[1,188],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],37:[2,109],46:[2,109],51:[2,109],54:[2,109],63:[2,109],64:[2,109],65:[2,109],67:[2,109],69:[2,109],70:[2,109],71:[2,109],75:[2,109],81:[2,109],82:[2,109],83:[2,109],88:[2,109],90:[2,109],99:[2,109],101:[2,109],102:[2,109],103:[2,109],107:[2,109],113:[2,109],114:[2,109],115:[2,109],123:[2,109],125:[2,109],126:[2,109],129:[2,109],130:[2,109],131:[2,109],132:[2,109],133:[2,109],134:[2,109]},{6:[2,49],25:[2,49],50:222,51:[1,223],88:[2,49]},{6:[2,117],25:[2,117],26:[2,117],51:[2,117],83:[2,117],88:[2,117]},{8:197,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,144],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:145,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],84:224,85:[1,55],86:[1,56],87:[1,54],91:143,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,123],25:[2,123],26:[2,123],51:[2,123],83:[2,123],88:[2,123]},{1:[2,108],6:[2,108],25:[2,108],26:[2,108],37:[2,108],40:[2,108],46:[2,108],51:[2,108],54:[2,108],63:[2,108],64:[2,108],65:[2,108],67:[2,108],69:[2,108],70:[2,108],71:[2,108],75:[2,108],77:[2,108],81:[2,108],82:[2,108],83:[2,108],88:[2,108],90:[2,108],99:[2,108],101:[2,108],102:[2,108],103:[2,108],107:[2,108],115:[2,108],123:[2,108],125:[2,108],126:[2,108],127:[2,108],128:[2,108],129:[2,108],130:[2,108],131:[2,108],132:[2,108],133:[2,108],134:[2,108],135:[2,108]},{5:225,25:[1,5],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],46:[2,134],51:[2,134],54:[2,134],69:[2,134],75:[2,134],83:[2,134],88:[2,134],90:[2,134],99:[2,134],100:84,101:[1,62],102:[1,226],103:[1,63],106:85,107:[1,65],108:66,115:[2,134],123:[2,134],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],46:[2,136],51:[2,136],54:[2,136],69:[2,136],75:[2,136],83:[2,136],88:[2,136],90:[2,136],99:[2,136],100:84,101:[1,62],102:[1,227],103:[1,63],106:85,107:[1,65],108:66,115:[2,136],123:[2,136],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],46:[2,142],51:[2,142],54:[2,142],69:[2,142],75:[2,142],83:[2,142],88:[2,142],90:[2,142],99:[2,142],101:[2,142],102:[2,142],103:[2,142],107:[2,142],115:[2,142],123:[2,142],125:[2,142],126:[2,142],129:[2,142],130:[2,142],131:[2,142],132:[2,142],133:[2,142],134:[2,142]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],46:[2,143],51:[2,143],54:[2,143],69:[2,143],75:[2,143],83:[2,143],88:[2,143],90:[2,143],99:[2,143],100:84,101:[1,62],102:[2,143],103:[1,63],106:85,107:[1,65],108:66,115:[2,143],123:[2,143],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],46:[2,147],51:[2,147],54:[2,147],69:[2,147],75:[2,147],83:[2,147],88:[2,147],90:[2,147],99:[2,147],101:[2,147],102:[2,147],103:[2,147],107:[2,147],115:[2,147],123:[2,147],125:[2,147],126:[2,147],129:[2,147],130:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147]},{113:[2,149],114:[2,149]},{27:156,28:[1,70],55:157,56:158,73:[1,67],87:[1,112],110:228,112:155},{51:[1,229],113:[2,154],114:[2,154]},{51:[2,151],113:[2,151],114:[2,151]},{51:[2,152],113:[2,152],114:[2,152]},{51:[2,153],113:[2,153],114:[2,153]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],46:[2,148],51:[2,148],54:[2,148],69:[2,148],75:[2,148],83:[2,148],88:[2,148],90:[2,148],99:[2,148],101:[2,148],102:[2,148],103:[2,148],107:[2,148],115:[2,148],123:[2,148],125:[2,148],126:[2,148],129:[2,148],130:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148]},{8:230,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:231,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,49],25:[2,49],50:232,51:[1,233],75:[2,49]},{6:[2,86],25:[2,86],26:[2,86],51:[2,86],75:[2,86]},{6:[2,35],25:[2,35],26:[2,35],40:[1,234],51:[2,35],75:[2,35]},{6:[2,38],25:[2,38],26:[2,38],51:[2,38],75:[2,38]},{6:[2,39],25:[2,39],26:[2,39],40:[2,39],51:[2,39],75:[2,39]},{6:[2,40],25:[2,40],26:[2,40],40:[2,40],51:[2,40],75:[2,40]},{6:[2,41],25:[2,41],26:[2,41],40:[2,41],51:[2,41],75:[2,41]},{1:[2,5],6:[2,5],26:[2,5],99:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],46:[2,25],51:[2,25],54:[2,25],69:[2,25],75:[2,25],83:[2,25],88:[2,25],90:[2,25],95:[2,25],96:[2,25],99:[2,25],101:[2,25],102:[2,25],103:[2,25],107:[2,25],115:[2,25],118:[2,25],120:[2,25],123:[2,25],125:[2,25],126:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],46:[2,185],51:[2,185],54:[2,185],69:[2,185],75:[2,185],83:[2,185],88:[2,185],90:[2,185],99:[2,185],100:84,101:[2,185],102:[2,185],103:[2,185],106:85,107:[2,185],108:66,115:[2,185],123:[2,185],125:[2,185],126:[2,185],129:[1,75],130:[1,78],131:[2,185],132:[2,185],133:[2,185],134:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],46:[2,186],51:[2,186],54:[2,186],69:[2,186],75:[2,186],83:[2,186],88:[2,186],90:[2,186],99:[2,186],100:84,101:[2,186],102:[2,186],103:[2,186],106:85,107:[2,186],108:66,115:[2,186],123:[2,186],125:[2,186],126:[2,186],129:[1,75],130:[1,78],131:[2,186],132:[2,186],133:[2,186],134:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],46:[2,187],51:[2,187],54:[2,187],69:[2,187],75:[2,187],83:[2,187],88:[2,187],90:[2,187],99:[2,187],100:84,101:[2,187],102:[2,187],103:[2,187],106:85,107:[2,187],108:66,115:[2,187],123:[2,187],125:[2,187],126:[2,187],129:[1,75],130:[2,187],131:[2,187],132:[2,187],133:[2,187],134:[2,187]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],46:[2,188],51:[2,188],54:[2,188],69:[2,188],75:[2,188],83:[2,188],88:[2,188],90:[2,188],99:[2,188],100:84,101:[2,188],102:[2,188],103:[2,188],106:85,107:[2,188],108:66,115:[2,188],123:[2,188],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[2,188],132:[2,188],133:[2,188],134:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],46:[2,189],51:[2,189],54:[2,189],69:[2,189],75:[2,189],83:[2,189],88:[2,189],90:[2,189],99:[2,189],100:84,101:[2,189],102:[2,189],103:[2,189],106:85,107:[2,189],108:66,115:[2,189],123:[2,189],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[2,189],133:[2,189],134:[1,82]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],46:[2,190],51:[2,190],54:[2,190],69:[2,190],75:[2,190],83:[2,190],88:[2,190],90:[2,190],99:[2,190],100:84,101:[2,190],102:[2,190],103:[2,190],106:85,107:[2,190],108:66,115:[2,190],123:[2,190],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[2,190],134:[1,82]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],46:[2,191],51:[2,191],54:[2,191],69:[2,191],75:[2,191],83:[2,191],88:[2,191],90:[2,191],99:[2,191],100:84,101:[2,191],102:[2,191],103:[2,191],106:85,107:[2,191],108:66,115:[2,191],123:[2,191],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[2,191],133:[2,191],134:[2,191]},{1:[2,176],6:[2,176],25:[2,176],26:[2,176],46:[2,176],51:[2,176],54:[2,176],69:[2,176],75:[2,176],83:[2,176],88:[2,176],90:[2,176],99:[2,176],100:84,101:[1,62],102:[2,176],103:[1,63],106:85,107:[1,65],108:66,115:[2,176],123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],46:[2,175],51:[2,175],54:[2,175],69:[2,175],75:[2,175],83:[2,175],88:[2,175],90:[2,175],99:[2,175],100:84,101:[1,62],102:[2,175],103:[1,63],106:85,107:[1,65],108:66,115:[2,175],123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],46:[2,98],51:[2,98],54:[2,98],63:[2,98],64:[2,98],65:[2,98],67:[2,98],69:[2,98],70:[2,98],71:[2,98],75:[2,98],81:[2,98],82:[2,98],83:[2,98],88:[2,98],90:[2,98],99:[2,98],101:[2,98],102:[2,98],103:[2,98],107:[2,98],115:[2,98],123:[2,98],125:[2,98],126:[2,98],129:[2,98],130:[2,98],131:[2,98],132:[2,98],133:[2,98],134:[2,98]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],37:[2,74],46:[2,74],51:[2,74],54:[2,74],63:[2,74],64:[2,74],65:[2,74],67:[2,74],69:[2,74],70:[2,74],71:[2,74],75:[2,74],77:[2,74],81:[2,74],82:[2,74],83:[2,74],88:[2,74],90:[2,74],99:[2,74],101:[2,74],102:[2,74],103:[2,74],107:[2,74],115:[2,74],123:[2,74],125:[2,74],126:[2,74],127:[2,74],128:[2,74],129:[2,74],130:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],37:[2,75],46:[2,75],51:[2,75],54:[2,75],63:[2,75],64:[2,75],65:[2,75],67:[2,75],69:[2,75],70:[2,75],71:[2,75],75:[2,75],77:[2,75],81:[2,75],82:[2,75],83:[2,75],88:[2,75],90:[2,75],99:[2,75],101:[2,75],102:[2,75],103:[2,75],107:[2,75],115:[2,75],123:[2,75],125:[2,75],126:[2,75],127:[2,75],128:[2,75],129:[2,75],130:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],37:[2,76],46:[2,76],51:[2,76],54:[2,76],63:[2,76],64:[2,76],65:[2,76],67:[2,76],69:[2,76],70:[2,76],71:[2,76],75:[2,76],77:[2,76],81:[2,76],82:[2,76],83:[2,76],88:[2,76],90:[2,76],99:[2,76],101:[2,76],102:[2,76],103:[2,76],107:[2,76],115:[2,76],123:[2,76],125:[2,76],126:[2,76],127:[2,76],128:[2,76],129:[2,76],130:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76]},{69:[1,235]},{54:[1,189],69:[2,82],89:236,90:[1,188],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{69:[2,83]},{8:237,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{13:[2,111],28:[2,111],30:[2,111],31:[2,111],33:[2,111],34:[2,111],35:[2,111],42:[2,111],43:[2,111],44:[2,111],48:[2,111],49:[2,111],69:[2,111],73:[2,111],76:[2,111],80:[2,111],85:[2,111],86:[2,111],87:[2,111],93:[2,111],97:[2,111],98:[2,111],101:[2,111],103:[2,111],105:[2,111],107:[2,111],116:[2,111],122:[2,111],124:[2,111],125:[2,111],126:[2,111],127:[2,111],128:[2,111]},{13:[2,112],28:[2,112],30:[2,112],31:[2,112],33:[2,112],34:[2,112],35:[2,112],42:[2,112],43:[2,112],44:[2,112],48:[2,112],49:[2,112],69:[2,112],73:[2,112],76:[2,112],80:[2,112],85:[2,112],86:[2,112],87:[2,112],93:[2,112],97:[2,112],98:[2,112],101:[2,112],103:[2,112],105:[2,112],107:[2,112],116:[2,112],122:[2,112],124:[2,112],125:[2,112],126:[2,112],127:[2,112],128:[2,112]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],37:[2,80],46:[2,80],51:[2,80],54:[2,80],63:[2,80],64:[2,80],65:[2,80],67:[2,80],69:[2,80],70:[2,80],71:[2,80],75:[2,80],77:[2,80],81:[2,80],82:[2,80],83:[2,80],88:[2,80],90:[2,80],99:[2,80],101:[2,80],102:[2,80],103:[2,80],107:[2,80],115:[2,80],123:[2,80],125:[2,80],126:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],37:[2,81],46:[2,81],51:[2,81],54:[2,81],63:[2,81],64:[2,81],65:[2,81],67:[2,81],69:[2,81],70:[2,81],71:[2,81],75:[2,81],77:[2,81],81:[2,81],82:[2,81],83:[2,81],88:[2,81],90:[2,81],99:[2,81],101:[2,81],102:[2,81],103:[2,81],107:[2,81],115:[2,81],123:[2,81],125:[2,81],126:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],46:[2,99],51:[2,99],54:[2,99],63:[2,99],64:[2,99],65:[2,99],67:[2,99],69:[2,99],70:[2,99],71:[2,99],75:[2,99],81:[2,99],82:[2,99],83:[2,99],88:[2,99],90:[2,99],99:[2,99],101:[2,99],102:[2,99],103:[2,99],107:[2,99],115:[2,99],123:[2,99],125:[2,99],126:[2,99],129:[2,99],130:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],46:[2,33],51:[2,33],54:[2,33],69:[2,33],75:[2,33],83:[2,33],88:[2,33],90:[2,33],99:[2,33],100:84,101:[2,33],102:[2,33],103:[2,33],106:85,107:[2,33],108:66,115:[2,33],123:[2,33],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{8:238,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],46:[2,104],51:[2,104],54:[2,104],63:[2,104],64:[2,104],65:[2,104],67:[2,104],69:[2,104],70:[2,104],71:[2,104],75:[2,104],81:[2,104],82:[2,104],83:[2,104],88:[2,104],90:[2,104],99:[2,104],101:[2,104],102:[2,104],103:[2,104],107:[2,104],115:[2,104],123:[2,104],125:[2,104],126:[2,104],129:[2,104],130:[2,104],131:[2,104],132:[2,104],133:[2,104],134:[2,104]},{6:[2,49],25:[2,49],50:239,51:[1,223],83:[2,49]},{6:[2,122],25:[2,122],26:[2,122],51:[2,122],54:[1,240],83:[2,122],88:[2,122],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{47:241,48:[1,57],49:[1,58]},{27:107,28:[1,70],41:108,52:242,53:106,55:109,56:110,73:[1,67],86:[1,111],87:[1,112]},{46:[2,55],51:[2,55]},{8:243,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],46:[2,192],51:[2,192],54:[2,192],69:[2,192],75:[2,192],83:[2,192],88:[2,192],90:[2,192],99:[2,192],100:84,101:[2,192],102:[2,192],103:[2,192],106:85,107:[2,192],108:66,115:[2,192],123:[2,192],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{8:244,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],46:[2,194],51:[2,194],54:[2,194],69:[2,194],75:[2,194],83:[2,194],88:[2,194],90:[2,194],99:[2,194],100:84,101:[2,194],102:[2,194],103:[2,194],106:85,107:[2,194],108:66,115:[2,194],123:[2,194],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],46:[2,174],51:[2,174],54:[2,174],69:[2,174],75:[2,174],83:[2,174],88:[2,174],90:[2,174],99:[2,174],101:[2,174],102:[2,174],103:[2,174],107:[2,174],115:[2,174],123:[2,174],125:[2,174],126:[2,174],129:[2,174],130:[2,174],131:[2,174],132:[2,174],133:[2,174],134:[2,174]},{8:245,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,127],6:[2,127],25:[2,127],26:[2,127],46:[2,127],51:[2,127],54:[2,127],69:[2,127],75:[2,127],83:[2,127],88:[2,127],90:[2,127],95:[1,246],99:[2,127],101:[2,127],102:[2,127],103:[2,127],107:[2,127],115:[2,127],123:[2,127],125:[2,127],126:[2,127],129:[2,127],130:[2,127],131:[2,127],132:[2,127],133:[2,127],134:[2,127]},{5:247,25:[1,5]},{27:248,28:[1,70]},{117:249,119:212,120:[1,213]},{26:[1,250],118:[1,251],119:252,120:[1,213]},{26:[2,167],118:[2,167],120:[2,167]},{8:254,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],92:253,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,92],5:255,6:[2,92],25:[1,5],26:[2,92],46:[2,92],51:[2,92],54:[2,92],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],69:[2,92],70:[1,97],71:[1,98],75:[2,92],78:89,81:[1,91],82:[2,102],83:[2,92],88:[2,92],90:[2,92],99:[2,92],101:[2,92],102:[2,92],103:[2,92],107:[2,92],115:[2,92],123:[2,92],125:[2,92],126:[2,92],129:[2,92],130:[2,92],131:[2,92],132:[2,92],133:[2,92],134:[2,92]},{1:[2,66],6:[2,66],25:[2,66],26:[2,66],46:[2,66],51:[2,66],54:[2,66],63:[2,66],64:[2,66],65:[2,66],67:[2,66],69:[2,66],70:[2,66],71:[2,66],75:[2,66],81:[2,66],82:[2,66],83:[2,66],88:[2,66],90:[2,66],99:[2,66],101:[2,66],102:[2,66],103:[2,66],107:[2,66],115:[2,66],123:[2,66],125:[2,66],126:[2,66],129:[2,66],130:[2,66],131:[2,66],132:[2,66],133:[2,66],134:[2,66]},{1:[2,95],6:[2,95],25:[2,95],26:[2,95],46:[2,95],51:[2,95],54:[2,95],69:[2,95],75:[2,95],83:[2,95],88:[2,95],90:[2,95],99:[2,95],101:[2,95],102:[2,95],103:[2,95],107:[2,95],115:[2,95],123:[2,95],125:[2,95],126:[2,95],129:[2,95],130:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95]},{14:256,15:120,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:121,41:60,55:47,56:48,58:215,60:25,61:26,62:27,73:[1,67],80:[1,28],85:[1,55],86:[1,56],87:[1,54],98:[1,53]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],46:[2,132],51:[2,132],54:[2,132],63:[2,132],64:[2,132],65:[2,132],67:[2,132],69:[2,132],70:[2,132],71:[2,132],75:[2,132],81:[2,132],82:[2,132],83:[2,132],88:[2,132],90:[2,132],99:[2,132],101:[2,132],102:[2,132],103:[2,132],107:[2,132],115:[2,132],123:[2,132],125:[2,132],126:[2,132],129:[2,132],130:[2,132],131:[2,132],132:[2,132],133:[2,132],134:[2,132]},{6:[1,71],26:[1,257]},{8:258,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,61],13:[2,112],25:[2,61],28:[2,112],30:[2,112],31:[2,112],33:[2,112],34:[2,112],35:[2,112],42:[2,112],43:[2,112],44:[2,112],48:[2,112],49:[2,112],51:[2,61],73:[2,112],76:[2,112],80:[2,112],85:[2,112],86:[2,112],87:[2,112],88:[2,61],93:[2,112],97:[2,112],98:[2,112],101:[2,112],103:[2,112],105:[2,112],107:[2,112],116:[2,112],122:[2,112],124:[2,112],125:[2,112],126:[2,112],127:[2,112],128:[2,112]},{6:[1,260],25:[1,261],88:[1,259]},{6:[2,50],8:197,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[2,50],26:[2,50],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:145,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],83:[2,50],85:[1,55],86:[1,56],87:[1,54],88:[2,50],91:262,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,49],25:[2,49],26:[2,49],50:263,51:[1,223]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],46:[2,171],51:[2,171],54:[2,171],69:[2,171],75:[2,171],83:[2,171],88:[2,171],90:[2,171],99:[2,171],101:[2,171],102:[2,171],103:[2,171],107:[2,171],115:[2,171],118:[2,171],123:[2,171],125:[2,171],126:[2,171],129:[2,171],130:[2,171],131:[2,171],132:[2,171],133:[2,171],134:[2,171]},{8:264,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:265,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{113:[2,150],114:[2,150]},{27:156,28:[1,70],55:157,56:158,73:[1,67],87:[1,112],112:266},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],46:[2,156],51:[2,156],54:[2,156],69:[2,156],75:[2,156],83:[2,156],88:[2,156],90:[2,156],99:[2,156],100:84,101:[2,156],102:[1,267],103:[2,156],106:85,107:[2,156],108:66,115:[1,268],123:[2,156],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,157],6:[2,157],25:[2,157],26:[2,157],46:[2,157],51:[2,157],54:[2,157],69:[2,157],75:[2,157],83:[2,157],88:[2,157],90:[2,157],99:[2,157],100:84,101:[2,157],102:[1,269],103:[2,157],106:85,107:[2,157],108:66,115:[2,157],123:[2,157],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{6:[1,271],25:[1,272],75:[1,270]},{6:[2,50],12:165,25:[2,50],26:[2,50],27:166,28:[1,70],29:167,30:[1,68],31:[1,69],38:273,39:164,41:168,43:[1,46],75:[2,50],86:[1,111]},{8:274,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,275],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],37:[2,79],46:[2,79],51:[2,79],54:[2,79],63:[2,79],64:[2,79],65:[2,79],67:[2,79],69:[2,79],70:[2,79],71:[2,79],75:[2,79],77:[2,79],81:[2,79],82:[2,79],83:[2,79],88:[2,79],90:[2,79],99:[2,79],101:[2,79],102:[2,79],103:[2,79],107:[2,79],115:[2,79],123:[2,79],125:[2,79],126:[2,79],127:[2,79],128:[2,79],129:[2,79],130:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79]},{8:276,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,69:[2,115],73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{69:[2,116],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{26:[1,277],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{6:[1,260],25:[1,261],83:[1,278]},{6:[2,61],25:[2,61],26:[2,61],51:[2,61],83:[2,61],88:[2,61]},{5:279,25:[1,5]},{46:[2,53],51:[2,53]},{46:[2,56],51:[2,56],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{26:[1,280],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{5:281,25:[1,5],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{5:282,25:[1,5]},{1:[2,128],6:[2,128],25:[2,128],26:[2,128],46:[2,128],51:[2,128],54:[2,128],69:[2,128],75:[2,128],83:[2,128],88:[2,128],90:[2,128],99:[2,128],101:[2,128],102:[2,128],103:[2,128],107:[2,128],115:[2,128],123:[2,128],125:[2,128],126:[2,128],129:[2,128],130:[2,128],131:[2,128],132:[2,128],133:[2,128],134:[2,128]},{5:283,25:[1,5]},{26:[1,284],118:[1,285],119:252,120:[1,213]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],46:[2,165],51:[2,165],54:[2,165],69:[2,165],75:[2,165],83:[2,165],88:[2,165],90:[2,165],99:[2,165],101:[2,165],102:[2,165],103:[2,165],107:[2,165],115:[2,165],123:[2,165],125:[2,165],126:[2,165],129:[2,165],130:[2,165],131:[2,165],132:[2,165],133:[2,165],134:[2,165]},{5:286,25:[1,5]},{26:[2,168],118:[2,168],120:[2,168]},{5:287,25:[1,5],51:[1,288]},{25:[2,124],51:[2,124],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,93],6:[2,93],25:[2,93],26:[2,93],46:[2,93],51:[2,93],54:[2,93],69:[2,93],75:[2,93],83:[2,93],88:[2,93],90:[2,93],99:[2,93],101:[2,93],102:[2,93],103:[2,93],107:[2,93],115:[2,93],123:[2,93],125:[2,93],126:[2,93],129:[2,93],130:[2,93],131:[2,93],132:[2,93],133:[2,93],134:[2,93]},{1:[2,96],5:289,6:[2,96],25:[1,5],26:[2,96],46:[2,96],51:[2,96],54:[2,96],59:90,63:[1,92],64:[1,93],65:[1,94],66:95,67:[1,96],69:[2,96],70:[1,97],71:[1,98],75:[2,96],78:89,81:[1,91],82:[2,102],83:[2,96],88:[2,96],90:[2,96],99:[2,96],101:[2,96],102:[2,96],103:[2,96],107:[2,96],115:[2,96],123:[2,96],125:[2,96],126:[2,96],129:[2,96],130:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96]},{99:[1,290]},{88:[1,291],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],37:[2,110],46:[2,110],51:[2,110],54:[2,110],63:[2,110],64:[2,110],65:[2,110],67:[2,110],69:[2,110],70:[2,110],71:[2,110],75:[2,110],81:[2,110],82:[2,110],83:[2,110],88:[2,110],90:[2,110],99:[2,110],101:[2,110],102:[2,110],103:[2,110],107:[2,110],113:[2,110],114:[2,110],115:[2,110],123:[2,110],125:[2,110],126:[2,110],129:[2,110],130:[2,110],131:[2,110],132:[2,110],133:[2,110],134:[2,110]},{8:197,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:145,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],91:292,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:197,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,25:[1,144],27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,57:145,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],84:293,85:[1,55],86:[1,56],87:[1,54],91:143,93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[2,118],25:[2,118],26:[2,118],51:[2,118],83:[2,118],88:[2,118]},{6:[1,260],25:[1,261],26:[1,294]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],46:[2,135],51:[2,135],54:[2,135],69:[2,135],75:[2,135],83:[2,135],88:[2,135],90:[2,135],99:[2,135],100:84,101:[1,62],102:[2,135],103:[1,63],106:85,107:[1,65],108:66,115:[2,135],123:[2,135],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],46:[2,137],51:[2,137],54:[2,137],69:[2,137],75:[2,137],83:[2,137],88:[2,137],90:[2,137],99:[2,137],100:84,101:[1,62],102:[2,137],103:[1,63],106:85,107:[1,65],108:66,115:[2,137],123:[2,137],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{113:[2,155],114:[2,155]},{8:295,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:296,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:297,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],37:[2,84],46:[2,84],51:[2,84],54:[2,84],63:[2,84],64:[2,84],65:[2,84],67:[2,84],69:[2,84],70:[2,84],71:[2,84],75:[2,84],81:[2,84],82:[2,84],83:[2,84],88:[2,84],90:[2,84],99:[2,84],101:[2,84],102:[2,84],103:[2,84],107:[2,84],113:[2,84],114:[2,84],115:[2,84],123:[2,84],125:[2,84],126:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84]},{12:165,27:166,28:[1,70],29:167,30:[1,68],31:[1,69],38:298,39:164,41:168,43:[1,46],86:[1,111]},{6:[2,85],12:165,25:[2,85],26:[2,85],27:166,28:[1,70],29:167,30:[1,68],31:[1,69],38:163,39:164,41:168,43:[1,46],51:[2,85],74:299,86:[1,111]},{6:[2,87],25:[2,87],26:[2,87],51:[2,87],75:[2,87]},{6:[2,36],25:[2,36],26:[2,36],51:[2,36],75:[2,36],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{8:300,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{69:[2,114],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],46:[2,34],51:[2,34],54:[2,34],69:[2,34],75:[2,34],83:[2,34],88:[2,34],90:[2,34],99:[2,34],101:[2,34],102:[2,34],103:[2,34],107:[2,34],115:[2,34],123:[2,34],125:[2,34],126:[2,34],129:[2,34],130:[2,34],131:[2,34],132:[2,34],133:[2,34],134:[2,34]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],46:[2,105],51:[2,105],54:[2,105],63:[2,105],64:[2,105],65:[2,105],67:[2,105],69:[2,105],70:[2,105],71:[2,105],75:[2,105],81:[2,105],82:[2,105],83:[2,105],88:[2,105],90:[2,105],99:[2,105],101:[2,105],102:[2,105],103:[2,105],107:[2,105],115:[2,105],123:[2,105],125:[2,105],126:[2,105],129:[2,105],130:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105]},{1:[2,45],6:[2,45],25:[2,45],26:[2,45],46:[2,45],51:[2,45],54:[2,45],69:[2,45],75:[2,45],83:[2,45],88:[2,45],90:[2,45],99:[2,45],101:[2,45],102:[2,45],103:[2,45],107:[2,45],115:[2,45],123:[2,45],125:[2,45],126:[2,45],129:[2,45],130:[2,45],131:[2,45],132:[2,45],133:[2,45],134:[2,45]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],46:[2,193],51:[2,193],54:[2,193],69:[2,193],75:[2,193],83:[2,193],88:[2,193],90:[2,193],99:[2,193],101:[2,193],102:[2,193],103:[2,193],107:[2,193],115:[2,193],123:[2,193],125:[2,193],126:[2,193],129:[2,193],130:[2,193],131:[2,193],132:[2,193],133:[2,193],134:[2,193]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],46:[2,172],51:[2,172],54:[2,172],69:[2,172],75:[2,172],83:[2,172],88:[2,172],90:[2,172],99:[2,172],101:[2,172],102:[2,172],103:[2,172],107:[2,172],115:[2,172],118:[2,172],123:[2,172],125:[2,172],126:[2,172],129:[2,172],130:[2,172],131:[2,172],132:[2,172],133:[2,172],134:[2,172]},{1:[2,129],6:[2,129],25:[2,129],26:[2,129],46:[2,129],51:[2,129],54:[2,129],69:[2,129],75:[2,129],83:[2,129],88:[2,129],90:[2,129],99:[2,129],101:[2,129],102:[2,129],103:[2,129],107:[2,129],115:[2,129],123:[2,129],125:[2,129],126:[2,129],129:[2,129],130:[2,129],131:[2,129],132:[2,129],133:[2,129],134:[2,129]},{1:[2,130],6:[2,130],25:[2,130],26:[2,130],46:[2,130],51:[2,130],54:[2,130],69:[2,130],75:[2,130],83:[2,130],88:[2,130],90:[2,130],95:[2,130],99:[2,130],101:[2,130],102:[2,130],103:[2,130],107:[2,130],115:[2,130],123:[2,130],125:[2,130],126:[2,130],129:[2,130],130:[2,130],131:[2,130],132:[2,130],133:[2,130],134:[2,130]},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],46:[2,163],51:[2,163],54:[2,163],69:[2,163],75:[2,163],83:[2,163],88:[2,163],90:[2,163],99:[2,163],101:[2,163],102:[2,163],103:[2,163],107:[2,163],115:[2,163],123:[2,163],125:[2,163],126:[2,163],129:[2,163],130:[2,163],131:[2,163],132:[2,163],133:[2,163],134:[2,163]},{5:301,25:[1,5]},{26:[1,302]},{6:[1,303],26:[2,169],118:[2,169],120:[2,169]},{8:304,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{1:[2,97],6:[2,97],25:[2,97],26:[2,97],46:[2,97],51:[2,97],54:[2,97],69:[2,97],75:[2,97],83:[2,97],88:[2,97],90:[2,97],99:[2,97],101:[2,97],102:[2,97],103:[2,97],107:[2,97],115:[2,97],123:[2,97],125:[2,97],126:[2,97],129:[2,97],130:[2,97],131:[2,97],132:[2,97],133:[2,97],134:[2,97]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],46:[2,133],51:[2,133],54:[2,133],63:[2,133],64:[2,133],65:[2,133],67:[2,133],69:[2,133],70:[2,133],71:[2,133],75:[2,133],81:[2,133],82:[2,133],83:[2,133],88:[2,133],90:[2,133],99:[2,133],101:[2,133],102:[2,133],103:[2,133],107:[2,133],115:[2,133],123:[2,133],125:[2,133],126:[2,133],129:[2,133],130:[2,133],131:[2,133],132:[2,133],133:[2,133],134:[2,133]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],46:[2,113],51:[2,113],54:[2,113],63:[2,113],64:[2,113],65:[2,113],67:[2,113],69:[2,113],70:[2,113],71:[2,113],75:[2,113],81:[2,113],82:[2,113],83:[2,113],88:[2,113],90:[2,113],99:[2,113],101:[2,113],102:[2,113],103:[2,113],107:[2,113],115:[2,113],123:[2,113],125:[2,113],126:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113]},{6:[2,119],25:[2,119],26:[2,119],51:[2,119],83:[2,119],88:[2,119]},{6:[2,49],25:[2,49],26:[2,49],50:305,51:[1,223]},{6:[2,120],25:[2,120],26:[2,120],51:[2,120],83:[2,120],88:[2,120]},{1:[2,158],6:[2,158],25:[2,158],26:[2,158],46:[2,158],51:[2,158],54:[2,158],69:[2,158],75:[2,158],83:[2,158],88:[2,158],90:[2,158],99:[2,158],100:84,101:[2,158],102:[2,158],103:[2,158],106:85,107:[2,158],108:66,115:[1,306],123:[2,158],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,160],6:[2,160],25:[2,160],26:[2,160],46:[2,160],51:[2,160],54:[2,160],69:[2,160],75:[2,160],83:[2,160],88:[2,160],90:[2,160],99:[2,160],100:84,101:[2,160],102:[1,307],103:[2,160],106:85,107:[2,160],108:66,115:[2,160],123:[2,160],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,159],6:[2,159],25:[2,159],26:[2,159],46:[2,159],51:[2,159],54:[2,159],69:[2,159],75:[2,159],83:[2,159],88:[2,159],90:[2,159],99:[2,159],100:84,101:[2,159],102:[2,159],103:[2,159],106:85,107:[2,159],108:66,115:[2,159],123:[2,159],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{6:[2,88],25:[2,88],26:[2,88],51:[2,88],75:[2,88]},{6:[2,49],25:[2,49],26:[2,49],50:308,51:[1,233]},{26:[1,309],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{26:[1,310]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],46:[2,166],51:[2,166],54:[2,166],69:[2,166],75:[2,166],83:[2,166],88:[2,166],90:[2,166],99:[2,166],101:[2,166],102:[2,166],103:[2,166],107:[2,166],115:[2,166],123:[2,166],125:[2,166],126:[2,166],129:[2,166],130:[2,166],131:[2,166],132:[2,166],133:[2,166],134:[2,166]},{26:[2,170],118:[2,170],120:[2,170]},{25:[2,125],51:[2,125],100:84,101:[1,62],103:[1,63],106:85,107:[1,65],108:66,123:[1,83],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{6:[1,260],25:[1,261],26:[1,311]},{8:312,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{8:313,9:115,10:19,11:20,12:21,13:[1,22],14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:18,27:59,28:[1,70],29:49,30:[1,68],31:[1,69],32:24,33:[1,50],34:[1,51],35:[1,52],36:23,41:60,42:[1,44],43:[1,46],44:[1,29],47:30,48:[1,57],49:[1,58],55:47,56:48,58:36,60:25,61:26,62:27,73:[1,67],76:[1,43],80:[1,28],85:[1,55],86:[1,56],87:[1,54],93:[1,38],97:[1,45],98:[1,53],100:39,101:[1,62],103:[1,63],104:40,105:[1,64],106:41,107:[1,65],108:66,116:[1,42],121:37,122:[1,61],124:[1,31],125:[1,32],126:[1,33],127:[1,34],128:[1,35]},{6:[1,271],25:[1,272],26:[1,314]},{6:[2,37],25:[2,37],26:[2,37],51:[2,37],75:[2,37]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],46:[2,164],51:[2,164],54:[2,164],69:[2,164],75:[2,164],83:[2,164],88:[2,164],90:[2,164],99:[2,164],101:[2,164],102:[2,164],103:[2,164],107:[2,164],115:[2,164],123:[2,164],125:[2,164],126:[2,164],129:[2,164],130:[2,164],131:[2,164],132:[2,164],133:[2,164],134:[2,164]},{6:[2,121],25:[2,121],26:[2,121],51:[2,121],83:[2,121],88:[2,121]},{1:[2,161],6:[2,161],25:[2,161],26:[2,161],46:[2,161],51:[2,161],54:[2,161],69:[2,161],75:[2,161],83:[2,161],88:[2,161],90:[2,161],99:[2,161],100:84,101:[2,161],102:[2,161],103:[2,161],106:85,107:[2,161],108:66,115:[2,161],123:[2,161],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{1:[2,162],6:[2,162],25:[2,162],26:[2,162],46:[2,162],51:[2,162],54:[2,162],69:[2,162],75:[2,162],83:[2,162],88:[2,162],90:[2,162],99:[2,162],100:84,101:[2,162],102:[2,162],103:[2,162],106:85,107:[2,162],108:66,115:[2,162],123:[2,162],125:[1,77],126:[1,76],129:[1,75],130:[1,78],131:[1,79],132:[1,80],133:[1,81],134:[1,82]},{6:[2,89],25:[2,89],26:[2,89],51:[2,89],75:[2,89]}],
+defaultActions: {57:[2,47],58:[2,48],72:[2,3],91:[2,103],186:[2,83]},
+parseError: function parseError(str, hash) {
+ throw new Error(str);
+},
+parse: function parse(input) {
+ var self = this,
+ stack = [0],
+ vstack = [null], // semantic value stack
+ lstack = [], // location stack
+ table = this.table,
+ yytext = '',
+ yylineno = 0,
+ yyleng = 0,
+ recovering = 0,
+ TERROR = 2,
+ EOF = 1;
+
+ //this.reductionCount = this.shiftCount = 0;
+
+ this.lexer.setInput(input);
+ this.lexer.yy = this.yy;
+ this.yy.lexer = this.lexer;
+ if (typeof this.lexer.yylloc == 'undefined')
+ this.lexer.yylloc = {};
+ var yyloc = this.lexer.yylloc;
+ lstack.push(yyloc);
+
+ if (typeof this.yy.parseError === 'function')
+ this.parseError = this.yy.parseError;
+
+ function popStack (n) {
+ stack.length = stack.length - 2*n;
+ vstack.length = vstack.length - n;
+ lstack.length = lstack.length - n;
+ }
+
+ function lex() {
+ var token;
+ token = self.lexer.lex() || 1; // $end = 1
+ // if token isn't its numeric value, convert
+ if (typeof token !== 'number') {
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ };
+
+ var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;
+ while (true) {
+ // retreive state number from top of stack
+ state = stack[stack.length-1];
+
+ // use default actions if available
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol == null)
+ symbol = lex();
+ // read action for current state and first input
+ action = table[state] && table[state][symbol];
+ }
+
+ // handle parse error
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
+
+ if (!recovering) {
+ // Report error
+ expected = [];
+ for (p in table[state]) if (this.terminals_[p] && p > 2) {
+ expected.push("'"+this.terminals_[p]+"'");
+ }
+ var errStr = '';
+ if (this.lexer.showPosition) {
+ errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+'\nExpecting '+expected.join(', ');
+ } else {
+ errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " +
+ (symbol == 1 /*EOF*/ ? "end of input" :
+ ("'"+(this.terminals_[symbol] || symbol)+"'"));
+ }
+ this.parseError(errStr,
+ {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});
+ }
+
+ // just recovered from another error
+ if (recovering == 3) {
+ if (symbol == EOF) {
+ throw new Error(errStr || 'Parsing halted.');
+ }
+
+ // discard current lookahead and grab another
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ symbol = lex();
+ }
+
+ // try to recover from error
+ while (1) {
+ // check for error recovery rule in this state
+ if ((TERROR.toString()) in table[state]) {
+ break;
+ }
+ if (state == 0) {
+ throw new Error(errStr || 'Parsing halted.');
+ }
+ popStack(1);
+ state = stack[stack.length-1];
+ }
+
+ preErrorSymbol = symbol; // save the lookahead token
+ symbol = TERROR; // insert generic error symbol as new lookahead
+ state = stack[stack.length-1];
+ action = table[state] && table[state][TERROR];
+ recovering = 3; // allow 3 real symbols to be shifted before reporting a new error
+ }
+
+ // this shouldn't happen, unless resolve defaults are off
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);
+ }
+
+ switch (action[0]) {
+
+ case 1: // shift
+ //this.shiftCount++;
+
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]); // push state
+ symbol = null;
+ if (!preErrorSymbol) { // normal execution/no error
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0)
+ recovering--;
+ } else { // error just occurred, resume old lookahead f/ before error
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+
+ case 2: // reduce
+ //this.reductionCount++;
+
+ len = this.productions_[action[1]][1];
+
+ // perform semantic action
+ yyval.$ = vstack[vstack.length-len]; // default to $$ = $1
+ // default location, uses first token for firsts, last for lasts
+ yyval._$ = {
+ first_line: lstack[lstack.length-(len||1)].first_line,
+ last_line: lstack[lstack.length-1].last_line,
+ first_column: lstack[lstack.length-(len||1)].first_column,
+ last_column: lstack[lstack.length-1].last_column
+ };
+ r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);
+
+ if (typeof r !== 'undefined') {
+ return r;
+ }
+
+ // pop off stack
+ if (len) {
+ stack = stack.slice(0,-1*len*2);
+ vstack = vstack.slice(0, -1*len);
+ lstack = lstack.slice(0, -1*len);
+ }
+
+ stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ // goto new state = table[STATE][NONTERMINAL]
+ newState = table[stack[stack.length-2]][stack[stack.length-1]];
+ stack.push(newState);
+ break;
+
+ case 3: // accept
+ return true;
+ }
+
+ }
+
+ return true;
+}};
+return parser;
+})();
+if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
+exports.parser = parser;
+exports.parse = function () { return parser.parse.apply(parser, arguments); }
+exports.main = function commonjsMain(args) {
+ if (!args[1])
+ throw new Error('Usage: '+args[0]+' FILE');
+ if (typeof process !== 'undefined') {
+ var source = require('fs').readFileSync(require('path').join(process.cwd(), args[1]), "utf8");
+ } else {
+ var cwd = require("file").path(require("file").cwd());
+ var source = cwd.join(args[1]).read({charset: "utf-8"});
+ }
+ return exports.parser.parse(source);
+}
+if (typeof module !== 'undefined' && require.main === module) {
+ exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args);
+}
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/repl.js b/node_modules/anvil.js/node_modules/coffee-script/lib/repl.js
new file mode 100644
index 0000000..9e1bf7c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/repl.js
@@ -0,0 +1,123 @@
+(function() {
+ var ACCESSOR, CoffeeScript, Module, REPL_PROMPT, REPL_PROMPT_CONTINUATION, SIMPLEVAR, Script, autocomplete, backlog, completeAttribute, completeVariable, enableColours, error, g, getCompletions, inspect, nonContextGlobals, readline, repl, run, sandbox, stdin, stdout, _i, _len;
+ CoffeeScript = require('./coffee-script');
+ readline = require('readline');
+ inspect = require('util').inspect;
+ Script = require('vm').Script;
+ Module = require('module');
+ REPL_PROMPT = 'coffee> ';
+ REPL_PROMPT_CONTINUATION = '......> ';
+ enableColours = false;
+ if (process.platform !== 'win32') {
+ enableColours = !process.env.NODE_DISABLE_COLORS;
+ }
+ stdin = process.openStdin();
+ stdout = process.stdout;
+ error = function(err) {
+ return stdout.write((err.stack || err.toString()) + '\n\n');
+ };
+ backlog = '';
+ sandbox = Script.createContext();
+ nonContextGlobals = ['Buffer', 'console', 'process', 'setInterval', 'clearInterval', 'setTimeout', 'clearTimeout'];
+ for (_i = 0, _len = nonContextGlobals.length; _i < _len; _i++) {
+ g = nonContextGlobals[_i];
+ sandbox[g] = global[g];
+ }
+ sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox;
+ run = function(buffer) {
+ var code, returnValue, _;
+ if (!buffer.toString().trim() && !backlog) {
+ repl.prompt();
+ return;
+ }
+ code = backlog += buffer;
+ if (code[code.length - 1] === '\\') {
+ backlog = "" + backlog.slice(0, -1) + "\n";
+ repl.setPrompt(REPL_PROMPT_CONTINUATION);
+ repl.prompt();
+ return;
+ }
+ repl.setPrompt(REPL_PROMPT);
+ backlog = '';
+ try {
+ _ = sandbox._;
+ returnValue = CoffeeScript.eval("_=(" + code + "\n)", {
+ sandbox: sandbox,
+ filename: 'repl',
+ modulename: 'repl'
+ });
+ if (returnValue === void 0) {
+ sandbox._ = _;
+ } else {
+ process.stdout.write(inspect(returnValue, false, 2, enableColours) + '\n');
+ }
+ } catch (err) {
+ error(err);
+ }
+ return repl.prompt();
+ };
+ ACCESSOR = /\s*([\w\.]+)(?:\.(\w*))$/;
+ SIMPLEVAR = /\s*(\w*)$/i;
+ autocomplete = function(text) {
+ return completeAttribute(text) || completeVariable(text) || [[], text];
+ };
+ completeAttribute = function(text) {
+ var all, completions, match, obj, prefix, val;
+ if (match = text.match(ACCESSOR)) {
+ all = match[0], obj = match[1], prefix = match[2];
+ try {
+ val = Script.runInContext(obj, sandbox);
+ } catch (error) {
+ return;
+ }
+ completions = getCompletions(prefix, Object.getOwnPropertyNames(val));
+ return [completions, prefix];
+ }
+ };
+ completeVariable = function(text) {
+ var completions, free, possibilities, vars, _ref;
+ if (free = (_ref = text.match(SIMPLEVAR)) != null ? _ref[1] : void 0) {
+ vars = Script.runInContext('Object.getOwnPropertyNames(this)', sandbox);
+ possibilities = vars.concat(CoffeeScript.RESERVED);
+ completions = getCompletions(free, possibilities);
+ return [completions, free];
+ }
+ };
+ getCompletions = function(prefix, candidates) {
+ var el, _j, _len2, _results;
+ _results = [];
+ for (_j = 0, _len2 = candidates.length; _j < _len2; _j++) {
+ el = candidates[_j];
+ if (el.indexOf(prefix) === 0) {
+ _results.push(el);
+ }
+ }
+ return _results;
+ };
+ process.on('uncaughtException', error);
+ if (readline.createInterface.length < 3) {
+ repl = readline.createInterface(stdin, autocomplete);
+ stdin.on('data', function(buffer) {
+ return repl.write(buffer);
+ });
+ } else {
+ repl = readline.createInterface(stdin, stdout, autocomplete);
+ }
+ repl.on('attemptClose', function() {
+ if (backlog) {
+ backlog = '';
+ process.stdout.write('\n');
+ repl.setPrompt(REPL_PROMPT);
+ return repl.prompt();
+ } else {
+ return repl.close();
+ }
+ });
+ repl.on('close', function() {
+ process.stdout.write('\n');
+ return stdin.destroy();
+ });
+ repl.on('line', run);
+ repl.setPrompt(REPL_PROMPT);
+ repl.prompt();
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/rewriter.js b/node_modules/anvil.js/node_modules/coffee-script/lib/rewriter.js
new file mode 100644
index 0000000..d50a222
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/rewriter.js
@@ -0,0 +1,363 @@
+(function() {
+ var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref;
+ var __indexOf = Array.prototype.indexOf || function(item) {
+ for (var i = 0, l = this.length; i < l; i++) {
+ if (this[i] === item) return i;
+ }
+ return -1;
+ }, __slice = Array.prototype.slice;
+ exports.Rewriter = (function() {
+ function Rewriter() {}
+ Rewriter.prototype.rewrite = function(tokens) {
+ this.tokens = tokens;
+ this.removeLeadingNewlines();
+ this.removeMidExpressionNewlines();
+ this.closeOpenCalls();
+ this.closeOpenIndexes();
+ this.addImplicitIndentation();
+ this.tagPostfixConditionals();
+ this.addImplicitBraces();
+ this.addImplicitParentheses();
+ this.ensureBalance(BALANCED_PAIRS);
+ this.rewriteClosingParens();
+ return this.tokens;
+ };
+ Rewriter.prototype.scanTokens = function(block) {
+ var i, token, tokens;
+ tokens = this.tokens;
+ i = 0;
+ while (token = tokens[i]) {
+ i += block.call(this, token, i, tokens);
+ }
+ return true;
+ };
+ Rewriter.prototype.detectEnd = function(i, condition, action) {
+ var levels, token, tokens, _ref, _ref2;
+ tokens = this.tokens;
+ levels = 0;
+ while (token = tokens[i]) {
+ if (levels === 0 && condition.call(this, token, i)) {
+ return action.call(this, token, i);
+ }
+ if (!token || levels < 0) {
+ return action.call(this, token, i - 1);
+ }
+ if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) {
+ levels += 1;
+ } else if (_ref2 = token[0], __indexOf.call(EXPRESSION_END, _ref2) >= 0) {
+ levels -= 1;
+ }
+ i += 1;
+ }
+ return i - 1;
+ };
+ Rewriter.prototype.removeLeadingNewlines = function() {
+ var i, tag, _len, _ref;
+ _ref = this.tokens;
+ for (i = 0, _len = _ref.length; i < _len; i++) {
+ tag = _ref[i][0];
+ if (tag !== 'TERMINATOR') {
+ break;
+ }
+ }
+ if (i) {
+ return this.tokens.splice(0, i);
+ }
+ };
+ Rewriter.prototype.removeMidExpressionNewlines = function() {
+ return this.scanTokens(function(token, i, tokens) {
+ var _ref;
+ if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) {
+ return 1;
+ }
+ tokens.splice(i, 1);
+ return 0;
+ });
+ };
+ Rewriter.prototype.closeOpenCalls = function() {
+ var action, condition;
+ condition = function(token, i) {
+ var _ref;
+ return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')';
+ };
+ action = function(token, i) {
+ return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END';
+ };
+ return this.scanTokens(function(token, i) {
+ if (token[0] === 'CALL_START') {
+ this.detectEnd(i + 1, condition, action);
+ }
+ return 1;
+ });
+ };
+ Rewriter.prototype.closeOpenIndexes = function() {
+ var action, condition;
+ condition = function(token, i) {
+ var _ref;
+ return (_ref = token[0]) === ']' || _ref === 'INDEX_END';
+ };
+ action = function(token, i) {
+ return token[0] = 'INDEX_END';
+ };
+ return this.scanTokens(function(token, i) {
+ if (token[0] === 'INDEX_START') {
+ this.detectEnd(i + 1, condition, action);
+ }
+ return 1;
+ });
+ };
+ Rewriter.prototype.addImplicitBraces = function() {
+ var action, condition, stack, start, startIndent;
+ stack = [];
+ start = null;
+ startIndent = 0;
+ condition = function(token, i) {
+ var one, tag, three, two, _ref, _ref2;
+ _ref = this.tokens.slice(i + 1, (i + 3 + 1) || 9e9), one = _ref[0], two = _ref[1], three = _ref[2];
+ if ('HERECOMMENT' === (one != null ? one[0] : void 0)) {
+ return false;
+ }
+ tag = token[0];
+ return ((tag === 'TERMINATOR' || tag === 'OUTDENT') && !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':')) || (tag === ',' && one && ((_ref2 = one[0]) !== 'IDENTIFIER' && _ref2 !== 'NUMBER' && _ref2 !== 'STRING' && _ref2 !== '@' && _ref2 !== 'TERMINATOR' && _ref2 !== 'OUTDENT'));
+ };
+ action = function(token, i) {
+ var tok;
+ tok = ['}', '}', token[2]];
+ tok.generated = true;
+ return this.tokens.splice(i, 0, tok);
+ };
+ return this.scanTokens(function(token, i, tokens) {
+ var ago, idx, tag, tok, value, _ref, _ref2;
+ if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) {
+ stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]);
+ return 1;
+ }
+ if (__indexOf.call(EXPRESSION_END, tag) >= 0) {
+ start = stack.pop();
+ return 1;
+ }
+ if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref2 = stack[stack.length - 1]) != null ? _ref2[0] : void 0) !== '{'))) {
+ return 1;
+ }
+ stack.push(['{']);
+ idx = ago === '@' ? i - 2 : i - 1;
+ while (this.tag(idx - 2) === 'HERECOMMENT') {
+ idx -= 2;
+ }
+ value = new String('{');
+ value.generated = true;
+ tok = ['{', value, token[2]];
+ tok.generated = true;
+ tokens.splice(idx, 0, tok);
+ this.detectEnd(i + 2, condition, action);
+ return 2;
+ });
+ };
+ Rewriter.prototype.addImplicitParentheses = function() {
+ var action, noCall;
+ noCall = false;
+ action = function(token, i) {
+ var idx;
+ idx = token[0] === 'OUTDENT' ? i + 1 : i;
+ return this.tokens.splice(idx, 0, ['CALL_END', ')', token[2]]);
+ };
+ return this.scanTokens(function(token, i, tokens) {
+ var callObject, current, next, prev, seenControl, seenSingle, tag, _ref, _ref2, _ref3;
+ tag = token[0];
+ if (tag === 'CLASS' || tag === 'IF') {
+ noCall = true;
+ }
+ _ref = tokens.slice(i - 1, (i + 1 + 1) || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2];
+ callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0);
+ seenSingle = false;
+ seenControl = false;
+ if (__indexOf.call(LINEBREAKS, tag) >= 0) {
+ noCall = false;
+ }
+ if (prev && !prev.spaced && tag === '?') {
+ token.call = true;
+ }
+ if (token.fromThen) {
+ return 1;
+ }
+ if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref3 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref3) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) {
+ return 1;
+ }
+ tokens.splice(i, 0, ['CALL_START', '(', token[2]]);
+ this.detectEnd(i + 1, function(token, i) {
+ var post, _ref4;
+ tag = token[0];
+ if (!seenSingle && token.fromThen) {
+ return true;
+ }
+ if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>') {
+ seenSingle = true;
+ }
+ if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY') {
+ seenControl = true;
+ }
+ if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') {
+ return true;
+ }
+ return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (this.tag(i - 2) !== 'CLASS' && (_ref4 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref4) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{')));
+ }, action);
+ if (prev[0] === '?') {
+ prev[0] = 'FUNC_EXIST';
+ }
+ return 2;
+ });
+ };
+ Rewriter.prototype.addImplicitIndentation = function() {
+ return this.scanTokens(function(token, i, tokens) {
+ var action, condition, indent, outdent, starter, tag, _ref, _ref2;
+ tag = token[0];
+ if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') {
+ tokens.splice(i, 1);
+ return 0;
+ }
+ if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') {
+ tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token))));
+ return 2;
+ }
+ if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) {
+ tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token))));
+ return 4;
+ }
+ if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {
+ starter = tag;
+ _ref2 = this.indentation(token), indent = _ref2[0], outdent = _ref2[1];
+ if (starter === 'THEN') {
+ indent.fromThen = true;
+ }
+ indent.generated = outdent.generated = true;
+ tokens.splice(i + 1, 0, indent);
+ condition = function(token, i) {
+ var _ref3;
+ return token[1] !== ';' && (_ref3 = token[0], __indexOf.call(SINGLE_CLOSERS, _ref3) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN'));
+ };
+ action = function(token, i) {
+ return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent);
+ };
+ this.detectEnd(i + 2, condition, action);
+ if (tag === 'THEN') {
+ tokens.splice(i, 1);
+ }
+ return 1;
+ }
+ return 1;
+ });
+ };
+ Rewriter.prototype.tagPostfixConditionals = function() {
+ var condition;
+ condition = function(token, i) {
+ var _ref;
+ return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT';
+ };
+ return this.scanTokens(function(token, i) {
+ var original;
+ if (token[0] !== 'IF') {
+ return 1;
+ }
+ original = token;
+ this.detectEnd(i + 1, condition, function(token, i) {
+ if (token[0] !== 'INDENT') {
+ return original[0] = 'POST_' + original[0];
+ }
+ });
+ return 1;
+ });
+ };
+ Rewriter.prototype.ensureBalance = function(pairs) {
+ var close, level, levels, open, openLine, tag, token, _i, _j, _len, _len2, _ref, _ref2;
+ levels = {};
+ openLine = {};
+ _ref = this.tokens;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ token = _ref[_i];
+ tag = token[0];
+ for (_j = 0, _len2 = pairs.length; _j < _len2; _j++) {
+ _ref2 = pairs[_j], open = _ref2[0], close = _ref2[1];
+ levels[open] |= 0;
+ if (tag === open) {
+ if (levels[open]++ === 0) {
+ openLine[open] = token[2];
+ }
+ } else if (tag === close && --levels[open] < 0) {
+ throw Error("too many " + token[1] + " on line " + (token[2] + 1));
+ }
+ }
+ }
+ for (open in levels) {
+ level = levels[open];
+ if (level > 0) {
+ throw Error("unclosed " + open + " on line " + (openLine[open] + 1));
+ }
+ }
+ return this;
+ };
+ Rewriter.prototype.rewriteClosingParens = function() {
+ var debt, key, stack;
+ stack = [];
+ debt = {};
+ for (key in INVERSES) {
+ debt[key] = 0;
+ }
+ return this.scanTokens(function(token, i, tokens) {
+ var inv, match, mtag, oppos, tag, val, _ref;
+ if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) {
+ stack.push(token);
+ return 1;
+ }
+ if (__indexOf.call(EXPRESSION_END, tag) < 0) {
+ return 1;
+ }
+ if (debt[inv = INVERSES[tag]] > 0) {
+ debt[inv] -= 1;
+ tokens.splice(i, 1);
+ return 0;
+ }
+ match = stack.pop();
+ mtag = match[0];
+ oppos = INVERSES[mtag];
+ if (tag === oppos) {
+ return 1;
+ }
+ debt[mtag] += 1;
+ val = [oppos, mtag === 'INDENT' ? match[1] : oppos];
+ if (this.tag(i + 2) === mtag) {
+ tokens.splice(i + 3, 0, val);
+ stack.push(match);
+ } else {
+ tokens.splice(i, 0, val);
+ }
+ return 1;
+ });
+ };
+ Rewriter.prototype.indentation = function(token) {
+ return [['INDENT', 2, token[2]], ['OUTDENT', 2, token[2]]];
+ };
+ Rewriter.prototype.tag = function(i) {
+ var _ref;
+ return (_ref = this.tokens[i]) != null ? _ref[0] : void 0;
+ };
+ return Rewriter;
+ })();
+ BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']];
+ INVERSES = {};
+ EXPRESSION_START = [];
+ EXPRESSION_END = [];
+ for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) {
+ _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1];
+ EXPRESSION_START.push(INVERSES[rite] = left);
+ EXPRESSION_END.push(INVERSES[left] = rite);
+ }
+ EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END);
+ IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS'];
+ IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++'];
+ IMPLICIT_UNSPACED_CALL = ['+', '-'];
+ IMPLICIT_BLOCK = ['->', '=>', '{', '[', ','];
+ IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
+ SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN'];
+ SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
+ LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/lib/scope.js b/node_modules/anvil.js/node_modules/coffee-script/lib/scope.js
new file mode 100644
index 0000000..ab88ba9
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/lib/scope.js
@@ -0,0 +1,120 @@
+(function() {
+ var Scope, extend, last, _ref;
+ _ref = require('./helpers'), extend = _ref.extend, last = _ref.last;
+ exports.Scope = Scope = (function() {
+ Scope.root = null;
+ function Scope(parent, expressions, method) {
+ this.parent = parent;
+ this.expressions = expressions;
+ this.method = method;
+ this.variables = [
+ {
+ name: 'arguments',
+ type: 'arguments'
+ }
+ ];
+ this.positions = {};
+ if (!this.parent) {
+ Scope.root = this;
+ }
+ }
+ Scope.prototype.add = function(name, type, immediate) {
+ var pos;
+ if (this.shared && !immediate) {
+ return this.parent.add(name, type, immediate);
+ }
+ if (typeof (pos = this.positions[name]) === 'number') {
+ return this.variables[pos].type = type;
+ } else {
+ return this.positions[name] = this.variables.push({
+ name: name,
+ type: type
+ }) - 1;
+ }
+ };
+ Scope.prototype.find = function(name, options) {
+ if (this.check(name, options)) {
+ return true;
+ }
+ this.add(name, 'var');
+ return false;
+ };
+ Scope.prototype.parameter = function(name) {
+ if (this.shared && this.parent.check(name, true)) {
+ return;
+ }
+ return this.add(name, 'param');
+ };
+ Scope.prototype.check = function(name, immediate) {
+ var found, _ref2;
+ found = !!this.type(name);
+ if (found || immediate) {
+ return found;
+ }
+ return !!((_ref2 = this.parent) != null ? _ref2.check(name) : void 0);
+ };
+ Scope.prototype.temporary = function(name, index) {
+ if (name.length > 1) {
+ return '_' + name + (index > 1 ? index : '');
+ } else {
+ return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a');
+ }
+ };
+ Scope.prototype.type = function(name) {
+ var v, _i, _len, _ref2;
+ _ref2 = this.variables;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ v = _ref2[_i];
+ if (v.name === name) {
+ return v.type;
+ }
+ }
+ return null;
+ };
+ Scope.prototype.freeVariable = function(type) {
+ var index, temp;
+ index = 0;
+ while (this.check((temp = this.temporary(type, index)))) {
+ index++;
+ }
+ this.add(temp, 'var', true);
+ return temp;
+ };
+ Scope.prototype.assign = function(name, value) {
+ this.add(name, {
+ value: value,
+ assigned: true
+ });
+ return this.hasAssignments = true;
+ };
+ Scope.prototype.hasDeclarations = function() {
+ return !!this.declaredVariables().length;
+ };
+ Scope.prototype.declaredVariables = function() {
+ var realVars, tempVars, v, _i, _len, _ref2;
+ realVars = [];
+ tempVars = [];
+ _ref2 = this.variables;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ v = _ref2[_i];
+ if (v.type === 'var') {
+ (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name);
+ }
+ }
+ return realVars.sort().concat(tempVars.sort());
+ };
+ Scope.prototype.assignedVariables = function() {
+ var v, _i, _len, _ref2, _results;
+ _ref2 = this.variables;
+ _results = [];
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ v = _ref2[_i];
+ if (v.type.assigned) {
+ _results.push("" + v.name + " = " + v.type.value);
+ }
+ }
+ return _results;
+ };
+ return Scope;
+ })();
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffee-script/package.json b/node_modules/anvil.js/node_modules/coffee-script/package.json
new file mode 100644
index 0000000..58210ed
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffee-script/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "coffee-script",
+ "description": "Unfancy JavaScript",
+ "keywords": ["javascript", "language", "coffeescript", "compiler"],
+ "author": "Jeremy Ashkenas",
+ "version": "1.1.2",
+ "licenses": [{
+ "type": "MIT",
+ "url": "http://github.com/jashkenas/coffee-script/raw/master/LICENSE"
+ }],
+ "engines": {
+ "node": ">=0.2.5"
+ },
+ "directories" : {
+ "lib" : "./lib"
+ },
+ "main" : "./lib/coffee-script",
+ "bin": {
+ "coffee": "./bin/coffee",
+ "cake": "./bin/cake"
+ },
+ "homepage": "http://coffeescript.org",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jashkenas/coffee-script.git"
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/coffeekup/.npmignore b/node_modules/anvil.js/node_modules/coffeekup/.npmignore
new file mode 100644
index 0000000..8dd8f6e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/.npmignore
@@ -0,0 +1,2 @@
+.git*
+material/
diff --git a/node_modules/anvil.js/node_modules/coffeekup/CHANGELOG.md b/node_modules/anvil.js/node_modules/coffeekup/CHANGELOG.md
new file mode 100644
index 0000000..074a469
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/CHANGELOG.md
@@ -0,0 +1,78 @@
+**v0.3.1** (2011-09-29):
+
+ - Fixed #71: indexOf not supported in IE7 (thanks @jaekwon).
+ - Added better error reporting to express adapter. [benekastah]
+ - Added `yield`: see `/docs/reference.md`. Closes #16 (thanks @pyrotechnick, @colinta and @smathy).
+ - Added prefixed attributes: `data: {icon: 'foo.png'}` renders as `data-icon="foo.png"`. [colinta]
+ - Added functions as attribute values: `onclick: -> alert 'hi'`. Closes #79 (thanks @smathy).
+
+**v0.3.0** (2011-09-04):
+
+ - Fixed #64 (`hardcode` option masked in express adapter). [smathy]
+ - Added missing elements from the HTML 5 spec (both valid and obsolete). Closes #66 (thanks @aeosynth).
+ - Added compile to js option to CLI. Closes #58. [rachel-carvalho]
+ - Fixed #69 (`coffeekup -w` only compiles upon first change). [rachel-carvalho]
+
+**v0.3.0beta** (2011-07-27):
+
+ - Added documentation: API reference at `/docs/reference.md` and annotated source at `/docs/coffeekup.html`.
+
+ - Added id/class shortcuts: `div '#id.class.class2', 'contents'` (thanks @aeosynth and @payload).
+
+ - Added IE conditional comments: `ie 'lt IE8', -> 'IE 7 or less stuff'` (thanks @aeosynth).
+
+ - Added `ck.adapters.express` which allows `partial 'foo'` instead of `text @partial 'foo'` - see `/examples/express` (thanks @cushman).
+
+ - Added `coffeescript src: 'file.coffee'` and `coffeescript 'string'` - see reference (thanks @henrikh).
+
+ - Changed the template param format to align with Express and other templating engines. Now `tpl(foo: 'bar')` makes `foo` accessible as `h1 @foo`. `context` is not used anymore.
+
+ - `tpl(locals: {foo: 'bar'})` now always implemented through the `with` keyword (past behavior with `dynamic_locals: true`).
+
+ - `tpl(hardcode: {foo: 'bar'})` will hardcode `foo` into the compiled template's body (past behavior with `dynamic_locals: false`).
+
+ - Fixed: `coffeescript -> code()` now correctly adds CoffeeScript helpers to the output.
+
+ - Changed: using `.call(this);` instead of `();` in js generated by `coffeescript`.
+
+ - Fixed: correctly handle numbers and booleans when used as tag contents or attribute values.
+
+ - Fixed #50: "`coffeekup -w` quits on syntax error".
+
+ - Added: doctypes now editable at `coffeekup.doctypes`, tags at `coffeekup.tags`, and self-closing tags at `coffeekup.self_closing`.
+
+ - Added the `ce` doctype.
+
+ - Changed: using `doctypes['default']` instead of `doctypes['5']` by default.
+
+ - Changed: in `coffeekup.render`, option `cache` is now `false` by default.
+
+ - Added a third optional param to `render`. You can pass an object with options and they will be merged with the main object param.
+
+ - Removed ck_* locals, now all implementation inside the `__ck` object.
+
+**v0.2.3** (2011-05-06):
+
+ - Compatible with npm 1.x.
+ - Converting any ampersands (instead of /&(?!\w+;/) to & when escaping html.
+ - New CLI option -o / --output [DIR] (specifies a directory to compile into).
+ - Self-closing tags are now: 'area', 'base', 'basefont', 'br', 'col', 'frame', 'hr', 'img', 'input', 'link', 'meta' and 'param'.
+
+**v0.2.2** (2011-01-05):
+
+ - Updated to CoffeeScript 1.0.0 and node 0.2.6/0.3.3.
+
+**v0.2.1** (2010-11-23):
+
+ - Updated to CoffeeScript 0.9.5 and node 0.2.5/0.3.1.
+ - Fixed string templates compilation in opera.
+
+**v0.2.0** (2010-11-09):
+
+ - Huge performance gains, now among the fastest. See `cake benchmark`.
+ - Compile templates into standalone functions with `coffeekup.compile`.
+ - Option `format` to add line breaks and indentation to output.
+ - Escape HTML automatically with the `autoescape` option, or manually with the `h` local.
+ - CLI behaviour closer to CoffeeScript's: compiles to `filename.html` by default, can watch and recompile with `-w`.
+ - CLI `-u`/`--utils` option to make build-time utility locals available to templates (currently only `render`).
+
diff --git a/node_modules/anvil.js/node_modules/coffeekup/Cakefile b/node_modules/anvil.js/node_modules/coffeekup/Cakefile
new file mode 100644
index 0000000..06bb724
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/Cakefile
@@ -0,0 +1,28 @@
+{spawn, exec} = require 'child_process'
+log = console.log
+
+task 'build', ->
+ run 'coffee -o lib -c src/*.coffee'
+
+task 'test', -> require('./test').run()
+
+task 'bench', -> require('./benchmark').run()
+
+task 'docs', ->
+ run 'docco src/coffeekup.coffee'
+
+run = (args...) ->
+ for a in args
+ switch typeof a
+ when 'string' then command = a
+ when 'object'
+ if a instanceof Array then params = a
+ else options = a
+ when 'function' then callback = a
+
+ command += ' ' + params.join ' ' if params?
+ cmd = spawn '/bin/sh', ['-c', command], options
+ cmd.stdout.on 'data', (data) -> process.stdout.write data
+ cmd.stderr.on 'data', (data) -> process.stderr.write data
+ process.on 'SIGHUP', -> cmd.kill()
+ cmd.on 'exit', (code) -> callback() if callback? and code is 0
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/LICENSE b/node_modules/anvil.js/node_modules/coffeekup/LICENSE
new file mode 100644
index 0000000..6c6a396
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Maurice Machado
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/anvil.js/node_modules/coffeekup/README.md b/node_modules/anvil.js/node_modules/coffeekup/README.md
new file mode 100644
index 0000000..a5421dd
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/README.md
@@ -0,0 +1,260 @@
+# CoffeeKup <☕/>
+## Markup as CoffeeScript
+
+CoffeeKup is a templating engine for [node.js](http://nodejs.org) and browsers that lets you to write your HTML templates in 100% pure [CoffeeScript](http://coffeescript.org).
+
+It was created in celebration of [whyday](http://whyday.org/), as an application of the concept used in [Markaby](https://github.com/markaby/markaby) ("Markup as Ruby", by Tim Fletcher and why the lucky stiff) to CoffeeScript.
+
+Here's what a template written for CoffeeKup looks like:
+
+ doctype 5
+ html ->
+ head ->
+ meta charset: 'utf-8'
+ title "#{@title or 'Untitled'} | A completely plausible website"
+ meta(name: 'description', content: @description) if @description?
+
+ link rel: 'stylesheet', href: '/css/app.css'
+
+ style '''
+ body {font-family: sans-serif}
+ header, nav, section, footer {display: block}
+ '''
+
+ script src: '/js/jquery.js'
+
+ coffeescript ->
+ $(document).ready ->
+ alert 'Alerts suck!'
+ body ->
+ header ->
+ h1 @title or 'Untitled'
+
+ nav ->
+ ul ->
+ (li -> a href: '/', -> 'Home') unless @path is '/'
+ li -> a href: '/chunky', -> 'Bacon!'
+ switch @user.role
+ when 'owner', 'admin'
+ li -> a href: '/admin', -> 'Secret Stuff'
+ when 'vip'
+ li -> a href: '/vip', -> 'Exclusive Stuff'
+ else
+ li -> a href: '/commoners', -> 'Just Stuff'
+
+ div '#myid.myclass.anotherclass', style: 'position: fixed', ->
+ p 'Divitis kills! Inline styling too.'
+
+ section ->
+ # A helper function you built and included.
+ breadcrumb separator: '>', clickable: yes
+
+ h2 "Let's count to 10:"
+ p i for i in [1..10]
+
+ # Another hypothetical helper.
+ form_to @post, ->
+ textbox '#title', label: 'Title:'
+ textbox '#author', label: 'Author:'
+ submit 'Save'
+
+ footer ->
+ # CoffeeScript comments. Not visible in the output document.
+ comment 'HTML comments.'
+ p 'Bye!'
+
+Interactive demo at [coffeekup.org](http://coffeekup.org).
+
+## _why?
+
+- **One language to rule them all**. JavaScript is everywhere, thus so is CoffeeScript. Servers, browsers, even databases. If extending this to rendering logic and UI structure (server and client side) is desirable to you, CoffeeKup is your friend.
+
+- **More specifically, one _outstanding_ language**. CoffeeScript is one hell of a clean, expressive, flexible and powerful language. It's hard to find such combination, especially if you need it to run in the browser too.
+
+- **Not yet another specialized language to learn**. Transferable knowledge FTW.
+
+- **Embed your templates in CoffeeScript nicely**. Templates are just functions, so they don't lose syntax highlighting and syntax checking when embedded in CoffeeScript apps.
+
+- **Embed CoffeeScript in your templates nicely**. In the same manner, you can write the contents of `
+
+
+This is one of many browser deployment possibilities, pre-compiling your template on the server to a standalone function. To see all serving suggestions, check out [regular](http://github.com/mauricemach/coffeekup/blob/master/examples/browser/regular/index.html), [decaf](http://github.com/mauricemach/coffeekup/blob/master/examples/browser/decaf/index.html) and [crème](http://github.com/mauricemach/coffeekup/blob/master/examples/browser/creme/index.html).
+
+Command-line:
+
+ $ coffeekup -h
+
+ Usage:
+ coffeekup [options] path/to/template.coffee
+
+ --js compile template to js function
+ -n, --namespace global object holding the templates (default: "templates")
+ -w, --watch watch templates for changes, and recompile
+ -o, --output set the directory for compiled html
+ -p, --print print the compiled html to stdout
+ -f, --format apply line breaks and indentation to html output
+ -u, --utils add helper locals (currently only "render")
+ -v, --version display CoffeeKup version
+ -h, --help display this help message
+
+See [/examples](http://github.com/mauricemach/coffeekup/tree/master/examples) for complete versions (you have to run `cake build` first).
+
+Please note that even though all examples are given in CoffeeScript, you can also use their plain JavaScript counterparts just fine.
+
+## Resources
+
+- [API reference](https://github.com/mauricemach/coffeekup/blob/master/docs/reference.md)
+
+- [Mailing list](https://groups.google.com/group/coffeekup)
+
+- [Issues](https://github.com/mauricemach/coffeekup/issues)
+
+- **IRC**: #coffeekup on irc.freenode.net
+
+- [A Beginners's Introduction to CoffeeKup](https://github.com/mark-hahn/coffeekup-intro)
+
+## Tools
+
+- [html2coffeekup](https://github.com/brandonbloom/html2coffeekup) - Converts HTML to CoffeeKup templates.
+
+- [htmlkup](https://github.com/colinta/htmlkup) - Another HTML converter, stdin/stdout based.
+
+- [ice](https://github.com/ludicast/ice) - CoffeeKup and Eco in Rails ([screencast](http://vimeo.com/25907220)).
+
+- [coffee-world](https://github.com/khoomeister/coffee-world) - Tool to watch and compile HTML with CoffeeKup, CSS with coffee-css and JS with CoffeeScript.
+
+- [cupcake](https://github.com/twilson63/cupcake) - Express app generator with CoffeeKup support.
+
+## Related projects
+
+- [ck](https://github.com/aeosynth/ck) - "a smaller, faster coffeekup": Alternative, barebones implementation.
+
+- [ckup](https://github.com/satyr/ckup) - "Markup as Coco": Similar engine but for [Coco](https://github.com/satyr/coco) ("Unfancy CoffeeScript").
+
+- [Eco](https://github.com/sstephenson/eco) - "Embedded CoffeeScript templates": "EJS/ERB" for CoffeeScript.
+
+- [timbits](https://github.com/Postmedia/timbits) - "Widget framework based on Express and CoffeeScript".
+
+- [coffee-css](https://github.com/khoomeister/coffee-css) - "More CSS for CoffeeScript".
+
+- [ccss](https://github.com/aeosynth/ccss) - "CoffeeScript CSS".
+
+## Compatibility
+
+Latest version tested with node 0.4.9 and CoffeeScript 1.1.1.
+
+## Special thanks
+
+ - [Jeremy Ashkenas](https://github.com/jashkenas), for the amazing CoffeeScript language.
+ - [why the lucky stiff](Why_the_lucky_stiff), for the inspiration.
diff --git a/node_modules/anvil.js/node_modules/coffeekup/benchmark.coffee b/node_modules/anvil.js/node_modules/coffeekup/benchmark.coffee
new file mode 100644
index 0000000..9f2f61e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/benchmark.coffee
@@ -0,0 +1,207 @@
+coffeekup = require './src/coffeekup'
+jade = require 'jade'
+ejs = require 'ejs'
+eco = require 'eco'
+haml = require 'haml'
+log = console.log
+
+data =
+ title: 'test'
+ inspired: no
+ users: [
+ {email: 'house@gmail.com', name: 'house'}
+ {email: 'cuddy@gmail.com', name: 'cuddy'}
+ {email: 'wilson@gmail.com', name: 'wilson'}
+ ]
+
+coffeekup_template = ->
+ doctype 5
+ html lang: 'en', ->
+ head ->
+ meta charset: 'utf-8'
+ title @title
+ style '''
+ body {font-family: "sans-serif"}
+ section, header {display: block}
+ '''
+ body ->
+ section ->
+ header ->
+ h1 @title
+ if @inspired
+ p 'Create a witty example'
+ else
+ p 'Go meta'
+ ul ->
+ for user in @users
+ li user.name
+ li -> a href: "mailto:#{user.email}", -> user.email
+
+coffeekup_string_template = """
+ doctype 5
+ html lang: 'en', ->
+ head ->
+ meta charset: 'utf-8'
+ title @title
+ style '''
+ body {font-family: "sans-serif"}
+ section, header {display: block}
+ '''
+ body ->
+ section ->
+ header ->
+ h1 @title
+ if @inspired
+ p 'Create a witty example'
+ else
+ p 'Go meta'
+ ul ->
+ for user in @users
+ li user.name
+ li -> a href: "mailto:\#{user.email}", -> user.email
+"""
+
+coffeekup_compiled_template = coffeekup.compile coffeekup_template
+
+jade_template = '''
+ !!! 5
+ html(lang="en")
+ head
+ meta(charset="utf-8")
+ title= title
+ style
+ | body {font-family: "sans-serif"}
+ | section, header {display: block}
+ body
+ section
+ header
+ h1= title
+ - if (inspired)
+ p Create a witty example
+ - else
+ p Go meta
+ ul
+ - each user in users
+ li= user.name
+ li
+ a(href="mailto:"+user.email)= user.email
+'''
+
+jade_compiled_template = jade.compile jade_template
+
+ejs_template = '''
+
+
+
+
+ <%= title %>
+
+
+
+
+
+ <% if (inspired) { %>
+ Create a witty example
+ <% } else { %>
+ Go meta
+ <% } %>
+
+
+
+
+'''
+
+eco_template = '''
+
+
+
+
+ <%= @title %>
+
+
+
+
+
+ <% if @inspired: %>
+ Create a witty example
+ <% else: %>
+ Go meta
+ <% end %>
+
+
+
+
+'''
+
+haml_template = '''
+ !!! 5
+ %html{lang: "en"}
+ %head
+ %meta{charset: "utf-8"}
+ %title= title
+ :css
+ body {font-family: "sans-serif"}
+ section, header {display: block}
+ %body
+ %section
+ %header
+ %h1= title
+ :if inspired
+ %p Create a witty example
+ :if !inspired
+ %p Go meta
+ %ul
+ :each user in users
+ %li= user.name
+ %li
+ %a{href: "mailto:#{user.email}"}= user.email
+'''
+
+haml_template_compiled = haml(haml_template)
+
+benchmark = (title, code) ->
+ start = new Date
+ for i in [1..5000]
+ code()
+ log "#{title}: #{new Date - start} ms"
+
+@run = ->
+ benchmark 'CoffeeKup (precompiled)', -> coffeekup_compiled_template data
+ benchmark 'Jade (precompiled)', -> jade_compiled_template data
+ benchmark 'haml-js (precompiled)', -> haml_template_compiled data
+ benchmark 'Eco', -> eco.render eco_template, data
+
+ console.log '\n'
+
+ benchmark 'CoffeeKup (function, cache on)', -> coffeekup.render coffeekup_template, data, cache: on
+ benchmark 'CoffeeKup (string, cache on)', -> coffeekup.render coffeekup_string_template, data, cache: on
+ benchmark 'Jade (cache on)', -> jade.render jade_template, locals: data, cache: on, filename: 'test'
+ benchmark 'ejs (cache on)', -> ejs.render ejs_template, locals: data, cache: on, filename: 'test'
+
+ console.log '\n'
+
+ benchmark 'CoffeeKup (function, cache off)', -> coffeekup.render coffeekup_template, data
+ benchmark 'CoffeeKup (string, cache off)', -> coffeekup.render coffeekup_string_template, data, cache: off
+ benchmark 'Jade (cache off)', -> jade.render jade_template, locals: data
+ benchmark 'haml-js', -> haml.render haml_template, locals: data
+ benchmark 'ejs (cache off)', -> ejs.render ejs_template, locals: data
diff --git a/node_modules/anvil.js/node_modules/coffeekup/docs/coffeekup.html b/node_modules/anvil.js/node_modules/coffeekup/docs/coffeekup.html
new file mode 100644
index 0000000..3472e38
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/docs/coffeekup.html
@@ -0,0 +1,284 @@
+ coffeekup.coffee
coffeekup.coffee CoffeeKup lets you to write HTML templates in 100% pure
+CoffeeScript .
+
+You can run it on node.js or the browser, or compile your
+templates down to self-contained javascript functions, that will take in data
+and options and return generated HTML on any JS runtime.
+
+The concept is directly stolen from the amazing
+Markaby by Tim Fletcher and why the lucky
+stiff.
if window ?
+ coffeekup = window . CoffeeKup = {}
+ coffee = if CoffeeScript ? then CoffeeScript else null
+else
+ coffeekup = exports
+ coffee = require 'coffee-script'
+
+coffeekup.version = '0.3.1' Values available to the doctype function inside a template.
+Ex.: doctype 'strict'
coffeekup.doctypes =
+ 'default' : '<!DOCTYPE html>'
+ '5' : '<!DOCTYPE html>'
+ 'xml' : '<?xml version="1.0" encoding="utf-8" ?>'
+ 'transitional' : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
+ 'strict' : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
+ 'frameset' : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'
+ '1.1' : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' ,
+ 'basic' : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">'
+ 'mobile' : '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">'
+ 'ce' : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "ce-html-1.0-transitional.dtd">' CoffeeScript-generated JavaScript may contain anyone of these; but when we
+take a function to string form to manipulate it, and then recreate it through
+the Function() constructor, it loses access to its parent scope and
+consequently to any helpers it might need. So we need to reintroduce these
+inside any "rewritten" function.
coffeescript_helpers = """
+ var __slice = Array.prototype.slice;
+ var __hasProp = Object.prototype.hasOwnProperty;
+ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+ var __extends = function(child, parent) {
+ for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
+ function ctor() { this.constructor = child; }
+ ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype;
+ return child; };
+ var __indexOf = Array.prototype.indexOf || function(item) {
+ for (var i = 0, l = this.length; i < l; i++) {
+ if (this[i] === item) return i;
+ } return -1; };
+""" . replace /\n/g , '' Private HTML element reference.
+Please mind the gap (1 space at the beginning of each subsequent line).
Valid HTML 5 elements requiring a closing tag.
+Note: the var element is out for obvious reasons, please use tag 'var'.
regular: 'a abbr address article aside audio b bdi bdo blockquote body button
+ canvas caption cite code colgroup datalist dd del details dfn div dl dt em
+ fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup
+ html i iframe ins kbd label legend li map mark menu meter nav noscript object
+ ol optgroup option output p pre progress q rp rt ruby s samp script section
+ select small span strong style sub summary sup table tbody td textarea tfoot
+ th thead time title tr u ul video' Valid self-closing HTML 5 elements.
void: 'area base br col command embed hr img input keygen link meta param
+ source track wbr'
+
+ obsolete: 'applet acronym bgsound dir frameset noframes isindex listing
+ nextid noembed plaintext rb strike xmp big blink center font marquee multicol
+ nobr spacer tt'
+
+ obsolete_void: 'basefont frame' Create a unique list of element names merging the desired groups.
merge_elements = (args...) ->
+ result = []
+ for a in args
+ for element in elements [ a ]. split ' '
+ result . push element unless element in result
+ result Public/customizable list of possible elements.
+For each name in this list that is also present in the input template code,
+a function with the same name will be added to the compiled template.
coffeekup.tags = merge_elements 'regular' , 'obsolete' , 'void' , 'obsolete_void' Public/customizable list of elements that should be rendered self-closed.
coffeekup.self_closing = merge_elements 'void' , 'obsolete_void' This is the basic material from which compiled templates will be formed.
+It will be manipulated in its string form at the coffeekup.compile function
+to generate the final template function.
skeleton = (data = {}) -> Whether to generate formatted HTML with indentation and line breaks, or
+just the natural "faux-minified" output.
Whether to autoescape all content or let you handle it on a case by case
+basis with the h function.
Internal CoffeeKup stuff.
__ck =
+ buffer: []
+
+ esc: (txt) ->
+ if data . autoescape then h ( txt ) else String ( txt )
+
+ tabs: 0
+
+ repeat: (string, count) -> Array ( count + 1 ). join string
+
+ indent: -> text @repeat ( ' ' , @tabs ) if data . format Adapter to keep the builtin tag functions DRY.
tag: (name, args) ->
+ combo = [ name ]
+ combo . push i for i in args
+ tag . apply data , combo
+
+ render_idclass: (str) ->
+ classes = []
+
+ for i in str . split '.'
+ if '#' in i
+ id = i . replace '#' , ''
+ else
+ classes . push i unless i is ''
+
+ text " id=\"#{id}\"" if id
+
+ if classes . length > 0
+ text " class=\""
+ for c in classes
+ text ' ' unless c is classes [ 0 ]
+ text c
+ text '"'
+
+ render_attrs: (obj, prefix = '') ->
+ for k , v of obj true is rendered as selected="selected".
v = k if typeof v is 'boolean' and v
+ Functions are rendered in an executable form.
v = "(#{v}).call(this);" if typeof v is 'function' Prefixed attribute.
if typeof v is 'object' and v not instanceof Array data: {icon: 'foo'} is rendered as data-icon="foo".
@render_attrs ( v , prefix + k + '-' ) undefined, false and null result in the attribute not being rendered.
strings, numbers, arrays and functions are rendered "as is".
text " #{prefix + k}=\"#{@esc(v)}\""
+
+ render_contents: (contents) ->
+ switch typeof contents
+ when 'string' , 'number' , 'boolean'
+ text @esc ( contents )
+ when 'function'
+ text '\n' if data . format
+ @tabs ++
+ result = contents . call data
+ if typeof result is 'string'
+ @indent ()
+ text @esc ( result )
+ text '\n' if data . format
+ @tabs --
+ @indent ()
+
+ render_tag: (name, idclass, attrs, contents) ->
+ @indent ()
+
+ text "<#{name}"
+ @render_idclass ( idclass ) if idclass
+ @render_attrs ( attrs ) if attrs
+
+ if name in @self_closing
+ text ' />'
+ text '\n' if data . format
+ else
+ text '>'
+
+ @render_contents ( contents )
+
+ text "</#{name}>"
+ text '\n' if data . format
+
+ null
+
+ tag = (name, args...) ->
+ for a in args
+ switch typeof a
+ when 'function'
+ contents = a
+ when 'object'
+ attrs = a
+ when 'number' , 'boolean'
+ contents = a
+ when 'string'
+ if args . length is 1
+ contents = a
+ else
+ if a is args [ 0 ]
+ idclass = a
+ else
+ contents = a
+
+ __ck . render_tag ( name , idclass , attrs , contents )
+
+ yield = (f) ->
+ temp_buffer = []
+ old_buffer = __ck . buffer
+ __ck.buffer = temp_buffer
+ f ()
+ __ck.buffer = old_buffer
+ temp_buffer . join ''
+
+ h = (txt) ->
+ String ( txt ). replace ( /&/g , '&' )
+ . replace ( /</g , '<' )
+ . replace ( />/g , '>' )
+ . replace ( /"/g , '"' )
+
+ doctype = (type = 'default') ->
+ text __ck . doctypes [ type ]
+ text '\n' if data . format
+
+ text = (txt) ->
+ __ck . buffer . push String ( txt )
+ null
+
+ comment = (cmt) ->
+ text "<!--#{cmt}-->"
+ text '\n' if data . format
+
+ coffeescript = (param) ->
+ switch typeof param coffeescript -> alert 'hi' becomes:
+<script>;(function () {return alert('hi');})();</script>
when 'function'
+ script "#{__ck.coffeescript_helpers}(#{param}).call(this);" coffeescript "alert 'hi'" becomes:
+<script type="text/coffeescript">alert 'hi'</script>
when 'string'
+ script type: 'text/coffeescript' , -> param coffeescript src: 'script.coffee' becomes:
+<script type="text/coffeescript" src="script.coffee"></script>
when 'object'
+ param.type = 'text/coffeescript'
+ script param
+ Conditional IE comments.
ie = (condition, contents) ->
+ __ck . indent ()
+
+ text "<!--[if #{condition}]>"
+ __ck . render_contents ( contents )
+ text "<![endif]-->"
+ text '\n' if data . format
+
+ null Stringify the skeleton and unwrap it from its enclosing function(){}, then
+add the CoffeeScript helpers.
skeleton = String ( skeleton )
+ . replace ( /function\s*\(.*\)\s*\{/ , '' )
+ . replace ( /return null;\s*\}$/ , '' )
+
+skeleton = coffeescript_helpers + skeleton Compiles a template into a standalone JavaScript function.
coffeekup.compile = (template, options = {}) -> The template can be provided as either a function or a CoffeeScript string
+(in the latter case, the CoffeeScript compiler must be available).
if typeof template is 'function' then template = String ( template )
+ else if typeof template is 'string' and coffee ?
+ template = coffee . compile template , bare: yes
+ template = "function(){#{template}}" If an object hardcode is provided, insert the stringified value
+of each variable directly in the function body. This is a less flexible but
+faster alternative to the standard method of using with (see below).
hardcoded_locals = ''
+
+ if options . hardcode
+ for k , v of options . hardcode
+ if typeof v is 'function' Make sure these functions have access to data as @/this.
hardcoded_locals += "var #{k} = function(){return (#{v}).apply(data, arguments);};"
+ else hardcoded_locals += "var #{k} = #{JSON.stringify v};" Add a function for each tag this template references. We don't want to have
+all hundred-odd tags wasting space in the compiled function.
tag_functions = ''
+ tags_used = []
+
+ for t in coffeekup . tags
+ if template . indexOf ( t ) > - 1 or hardcoded_locals . indexOf ( t ) > - 1
+ tags_used . push t
+
+ tag_functions += "var #{tags_used.join ','};"
+ for t in tags_used
+ tag_functions += "#{t} = function(){return __ck.tag('#{t}', arguments);};" Main function assembly.
code = tag_functions + hardcoded_locals + skeleton
+
+ code += "__ck.doctypes = #{JSON.stringify coffeekup.doctypes};"
+ code += "__ck.coffeescript_helpers = #{JSON.stringify coffeescript_helpers};"
+ code += "__ck.self_closing = #{JSON.stringify coffeekup.self_closing};" If locals is set, wrap the template inside a with block. This is the
+most flexible but slower approach to specifying local variables.
code += 'with(data.locals){' if options . locals
+ code += "(#{template}).call(data);"
+ code += '}' if options . locals
+ code += "return __ck.buffer.join('');"
+
+ new Function ( 'data' , code )
+
+cache = {} Template in, HTML out. Accepts functions or strings as does coffeekup.compile.
+
+Accepts an option cache, by default false. If set to false templates will
+be recompiled each time.
+
+options is just a convenience parameter to pass options separately from the
+data, but the two will be merged and passed down to the compiler (which uses
+locals and hardcode), and the template (which understands locals, format
+and autoescape).
coffeekup.render = (template, data = {}, options = {}) ->
+ data [ k ] = v for k , v of options
+ data . cache ?= off
+
+ if data . cache and cache [ template ] ? then tpl = cache [ template ]
+ else if data . cache then tpl = cache [ template ] = coffeekup . compile ( template , data )
+ else tpl = coffeekup . compile ( template , data )
+ tpl ( data )
+
+unless window ?
+ coffeekup.adapters = Legacy adapters for when CoffeeKup expected data in the context attribute.
simple: coffeekup . render
+ meryl: coffeekup . render
+
+ express:
+ TemplateError: class extends Error
+ constructor: (@message) ->
+ Error . call this , @message
+ Error . captureStackTrace this , arguments . callee
+ name: 'TemplateError'
+
+ compile: (template, data) -> Allows partial 'foo' instead of text @partial 'foo'.
data . hardcode ?= {}
+ data.hardcode.partial = ->
+ text @partial . apply @ , arguments
+
+ TemplateError = @TemplateError
+ try tpl = coffeekup . compile ( template , data )
+ catch e then throw new TemplateError "Error compiling #{data.filename}: #{e.message}"
+
+ return ->
+ try tpl arguments ...
+ catch e then throw new TemplateError "Error rendering #{data.filename}: #{e.message}"
+
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/docs/docco.css b/node_modules/anvil.js/node_modules/coffeekup/docs/docco.css
new file mode 100644
index 0000000..5aa0a8d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/docs/docco.css
@@ -0,0 +1,186 @@
+/*--------------------- Layout and Typography ----------------------------*/
+body {
+ font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
+ font-size: 15px;
+ line-height: 22px;
+ color: #252519;
+ margin: 0; padding: 0;
+}
+a {
+ color: #261a3b;
+}
+ a:visited {
+ color: #261a3b;
+ }
+p {
+ margin: 0 0 15px 0;
+}
+h1, h2, h3, h4, h5, h6 {
+ margin: 0px 0 15px 0;
+}
+ h1 {
+ margin-top: 40px;
+ }
+#container {
+ position: relative;
+}
+#background {
+ position: fixed;
+ top: 0; left: 525px; right: 0; bottom: 0;
+ background: #f5f5ff;
+ border-left: 1px solid #e5e5ee;
+ z-index: -1;
+}
+#jump_to, #jump_page {
+ background: white;
+ -webkit-box-shadow: 0 0 25px #777; -moz-box-shadow: 0 0 25px #777;
+ -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomleft: 5px;
+ font: 10px Arial;
+ text-transform: uppercase;
+ cursor: pointer;
+ text-align: right;
+}
+#jump_to, #jump_wrapper {
+ position: fixed;
+ right: 0; top: 0;
+ padding: 5px 10px;
+}
+ #jump_wrapper {
+ padding: 0;
+ display: none;
+ }
+ #jump_to:hover #jump_wrapper {
+ display: block;
+ }
+ #jump_page {
+ padding: 5px 0 3px;
+ margin: 0 0 25px 25px;
+ }
+ #jump_page .source {
+ display: block;
+ padding: 5px 10px;
+ text-decoration: none;
+ border-top: 1px solid #eee;
+ }
+ #jump_page .source:hover {
+ background: #f5f5ff;
+ }
+ #jump_page .source:first-child {
+ }
+table td {
+ border: 0;
+ outline: 0;
+}
+ td.docs, th.docs {
+ max-width: 450px;
+ min-width: 450px;
+ min-height: 5px;
+ padding: 10px 25px 1px 50px;
+ overflow-x: hidden;
+ vertical-align: top;
+ text-align: left;
+ }
+ .docs pre {
+ margin: 15px 0 15px;
+ padding-left: 15px;
+ }
+ .docs p tt, .docs p code {
+ background: #f8f8ff;
+ border: 1px solid #dedede;
+ font-size: 12px;
+ padding: 0 0.2em;
+ }
+ .pilwrap {
+ position: relative;
+ }
+ .pilcrow {
+ font: 12px Arial;
+ text-decoration: none;
+ color: #454545;
+ position: absolute;
+ top: 3px; left: -20px;
+ padding: 1px 2px;
+ opacity: 0;
+ -webkit-transition: opacity 0.2s linear;
+ }
+ td.docs:hover .pilcrow {
+ opacity: 1;
+ }
+ td.code, th.code {
+ padding: 14px 15px 16px 25px;
+ width: 100%;
+ vertical-align: top;
+ background: #f5f5ff;
+ border-left: 1px solid #e5e5ee;
+ }
+ pre, tt, code {
+ font-size: 12px; line-height: 18px;
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
+ margin: 0; padding: 0;
+ }
+
+
+/*---------------------- Syntax Highlighting -----------------------------*/
+td.linenos { background-color: #f0f0f0; padding-right: 10px; }
+span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
+body .hll { background-color: #ffffcc }
+body .c { color: #408080; font-style: italic } /* Comment */
+body .err { border: 1px solid #FF0000 } /* Error */
+body .k { color: #954121 } /* Keyword */
+body .o { color: #666666 } /* Operator */
+body .cm { color: #408080; font-style: italic } /* Comment.Multiline */
+body .cp { color: #BC7A00 } /* Comment.Preproc */
+body .c1 { color: #408080; font-style: italic } /* Comment.Single */
+body .cs { color: #408080; font-style: italic } /* Comment.Special */
+body .gd { color: #A00000 } /* Generic.Deleted */
+body .ge { font-style: italic } /* Generic.Emph */
+body .gr { color: #FF0000 } /* Generic.Error */
+body .gh { color: #000080; font-weight: bold } /* Generic.Heading */
+body .gi { color: #00A000 } /* Generic.Inserted */
+body .go { color: #808080 } /* Generic.Output */
+body .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
+body .gs { font-weight: bold } /* Generic.Strong */
+body .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+body .gt { color: #0040D0 } /* Generic.Traceback */
+body .kc { color: #954121 } /* Keyword.Constant */
+body .kd { color: #954121; font-weight: bold } /* Keyword.Declaration */
+body .kn { color: #954121; font-weight: bold } /* Keyword.Namespace */
+body .kp { color: #954121 } /* Keyword.Pseudo */
+body .kr { color: #954121; font-weight: bold } /* Keyword.Reserved */
+body .kt { color: #B00040 } /* Keyword.Type */
+body .m { color: #666666 } /* Literal.Number */
+body .s { color: #219161 } /* Literal.String */
+body .na { color: #7D9029 } /* Name.Attribute */
+body .nb { color: #954121 } /* Name.Builtin */
+body .nc { color: #0000FF; font-weight: bold } /* Name.Class */
+body .no { color: #880000 } /* Name.Constant */
+body .nd { color: #AA22FF } /* Name.Decorator */
+body .ni { color: #999999; font-weight: bold } /* Name.Entity */
+body .ne { color: #D2413A; font-weight: bold } /* Name.Exception */
+body .nf { color: #0000FF } /* Name.Function */
+body .nl { color: #A0A000 } /* Name.Label */
+body .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
+body .nt { color: #954121; font-weight: bold } /* Name.Tag */
+body .nv { color: #19469D } /* Name.Variable */
+body .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
+body .w { color: #bbbbbb } /* Text.Whitespace */
+body .mf { color: #666666 } /* Literal.Number.Float */
+body .mh { color: #666666 } /* Literal.Number.Hex */
+body .mi { color: #666666 } /* Literal.Number.Integer */
+body .mo { color: #666666 } /* Literal.Number.Oct */
+body .sb { color: #219161 } /* Literal.String.Backtick */
+body .sc { color: #219161 } /* Literal.String.Char */
+body .sd { color: #219161; font-style: italic } /* Literal.String.Doc */
+body .s2 { color: #219161 } /* Literal.String.Double */
+body .se { color: #BB6622; font-weight: bold } /* Literal.String.Escape */
+body .sh { color: #219161 } /* Literal.String.Heredoc */
+body .si { color: #BB6688; font-weight: bold } /* Literal.String.Interpol */
+body .sx { color: #954121 } /* Literal.String.Other */
+body .sr { color: #BB6688 } /* Literal.String.Regex */
+body .s1 { color: #219161 } /* Literal.String.Single */
+body .ss { color: #19469D } /* Literal.String.Symbol */
+body .bp { color: #954121 } /* Name.Builtin.Pseudo */
+body .vc { color: #19469D } /* Name.Variable.Class */
+body .vg { color: #19469D } /* Name.Variable.Global */
+body .vi { color: #19469D } /* Name.Variable.Instance */
+body .il { color: #666666 } /* Literal.Number.Integer.Long */
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/docs/reference.md b/node_modules/anvil.js/node_modules/coffeekup/docs/reference.md
new file mode 100644
index 0000000..f8eb7f2
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/docs/reference.md
@@ -0,0 +1,244 @@
+# CoffeeKup 0.3.1 Reference
+
+## The CoffeeKup object
+
+Both the returned value from `require 'coffeekup'` and the global `CoffeeKup` created by `
+
+Contents (function):
+
+ div -> 'Foo'
+ Foo
+
+ # equivalent to js: div(function(){'Foo'; return 'Bar';});
+ div ->
+ 'Foo'
+ 'Bar'
+
+ Bar
+
+
+ # equivalent to js: div(function(){'Foo'; div('Ping'); return 'Bar';});
+ div ->
+ 'Foo'
+ div 'Ping'
+ 'Bar'
+
+
+ # equivalent to js: div(function(){text('Foo'); div('Ping'); return 'Bar';});
+ div ->
+ text 'Foo'
+ div 'Ping'
+ 'Bar'
+
+
+ID/class shortcut
+
+ div '#id.class.anotherclass', 'string contents'
+ string contents
+
+ div '#id.class.anotherclass', -> h1 'Hullo'
+
Hullo
+
+ div '#id.class.anotherclass', style: 'position: fixed', 'string contents'
+ string contents
+
+### Other locals
+
+#### doctype
+
+Writes the doctype. Usage: `doctype()` (picks the default), `doctype 'xml'` (specifying). You can see and modify the list of doctypes at `CoffeeKup.doctypes`.
+
+#### comment
+
+Writes an HTML comment.
+
+#### ie
+
+Writes an IE conditional comment. Ex.:
+
+ ie 'gte IE8', ->
+ link href: 'ie.css', rel: 'stylesheet'
+
+
+
+#### text
+
+Writes arbitrary text to the buffer.
+
+#### tag
+
+Used for arbitrary tags. Works like the builtin tags, but the first string parameter is the name of the tag.
+
+#### coffeescript
+
+CoffeeScript-friendly shortcut to `script`:
+
+ coffeescript -> alert 'hi'
+
+
+ coffeescript "alert 'hi'"
+
+
+ coffeescript src: 'script.coffee'
+
+
+#### yield
+
+Returns the output of a template chunk as a string instead of writing it to the buffer. Useful for string interpolations. Ex.:
+
+ p "This text could use #{yield -> a href: '/', 'a link'}."
+ This text could use a link .
+
+Without it, the `a` function runs first, writes to the buffer and returns `null`, resulting in a useless output:
+
+ p "This text could use #{a href: '/', 'a link'}."
+ a link This text could use null.
+
+#### @
+
+CoffeeScript shortcut to `this`. This is where all the input data can be accessed.
+
+## Extending CoffeeKup
+
+ template = ->
+ h1 @title
+ form method: 'post', action: 'login', ->
+ textbox id: 'username'
+ textbox id: 'password'
+ button @title
+
+ helpers =
+ textbox: (attrs) ->
+ attrs.type = 'text'
+ attrs.name = attrs.id
+ input attrs
+
+ console.log CoffeeKup.render template, title: 'Log In', hardcode: helpers
+
+## The coffeekup command
+
+When installing CoffeeKup with `npm install coffeekup -g`, you get a `coffeekup` command that allows you to generate HTML from CoffeeKup templates:
+
+ $ coffeekup -h
+
+ Usage:
+ coffeekup [options] path/to/template.coffee
+
+ --js compile template to js function
+ -n, --namespace global object holding the templates (default: "templates")
+ -w, --watch watch templates for changes, and recompile
+ -o, --output set the directory for compiled html
+ -p, --print print the compiled html to stdout
+ -f, --format apply line breaks and indentation to html output
+ -u, --utils add helper locals (currently only "render")
+ -v, --version display CoffeeKup version
+ -h, --help display this help message
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/creme/index.html b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/creme/index.html
new file mode 100644
index 0000000..24870bb
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/creme/index.html
@@ -0,0 +1,40 @@
+
+
+
+
+ Client-side CoffeeKup (Crème)
+
+
+
+
+
+
+
+
+
+
+ Client-side CoffeeKup (crème)
+ Doing everything on the client. Lots of flexibility but a fatty download.
+
+
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/build b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/build
new file mode 100755
index 0000000..649d077
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/build
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+coffeekup --js template.coffee
+
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/index.html b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/index.html
new file mode 100644
index 0000000..29f3aad
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/index.html
@@ -0,0 +1,22 @@
+
+
+
+
+ Client-side CoffeeKup (decaf)
+
+
+
+
+
+
+
+
+
+ Client-side CoffeeKup (decaf)
+ Consuming a template from a non-CoffeeScript app.
+
+
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/template.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/template.coffee
new file mode 100644
index 0000000..c742289
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/template.coffee
@@ -0,0 +1,3 @@
+ul ->
+ for guy in @stooges
+ li guy
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/template.js b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/template.js
new file mode 100644
index 0000000..03cbd85
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/decaf/template.js
@@ -0,0 +1,223 @@
+(function(){
+ this.templates || (this.templates = {});
+ this.templates["template"] = function anonymous(data) {
+var a,i,li,p,s,th,u,ul;a = function(){return __ck.tag('a', arguments);};i = function(){return __ck.tag('i', arguments);};li = function(){return __ck.tag('li', arguments);};p = function(){return __ck.tag('p', arguments);};s = function(){return __ck.tag('s', arguments);};th = function(){return __ck.tag('th', arguments);};u = function(){return __ck.tag('u', arguments);};ul = function(){return __ck.tag('ul', arguments);};var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };var __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (this[i] === item) return i; } return -1; };
+ var coffeescript, comment, doctype, h, ie, tag, text, __ck, _ref, _ref2;
+ if (data == null) {
+ data = {};
+ }
+ if ((_ref = data.format) != null) {
+ _ref;
+ } else {
+ data.format = false;
+ };
+ if ((_ref2 = data.autoescape) != null) {
+ _ref2;
+ } else {
+ data.autoescape = false;
+ };
+ __ck = {
+ buffer: [],
+ esc: function(txt) {
+ if (data.autoescape) {
+ return h(txt);
+ } else {
+ return String(txt);
+ }
+ },
+ tabs: 0,
+ repeat: function(string, count) {
+ return Array(count + 1).join(string);
+ },
+ indent: function() {
+ if (data.format) {
+ return text(this.repeat(' ', this.tabs));
+ }
+ },
+ tag: function(name, args) {
+ var combo, i, _i, _len;
+ combo = [name];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ i = args[_i];
+ combo.push(i);
+ }
+ return tag.apply(data, combo);
+ },
+ render_idclass: function(str) {
+ var c, classes, i, id, _i, _j, _len, _len2, _ref3;
+ classes = [];
+ _ref3 = str.split('.');
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ i = _ref3[_i];
+ if (i.indexOf('#') === 0) {
+ id = i.replace('#', '');
+ } else {
+ if (i !== '') {
+ classes.push(i);
+ }
+ }
+ }
+ if (id) {
+ text(" id=\"" + id + "\"");
+ }
+ if (classes.length > 0) {
+ text(" class=\"");
+ for (_j = 0, _len2 = classes.length; _j < _len2; _j++) {
+ c = classes[_j];
+ if (c !== classes[0]) {
+ text(' ');
+ }
+ text(c);
+ }
+ return text('"');
+ }
+ },
+ render_attrs: function(obj) {
+ var k, v, _results;
+ _results = [];
+ for (k in obj) {
+ v = obj[k];
+ if (typeof v === 'boolean' && v) {
+ v = k;
+ }
+ _results.push(v ? text(" " + k + "=\"" + (this.esc(v)) + "\"") : void 0);
+ }
+ return _results;
+ },
+ render_contents: function(contents) {
+ var result;
+ switch (typeof contents) {
+ case 'string':
+ case 'number':
+ case 'boolean':
+ return text(this.esc(contents));
+ case 'function':
+ if (data.format) {
+ text('\n');
+ }
+ this.tabs++;
+ result = contents.call(data);
+ if (typeof result === 'string') {
+ this.indent();
+ text(this.esc(result));
+ if (data.format) {
+ text('\n');
+ }
+ }
+ this.tabs--;
+ return this.indent();
+ }
+ },
+ render_tag: function(name, idclass, attrs, contents) {
+ this.indent();
+ text("<" + name);
+ if (idclass) {
+ this.render_idclass(idclass);
+ }
+ if (attrs) {
+ this.render_attrs(attrs);
+ }
+ if (__indexOf.call(this.self_closing, name) >= 0) {
+ text(' />');
+ if (data.format) {
+ text('\n');
+ }
+ } else {
+ text('>');
+ this.render_contents(contents);
+ text("" + name + ">");
+ if (data.format) {
+ text('\n');
+ }
+ }
+ return null;
+ }
+ };
+ tag = function() {
+ var a, args, attrs, contents, idclass, name, _i, _len;
+ name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ a = args[_i];
+ switch (typeof a) {
+ case 'function':
+ contents = a;
+ break;
+ case 'object':
+ attrs = a;
+ break;
+ case 'number':
+ case 'boolean':
+ contents = a;
+ break;
+ case 'string':
+ if (args.length === 1) {
+ contents = a;
+ } else {
+ if (a === args[0]) {
+ idclass = a;
+ } else {
+ contents = a;
+ }
+ }
+ }
+ }
+ return __ck.render_tag(name, idclass, attrs, contents);
+ };
+ h = function(txt) {
+ return String(txt).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"');
+ };
+ doctype = function(type) {
+ if (type == null) {
+ type = 'default';
+ }
+ text(__ck.doctypes[type]);
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ text = function(txt) {
+ __ck.buffer.push(String(txt));
+ return null;
+ };
+ comment = function(cmt) {
+ text("");
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ coffeescript = function(param) {
+ switch (typeof param) {
+ case 'function':
+ return script("" + __ck.coffeescript_helpers + "(" + param + ").call(this);");
+ case 'string':
+ return script({
+ type: 'text/coffeescript'
+ }, function() {
+ return param;
+ });
+ case 'object':
+ param.type = 'text/coffeescript';
+ return script(param);
+ }
+ };
+ ie = function(condition, contents) {
+ __ck.indent();
+ text("");
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ __ck.doctypes = {"5":"","default":"","xml":"","transitional":"","strict":"","frameset":"","1.1":"","basic":"","mobile":"","ce":""};__ck.coffeescript_helpers = "var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };var __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (this[i] === item) return i; } return -1; };";__ck.self_closing = ["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","basefont","frame"];(function(){ul(function() {
+ var guy, _i, _len, _ref, _results;
+ _ref = this.stooges;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ guy = _ref[_i];
+ _results.push(li(guy));
+ }
+ return _results;
+});}).call(data);return __ck.buffer.join('');
+};
+}).call(this);
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/build b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/build
new file mode 100755
index 0000000..016fe15
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/build
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+coffeekup --js template.coffee
+coffee -c index.coffee
+
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.coffee
new file mode 100644
index 0000000..7173baf
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.coffee
@@ -0,0 +1,2 @@
+$().ready ->
+ $('body').append templates.template(stooges: ['moe', 'larry', 'curly'])
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.html b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.html
new file mode 100644
index 0000000..b0570b6
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Client-side CoffeeKup (regular)
+
+
+
+
+
+
+
+
+ Client-side CoffeeKup (regular)
+ Writing your app and templates in CoffeeScript but pre-compiling everything on the server-side.
+
+
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.js b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.js
new file mode 100644
index 0000000..f7a8ac5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/index.js
@@ -0,0 +1,7 @@
+(function() {
+ $().ready(function() {
+ return $('body').append(templates.template({
+ stooges: ['moe', 'larry', 'curly']
+ }));
+ });
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/template.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/template.coffee
new file mode 100644
index 0000000..c742289
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/template.coffee
@@ -0,0 +1,3 @@
+ul ->
+ for guy in @stooges
+ li guy
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/template.js b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/template.js
new file mode 100644
index 0000000..03cbd85
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/browser/regular/template.js
@@ -0,0 +1,223 @@
+(function(){
+ this.templates || (this.templates = {});
+ this.templates["template"] = function anonymous(data) {
+var a,i,li,p,s,th,u,ul;a = function(){return __ck.tag('a', arguments);};i = function(){return __ck.tag('i', arguments);};li = function(){return __ck.tag('li', arguments);};p = function(){return __ck.tag('p', arguments);};s = function(){return __ck.tag('s', arguments);};th = function(){return __ck.tag('th', arguments);};u = function(){return __ck.tag('u', arguments);};ul = function(){return __ck.tag('ul', arguments);};var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };var __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (this[i] === item) return i; } return -1; };
+ var coffeescript, comment, doctype, h, ie, tag, text, __ck, _ref, _ref2;
+ if (data == null) {
+ data = {};
+ }
+ if ((_ref = data.format) != null) {
+ _ref;
+ } else {
+ data.format = false;
+ };
+ if ((_ref2 = data.autoescape) != null) {
+ _ref2;
+ } else {
+ data.autoescape = false;
+ };
+ __ck = {
+ buffer: [],
+ esc: function(txt) {
+ if (data.autoescape) {
+ return h(txt);
+ } else {
+ return String(txt);
+ }
+ },
+ tabs: 0,
+ repeat: function(string, count) {
+ return Array(count + 1).join(string);
+ },
+ indent: function() {
+ if (data.format) {
+ return text(this.repeat(' ', this.tabs));
+ }
+ },
+ tag: function(name, args) {
+ var combo, i, _i, _len;
+ combo = [name];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ i = args[_i];
+ combo.push(i);
+ }
+ return tag.apply(data, combo);
+ },
+ render_idclass: function(str) {
+ var c, classes, i, id, _i, _j, _len, _len2, _ref3;
+ classes = [];
+ _ref3 = str.split('.');
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ i = _ref3[_i];
+ if (i.indexOf('#') === 0) {
+ id = i.replace('#', '');
+ } else {
+ if (i !== '') {
+ classes.push(i);
+ }
+ }
+ }
+ if (id) {
+ text(" id=\"" + id + "\"");
+ }
+ if (classes.length > 0) {
+ text(" class=\"");
+ for (_j = 0, _len2 = classes.length; _j < _len2; _j++) {
+ c = classes[_j];
+ if (c !== classes[0]) {
+ text(' ');
+ }
+ text(c);
+ }
+ return text('"');
+ }
+ },
+ render_attrs: function(obj) {
+ var k, v, _results;
+ _results = [];
+ for (k in obj) {
+ v = obj[k];
+ if (typeof v === 'boolean' && v) {
+ v = k;
+ }
+ _results.push(v ? text(" " + k + "=\"" + (this.esc(v)) + "\"") : void 0);
+ }
+ return _results;
+ },
+ render_contents: function(contents) {
+ var result;
+ switch (typeof contents) {
+ case 'string':
+ case 'number':
+ case 'boolean':
+ return text(this.esc(contents));
+ case 'function':
+ if (data.format) {
+ text('\n');
+ }
+ this.tabs++;
+ result = contents.call(data);
+ if (typeof result === 'string') {
+ this.indent();
+ text(this.esc(result));
+ if (data.format) {
+ text('\n');
+ }
+ }
+ this.tabs--;
+ return this.indent();
+ }
+ },
+ render_tag: function(name, idclass, attrs, contents) {
+ this.indent();
+ text("<" + name);
+ if (idclass) {
+ this.render_idclass(idclass);
+ }
+ if (attrs) {
+ this.render_attrs(attrs);
+ }
+ if (__indexOf.call(this.self_closing, name) >= 0) {
+ text(' />');
+ if (data.format) {
+ text('\n');
+ }
+ } else {
+ text('>');
+ this.render_contents(contents);
+ text("" + name + ">");
+ if (data.format) {
+ text('\n');
+ }
+ }
+ return null;
+ }
+ };
+ tag = function() {
+ var a, args, attrs, contents, idclass, name, _i, _len;
+ name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ a = args[_i];
+ switch (typeof a) {
+ case 'function':
+ contents = a;
+ break;
+ case 'object':
+ attrs = a;
+ break;
+ case 'number':
+ case 'boolean':
+ contents = a;
+ break;
+ case 'string':
+ if (args.length === 1) {
+ contents = a;
+ } else {
+ if (a === args[0]) {
+ idclass = a;
+ } else {
+ contents = a;
+ }
+ }
+ }
+ }
+ return __ck.render_tag(name, idclass, attrs, contents);
+ };
+ h = function(txt) {
+ return String(txt).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"');
+ };
+ doctype = function(type) {
+ if (type == null) {
+ type = 'default';
+ }
+ text(__ck.doctypes[type]);
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ text = function(txt) {
+ __ck.buffer.push(String(txt));
+ return null;
+ };
+ comment = function(cmt) {
+ text("");
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ coffeescript = function(param) {
+ switch (typeof param) {
+ case 'function':
+ return script("" + __ck.coffeescript_helpers + "(" + param + ").call(this);");
+ case 'string':
+ return script({
+ type: 'text/coffeescript'
+ }, function() {
+ return param;
+ });
+ case 'object':
+ param.type = 'text/coffeescript';
+ return script(param);
+ }
+ };
+ ie = function(condition, contents) {
+ __ck.indent();
+ text("");
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ __ck.doctypes = {"5":"","default":"","xml":"","transitional":"","strict":"","frameset":"","1.1":"","basic":"","mobile":"","ce":""};__ck.coffeescript_helpers = "var __slice = Array.prototype.slice;var __hasProp = Object.prototype.hasOwnProperty;var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };var __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype; return child; };var __indexOf = Array.prototype.indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (this[i] === item) return i; } return -1; };";__ck.self_closing = ["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr","basefont","frame"];(function(){ul(function() {
+ var guy, _i, _len, _ref, _results;
+ _ref = this.stooges;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ guy = _ref[_i];
+ _results.push(li(guy));
+ }
+ return _results;
+});}).call(data);return __ck.buffer.join('');
+};
+}).call(this);
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/express/app.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/express/app.coffee
new file mode 100644
index 0000000..72db0f7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/express/app.coffee
@@ -0,0 +1,20 @@
+app = require('express').createServer()
+
+coffeekup = require '../../src/coffeekup'
+
+app.set 'view engine', 'coffee'
+app.register '.coffee', coffeekup.adapters.express
+
+app.get '/', (req, res) ->
+ res.render 'index'
+
+app.get '/login', (req, res) ->
+ res.render 'login', foo: 'bar', locals: {ping: 'pong'}
+
+app.get '/inline', (req, res) ->
+ res.send coffeekup.render ->
+ h1 'This is an inline template.'
+
+app.listen 3000
+
+console.log "Listening on 3000..."
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/index.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/index.coffee
new file mode 100644
index 0000000..48201b6
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/index.coffee
@@ -0,0 +1,12 @@
+@title = 'Chunky Bacon!'
+@canonical = 'http://chunky.bacon'
+
+h1 @title
+
+p 'This is the home page.'
+
+p "Let's count to 10: "
+
+p "#{i}..." for i in [1..10]
+
+partial 'partial', [1..10]
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/layout.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/layout.coffee
new file mode 100644
index 0000000..c25553b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/layout.coffee
@@ -0,0 +1,43 @@
+doctype 5
+html ->
+ head ->
+ meta charset: 'utf-8'
+
+ title "#{@title} | My Site" if @title?
+ meta(name: 'description', content: @description) if @description?
+ link(rel: 'canonical', href: @canonical) if @canonical?
+
+ link rel: 'icon', href: '/favicon.png'
+ link rel: 'stylesheet', href: '/app.css'
+
+ script src: 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js'
+ script src: '/app.js'
+
+ coffeescript ->
+ $(document).ready ->
+ alert 'hi!'
+
+ style '''
+ header, nav, section, article, aside, footer {display: block}
+ nav li {display: inline}
+ nav.sub {float: right}
+ #content {margin-left: 120px}
+ '''
+ body ->
+ header ->
+ a href: '/', title: 'Home', -> 'Home'
+
+ nav ->
+ ul ->
+ for item in ['About', 'Pricing', 'Contact']
+ li -> a href: "/#{item.toLowerCase()}", title: item, -> item
+
+ li -> a href: '/about', title: 'About', -> 'About'
+ li -> a href: '/pricing', title: 'Pricing', -> 'Pricing'
+ li -> a href: '/contact', title: 'Contact Us', -> 'Contact Us'
+
+ div id: 'content', ->
+ @body
+
+ footer ->
+ p -> a href: '/privacy', -> 'Privacy Policy'
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/login.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/login.coffee
new file mode 100644
index 0000000..3e38e00
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/login.coffee
@@ -0,0 +1,15 @@
+@title = 'Log In'
+
+h1 @title
+
+p "A local var: #{ping}"
+p "A context var: #{@foo}"
+
+form action: '/', method: 'post', ->
+ div class: 'field', ->
+ label for: 'username', -> 'Username: '
+ input id: 'username', name: 'username'
+
+ div class: 'field', ->
+ label for: 'password', -> 'Password: '
+ input id: 'password', name: 'password'
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/partial.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/partial.coffee
new file mode 100644
index 0000000..76a31c2
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/express/views/partial.coffee
@@ -0,0 +1 @@
+p 'Express partial'
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/app.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/app.coffee
new file mode 100644
index 0000000..66b3044
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/app.coffee
@@ -0,0 +1,13 @@
+meryl = require 'meryl'
+coffeekup = require '../../src/coffeekup'
+
+meryl.h 'GET /', (req, resp) ->
+ people = ['bob', 'alice', 'meryl']
+ resp.render 'layout', content: 'index', context: {people: people}
+
+meryl.run
+ templateDir: 'templates'
+ templateExt: '.coffee'
+ templateFunc: coffeekup.adapters.meryl
+
+console.log 'Listening on 3000...'
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/templates/index.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/templates/index.coffee
new file mode 100644
index 0000000..5780f72
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/templates/index.coffee
@@ -0,0 +1,4 @@
+h1 'Meryl example'
+ul ->
+ for name in @people
+ li name
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/templates/layout.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/templates/layout.coffee
new file mode 100644
index 0000000..b559629
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/meryl/templates/layout.coffee
@@ -0,0 +1,6 @@
+doctype 5
+html ->
+ head ->
+ title 'Meryl example'
+ body ->
+ @render @content, @context
diff --git a/node_modules/anvil.js/node_modules/coffeekup/examples/zappa.coffee b/node_modules/anvil.js/node_modules/coffeekup/examples/zappa.coffee
new file mode 100644
index 0000000..bc11ca3
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/examples/zappa.coffee
@@ -0,0 +1,13 @@
+require('zappa') ->
+ enable 'default layout'
+
+ get '/': ->
+ @franks = ['miller', 'oz', 'sinatra', 'zappa']
+ render 'index'
+
+ view index: ->
+ @title = 'Zappa example'
+ h1 @title
+ ul ->
+ for f in @franks
+ li f
diff --git a/node_modules/anvil.js/node_modules/coffeekup/lib/cli.js b/node_modules/anvil.js/node_modules/coffeekup/lib/cli.js
new file mode 100644
index 0000000..fc43676
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/lib/cli.js
@@ -0,0 +1,98 @@
+(function() {
+ var OptionParser, argv, coffeekup, compile, fs, handle_error, options, path, puts, switches, usage, write;
+ coffeekup = require('./coffeekup');
+ fs = require('fs');
+ path = require('path');
+ puts = console.log;
+ OptionParser = require('coffee-script/lib/optparse').OptionParser;
+ argv = process.argv.slice(2);
+ options = null;
+ handle_error = function(err) {
+ if (err) {
+ return console.log(err.stack);
+ }
+ };
+ compile = function(input_path, output_directory, js, namespace) {
+ if (namespace == null) {
+ namespace = 'templates';
+ }
+ return fs.readFile(input_path, 'utf-8', function(err, contents) {
+ var ext, func, name, output;
+ handle_error(err);
+ name = path.basename(input_path, path.extname(input_path));
+ if (!js) {
+ output = coffeekup.render(contents, options);
+ ext = '.html';
+ } else {
+ func = coffeekup.compile(contents, options);
+ output = "(function(){ \n this." + namespace + " || (this." + namespace + " = {});\n this." + namespace + "[" + (JSON.stringify(name)) + "] = " + func + ";\n}).call(this);";
+ ext = '.js';
+ }
+ return write(input_path, name, output, output_directory, ext);
+ });
+ };
+ write = function(input_path, name, contents, output_directory, ext) {
+ var dir, filename;
+ filename = name + ext;
+ dir = output_directory || path.dirname(input_path);
+ return path.exists(dir, function(exists) {
+ var output_path;
+ if (!exists) {
+ fs.mkdirSync(dir, 0777);
+ }
+ output_path = path.join(dir, filename);
+ if (contents.length <= 0) {
+ contents = ' ';
+ }
+ return fs.writeFile(output_path, contents, function(err) {
+ handle_error(err);
+ if (options.print) {
+ puts(contents);
+ }
+ if (options.watch) {
+ return puts("Compiled " + input_path);
+ }
+ });
+ });
+ };
+ usage = 'Usage:\n coffeekup [options] path/to/template.coffee';
+ switches = [['--js', 'compile template to js function'], ['-n', '--namespace [name]', 'global object holding the templates (default: "templates")'], ['-w', '--watch', 'watch templates for changes, and recompile'], ['-o', '--output [dir]', 'set the directory for compiled html'], ['-p', '--print', 'print the compiled html to stdout'], ['-f', '--format', 'apply line breaks and indentation to html output'], ['-u', '--utils', 'add helper locals (currently only "render")'], ['-v', '--version', 'display CoffeeKup version'], ['-h', '--help', 'display this help message']];
+ this.run = function() {
+ var args, file, parser, _ref;
+ parser = new OptionParser(switches, usage);
+ options = parser.parse(argv);
+ args = options.arguments;
+ delete options.arguments;
+ if (options.help || argv.length === 0) {
+ puts(parser.help());
+ }
+ if (options.version) {
+ puts(coffeekup.version);
+ }
+ if (options.utils) {
+ if ((_ref = options.locals) == null) {
+ options.locals = {};
+ }
+ options.locals.render = function(file) {
+ var contents;
+ contents = fs.readFileSync(file, 'utf-8');
+ return coffeekup.render(contents, options);
+ };
+ }
+ if (args.length > 0) {
+ file = args[0];
+ if (options.watch) {
+ fs.watchFile(file, {
+ persistent: true,
+ interval: 500
+ }, function(curr, prev) {
+ if (curr.size === prev.size && curr.mtime.getTime() === prev.mtime.getTime()) {
+ return;
+ }
+ return compile(file, options.output, options.js, options.namespace);
+ });
+ }
+ return compile(file, options.output, options.js, options.namespace);
+ }
+ };
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffeekup/lib/coffeekup.js b/node_modules/anvil.js/node_modules/coffeekup/lib/coffeekup.js
new file mode 100644
index 0000000..0427a53
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/lib/coffeekup.js
@@ -0,0 +1,411 @@
+(function() {
+ var cache, coffee, coffeekup, coffeescript_helpers, elements, merge_elements, skeleton;
+ var __slice = Array.prototype.slice, __indexOf = Array.prototype.indexOf || function(item) {
+ for (var i = 0, l = this.length; i < l; i++) {
+ if (this[i] === item) return i;
+ }
+ return -1;
+ }, __hasProp = Object.prototype.hasOwnProperty, __extends = function(child, parent) {
+ for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
+ function ctor() { this.constructor = child; }
+ ctor.prototype = parent.prototype;
+ child.prototype = new ctor;
+ child.__super__ = parent.prototype;
+ return child;
+ };
+ if (typeof window !== "undefined" && window !== null) {
+ coffeekup = window.CoffeeKup = {};
+ coffee = typeof CoffeeScript !== "undefined" && CoffeeScript !== null ? CoffeeScript : null;
+ } else {
+ coffeekup = exports;
+ coffee = require('coffee-script');
+ }
+ coffeekup.version = '0.3.1';
+ coffeekup.doctypes = {
+ 'default': '',
+ '5': '',
+ 'xml': '',
+ 'transitional': '',
+ 'strict': '',
+ 'frameset': '',
+ '1.1': '',
+ 'basic': '',
+ 'mobile': '',
+ 'ce': ''
+ };
+ coffeescript_helpers = "var __slice = Array.prototype.slice;\nvar __hasProp = Object.prototype.hasOwnProperty;\nvar __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };\nvar __extends = function(child, parent) {\n for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype;\n return child; };\nvar __indexOf = Array.prototype.indexOf || function(item) {\n for (var i = 0, l = this.length; i < l; i++) {\n if (this[i] === item) return i;\n } return -1; };".replace(/\n/g, '');
+ elements = {
+ regular: 'a abbr address article aside audio b bdi bdo blockquote body button\
+ canvas caption cite code colgroup datalist dd del details dfn div dl dt em\
+ fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup\
+ html i iframe ins kbd label legend li map mark menu meter nav noscript object\
+ ol optgroup option output p pre progress q rp rt ruby s samp script section\
+ select small span strong style sub summary sup table tbody td textarea tfoot\
+ th thead time title tr u ul video',
+ "void": 'area base br col command embed hr img input keygen link meta param\
+ source track wbr',
+ obsolete: 'applet acronym bgsound dir frameset noframes isindex listing\
+ nextid noembed plaintext rb strike xmp big blink center font marquee multicol\
+ nobr spacer tt',
+ obsolete_void: 'basefont frame'
+ };
+ merge_elements = function() {
+ var a, args, element, result, _i, _j, _len, _len2, _ref;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ result = [];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ a = args[_i];
+ _ref = elements[a].split(' ');
+ for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) {
+ element = _ref[_j];
+ if (__indexOf.call(result, element) < 0) {
+ result.push(element);
+ }
+ }
+ }
+ return result;
+ };
+ coffeekup.tags = merge_elements('regular', 'obsolete', 'void', 'obsolete_void');
+ coffeekup.self_closing = merge_elements('void', 'obsolete_void');
+ skeleton = function(data) {
+ var coffeescript, comment, doctype, h, ie, tag, text, yield, __ck, _ref, _ref2;
+ if (data == null) {
+ data = {};
+ }
+ if ((_ref = data.format) == null) {
+ data.format = false;
+ }
+ if ((_ref2 = data.autoescape) == null) {
+ data.autoescape = false;
+ }
+ __ck = {
+ buffer: [],
+ esc: function(txt) {
+ if (data.autoescape) {
+ return h(txt);
+ } else {
+ return String(txt);
+ }
+ },
+ tabs: 0,
+ repeat: function(string, count) {
+ return Array(count + 1).join(string);
+ },
+ indent: function() {
+ if (data.format) {
+ return text(this.repeat(' ', this.tabs));
+ }
+ },
+ tag: function(name, args) {
+ var combo, i, _i, _len;
+ combo = [name];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ i = args[_i];
+ combo.push(i);
+ }
+ return tag.apply(data, combo);
+ },
+ render_idclass: function(str) {
+ var c, classes, i, id, _i, _j, _len, _len2, _ref3;
+ classes = [];
+ _ref3 = str.split('.');
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ i = _ref3[_i];
+ if (__indexOf.call(i, '#') >= 0) {
+ id = i.replace('#', '');
+ } else {
+ if (i !== '') {
+ classes.push(i);
+ }
+ }
+ }
+ if (id) {
+ text(" id=\"" + id + "\"");
+ }
+ if (classes.length > 0) {
+ text(" class=\"");
+ for (_j = 0, _len2 = classes.length; _j < _len2; _j++) {
+ c = classes[_j];
+ if (c !== classes[0]) {
+ text(' ');
+ }
+ text(c);
+ }
+ return text('"');
+ }
+ },
+ render_attrs: function(obj, prefix) {
+ var k, v, _results;
+ if (prefix == null) {
+ prefix = '';
+ }
+ _results = [];
+ for (k in obj) {
+ v = obj[k];
+ if (typeof v === 'boolean' && v) {
+ v = k;
+ }
+ if (typeof v === 'function') {
+ v = "(" + v + ").call(this);";
+ }
+ _results.push(typeof v === 'object' && !(v instanceof Array) ? this.render_attrs(v, prefix + k + '-') : v ? text(" " + (prefix + k) + "=\"" + (this.esc(v)) + "\"") : void 0);
+ }
+ return _results;
+ },
+ render_contents: function(contents) {
+ var result;
+ switch (typeof contents) {
+ case 'string':
+ case 'number':
+ case 'boolean':
+ return text(this.esc(contents));
+ case 'function':
+ if (data.format) {
+ text('\n');
+ }
+ this.tabs++;
+ result = contents.call(data);
+ if (typeof result === 'string') {
+ this.indent();
+ text(this.esc(result));
+ if (data.format) {
+ text('\n');
+ }
+ }
+ this.tabs--;
+ return this.indent();
+ }
+ },
+ render_tag: function(name, idclass, attrs, contents) {
+ this.indent();
+ text("<" + name);
+ if (idclass) {
+ this.render_idclass(idclass);
+ }
+ if (attrs) {
+ this.render_attrs(attrs);
+ }
+ if (__indexOf.call(this.self_closing, name) >= 0) {
+ text(' />');
+ if (data.format) {
+ text('\n');
+ }
+ } else {
+ text('>');
+ this.render_contents(contents);
+ text("" + name + ">");
+ if (data.format) {
+ text('\n');
+ }
+ }
+ return null;
+ }
+ };
+ tag = function() {
+ var a, args, attrs, contents, idclass, name, _i, _len;
+ name = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ a = args[_i];
+ switch (typeof a) {
+ case 'function':
+ contents = a;
+ break;
+ case 'object':
+ attrs = a;
+ break;
+ case 'number':
+ case 'boolean':
+ contents = a;
+ break;
+ case 'string':
+ if (args.length === 1) {
+ contents = a;
+ } else {
+ if (a === args[0]) {
+ idclass = a;
+ } else {
+ contents = a;
+ }
+ }
+ }
+ }
+ return __ck.render_tag(name, idclass, attrs, contents);
+ };
+ yield = function(f) {
+ var old_buffer, temp_buffer;
+ temp_buffer = [];
+ old_buffer = __ck.buffer;
+ __ck.buffer = temp_buffer;
+ f();
+ __ck.buffer = old_buffer;
+ return temp_buffer.join('');
+ };
+ h = function(txt) {
+ return String(txt).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"');
+ };
+ doctype = function(type) {
+ if (type == null) {
+ type = 'default';
+ }
+ text(__ck.doctypes[type]);
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ text = function(txt) {
+ __ck.buffer.push(String(txt));
+ return null;
+ };
+ comment = function(cmt) {
+ text("");
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ coffeescript = function(param) {
+ switch (typeof param) {
+ case 'function':
+ return script("" + __ck.coffeescript_helpers + "(" + param + ").call(this);");
+ case 'string':
+ return script({
+ type: 'text/coffeescript'
+ }, function() {
+ return param;
+ });
+ case 'object':
+ param.type = 'text/coffeescript';
+ return script(param);
+ }
+ };
+ ie = function(condition, contents) {
+ __ck.indent();
+ text("");
+ if (data.format) {
+ return text('\n');
+ }
+ };
+ return null;
+ };
+ skeleton = String(skeleton).replace(/function\s*\(.*\)\s*\{/, '').replace(/return null;\s*\}$/, '');
+ skeleton = coffeescript_helpers + skeleton;
+ coffeekup.compile = function(template, options) {
+ var code, hardcoded_locals, k, t, tag_functions, tags_used, v, _i, _j, _len, _len2, _ref, _ref2;
+ if (options == null) {
+ options = {};
+ }
+ if (typeof template === 'function') {
+ template = String(template);
+ } else if (typeof template === 'string' && (coffee != null)) {
+ template = coffee.compile(template, {
+ bare: true
+ });
+ template = "function(){" + template + "}";
+ }
+ hardcoded_locals = '';
+ if (options.hardcode) {
+ _ref = options.hardcode;
+ for (k in _ref) {
+ v = _ref[k];
+ if (typeof v === 'function') {
+ hardcoded_locals += "var " + k + " = function(){return (" + v + ").apply(data, arguments);};";
+ } else {
+ hardcoded_locals += "var " + k + " = " + (JSON.stringify(v)) + ";";
+ }
+ }
+ }
+ tag_functions = '';
+ tags_used = [];
+ _ref2 = coffeekup.tags;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ t = _ref2[_i];
+ if (template.indexOf(t) > -1 || hardcoded_locals.indexOf(t) > -1) {
+ tags_used.push(t);
+ }
+ }
+ tag_functions += "var " + (tags_used.join(',')) + ";";
+ for (_j = 0, _len2 = tags_used.length; _j < _len2; _j++) {
+ t = tags_used[_j];
+ tag_functions += "" + t + " = function(){return __ck.tag('" + t + "', arguments);};";
+ }
+ code = tag_functions + hardcoded_locals + skeleton;
+ code += "__ck.doctypes = " + (JSON.stringify(coffeekup.doctypes)) + ";";
+ code += "__ck.coffeescript_helpers = " + (JSON.stringify(coffeescript_helpers)) + ";";
+ code += "__ck.self_closing = " + (JSON.stringify(coffeekup.self_closing)) + ";";
+ if (options.locals) {
+ code += 'with(data.locals){';
+ }
+ code += "(" + template + ").call(data);";
+ if (options.locals) {
+ code += '}';
+ }
+ code += "return __ck.buffer.join('');";
+ return new Function('data', code);
+ };
+ cache = {};
+ coffeekup.render = function(template, data, options) {
+ var k, tpl, v, _ref;
+ if (data == null) {
+ data = {};
+ }
+ if (options == null) {
+ options = {};
+ }
+ for (k in options) {
+ v = options[k];
+ data[k] = v;
+ }
+ if ((_ref = data.cache) == null) {
+ data.cache = false;
+ }
+ if (data.cache && (cache[template] != null)) {
+ tpl = cache[template];
+ } else if (data.cache) {
+ tpl = cache[template] = coffeekup.compile(template, data);
+ } else {
+ tpl = coffeekup.compile(template, data);
+ }
+ return tpl(data);
+ };
+ if (typeof window === "undefined" || window === null) {
+ coffeekup.adapters = {
+ simple: coffeekup.render,
+ meryl: coffeekup.render,
+ express: {
+ TemplateError: (function() {
+ __extends(_Class, Error);
+ function _Class(message) {
+ this.message = message;
+ Error.call(this, this.message);
+ Error.captureStackTrace(this, arguments.callee);
+ }
+ _Class.prototype.name = 'TemplateError';
+ return _Class;
+ })(),
+ compile: function(template, data) {
+ var TemplateError, tpl, _ref;
+ if ((_ref = data.hardcode) == null) {
+ data.hardcode = {};
+ }
+ data.hardcode.partial = function() {
+ return text(this.partial.apply(this, arguments));
+ };
+ TemplateError = this.TemplateError;
+ try {
+ tpl = coffeekup.compile(template, data);
+ } catch (e) {
+ throw new TemplateError("Error compiling " + data.filename + ": " + e.message);
+ }
+ return function() {
+ try {
+ return tpl.apply(null, arguments);
+ } catch (e) {
+ throw new TemplateError("Error rendering " + data.filename + ": " + e.message);
+ }
+ };
+ }
+ }
+ };
+ }
+}).call(this);
diff --git a/node_modules/anvil.js/node_modules/coffeekup/package.json b/node_modules/anvil.js/node_modules/coffeekup/package.json
new file mode 100644
index 0000000..35b16eb
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/package.json
@@ -0,0 +1,27 @@
+{
+ "name": "coffeekup",
+ "description": "Markup as CoffeeScript.",
+ "version": "0.3.1",
+ "author": "Maurice Machado ",
+ "homepage": "http://coffeekup.org",
+ "repository": {"type": "git", "url": "git://github.com/mauricemach/coffeekup.git"},
+ "dependencies": {"coffee-script": ">= 1.1.2"},
+ "devDependencies": {"jade": "0.13.0", "eco": "1.1.0-rc-1", "ejs": "0.4.3", "haml": "0.4.2"},
+ "keywords": ["template", "view", "coffeescript"],
+ "bin": "./bin/coffeekup",
+ "main": "./lib/coffeekup",
+ "engines": {"node": ">= 0.4.7"},
+ "contributors": [
+ "Luis Pedro Coelho ",
+ "Rachel Carvalho ",
+ "Vladimir Dronnikov ",
+ "James Campos ",
+ "Martin Westergaard Lassen ",
+ "Paul Harper ",
+ "Colin Thomas-Arnold ",
+ "Esa-Matti Suuronen ",
+ "Jason King ",
+ "Brandon Bloom ",
+ "Nicholas Kinsey "
+ ]
+}
diff --git a/node_modules/anvil.js/node_modules/coffeekup/src/cli.coffee b/node_modules/anvil.js/node_modules/coffeekup/src/cli.coffee
new file mode 100644
index 0000000..f6bdcee
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/src/cli.coffee
@@ -0,0 +1,85 @@
+coffeekup = require './coffeekup'
+fs = require 'fs'
+path = require 'path'
+puts = console.log
+{OptionParser} = require 'coffee-script/lib/optparse'
+
+argv = process.argv[2..]
+options = null
+
+handle_error = (err) -> console.log err.stack if err
+
+compile = (input_path, output_directory, js, namespace = 'templates') ->
+ fs.readFile input_path, 'utf-8', (err, contents) ->
+ handle_error err
+
+ name = path.basename input_path, path.extname(input_path)
+
+ if not js
+ output = coffeekup.render contents, options
+ ext = '.html'
+ else
+ func = coffeekup.compile contents, options
+ output = """
+ (function(){
+ this.#{namespace} || (this.#{namespace} = {});
+ this.#{namespace}[#{JSON.stringify name}] = #{func};
+ }).call(this);
+ """
+ ext = '.js'
+
+ write input_path, name, output, output_directory, ext
+
+write = (input_path, name, contents, output_directory, ext) ->
+ filename = name + ext
+ dir = output_directory or path.dirname input_path
+ path.exists dir, (exists) ->
+ unless exists then fs.mkdirSync dir, 0777
+
+ output_path = path.join dir, filename
+ contents = ' ' if contents.length <= 0
+ fs.writeFile output_path, contents, (err) ->
+ handle_error err
+ puts contents if options.print
+ puts "Compiled #{input_path}" if options.watch
+
+usage = '''
+ Usage:
+ coffeekup [options] path/to/template.coffee
+'''
+
+switches = [
+ ['--js', 'compile template to js function']
+ ['-n', '--namespace [name]', 'global object holding the templates (default: "templates")']
+ ['-w', '--watch', 'watch templates for changes, and recompile']
+ ['-o', '--output [dir]', 'set the directory for compiled html']
+ ['-p', '--print', 'print the compiled html to stdout']
+ ['-f', '--format', 'apply line breaks and indentation to html output']
+ ['-u', '--utils', 'add helper locals (currently only "render")']
+ ['-v', '--version', 'display CoffeeKup version']
+ ['-h', '--help', 'display this help message']
+]
+
+@run = ->
+ parser = new OptionParser switches, usage
+ options = parser.parse argv
+ args = options.arguments
+ delete options.arguments
+
+ puts parser.help() if options.help or argv.length is 0
+ puts coffeekup.version if options.version
+ if options.utils
+ options.locals ?= {}
+ options.locals.render = (file) ->
+ contents = fs.readFileSync file, 'utf-8'
+ coffeekup.render contents, options
+
+ if args.length > 0
+ file = args[0]
+
+ if options.watch
+ fs.watchFile file, {persistent: true, interval: 500}, (curr, prev) ->
+ return if curr.size is prev.size and curr.mtime.getTime() is prev.mtime.getTime()
+ compile file, options.output, options.js, options.namespace
+
+ compile file, options.output, options.js, options.namespace
diff --git a/node_modules/anvil.js/node_modules/coffeekup/src/coffeekup.coffee b/node_modules/anvil.js/node_modules/coffeekup/src/coffeekup.coffee
new file mode 100644
index 0000000..9e0a38d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/src/coffeekup.coffee
@@ -0,0 +1,371 @@
+# **CoffeeKup** lets you to write HTML templates in 100% pure
+# [CoffeeScript](http://coffeescript.org).
+#
+# You can run it on [node.js](http://nodejs.org) or the browser, or compile your
+# templates down to self-contained javascript functions, that will take in data
+# and options and return generated HTML on any JS runtime.
+#
+# The concept is directly stolen from the amazing
+# [Markaby](http://markaby.rubyforge.org/) by Tim Fletcher and why the lucky
+# stiff.
+
+if window?
+ coffeekup = window.CoffeeKup = {}
+ coffee = if CoffeeScript? then CoffeeScript else null
+else
+ coffeekup = exports
+ coffee = require 'coffee-script'
+
+coffeekup.version = '0.3.1'
+
+# Values available to the `doctype` function inside a template.
+# Ex.: `doctype 'strict'`
+coffeekup.doctypes =
+ 'default': ''
+ '5': ''
+ 'xml': ''
+ 'transitional': ''
+ 'strict': ''
+ 'frameset': ''
+ '1.1': '',
+ 'basic': ''
+ 'mobile': ''
+ 'ce': ''
+
+# CoffeeScript-generated JavaScript may contain anyone of these; but when we
+# take a function to string form to manipulate it, and then recreate it through
+# the `Function()` constructor, it loses access to its parent scope and
+# consequently to any helpers it might need. So we need to reintroduce these
+# inside any "rewritten" function.
+coffeescript_helpers = """
+ var __slice = Array.prototype.slice;
+ var __hasProp = Object.prototype.hasOwnProperty;
+ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
+ var __extends = function(child, parent) {
+ for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; }
+ function ctor() { this.constructor = child; }
+ ctor.prototype = parent.prototype; child.prototype = new ctor; child.__super__ = parent.prototype;
+ return child; };
+ var __indexOf = Array.prototype.indexOf || function(item) {
+ for (var i = 0, l = this.length; i < l; i++) {
+ if (this[i] === item) return i;
+ } return -1; };
+""".replace /\n/g, ''
+
+# Private HTML element reference.
+# Please mind the gap (1 space at the beginning of each subsequent line).
+elements =
+ # Valid HTML 5 elements requiring a closing tag.
+ # Note: the `var` element is out for obvious reasons, please use `tag 'var'`.
+ regular: 'a abbr address article aside audio b bdi bdo blockquote body button
+ canvas caption cite code colgroup datalist dd del details dfn div dl dt em
+ fieldset figcaption figure footer form h1 h2 h3 h4 h5 h6 head header hgroup
+ html i iframe ins kbd label legend li map mark menu meter nav noscript object
+ ol optgroup option output p pre progress q rp rt ruby s samp script section
+ select small span strong style sub summary sup table tbody td textarea tfoot
+ th thead time title tr u ul video'
+
+ # Valid self-closing HTML 5 elements.
+ void: 'area base br col command embed hr img input keygen link meta param
+ source track wbr'
+
+ obsolete: 'applet acronym bgsound dir frameset noframes isindex listing
+ nextid noembed plaintext rb strike xmp big blink center font marquee multicol
+ nobr spacer tt'
+
+ obsolete_void: 'basefont frame'
+
+# Create a unique list of element names merging the desired groups.
+merge_elements = (args...) ->
+ result = []
+ for a in args
+ for element in elements[a].split ' '
+ result.push element unless element in result
+ result
+
+# Public/customizable list of possible elements.
+# For each name in this list that is also present in the input template code,
+# a function with the same name will be added to the compiled template.
+coffeekup.tags = merge_elements 'regular', 'obsolete', 'void', 'obsolete_void'
+
+# Public/customizable list of elements that should be rendered self-closed.
+coffeekup.self_closing = merge_elements 'void', 'obsolete_void'
+
+# This is the basic material from which compiled templates will be formed.
+# It will be manipulated in its string form at the `coffeekup.compile` function
+# to generate the final template function.
+skeleton = (data = {}) ->
+ # Whether to generate formatted HTML with indentation and line breaks, or
+ # just the natural "faux-minified" output.
+ data.format ?= off
+
+ # Whether to autoescape all content or let you handle it on a case by case
+ # basis with the `h` function.
+ data.autoescape ?= off
+
+ # Internal CoffeeKup stuff.
+ __ck =
+ buffer: []
+
+ esc: (txt) ->
+ if data.autoescape then h(txt) else String(txt)
+
+ tabs: 0
+
+ repeat: (string, count) -> Array(count + 1).join string
+
+ indent: -> text @repeat(' ', @tabs) if data.format
+
+ # Adapter to keep the builtin tag functions DRY.
+ tag: (name, args) ->
+ combo = [name]
+ combo.push i for i in args
+ tag.apply data, combo
+
+ render_idclass: (str) ->
+ classes = []
+
+ for i in str.split '.'
+ if '#' in i
+ id = i.replace '#', ''
+ else
+ classes.push i unless i is ''
+
+ text " id=\"#{id}\"" if id
+
+ if classes.length > 0
+ text " class=\""
+ for c in classes
+ text ' ' unless c is classes[0]
+ text c
+ text '"'
+
+ render_attrs: (obj, prefix = '') ->
+ for k, v of obj
+ # `true` is rendered as `selected="selected"`.
+ v = k if typeof v is 'boolean' and v
+
+ # Functions are rendered in an executable form.
+ v = "(#{v}).call(this);" if typeof v is 'function'
+
+ # Prefixed attribute.
+ if typeof v is 'object' and v not instanceof Array
+ # `data: {icon: 'foo'}` is rendered as `data-icon="foo"`.
+ @render_attrs(v, prefix + k + '-')
+ # `undefined`, `false` and `null` result in the attribute not being rendered.
+ else if v
+ # strings, numbers, arrays and functions are rendered "as is".
+ text " #{prefix + k}=\"#{@esc(v)}\""
+
+ render_contents: (contents) ->
+ switch typeof contents
+ when 'string', 'number', 'boolean'
+ text @esc(contents)
+ when 'function'
+ text '\n' if data.format
+ @tabs++
+ result = contents.call data
+ if typeof result is 'string'
+ @indent()
+ text @esc(result)
+ text '\n' if data.format
+ @tabs--
+ @indent()
+
+ render_tag: (name, idclass, attrs, contents) ->
+ @indent()
+
+ text "<#{name}"
+ @render_idclass(idclass) if idclass
+ @render_attrs(attrs) if attrs
+
+ if name in @self_closing
+ text ' />'
+ text '\n' if data.format
+ else
+ text '>'
+
+ @render_contents(contents)
+
+ text "#{name}>"
+ text '\n' if data.format
+
+ null
+
+ tag = (name, args...) ->
+ for a in args
+ switch typeof a
+ when 'function'
+ contents = a
+ when 'object'
+ attrs = a
+ when 'number', 'boolean'
+ contents = a
+ when 'string'
+ if args.length is 1
+ contents = a
+ else
+ if a is args[0]
+ idclass = a
+ else
+ contents = a
+
+ __ck.render_tag(name, idclass, attrs, contents)
+
+ yield = (f) ->
+ temp_buffer = []
+ old_buffer = __ck.buffer
+ __ck.buffer = temp_buffer
+ f()
+ __ck.buffer = old_buffer
+ temp_buffer.join ''
+
+ h = (txt) ->
+ String(txt).replace(/&/g, '&')
+ .replace(//g, '>')
+ .replace(/"/g, '"')
+
+ doctype = (type = 'default') ->
+ text __ck.doctypes[type]
+ text '\n' if data.format
+
+ text = (txt) ->
+ __ck.buffer.push String(txt)
+ null
+
+ comment = (cmt) ->
+ text ""
+ text '\n' if data.format
+
+ coffeescript = (param) ->
+ switch typeof param
+ # `coffeescript -> alert 'hi'` becomes:
+ # ``
+ when 'function'
+ script "#{__ck.coffeescript_helpers}(#{param}).call(this);"
+ # `coffeescript "alert 'hi'"` becomes:
+ # ``
+ when 'string'
+ script type: 'text/coffeescript', -> param
+ # `coffeescript src: 'script.coffee'` becomes:
+ # ``
+ when 'object'
+ param.type = 'text/coffeescript'
+ script param
+
+ # Conditional IE comments.
+ ie = (condition, contents) ->
+ __ck.indent()
+
+ text ""
+ text '\n' if data.format
+
+ null
+
+# Stringify the skeleton and unwrap it from its enclosing `function(){}`, then
+# add the CoffeeScript helpers.
+skeleton = String(skeleton)
+ .replace(/function\s*\(.*\)\s*\{/, '')
+ .replace(/return null;\s*\}$/, '')
+
+skeleton = coffeescript_helpers + skeleton
+
+# Compiles a template into a standalone JavaScript function.
+coffeekup.compile = (template, options = {}) ->
+ # The template can be provided as either a function or a CoffeeScript string
+ # (in the latter case, the CoffeeScript compiler must be available).
+ if typeof template is 'function' then template = String(template)
+ else if typeof template is 'string' and coffee?
+ template = coffee.compile template, bare: yes
+ template = "function(){#{template}}"
+
+ # If an object `hardcode` is provided, insert the stringified value
+ # of each variable directly in the function body. This is a less flexible but
+ # faster alternative to the standard method of using `with` (see below).
+ hardcoded_locals = ''
+
+ if options.hardcode
+ for k, v of options.hardcode
+ if typeof v is 'function'
+ # Make sure these functions have access to `data` as `@/this`.
+ hardcoded_locals += "var #{k} = function(){return (#{v}).apply(data, arguments);};"
+ else hardcoded_locals += "var #{k} = #{JSON.stringify v};"
+
+ # Add a function for each tag this template references. We don't want to have
+ # all hundred-odd tags wasting space in the compiled function.
+ tag_functions = ''
+ tags_used = []
+
+ for t in coffeekup.tags
+ if template.indexOf(t) > -1 or hardcoded_locals.indexOf(t) > -1
+ tags_used.push t
+
+ tag_functions += "var #{tags_used.join ','};"
+ for t in tags_used
+ tag_functions += "#{t} = function(){return __ck.tag('#{t}', arguments);};"
+
+ # Main function assembly.
+ code = tag_functions + hardcoded_locals + skeleton
+
+ code += "__ck.doctypes = #{JSON.stringify coffeekup.doctypes};"
+ code += "__ck.coffeescript_helpers = #{JSON.stringify coffeescript_helpers};"
+ code += "__ck.self_closing = #{JSON.stringify coffeekup.self_closing};"
+
+ # If `locals` is set, wrap the template inside a `with` block. This is the
+ # most flexible but slower approach to specifying local variables.
+ code += 'with(data.locals){' if options.locals
+ code += "(#{template}).call(data);"
+ code += '}' if options.locals
+ code += "return __ck.buffer.join('');"
+
+ new Function('data', code)
+
+cache = {}
+
+# Template in, HTML out. Accepts functions or strings as does `coffeekup.compile`.
+#
+# Accepts an option `cache`, by default `false`. If set to `false` templates will
+# be recompiled each time.
+#
+# `options` is just a convenience parameter to pass options separately from the
+# data, but the two will be merged and passed down to the compiler (which uses
+# `locals` and `hardcode`), and the template (which understands `locals`, `format`
+# and `autoescape`).
+coffeekup.render = (template, data = {}, options = {}) ->
+ data[k] = v for k, v of options
+ data.cache ?= off
+
+ if data.cache and cache[template]? then tpl = cache[template]
+ else if data.cache then tpl = cache[template] = coffeekup.compile(template, data)
+ else tpl = coffeekup.compile(template, data)
+ tpl(data)
+
+unless window?
+ coffeekup.adapters =
+ # Legacy adapters for when CoffeeKup expected data in the `context` attribute.
+ simple: coffeekup.render
+ meryl: coffeekup.render
+
+ express:
+ TemplateError: class extends Error
+ constructor: (@message) ->
+ Error.call this, @message
+ Error.captureStackTrace this, arguments.callee
+ name: 'TemplateError'
+
+ compile: (template, data) ->
+ # Allows `partial 'foo'` instead of `text @partial 'foo'`.
+ data.hardcode ?= {}
+ data.hardcode.partial = ->
+ text @partial.apply @, arguments
+
+ TemplateError = @TemplateError
+ try tpl = coffeekup.compile(template, data)
+ catch e then throw new TemplateError "Error compiling #{data.filename}: #{e.message}"
+
+ return ->
+ try tpl arguments...
+ catch e then throw new TemplateError "Error rendering #{data.filename}: #{e.message}"
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/coffeekup/test.coffee b/node_modules/anvil.js/node_modules/coffeekup/test.coffee
new file mode 100644
index 0000000..28565d1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/coffeekup/test.coffee
@@ -0,0 +1,221 @@
+tests =
+ 'Literal text':
+ template: "text 'Just text'"
+ expected: 'Just text'
+
+ 'Default DOCTYPE':
+ template: "doctype()"
+ expected: ''
+
+ 'DOCTYPE':
+ template: "doctype 'xml'"
+ expected: ''
+
+ 'Custom tag':
+ template: "tag 'custom'"
+ expected: ' '
+
+ 'Custom tag with attributes':
+ template: "tag 'custom', foo: 'bar', ping: 'pong'"
+ expected: ' '
+
+ 'Custom tag with attributes and inner content':
+ template: "tag 'custom', foo: 'bar', ping: 'pong', -> 'zag'"
+ expected: 'zag '
+
+ 'Self-closing tags':
+ template: "img src: 'icon.png', alt: 'Icon'"
+ expected: ' '
+
+ 'Common tag':
+ template: "p 'hi'"
+ expected: 'hi
'
+
+ 'Attributes':
+ template: "a href: '/', title: 'Home'"
+ expected: ' '
+
+ 'HereDocs':
+ template: '''
+ script """
+ $(document).ready(function(){
+ alert('test');
+ });
+ """
+ '''
+ expected: ""
+
+ 'CoffeeScript helper (function)':
+ template: "coffeescript -> alert 'hi'"
+ expected: ""
+
+ 'CoffeeScript helper (string)':
+ template: "coffeescript \"alert 'hi'\""
+ expected: ""
+
+ 'CoffeeScript helper (object)':
+ template: "coffeescript src: 'script.coffee'"
+ expected: ""
+
+ 'Context vars':
+ template: "h1 @foo"
+ expected: 'bar '
+ params: {foo: 'bar'}
+
+ 'Local vars, hardcoded':
+ template: 'h1 "harcoded: " + obj.foo'
+ run: ->
+ obj = {foo: 'bar'}
+ @compiled = ck.compile(@template, hardcode: {obj})
+ @expected = 'harcoded: bar '
+ @result = @compiled()
+ @success = @result is @expected
+ if @success
+ obj.foo = 'baz'
+ @result = @compiled()
+ @success = @result is @expected
+
+ 'Local vars, hard-coded (functions)':
+ template: "h1 \"The sum is: \#{sum 1, 2}\""
+ expected: 'The sum is: 3 '
+ params: {hardcode: {sum: (a, b) -> a + b}}
+
+ 'Local vars, hard-coded ("helpers")':
+ template: "textbox id: 'foo'"
+ expected: ' '
+ params:
+ hardcode:
+ textbox: (attrs) ->
+ attrs.name = attrs.id
+ attrs.type = 'text'
+ tag 'input', attrs
+
+ 'Local vars':
+ template: 'h1 "dynamic: " + obj.foo'
+ run: ->
+ obj = {foo: 'bar'}
+ @expected = 'dynamic: bar '
+ @result = render(@template, locals: {obj: obj})
+ @success = @result is @expected
+ if @success
+ obj.foo = 'baz'
+ @expected = 'dynamic: baz '
+ @result = render(@template, locals: {obj: obj})
+ @success = @result is @expected
+
+ 'Comments':
+ template: "comment 'Comment'"
+ expected: ''
+
+ 'Escaping':
+ template: "h1 h(\"\")"
+ expected: "<script>alert('"pwned" by c&a ©')</script> "
+
+ 'Autoescaping':
+ template: "h1 \"\""
+ expected: "<script>alert('"pwned" by c&a ©')</script> "
+ params: {autoescape: yes}
+
+ 'ID/class shortcut (combo)':
+ template: "div '#myid.myclass1.myclass2', 'foo'"
+ expected: 'foo
'
+
+ 'ID/class shortcut (ID only)':
+ template: "div '#myid', 'foo'"
+ expected: 'foo
'
+
+ 'ID/class shortcut (one class only)':
+ template: "div '.myclass', 'foo'"
+ expected: 'foo
'
+
+ 'ID/class shortcut (multiple classes)':
+ template: "div '.myclass.myclass2.myclass3', 'foo'"
+ expected: 'foo
'
+
+ 'ID/class shortcut (no string contents)':
+ template: "img '#myid.myclass', src: '/pic.png'"
+ expected: ' '
+
+ 'Attribute values':
+ template: "br vrai: yes, faux: no, undef: @foo, nil: null, str: 'str', num: 42, arr: [1, 2, 3], obj: {foo: 'bar'}, func: ->"
+ expected: ' '
+
+ 'IE conditionals':
+ template: """
+ html ->
+ head ->
+ title 'test'
+ ie 'gte IE8', ->
+ link href: 'ie.css', rel: 'stylesheet'
+ """
+ expected: '''
+
+
+ test
+
+
+
+
+ '''
+ params: {format: yes}
+
+ 'yield':
+ template: "p \"This text could use \#{yield -> strong -> a href: '/', 'a link'}.\""
+ expected: 'This text could use a link .
'
+
+ck = require './src/coffeekup'
+render = ck.render
+
+@run = ->
+ {print} = require 'sys'
+ colors = {red: "\033[31m", redder: "\033[91m", green: "\033[32m", normal: "\033[0m"}
+ printc = (color, str) -> print colors[color] + str + colors.normal
+
+ [total, passed, failed, errors] = [0, [], [], []]
+
+ for name, test of tests
+ total++
+ try
+ test.original_params = JSON.stringify test.params
+
+ if test.run
+ test.run()
+ else
+ test.result = ck.render(test.template, test.params)
+ test.success = test.result is test.expected
+
+ if test.success
+ passed.push name
+ print "[Passed] #{name}\n"
+ else
+ failed.push name
+ printc 'red', "[Failed] #{name}\n"
+ catch ex
+ test.result = ex
+ errors.push name
+ printc 'redder', "[Error] #{name}\n"
+
+ print "\n#{total} tests, #{passed.length} passed, #{failed.length} failed, #{errors.length} errors\n\n"
+
+ if failed.length > 0
+ printc 'red', "FAILED:\n\n"
+
+ for name in failed
+ t = tests[name]
+ print "- #{name}:\n"
+ print t.template + "\n"
+ print t.original_params + "\n" if t.params
+ printc 'green', t.expected + "\n"
+ printc 'red', t.result + "\n\n"
+
+ if errors.length > 0
+ printc 'redder', "ERRORS:\n\n"
+
+ for name in errors
+ t = tests[name]
+ print "- #{name}:\n"
+ print t.template + "\n"
+ printc 'green', t.expected + "\n"
+ printc 'redder', t.result.stack + "\n\n"
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/colors/MIT-LICENSE.txt b/node_modules/anvil.js/node_modules/colors/MIT-LICENSE.txt
new file mode 100644
index 0000000..7dca107
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/colors/MIT-LICENSE.txt
@@ -0,0 +1,22 @@
+Copyright (c) 2010
+
+Marak Squires
+Alexis Sellier (cloudhead)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/colors/ReadMe.md b/node_modules/anvil.js/node_modules/colors/ReadMe.md
new file mode 100644
index 0000000..1c6b0d0
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/colors/ReadMe.md
@@ -0,0 +1,77 @@
+# colors.js - get color and style in your node.js console ( and browser ) like what
+
+
+
+
+## Installation
+
+ npm install colors
+
+## colors and styles!
+
+- bold
+- italic
+- underline
+- inverse
+- yellow
+- cyan
+- white
+- magenta
+- green
+- red
+- grey
+- blue
+- rainbow
+- zebra
+- random
+
+## Usage
+
+``` js
+var colors = require('./colors');
+
+console.log('hello'.green); // outputs green text
+console.log('i like cake and pies'.underline.red) // outputs red underlined text
+console.log('inverse the color'.inverse); // inverses the color
+console.log('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)
+```
+
+# Creating Custom themes
+
+```js
+
+var require('colors');
+
+colors.setTheme({
+ silly: 'rainbow',
+ input: 'grey',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+});
+
+// outputs red text
+console.log("this is an error".error);
+
+// outputs yellow text
+console.log("this is a warning".warn);
+```
+
+
+### Contributors
+
+Marak (Marak Squires)
+Alexis Sellier (cloudhead)
+mmalecki (Maciej Małecki)
+nicoreed (Nico Reed)
+morganrallen (Morgan Allen)
+JustinCampbell (Justin Campbell)
+ded (Dustin Diaz)
+
+
+#### , Marak Squires , Justin Campbell, Dustin Diaz (@ded)
diff --git a/node_modules/anvil.js/node_modules/colors/colors.js b/node_modules/anvil.js/node_modules/colors/colors.js
new file mode 100644
index 0000000..a7198f1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/colors/colors.js
@@ -0,0 +1,269 @@
+/*
+colors.js
+
+Copyright (c) 2010
+
+Marak Squires
+Alexis Sellier (cloudhead)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+
+var isHeadless = false;
+
+if (typeof module !== 'undefined') {
+ isHeadless = true;
+}
+
+if (!isHeadless) {
+ var exports = {};
+ var module = {};
+ var colors = exports;
+ exports.mode = "browser";
+} else {
+ exports.mode = "console";
+}
+
+//
+// Prototypes the string object to have additional method calls that add terminal colors
+//
+var addProperty = function (color, func) {
+ var allowOverride = ['bold'];
+ exports[color] = function(str) {
+ return func.apply(str);
+ };
+ String.prototype.__defineGetter__(color, func);
+}
+
+//
+// Iterate through all default styles and colors
+//
+
+var x = ['bold', 'underline', 'italic', 'inverse', 'grey', 'black', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
+x.forEach(function (style) {
+
+ // __defineGetter__ at the least works in more browsers
+ // http://robertnyman.com/javascript/javascript-getters-setters.html
+ // Object.defineProperty only works in Chrome
+ addProperty(style, function () {
+ return stylize(this, style);
+ });
+});
+
+function sequencer(map) {
+ return function () {
+ if (!isHeadless) {
+ return this.replace(/( )/, '$1');
+ }
+ var exploded = this.split("");
+ var i = 0;
+ exploded = exploded.map(map);
+ return exploded.join("");
+ }
+}
+
+var rainbowMap = (function () {
+ var rainbowColors = ['red','yellow','green','blue','magenta']; //RoY G BiV
+ return function (letter, i, exploded) {
+ if (letter == " ") {
+ return letter;
+ } else {
+ return stylize(letter, rainbowColors[i++ % rainbowColors.length]);
+ }
+ }
+})();
+
+exports.addSequencer = function (name, map) {
+ addProperty(name, sequencer(map));
+}
+
+exports.addSequencer('rainbow', rainbowMap);
+exports.addSequencer('zebra', function (letter, i, exploded) {
+ return i % 2 === 0 ? letter : letter.inverse;
+});
+
+exports.setTheme = function (theme) {
+ Object.keys(theme).forEach(function(prop){
+ addProperty(prop, function(){
+ return exports[theme[prop]](this);
+ });
+ });
+}
+
+function stylize(str, style) {
+
+ if (exports.mode == 'console') {
+ var styles = {
+ //styles
+ 'bold' : ['\033[1m', '\033[22m'],
+ 'italic' : ['\033[3m', '\033[23m'],
+ 'underline' : ['\033[4m', '\033[24m'],
+ 'inverse' : ['\033[7m', '\033[27m'],
+ //grayscale
+ 'white' : ['\033[37m', '\033[39m'],
+ 'grey' : ['\033[90m', '\033[39m'],
+ 'black' : ['\033[30m', '\033[39m'],
+ //colors
+ 'blue' : ['\033[34m', '\033[39m'],
+ 'cyan' : ['\033[36m', '\033[39m'],
+ 'green' : ['\033[32m', '\033[39m'],
+ 'magenta' : ['\033[35m', '\033[39m'],
+ 'red' : ['\033[31m', '\033[39m'],
+ 'yellow' : ['\033[33m', '\033[39m']
+ };
+ } else if (exports.mode == 'browser') {
+ var styles = {
+ //styles
+ 'bold' : ['', ' '],
+ 'italic' : ['', ' '],
+ 'underline' : ['', ' '],
+ 'inverse' : ['', ' '],
+ //grayscale
+ 'white' : ['', ' '],
+ 'grey' : ['', ' '],
+ 'black' : ['', ' '],
+ //colors
+ 'blue' : ['', ' '],
+ 'cyan' : ['', ' '],
+ 'green' : ['', ' '],
+ 'magenta' : ['', ' '],
+ 'red' : ['', ' '],
+ 'yellow' : ['', ' ']
+ };
+ } else if (exports.mode == 'none') {
+ return str;
+ } else {
+ console.log('unsupported mode, try "browser", "console" or "none"');
+ }
+ return styles[style][0] + str + styles[style][1];
+};
+
+// don't summon zalgo
+addProperty('zalgo', function () {
+ return zalgo(this);
+});
+
+// please no
+function zalgo(text, options) {
+ var soul = {
+ "up" : [
+ '̍','̎','̄','̅',
+ '̿','̑','̆','̐',
+ '͒','͗','͑','̇',
+ '̈','̊','͂','̓',
+ '̈','͊','͋','͌',
+ '̃','̂','̌','͐',
+ '̀','́','̋','̏',
+ '̒','̓','̔','̽',
+ '̉','ͣ','ͤ','ͥ',
+ 'ͦ','ͧ','ͨ','ͩ',
+ 'ͪ','ͫ','ͬ','ͭ',
+ 'ͮ','ͯ','̾','͛',
+ '͆','̚'
+ ],
+ "down" : [
+ '̖','̗','̘','̙',
+ '̜','̝','̞','̟',
+ '̠','̤','̥','̦',
+ '̩','̪','̫','̬',
+ '̭','̮','̯','̰',
+ '̱','̲','̳','̹',
+ '̺','̻','̼','ͅ',
+ '͇','͈','͉','͍',
+ '͎','͓','͔','͕',
+ '͖','͙','͚','̣'
+ ],
+ "mid" : [
+ '̕','̛','̀','́',
+ '͘','̡','̢','̧',
+ '̨','̴','̵','̶',
+ '͜','͝','͞',
+ '͟','͠','͢','̸',
+ '̷','͡',' ҉'
+ ]
+ },
+ all = [].concat(soul.up, soul.down, soul.mid),
+ zalgo = {};
+
+ function randomNumber(range) {
+ r = Math.floor(Math.random()*range);
+ return r;
+ };
+
+ function is_char(character) {
+ var bool = false;
+ all.filter(function(i){
+ bool = (i == character);
+ });
+ return bool;
+ }
+
+ function heComes(text, options){
+ result = '';
+ options = options || {};
+ options["up"] = options["up"] || true;
+ options["mid"] = options["mid"] || true;
+ options["down"] = options["down"] || true;
+ options["size"] = options["size"] || "maxi";
+ var counts;
+ text = text.split('');
+ for(var l in text){
+ if(is_char(l)) { continue; }
+ result = result + text[l];
+
+ counts = {"up" : 0, "down" : 0, "mid" : 0};
+
+ switch(options.size) {
+ case 'mini':
+ counts.up = randomNumber(8);
+ counts.min= randomNumber(2);
+ counts.down = randomNumber(8);
+ break;
+ case 'maxi':
+ counts.up = randomNumber(16) + 3;
+ counts.min = randomNumber(4) + 1;
+ counts.down = randomNumber(64) + 3;
+ break;
+ default:
+ counts.up = randomNumber(8) + 1;
+ counts.mid = randomNumber(6) / 2;
+ counts.down= randomNumber(8) + 1;
+ break;
+ }
+
+ var arr = ["up", "mid", "down"];
+ for(var d in arr){
+ var index = arr[d];
+ for (var i = 0 ; i <= counts[index]; i++)
+ {
+ if(options[index]) {
+ result = result + soul[index][randomNumber(soul[index].length)];
+ }
+ }
+ }
+ }
+ return result;
+ };
+ return heComes(text);
+}
+
+addProperty('stripColors', function() {
+ return ("" + this).replace(/\u001b\[\d+m/g,'');
+});
diff --git a/node_modules/anvil.js/node_modules/colors/example.html b/node_modules/anvil.js/node_modules/colors/example.html
new file mode 100644
index 0000000..ab95649
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/colors/example.html
@@ -0,0 +1,74 @@
+
+
+
+
+ Colors Example
+
+
+
+
+
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/colors/example.js b/node_modules/anvil.js/node_modules/colors/example.js
new file mode 100644
index 0000000..3da2986
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/colors/example.js
@@ -0,0 +1,65 @@
+var colors = require('./colors');
+
+//colors.mode = "browser";
+
+var test = colors.red("hopefully colorless output");
+console.log('Rainbows are fun!'.rainbow);
+console.log('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported
+console.log('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported
+//console.log('zalgo time!'.zalgo);
+console.log(test.stripColors);
+console.log("a".grey + " b".black);
+
+console.log("Zebras are so fun!".zebra);
+
+console.log(colors.rainbow('Rainbows are fun!'));
+console.log(colors.italic('So ') + colors.underline('are') + colors.bold(' styles! ') + colors.inverse('inverse')); // styles not widely supported
+console.log(colors.bold(colors.italic(colors.underline(colors.red('Chains are also cool.'))))); // styles not widely supported
+//console.log(colors.zalgo('zalgo time!'));
+console.log(colors.stripColors(test));
+console.log(colors.grey("a") + colors.black(" b"));
+
+colors.addSequencer("america", function(letter, i, exploded) {
+ if(letter === " ") return letter;
+ switch(i%3) {
+ case 0: return letter.red;
+ case 1: return letter.white;
+ case 2: return letter.blue;
+ }
+});
+
+colors.addSequencer("random", (function() {
+ var available = ['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'];
+
+ return function(letter, i, exploded) {
+ return letter === " " ? letter : letter[available[Math.round(Math.random() * (available.length - 1))]];
+ };
+})());
+
+console.log("AMERICA! F--K YEAH!".america);
+console.log("So apparently I've been to Mars, with all the little green men. But you know, I don't recall.".random);
+
+//
+// Custom themes
+//
+
+colors.setTheme({
+ silly: 'rainbow',
+ input: 'grey',
+ verbose: 'cyan',
+ prompt: 'grey',
+ info: 'green',
+ data: 'grey',
+ help: 'cyan',
+ warn: 'yellow',
+ debug: 'blue',
+ error: 'red'
+});
+
+// outputs red text
+console.log("this is an error".error);
+
+// outputs yellow text
+console.log("this is a warning".warn);
+
+
diff --git a/node_modules/anvil.js/node_modules/colors/package.json b/node_modules/anvil.js/node_modules/colors/package.json
new file mode 100644
index 0000000..3a53d62
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/colors/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "colors",
+ "description": "get colors in your node.js console like what",
+ "version": "0.6.0-1",
+ "author": "Marak Squires",
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/Marak/colors.js.git"
+ },
+ "engines": {
+ "node": ">=0.1.90"
+ },
+ "main": "colors"
+}
diff --git a/node_modules/anvil.js/node_modules/colors/test.js b/node_modules/anvil.js/node_modules/colors/test.js
new file mode 100644
index 0000000..1c03d65
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/colors/test.js
@@ -0,0 +1,65 @@
+var assert = require('assert'),
+ colors = require('./colors');
+
+//
+// This is a pretty nice example on how tests shouldn't be written. However,
+// it's more about API stability than about really testing it (although it's
+// a pretty complete test suite).
+//
+
+var s = 'string';
+
+function a(s, code) {
+ return '\033[' + code.toString() + 'm' + s + '\033[39m';
+}
+
+function aE(s, color, code) {
+ assert.equal(s[color], a(s, code));
+ assert.equal(colors[color](s), a(s, code));
+ assert.equal(s[color], colors[color](s));
+ assert.equal(s[color].stripColors, s);
+ assert.equal(s[color].stripColors, colors.stripColors(s));
+}
+
+function h(s, color) {
+ return '' + s + ' ';
+ // that's pretty dumb approach to testing it
+}
+
+var stylesColors = ['white', 'grey', 'black', 'blue', 'cyan', 'green', 'magenta', 'red', 'yellow'];
+var stylesAll = stylesColors.concat(['bold', 'italic', 'underline', 'inverse', 'rainbow']);
+
+colors.mode = 'console';
+assert.equal(s.bold, '\033[1m' + s + '\033[22m');
+assert.equal(s.italic, '\033[3m' + s + '\033[23m');
+assert.equal(s.underline, '\033[4m' + s + '\033[24m');
+assert.equal(s.inverse, '\033[7m' + s + '\033[27m');
+assert.ok(s.rainbow);
+aE(s, 'white', 37);
+aE(s, 'grey', 90);
+aE(s, 'black', 30);
+aE(s, 'blue', 34);
+aE(s, 'cyan', 36);
+aE(s, 'green', 32);
+aE(s, 'magenta', 35);
+aE(s, 'red', 31);
+aE(s, 'yellow', 33);
+assert.equal(s, 'string');
+
+colors.mode = 'browser';
+assert.equal(s.bold, '' + s + ' ');
+assert.equal(s.italic, '' + s + ' ');
+assert.equal(s.underline, '' + s + ' ');
+assert.equal(s.inverse, '' + s + ' ');
+assert.ok(s.rainbow);
+stylesColors.forEach(function (color) {
+ assert.equal(s[color], h(s, color));
+ assert.equal(colors[color](s), h(s, color));
+});
+
+colors.mode = 'none';
+stylesAll.forEach(function (style) {
+ assert.equal(s[style], s);
+ assert.equal(colors[style](s), s);
+});
+
diff --git a/node_modules/anvil.js/node_modules/commander/.npmignore b/node_modules/anvil.js/node_modules/commander/.npmignore
new file mode 100644
index 0000000..f1250e5
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/.npmignore
@@ -0,0 +1,4 @@
+support
+test
+examples
+*.sock
diff --git a/node_modules/anvil.js/node_modules/commander/.travis.yml b/node_modules/anvil.js/node_modules/commander/.travis.yml
new file mode 100644
index 0000000..f1d0f13
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/node_modules/anvil.js/node_modules/commander/History.md b/node_modules/anvil.js/node_modules/commander/History.md
new file mode 100644
index 0000000..b9e4d10
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/History.md
@@ -0,0 +1,125 @@
+
+1.0.2 / 2012-08-24
+==================
+
+ * add `--foo=bar` support [arv]
+ * fix password on node 0.8.8. Make backward compatible with 0.6 [focusaurus]
+
+1.0.1 / 2012-08-03
+==================
+
+ * fix issue #56
+ * fix tty.setRawMode(mode) was moved to tty.ReadStream#setRawMode() (i.e. process.stdin.setRawMode())
+
+1.0.0 / 2012-07-05
+==================
+
+ * add support for optional option descriptions
+ * add defaulting of `.version()` to package.json's version
+
+0.6.1 / 2012-06-01
+==================
+
+ * Added: append (yes or no) on confirmation
+ * Added: allow node.js v0.7.x
+
+0.6.0 / 2012-04-10
+==================
+
+ * Added `.prompt(obj, callback)` support. Closes #49
+ * Added default support to .choose(). Closes #41
+ * Fixed the choice example
+
+0.5.1 / 2011-12-20
+==================
+
+ * Fixed `password()` for recent nodes. Closes #36
+
+0.5.0 / 2011-12-04
+==================
+
+ * Added sub-command option support [itay]
+
+0.4.3 / 2011-12-04
+==================
+
+ * Fixed custom help ordering. Closes #32
+
+0.4.2 / 2011-11-24
+==================
+
+ * Added travis support
+ * Fixed: line-buffered input automatically trimmed. Closes #31
+
+0.4.1 / 2011-11-18
+==================
+
+ * Removed listening for "close" on --help
+
+0.4.0 / 2011-11-15
+==================
+
+ * Added support for `--`. Closes #24
+
+0.3.3 / 2011-11-14
+==================
+
+ * Fixed: wait for close event when writing help info [Jerry Hamlet]
+
+0.3.2 / 2011-11-01
+==================
+
+ * Fixed long flag definitions with values [felixge]
+
+0.3.1 / 2011-10-31
+==================
+
+ * Changed `--version` short flag to `-V` from `-v`
+ * Changed `.version()` so it's configurable [felixge]
+
+0.3.0 / 2011-10-31
+==================
+
+ * Added support for long flags only. Closes #18
+
+0.2.1 / 2011-10-24
+==================
+
+ * "node": ">= 0.4.x < 0.7.0". Closes #20
+
+0.2.0 / 2011-09-26
+==================
+
+ * Allow for defaults that are not just boolean. Default peassignment only occurs for --no-*, optional, and required arguments. [Jim Isaacs]
+
+0.1.0 / 2011-08-24
+==================
+
+ * Added support for custom `--help` output
+
+0.0.5 / 2011-08-18
+==================
+
+ * Changed: when the user enters nothing prompt for password again
+ * Fixed issue with passwords beginning with numbers [NuckChorris]
+
+0.0.4 / 2011-08-15
+==================
+
+ * Fixed `Commander#args`
+
+0.0.3 / 2011-08-15
+==================
+
+ * Added default option value support
+
+0.0.2 / 2011-08-15
+==================
+
+ * Added mask support to `Command#password(str[, mask], fn)`
+ * Added `Command#password(str, fn)`
+
+0.0.1 / 2010-01-03
+==================
+
+ * Initial release
diff --git a/node_modules/anvil.js/node_modules/commander/Makefile b/node_modules/anvil.js/node_modules/commander/Makefile
new file mode 100644
index 0000000..0074625
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/Makefile
@@ -0,0 +1,7 @@
+
+TESTS = $(shell find test/test.*.js)
+
+test:
+ @./test/run $(TESTS)
+
+.PHONY: test
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/commander/Readme.md b/node_modules/anvil.js/node_modules/commander/Readme.md
new file mode 100644
index 0000000..b8328c3
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/Readme.md
@@ -0,0 +1,262 @@
+# Commander.js
+
+ The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/visionmedia/commander).
+
+ [](http://travis-ci.org/visionmedia/commander.js)
+
+## Installation
+
+ $ npm install commander
+
+## Option parsing
+
+ Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('commander');
+
+program
+ .version('0.0.1')
+ .option('-p, --peppers', 'Add peppers')
+ .option('-P, --pineapple', 'Add pineapple')
+ .option('-b, --bbq', 'Add bbq sauce')
+ .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
+ .parse(process.argv);
+
+console.log('you ordered a pizza with:');
+if (program.peppers) console.log(' - peppers');
+if (program.pineapple) console.log(' - pineappe');
+if (program.bbq) console.log(' - bbq');
+console.log(' - %s cheese', program.cheese);
+```
+
+ Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as "--template-engine" are camel-cased, becoming `program.templateEngine` etc.
+
+## Automated --help
+
+ The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
+
+```
+ $ ./examples/pizza --help
+
+ Usage: pizza [options]
+
+ Options:
+
+ -V, --version output the version number
+ -p, --peppers Add peppers
+ -P, --pineapple Add pineappe
+ -b, --bbq Add bbq sauce
+ -c, --cheese Add the specified type of cheese [marble]
+ -h, --help output usage information
+
+```
+
+## Coercion
+
+```js
+function range(val) {
+ return val.split('..').map(Number);
+}
+
+function list(val) {
+ return val.split(',');
+}
+
+program
+ .version('0.0.1')
+ .usage('[options] ')
+ .option('-i, --integer ', 'An integer argument', parseInt)
+ .option('-f, --float ', 'A float argument', parseFloat)
+ .option('-r, --range ..', 'A range', range)
+ .option('-l, --list ', 'A list', list)
+ .option('-o, --optional [value]', 'An optional value')
+ .parse(process.argv);
+
+console.log(' int: %j', program.integer);
+console.log(' float: %j', program.float);
+console.log(' optional: %j', program.optional);
+program.range = program.range || [];
+console.log(' range: %j..%j', program.range[0], program.range[1]);
+console.log(' list: %j', program.list);
+console.log(' args: %j', program.args);
+```
+
+## Custom help
+
+ You can display arbitrary `-h, --help` information
+ by listening for "--help". Commander will automatically
+ exit once you are done so that the remainder of your program
+ does not execute causing undesired behaviours, for example
+ in the following executable "stuff" will not output when
+ `--help` is used.
+
+```js
+#!/usr/bin/env node
+
+/**
+ * Module dependencies.
+ */
+
+var program = require('../');
+
+function list(val) {
+ return val.split(',').map(Number);
+}
+
+program
+ .version('0.0.1')
+ .option('-f, --foo', 'enable some foo')
+ .option('-b, --bar', 'enable some bar')
+ .option('-B, --baz', 'enable some baz');
+
+// must be before .parse() since
+// node's emit() is immediate
+
+program.on('--help', function(){
+ console.log(' Examples:');
+ console.log('');
+ console.log(' $ custom-help --help');
+ console.log(' $ custom-help -h');
+ console.log('');
+});
+
+program.parse(process.argv);
+
+console.log('stuff');
+```
+
+yielding the following help output:
+
+```
+
+Usage: custom-help [options]
+
+Options:
+
+ -h, --help output usage information
+ -V, --version output the version number
+ -f, --foo enable some foo
+ -b, --bar enable some bar
+ -B, --baz enable some baz
+
+Examples:
+
+ $ custom-help --help
+ $ custom-help -h
+
+```
+
+## .prompt(msg, fn)
+
+ Single-line prompt:
+
+```js
+program.prompt('name: ', function(name){
+ console.log('hi %s', name);
+});
+```
+
+ Multi-line prompt:
+
+```js
+program.prompt('description:', function(name){
+ console.log('hi %s', name);
+});
+```
+
+ Coercion:
+
+```js
+program.prompt('Age: ', Number, function(age){
+ console.log('age: %j', age);
+});
+```
+
+```js
+program.prompt('Birthdate: ', Date, function(date){
+ console.log('date: %s', date);
+});
+```
+
+## .password(msg[, mask], fn)
+
+Prompt for password without echoing:
+
+```js
+program.password('Password: ', function(pass){
+ console.log('got "%s"', pass);
+ process.stdin.destroy();
+});
+```
+
+Prompt for password with mask char "*":
+
+```js
+program.password('Password: ', '*', function(pass){
+ console.log('got "%s"', pass);
+ process.stdin.destroy();
+});
+```
+
+## .confirm(msg, fn)
+
+ Confirm with the given `msg`:
+
+```js
+program.confirm('continue? ', function(ok){
+ console.log(' got %j', ok);
+});
+```
+
+## .choose(list, fn)
+
+ Let the user choose from a `list`:
+
+```js
+var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
+
+console.log('Choose the coolest pet:');
+program.choose(list, function(i){
+ console.log('you chose %d "%s"', i, list[i]);
+});
+```
+
+## Links
+
+ - [API documentation](http://visionmedia.github.com/commander.js/)
+ - [ascii tables](https://github.com/LearnBoost/cli-table)
+ - [progress bars](https://github.com/visionmedia/node-progress)
+ - [more progress bars](https://github.com/substack/node-multimeter)
+ - [examples](https://github.com/visionmedia/commander.js/tree/master/examples)
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/commander/index.js b/node_modules/anvil.js/node_modules/commander/index.js
new file mode 100644
index 0000000..06ec1e4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/index.js
@@ -0,0 +1,2 @@
+
+module.exports = require('./lib/commander');
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/commander/lib/commander.js b/node_modules/anvil.js/node_modules/commander/lib/commander.js
new file mode 100644
index 0000000..409ce9d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/lib/commander.js
@@ -0,0 +1,1048 @@
+/*!
+ * commander
+ * Copyright(c) 2011 TJ Holowaychuk
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var EventEmitter = require('events').EventEmitter
+ , path = require('path')
+ , keypress = require('keypress')
+ , tty = require('tty')
+ , basename = path.basename;
+
+/**
+ * Expose the root command.
+ */
+
+exports = module.exports = new Command;
+
+/**
+ * Expose `Command`.
+ */
+
+exports.Command = Command;
+
+/**
+ * Expose `Option`.
+ */
+
+exports.Option = Option;
+
+/**
+ * Initialize a new `Option` with the given `flags` and `description`.
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @api public
+ */
+
+function Option(flags, description) {
+ this.flags = flags;
+ this.required = ~flags.indexOf('<');
+ this.optional = ~flags.indexOf('[');
+ this.bool = !~flags.indexOf('-no-');
+ flags = flags.split(/[ ,|]+/);
+ if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
+ this.long = flags.shift();
+ this.description = description || '';
+}
+
+/**
+ * Return option name.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Option.prototype.name = function(){
+ return this.long
+ .replace('--', '')
+ .replace('no-', '');
+};
+
+/**
+ * Check if `arg` matches the short or long flag.
+ *
+ * @param {String} arg
+ * @return {Boolean}
+ * @api private
+ */
+
+Option.prototype.is = function(arg){
+ return arg == this.short
+ || arg == this.long;
+};
+
+/**
+ * Initialize a new `Command`.
+ *
+ * @param {String} name
+ * @api public
+ */
+
+function Command(name) {
+ this.commands = [];
+ this.options = [];
+ this.args = [];
+ this.name = name;
+}
+
+/**
+ * Inherit from `EventEmitter.prototype`.
+ */
+
+Command.prototype.__proto__ = EventEmitter.prototype;
+
+/**
+ * Add command `name`.
+ *
+ * The `.action()` callback is invoked when the
+ * command `name` is specified via __ARGV__,
+ * and the remaining arguments are applied to the
+ * function for access.
+ *
+ * When the `name` is "*" an un-matched command
+ * will be passed as the first arg, followed by
+ * the rest of __ARGV__ remaining.
+ *
+ * Examples:
+ *
+ * program
+ * .version('0.0.1')
+ * .option('-C, --chdir ', 'change the working directory')
+ * .option('-c, --config ', 'set config path. defaults to ./deploy.conf')
+ * .option('-T, --no-tests', 'ignore test hook')
+ *
+ * program
+ * .command('setup')
+ * .description('run remote setup commands')
+ * .action(function(){
+ * console.log('setup');
+ * });
+ *
+ * program
+ * .command('exec ')
+ * .description('run the given remote command')
+ * .action(function(cmd){
+ * console.log('exec "%s"', cmd);
+ * });
+ *
+ * program
+ * .command('*')
+ * .description('deploy the given env')
+ * .action(function(env){
+ * console.log('deploying "%s"', env);
+ * });
+ *
+ * program.parse(process.argv);
+ *
+ * @param {String} name
+ * @return {Command} the new command
+ * @api public
+ */
+
+Command.prototype.command = function(name){
+ var args = name.split(/ +/);
+ var cmd = new Command(args.shift());
+ this.commands.push(cmd);
+ cmd.parseExpectedArgs(args);
+ cmd.parent = this;
+ return cmd;
+};
+
+/**
+ * Parse expected `args`.
+ *
+ * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parseExpectedArgs = function(args){
+ if (!args.length) return;
+ var self = this;
+ args.forEach(function(arg){
+ switch (arg[0]) {
+ case '<':
+ self.args.push({ required: true, name: arg.slice(1, -1) });
+ break;
+ case '[':
+ self.args.push({ required: false, name: arg.slice(1, -1) });
+ break;
+ }
+ });
+ return this;
+};
+
+/**
+ * Register callback `fn` for the command.
+ *
+ * Examples:
+ *
+ * program
+ * .command('help')
+ * .description('display verbose help')
+ * .action(function(){
+ * // output help here
+ * });
+ *
+ * @param {Function} fn
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.action = function(fn){
+ var self = this;
+ this.parent.on(this.name, function(args, unknown){
+ // Parse any so-far unknown options
+ unknown = unknown || [];
+ var parsed = self.parseOptions(unknown);
+
+ // Output help if necessary
+ outputHelpIfNecessary(self, parsed.unknown);
+
+ // If there are still any unknown options, then we simply
+ // die, unless someone asked for help, in which case we give it
+ // to them, and then we die.
+ if (parsed.unknown.length > 0) {
+ self.unknownOption(parsed.unknown[0]);
+ }
+
+ // Leftover arguments need to be pushed back. Fixes issue #56
+ if (parsed.args.length) args = parsed.args.concat(args);
+
+ self.args.forEach(function(arg, i){
+ if (arg.required && null == args[i]) {
+ self.missingArgument(arg.name);
+ }
+ });
+
+ // Always append ourselves to the end of the arguments,
+ // to make sure we match the number of arguments the user
+ // expects
+ if (self.args.length) {
+ args[self.args.length] = self;
+ } else {
+ args.push(self);
+ }
+
+ fn.apply(this, args);
+ });
+ return this;
+};
+
+/**
+ * Define option with `flags`, `description` and optional
+ * coercion `fn`.
+ *
+ * The `flags` string should contain both the short and long flags,
+ * separated by comma, a pipe or space. The following are all valid
+ * all will output this way when `--help` is used.
+ *
+ * "-p, --pepper"
+ * "-p|--pepper"
+ * "-p --pepper"
+ *
+ * Examples:
+ *
+ * // simple boolean defaulting to false
+ * program.option('-p, --pepper', 'add pepper');
+ *
+ * --pepper
+ * program.pepper
+ * // => Boolean
+ *
+ * // simple boolean defaulting to false
+ * program.option('-C, --no-cheese', 'remove cheese');
+ *
+ * program.cheese
+ * // => true
+ *
+ * --no-cheese
+ * program.cheese
+ * // => true
+ *
+ * // required argument
+ * program.option('-C, --chdir ', 'change the working directory');
+ *
+ * --chdir /tmp
+ * program.chdir
+ * // => "/tmp"
+ *
+ * // optional argument
+ * program.option('-c, --cheese [type]', 'add cheese [marble]');
+ *
+ * @param {String} flags
+ * @param {String} description
+ * @param {Function|Mixed} fn or default
+ * @param {Mixed} defaultValue
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.option = function(flags, description, fn, defaultValue){
+ var self = this
+ , option = new Option(flags, description)
+ , oname = option.name()
+ , name = camelcase(oname);
+
+ // default as 3rd arg
+ if ('function' != typeof fn) defaultValue = fn, fn = null;
+
+ // preassign default value only for --no-*, [optional], or
+ if (false == option.bool || option.optional || option.required) {
+ // when --no-* we make sure default is true
+ if (false == option.bool) defaultValue = true;
+ // preassign only if we have a default
+ if (undefined !== defaultValue) self[name] = defaultValue;
+ }
+
+ // register the option
+ this.options.push(option);
+
+ // when it's passed assign the value
+ // and conditionally invoke the callback
+ this.on(oname, function(val){
+ // coercion
+ if (null != val && fn) val = fn(val);
+
+ // unassigned or bool
+ if ('boolean' == typeof self[name] || 'undefined' == typeof self[name]) {
+ // if no value, bool true, and we have a default, then use it!
+ if (null == val) {
+ self[name] = option.bool
+ ? defaultValue || true
+ : false;
+ } else {
+ self[name] = val;
+ }
+ } else if (null !== val) {
+ // reassign
+ self[name] = val;
+ }
+ });
+
+ return this;
+};
+
+/**
+ * Parse `argv`, settings options and invoking commands when defined.
+ *
+ * @param {Array} argv
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.parse = function(argv){
+ // store raw args
+ this.rawArgs = argv;
+
+ // guess name
+ if (!this.name) this.name = basename(argv[1]);
+ // guess version
+ if (!this._version) {
+ try {
+ this.version(require('../package.json').version);
+ } catch(e) {}
+ }
+ // process argv
+ var parsed = this.parseOptions(this.normalize(argv.slice(2)));
+ this.args = parsed.args;
+ return this.parseArgs(this.args, parsed.unknown);
+};
+
+/**
+ * Normalize `args`, splitting joined short flags. For example
+ * the arg "-abc" is equivalent to "-a -b -c".
+ * This also normalizes equal sign and splits "--abc=def" into "--abc def".
+ *
+ * @param {Array} args
+ * @return {Array}
+ * @api private
+ */
+
+Command.prototype.normalize = function(args){
+ var ret = []
+ , arg
+ , index;
+
+ for (var i = 0, len = args.length; i < len; ++i) {
+ arg = args[i];
+ if (arg.length > 1 && '-' == arg[0] && '-' != arg[1]) {
+ arg.slice(1).split('').forEach(function(c){
+ ret.push('-' + c);
+ });
+ } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
+ ret.push(arg.slice(0, index), arg.slice(index + 1));
+ } else {
+ ret.push(arg);
+ }
+ }
+
+ return ret;
+};
+
+/**
+ * Parse command `args`.
+ *
+ * When listener(s) are available those
+ * callbacks are invoked, otherwise the "*"
+ * event is emitted and those actions are invoked.
+ *
+ * @param {Array} args
+ * @return {Command} for chaining
+ * @api private
+ */
+
+Command.prototype.parseArgs = function(args, unknown){
+ var cmds = this.commands
+ , len = cmds.length
+ , name;
+
+ if (args.length) {
+ name = args[0];
+ if (this.listeners(name).length) {
+ this.emit(args.shift(), args, unknown);
+ } else {
+ this.emit('*', args);
+ }
+ } else {
+ outputHelpIfNecessary(this, unknown);
+
+ // If there were no args and we have unknown options,
+ // then they are extraneous and we need to error.
+ if (unknown.length > 0) {
+ this.unknownOption(unknown[0]);
+ }
+ }
+
+ return this;
+};
+
+/**
+ * Return an option matching `arg` if any.
+ *
+ * @param {String} arg
+ * @return {Option}
+ * @api private
+ */
+
+Command.prototype.optionFor = function(arg){
+ for (var i = 0, len = this.options.length; i < len; ++i) {
+ if (this.options[i].is(arg)) {
+ return this.options[i];
+ }
+ }
+};
+
+/**
+ * Parse options from `argv` returning `argv`
+ * void of these options.
+ *
+ * @param {Array} argv
+ * @return {Array}
+ * @api public
+ */
+
+Command.prototype.parseOptions = function(argv){
+ var args = []
+ , len = argv.length
+ , literal
+ , option
+ , arg;
+
+ var unknownOptions = [];
+
+ // parse options
+ for (var i = 0; i < len; ++i) {
+ arg = argv[i];
+
+ // literal args after --
+ if ('--' == arg) {
+ literal = true;
+ continue;
+ }
+
+ if (literal) {
+ args.push(arg);
+ continue;
+ }
+
+ // find matching Option
+ option = this.optionFor(arg);
+
+ // option is defined
+ if (option) {
+ // requires arg
+ if (option.required) {
+ arg = argv[++i];
+ if (null == arg) return this.optionMissingArgument(option);
+ if ('-' == arg[0]) return this.optionMissingArgument(option, arg);
+ this.emit(option.name(), arg);
+ // optional arg
+ } else if (option.optional) {
+ arg = argv[i+1];
+ if (null == arg || '-' == arg[0]) {
+ arg = null;
+ } else {
+ ++i;
+ }
+ this.emit(option.name(), arg);
+ // bool
+ } else {
+ this.emit(option.name());
+ }
+ continue;
+ }
+
+ // looks like an option
+ if (arg.length > 1 && '-' == arg[0]) {
+ unknownOptions.push(arg);
+
+ // If the next argument looks like it might be
+ // an argument for this option, we pass it on.
+ // If it isn't, then it'll simply be ignored
+ if (argv[i+1] && '-' != argv[i+1][0]) {
+ unknownOptions.push(argv[++i]);
+ }
+ continue;
+ }
+
+ // arg
+ args.push(arg);
+ }
+
+ return { args: args, unknown: unknownOptions };
+};
+
+/**
+ * Argument `name` is missing.
+ *
+ * @param {String} name
+ * @api private
+ */
+
+Command.prototype.missingArgument = function(name){
+ console.error();
+ console.error(" error: missing required argument `%s'", name);
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * `Option` is missing an argument, but received `flag` or nothing.
+ *
+ * @param {String} option
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.optionMissingArgument = function(option, flag){
+ console.error();
+ if (flag) {
+ console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
+ } else {
+ console.error(" error: option `%s' argument missing", option.flags);
+ }
+ console.error();
+ process.exit(1);
+};
+
+/**
+ * Unknown option `flag`.
+ *
+ * @param {String} flag
+ * @api private
+ */
+
+Command.prototype.unknownOption = function(flag){
+ console.error();
+ console.error(" error: unknown option `%s'", flag);
+ console.error();
+ process.exit(1);
+};
+
+
+/**
+ * Set the program version to `str`.
+ *
+ * This method auto-registers the "-V, --version" flag
+ * which will print the version number when passed.
+ *
+ * @param {String} str
+ * @param {String} flags
+ * @return {Command} for chaining
+ * @api public
+ */
+
+Command.prototype.version = function(str, flags){
+ if (0 == arguments.length) return this._version;
+ this._version = str;
+ flags = flags || '-V, --version';
+ this.option(flags, 'output the version number');
+ this.on('version', function(){
+ console.log(str);
+ process.exit(0);
+ });
+ return this;
+};
+
+/**
+ * Set the description `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.description = function(str){
+ if (0 == arguments.length) return this._description;
+ this._description = str;
+ return this;
+};
+
+/**
+ * Set / get the command usage `str`.
+ *
+ * @param {String} str
+ * @return {String|Command}
+ * @api public
+ */
+
+Command.prototype.usage = function(str){
+ var args = this.args.map(function(arg){
+ return arg.required
+ ? '<' + arg.name + '>'
+ : '[' + arg.name + ']';
+ });
+
+ var usage = '[options'
+ + (this.commands.length ? '] [command' : '')
+ + ']'
+ + (this.args.length ? ' ' + args : '');
+ if (0 == arguments.length) return this._usage || usage;
+ this._usage = str;
+
+ return this;
+};
+
+/**
+ * Return the largest option length.
+ *
+ * @return {Number}
+ * @api private
+ */
+
+Command.prototype.largestOptionLength = function(){
+ return this.options.reduce(function(max, option){
+ return Math.max(max, option.flags.length);
+ }, 0);
+};
+
+/**
+ * Return help for options.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.optionHelp = function(){
+ var width = this.largestOptionLength();
+
+ // Prepend the help information
+ return [pad('-h, --help', width) + ' ' + 'output usage information']
+ .concat(this.options.map(function(option){
+ return pad(option.flags, width)
+ + ' ' + option.description;
+ }))
+ .join('\n');
+};
+
+/**
+ * Return command help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.commandHelp = function(){
+ if (!this.commands.length) return '';
+ return [
+ ''
+ , ' Commands:'
+ , ''
+ , this.commands.map(function(cmd){
+ var args = cmd.args.map(function(arg){
+ return arg.required
+ ? '<' + arg.name + '>'
+ : '[' + arg.name + ']';
+ }).join(' ');
+
+ return cmd.name
+ + (cmd.options.length
+ ? ' [options]'
+ : '') + ' ' + args
+ + (cmd.description()
+ ? '\n' + cmd.description()
+ : '');
+ }).join('\n\n').replace(/^/gm, ' ')
+ , ''
+ ].join('\n');
+};
+
+/**
+ * Return program help documentation.
+ *
+ * @return {String}
+ * @api private
+ */
+
+Command.prototype.helpInformation = function(){
+ return [
+ ''
+ , ' Usage: ' + this.name + ' ' + this.usage()
+ , '' + this.commandHelp()
+ , ' Options:'
+ , ''
+ , '' + this.optionHelp().replace(/^/gm, ' ')
+ , ''
+ , ''
+ ].join('\n');
+};
+
+/**
+ * Prompt for a `Number`.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptForNumber = function(str, fn){
+ var self = this;
+ this.promptSingleLine(str, function parseNumber(val){
+ val = Number(val);
+ if (isNaN(val)) return self.promptSingleLine(str + '(must be a number) ', parseNumber);
+ fn(val);
+ });
+};
+
+/**
+ * Prompt for a `Date`.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptForDate = function(str, fn){
+ var self = this;
+ this.promptSingleLine(str, function parseDate(val){
+ val = new Date(val);
+ if (isNaN(val.getTime())) return self.promptSingleLine(str + '(must be a date) ', parseDate);
+ fn(val);
+ });
+};
+
+/**
+ * Single-line prompt.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptSingleLine = function(str, fn){
+ if ('function' == typeof arguments[2]) {
+ return this['promptFor' + (fn.name || fn)](str, arguments[2]);
+ }
+
+ process.stdout.write(str);
+ process.stdin.setEncoding('utf8');
+ process.stdin.once('data', function(val){
+ fn(val.trim());
+ }).resume();
+};
+
+/**
+ * Multi-line prompt.
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api private
+ */
+
+Command.prototype.promptMultiLine = function(str, fn){
+ var buf = [];
+ console.log(str);
+ process.stdin.setEncoding('utf8');
+ process.stdin.on('data', function(val){
+ if ('\n' == val || '\r\n' == val) {
+ process.stdin.removeAllListeners('data');
+ fn(buf.join('\n'));
+ } else {
+ buf.push(val.trimRight());
+ }
+ }).resume();
+};
+
+/**
+ * Prompt `str` and callback `fn(val)`
+ *
+ * Commander supports single-line and multi-line prompts.
+ * To issue a single-line prompt simply add white-space
+ * to the end of `str`, something like "name: ", whereas
+ * for a multi-line prompt omit this "description:".
+ *
+ *
+ * Examples:
+ *
+ * program.prompt('Username: ', function(name){
+ * console.log('hi %s', name);
+ * });
+ *
+ * program.prompt('Description:', function(desc){
+ * console.log('description was "%s"', desc.trim());
+ * });
+ *
+ * @param {String|Object} str
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.prompt = function(str, fn){
+ var self = this;
+
+ if ('string' == typeof str) {
+ if (/ $/.test(str)) return this.promptSingleLine.apply(this, arguments);
+ this.promptMultiLine(str, fn);
+ } else {
+ var keys = Object.keys(str)
+ , obj = {};
+
+ function next() {
+ var key = keys.shift()
+ , label = str[key];
+
+ if (!key) return fn(obj);
+ self.prompt(label, function(val){
+ obj[key] = val;
+ next();
+ });
+ }
+
+ next();
+ }
+};
+
+/**
+ * Prompt for password with `str`, `mask` char and callback `fn(val)`.
+ *
+ * The mask string defaults to '', aka no output is
+ * written while typing, you may want to use "*" etc.
+ *
+ * Examples:
+ *
+ * program.password('Password: ', function(pass){
+ * console.log('got "%s"', pass);
+ * process.stdin.destroy();
+ * });
+ *
+ * program.password('Password: ', '*', function(pass){
+ * console.log('got "%s"', pass);
+ * process.stdin.destroy();
+ * });
+ *
+ * @param {String} str
+ * @param {String} mask
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.password = function(str, mask, fn){
+ var self = this
+ , buf = '';
+
+ // default mask
+ if ('function' == typeof mask) {
+ fn = mask;
+ mask = '';
+ }
+
+ keypress(process.stdin);
+
+ function setRawMode(mode) {
+ if (process.stdin.setRawMode) {
+ process.stdin.setRawMode(mode);
+ } else {
+ tty.setRawMode(mode);
+ }
+ };
+ setRawMode(true);
+ process.stdout.write(str);
+
+ // keypress
+ process.stdin.on('keypress', function(c, key){
+ if (key && 'enter' == key.name) {
+ console.log();
+ process.stdin.pause();
+ process.stdin.removeAllListeners('keypress');
+ setRawMode(false);
+ if (!buf.trim().length) return self.password(str, mask, fn);
+ fn(buf);
+ return;
+ }
+
+ if (key && key.ctrl && 'c' == key.name) {
+ console.log('%s', buf);
+ process.exit();
+ }
+
+ process.stdout.write(mask);
+ buf += c;
+ }).resume();
+};
+
+/**
+ * Confirmation prompt with `str` and callback `fn(bool)`
+ *
+ * Examples:
+ *
+ * program.confirm('continue? ', function(ok){
+ * console.log(' got %j', ok);
+ * process.stdin.destroy();
+ * });
+ *
+ * @param {String} str
+ * @param {Function} fn
+ * @api public
+ */
+
+
+Command.prototype.confirm = function(str, fn, verbose){
+ var self = this;
+ this.prompt(str, function(ok){
+ if (!ok.trim()) {
+ if (!verbose) str += '(yes or no) ';
+ return self.confirm(str, fn, true);
+ }
+ fn(parseBool(ok));
+ });
+};
+
+/**
+ * Choice prompt with `list` of items and callback `fn(index, item)`
+ *
+ * Examples:
+ *
+ * var list = ['tobi', 'loki', 'jane', 'manny', 'luna'];
+ *
+ * console.log('Choose the coolest pet:');
+ * program.choose(list, function(i){
+ * console.log('you chose %d "%s"', i, list[i]);
+ * process.stdin.destroy();
+ * });
+ *
+ * @param {Array} list
+ * @param {Number|Function} index or fn
+ * @param {Function} fn
+ * @api public
+ */
+
+Command.prototype.choose = function(list, index, fn){
+ var self = this
+ , hasDefault = 'number' == typeof index;
+
+ if (!hasDefault) {
+ fn = index;
+ index = null;
+ }
+
+ list.forEach(function(item, i){
+ if (hasDefault && i == index) {
+ console.log('* %d) %s', i + 1, item);
+ } else {
+ console.log(' %d) %s', i + 1, item);
+ }
+ });
+
+ function again() {
+ self.prompt(' : ', function(val){
+ val = parseInt(val, 10) - 1;
+ if (hasDefault && isNaN(val)) val = index;
+
+ if (null == list[val]) {
+ again();
+ } else {
+ fn(val, list[val]);
+ }
+ });
+ }
+
+ again();
+};
+
+/**
+ * Camel-case the given `flag`
+ *
+ * @param {String} flag
+ * @return {String}
+ * @api private
+ */
+
+function camelcase(flag) {
+ return flag.split('-').reduce(function(str, word){
+ return str + word[0].toUpperCase() + word.slice(1);
+ });
+}
+
+/**
+ * Parse a boolean `str`.
+ *
+ * @param {String} str
+ * @return {Boolean}
+ * @api private
+ */
+
+function parseBool(str) {
+ return /^y|yes|ok|true$/i.test(str);
+}
+
+/**
+ * Pad `str` to `width`.
+ *
+ * @param {String} str
+ * @param {Number} width
+ * @return {String}
+ * @api private
+ */
+
+function pad(str, width) {
+ var len = Math.max(0, width - str.length);
+ return str + Array(len + 1).join(' ');
+}
+
+/**
+ * Output help information if necessary
+ *
+ * @param {Command} command to output help for
+ * @param {Array} array of options to search for -h or --help
+ * @api private
+ */
+
+function outputHelpIfNecessary(cmd, options) {
+ options = options || [];
+ for (var i = 0; i < options.length; i++) {
+ if (options[i] == '--help' || options[i] == '-h') {
+ process.stdout.write(cmd.helpInformation());
+ cmd.emit('--help');
+ process.exit(0);
+ }
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/commander/node_modules/keypress/README.md b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/README.md
new file mode 100644
index 0000000..a768e8f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/README.md
@@ -0,0 +1,101 @@
+keypress
+========
+### Make any Node ReadableStream emit "keypress" events
+
+
+Previous to Node `v0.8.x`, there was an undocumented `"keypress"` event that
+`process.stdin` would emit when it was a TTY. Some people discovered this hidden
+gem, and started using it in their own code.
+
+Now in Node `v0.8.x`, this `"keypress"` event does not get emitted by default,
+but rather only when it is being used in conjuction with the `readline` (or by
+extension, the `repl`) module.
+
+This module is the exact logic from the node `v0.8.x` releases ripped out into its
+own module.
+
+__Bonus:__ Now with mouse support!
+
+Installation
+------------
+
+Install with `npm`:
+
+``` bash
+$ npm install keypress
+```
+
+Or add it to the `"dependencies"` section of your _package.json_ file.
+
+
+Example
+-------
+
+#### Listening for "keypress" events
+
+``` js
+var keypress = require('keypress');
+
+// make `process.stdin` begin emitting "keypress" events
+keypress(process.stdin);
+
+// listen for the "keypress" event
+process.stdin.on('keypress', function (ch, key) {
+ console.log('got "keypress"', key);
+ if (key && key.ctrl && key.name == 'c') {
+ process.stdin.pause();
+ }
+});
+
+process.stdin.setRawMode(true);
+process.stdin.resume();
+```
+
+#### Listening for "mousepress" events
+
+``` js
+var keypress = require('keypress');
+
+// make `process.stdin` begin emitting "mousepress" (and "keypress") events
+keypress(process.stdin);
+
+// you must enable the mouse events before they will begin firing
+keypress.enableMouse(process.stdout);
+
+process.stdin.on('mousepress', function (info) {
+ console.log('got "mousepress" event at %d x %d', info.x, info.y);
+});
+
+process.on('exit', function () {
+ // disable mouse on exit, so that the state
+ // is back to normal for the terminal
+ keypress.disableMouse(process.stdout);
+});
+```
+
+
+License
+-------
+
+(The MIT License)
+
+Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/anvil.js/node_modules/commander/node_modules/keypress/index.js b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/index.js
new file mode 100644
index 0000000..c2ba488
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/index.js
@@ -0,0 +1,346 @@
+
+/**
+ * This module offers the internal "keypress" functionality from node-core's
+ * `readline` module, for your own programs and modules to use.
+ *
+ * Usage:
+ *
+ * require('keypress')(process.stdin);
+ *
+ * process.stdin.on('keypress', function (ch, key) {
+ * console.log(ch, key);
+ * if (key.ctrl && key.name == 'c') {
+ * process.stdin.pause();
+ * }
+ * });
+ * proces.stdin.resume();
+ */
+var exports = module.exports = keypress;
+
+exports.enableMouse = function (stream) {
+ stream.write('\x1b' +'[?1000h')
+}
+
+exports.disableMouse = function (stream) {
+ stream.write('\x1b' +'[?1000l')
+}
+
+
+/**
+ * accepts a readable Stream instance and makes it emit "keypress" events
+ */
+
+function keypress(stream) {
+ if (isEmittingKeypress(stream)) return;
+ stream._emitKeypress = true;
+
+ function onData(b) {
+ if (stream.listeners('keypress').length > 0) {
+ emitKey(stream, b);
+ } else {
+ // Nobody's watching anyway
+ stream.removeListener('data', onData);
+ stream.on('newListener', onNewListener);
+ }
+ }
+
+ function onNewListener(event) {
+ if (event == 'keypress') {
+ stream.on('data', onData);
+ stream.removeListener('newListener', onNewListener);
+ }
+ }
+
+ if (stream.listeners('keypress').length > 0) {
+ stream.on('data', onData);
+ } else {
+ stream.on('newListener', onNewListener);
+ }
+}
+
+/**
+ * Returns `true` if the stream is already emitting "keypress" events.
+ * `false` otherwise.
+ */
+
+function isEmittingKeypress(stream) {
+ var rtn = stream._emitKeypress;
+ if (!rtn) {
+ // hack: check for the v0.6.x "data" event
+ stream.listeners('data').forEach(function (l) {
+ if (l.name == 'onData' && /emitKey/.test(l.toString())) {
+ rtn = true;
+ stream._emitKeypress = true;
+ }
+ });
+ }
+ if (!rtn) {
+ // hack: check for the v0.6.x "newListener" event
+ stream.listeners('newListener').forEach(function (l) {
+ if (l.name == 'onNewListener' && /keypress/.test(l.toString())) {
+ rtn = true;
+ stream._emitKeypress = true;
+ }
+ });
+ }
+ return rtn;
+}
+
+
+/*
+ Some patterns seen in terminal key escape codes, derived from combos seen
+ at http://www.midnight-commander.org/browser/lib/tty/key.c
+
+ ESC letter
+ ESC [ letter
+ ESC [ modifier letter
+ ESC [ 1 ; modifier letter
+ ESC [ num char
+ ESC [ num ; modifier char
+ ESC O letter
+ ESC O modifier letter
+ ESC O 1 ; modifier letter
+ ESC N letter
+ ESC [ [ num ; modifier char
+ ESC [ [ 1 ; modifier letter
+ ESC ESC [ num char
+ ESC ESC O letter
+
+ - char is usually ~ but $ and ^ also happen with rxvt
+ - modifier is 1 +
+ (shift * 1) +
+ (left_alt * 2) +
+ (ctrl * 4) +
+ (right_alt * 8)
+ - two leading ESCs apparently mean the same as one leading ESC
+*/
+
+// Regexes used for ansi escape code splitting
+var metaKeyCodeRe = /^(?:\x1b)([a-zA-Z0-9])$/;
+var functionKeyCodeRe =
+ /^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/;
+
+function emitKey(stream, s) {
+ var ch,
+ key = {
+ name: undefined,
+ ctrl: false,
+ meta: false,
+ shift: false
+ },
+ parts;
+
+ if (Buffer.isBuffer(s)) {
+ if (s[0] > 127 && s[1] === undefined) {
+ s[0] -= 128;
+ s = '\x1b' + s.toString(stream.encoding || 'utf-8');
+ } else {
+ s = s.toString(stream.encoding || 'utf-8');
+ }
+ }
+
+ key.sequence = s;
+
+ if (s === '\r' || s === '\n') {
+ // enter
+ key.name = 'enter';
+
+ } else if (s === '\t') {
+ // tab
+ key.name = 'tab';
+
+ } else if (s === '\b' || s === '\x7f' ||
+ s === '\x1b\x7f' || s === '\x1b\b') {
+ // backspace or ctrl+h
+ key.name = 'backspace';
+ key.meta = (s.charAt(0) === '\x1b');
+
+ } else if (s === '\x1b' || s === '\x1b\x1b') {
+ // escape key
+ key.name = 'escape';
+ key.meta = (s.length === 2);
+
+ } else if (s === ' ' || s === '\x1b ') {
+ key.name = 'space';
+ key.meta = (s.length === 2);
+
+ } else if (s <= '\x1a') {
+ // ctrl+letter
+ key.name = String.fromCharCode(s.charCodeAt(0) + 'a'.charCodeAt(0) - 1);
+ key.ctrl = true;
+
+ } else if (s.length === 1 && s >= 'a' && s <= 'z') {
+ // lowercase letter
+ key.name = s;
+
+ } else if (s.length === 1 && s >= 'A' && s <= 'Z') {
+ // shift+letter
+ key.name = s.toLowerCase();
+ key.shift = true;
+
+ } else if (parts = metaKeyCodeRe.exec(s)) {
+ // meta+character key
+ key.name = parts[1].toLowerCase();
+ key.meta = true;
+ key.shift = /^[A-Z]$/.test(parts[1]);
+
+ } else if (parts = functionKeyCodeRe.exec(s)) {
+ // ansi escape sequence
+
+ // reassemble the key code leaving out leading \x1b's,
+ // the modifier key bitflag and any meaningless "1;" sequence
+ var code = (parts[1] || '') + (parts[2] || '') +
+ (parts[4] || '') + (parts[6] || ''),
+ modifier = (parts[3] || parts[5] || 1) - 1;
+
+ // Parse the key modifier
+ key.ctrl = !!(modifier & 4);
+ key.meta = !!(modifier & 10);
+ key.shift = !!(modifier & 1);
+ key.code = code;
+
+ // Parse the key itself
+ switch (code) {
+ /* xterm/gnome ESC O letter */
+ case 'OP': key.name = 'f1'; break;
+ case 'OQ': key.name = 'f2'; break;
+ case 'OR': key.name = 'f3'; break;
+ case 'OS': key.name = 'f4'; break;
+
+ /* xterm/rxvt ESC [ number ~ */
+ case '[11~': key.name = 'f1'; break;
+ case '[12~': key.name = 'f2'; break;
+ case '[13~': key.name = 'f3'; break;
+ case '[14~': key.name = 'f4'; break;
+
+ /* from Cygwin and used in libuv */
+ case '[[A': key.name = 'f1'; break;
+ case '[[B': key.name = 'f2'; break;
+ case '[[C': key.name = 'f3'; break;
+ case '[[D': key.name = 'f4'; break;
+ case '[[E': key.name = 'f5'; break;
+
+ /* common */
+ case '[15~': key.name = 'f5'; break;
+ case '[17~': key.name = 'f6'; break;
+ case '[18~': key.name = 'f7'; break;
+ case '[19~': key.name = 'f8'; break;
+ case '[20~': key.name = 'f9'; break;
+ case '[21~': key.name = 'f10'; break;
+ case '[23~': key.name = 'f11'; break;
+ case '[24~': key.name = 'f12'; break;
+
+ /* xterm ESC [ letter */
+ case '[A': key.name = 'up'; break;
+ case '[B': key.name = 'down'; break;
+ case '[C': key.name = 'right'; break;
+ case '[D': key.name = 'left'; break;
+ case '[E': key.name = 'clear'; break;
+ case '[F': key.name = 'end'; break;
+ case '[H': key.name = 'home'; break;
+
+ /* xterm/gnome ESC O letter */
+ case 'OA': key.name = 'up'; break;
+ case 'OB': key.name = 'down'; break;
+ case 'OC': key.name = 'right'; break;
+ case 'OD': key.name = 'left'; break;
+ case 'OE': key.name = 'clear'; break;
+ case 'OF': key.name = 'end'; break;
+ case 'OH': key.name = 'home'; break;
+
+ /* xterm/rxvt ESC [ number ~ */
+ case '[1~': key.name = 'home'; break;
+ case '[2~': key.name = 'insert'; break;
+ case '[3~': key.name = 'delete'; break;
+ case '[4~': key.name = 'end'; break;
+ case '[5~': key.name = 'pageup'; break;
+ case '[6~': key.name = 'pagedown'; break;
+
+ /* putty */
+ case '[[5~': key.name = 'pageup'; break;
+ case '[[6~': key.name = 'pagedown'; break;
+
+ /* rxvt */
+ case '[7~': key.name = 'home'; break;
+ case '[8~': key.name = 'end'; break;
+
+ /* rxvt keys with modifiers */
+ case '[a': key.name = 'up'; key.shift = true; break;
+ case '[b': key.name = 'down'; key.shift = true; break;
+ case '[c': key.name = 'right'; key.shift = true; break;
+ case '[d': key.name = 'left'; key.shift = true; break;
+ case '[e': key.name = 'clear'; key.shift = true; break;
+
+ case '[2$': key.name = 'insert'; key.shift = true; break;
+ case '[3$': key.name = 'delete'; key.shift = true; break;
+ case '[5$': key.name = 'pageup'; key.shift = true; break;
+ case '[6$': key.name = 'pagedown'; key.shift = true; break;
+ case '[7$': key.name = 'home'; key.shift = true; break;
+ case '[8$': key.name = 'end'; key.shift = true; break;
+
+ case 'Oa': key.name = 'up'; key.ctrl = true; break;
+ case 'Ob': key.name = 'down'; key.ctrl = true; break;
+ case 'Oc': key.name = 'right'; key.ctrl = true; break;
+ case 'Od': key.name = 'left'; key.ctrl = true; break;
+ case 'Oe': key.name = 'clear'; key.ctrl = true; break;
+
+ case '[2^': key.name = 'insert'; key.ctrl = true; break;
+ case '[3^': key.name = 'delete'; key.ctrl = true; break;
+ case '[5^': key.name = 'pageup'; key.ctrl = true; break;
+ case '[6^': key.name = 'pagedown'; key.ctrl = true; break;
+ case '[7^': key.name = 'home'; key.ctrl = true; break;
+ case '[8^': key.name = 'end'; key.ctrl = true; break;
+
+ /* misc. */
+ case '[Z': key.name = 'tab'; key.shift = true; break;
+ default: key.name = 'undefined'; break;
+
+ }
+ } else if (s.length > 1 && s[0] !== '\x1b') {
+ // Got a longer-than-one string of characters.
+ // Probably a paste, since it wasn't a control sequence.
+ Array.prototype.forEach.call(s, function(c) {
+ emitKey(stream, c);
+ });
+ return;
+ }
+
+ if (key.code == '[M') {
+ key.name = 'mouse';
+ var s = key.sequence;
+ var b = s.charCodeAt(3);
+ key.x = s.charCodeAt(4) - 040;
+ key.y = s.charCodeAt(5) - 040;
+
+ key.scroll = 0;
+
+ key.ctrl = !!(1<<4 & b);
+ key.meta = !!(1<<3 & b);
+ key.shift = !!(1<<2 & b);
+
+ key.release = (3 & b) === 3;
+
+ if (1<<6 & b) { //scroll
+ key.scroll = 1 & b ? 1 : -1;
+ }
+
+ if (!key.release && !key.scroll) {
+ key.button = b & 3;
+ }
+ }
+
+ // Don't emit a key if no name was found
+ if (key.name === undefined) {
+ key = undefined;
+ }
+
+ if (s.length === 1) {
+ ch = s;
+ }
+
+ if (key && key.name == 'mouse') {
+ stream.emit('mousepress', key)
+ } else if (key || ch) {
+ stream.emit('keypress', ch, key);
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/commander/node_modules/keypress/package.json b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/package.json
new file mode 100644
index 0000000..a527801
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/package.json
@@ -0,0 +1,20 @@
+{
+ "name": "keypress",
+ "version": "0.1.0",
+ "description": "Make any Node ReadableStream emit \"keypress\" events",
+ "author": "Nathan Rajlich (http://tootallnate.net)",
+ "main": "index.js",
+ "scripts": {
+ "test": "echo \"Error: no test specified\" && exit 1"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/TooTallNate/keypress.git"
+ },
+ "keywords": [
+ "keypress",
+ "readline",
+ "core"
+ ],
+ "license": "MIT"
+}
diff --git a/node_modules/anvil.js/node_modules/commander/node_modules/keypress/test.js b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/test.js
new file mode 100644
index 0000000..c3f61d7
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/node_modules/keypress/test.js
@@ -0,0 +1,28 @@
+
+var keypress = require('./')
+keypress(process.stdin)
+
+if (process.stdin.setRawMode)
+ process.stdin.setRawMode(true)
+else
+ require('tty').setRawMode(true)
+
+process.stdin.on('keypress', function (c, key) {
+ console.log(0, c, key)
+ if (key && key.ctrl && key.name == 'c') {
+ process.stdin.pause()
+ }
+})
+process.stdin.on('mousepress', function (mouse) {
+ console.log(mouse)
+})
+
+keypress.enableMouse(process.stdout)
+process.on('exit', function () {
+ //disable mouse on exit, so that the state is back to normal
+ //for the terminal.
+ keypress.disableMouse(process.stdout)
+})
+
+process.stdin.resume()
+
diff --git a/node_modules/anvil.js/node_modules/commander/package.json b/node_modules/anvil.js/node_modules/commander/package.json
new file mode 100644
index 0000000..d107b3b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/commander/package.json
@@ -0,0 +1,13 @@
+{
+ "name": "commander"
+ , "version": "1.0.2"
+ , "description": "the complete solution for node.js command-line programs"
+ , "keywords": ["command", "option", "parser", "prompt", "stdin"]
+ , "author": "TJ Holowaychuk "
+ , "repository": { "type": "git", "url": "https://github.com/visionmedia/commander.js.git" }
+ , "dependencies": { "keypress": "0.1.x"}
+ , "devDependencies": { "should": ">= 0.0.1" }
+ , "scripts": { "test": "make test" }
+ , "main": "index"
+ , "engines": { "node": ">= 0.6.x" }
+}
diff --git a/node_modules/anvil.js/node_modules/cssmin/README.textile b/node_modules/anvil.js/node_modules/cssmin/README.textile
new file mode 100644
index 0000000..86ab497
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/cssmin/README.textile
@@ -0,0 +1,28 @@
+h2. Description
+
+This is a node.js module that minimize CSS files (cssmin).
+It uses a port of YUICompressor made in JavaScript by Stoyan Stefanov based on Isaac Schlueter work.
+For more informations about YUICompressor -> https://github.com/yui/yuicompressor
+
+h2. Installation
+
+You can either download the plugin and unzip it into to your project folder or you can use npm to install the node-cssmin package.
+
+h2. Usage
+
+The module exports the cssmin function, so you can use it with :
+
+pre. var cssmin = require('cssmin').cssmin;
+
+The function cssmin takes two arguments :
+* input : the CSS content you want to minimize.
+* linebreakpos : the number of characters before the end of the line. If empty, the output will have only one line.
+
+Example :
+
+pre.. var puts = require('sys').puts,
+fs = require('fs'),
+cssmin = require('./cssmin').cssmin;
+var css = fs.readFileSync("/Any/Random/CSS/File.css", encoding='utf8');
+var min = cssmin(css);
+puts(min);
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/cssmin/cssmin.js b/node_modules/anvil.js/node_modules/cssmin/cssmin.js
new file mode 100755
index 0000000..892440d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/cssmin/cssmin.js
@@ -0,0 +1,238 @@
+/**
+ * node-cssmin
+ * A simple module for Node.js that minify CSS
+ * Author : Johan Bleuzen
+ */
+
+/**
+ * cssmin.js
+ * Author: Stoyan Stefanov - http://phpied.com/
+ * This is a JavaScript port of the CSS minification tool
+ * distributed with YUICompressor, itself a port
+ * of the cssmin utility by Isaac Schlueter - http://foohack.com/
+ * Permission is hereby granted to use the JavaScript version under the same
+ * conditions as the YUICompressor (original YUICompressor note below).
+ */
+
+/*
+* YUI Compressor
+* http://developer.yahoo.com/yui/compressor/
+* Author: Julien Lecomte - http://www.julienlecomte.net/
+* Copyright (c) 2011 Yahoo! Inc. All rights reserved.
+* The copyrights embodied in the content of this file are licensed
+* by Yahoo! Inc. under the BSD (revised) open source license.
+*/
+
+exports.cssmin = cssmin;
+
+function cssmin(css, linebreakpos) {
+
+ var startIndex = 0,
+ endIndex = 0,
+ i = 0, max = 0,
+ preservedTokens = [],
+ comments = [],
+ token = '',
+ totallen = css.length,
+ placeholder = '';
+
+ // collect all comment blocks...
+ while ((startIndex = css.indexOf("/*", startIndex)) >= 0) {
+ endIndex = css.indexOf("*/", startIndex + 2);
+ if (endIndex < 0) {
+ endIndex = totallen;
+ }
+ token = css.slice(startIndex + 2, endIndex);
+ comments.push(token);
+ css = css.slice(0, startIndex + 2) + "___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + (comments.length - 1) + "___" + css.slice(endIndex);
+ startIndex += 2;
+ }
+
+ // preserve strings so their content doesn't get accidentally minified
+ css = css.replace(/("([^\\"]|\\.|\\)*")|('([^\\']|\\.|\\)*')/g, function (match) {
+ var i, max, quote = match.substring(0, 1);
+
+ match = match.slice(1, -1);
+
+ // maybe the string contains a comment-like substring?
+ // one, maybe more? put'em back then
+ if (match.indexOf("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_") >= 0) {
+ for (i = 0, max = comments.length; i < max; i = i + 1) {
+ match = match.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", comments[i]);
+ }
+ }
+
+ // minify alpha opacity in filter strings
+ match = match.replace(/progid:DXImageTransform\.Microsoft\.Alpha\(Opacity=/gi, "alpha(opacity=");
+
+ preservedTokens.push(match);
+ return quote + "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___" + quote;
+ });
+
+ // strings are safe, now wrestle the comments
+ for (i = 0, max = comments.length; i < max; i = i + 1) {
+
+ token = comments[i];
+ placeholder = "___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___";
+
+ // ! in the first position of the comment means preserve
+ // so push to the preserved tokens keeping the !
+ if (token.charAt(0) === "!") {
+ preservedTokens.push(token);
+ css = css.replace(placeholder, "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
+ continue;
+ }
+
+ // \ in the last position looks like hack for Mac/IE5
+ // shorten that to /*\*/ and the next one to /**/
+ if (token.charAt(token.length - 1) === "\\") {
+ preservedTokens.push("\\");
+ css = css.replace(placeholder, "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
+ i = i + 1; // attn: advancing the loop
+ preservedTokens.push("");
+ css = css.replace("___YUICSSMIN_PRESERVE_CANDIDATE_COMMENT_" + i + "___", "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
+ continue;
+ }
+
+ // keep empty comments after child selectors (IE7 hack)
+ // e.g. html >/**/ body
+ if (token.length === 0) {
+ startIndex = css.indexOf(placeholder);
+ if (startIndex > 2) {
+ if (css.charAt(startIndex - 3) === '>') {
+ preservedTokens.push("");
+ css = css.replace(placeholder, "___YUICSSMIN_PRESERVED_TOKEN_" + (preservedTokens.length - 1) + "___");
+ }
+ }
+ }
+
+ // in all other cases kill the comment
+ css = css.replace("/*" + placeholder + "*/", "");
+ }
+
+
+ // Normalize all whitespace strings to single spaces. Easier to work with that way.
+ css = css.replace(/\s+/g, " ");
+
+ // Remove the spaces before the things that should not have spaces before them.
+ // But, be careful not to turn "p :link {...}" into "p:link{...}"
+ // Swap out any pseudo-class colons with the token, and then swap back.
+ css = css.replace(/(^|\})(([^\{:])+:)+([^\{]*\{)/g, function (m) {
+ return m.replace(":", "___YUICSSMIN_PSEUDOCLASSCOLON___");
+ });
+ css = css.replace(/\s+([!{};:>+\(\)\],])/g, '$1');
+ css = css.replace(/___YUICSSMIN_PSEUDOCLASSCOLON___/g, ":");
+
+ // retain space for special IE6 cases
+ css = css.replace(/:first-(line|letter)(\{|,)/g, ":first-$1 $2");
+
+ // no space after the end of a preserved comment
+ css = css.replace(/\*\/ /g, '*/');
+
+
+ // If there is a @charset, then only allow one, and push to the top of the file.
+ css = css.replace(/^(.*)(@charset "[^"]*";)/gi, '$2$1');
+ css = css.replace(/^(\s*@charset [^;]+;\s*)+/gi, '$1');
+
+ // Put the space back in some cases, to support stuff like
+ // @media screen and (-webkit-min-device-pixel-ratio:0){
+ css = css.replace(/\band\(/gi, "and (");
+
+
+ // Remove the spaces after the things that should not have spaces after them.
+ css = css.replace(/([!{}:;>+\(\[,])\s+/g, '$1');
+
+ // remove unnecessary semicolons
+ css = css.replace(/;+\}/g, "}");
+
+ // Replace 0(px,em,%) with 0.
+ css = css.replace(/([\s:])(0)(px|em|%|in|cm|mm|pc|pt|ex)/gi, "$1$2");
+
+ // Replace 0 0 0 0; with 0.
+ css = css.replace(/:0 0 0 0(;|\})/g, ":0$1");
+ css = css.replace(/:0 0 0(;|\})/g, ":0$1");
+ css = css.replace(/:0 0(;|\})/g, ":0$1");
+
+ // Replace background-position:0; with background-position:0 0;
+ // same for transform-origin
+ css = css.replace(/(background-position|transform-origin|webkit-transform-origin|moz-transform-origin|o-transform-origin|ms-transform-origin):0(;|\})/gi, function(all, prop, tail) {
+ return prop.toLowerCase() + ":0 0" + tail;
+ });
+
+ // Replace 0.6 to .6, but only when preceded by : or a white-space
+ css = css.replace(/(:|\s)0+\.(\d+)/g, "$1.$2");
+
+ // Shorten colors from rgb(51,102,153) to #336699
+ // This makes it more likely that it'll get further compressed in the next step.
+ css = css.replace(/rgb\s*\(\s*([0-9,\s]+)\s*\)/gi, function () {
+ var i, rgbcolors = arguments[1].split(',');
+ for (i = 0; i < rgbcolors.length; i = i + 1) {
+ rgbcolors[i] = parseInt(rgbcolors[i], 10).toString(16);
+ if (rgbcolors[i].length === 1) {
+ rgbcolors[i] = '0' + rgbcolors[i];
+ }
+ }
+ return '#' + rgbcolors.join('');
+ });
+
+
+ // Shorten colors from #AABBCC to #ABC. Note that we want to make sure
+ // the color is not preceded by either ", " or =. Indeed, the property
+ // filter: chroma(color="#FFFFFF");
+ // would become
+ // filter: chroma(color="#FFF");
+ // which makes the filter break in IE.
+ css = css.replace(/([^"'=\s])(\s*)#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])/gi, function () {
+ var group = arguments;
+ if (
+ group[3].toLowerCase() === group[4].toLowerCase() &&
+ group[5].toLowerCase() === group[6].toLowerCase() &&
+ group[7].toLowerCase() === group[8].toLowerCase()
+ ) {
+ return (group[1] + group[2] + '#' + group[3] + group[5] + group[7]).toLowerCase();
+ } else {
+ return group[0].toLowerCase();
+ }
+ });
+
+ // border: none -> border:0
+ css = css.replace(/(border|border-top|border-right|border-bottom|border-right|outline|background):none(;|\})/gi, function(all, prop, tail) {
+ return prop.toLowerCase() + ":0" + tail;
+ });
+
+ // shorter opacity IE filter
+ css = css.replace(/progid:DXImageTransform\.Microsoft\.Alpha\(Opacity=/gi, "alpha(opacity=");
+
+ // Remove empty rules.
+ css = css.replace(/[^\};\{\/]+\{\}/g, "");
+
+ if (linebreakpos >= 0) {
+ // Some source control tools don't like it when files containing lines longer
+ // than, say 8000 characters, are checked in. The linebreak option is used in
+ // that case to split long lines after a specific column.
+ startIndex = 0;
+ i = 0;
+ while (i < css.length) {
+ i = i + 1;
+ if (css[i - 1] === '}' && i - startIndex > linebreakpos) {
+ css = css.slice(0, i) + '\n' + css.slice(i);
+ startIndex = i;
+ }
+ }
+ }
+
+ // Replace multiple semi-colons in a row by a single one
+ // See SF bug #1980989
+ css = css.replace(/;;+/g, ";");
+
+ // restore preserved comments and strings
+ for (i = 0, max = preservedTokens.length; i < max; i = i + 1) {
+ css = css.replace("___YUICSSMIN_PRESERVED_TOKEN_" + i + "___", preservedTokens[i]);
+ }
+
+ // Trim the final string (for any leading or trailing white spaces)
+ css = css.replace(/^\s+|\s+$/g, "");
+
+ return css;
+
+};
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/cssmin/package.json b/node_modules/anvil.js/node_modules/cssmin/package.json
new file mode 100755
index 0000000..dedb636
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/cssmin/package.json
@@ -0,0 +1,17 @@
+{
+ "name": "cssmin",
+ "version": "0.3.1",
+ "description": "A simple CSS minifier that uses a port of YUICompressor in JS",
+ "main": "cssmin",
+ "bin": {
+ "cssmin": "./bin/cssmin"
+ },
+ "author" : {
+ "name" : "Johan Bleuzen",
+ "url" : "http://blog.johanbleuzen.fr"
+ },
+ "repository" : {
+ "type" : "git",
+ "url" : "http://github.com/jbleuzen/node-cssmin"
+ }
+}
diff --git a/node_modules/anvil.js/node_modules/haml/CHANGELOG.markdown b/node_modules/anvil.js/node_modules/haml/CHANGELOG.markdown
new file mode 100644
index 0000000..9eefd2c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/CHANGELOG.markdown
@@ -0,0 +1,69 @@
+# HAML-JS Changelog
+
+- **v0.4.0**
+ Breaking Changes:
+ Made interpolation #{} escaped by default. Use !{} for unsafe interpolation.
+
+ New Features:
+ * Optionally exclude `html_escape` function definition from every template -- provide your own escape function invocation string ("MyApp.htmlEscape") and it will be used instead, dramatically shrinking template sizes.
+ * Optionally escape all output of `=` by default. Set the escapeHtmlByDefault configuration variable.
+ * New never-escaped `!=` recommended for when you **want** to output strings that contain html.
+ * More test coverage for interpolation and escaping
+
+ Bugfix: "inside" whitespace was not concatenating properly in some cases.
+
+- **v0.3.0**
+ New features:
+ * Comments -- Haml comments, HTML comments, JavaScript Comments
+ * Raw JS -- this lets you use if/else, switch, try/catch, et cetera
+ in your views (use cautiously!)
+ * Whitespace insertion -- Now, you can insert whitespace in and/or
+ around tags using < and >. Check the docs.
+ * Blank templates are now valid!
+ * More test coverage
+
+- **v0.2.5** - *2010-05-06* - NPM support
+
+ Fixed to work with Node Package Manager
+
+- **v0.2.4** - *2010-04-16* - Bug fixes, XML support
+
+ Allow for commas in calls to helpers in attributes. Also make haml more XML friendly.
+
+- **v0.2.3** - *2010-04-10* - Bug fixes
+
+ Fixed an issue where "content" html attributes got munched. (This broke meta tags)
+
+- **v0.2.2** - *2010-04-05* - Bug fixes
+
+ Fixed two issues where the parser incorrectly parsed blank lines and extra spaces in attribute blocks.
+
+- **v0.2.1** - *2010-04-01* - Minor speed tweak
+
+ `Haml()` now caches the eval step so that there is no eval in executing a compiled template. This should make things a bit faster.
+
+- **v0.2.0** - *2010-03-31* - Function based API, Safe whitespace, Code interpolation.
+
+ At the request of some users, I've removed the new insertion into the generated html. This means that most html will be on one long line, but as an added advantage you won't have that extra whitespace next to your anchor labels messing up your visual display.
+
+ Also I added string interpolation to every place I could fit it. This means you can do crazy stuff like interpolate within strings in attributes, in the body on plain text sections, and of course in javascript and css plugin blocks.
+
+ In order to tame the API, I deprecated the four old interfaces `compile`, `optimize`, `execute` and `render`. The new API is that the Haml/exports object itself is now a function that takes in haml text and outputs a compiled, optimized, ready to execute function.
+
+- **0.1.2** - *2010-02-03* - Bug fixes, plugin aliases, CommonJS, and more...
+
+ This is a big release with many improvements. First haml-js is now a CommonJS module and is in the Tusk repository. Thanks to Tom Robinson for helping with that. Some of the plugins got aliases for people who didn't like the original name. For example, you can now do `:javascript` instead of `:script` and `:for` instead of `:each`. There were many bug fixes now that the code is starting to be actually used by myself and others.
+
+- **0.1.1** - *2010-01-09* - Add :css and :script plugins
+
+ Added two quick plugins that make working with javascript and css much easier.
+
+ - **0.1.0** - *2010-01-09* - Complete Rewrite
+
+ Rewrote the compiler to be recursive and compile to JavaScript code instead of JSON data structures. This fixes all the outstanding bugs and simplifies the code. Pending is restoring the `:script` and `:css` plugins.
+
+ - **0.0.1** - *2009-12-16* - Initial release
+
+ Change how haml is packaged. It is a pure JS function with no node dependencies. There is an exports hook for commonjs usability. It's now the responsibility of the script user to acquire the haml text.
+
+
diff --git a/node_modules/anvil.js/node_modules/haml/LICENSE b/node_modules/anvil.js/node_modules/haml/LICENSE
new file mode 100644
index 0000000..ad2a669
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2009 Tim Caswell
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/anvil.js/node_modules/haml/README.markdown b/node_modules/anvil.js/node_modules/haml/README.markdown
new file mode 100644
index 0000000..00a84e4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/README.markdown
@@ -0,0 +1,317 @@
+# haml-js - Server side templating language for JavaScript
+
+Ever wanted to use the excellent HAML syntax on a javascript project? Me too, so I made one!. This has most of the same functionality as the traditional [haml][].
+
+## About the language
+
+Here is the first example(with a little extra added) from the [haml][] site converted to haml-js:
+
+**haml-js**
+
+ !!! XML
+ !!! strict
+ %html{ xmlns: "http://www.w3.org/1999/xhtml" }
+ %head
+ %title Sample haml template
+ %body
+ .profile
+ .left.column
+ #date= print_date()
+ #address= current_user.address
+ .right.column
+ #email= current_user.email
+ #bio= current_user.bio
+
+**html**
+
+
+
+ Sample haml template
+ January 1, 2009
+
Richardson, TX
+
tim@creationix.com
+
Experienced software professional...
+
+
+Note that this works almost the same as ruby's [haml][], but doesn't pretty print the html. This would greatly slow down and complicate the code. If you really want pretty printed html, then I suggest writing one using the xml parser library and process the resulting html..
+
+## API
+
+### Haml(haml) -> template(locals) -> html
+
+This is the new (as of 0.2.0) way to generate haml templates. A haml template is a live function that takes in "this" context and a "locals" variable. This compile step takes a few milliseconds to complete so it should be done at startup and the resulting function should be cached. Then to use the template function you simply call it with the desired local variables and it will output html at blazing speeds (we're talking millions per second on my 13" MBP)
+
+Compile and store a template:
+
+ var main = Haml(main_haml);
+
+Then use it whenever you need a new version:
+
+ main({name: "Tim", age: 28});
+
+That's it. Haml templating made easy!
+
+If you want to store the generated javascript to a file to skip the compile step later on you can either decompile the template function or use the `compile` and `optimize` advanced functions directly.
+
+
+### Haml.compile(text) -> JavaScript compiled template
+
+Given a haml template as raw text, this compiles it to a javascript expression
+that can later be eval'ed to get the final HTML.
+
+The following input:
+
+ #home
+ = title
+ %ul.menu
+ %li Go Home
+ %li Go Back
+
+Produces the following JavaScript expression:
+
+ "" +
+ title +
+ "\n" +
+ "" +
+ "
"
+
+### Haml.optimize(js) -> optimized JavaScript expression
+
+Takes the output of compile and optimizes it to run faster with the tradeoff of longer compile time. This is useful for framework developers wanting to use haml in their framework and want to cache the compiled templates for performance.
+
+With the previous input it outputs:
+
+ "" +
+ title +
+ "\n
"
+
+Notice how congruent static strings are merged into a single string literal when possible.
+
+### Haml.execute(js, context, locals) -> Executes a compiled template
+
+Context is the value of `this` in the template, and locals is a hash of local variables.
+
+### Haml.render(text, options) -> html text
+
+This is a convenience function that compiles and executes to html in one shot. Most casual users will want to use this function exclusively.
+
+The `text` parameter is the haml source already read from a file.
+
+The three recognized `options` are:
+
+ - **context**: This is the `this` context within the haml template.
+ - **locals**: This is an object that's used in the `with` scope. Basically it creates local variables and function accessible to the haml template.
+ - **optimize**: This is a flag to tell the compiler to use the extra optimizations.
+
+See [test.js][] for an example usage of Haml.render
+
+## Executable JavaScript (not output)
+
+New in version 0.2.6 is the ability to embed javascript in your template function. This lets you do variable assignments, if/else, switch statements, and even define functions. In Haml.js, execution blocks begin with a `-` and define a raw js block. This behaves slightly differently from Ruby's Haml. The advantage is that you can easily have multi-line executable blocks and comments, but the downside is that that you have to "outdent" the haml if you want to output from within a javascript block.
+
+Simple example:
+
+ - var area = 0.5 * length * height
+ .area= area
+
+Multi-line example:
+
+ - var obj = {
+ area: 0.5 * b * h,
+ r: opposite / adjacent
+ }
+ .triangle-details Area is: #{area} and the ratio is: #{r}
+
+"Outdent" the haml in a javascript block (the "goodbye" div is not rendered!)
+
+ .conditional
+ - var a = "strings are truthy"
+ - if(a){
+ .hello
+ - } else{
+ .goodbye
+ - }
+
+You can even define functions:
+
+ - function b(item){
+ .item
+ %b= item
+ %span.length= item.length
+ - }
+ - b("Hi")
+ - b("World")
+
+This outputs:
+
+ Hi 2
World 5
+
+Please see test/raw_complex.haml for more details and examples.
+
+## Comments
+
+Comments that will **not** appear in the compiled JS function nor the output begin with `-#`
+
+ -# This is a comment
+ - # This is a syntax error because of the extraneous space between the - and #.
+
+If you want to have comments that will be in the compiled JS function but *NOT* the final HTML output:
+
+ - /*
+ here we can have a comment that will not be output. Since executable-JS is block-level,
+ we can have as much comment as we want, and it will not be output to html */
+
+If you want an HTML comment that **WILL** be in the final HTML, begin with `/`
+
+## Whitespace
+
+By default, Haml.js **has no whitespace between tags**. In this way, Haml.js is the opposite of Haml in Ruby. You can insert whitespace around or inside tags with `>` and `<`, respectively.
+
+Most commonly, you want to have an `a` or `span` with whitespace around it:
+
+ Download the file
+ %a(href="/home")> here
+ now.
+
+Will produce:
+
+ Download the file here now.
+
+You can also combine them if you want to have whitespace around and inside your tag.
+
+ %span<> This will have space in and around it.
+ %span>< This will, too.
+ %span><= "also works with code".toUpperCase()
+
+Please see `test/whitespace.haml` for more examples.
+
+## Code interpolation
+
+As of version 0.2.0 there is string interpolation throughout. This means that the body of regular text areas can have embedded code. This is true for attributes and the contents of plugins like javascript and markdown also. If you notice an area that doesn't support interpolation and it should then send me a note and I'll add it.
+
+For interpolation, you may use `#{}` for escaped interpolation or `!{}` for unsafe interpolation.
+
+## Html Escaping / Santizer
+
+You probably don't want to put unescaped user input right into your html. http://xkcd.com/327/ HTML/XSS sanitization is the new "Bobby Tables."
+
+Let's assume we have a malicious username: `name = ""`
+
+Always unsafe:
+
+ %span!= name
+
+
+
+Always safe:
+
+ %span&= name
+ <script>...</script>
+
+Sometimes safe:
+
+ %span= name
+
+The behavior of `=` depends on the setting of the `escapeHtmlByDefault` configuration variable. To make `=` safe, call Haml like this:
+
+ Haml(src, {escapeHtmlByDefault: true})
+
+## Plugins
+
+There are plugins in the parser for things like inline script tags, css blocks, and support for if statements and for loops.
+
+### `:if` statements
+
+`if` statements evaluate a condition for truthiness (as opposed to a strict comparison to `true`) and includes the content inside the block if it's truthy.
+
+ :if todolist.length > 20
+ %p Oh my, you are a busy fellow!
+
+### `:each` loops
+
+`:each` loops allow you to loop over a collection including a block of content once for each item. You need to what variable to pull the data from and where to put the index and value. The index variable is optional and defaults to `__key__`.
+
+Here is an example over a simple array.
+
+ %ul.todolist
+ :each item in todolist
+ %li= item.description
+
+You can loop over the keys and values of objects too (Note the inner `:each` loop)
+
+ :each item in data
+ :if item.age < 100
+ %dl
+ :each name, value in item
+ %dt&= name
+ %dd&= value
+
+### `:css` and `:script` helpers.
+
+It's easy to embed script and css tags in an haml document. Note that both `:script` and `:javascript` will work.
+
+ %head
+ :javascript
+ function greet(message) {
+ alert("Message from MCP: " + message);
+ }
+ %title Script and Css test
+ :css
+ body {
+ color: pink;
+ }
+ %body{ onload: "greet(\"I'm Pink\")" } COLOR ME PINK
+
+This compiles to the following HTML:
+
+
+
+ Script and Css test
+
+
+ COLOR ME PINK
+
+
+
+## Custom Escaper
+
+By default, Haml(src) returns a completely self-sufficient function, including a nested `html_escape` function. However, repeating the html_escape function definition in each of your templates is going to use more size than necessary. So, you may pass the name of a custom escaper in an optional config variable.
+
+ Haml(src, {customEscape: "MyApp.esc"})
+
+Then, the output template function definition will call `MyApp.esc(string)` and will omit the `html_escape` function definition. Haml.html_escape exposes the default escape function. If you are going to render your templates in the same context where you compile them (for instance, if you are only rendering them on the server side,) it might make sense to use `Haml(src, {customEscape: "Haml.html_escape"})`
+
+## Get Involved
+
+If you want to use this project and something is missing then send me a message. I'm very busy and have several open source projects I manage. I'll contribute to this project as I have time, but if there is more interest for some particular aspect, I'll work on it a lot faster. Also you're welcome to fork this project and send me patches/pull-requests.
+
+## About Performance
+
+The haml compiler isn't built for speed, it's built for maintainability. The actual generated templates, however are blazing fast. I benchmarked them with over 65 million renders per second on a small (20 line) template with some dynamic data on my laptop. Compare this to the 629 compiles per second I got out of the compiler. The idea is that you pre-compile your templates and reuse them on every request. While 629 per second is nothing compared to 65 million, that still means that your server with over 600 different views can boot up in about a second. I think that's fine for something that only happens every few weeks.
+
+## License
+
+Haml-js is [licensed][] under the [MIT license][].
+
+[MIT license]: http://creativecommons.org/licenses/MIT/
+[licensed]: http://github.com/creationix/haml-js/blob/master/LICENSE
+[jquery-haml]: http://github.com/creationix/jquery-haml
+[haml]: http://haml-lang.com/
+[test.js]: http://github.com/creationix/haml-js/blob/master/test/test.js
diff --git a/node_modules/anvil.js/node_modules/haml/lib/cli.js b/node_modules/anvil.js/node_modules/haml/lib/cli.js
new file mode 100755
index 0000000..f6cd6d0
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/lib/cli.js
@@ -0,0 +1,36 @@
+#!/usr/bin/env node
+
+var Haml = require('./haml');
+
+var readUntilEnd = function(stream, callback) {
+ var chunks = [];
+ stream.on('data', function(chunk) {
+ chunks.push(chunk.toString('utf-8'));
+ });
+ stream.on('end', function() {
+ callback(chunks.join(''));
+ });
+}
+
+readUntilEnd(process.openStdin(), function(haml) {
+ var result;
+
+ if (haml.length == 0) {
+ console.log("Error: HAML expected on stdin")
+ process.exit(1);
+ }
+
+ // --html
+ if ((process.argv.length >= 3) && (process.argv[2] == '--html')) {
+ result = Haml.render(haml);
+ }
+
+ // --js
+ else {
+ result = Haml.optimize(
+ Haml.compile(
+ haml));
+ }
+
+ process.stdout.write(result);
+});
diff --git a/node_modules/anvil.js/node_modules/haml/lib/haml.js b/node_modules/anvil.js/node_modules/haml/lib/haml.js
new file mode 100755
index 0000000..ccebd4e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/lib/haml.js
@@ -0,0 +1,651 @@
+var Haml;
+
+(function () {
+
+ var matchers, self_close_tags, embedder, forceXML, escaperName, escapeHtmlByDefault;
+
+ function html_escape(text) {
+ return (text + "").
+ replace(/&/g, "&").
+ replace(//g, ">").
+ replace(/\"/g, """);
+ }
+
+ function render_attribs(attribs) {
+ var key, value, result = [];
+ for (key in attribs) {
+ if (key !== '_content' && attribs.hasOwnProperty(key)) {
+ switch (attribs[key]) {
+ case 'undefined':
+ case 'false':
+ case 'null':
+ case '""':
+ break;
+ default:
+ try {
+ value = JSON.parse("[" + attribs[key] +"]")[0];
+ if (value === true) {
+ value = key;
+ } else if (typeof value === 'string' && embedder.test(value)) {
+ value = '" +\n' + parse_interpol(html_escape(value)) + ' +\n"';
+ } else {
+ value = html_escape(value);
+ }
+ result.push(" " + key + '=\\"' + value + '\\"');
+ } catch (e) {
+ result.push(" " + key + '=\\"" + '+escaperName+'(' + attribs[key] + ') + "\\"');
+ }
+ }
+ }
+ }
+ return result.join("");
+ }
+
+ // Parse the attribute block using a state machine
+ function parse_attribs(line) {
+ var attributes = {},
+ l = line.length,
+ i, c,
+ count = 1,
+ quote = false,
+ skip = false,
+ open, close, joiner, seperator,
+ pair = {
+ start: 1,
+ middle: null,
+ end: null
+ };
+
+ if (!(l > 0 && (line.charAt(0) === '{' || line.charAt(0) === '('))) {
+ return {
+ _content: line[0] === ' ' ? line.substr(1, l) : line
+ };
+ }
+ open = line.charAt(0);
+ close = (open === '{') ? '}' : ')';
+ joiner = (open === '{') ? ':' : '=';
+ seperator = (open === '{') ? ',' : ' ';
+
+ function process_pair() {
+ if (typeof pair.start === 'number' &&
+ typeof pair.middle === 'number' &&
+ typeof pair.end === 'number') {
+ var key = line.substr(pair.start, pair.middle - pair.start).trim(),
+ value = line.substr(pair.middle + 1, pair.end - pair.middle - 1).trim();
+ attributes[key] = value;
+ }
+ pair = {
+ start: null,
+ middle: null,
+ end: null
+ };
+ }
+
+ for (i = 1; count > 0; i += 1) {
+
+ // If we reach the end of the line, then there is a problem
+ if (i > l) {
+ throw "Malformed attribute block";
+ }
+
+ c = line.charAt(i);
+ if (skip) {
+ skip = false;
+ } else {
+ if (quote) {
+ if (c === '\\') {
+ skip = true;
+ }
+ if (c === quote) {
+ quote = false;
+ }
+ } else {
+ if (c === '"' || c === "'") {
+ quote = c;
+ }
+
+ if (count === 1) {
+ if (c === joiner) {
+ pair.middle = i;
+ }
+ if (c === seperator || c === close) {
+ pair.end = i;
+ process_pair();
+ if (c === seperator) {
+ pair.start = i + 1;
+ }
+ }
+ }
+
+ if (c === open || c === "(") {
+ count += 1;
+ }
+ if (c === close || (count > 1 && c === ")")) {
+ count -= 1;
+ }
+ }
+ }
+ }
+ attributes._content = line.substr(i, line.length);
+ return attributes;
+ }
+
+ // Split interpolated strings into an array of literals and code fragments.
+ function parse_interpol(value) {
+ var items = [],
+ pos = 0,
+ next = 0,
+ match;
+ while (true) {
+ // Match up to embedded string
+ next = value.substr(pos).search(embedder);
+ if (next < 0) {
+ if (pos < value.length) {
+ items.push(JSON.stringify(value.substr(pos)));
+ }
+ break;
+ }
+ items.push(JSON.stringify(value.substr(pos, next)));
+ pos += next;
+
+ // Match embedded string
+ match = value.substr(pos).match(embedder);
+ next = match[0].length;
+ if (next < 0) { break; }
+ if(match[1] === "#"){
+ items.push(escaperName+"("+(match[2] || match[3])+")");
+ }else{
+ //unsafe!!!
+ items.push(match[2] || match[3]);
+ }
+
+ pos += next;
+ }
+ return items.filter(function (part) { return part && part.length > 0}).join(" +\n");
+ }
+
+ // Used to find embedded code in interpolated strings.
+ embedder = /([#!])\{([^}]*)\}/;
+
+ self_close_tags = ["meta", "img", "link", "br", "hr", "input", "area", "base"];
+
+ // All matchers' regexps should capture leading whitespace in first capture
+ // and trailing content in last capture
+ matchers = [
+ // html tags
+ {
+ name: "html tags",
+ regexp: /^(\s*)((?:[.#%][a-z_\-][a-z0-9_:\-]*)+)(.*)$/i,
+ process: function () {
+ var line_beginning, tag, classes, ids, attribs, content, whitespaceSpecifier, whitespace={}, output;
+ line_beginning = this.matches[2];
+ classes = line_beginning.match(/\.([a-z_\-][a-z0-9_\-]*)/gi);
+ ids = line_beginning.match(/\#([a-z_\-][a-z0-9_\-]*)/gi);
+ tag = line_beginning.match(/\%([a-z_\-][a-z0-9_:\-]*)/gi);
+
+ // Default to tag
+ tag = tag ? tag[0].substr(1, tag[0].length) : 'div';
+
+ attribs = this.matches[3];
+ if (attribs) {
+ attribs = parse_attribs(attribs);
+ if (attribs._content) {
+ var leader0 = attribs._content.charAt(0),
+ leader1 = attribs._content.charAt(1),
+ leaderLength = 0;
+
+ if(leader0 == "<"){
+ leaderLength++;
+ whitespace.inside = true;
+ if(leader1 == ">"){
+ leaderLength++;
+ whitespace.around = true;
+ }
+ }else if(leader0 == ">"){
+ leaderLength++;
+ whitespace.around = true;
+ if(leader1 == "<"){
+ leaderLength++;
+ whitespace.inside = true;
+ }
+ }
+ attribs._content = attribs._content.substr(leaderLength);
+ //once we've identified the tag and its attributes, the rest is content.
+ // this is currently trimmed for neatness.
+ this.contents.unshift(attribs._content.trim());
+ delete(attribs._content);
+ }
+ } else {
+ attribs = {};
+ }
+
+ if (classes) {
+ classes = classes.map(function (klass) {
+ return klass.substr(1, klass.length);
+ }).join(' ');
+ if (attribs['class']) {
+ try {
+ attribs['class'] = JSON.stringify(classes + " " + JSON.parse(attribs['class']));
+ } catch (e) {
+ attribs['class'] = JSON.stringify(classes + " ") + " + " + attribs['class'];
+ }
+ } else {
+ attribs['class'] = JSON.stringify(classes);
+ }
+ }
+ if (ids) {
+ ids = ids.map(function (id) {
+ return id.substr(1, id.length);
+ }).join(' ');
+ if (attribs.id) {
+ attribs.id = JSON.stringify(ids + " ") + attribs.id;
+ } else {
+ attribs.id = JSON.stringify(ids);
+ }
+ }
+
+ attribs = render_attribs(attribs);
+
+ content = this.render_contents();
+ if (content === '""') {
+ content = '';
+ }
+
+ if(whitespace.inside){
+ if(content.length==0){
+ content='" "'
+ }else{
+ try{ //remove quotes if they are there
+ content = '" '+JSON.parse(content)+' "';
+ }catch(e){
+ content = '" "+\n'+content+'+\n" "';
+ }
+ }
+ }
+
+ if (forceXML ? content.length > 0 : self_close_tags.indexOf(tag) == -1) {
+ output = '"<' + tag + attribs + '>"' +
+ (content.length > 0 ? ' + \n' + content : "") +
+ ' + \n"' + tag + '>"';
+ } else {
+ output = '"<' + tag + attribs + ' />"';
+ }
+
+ if(whitespace.around){
+ //output now contains '"
hello "'
+ //we need to crack it open to insert whitespace.
+ output = '" '+output.substr(1, output.length - 2)+' "';
+ }
+
+ return output;
+ }
+ },
+
+ // each loops
+ {
+ name: "each loop",
+ regexp: /^(\s*)(?::for|:each)\s+(?:([a-z_][a-z_\-]*),\s*)?([a-z_][a-z_\-]*)\s+in\s+(.*)(\s*)$/i,
+ process: function () {
+ var ivar = this.matches[2] || '__key__', // index
+ vvar = this.matches[3], // value
+ avar = this.matches[4], // array
+ rvar = '__result__'; // results
+
+ if (this.matches[5]) {
+ this.contents.unshift(this.matches[5]);
+ }
+ return '(function () { ' +
+ 'var ' + rvar + ' = [], ' + ivar + ', ' + vvar + '; ' +
+ 'for (' + ivar + ' in ' + avar + ') { ' +
+ 'if (' + avar + '.hasOwnProperty(' + ivar + ')) { ' +
+ vvar + ' = ' + avar + '[' + ivar + ']; ' +
+ rvar + '.push(\n' + (this.render_contents() || "''") + '\n); ' +
+ '} } return ' + rvar + '.join(""); }).call(this)';
+ }
+ },
+
+ // if statements
+ {
+ name: "if",
+ regexp: /^(\s*):if\s+(.*)\s*$/i,
+ process: function () {
+ var condition = this.matches[2];
+ return '(function () { ' +
+ 'if (' + condition + ') { ' +
+ 'return (\n' + (this.render_contents() || '') + '\n);' +
+ '} else { return ""; } }).call(this)';
+ }
+ },
+
+ // silent-comments
+ {
+ name: "silent-comments",
+ regexp: /^(\s*)-#\s*(.*)\s*$/i,
+ process: function () {
+ return '""';
+ }
+ },
+
+ //html-comments
+ {
+ name: "silent-comments",
+ regexp: /^(\s*)\/\s*(.*)\s*$/i,
+ process: function () {
+ this.contents.unshift(this.matches[2]);
+
+ return '""';
+ }
+ },
+
+ // raw js
+ {
+ name: "rawjs",
+ regexp: /^(\s*)-\s*(.*)\s*$/i,
+ process: function () {
+ this.contents.unshift(this.matches[2]);
+ return '"";' + this.contents.join("\n")+"; _$output = _$output ";
+ }
+ },
+
+ // raw js
+ {
+ name: "pre",
+ regexp: /^(\s*):pre(\s+(.*)|$)/i,
+ process: function () {
+ this.contents.unshift(this.matches[2]);
+ return '"
"+\n' + JSON.stringify(this.contents.join("\n"))+'+\n" "';
+ }
+ },
+
+ // declarations
+ {
+ name: "doctype",
+ regexp: /^()!!!(?:\s*(.*))\s*$/,
+ process: function () {
+ var line = '';
+ switch ((this.matches[2] || '').toLowerCase()) {
+ case '':
+ // XHTML 1.0 Transitional
+ line = '';
+ break;
+ case 'strict':
+ case '1.0':
+ // XHTML 1.0 Strict
+ line = '';
+ break;
+ case 'frameset':
+ // XHTML 1.0 Frameset
+ line = '';
+ break;
+ case '5':
+ // XHTML 5
+ line = '';
+ break;
+ case '1.1':
+ // XHTML 1.1
+ line = '';
+ break;
+ case 'basic':
+ // XHTML Basic 1.1
+ line = '';
+ break;
+ case 'mobile':
+ // XHTML Mobile 1.2
+ line = '';
+ break;
+ case 'xml':
+ // XML
+ line = "";
+ break;
+ case 'xml iso-8859-1':
+ // XML iso-8859-1
+ line = "";
+ break;
+ }
+ return JSON.stringify(line + "\n");
+ }
+ },
+
+ // Embedded markdown. Needs to be added to exports externally.
+ {
+ name: "markdown",
+ regexp: /^(\s*):markdown\s*$/i,
+ process: function () {
+ return parse_interpol(exports.Markdown.encode(this.contents.join("\n")));
+ }
+ },
+
+ // script blocks
+ {
+ name: "script",
+ regexp: /^(\s*):(?:java)?script\s*$/,
+ process: function () {
+ return parse_interpol('\n\n");
+ }
+ },
+
+ // css blocks
+ {
+ name: "css",
+ regexp: /^(\s*):css\s*$/,
+ process: function () {
+ return JSON.stringify('");
+ }
+ }
+
+ ];
+
+ function compile(lines) {
+ var block = false,
+ output = [];
+
+ // If lines is a string, turn it into an array
+ if (typeof lines === 'string') {
+ lines = lines.trim().replace(/\n\r|\r/g, '\n').split('\n');
+ }
+
+ lines.forEach(function(line) {
+ var match, found = false;
+
+ // Collect all text as raw until outdent
+ if (block) {
+ match = block.check_indent.exec(line);
+ if (match) {
+ block.contents.push(match[1] || "");
+ return;
+ } else {
+ output.push(block.process());
+ block = false;
+ }
+ }
+
+ matchers.forEach(function (matcher) {
+ if (!found) {
+ match = matcher.regexp.exec(line);
+ if (match) {
+ block = {
+ contents: [],
+ indent_level: (match[1]),
+ matches: match,
+ check_indent: new RegExp("^(?:\\s*|" + match[1] + " (.*))$"),
+ process: matcher.process,
+ render_contents: function () {
+ return compile(this.contents);
+ }
+ };
+ found = true;
+ }
+ }
+ });
+
+ // Match plain text
+ if (!found) {
+ output.push(function () {
+ // Escaped plain text
+ if (line[0] === '\\') {
+ return parse_interpol(line.substr(1, line.length));
+ }
+
+
+ function escapedLine(){
+ try {
+ return escaperName+'('+JSON.stringify(JSON.parse(line)) +')';
+ } catch (e2) {
+ return escaperName+'(' + line + ')';
+ }
+ }
+
+ function unescapedLine(){
+ try {
+ return parse_interpol(JSON.parse(line));
+ } catch (e) {
+ return line;
+ }
+ }
+
+ // always escaped
+ if((line.substr(0, 2) === "&=")) {
+ line = line.substr(2, line.length).trim();
+ return escapedLine();
+ }
+
+ //never escaped
+ if((line.substr(0, 2) === "!=")) {
+ line = line.substr(2, line.length).trim();
+ return unescapedLine();
+ }
+
+ // sometimes escaped
+ if ( (line[0] === '=')) {
+ line = line.substr(1, line.length).trim();
+ if(escapeHtmlByDefault){
+ return escapedLine();
+ }else{
+ return unescapedLine();
+ }
+ }
+
+ // Plain text
+ return parse_interpol(line);
+ }());
+ }
+
+ });
+ if (block) {
+ output.push(block.process());
+ }
+
+ var txt = output.filter(function (part) { return part && part.length > 0}).join(" +\n");
+ if(txt.length == 0){
+ txt = '""';
+ }
+ return txt;
+ };
+
+ function optimize(js) {
+ var new_js = [], buffer = [], part, end;
+
+ function flush() {
+ if (buffer.length > 0) {
+ new_js.push(JSON.stringify(buffer.join("")) + end);
+ buffer = [];
+ }
+ }
+ js.replace(/\n\r|\r/g, '\n').split('\n').forEach(function (line) {
+ part = line.match(/^(\".*\")(\s*\+\s*)?$/);
+ if (!part) {
+ flush();
+ new_js.push(line);
+ return;
+ }
+ end = part[2] || "";
+ part = part[1];
+ try {
+ buffer.push(JSON.parse(part));
+ } catch (e) {
+ flush();
+ new_js.push(line);
+ }
+ });
+ flush();
+ return new_js.join("\n");
+ };
+
+ function render(text, options) {
+ options = options || {};
+ text = text || "";
+ var js = compile(text, options);
+ if (options.optimize) {
+ js = Haml.optimize(js);
+ }
+ return execute(js, options.context || Haml, options.locals);
+ };
+
+ function execute(js, self, locals) {
+ return (function () {
+ with(locals || {}) {
+ try {
+ var _$output;
+ eval("_$output =" + js );
+ return _$output; //set in eval
+ } catch (e) {
+ return "\n
" + html_escape(e.stack) + " \n";
+ }
+
+ }
+ }).call(self);
+ };
+
+ Haml = function Haml(haml, config) {
+ if(typeof(config) != "object"){
+ forceXML = config;
+ config = {};
+ }
+
+ var escaper;
+ if(config.customEscape){
+ escaper = "";
+ escaperName = config.customEscape;
+ }else{
+ escaper = html_escape.toString() + "\n";
+ escaperName = "html_escape";
+ }
+
+ escapeHtmlByDefault = (config.escapeHtmlByDefault || config.escapeHTML || config.escape_html);
+
+ var js = optimize(compile(haml));
+
+ var str = "with(locals || {}) {\n" +
+ " try {\n" +
+ " var _$output=" + js + ";\n return _$output;" +
+ " } catch (e) {\n" +
+ " return \"\\n
\" + "+escaperName+"(e.stack) + \" \\n\";\n" +
+ " }\n" +
+ "}"
+
+ try{
+ var f = new Function("locals", escaper + str );
+ return f;
+ }catch(e){
+ if ( typeof(console) !== 'undefined' ) { console.error(str); }
+ throw e;
+ }
+ }
+
+ Haml.compile = compile;
+ Haml.optimize = optimize;
+ Haml.render = render;
+ Haml.execute = execute;
+ Haml.html_escape = html_escape;
+}());
+
+// Hook into module system
+if (typeof module !== 'undefined') {
+ module.exports = Haml;
+}
diff --git a/node_modules/anvil.js/node_modules/haml/package.json b/node_modules/anvil.js/node_modules/haml/package.json
new file mode 100644
index 0000000..45746b6
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/package.json
@@ -0,0 +1,12 @@
+{
+ "name": "haml",
+ "description": "Haml ported to server-side Javascript. This is a traditional server-side templating language.",
+ "keywords": ["haml", "template"],
+ "homepage": "https://github.com/creationix/haml-js",
+ "main" : "./lib/haml",
+ "bin": {
+ "haml-js": "./lib/cli.js"
+ },
+ "author": "Aaron Blohowiak
, Tim Caswell ",
+ "version": "0.4.3"
+}
diff --git a/node_modules/anvil.js/node_modules/haml/test.haml b/node_modules/anvil.js/node_modules/haml/test.haml
new file mode 100644
index 0000000..982157c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test.haml
@@ -0,0 +1,2 @@
+.class1
+.class2#testid
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/alt_attribs.haml b/node_modules/anvil.js/node_modules/haml/test/alt_attribs.haml
new file mode 100644
index 0000000..9e66fd4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/alt_attribs.haml
@@ -0,0 +1,4 @@
+%tag(name="value" name2=true ns:tag=100)
+%input#space-end(type="hidden" value="3" )
+%input#space-start( type="hidden" value="3" )
+%input#space-middle(type="hidden" value="3")
diff --git a/node_modules/anvil.js/node_modules/haml/test/alt_attribs.html b/node_modules/anvil.js/node_modules/haml/test/alt_attribs.html
new file mode 100644
index 0000000..ef8ce3c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/alt_attribs.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/blank.haml b/node_modules/anvil.js/node_modules/haml/test/blank.haml
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/anvil.js/node_modules/haml/test/blank.html b/node_modules/anvil.js/node_modules/haml/test/blank.html
new file mode 100644
index 0000000..e69de29
diff --git a/node_modules/anvil.js/node_modules/haml/test/comments.haml b/node_modules/anvil.js/node_modules/haml/test/comments.haml
new file mode 100644
index 0000000..94ca08d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/comments.haml
@@ -0,0 +1,14 @@
+-# should not be displayed
+.display-this
+-# will be hidden
+ Will also be hidden
+ So comments
+ Are block-level
+- var a=2
+=a
+-# Ensure that executable JS blocks still work
+- /* this will be in the compiled function,
+ but not in the final HTML
+ */
+/ This should be a Haml comment
+ and it should be in the resulting html
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/comments.html b/node_modules/anvil.js/node_modules/haml/test/comments.html
new file mode 100644
index 0000000..5331016
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/comments.html
@@ -0,0 +1,2 @@
+
2
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/css.haml b/node_modules/anvil.js/node_modules/haml/test/css.haml
new file mode 100644
index 0000000..3f741bc
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/css.haml
@@ -0,0 +1,16 @@
+:css
+ #pants{
+ font-weight:"bold";
+ }
+
+ a:link{
+ color: "red";
+ }
+
+ a:visited{
+ color: "#ff00ff";
+ }
+
+ .visited{
+ font-weight: bold;
+ }
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/css.html b/node_modules/anvil.js/node_modules/haml/test/css.html
new file mode 100644
index 0000000..1e6a0f8
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/css.html
@@ -0,0 +1,17 @@
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/div_nesting.haml b/node_modules/anvil.js/node_modules/haml/test/div_nesting.haml
new file mode 100644
index 0000000..ac22bdc
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/div_nesting.haml
@@ -0,0 +1,5 @@
+%div
+ Does not close properly
+ %div Nested same level as next div
+%div
+ Will be nested, but should be top level
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/div_nesting.html b/node_modules/anvil.js/node_modules/haml/test/div_nesting.html
new file mode 100644
index 0000000..67983ee
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/div_nesting.html
@@ -0,0 +1 @@
+Does not close properly
Nested same level as next div
Will be nested, but should be top level
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/doctype.haml b/node_modules/anvil.js/node_modules/haml/test/doctype.haml
new file mode 100644
index 0000000..b08273b
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/doctype.haml
@@ -0,0 +1,5 @@
+!!!
+!!! strict
+!!! 1.1
+!!! 5
+!!! xml
diff --git a/node_modules/anvil.js/node_modules/haml/test/doctype.html b/node_modules/anvil.js/node_modules/haml/test/doctype.html
new file mode 100644
index 0000000..df8955f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/doctype.html
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/node_modules/anvil.js/node_modules/haml/test/embedded_code.haml b/node_modules/anvil.js/node_modules/haml/test/embedded_code.haml
new file mode 100644
index 0000000..6bec147
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/embedded_code.haml
@@ -0,0 +1,6 @@
+%head
+ :javascript
+ Page.chapter = !{JSON.stringify(chapter)};
+%body
+ %h1 Welcome #{name}
+ %div{class: "div_#{id}"}
diff --git a/node_modules/anvil.js/node_modules/haml/test/embedded_code.html b/node_modules/anvil.js/node_modules/haml/test/embedded_code.html
new file mode 100644
index 0000000..8fa69ec
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/embedded_code.html
@@ -0,0 +1,7 @@
+
+
+Welcome Tim
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/embedded_code.js b/node_modules/anvil.js/node_modules/haml/test/embedded_code.js
new file mode 100644
index 0000000..5e04d9d
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/embedded_code.js
@@ -0,0 +1,7 @@
+{
+ locals: {
+ chapter: {name: "Ninja", page: 42},
+ name: "Tim",
+ id: 42
+ }
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/escaping.haml b/node_modules/anvil.js/node_modules/haml/test/escaping.haml
new file mode 100644
index 0000000..2c725ee
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/escaping.haml
@@ -0,0 +1,7 @@
+%a{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}
+%a{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}<>
+%a{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}&= " "
+%p{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}= " "
+%p<>
+%p<>
+%p(attr0=attr[0] attr1=attr[1])
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/escaping.html b/node_modules/anvil.js/node_modules/haml/test/escaping.html
new file mode 100644
index 0000000..0cfddbd
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/escaping.html
@@ -0,0 +1 @@
+ <br>
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/escaping.js b/node_modules/anvil.js/node_modules/haml/test/escaping.js
new file mode 100644
index 0000000..cbab52c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/escaping.js
@@ -0,0 +1,13 @@
+{
+ locals: {
+ apos: "'",
+ amp: '&',
+ carrots: '<>',
+ quo: '"',
+ sol: '/',
+ attr:[
+ '"">',
+ 'javascript:alert(String.fromCharCode(88,83,83)'
+ ]
+ }
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/foreach.haml b/node_modules/anvil.js/node_modules/haml/test/foreach.haml
new file mode 100644
index 0000000..9ab286f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/foreach.haml
@@ -0,0 +1,12 @@
+:each color in colors
+ .preview{style: "color: " + color + ";"}&= name
+:each item in data
+ :if item.age < 100
+ %dl
+ :each name, value in item
+ %dt&= name
+ %dd&= value
+:each number in [1,2,3,4,5,6,7]
+ = number
+:for word in "Hello World".split(" ")
+ = word
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/foreach.html b/node_modules/anvil.js/node_modules/haml/test/foreach.html
new file mode 100644
index 0000000..2f81fd1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/foreach.html
@@ -0,0 +1 @@
+My Rainbow
My Rainbow
My Rainbow
name Tim Caswell age 27 1234567HelloWorld
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/foreach.js b/node_modules/anvil.js/node_modules/haml/test/foreach.js
new file mode 100644
index 0000000..97de8e1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/foreach.js
@@ -0,0 +1,10 @@
+{
+ locals: {
+ colors: ["#f80", "#08f", "#4f4"],
+ name: "My Rainbow",
+ data: [
+ {name: "Tim Caswell", age: 27},
+ {name: "John Smith", age: 107},
+ ]
+ }
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/interpolation.haml b/node_modules/anvil.js/node_modules/haml/test/interpolation.haml
new file mode 100644
index 0000000..9266915
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/interpolation.haml
@@ -0,0 +1,12 @@
+- var amp = "&",
+ quo = '"',
+ carrots = "<>",
+ tag=" ";
+
+%p(id="p-#{amp}") Well then #{carrots}
+%p(id="p-!{amp}") Well then !{carrots}
+
+This is some text #{amp} it is cool. !{tag} i am doing fun stuff!
+
+%p(src="!{quo}!{tag}!{quo}")
+
diff --git a/node_modules/anvil.js/node_modules/haml/test/interpolation.html b/node_modules/anvil.js/node_modules/haml/test/interpolation.html
new file mode 100644
index 0000000..74137d1
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/interpolation.html
@@ -0,0 +1 @@
+Well then <>
Well then <>
This is some text & it is cool. i am doing fun stuff!
"">
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/meta.haml b/node_modules/anvil.js/node_modules/haml/test/meta.haml
new file mode 100644
index 0000000..ed22c52
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/meta.haml
@@ -0,0 +1 @@
+%meta(http-equiv="content-type" content="text/html; charset=UTF-8")
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/meta.html b/node_modules/anvil.js/node_modules/haml/test/meta.html
new file mode 100644
index 0000000..fec8b93
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/meta.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/nanline.haml b/node_modules/anvil.js/node_modules/haml/test/nanline.haml
new file mode 100644
index 0000000..f57fe22
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/nanline.haml
@@ -0,0 +1,6 @@
+!!! 5
+%html
+ %head
+ %title atomix
+
+ %script(src='atomix_xlib.js')
diff --git a/node_modules/anvil.js/node_modules/haml/test/nanline.html b/node_modules/anvil.js/node_modules/haml/test/nanline.html
new file mode 100644
index 0000000..78e1623
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/nanline.html
@@ -0,0 +1,2 @@
+
+atomix
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/nested_context.haml b/node_modules/anvil.js/node_modules/haml/test/nested_context.haml
new file mode 100644
index 0000000..907c484
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/nested_context.haml
@@ -0,0 +1,6 @@
+%p= this.name
+#main
+ :each item in items
+ .item= this.name + ": " + item
+ :if items
+ #cool= this.name
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/nested_context.html b/node_modules/anvil.js/node_modules/haml/test/nested_context.html
new file mode 100644
index 0000000..0aa937e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/nested_context.html
@@ -0,0 +1 @@
+Frank
Frank: 1
Frank: 2
Frank: 3
Frank
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/nested_context.js b/node_modules/anvil.js/node_modules/haml/test/nested_context.js
new file mode 100644
index 0000000..f823655
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/nested_context.js
@@ -0,0 +1,8 @@
+{
+ context: {
+ name: "Frank"
+ },
+ locals: {
+ items: [1,2,3]
+ }
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/no_self_close_div.haml b/node_modules/anvil.js/node_modules/haml/test/no_self_close_div.haml
new file mode 100644
index 0000000..05ccbee
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/no_self_close_div.haml
@@ -0,0 +1,8 @@
+%html
+ %body
+ %div#a
+ %div I do not self close.
+ :javascript
+ (function(){
+ document.getElementById('a').textContent='I self close';
+ })();
diff --git a/node_modules/anvil.js/node_modules/haml/test/no_self_close_div.html b/node_modules/anvil.js/node_modules/haml/test/no_self_close_div.html
new file mode 100644
index 0000000..5067557
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/no_self_close_div.html
@@ -0,0 +1,9 @@
+
I do not self close.
+
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/non-string-attribs.haml b/node_modules/anvil.js/node_modules/haml/test/non-string-attribs.haml
new file mode 100644
index 0000000..4e70727
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/non-string-attribs.haml
@@ -0,0 +1,8 @@
+#plain= "Plain Text"
+#escaped&= ""
+%input{checked: true}
+%input{checked: false}
+%input{checked: null}
+%input{checked: undefined}
+%input{checked: 0}
+%input{checked: ""}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/non-string-attribs.html b/node_modules/anvil.js/node_modules/haml/test/non-string-attribs.html
new file mode 100644
index 0000000..b390396
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/non-string-attribs.html
@@ -0,0 +1 @@
+Plain Text
<escaped>
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/other/custom_escape.haml b/node_modules/anvil.js/node_modules/haml/test/other/custom_escape.haml
new file mode 100644
index 0000000..a4ee2b3
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/other/custom_escape.haml
@@ -0,0 +1,12 @@
+%a{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}
+%a{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}<>
+%a{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}&= " "
+%p{apos:apos, amp:amp, carrots:carrots, quo:quo, sol:sol}= " "
+%p<>
+%p<>
+%p(attr0=attr[0] attr1=attr[1])
+
+
+
+%h1(id="#{carrots} blah") How#{apos}s it going #{amp} how are you?
+
diff --git a/node_modules/anvil.js/node_modules/haml/test/other/custom_escape.html b/node_modules/anvil.js/node_modules/haml/test/other/custom_escape.html
new file mode 100644
index 0000000..be08513
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/other/custom_escape.html
@@ -0,0 +1 @@
+ moo
Howmoos it going moo how are you?
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/other/escape_by_default.haml b/node_modules/anvil.js/node_modules/haml/test/other/escape_by_default.haml
new file mode 100644
index 0000000..3646a55
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/other/escape_by_default.haml
@@ -0,0 +1,8 @@
+- tag = "";
+
+.safe<>= tag
+.safe>&= tag
+.safe<&= tag
+.unsafe!= tag
+.unsafe!= tag
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/other/escape_by_default.html b/node_modules/anvil.js/node_modules/haml/test/other/escape_by_default.html
new file mode 100644
index 0000000..558789f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/other/escape_by_default.html
@@ -0,0 +1 @@
+ <script> bad things</script>
<script> bad things</script>
<script> bad things</script>
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/raw.haml b/node_modules/anvil.js/node_modules/haml/test/raw.haml
new file mode 100644
index 0000000..af108d2
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/raw.haml
@@ -0,0 +1,7 @@
+.conditional
+ - var a = "strings are truthy"
+ - if(a){
+ .hello
+ - } else{
+ .goodbye
+ - }
diff --git a/node_modules/anvil.js/node_modules/haml/test/raw.html b/node_modules/anvil.js/node_modules/haml/test/raw.html
new file mode 100644
index 0000000..6791d8f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/raw.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/raw_complex.haml b/node_modules/anvil.js/node_modules/haml/test/raw_complex.haml
new file mode 100644
index 0000000..29896f2
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/raw_complex.haml
@@ -0,0 +1,62 @@
+- /*
+ here we can have a comment that will not be output.
+ Since executable-JS is a block-level thing, we can
+ have as much comment as we want */
+
+
+- /* now you can have arbitrary control logic
+ This will output 1
2
3
+ notice: the %div isn't indented! Explained below!
+ */
+
+- for(var i=1; i < 4; i++){
+%div= i
+-}
+
+
+%h1 Woah!
+
+- /* we can include new variable declarations as well! */
+ var someObj = {
+ a: 1,
+ b: 2
+ }
+= someObj.b
+
+
+%br
+
+
+- /* this is going to be funky. i DO NOT expect you to do this.
+ Here we will begin with a comment, then define our variable.
+ Next we begin a function definition.
+
+ We will use this function to output a div that contains a number.
+ Successive calls should output the next number in the div.
+
+ We want our function to output the value of the counter,
+ so we "outdent" to escape the JavaScript block in haml.
+ Note that we have not closed our function definition's
+ parenthesis yet. So, even though we outdent, the
+ concatenation statement will be in the function's body.
+ */
+
+ var counter = 0;
+ function increment(){
+ counter++;
+.count
+ = counter
+-}
+- increment() /* the tags wil be appended to the buffer, so use - instead of = */
+- increment()
+
+
+
+
+- function b(item){
+.item
+ %b= item
+ %span.length= item.length
+- }
+- b("Hi")
+- b("World")
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/raw_complex.html b/node_modules/anvil.js/node_modules/haml/test/raw_complex.html
new file mode 100644
index 0000000..d87eb84
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/raw_complex.html
@@ -0,0 +1 @@
+1
2
3
Woah! 21
2
Hi 2
World 5
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/script_css.haml b/node_modules/anvil.js/node_modules/haml/test/script_css.haml
new file mode 100644
index 0000000..ed9a9d4
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/script_css.haml
@@ -0,0 +1,12 @@
+%head
+ :javascript
+ function greet(message) {
+ alert("Message from MCP: " + message);
+ }
+ %title Script and Css test
+ :css
+ body {
+ color: pink;
+ }
+%body{onload: "greet(\"I'm Pink\")"} COLOR ME PINK
+
diff --git a/node_modules/anvil.js/node_modules/haml/test/script_css.html b/node_modules/anvil.js/node_modules/haml/test/script_css.html
new file mode 100644
index 0000000..648a327
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/script_css.html
@@ -0,0 +1,13 @@
+
+
+Script and Css test COLOR ME PINK
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/self_close.haml b/node_modules/anvil.js/node_modules/haml/test/self_close.haml
new file mode 100644
index 0000000..a26cdcd
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/self_close.haml
@@ -0,0 +1,8 @@
+%html
+ %head
+ :if url !='/'
+ %script
+ %meta{name: "test", value:"Monkey"}
+ %body
+ %a{ href: url }
+ link
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/self_close.html b/node_modules/anvil.js/node_modules/haml/test/self_close.html
new file mode 100644
index 0000000..90b50a0
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/self_close.html
@@ -0,0 +1 @@
+link
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/self_close.js b/node_modules/anvil.js/node_modules/haml/test/self_close.js
new file mode 100644
index 0000000..5f6f85c
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/self_close.js
@@ -0,0 +1,5 @@
+{
+ locals: {
+ url: "http://nodejs.org/"
+ }
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/standard.haml b/node_modules/anvil.js/node_modules/haml/test/standard.haml
new file mode 100644
index 0000000..955fe05
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/standard.haml
@@ -0,0 +1,14 @@
+!!! XML
+!!! strict
+%html{ xmlns: "http://www.w3.org/1999/xhtml" }
+ %head
+ %title
+ Sample haml template
+ %body
+ .profile
+ .left.column
+ #date= print_date()
+ #address= current_user.address
+ .right.column
+ #email= current_user.email
+ #bio= current_user.bio
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/standard.html b/node_modules/anvil.js/node_modules/haml/test/standard.html
new file mode 100644
index 0000000..bb24daa
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/standard.html
@@ -0,0 +1,3 @@
+
+
+Sample haml template January 1, 2009
Richardson, TX
tim@creationix.com
Experienced software professional...
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/standard.js b/node_modules/anvil.js/node_modules/haml/test/standard.js
new file mode 100644
index 0000000..23abf66
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/standard.js
@@ -0,0 +1,12 @@
+{
+ locals: {
+ print_date: function () {
+ return 'January 1, 2009';
+ },
+ current_user: {
+ address: "Richardson, TX",
+ email: "tim@creationix.com",
+ bio: "Experienced software professional..."
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/test-commonjs.js b/node_modules/anvil.js/node_modules/haml/test/test-commonjs.js
new file mode 100644
index 0000000..b20c2ac
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/test-commonjs.js
@@ -0,0 +1,23 @@
+var FILE = require("file");
+var ASSERT = require("assert");
+
+var Haml = require("../lib/haml");
+
+FILE.glob("test/*.haml").forEach(function(hamlFile) {
+ exports["test " + hamlFile] = function() {
+ var scopeFile = hamlFile.replace(/haml$/, "js");
+ var htmlFile = hamlFile.replace(/haml$/, "html");
+
+ var haml = FILE.read(hamlFile);
+ var expected = FILE.read(htmlFile);
+ var scope = FILE.exists(scopeFile) ? eval("("+FILE.read(scopeFile)+")") : {};
+
+ var js = Haml.compile(haml);
+ var js_opt = Haml.optimize(js);
+ var actual = Haml.execute(js_opt, scope.context, scope.locals);
+ ASSERT.equal(actual.trim(), expected.trim());
+ }
+});
+
+if (module == require.main)
+ require("os").exit(require("test").run(exports));
diff --git a/node_modules/anvil.js/node_modules/haml/test/test.js b/node_modules/anvil.js/node_modules/haml/test/test.js
new file mode 100644
index 0000000..adcc36f
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/test.js
@@ -0,0 +1,137 @@
+var fs = require('fs');
+var assert = require('assert');
+var sys = require('sys');
+
+var Haml = require("../lib/haml");
+
+
+
+function compare(haml_file, haml, expected, scope, options){
+ options || (options = {});
+ try {
+ sys.puts(haml_file + " Begun")
+ var js = Haml.compile(haml);
+ var js_opt = Haml.optimize(js);
+ var jsFn = Haml(haml, options);
+ var actual = jsFn.call(scope.context, scope.locals);
+
+ assert.equal(actual, expected);
+ sys.puts(haml_file + " Passed")
+
+ actual = Haml.render(haml, {context:scope.context, locals:scope.locals})
+
+ assert.equal(actual, expected);
+ sys.puts(haml_file + " Haml.render Passed")
+
+ } catch (e) {
+ var message = e.name;
+ if (e.message) { message += ": " + e.message; }
+ sys.error(haml_file + " FAILED")
+ sys.error(message);
+ sys.error("\nJS:\n\n" + js);
+ sys.error("\nOptimized JS:\n\n" + js_opt);
+ sys.error("\nJS fn:\n\n"+jsFn.toString());
+ sys.error("\nStack:\n\n"+e.stack);
+ try{
+ sys.error("\nActual["+actual.length+"]:\n\n" + actual);
+ sys.error("\nExpected["+expected.length+"]:\n\n" + expected);
+ }catch(e2){}
+
+ process.exit();
+ }
+}
+
+
+fs.readdir('.', function (err, files) {
+ files.forEach(function (haml_file) {
+ var m = haml_file.match(/^(.*)\.haml/),
+ base;
+ if (!m) {
+ return;
+ }
+ base = m[1];
+
+ function load_haml(scope) {
+ fs.readFile(haml_file, "utf8", function (err, haml) {
+ fs.readFile(base + ".html", "utf8", function (err, expected) {
+ compare(haml_file, haml, expected, scope)
+ });
+ });
+ }
+
+ // Load scope
+ if (files.indexOf(base + ".js") >= 0) {
+ fs.readFile(base + ".js", "utf8", function (err, js) {
+ load_haml(eval("(" + js + ")"));
+ });
+ } else {
+ load_haml({});
+ }
+ });
+});
+
+(function(){
+ var hamlSrc = fs.readFileSync("alt_attribs.haml", "utf8");
+ var includeEscape = Haml(hamlSrc).toString();
+ var customEscape = Haml(hamlSrc, {customEscape:"$esc"}).toString();
+ try{
+ assert.ok(customEscape.length < includeEscape.length);
+ }catch(e){
+ sys.error(e.stack);
+ sys.error(customEscape);
+ process.exit();
+ }
+})();
+
+
+(function(){
+ var hamlSrc = fs.readFileSync("./other/custom_escape.haml", "utf8");
+ var expected = fs.readFileSync("./other/custom_escape.html", "utf8");
+ var scope = eval("(" + fs.readFileSync("escaping.js") + ")");
+
+ sys.puts("custom_escape" + " Begun")
+ var jsFn = Haml(hamlSrc, {customEscape:"$esc"});
+
+ this.$esc = function(){
+ return "moo"
+ };
+
+ var actual = jsFn.call(scope.context, scope.locals);
+ try{
+ assert.equal(actual, expected);
+ }catch(e){
+ sys.error("\nActual["+actual.length+"]:\n\n" + actual);
+ sys.error("\nExpected["+expected.length+"]:\n\n" + expected);
+ process.exit();
+ }
+ sys.puts("custom_escape" + " Passed")
+
+})();
+
+
+(function(){
+ var hamlSrc = fs.readFileSync("./other/escape_by_default.haml", "utf8");
+ var expected = fs.readFileSync("./other/escape_by_default.html", "utf8");
+ var scope = {};
+
+ sys.puts("escape_by_default" + " Begun")
+ var js = Haml.compile(hamlSrc);
+
+ var jsFn = Haml(hamlSrc, {escapeHtmlByDefault:true});
+
+ this.$esc = function(){
+ return "moo"
+ };
+
+ var actual = jsFn.call(scope.context, scope.locals);
+ try{
+ assert.equal(actual, expected);
+ }catch(e){
+ sys.error("\nActual["+actual.length+"]:\n\n" + actual);
+ sys.error("\nExpected["+expected.length+"]:\n\n" + expected);
+ process.exit();
+ }
+ sys.puts("escape_by_default" + " Passed")
+
+})();
+
diff --git a/node_modules/anvil.js/node_modules/haml/test/whitespace.haml b/node_modules/anvil.js/node_modules/haml/test/whitespace.haml
new file mode 100644
index 0000000..e204278
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/whitespace.haml
@@ -0,0 +1,44 @@
+%p I want my words
+ %a> to have spaces on the outside
+ So they don't run together.
+ But i also want some to have
+ %a< spaces on the inside
+ and still others to have
+ %a<> spaces on either side
+ even if it has
+ %a<>= "code"
+ on the line
+ %a>= "or"
+ just code with space on the outside
+
+
+%p
+ %a link
+ s that touch their neighbor.
+
+
+%p
+ And
+ %a>links
+ that do not
+
+%p
+ Or a
+ %b<> important thing
+ with tons of space
+
+%p
+ Download the file
+ %a(href="/home")> here
+ now.
+
+-# empty tag
+%p<>
+
+- id="123456"; locals={name:"hi"}
+
+.item.pending{data-id: id}
+ %input.checkbox(type="checkbox" id="todo-"+id)
+ %label.description(name=("todo-"+id))= (locals.name || "")
+ %span<>= id
+ %a.delete.live{href:"/todo/"+id+"/delete"}> delete
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/haml/test/whitespace.html b/node_modules/anvil.js/node_modules/haml/test/whitespace.html
new file mode 100644
index 0000000..9f010de
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/haml/test/whitespace.html
@@ -0,0 +1 @@
+I want my words to have spaces on the outside So they don't run together. But i also want some to have spaces on the inside and still others to have spaces on either side even if it has code on the line or just code with space on the outside
link s that touch their neighbor.
And links that do not
Or a important thing with tons of space
Download the file here now.
\ No newline at end of file
diff --git a/node_modules/anvil.js/node_modules/less/.npmignore b/node_modules/anvil.js/node_modules/less/.npmignore
new file mode 100644
index 0000000..320faec
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/.npmignore
@@ -0,0 +1,2 @@
+
+*.less
diff --git a/node_modules/anvil.js/node_modules/less/CHANGELOG b/node_modules/anvil.js/node_modules/less/CHANGELOG
new file mode 100644
index 0000000..9269555
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/CHANGELOG
@@ -0,0 +1,26 @@
+1.2.1
+
+fix imports on browser
+improve error reporting on browser
+fix Runtime error reports from imported files
+fix 'File not found' import error reporting
+
+1.2.0
+
+- mixin guards
+- new function `percentage`
+- new `color` function to parse hex color strings
+- new type-checking stylesheet functions
+- fix Rhino support
+- fix bug in string arguments to mixin call
+- fix error reporting when index is 0
+- fix browser support in webkit and IE
+- fix string interpolation bug when var is empty
+- support '!important' after mixin calls
+- support vanilla @keyframes directive
+- support variables in certain css selectors, like 'nth-child'
+- support @media and @import features properly
+- improve @import support with media features
+- improve error reports from imported files
+- improve function call error reporting
+- improve error-reporting
diff --git a/node_modules/anvil.js/node_modules/less/LICENSE b/node_modules/anvil.js/node_modules/less/LICENSE
new file mode 100644
index 0000000..40f3b78
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/LICENSE
@@ -0,0 +1,179 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+Copyright (c) 2009-2010 Alexis Sellier
diff --git a/node_modules/anvil.js/node_modules/less/Makefile b/node_modules/anvil.js/node_modules/less/Makefile
new file mode 100644
index 0000000..32d7cc0
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/Makefile
@@ -0,0 +1,75 @@
+#
+# Run all tests
+#
+test:
+ node test/less-test.js
+
+#
+# Run benchmark
+#
+benchmark:
+ node benchmark/less-benchmark.js
+
+#
+# Build less.js
+#
+SRC = lib/less
+HEADER = build/header.js
+VERSION = `cat package.json | grep version \
+ | grep -o '[0-9]\.[0-9]\.[0-9]\+'`
+DIST = dist/less-${VERSION}.js
+RHINO = dist/less-rhino-${VERSION}.js
+DIST_MIN = dist/less-${VERSION}.min.js
+
+less:
+ @@mkdir -p dist
+ @@touch ${DIST}
+ @@cat ${HEADER} | sed s/@VERSION/${VERSION}/ > ${DIST}
+ @@echo "(function (window, undefined) {" >> ${DIST}
+ @@cat build/require.js\
+ build/amd.js\
+ build/ecma-5.js\
+ ${SRC}/parser.js\
+ ${SRC}/functions.js\
+ ${SRC}/colors.js\
+ ${SRC}/tree/*.js\
+ ${SRC}/tree.js\
+ ${SRC}/browser.js >> ${DIST}
+ @@echo "})(window);" >> ${DIST}
+ @@echo ${DIST} built.
+
+rhino:
+ @@mkdir -p dist
+ @@touch ${RHINO}
+ @@cat build/require-rhino.js\
+ build/ecma-5.js\
+ ${SRC}/parser.js\
+ ${SRC}/functions.js\
+ ${SRC}/tree/*.js\
+ ${SRC}/tree.js\
+ ${SRC}/rhino.js > ${RHINO}
+ @@echo ${RHINO} built.
+
+min: less
+ @@echo minifying...
+ @@uglifyjs ${DIST} > ${DIST_MIN}
+ @@echo ${DIST_MIN} built.
+
+server: less
+ cp dist/less-${VERSION}.js test/html/
+ cd test/html && python -m SimpleHTTPServer
+
+clean:
+ git rm dist/*
+
+dist: clean min
+ git add dist/*
+ git commit -a -m "(dist) build ${VERSION}"
+ git archive master --prefix=less/ -o less-${VERSION}.tar.gz
+ npm publish less-${VERSION}.tar.gz
+
+stable:
+ npm tag less ${VERSION} stable
+
+
+.PHONY: test benchmark
diff --git a/node_modules/anvil.js/node_modules/less/README.md b/node_modules/anvil.js/node_modules/less/README.md
new file mode 100644
index 0000000..726d691
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/README.md
@@ -0,0 +1,20 @@
+less.js
+=======
+
+The **dynamic** stylesheet language.
+
+
+
+about
+-----
+
+This is the JavaScript, and now official, stable version of LESS.
+
+For more information, visit .
+
+license
+-------
+
+See `LICENSE` file.
+
+> Copyright (c) 2009-2011 Alexis Sellier
diff --git a/node_modules/anvil.js/node_modules/less/benchmark/less-benchmark.js b/node_modules/anvil.js/node_modules/less/benchmark/less-benchmark.js
new file mode 100644
index 0000000..68fe1ad
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/benchmark/less-benchmark.js
@@ -0,0 +1,47 @@
+var path = require('path'),
+ fs = require('fs'),
+ sys = require('util');
+
+var less = require('../lib/less');
+var file = path.join(__dirname, 'benchmark.less');
+
+if (process.argv[2]) { file = path.join(process.cwd(), process.argv[2]) }
+
+fs.readFile(file, 'utf8', function (e, data) {
+ var tree, css, start, end, total;
+
+ sys.puts("Benchmarking...\n", path.basename(file) + " (" +
+ parseInt(data.length / 1024) + " KB)", "");
+
+ start = new(Date);
+
+ new(less.Parser)({ optimization: 2 }).parse(data, function (err, tree) {
+ end = new(Date);
+
+ total = end - start;
+
+ sys.puts("Parsing: " +
+ total + " ms (" +
+ parseInt(1000 / total *
+ data.length / 1024) + " KB\/s)");
+
+ start = new(Date);
+ css = tree.toCSS();
+ end = new(Date);
+
+ sys.puts("Generation: " + (end - start) + " ms (" +
+ parseInt(1000 / (end - start) *
+ data.length / 1024) + " KB\/s)");
+
+ total += end - start;
+
+ sys.puts("Total: " + total + "ms (" +
+ parseInt(1000 / total * data.length / 1024) + " KB/s)");
+
+ if (err) {
+ less.writeError(err);
+ process.exit(3);
+ }
+ });
+});
+
diff --git a/node_modules/anvil.js/node_modules/less/dist/less-1.1.0.js b/node_modules/anvil.js/node_modules/less/dist/less-1.1.0.js
new file mode 100644
index 0000000..487c06a
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/dist/less-1.1.0.js
@@ -0,0 +1,2695 @@
+//
+// LESS - Leaner CSS v1.1.0
+// http://lesscss.org
+//
+// Copyright (c) 2009-2011, Alexis Sellier
+// Licensed under the Apache 2.0 License.
+//
+(function (window, undefined) {
+//
+// Stub out `require` in the browser
+//
+function require(arg) {
+ return window.less[arg.split('/')[1]];
+};
+
+
+// ecma-5.js
+//
+// -- kriskowal Kris Kowal Copyright (C) 2009-2010 MIT License
+// -- tlrobinson Tom Robinson
+// dantman Daniel Friesen
+
+//
+// Array
+//
+if (!Array.isArray) {
+ Array.isArray = function(obj) {
+ return Object.prototype.toString.call(obj) === "[object Array]" ||
+ (obj instanceof Array);
+ };
+}
+if (!Array.prototype.forEach) {
+ Array.prototype.forEach = function(block, thisObject) {
+ var len = this.length >>> 0;
+ for (var i = 0; i < len; i++) {
+ if (i in this) {
+ block.call(thisObject, this[i], i, this);
+ }
+ }
+ };
+}
+if (!Array.prototype.map) {
+ Array.prototype.map = function(fun /*, thisp*/) {
+ var len = this.length >>> 0;
+ var res = new Array(len);
+ var thisp = arguments[1];
+
+ for (var i = 0; i < len; i++) {
+ if (i in this) {
+ res[i] = fun.call(thisp, this[i], i, this);
+ }
+ }
+ return res;
+ };
+}
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function (block /*, thisp */) {
+ var values = [];
+ var thisp = arguments[1];
+ for (var i = 0; i < this.length; i++) {
+ if (block.call(thisp, this[i])) {
+ values.push(this[i]);
+ }
+ }
+ return values;
+ };
+}
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function(fun /*, initial*/) {
+ var len = this.length >>> 0;
+ var i = 0;
+
+ // no value to return if no initial value and an empty array
+ if (len === 0 && arguments.length === 1) throw new TypeError();
+
+ if (arguments.length >= 2) {
+ var rv = arguments[1];
+ } else {
+ do {
+ if (i in this) {
+ rv = this[i++];
+ break;
+ }
+ // if array contains no values, no initial value to return
+ if (++i >= len) throw new TypeError();
+ } while (true);
+ }
+ for (; i < len; i++) {
+ if (i in this) {
+ rv = fun.call(null, rv, this[i], i, this);
+ }
+ }
+ return rv;
+ };
+}
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function (value /*, fromIndex */ ) {
+ var length = this.length;
+ var i = arguments[1] || 0;
+
+ if (!length) return -1;
+ if (i >= length) return -1;
+ if (i < 0) i += length;
+
+ for (; i < length; i++) {
+ if (!Object.prototype.hasOwnProperty.call(this, i)) { continue }
+ if (value === this[i]) return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+//
+if (!Object.keys) {
+ Object.keys = function (object) {
+ var keys = [];
+ for (var name in object) {
+ if (Object.prototype.hasOwnProperty.call(object, name)) {
+ keys.push(name);
+ }
+ }
+ return keys;
+ };
+}
+
+//
+// String
+//
+if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return String(this).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+ };
+}
+var less, tree;
+
+if (typeof(window) === 'undefined') {
+ less = exports,
+ tree = require('less/tree');
+} else {
+ if (typeof(window.less) === 'undefined') { window.less = {} }
+ less = window.less,
+ tree = window.less.tree = {};
+}
+//
+// less.js - parser
+//
+// A relatively straight-forward predictive parser.
+// There is no tokenization/lexing stage, the input is parsed
+// in one sweep.
+//
+// To make the parser fast enough to run in the browser, several
+// optimization had to be made:
+//
+// - Matching and slicing on a huge input is often cause of slowdowns.
+// The solution is to chunkify the input into smaller strings.
+// The chunks are stored in the `chunks` var,
+// `j` holds the current chunk index, and `current` holds
+// the index of the current chunk in relation to `input`.
+// This gives us an almost 4x speed-up.
+//
+// - In many cases, we don't need to match individual tokens;
+// for example, if a value doesn't hold any variables, operations
+// or dynamic references, the parser can effectively 'skip' it,
+// treating it as a literal.
+// An example would be '1px solid #000' - which evaluates to itself,
+// we don't need to know what the individual components are.
+// The drawback, of course is that you don't get the benefits of
+// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,
+// and a smaller speed-up in the code-gen.
+//
+//
+// Token matching is done with the `$` function, which either takes
+// a terminal string or regexp, or a non-terminal function to call.
+// It also takes care of moving all the indices forwards.
+//
+//
+less.Parser = function Parser(env) {
+ var input, // LeSS input string
+ i, // current index in `input`
+ j, // current chunk
+ temp, // temporarily holds a chunk's state, for backtracking
+ memo, // temporarily holds `i`, when backtracking
+ furthest, // furthest index the parser has gone to
+ chunks, // chunkified input
+ current, // index of current chunk, in `input`
+ parser;
+
+ var that = this;
+
+ // This function is called after all files
+ // have been imported through `@import`.
+ var finish = function () {};
+
+ var imports = this.imports = {
+ paths: env && env.paths || [], // Search paths, when importing
+ queue: [], // Files which haven't been imported yet
+ files: {}, // Holds the imported parse trees
+ mime: env && env.mime, // MIME type of .less files
+ push: function (path, callback) {
+ var that = this;
+ this.queue.push(path);
+
+ //
+ // Import a file asynchronously
+ //
+ less.Parser.importer(path, this.paths, function (root) {
+ that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue
+ that.files[path] = root; // Store the root
+
+ callback(root);
+
+ if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing
+ }, env);
+ }
+ };
+
+ function save() { temp = chunks[j], memo = i, current = i }
+ function restore() { chunks[j] = temp, i = memo, current = i }
+
+ function sync() {
+ if (i > current) {
+ chunks[j] = chunks[j].slice(i - current);
+ current = i;
+ }
+ }
+ //
+ // Parse from a token, regexp or string, and move forward if match
+ //
+ function $(tok) {
+ var match, args, length, c, index, endIndex, k, mem;
+
+ //
+ // Non-terminal
+ //
+ if (tok instanceof Function) {
+ return tok.call(parser.parsers);
+ //
+ // Terminal
+ //
+ // Either match a single character in the input,
+ // or match a regexp in the current chunk (chunk[j]).
+ //
+ } else if (typeof(tok) === 'string') {
+ match = input.charAt(i) === tok ? tok : null;
+ length = 1;
+ sync ();
+ } else {
+ sync ();
+
+ if (match = tok.exec(chunks[j])) {
+ length = match[0].length;
+ } else {
+ return null;
+ }
+ }
+
+ // The match is confirmed, add the match length to `i`,
+ // and consume any extra white-space characters (' ' || '\n')
+ // which come after that. The reason for this is that LeSS's
+ // grammar is mostly white-space insensitive.
+ //
+ if (match) {
+ mem = i += length;
+ endIndex = i + chunks[j].length - length;
+
+ while (i < endIndex) {
+ c = input.charCodeAt(i);
+ if (! (c === 32 || c === 10 || c === 9)) { break }
+ i++;
+ }
+ chunks[j] = chunks[j].slice(length + (i - mem));
+ current = i;
+
+ if (chunks[j].length === 0 && j < chunks.length - 1) { j++ }
+
+ if(typeof(match) === 'string') {
+ return match;
+ } else {
+ return match.length === 1 ? match[0] : match;
+ }
+ }
+ }
+
+ // Same as $(), but don't change the state of the parser,
+ // just return the match.
+ function peek(tok) {
+ if (typeof(tok) === 'string') {
+ return input.charAt(i) === tok;
+ } else {
+ if (tok.test(chunks[j])) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ this.env = env = env || {};
+
+ // The optimization level dictates the thoroughness of the parser,
+ // the lower the number, the less nodes it will create in the tree.
+ // This could matter for debugging, or if you want to access
+ // the individual nodes in the tree.
+ this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
+
+ this.env.filename = this.env.filename || null;
+
+ //
+ // The Parser
+ //
+ return parser = {
+
+ imports: imports,
+ //
+ // Parse an input string into an abstract syntax tree,
+ // call `callback` when done.
+ //
+ parse: function (str, callback) {
+ var root, start, end, zone, line, lines, buff = [], c, error = null;
+
+ i = j = current = furthest = 0;
+ chunks = [];
+ input = str.replace(/\r\n/g, '\n');
+
+ // Split the input into chunks.
+ chunks = (function (chunks) {
+ var j = 0,
+ skip = /[^"'`\{\}\/\(\)]+/g,
+ comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
+ level = 0,
+ match,
+ chunk = chunks[0],
+ inParam,
+ inString;
+
+ for (var i = 0, c, cc; i < input.length; i++) {
+ skip.lastIndex = i;
+ if (match = skip.exec(input)) {
+ if (match.index === i) {
+ i += match[0].length;
+ chunk.push(match[0]);
+ }
+ }
+ c = input.charAt(i);
+ comment.lastIndex = i;
+
+ if (!inString && !inParam && c === '/') {
+ cc = input.charAt(i + 1);
+ if (cc === '/' || cc === '*') {
+ if (match = comment.exec(input)) {
+ if (match.index === i) {
+ i += match[0].length;
+ chunk.push(match[0]);
+ c = input.charAt(i);
+ }
+ }
+ }
+ }
+
+ if (c === '{' && !inString && !inParam) { level ++;
+ chunk.push(c);
+ } else if (c === '}' && !inString && !inParam) { level --;
+ chunk.push(c);
+ chunks[++j] = chunk = [];
+ } else if (c === '(' && !inString && !inParam) {
+ chunk.push(c);
+ inParam = true;
+ } else if (c === ')' && !inString && inParam) {
+ chunk.push(c);
+ inParam = false;
+ } else {
+ if (c === '"' || c === "'" || c === '`') {
+ if (! inString) {
+ inString = c;
+ } else {
+ inString = inString === c ? false : inString;
+ }
+ }
+ chunk.push(c);
+ }
+ }
+ if (level > 0) {
+ throw {
+ type: 'Syntax',
+ message: "Missing closing `}`",
+ filename: env.filename
+ };
+ }
+
+ return chunks.map(function (c) { return c.join('') });;
+ })([[]]);
+
+ // Start with the primary rule.
+ // The whole syntax tree is held under a Ruleset node,
+ // with the `root` property set to true, so no `{}` are
+ // output. The callback is called when the input is parsed.
+ root = new(tree.Ruleset)([], $(this.parsers.primary));
+ root.root = true;
+
+ root.toCSS = (function (evaluate) {
+ var line, lines, column;
+
+ return function (options, variables) {
+ var frames = [];
+
+ options = options || {};
+ //
+ // Allows setting variables with a hash, so:
+ //
+ // `{ color: new(tree.Color)('#f01') }` will become:
+ //
+ // new(tree.Rule)('@color',
+ // new(tree.Value)([
+ // new(tree.Expression)([
+ // new(tree.Color)('#f01')
+ // ])
+ // ])
+ // )
+ //
+ if (typeof(variables) === 'object' && !Array.isArray(variables)) {
+ variables = Object.keys(variables).map(function (k) {
+ var value = variables[k];
+
+ if (! (value instanceof tree.Value)) {
+ if (! (value instanceof tree.Expression)) {
+ value = new(tree.Expression)([value]);
+ }
+ value = new(tree.Value)([value]);
+ }
+ return new(tree.Rule)('@' + k, value, false, 0);
+ });
+ frames = [new(tree.Ruleset)(null, variables)];
+ }
+
+ try {
+ var css = evaluate.call(this, { frames: frames })
+ .toCSS([], { compress: options.compress || false });
+ } catch (e) {
+ lines = input.split('\n');
+ line = getLine(e.index);
+
+ for (var n = e.index, column = -1;
+ n >= 0 && input.charAt(n) !== '\n';
+ n--) { column++ }
+
+ throw {
+ type: e.type,
+ message: e.message,
+ filename: env.filename,
+ index: e.index,
+ line: typeof(line) === 'number' ? line + 1 : null,
+ callLine: e.call && (getLine(e.call) + 1),
+ callExtract: lines[getLine(e.call)],
+ stack: e.stack,
+ column: column,
+ extract: [
+ lines[line - 1],
+ lines[line],
+ lines[line + 1]
+ ]
+ };
+ }
+ if (options.compress) {
+ return css.replace(/(\s)+/g, "$1");
+ } else {
+ return css;
+ }
+
+ function getLine(index) {
+ return index ? (input.slice(0, index).match(/\n/g) || "").length : null;
+ }
+ };
+ })(root.eval);
+
+ // If `i` is smaller than the `input.length - 1`,
+ // it means the parser wasn't able to parse the whole
+ // string, so we've got a parsing error.
+ //
+ // We try to extract a \n delimited string,
+ // showing the line where the parse error occured.
+ // We split it up into two parts (the part which parsed,
+ // and the part which didn't), so we can color them differently.
+ if (i < input.length - 1) {
+ i = furthest;
+ lines = input.split('\n');
+ line = (input.slice(0, i).match(/\n/g) || "").length + 1;
+
+ for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ }
+
+ error = {
+ name: "ParseError",
+ message: "Syntax Error on line " + line,
+ index: i,
+ filename: env.filename,
+ line: line,
+ column: column,
+ extract: [
+ lines[line - 2],
+ lines[line - 1],
+ lines[line]
+ ]
+ };
+ }
+
+ if (this.imports.queue.length > 0) {
+ finish = function () { callback(error, root) };
+ } else {
+ callback(error, root);
+ }
+ },
+
+ //
+ // Here in, the parsing rules/functions
+ //
+ // The basic structure of the syntax tree generated is as follows:
+ //
+ // Ruleset -> Rule -> Value -> Expression -> Entity
+ //
+ // Here's some LESS code:
+ //
+ // .class {
+ // color: #fff;
+ // border: 1px solid #000;
+ // width: @w + 4px;
+ // > .child {...}
+ // }
+ //
+ // And here's what the parse tree might look like:
+ //
+ // Ruleset (Selector '.class', [
+ // Rule ("color", Value ([Expression [Color #fff]]))
+ // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]]))
+ // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]]))
+ // Ruleset (Selector [Element '>', '.child'], [...])
+ // ])
+ //
+ // In general, most rules will try to parse a token with the `$()` function, and if the return
+ // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
+ // first, before parsing, that's when we use `peek()`.
+ //
+ parsers: {
+ //
+ // The `primary` rule is the *entry* and *exit* point of the parser.
+ // The rules here can appear at any level of the parse tree.
+ //
+ // The recursive nature of the grammar is an interplay between the `block`
+ // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
+ // as represented by this simplified grammar:
+ //
+ // primary → (ruleset | rule)+
+ // ruleset → selector+ block
+ // block → '{' primary '}'
+ //
+ // Only at one point is the primary rule not called from the
+ // block rule: at the root level.
+ //
+ primary: function () {
+ var node, root = [];
+
+ while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
+ $(this.mixin.call) || $(this.comment) || $(this.directive))
+ || $(/^[\s\n]+/)) {
+ node && root.push(node);
+ }
+ return root;
+ },
+
+ // We create a Comment node for CSS comments `/* */`,
+ // but keep the LeSS comments `//` silent, by just skipping
+ // over them.
+ comment: function () {
+ var comment;
+
+ if (input.charAt(i) !== '/') return;
+
+ if (input.charAt(i + 1) === '/') {
+ return new(tree.Comment)($(/^\/\/.*/), true);
+ } else if (comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
+ return new(tree.Comment)(comment);
+ }
+ },
+
+ //
+ // Entities are tokens which can be found inside an Expression
+ //
+ entities: {
+ //
+ // A string, which supports escaping " and '
+ //
+ // "milky way" 'he\'s the one!'
+ //
+ quoted: function () {
+ var str, j = i, e;
+
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
+ if (input.charAt(j) !== '"' && input.charAt(j) !== "'") return;
+
+ e && $('~');
+
+ if (str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) {
+ return new(tree.Quoted)(str[0], str[1] || str[2], e);
+ }
+ },
+
+ //
+ // A catch-all word, such as:
+ //
+ // black border-collapse
+ //
+ keyword: function () {
+ var k;
+ if (k = $(/^[A-Za-z-]+/)) { return new(tree.Keyword)(k) }
+ },
+
+ //
+ // A function call
+ //
+ // rgb(255, 0, 255)
+ //
+ // We also try to catch IE's `alpha()`, but let the `alpha` parser
+ // deal with the details.
+ //
+ // The arguments are parsed with the `entities.arguments` parser.
+ //
+ call: function () {
+ var name, args;
+
+ if (! (name = /^([\w-]+|%)\(/.exec(chunks[j]))) return;
+
+ name = name[1].toLowerCase();
+
+ if (name === 'url') { return null }
+ else { i += name.length }
+
+ if (name === 'alpha') { return $(this.alpha) }
+
+ $('('); // Parse the '(' and consume whitespace.
+
+ args = $(this.entities.arguments);
+
+ if (! $(')')) return;
+
+ if (name) { return new(tree.Call)(name, args) }
+ },
+ arguments: function () {
+ var args = [], arg;
+
+ while (arg = $(this.expression)) {
+ args.push(arg);
+ if (! $(',')) { break }
+ }
+ return args;
+ },
+ literal: function () {
+ return $(this.entities.dimension) ||
+ $(this.entities.color) ||
+ $(this.entities.quoted);
+ },
+
+ //
+ // Parse url() tokens
+ //
+ // We use a specific rule for urls, because they don't really behave like
+ // standard function calls. The difference is that the argument doesn't have
+ // to be enclosed within a string, so it can't be parsed as an Expression.
+ //
+ url: function () {
+ var value;
+
+ if (input.charAt(i) !== 'u' || !$(/^url\(/)) return;
+ value = $(this.entities.quoted) || $(this.entities.variable) ||
+ $(this.entities.dataURI) || $(/^[-\w%@$\/.&=:;#+?~]+/) || "";
+ if (! $(')')) throw new(Error)("missing closing ) for url()");
+
+ return new(tree.URL)((value.value || value.data || value instanceof tree.Variable)
+ ? value : new(tree.Anonymous)(value), imports.paths);
+ },
+
+ dataURI: function () {
+ var obj;
+
+ if ($(/^data:/)) {
+ obj = {};
+ obj.mime = $(/^[^\/]+\/[^,;)]+/) || '';
+ obj.charset = $(/^;\s*charset=[^,;)]+/) || '';
+ obj.base64 = $(/^;\s*base64/) || '';
+ obj.data = $(/^,\s*[^)]+/);
+
+ if (obj.data) { return obj }
+ }
+ },
+
+ //
+ // A Variable entity, such as `@fink`, in
+ //
+ // width: @fink + 2px
+ //
+ // We use a different parser for variable definitions,
+ // see `parsers.variable`.
+ //
+ variable: function () {
+ var name, index = i;
+
+ if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
+ return new(tree.Variable)(name, index);
+ }
+ },
+
+ //
+ // A Hexadecimal color
+ //
+ // #4F3C2F
+ //
+ // `rgb` and `hsl` colors are parsed through the `entities.call` parser.
+ //
+ color: function () {
+ var rgb;
+
+ if (input.charAt(i) === '#' && (rgb = $(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
+ return new(tree.Color)(rgb[1]);
+ }
+ },
+
+ //
+ // A Dimension, that is, a number and a unit
+ //
+ // 0.5em 95%
+ //
+ dimension: function () {
+ var value, c = input.charCodeAt(i);
+ if ((c > 57 || c < 45) || c === 47) return;
+
+ if (value = $(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) {
+ return new(tree.Dimension)(value[1], value[2]);
+ }
+ },
+
+ //
+ // JavaScript code to be evaluated
+ //
+ // `window.location.href`
+ //
+ javascript: function () {
+ var str, j = i, e;
+
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
+ if (input.charAt(j) !== '`') { return }
+
+ e && $('~');
+
+ if (str = $(/^`([^`]*)`/)) {
+ return new(tree.JavaScript)(str[1], i, e);
+ }
+ }
+ },
+
+ //
+ // The variable part of a variable definition. Used in the `rule` parser
+ //
+ // @fink:
+ //
+ variable: function () {
+ var name;
+
+ if (input.charAt(i) === '@' && (name = $(/^(@[\w-]+)\s*:/))) { return name[1] }
+ },
+
+ //
+ // A font size/line-height shorthand
+ //
+ // small/12px
+ //
+ // We need to peek first, or we'll match on keywords and dimensions
+ //
+ shorthand: function () {
+ var a, b;
+
+ if (! peek(/^[@\w.%-]+\/[@\w.-]+/)) return;
+
+ if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) {
+ return new(tree.Shorthand)(a, b);
+ }
+ },
+
+ //
+ // Mixins
+ //
+ mixin: {
+ //
+ // A Mixin call, with an optional argument list
+ //
+ // #mixins > .square(#fff);
+ // .rounded(4px, black);
+ // .button;
+ //
+ // The `while` loop is there because mixins can be
+ // namespaced, but we only support the child and descendant
+ // selector for now.
+ //
+ call: function () {
+ var elements = [], e, c, args, index = i, s = input.charAt(i);
+
+ if (s !== '.' && s !== '#') { return }
+
+ while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
+ elements.push(new(tree.Element)(c, e));
+ c = $('>');
+ }
+ $('(') && (args = $(this.entities.arguments)) && $(')');
+
+ if (elements.length > 0 && ($(';') || peek('}'))) {
+ return new(tree.mixin.Call)(elements, args, index);
+ }
+ },
+
+ //
+ // A Mixin definition, with a list of parameters
+ //
+ // .rounded (@radius: 2px, @color) {
+ // ...
+ // }
+ //
+ // Until we have a finer grained state-machine, we have to
+ // do a look-ahead, to make sure we don't have a mixin call.
+ // See the `rule` function for more information.
+ //
+ // We start by matching `.rounded (`, and then proceed on to
+ // the argument list, which has optional default values.
+ // We store the parameters in `params`, with a `value` key,
+ // if there is a value, such as in the case of `@radius`.
+ //
+ // Once we've got our params list, and a closing `)`, we parse
+ // the `{...}` block.
+ //
+ definition: function () {
+ var name, params = [], match, ruleset, param, value;
+
+ if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
+ peek(/^[^{]*(;|})/)) return;
+
+ if (match = $(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)) {
+ name = match[1];
+
+ while (param = $(this.entities.variable) || $(this.entities.literal)
+ || $(this.entities.keyword)) {
+ // Variable
+ if (param instanceof tree.Variable) {
+ if ($(':')) {
+ if (value = $(this.expression)) {
+ params.push({ name: param.name, value: value });
+ } else {
+ throw new(Error)("Expected value");
+ }
+ } else {
+ params.push({ name: param.name });
+ }
+ } else {
+ params.push({ value: param });
+ }
+ if (! $(',')) { break }
+ }
+ if (! $(')')) throw new(Error)("Expected )");
+
+ ruleset = $(this.block);
+
+ if (ruleset) {
+ return new(tree.mixin.Definition)(name, params, ruleset);
+ }
+ }
+ }
+ },
+
+ //
+ // Entities are the smallest recognized token,
+ // and can be found inside a rule's value.
+ //
+ entity: function () {
+ return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) ||
+ $(this.entities.call) || $(this.entities.keyword) || $(this.entities.javascript) ||
+ $(this.comment);
+ },
+
+ //
+ // A Rule terminator. Note that we use `peek()` to check for '}',
+ // because the `block` rule will be expecting it, but we still need to make sure
+ // it's there, if ';' was ommitted.
+ //
+ end: function () {
+ return $(';') || peek('}');
+ },
+
+ //
+ // IE's alpha function
+ //
+ // alpha(opacity=88)
+ //
+ alpha: function () {
+ var value;
+
+ if (! $(/^opacity=/i)) return;
+ if (value = $(/^\d+/) || $(this.entities.variable)) {
+ if (! $(')')) throw new(Error)("missing closing ) for alpha()");
+ return new(tree.Alpha)(value);
+ }
+ },
+
+ //
+ // A Selector Element
+ //
+ // div
+ // + h1
+ // #socks
+ // input[type="text"]
+ //
+ // Elements are the building blocks for Selectors,
+ // they are made out of a `Combinator` (see combinator rule),
+ // and an element name, such as a tag a class, or `*`.
+ //
+ element: function () {
+ var e, t, c;
+
+ c = $(this.combinator);
+ e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/);
+
+ if (e) { return new(tree.Element)(c, e) }
+ },
+
+ //
+ // Combinators combine elements together, in a Selector.
+ //
+ // Because our parser isn't white-space sensitive, special care
+ // has to be taken, when parsing the descendant combinator, ` `,
+ // as it's an empty space. We have to check the previous character
+ // in the input, to see if it's a ` ` character. More info on how
+ // we deal with this in *combinator.js*.
+ //
+ combinator: function () {
+ var match, c = input.charAt(i);
+
+ if (c === '>' || c === '&' || c === '+' || c === '~') {
+ i++;
+ while (input.charAt(i) === ' ') { i++ }
+ return new(tree.Combinator)(c);
+ } else if (c === ':' && input.charAt(i + 1) === ':') {
+ i += 2;
+ while (input.charAt(i) === ' ') { i++ }
+ return new(tree.Combinator)('::');
+ } else if (input.charAt(i - 1) === ' ') {
+ return new(tree.Combinator)(" ");
+ } else {
+ return new(tree.Combinator)(null);
+ }
+ },
+
+ //
+ // A CSS Selector
+ //
+ // .class > div + h1
+ // li a:hover
+ //
+ // Selectors are made out of one or more Elements, see above.
+ //
+ selector: function () {
+ var sel, e, elements = [], c, match;
+
+ while (e = $(this.element)) {
+ c = input.charAt(i);
+ elements.push(e)
+ if (c === '{' || c === '}' || c === ';' || c === ',') { break }
+ }
+
+ if (elements.length > 0) { return new(tree.Selector)(elements) }
+ },
+ tag: function () {
+ return $(/^[a-zA-Z][a-zA-Z-]*[0-9]?/) || $('*');
+ },
+ attribute: function () {
+ var attr = '', key, val, op;
+
+ if (! $('[')) return;
+
+ if (key = $(/^[a-zA-Z-]+/) || $(this.entities.quoted)) {
+ if ((op = $(/^[|~*$^]?=/)) &&
+ (val = $(this.entities.quoted) || $(/^[\w-]+/))) {
+ attr = [key, op, val.toCSS ? val.toCSS() : val].join('');
+ } else { attr = key }
+ }
+
+ if (! $(']')) return;
+
+ if (attr) { return "[" + attr + "]" }
+ },
+
+ //
+ // The `block` rule is used by `ruleset` and `mixin.definition`.
+ // It's a wrapper around the `primary` rule, with added `{}`.
+ //
+ block: function () {
+ var content;
+
+ if ($('{') && (content = $(this.primary)) && $('}')) {
+ return content;
+ }
+ },
+
+ //
+ // div, .class, body > p {...}
+ //
+ ruleset: function () {
+ var selectors = [], s, rules, match;
+ save();
+
+ if (match = /^([.#: \w-]+)[\s\n]*\{/.exec(chunks[j])) {
+ i += match[0].length - 1;
+ selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
+ } else {
+ while (s = $(this.selector)) {
+ selectors.push(s);
+ $(this.comment);
+ if (! $(',')) { break }
+ $(this.comment);
+ }
+ }
+
+ if (selectors.length > 0 && (rules = $(this.block))) {
+ return new(tree.Ruleset)(selectors, rules);
+ } else {
+ // Backtrack
+ furthest = i;
+ restore();
+ }
+ },
+ rule: function () {
+ var name, value, c = input.charAt(i), important, match;
+ save();
+
+ if (c === '.' || c === '#' || c === '&') { return }
+
+ if (name = $(this.variable) || $(this.property)) {
+ if ((name.charAt(0) != '@') && (match = /^([^@+\/'"*`(;{}-]*);/.exec(chunks[j]))) {
+ i += match[0].length - 1;
+ value = new(tree.Anonymous)(match[1]);
+ } else if (name === "font") {
+ value = $(this.font);
+ } else {
+ value = $(this.value);
+ }
+ important = $(this.important);
+
+ if (value && $(this.end)) {
+ return new(tree.Rule)(name, value, important, memo);
+ } else {
+ furthest = i;
+ restore();
+ }
+ }
+ },
+
+ //
+ // An @import directive
+ //
+ // @import "lib";
+ //
+ // Depending on our environemnt, importing is done differently:
+ // In the browser, it's an XHR request, in Node, it would be a
+ // file-system operation. The function used for importing is
+ // stored in `import`, which we pass to the Import constructor.
+ //
+ "import": function () {
+ var path;
+ if ($(/^@import\s+/) &&
+ (path = $(this.entities.quoted) || $(this.entities.url)) &&
+ $(';')) {
+ return new(tree.Import)(path, imports);
+ }
+ },
+
+ //
+ // A CSS Directive
+ //
+ // @charset "utf-8";
+ //
+ directive: function () {
+ var name, value, rules, types;
+
+ if (input.charAt(i) !== '@') return;
+
+ if (value = $(this['import'])) {
+ return value;
+ } else if (name = $(/^@media|@page|@-[-a-z]+/)) {
+ types = ($(/^[^{]+/) || '').trim();
+ if (rules = $(this.block)) {
+ return new(tree.Directive)(name + " " + types, rules);
+ }
+ } else if (name = $(/^@[-a-z]+/)) {
+ if (name === '@font-face') {
+ if (rules = $(this.block)) {
+ return new(tree.Directive)(name, rules);
+ }
+ } else if ((value = $(this.entity)) && $(';')) {
+ return new(tree.Directive)(name, value);
+ }
+ }
+ },
+ font: function () {
+ var value = [], expression = [], weight, shorthand, font, e;
+
+ while (e = $(this.shorthand) || $(this.entity)) {
+ expression.push(e);
+ }
+ value.push(new(tree.Expression)(expression));
+
+ if ($(',')) {
+ while (e = $(this.expression)) {
+ value.push(e);
+ if (! $(',')) { break }
+ }
+ }
+ return new(tree.Value)(value);
+ },
+
+ //
+ // A Value is a comma-delimited list of Expressions
+ //
+ // font-family: Baskerville, Georgia, serif;
+ //
+ // In a Rule, a Value represents everything after the `:`,
+ // and before the `;`.
+ //
+ value: function () {
+ var e, expressions = [], important;
+
+ while (e = $(this.expression)) {
+ expressions.push(e);
+ if (! $(',')) { break }
+ }
+
+ if (expressions.length > 0) {
+ return new(tree.Value)(expressions);
+ }
+ },
+ important: function () {
+ if (input.charAt(i) === '!') {
+ return $(/^! *important/);
+ }
+ },
+ sub: function () {
+ var e;
+
+ if ($('(') && (e = $(this.expression)) && $(')')) {
+ return e;
+ }
+ },
+ multiplication: function () {
+ var m, a, op, operation;
+ if (m = $(this.operand)) {
+ while ((op = ($('/') || $('*'))) && (a = $(this.operand))) {
+ operation = new(tree.Operation)(op, [operation || m, a]);
+ }
+ return operation || m;
+ }
+ },
+ addition: function () {
+ var m, a, op, operation;
+ if (m = $(this.multiplication)) {
+ while ((op = $(/^[-+]\s+/) || (input.charAt(i - 1) != ' ' && ($('+') || $('-')))) &&
+ (a = $(this.multiplication))) {
+ operation = new(tree.Operation)(op, [operation || m, a]);
+ }
+ return operation || m;
+ }
+ },
+
+ //
+ // An operand is anything that can be part of an operation,
+ // such as a Color, or a Variable
+ //
+ operand: function () {
+ var negate, p = input.charAt(i + 1);
+
+ if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
+ var o = $(this.sub) || $(this.entities.dimension) ||
+ $(this.entities.color) || $(this.entities.variable) ||
+ $(this.entities.call);
+ return negate ? new(tree.Operation)('*', [new(tree.Dimension)(-1), o])
+ : o;
+ },
+
+ //
+ // Expressions either represent mathematical operations,
+ // or white-space delimited Entities.
+ //
+ // 1px solid black
+ // @var * 2
+ //
+ expression: function () {
+ var e, delim, entities = [], d;
+
+ while (e = $(this.addition) || $(this.entity)) {
+ entities.push(e);
+ }
+ if (entities.length > 0) {
+ return new(tree.Expression)(entities);
+ }
+ },
+ property: function () {
+ var name;
+
+ if (name = $(/^(\*?-?[-a-z_0-9]+)\s*:/)) {
+ return name[1];
+ }
+ }
+ }
+ };
+};
+
+if (typeof(window) !== 'undefined') {
+ //
+ // Used by `@import` directives
+ //
+ less.Parser.importer = function (path, paths, callback, env) {
+ if (path.charAt(0) !== '/' && paths.length > 0) {
+ path = paths[0] + path;
+ }
+ // We pass `true` as 3rd argument, to force the reload of the import.
+ // This is so we can get the syntax tree as opposed to just the CSS output,
+ // as we need this to evaluate the current stylesheet.
+ loadStyleSheet({ href: path, title: path, type: env.mime }, callback, true);
+ };
+}
+
+(function (tree) {
+
+tree.functions = {
+ rgb: function (r, g, b) {
+ return this.rgba(r, g, b, 1.0);
+ },
+ rgba: function (r, g, b, a) {
+ var rgb = [r, g, b].map(function (c) { return number(c) }),
+ a = number(a);
+ return new(tree.Color)(rgb, a);
+ },
+ hsl: function (h, s, l) {
+ return this.hsla(h, s, l, 1.0);
+ },
+ hsla: function (h, s, l, a) {
+ h = (number(h) % 360) / 360;
+ s = number(s); l = number(l); a = number(a);
+
+ var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
+ var m1 = l * 2 - m2;
+
+ return this.rgba(hue(h + 1/3) * 255,
+ hue(h) * 255,
+ hue(h - 1/3) * 255,
+ a);
+
+ function hue(h) {
+ h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
+ if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
+ else if (h * 2 < 1) return m2;
+ else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;
+ else return m1;
+ }
+ },
+ hue: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().h));
+ },
+ saturation: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%');
+ },
+ lightness: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
+ },
+ alpha: function (color) {
+ return new(tree.Dimension)(color.toHSL().a);
+ },
+ saturate: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.s += amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ desaturate: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.s -= amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ lighten: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l += amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ darken: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l -= amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ fadein: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a += amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ fadeout: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a -= amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ spin: function (color, amount) {
+ var hsl = color.toHSL();
+ var hue = (hsl.h + amount.value) % 360;
+
+ hsl.h = hue < 0 ? 360 + hue : hue;
+
+ return hsla(hsl);
+ },
+ //
+ // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
+ // http://sass-lang.com
+ //
+ mix: function (color1, color2, weight) {
+ var p = weight.value / 100.0;
+ var w = p * 2 - 1;
+ var a = color1.toHSL().a - color2.toHSL().a;
+
+ var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
+ var w2 = 1 - w1;
+
+ var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
+ color1.rgb[1] * w1 + color2.rgb[1] * w2,
+ color1.rgb[2] * w1 + color2.rgb[2] * w2];
+
+ var alpha = color1.alpha * p + color2.alpha * (1 - p);
+
+ return new(tree.Color)(rgb, alpha);
+ },
+ greyscale: function (color) {
+ return this.desaturate(color, new(tree.Dimension)(100));
+ },
+ e: function (str) {
+ return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
+ },
+ escape: function (str) {
+ return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"));
+ },
+ '%': function (quoted /* arg, arg, ...*/) {
+ var args = Array.prototype.slice.call(arguments, 1),
+ str = quoted.value;
+
+ for (var i = 0; i < args.length; i++) {
+ str = str.replace(/%[sda]/i, function(token) {
+ var value = token.match(/s/i) ? args[i].value : args[i].toCSS();
+ return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
+ });
+ }
+ str = str.replace(/%%/g, '%');
+ return new(tree.Quoted)('"' + str + '"', str);
+ },
+ round: function (n) {
+ if (n instanceof tree.Dimension) {
+ return new(tree.Dimension)(Math.round(number(n)), n.unit);
+ } else if (typeof(n) === 'number') {
+ return Math.round(n);
+ } else {
+ throw {
+ error: "RuntimeError",
+ message: "math functions take numbers as parameters"
+ };
+ }
+ }
+};
+
+function hsla(hsla) {
+ return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a);
+}
+
+function number(n) {
+ if (n instanceof tree.Dimension) {
+ return parseFloat(n.unit == '%' ? n.value / 100 : n.value);
+ } else if (typeof(n) === 'number') {
+ return n;
+ } else {
+ throw {
+ error: "RuntimeError",
+ message: "color functions take numbers as parameters"
+ };
+ }
+}
+
+function clamp(val) {
+ return Math.min(1, Math.max(0, val));
+}
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Alpha = function (val) {
+ this.value = val;
+};
+tree.Alpha.prototype = {
+ toCSS: function () {
+ return "alpha(opacity=" +
+ (this.value.toCSS ? this.value.toCSS() : this.value) + ")";
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Anonymous = function (string) {
+ this.value = string.value || string;
+};
+tree.Anonymous.prototype = {
+ toCSS: function () {
+ return this.value;
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+//
+// A function call node.
+//
+tree.Call = function (name, args) {
+ this.name = name;
+ this.args = args;
+};
+tree.Call.prototype = {
+ //
+ // When evaluating a function call,
+ // we either find the function in `tree.functions` [1],
+ // in which case we call it, passing the evaluated arguments,
+ // or we simply print it out as it appeared originally [2].
+ //
+ // The *functions.js* file contains the built-in functions.
+ //
+ // The reason why we evaluate the arguments, is in the case where
+ // we try to pass a variable to a function, like: `saturate(@color)`.
+ // The function should receive the value, not the variable.
+ //
+ eval: function (env) {
+ var args = this.args.map(function (a) { return a.eval(env) });
+
+ if (this.name in tree.functions) { // 1.
+ return tree.functions[this.name].apply(tree.functions, args);
+ } else { // 2.
+ return new(tree.Anonymous)(this.name +
+ "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")");
+ }
+ },
+
+ toCSS: function (env) {
+ return this.eval(env).toCSS();
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+//
+// RGB Colors - #ff0014, #eee
+//
+tree.Color = function (rgb, a) {
+ //
+ // The end goal here, is to parse the arguments
+ // into an integer triplet, such as `128, 255, 0`
+ //
+ // This facilitates operations and conversions.
+ //
+ if (Array.isArray(rgb)) {
+ this.rgb = rgb;
+ } else if (rgb.length == 6) {
+ this.rgb = rgb.match(/.{2}/g).map(function (c) {
+ return parseInt(c, 16);
+ });
+ } else if (rgb.length == 8) {
+ this.alpha = parseInt(rgb.substring(0,2), 16) / 255.0;
+ this.rgb = rgb.substr(2).match(/.{2}/g).map(function (c) {
+ return parseInt(c, 16);
+ });
+ } else {
+ this.rgb = rgb.split('').map(function (c) {
+ return parseInt(c + c, 16);
+ });
+ }
+ this.alpha = typeof(a) === 'number' ? a : 1;
+};
+tree.Color.prototype = {
+ eval: function () { return this },
+
+ //
+ // If we have some transparency, the only way to represent it
+ // is via `rgba`. Otherwise, we use the hex representation,
+ // which has better compatibility with older browsers.
+ // Values are capped between `0` and `255`, rounded and zero-padded.
+ //
+ toCSS: function () {
+ if (this.alpha < 1.0) {
+ return "rgba(" + this.rgb.map(function (c) {
+ return Math.round(c);
+ }).concat(this.alpha).join(', ') + ")";
+ } else {
+ return '#' + this.rgb.map(function (i) {
+ i = Math.round(i);
+ i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
+ return i.length === 1 ? '0' + i : i;
+ }).join('');
+ }
+ },
+
+ //
+ // Operations have to be done per-channel, if not,
+ // channels will spill onto each other. Once we have
+ // our result, in the form of an integer triplet,
+ // we create a new Color node to hold the result.
+ //
+ operate: function (op, other) {
+ var result = [];
+
+ if (! (other instanceof tree.Color)) {
+ other = other.toColor();
+ }
+
+ for (var c = 0; c < 3; c++) {
+ result[c] = tree.operate(op, this.rgb[c], other.rgb[c]);
+ }
+ return new(tree.Color)(result, this.alpha + other.alpha);
+ },
+
+ toHSL: function () {
+ var r = this.rgb[0] / 255,
+ g = this.rgb[1] / 255,
+ b = this.rgb[2] / 255,
+ a = this.alpha;
+
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
+ var h, s, l = (max + min) / 2, d = max - min;
+
+ if (max === min) {
+ h = s = 0;
+ } else {
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+
+ switch (max) {
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+ case g: h = (b - r) / d + 2; break;
+ case b: h = (r - g) / d + 4; break;
+ }
+ h /= 6;
+ }
+ return { h: h * 360, s: s, l: l, a: a };
+ }
+};
+
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Comment = function (value, silent) {
+ this.value = value;
+ this.silent = !!silent;
+};
+tree.Comment.prototype = {
+ toCSS: function (env) {
+ return env.compress ? '' : this.value;
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+//
+// A number with a unit
+//
+tree.Dimension = function (value, unit) {
+ this.value = parseFloat(value);
+ this.unit = unit || null;
+};
+
+tree.Dimension.prototype = {
+ eval: function () { return this },
+ toColor: function () {
+ return new(tree.Color)([this.value, this.value, this.value]);
+ },
+ toCSS: function () {
+ var css = this.value + this.unit;
+ return css;
+ },
+
+ // In an operation between two Dimensions,
+ // we default to the first Dimension's unit,
+ // so `1px + 2em` will yield `3px`.
+ // In the future, we could implement some unit
+ // conversions such that `100cm + 10mm` would yield
+ // `101cm`.
+ operate: function (op, other) {
+ return new(tree.Dimension)
+ (tree.operate(op, this.value, other.value),
+ this.unit || other.unit);
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Directive = function (name, value) {
+ this.name = name;
+ if (Array.isArray(value)) {
+ this.ruleset = new(tree.Ruleset)([], value);
+ } else {
+ this.value = value;
+ }
+};
+tree.Directive.prototype = {
+ toCSS: function (ctx, env) {
+ if (this.ruleset) {
+ this.ruleset.root = true;
+ return this.name + (env.compress ? '{' : ' {\n ') +
+ this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') +
+ (env.compress ? '}': '\n}\n');
+ } else {
+ return this.name + ' ' + this.value.toCSS() + ';\n';
+ }
+ },
+ eval: function (env) {
+ env.frames.unshift(this);
+ this.ruleset = this.ruleset && this.ruleset.eval(env);
+ env.frames.shift();
+ return this;
+ },
+ variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
+ find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
+ rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Element = function (combinator, value) {
+ this.combinator = combinator instanceof tree.Combinator ?
+ combinator : new(tree.Combinator)(combinator);
+ this.value = value.trim();
+};
+tree.Element.prototype.toCSS = function (env) {
+ return this.combinator.toCSS(env || {}) + this.value;
+};
+
+tree.Combinator = function (value) {
+ if (value === ' ') {
+ this.value = ' ';
+ } else {
+ this.value = value ? value.trim() : "";
+ }
+};
+tree.Combinator.prototype.toCSS = function (env) {
+ return {
+ '' : '',
+ ' ' : ' ',
+ '&' : '',
+ ':' : ' :',
+ '::': '::',
+ '+' : env.compress ? '+' : ' + ',
+ '~' : env.compress ? '~' : ' ~ ',
+ '>' : env.compress ? '>' : ' > '
+ }[this.value];
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Expression = function (value) { this.value = value };
+tree.Expression.prototype = {
+ eval: function (env) {
+ if (this.value.length > 1) {
+ return new(tree.Expression)(this.value.map(function (e) {
+ return e.eval(env);
+ }));
+ } else {
+ return this.value[0].eval(env);
+ }
+ },
+ toCSS: function (env) {
+ return this.value.map(function (e) {
+ return e.toCSS(env);
+ }).join(' ');
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+//
+// CSS @import node
+//
+// The general strategy here is that we don't want to wait
+// for the parsing to be completed, before we start importing
+// the file. That's because in the context of a browser,
+// most of the time will be spent waiting for the server to respond.
+//
+// On creation, we push the import path to our import queue, though
+// `import,push`, we also pass it a callback, which it'll call once
+// the file has been fetched, and parsed.
+//
+tree.Import = function (path, imports) {
+ var that = this;
+
+ this._path = path;
+
+ // The '.less' extension is optional
+ if (path instanceof tree.Quoted) {
+ this.path = /\.(le?|c)ss$/.test(path.value) ? path.value : path.value + '.less';
+ } else {
+ this.path = path.value.value || path.value;
+ }
+
+ this.css = /css$/.test(this.path);
+
+ // Only pre-compile .less files
+ if (! this.css) {
+ imports.push(this.path, function (root) {
+ if (! root) {
+ throw new(Error)("Error parsing " + that.path);
+ }
+ that.root = root;
+ });
+ }
+};
+
+//
+// The actual import node doesn't return anything, when converted to CSS.
+// The reason is that it's used at the evaluation stage, so that the rules
+// it imports can be treated like any other rules.
+//
+// In `eval`, we make sure all Import nodes get evaluated, recursively, so
+// we end up with a flat structure, which can easily be imported in the parent
+// ruleset.
+//
+tree.Import.prototype = {
+ toCSS: function () {
+ if (this.css) {
+ return "@import " + this._path.toCSS() + ';\n';
+ } else {
+ return "";
+ }
+ },
+ eval: function (env) {
+ var ruleset;
+
+ if (this.css) {
+ return this;
+ } else {
+ ruleset = new(tree.Ruleset)(null, this.root.rules.slice(0));
+
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.Import) {
+ Array.prototype
+ .splice
+ .apply(ruleset.rules,
+ [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+ return ruleset.rules;
+ }
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.JavaScript = function (string, index, escaped) {
+ this.escaped = escaped;
+ this.expression = string;
+ this.index = index;
+};
+tree.JavaScript.prototype = {
+ toCSS: function () {
+ if (this.escaped) {
+ return this.evaluated;
+ } else {
+ return JSON.stringify(this.evaluated);
+ }
+ },
+ eval: function (env) {
+ var result,
+ context = {};
+
+ var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
+ return new(tree.Variable)('@' + name).eval(env).value;
+ });
+
+ expression = new(Function)('return (' + expression + ')');
+
+ for (var k in env.frames[0].variables()) {
+ context[k.slice(1)] = {
+ value: env.frames[0].variables()[k].value,
+ toJS: function () {
+ return this.value.eval(env).toCSS();
+ }
+ };
+ }
+
+ try {
+ this.evaluated = expression.call(context);
+ } catch (e) {
+ throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" ,
+ index: this.index };
+ }
+ return this;
+ }
+};
+
+})(require('less/tree'));
+
+(function (tree) {
+
+tree.Keyword = function (value) { this.value = value };
+tree.Keyword.prototype = {
+ eval: function () { return this },
+ toCSS: function () { return this.value }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.mixin = {};
+tree.mixin.Call = function (elements, args, index) {
+ this.selector = new(tree.Selector)(elements);
+ this.arguments = args;
+ this.index = index;
+};
+tree.mixin.Call.prototype = {
+ eval: function (env) {
+ var mixins, rules = [], match = false;
+
+ for (var i = 0; i < env.frames.length; i++) {
+ if ((mixins = env.frames[i].find(this.selector)).length > 0) {
+ for (var m = 0; m < mixins.length; m++) {
+ if (mixins[m].match(this.arguments, env)) {
+ try {
+ Array.prototype.push.apply(
+ rules, mixins[m].eval(env, this.arguments).rules);
+ match = true;
+ } catch (e) {
+ throw { message: e.message, index: e.index, stack: e.stack, call: this.index };
+ }
+ }
+ }
+ if (match) {
+ return rules;
+ } else {
+ throw { message: 'No matching definition was found for `' +
+ this.selector.toCSS().trim() + '(' +
+ this.arguments.map(function (a) {
+ return a.toCSS();
+ }).join(', ') + ")`",
+ index: this.index };
+ }
+ }
+ }
+ throw { message: this.selector.toCSS().trim() + " is undefined",
+ index: this.index };
+ }
+};
+
+tree.mixin.Definition = function (name, params, rules) {
+ this.name = name;
+ this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
+ this.params = params;
+ this.arity = params.length;
+ this.rules = rules;
+ this._lookups = {};
+ this.required = params.reduce(function (count, p) {
+ if (!p.name || (p.name && !p.value)) { return count + 1 }
+ else { return count }
+ }, 0);
+ this.parent = tree.Ruleset.prototype;
+ this.frames = [];
+};
+tree.mixin.Definition.prototype = {
+ toCSS: function () { return "" },
+ variable: function (name) { return this.parent.variable.call(this, name) },
+ variables: function () { return this.parent.variables.call(this) },
+ find: function () { return this.parent.find.apply(this, arguments) },
+ rulesets: function () { return this.parent.rulesets.apply(this) },
+
+ eval: function (env, args) {
+ var frame = new(tree.Ruleset)(null, []), context, _arguments = [];
+
+ for (var i = 0, val; i < this.params.length; i++) {
+ if (this.params[i].name) {
+ if (val = (args && args[i]) || this.params[i].value) {
+ frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env)));
+ } else {
+ throw { message: "wrong number of arguments for " + this.name +
+ ' (' + args.length + ' for ' + this.arity + ')' };
+ }
+ }
+ }
+ for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) {
+ _arguments.push(args[i] || this.params[i].value);
+ }
+ frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments)));
+
+ return new(tree.Ruleset)(null, this.rules.slice(0)).eval({
+ frames: [this, frame].concat(this.frames, env.frames)
+ });
+ },
+ match: function (args, env) {
+ var argsLength = (args && args.length) || 0, len;
+
+ if (argsLength < this.required) { return false }
+ if ((this.required > 0) && (argsLength > this.params.length)) { return false }
+
+ len = Math.min(argsLength, this.arity);
+
+ for (var i = 0; i < len; i++) {
+ if (!this.params[i].name) {
+ if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Operation = function (op, operands) {
+ this.op = op.trim();
+ this.operands = operands;
+};
+tree.Operation.prototype.eval = function (env) {
+ var a = this.operands[0].eval(env),
+ b = this.operands[1].eval(env),
+ temp;
+
+ if (a instanceof tree.Dimension && b instanceof tree.Color) {
+ if (this.op === '*' || this.op === '+') {
+ temp = b, b = a, a = temp;
+ } else {
+ throw { name: "OperationError",
+ message: "Can't substract or divide a color from a number" };
+ }
+ }
+ return a.operate(this.op, b);
+};
+
+tree.operate = function (op, a, b) {
+ switch (op) {
+ case '+': return a + b;
+ case '-': return a - b;
+ case '*': return a * b;
+ case '/': return a / b;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Quoted = function (str, content, escaped, i) {
+ this.escaped = escaped;
+ this.value = content || '';
+ this.quote = str.charAt(0);
+ this.index = i;
+};
+tree.Quoted.prototype = {
+ toCSS: function () {
+ if (this.escaped) {
+ return this.value;
+ } else {
+ return this.quote + this.value + this.quote;
+ }
+ },
+ eval: function (env) {
+ this.value = this.value.replace(/@\{([\w-]+)\}/g, function (_, name) {
+ return new(tree.Variable)('@' + name).eval(env).value;
+ }).replace(/`([^`]+)`/g, function (_, exp) {
+ return new(tree.JavaScript)(exp, this.index, true).eval(env).toCSS();
+ });
+ return this;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Rule = function (name, value, important, index) {
+ this.name = name;
+ this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
+ this.important = important ? ' ' + important.trim() : '';
+ this.index = index;
+
+ if (name.charAt(0) === '@') {
+ this.variable = true;
+ } else { this.variable = false }
+};
+tree.Rule.prototype.toCSS = function (env) {
+ if (this.variable) { return "" }
+ else {
+ return this.name + (env.compress ? ':' : ': ') +
+ this.value.toCSS(env) +
+ this.important + ";";
+ }
+};
+
+tree.Rule.prototype.eval = function (context) {
+ return new(tree.Rule)(this.name, this.value.eval(context), this.important, this.index);
+};
+
+tree.Shorthand = function (a, b) {
+ this.a = a;
+ this.b = b;
+};
+
+tree.Shorthand.prototype = {
+ toCSS: function (env) {
+ return this.a.toCSS(env) + "/" + this.b.toCSS(env);
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Ruleset = function (selectors, rules) {
+ this.selectors = selectors;
+ this.rules = rules;
+ this._lookups = {};
+};
+tree.Ruleset.prototype = {
+ eval: function (env) {
+ var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0));
+
+ ruleset.root = this.root;
+
+ // push the current ruleset to the frames stack
+ env.frames.unshift(ruleset);
+
+ // Evaluate imports
+ if (ruleset.root) {
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.Import) {
+ Array.prototype.splice
+ .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+ }
+
+ // Store the frames around mixin definitions,
+ // so they can be evaluated like closures when the time comes.
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.mixin.Definition) {
+ ruleset.rules[i].frames = env.frames.slice(0);
+ }
+ }
+
+ // Evaluate mixin calls.
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.mixin.Call) {
+ Array.prototype.splice
+ .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+
+ // Evaluate everything else
+ for (var i = 0, rule; i < ruleset.rules.length; i++) {
+ rule = ruleset.rules[i];
+
+ if (! (rule instanceof tree.mixin.Definition)) {
+ ruleset.rules[i] = rule.eval ? rule.eval(env) : rule;
+ }
+ }
+
+ // Pop the stack
+ env.frames.shift();
+
+ return ruleset;
+ },
+ match: function (args) {
+ return !args || args.length === 0;
+ },
+ variables: function () {
+ if (this._variables) { return this._variables }
+ else {
+ return this._variables = this.rules.reduce(function (hash, r) {
+ if (r instanceof tree.Rule && r.variable === true) {
+ hash[r.name] = r;
+ }
+ return hash;
+ }, {});
+ }
+ },
+ variable: function (name) {
+ return this.variables()[name];
+ },
+ rulesets: function () {
+ if (this._rulesets) { return this._rulesets }
+ else {
+ return this._rulesets = this.rules.filter(function (r) {
+ return (r instanceof tree.Ruleset) || (r instanceof tree.mixin.Definition);
+ });
+ }
+ },
+ find: function (selector, self) {
+ self = self || this;
+ var rules = [], rule, match,
+ key = selector.toCSS();
+
+ if (key in this._lookups) { return this._lookups[key] }
+
+ this.rulesets().forEach(function (rule) {
+ if (rule !== self) {
+ for (var j = 0; j < rule.selectors.length; j++) {
+ if (match = selector.match(rule.selectors[j])) {
+ if (selector.elements.length > 1) {
+ Array.prototype.push.apply(rules, rule.find(
+ new(tree.Selector)(selector.elements.slice(1)), self));
+ } else {
+ rules.push(rule);
+ }
+ break;
+ }
+ }
+ }
+ });
+ return this._lookups[key] = rules;
+ },
+ //
+ // Entry point for code generation
+ //
+ // `context` holds an array of arrays.
+ //
+ toCSS: function (context, env) {
+ var css = [], // The CSS output
+ rules = [], // node.Rule instances
+ rulesets = [], // node.Ruleset instances
+ paths = [], // Current selectors
+ selector, // The fully rendered selector
+ rule;
+
+ if (! this.root) {
+ if (context.length === 0) {
+ paths = this.selectors.map(function (s) { return [s] });
+ } else {
+ for (var s = 0; s < this.selectors.length; s++) {
+ for (var c = 0; c < context.length; c++) {
+ paths.push(context[c].concat([this.selectors[s]]));
+ }
+ }
+ }
+ }
+
+ // Compile rules and rulesets
+ for (var i = 0; i < this.rules.length; i++) {
+ rule = this.rules[i];
+
+ if (rule.rules || (rule instanceof tree.Directive)) {
+ rulesets.push(rule.toCSS(paths, env));
+ } else if (rule instanceof tree.Comment) {
+ if (!rule.silent) {
+ if (this.root) {
+ rulesets.push(rule.toCSS(env));
+ } else {
+ rules.push(rule.toCSS(env));
+ }
+ }
+ } else {
+ if (rule.toCSS && !rule.variable) {
+ rules.push(rule.toCSS(env));
+ } else if (rule.value && !rule.variable) {
+ rules.push(rule.value.toString());
+ }
+ }
+ }
+
+ rulesets = rulesets.join('');
+
+ // If this is the root node, we don't render
+ // a selector, or {}.
+ // Otherwise, only output if this ruleset has rules.
+ if (this.root) {
+ css.push(rules.join(env.compress ? '' : '\n'));
+ } else {
+ if (rules.length > 0) {
+ selector = paths.map(function (p) {
+ return p.map(function (s) {
+ return s.toCSS(env);
+ }).join('').trim();
+ }).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
+ css.push(selector,
+ (env.compress ? '{' : ' {\n ') +
+ rules.join(env.compress ? '' : '\n ') +
+ (env.compress ? '}' : '\n}\n'));
+ }
+ }
+ css.push(rulesets);
+
+ return css.join('') + (env.compress ? '\n' : '');
+ }
+};
+})(require('less/tree'));
+(function (tree) {
+
+tree.Selector = function (elements) {
+ this.elements = elements;
+ if (this.elements[0].combinator.value === "") {
+ this.elements[0].combinator.value = ' ';
+ }
+};
+tree.Selector.prototype.match = function (other) {
+ if (this.elements[0].value === other.elements[0].value) {
+ return true;
+ } else {
+ return false;
+ }
+};
+tree.Selector.prototype.toCSS = function (env) {
+ if (this._css) { return this._css }
+
+ return this._css = this.elements.map(function (e) {
+ if (typeof(e) === 'string') {
+ return ' ' + e.trim();
+ } else {
+ return e.toCSS(env);
+ }
+ }).join('');
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.URL = function (val, paths) {
+ if (val.data) {
+ this.attrs = val;
+ } else {
+ // Add the base path if the URL is relative and we are in the browser
+ if (!/^(?:https?:\/|file:\/|data:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
+ val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value);
+ }
+ this.value = val;
+ this.paths = paths;
+ }
+};
+tree.URL.prototype = {
+ toCSS: function () {
+ return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data
+ : this.value.toCSS()) + ")";
+ },
+ eval: function (ctx) {
+ return this.attrs ? this : new(tree.URL)(this.value.eval(ctx), this.paths);
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Value = function (value) {
+ this.value = value;
+ this.is = 'value';
+};
+tree.Value.prototype = {
+ eval: function (env) {
+ if (this.value.length === 1) {
+ return this.value[0].eval(env);
+ } else {
+ return new(tree.Value)(this.value.map(function (v) {
+ return v.eval(env);
+ }));
+ }
+ },
+ toCSS: function (env) {
+ return this.value.map(function (e) {
+ return e.toCSS(env);
+ }).join(env.compress ? ',' : ', ');
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Variable = function (name, index) { this.name = name, this.index = index };
+tree.Variable.prototype = {
+ eval: function (env) {
+ var variable, v, name = this.name;
+
+ if (name.indexOf('@@') == 0) {
+ name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value;
+ }
+
+ if (variable = tree.find(env.frames, function (frame) {
+ if (v = frame.variable(name)) {
+ return v.value.eval(env);
+ }
+ })) { return variable }
+ else {
+ throw { message: "variable " + name + " is undefined",
+ index: this.index };
+ }
+ }
+};
+
+})(require('less/tree'));
+require('less/tree').find = function (obj, fun) {
+ for (var i = 0, r; i < obj.length; i++) {
+ if (r = fun.call(obj, obj[i])) { return r }
+ }
+ return null;
+};
+//
+// browser.js - client-side engine
+//
+
+var isFileProtocol = (location.protocol === 'file:' ||
+ location.protocol === 'chrome:' ||
+ location.protocol === 'chrome-extension:' ||
+ location.protocol === 'resource:');
+
+less.env = less.env || (location.hostname == '127.0.0.1' ||
+ location.hostname == '0.0.0.0' ||
+ location.hostname == 'localhost' ||
+ location.port.length > 0 ||
+ isFileProtocol ? 'development'
+ : 'production');
+
+// Load styles asynchronously (default: false)
+//
+// This is set to `false` by default, so that the body
+// doesn't start loading before the stylesheets are parsed.
+// Setting this to `true` can result in flickering.
+//
+less.async = false;
+
+// Interval between watch polls
+less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
+
+//
+// Watch mode
+//
+less.watch = function () { return this.watchMode = true };
+less.unwatch = function () { return this.watchMode = false };
+
+if (less.env === 'development') {
+ less.optimization = 0;
+
+ if (/!watch/.test(location.hash)) {
+ less.watch();
+ }
+ less.watchTimer = setInterval(function () {
+ if (less.watchMode) {
+ loadStyleSheets(function (root, sheet, env) {
+ if (root) {
+ createCSS(root.toCSS(), sheet, env.lastModified);
+ }
+ });
+ }
+ }, less.poll);
+} else {
+ less.optimization = 3;
+}
+
+var cache;
+
+try {
+ cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
+} catch (_) {
+ cache = null;
+}
+
+//
+// Get all tags with the 'rel' attribute set to "stylesheet/less"
+//
+var links = document.getElementsByTagName('link');
+var typePattern = /^text\/(x-)?less$/;
+
+less.sheets = [];
+
+for (var i = 0; i < links.length; i++) {
+ if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
+ (links[i].type.match(typePattern)))) {
+ less.sheets.push(links[i]);
+ }
+}
+
+
+less.refresh = function (reload) {
+ var startTime, endTime;
+ startTime = endTime = new(Date);
+
+ loadStyleSheets(function (root, sheet, env) {
+ if (env.local) {
+ log("loading " + sheet.href + " from cache.");
+ } else {
+ log("parsed " + sheet.href + " successfully.");
+ createCSS(root.toCSS(), sheet, env.lastModified);
+ }
+ log("css for " + sheet.href + " generated in " + (new(Date) - endTime) + 'ms');
+ (env.remaining === 0) && log("css generated in " + (new(Date) - startTime) + 'ms');
+ endTime = new(Date);
+ }, reload);
+
+ loadStyles();
+};
+less.refreshStyles = loadStyles;
+
+less.refresh(less.env === 'development');
+
+function loadStyles() {
+ var styles = document.getElementsByTagName('style');
+ for (var i = 0; i < styles.length; i++) {
+ if (styles[i].type.match(typePattern)) {
+ new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
+ styles[i].type = 'text/css';
+ styles[i].innerHTML = tree.toCSS();
+ });
+ }
+ }
+}
+
+function loadStyleSheets(callback, reload) {
+ for (var i = 0; i < less.sheets.length; i++) {
+ loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1));
+ }
+}
+
+function loadStyleSheet(sheet, callback, reload, remaining) {
+ var url = window.location.href.replace(/[#?].*$/, '');
+ var href = sheet.href.replace(/\?.*$/, '');
+ var css = cache && cache.getItem(href);
+ var timestamp = cache && cache.getItem(href + ':timestamp');
+ var styles = { css: css, timestamp: timestamp };
+
+ // Stylesheets in IE don't always return the full path
+ if (! /^(https?|file):/.test(href)) {
+ if (href.charAt(0) == "/") {
+ href = window.location.protocol + "//" + window.location.host + href;
+ } else {
+ href = url.slice(0, url.lastIndexOf('/') + 1) + href;
+ }
+ }
+
+ xhr(sheet.href, sheet.type, function (data, lastModified) {
+ if (!reload && styles && lastModified &&
+ (new(Date)(lastModified).valueOf() ===
+ new(Date)(styles.timestamp).valueOf())) {
+ // Use local copy
+ createCSS(styles.css, sheet);
+ callback(null, sheet, { local: true, remaining: remaining });
+ } else {
+ // Use remote copy (re-parse)
+ try {
+ new(less.Parser)({
+ optimization: less.optimization,
+ paths: [href.replace(/[\w\.-]+$/, '')],
+ mime: sheet.type
+ }).parse(data, function (e, root) {
+ if (e) { return error(e, href) }
+ try {
+ callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining });
+ removeNode(document.getElementById('less-error-message:' + extractId(href)));
+ } catch (e) {
+ error(e, href);
+ }
+ });
+ } catch (e) {
+ error(e, href);
+ }
+ }
+ }, function (status, url) {
+ throw new(Error)("Couldn't load " + url + " (" + status + ")");
+ });
+}
+
+function extractId(href) {
+ return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' ) // Remove protocol & domain
+ .replace(/^\//, '' ) // Remove root /
+ .replace(/\?.*$/, '' ) // Remove query
+ .replace(/\.[^\.\/]+$/, '' ) // Remove file extension
+ .replace(/[^\.\w-]+/g, '-') // Replace illegal characters
+ .replace(/\./g, ':'); // Replace dots with colons(for valid id)
+}
+
+function createCSS(styles, sheet, lastModified) {
+ var css;
+
+ // Strip the query-string
+ var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : '';
+
+ // If there is no title set, use the filename, minus the extension
+ var id = 'less:' + (sheet.title || extractId(href));
+
+ // If the stylesheet doesn't exist, create a new node
+ if ((css = document.getElementById(id)) === null) {
+ css = document.createElement('style');
+ css.type = 'text/css';
+ css.media = sheet.media || 'screen';
+ css.id = id;
+ document.getElementsByTagName('head')[0].appendChild(css);
+ }
+
+ if (css.styleSheet) { // IE
+ try {
+ css.styleSheet.cssText = styles;
+ } catch (e) {
+ throw new(Error)("Couldn't reassign styleSheet.cssText.");
+ }
+ } else {
+ (function (node) {
+ if (css.childNodes.length > 0) {
+ if (css.firstChild.nodeValue !== node.nodeValue) {
+ css.replaceChild(node, css.firstChild);
+ }
+ } else {
+ css.appendChild(node);
+ }
+ })(document.createTextNode(styles));
+ }
+
+ // Don't update the local store if the file wasn't modified
+ if (lastModified && cache) {
+ log('saving ' + href + ' to cache.');
+ cache.setItem(href, styles);
+ cache.setItem(href + ':timestamp', lastModified);
+ }
+}
+
+function xhr(url, type, callback, errback) {
+ var xhr = getXMLHttpRequest();
+ var async = isFileProtocol ? false : less.async;
+
+ if (typeof(xhr.overrideMimeType) === 'function') {
+ xhr.overrideMimeType('text/css');
+ }
+ xhr.open('GET', url, async);
+ xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
+ xhr.send(null);
+
+ if (isFileProtocol) {
+ if (xhr.status === 0) {
+ callback(xhr.responseText);
+ } else {
+ errback(xhr.status, url);
+ }
+ } else if (async) {
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState == 4) {
+ handleResponse(xhr, callback, errback);
+ }
+ };
+ } else {
+ handleResponse(xhr, callback, errback);
+ }
+
+ function handleResponse(xhr, callback, errback) {
+ if (xhr.status >= 200 && xhr.status < 300) {
+ callback(xhr.responseText,
+ xhr.getResponseHeader("Last-Modified"));
+ } else if (typeof(errback) === 'function') {
+ errback(xhr.status, url);
+ }
+ }
+}
+
+function getXMLHttpRequest() {
+ if (window.XMLHttpRequest) {
+ return new(XMLHttpRequest);
+ } else {
+ try {
+ return new(ActiveXObject)("MSXML2.XMLHTTP.3.0");
+ } catch (e) {
+ log("browser doesn't support AJAX.");
+ return null;
+ }
+ }
+}
+
+function removeNode(node) {
+ return node && node.parentNode.removeChild(node);
+}
+
+function log(str) {
+ if (less.env == 'development' && typeof(console) !== "undefined") { console.log('less: ' + str) }
+}
+
+function error(e, href) {
+ var id = 'less-error-message:' + extractId(href);
+
+ var template = ['',
+ '[-1] {0} ',
+ '[0] {current} ',
+ '[1] {2} ',
+ ' '].join('\n');
+
+ var elem = document.createElement('div'), timer, content;
+
+ elem.id = id;
+ elem.className = "less-error-message";
+
+ content = '' + (e.message || 'There is an error in your .less file') +
+ ' ' + '' + href + " ";
+
+ if (e.extract) {
+ content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':
' +
+ template.replace(/\[(-?\d)\]/g, function (_, i) {
+ return (parseInt(e.line) + parseInt(i)) || '';
+ }).replace(/\{(\d)\}/g, function (_, i) {
+ return e.extract[parseInt(i)] || '';
+ }).replace(/\{current\}/, e.extract[1].slice(0, e.column) + '' +
+ e.extract[1].slice(e.column) + ' ');
+ }
+ elem.innerHTML = content;
+
+ // CSS for error messages
+ createCSS([
+ '.less-error-message ul, .less-error-message li {',
+ 'list-style-type: none;',
+ 'margin-right: 15px;',
+ 'padding: 4px 0;',
+ 'margin: 0;',
+ '}',
+ '.less-error-message label {',
+ 'font-size: 12px;',
+ 'margin-right: 15px;',
+ 'padding: 4px 0;',
+ 'color: #cc7777;',
+ '}',
+ '.less-error-message pre {',
+ 'color: #ee4444;',
+ 'padding: 4px 0;',
+ 'margin: 0;',
+ 'display: inline-block;',
+ '}',
+ '.less-error-message pre.ctx {',
+ 'color: #dd4444;',
+ '}',
+ '.less-error-message h3 {',
+ 'font-size: 20px;',
+ 'font-weight: bold;',
+ 'padding: 15px 0 5px 0;',
+ 'margin: 0;',
+ '}',
+ '.less-error-message a {',
+ 'color: #10a',
+ '}',
+ '.less-error-message .error {',
+ 'color: red;',
+ 'font-weight: bold;',
+ 'padding-bottom: 2px;',
+ 'border-bottom: 1px dashed red;',
+ '}'
+ ].join('\n'), { title: 'error-message' });
+
+ elem.style.cssText = [
+ "font-family: Arial, sans-serif",
+ "border: 1px solid #e00",
+ "background-color: #eee",
+ "border-radius: 5px",
+ "-webkit-border-radius: 5px",
+ "-moz-border-radius: 5px",
+ "color: #e00",
+ "padding: 15px",
+ "margin-bottom: 15px"
+ ].join(';');
+
+ if (less.env == 'development') {
+ timer = setInterval(function () {
+ if (document.body) {
+ if (document.getElementById(id)) {
+ document.body.replaceChild(elem, document.getElementById(id));
+ } else {
+ document.body.insertBefore(elem, document.body.firstChild);
+ }
+ clearInterval(timer);
+ }
+ }, 10);
+ }
+}
+
+})(window);
diff --git a/node_modules/anvil.js/node_modules/less/dist/less-1.1.0.min.js b/node_modules/anvil.js/node_modules/less/dist/less-1.1.0.min.js
new file mode 100644
index 0000000..ede454e
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/dist/less-1.1.0.min.js
@@ -0,0 +1,16 @@
+//
+// LESS - Leaner CSS v1.1.0
+// http://lesscss.org
+//
+// Copyright (c) 2009-2011, Alexis Sellier
+// Licensed under the Apache 2.0 License.
+//
+//
+// LESS - Leaner CSS v1.1.0
+// http://lesscss.org
+//
+// Copyright (c) 2009-2011, Alexis Sellier
+// Licensed under the Apache 2.0 License.
+//
+(function(a,b){function v(a,b){var c="less-error-message:"+p(b),e=["",'[-1] {0} ',"[0] {current} ",'[1] {2} '," "].join("\n"),f=document.createElement("div"),g,h;f.id=c,f.className="less-error-message",h=""+(a.message||"There is an error in your .less file")+" "+''+b+" ",a.extract&&(h+="on line "+a.line+", column "+(a.column+1)+":
"+e.replace(/\[(-?\d)\]/g,function(b,c){return parseInt(a.line)+parseInt(c)||""}).replace(/\{(\d)\}/g,function(b,c){return a.extract[parseInt(c)]||""}).replace(/\{current\}/,a.extract[1].slice(0,a.column)+''+a.extract[1].slice(a.column)+" ")),f.innerHTML=h,q([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #ee4444;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.ctx {","color: #dd4444;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}function u(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function t(a){return a&&a.parentNode.removeChild(a)}function s(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){u("browser doesn't support AJAX.");return null}}function r(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var f=s(),h=g?!1:d.async;typeof f.overrideMimeType=="function"&&f.overrideMimeType("text/css"),f.open("GET",a,h),f.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),f.send(null),g?f.status===0?c(f.responseText):e(f.status,a):h?f.onreadystatechange=function(){f.readyState==4&&i(f,c,e)}:i(f,c,e)}function q(a,b,c){var d,e=b.href?b.href.replace(/\?.*$/,""):"",f="less:"+(b.title||p(e));(d=document.getElementById(f))===null&&(d=document.createElement("style"),d.type="text/css",d.media=b.media||"screen",d.id=f,document.getElementsByTagName("head")[0].appendChild(d));if(d.styleSheet)try{d.styleSheet.cssText=a}catch(g){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(a){d.childNodes.length>0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));c&&h&&(u("saving "+e+" to cache."),h.setItem(e,a),h.setItem(e+":timestamp",c))}function p(a){return a.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function o(b,c,e,f){var g=a.location.href.replace(/[#?].*$/,""),i=b.href.replace(/\?.*$/,""),j=h&&h.getItem(i),k=h&&h.getItem(i+":timestamp"),l={css:j,timestamp:k};/^(https?|file):/.test(i)||(i.charAt(0)=="/"?i=a.location.protocol+"//"+a.location.host+i:i=g.slice(0,g.lastIndexOf("/")+1)+i),r(b.href,b.type,function(a,g){if(!e&&l&&g&&(new Date(g)).valueOf()===(new Date(l.timestamp)).valueOf())q(l.css,b),c(null,b,{local:!0,remaining:f});else try{(new d.Parser({optimization:d.optimization,paths:[i.replace(/[\w\.-]+$/,"")],mime:b.type})).parse(a,function(a,d){if(a)return v(a,i);try{c(d,b,{local:!1,lastModified:g,remaining:f}),t(document.getElementById("less-error-message:"+p(i)))}catch(a){v(a,i)}})}catch(h){v(h,i)}},function(a,b){throw new Error("Couldn't load "+b+" ("+a+")")})}function n(a,b){for(var c=0;c>>0;for(var d=0;d>>0,c=Array(b),d=arguments[1];for(var e=0;e>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else for(;;){if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}for(;c=b)return-1;c<0&&(c+=b);for(;ck&&(j[f]=j[f].slice(c-k),k=c)}function q(){j[f]=g,c=h,k=c}function p(){g=j[f],h=c,k=c}var b,c,f,g,h,i,j,k,l,m=this,n=function(){},o=this.imports={paths:a&&a.paths||[],queue:[],files:{},mime:a&&a.mime,push:function(b,c){var e=this;this.queue.push(b),d.Parser.importer(b,this.paths,function(a){e.queue.splice(e.queue.indexOf(b),1),e.files[b]=a,c(a),e.queue.length===0&&n()},a)}};this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null;return l={imports:o,parse:function(d,g){var h,l,m,o,p,q,r=[],t,u=null;c=f=k=i=0,j=[],b=d.replace(/\r\n/g,"\n"),j=function(c){var d=0,e=/[^"'`\{\}\/\(\)]+/g,f=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g=0,h,i=c[0],j,k;for(var l=0,m,n;l0)throw{type:"Syntax",message:"Missing closing `}`",filename:a.filename};return c.map(function(a){return a.join("")})}([[]]),h=new e.Ruleset([],s(this.parsers.primary)),h.root=!0,h.toCSS=function(c){var d,f,g;return function(g,h){function n(a){return a?(b.slice(0,a).match(/\n/g)||"").length:null}var i=[];g=g||{},typeof h=="object"&&!Array.isArray(h)&&(h=Object.keys(h).map(function(a){var b=h[a];b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b]));return new e.Rule("@"+a,b,!1,0)}),i=[new e.Ruleset(null,h)]);try{var j=c.call(this,{frames:i}).toCSS([],{compress:g.compress||!1})}catch(k){f=b.split("\n"),d=n(k.index);for(var l=k.index,m=-1;l>=0&&b.charAt(l)!=="\n";l--)m++;throw{type:k.type,message:k.message,filename:a.filename,index:k.index,line:typeof d=="number"?d+1:null,callLine:k.call&&n(k.call)+1,callExtract:f[n(k.call)],stack:k.stack,column:m,extract:[f[d-1],f[d],f[d+1]]}}return g.compress?j.replace(/(\s)+/g,"$1"):j}}(h.eval);if(c=0&&b.charAt(v)!=="\n";v--)w++;u={name:"ParseError",message:"Syntax Error on line "+p,index:c,filename:a.filename,line:p,column:w,extract:[q[p-2],q[p-1],q[p]]}}this.imports.queue.length>0?n=function(){g(u,h)}:g(u,h)},parsers:{primary:function(){var a,b=[];while((a=s(this.mixin.definition)||s(this.rule)||s(this.ruleset)||s(this.mixin.call)||s(this.comment)||s(this.directive))||s(/^[\s\n]+/))a&&b.push(a);return b},comment:function(){var a;if(b.charAt(c)==="/"){if(b.charAt(c+1)==="/")return new e.Comment(s(/^\/\/.*/),!0);if(a=s(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)}},entities:{quoted:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==='"'||b.charAt(d)==="'"){f&&s("~");if(a=s(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0],a[1]||a[2],f)}},keyword:function(){var a;if(a=s(/^[A-Za-z-]+/))return new e.Keyword(a)},call:function(){var a,b;if(!!(a=/^([\w-]+|%)\(/.exec(j[f]))){a=a[1].toLowerCase();if(a==="url")return null;c+=a.length;if(a==="alpha")return s(this.alpha);s("("),b=s(this.entities.arguments);if(!s(")"))return;if(a)return new e.Call(a,b)}},arguments:function(){var a=[],b;while(b=s(this.expression)){a.push(b);if(!s(","))break}return a},literal:function(){return s(this.entities.dimension)||s(this.entities.color)||s(this.entities.quoted)},url:function(){var a;if(b.charAt(c)==="u"&&!!s(/^url\(/)){a=s(this.entities.quoted)||s(this.entities.variable)||s(this.entities.dataURI)||s(/^[-\w%@$\/.&=:;#+?~]+/)||"";if(!s(")"))throw new Error("missing closing ) for url()");return new e.URL(a.value||a.data||a instanceof e.Variable?a:new e.Anonymous(a),o.paths)}},dataURI:function(){var a;if(s(/^data:/)){a={},a.mime=s(/^[^\/]+\/[^,;)]+/)||"",a.charset=s(/^;\s*charset=[^,;)]+/)||"",a.base64=s(/^;\s*base64/)||"",a.data=s(/^,\s*[^)]+/);if(a.data)return a}},variable:function(){var a,d=c;if(b.charAt(c)==="@"&&(a=s(/^@@?[\w-]+/)))return new e.Variable(a,d)},color:function(){var a;if(b.charAt(c)==="#"&&(a=s(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Color(a[1])},dimension:function(){var a,d=b.charCodeAt(c);if(!(d>57||d<45||d===47))if(a=s(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new e.Dimension(a[1],a[2])},javascript:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==="`"){f&&s("~");if(a=s(/^`([^`]*)`/))return new e.JavaScript(a[1],c,f)}}},variable:function(){var a;if(b.charAt(c)==="@"&&(a=s(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(!!t(/^[@\w.%-]+\/[@\w.-]+/)&&(a=s(this.entity))&&s("/")&&(b=s(this.entity)))return new e.Shorthand(a,b)},mixin:{call:function(){var a=[],d,f,g,h=c,i=b.charAt(c);if(i==="."||i==="#"){while(d=s(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/))a.push(new e.Element(f,d)),f=s(">");s("(")&&(g=s(this.entities.arguments))&&s(")");if(a.length>0&&(s(";")||t("}")))return new e.mixin.Call(a,g,h)}},definition:function(){var a,d=[],f,g,h,i;if(!(b.charAt(c)!=="."&&b.charAt(c)!=="#"||t(/^[^{]*(;|})/)))if(f=s(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){a=f[1];while(h=s(this.entities.variable)||s(this.entities.literal)||s(this.entities.keyword)){if(h instanceof e.Variable)if(s(":"))if(i=s(this.expression))d.push({name:h.name,value:i});else throw new Error("Expected value");else d.push({name:h.name});else d.push({value:h});if(!s(","))break}if(!s(")"))throw new Error("Expected )");g=s(this.block);if(g)return new e.mixin.Definition(a,d,g)}}},entity:function(){return s(this.entities.literal)||s(this.entities.variable)||s(this.entities.url)||s(this.entities.call)||s(this.entities.keyword)||s(this.entities.javascript)||s(this.comment)},end:function(){return s(";")||t("}")},alpha:function(){var a;if(!!s(/^opacity=/i))if(a=s(/^\d+/)||s(this.entities.variable)){if(!s(")"))throw new Error("missing closing ) for alpha()");return new e.Alpha(a)}},element:function(){var a,b,c;c=s(this.combinator),a=s(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||s("*")||s(this.attribute)||s(/^\([^)@]+\)/);if(a)return new e.Element(c,a)},combinator:function(){var a,d=b.charAt(c);if(d===">"||d==="&"||d==="+"||d==="~"){c++;while(b.charAt(c)===" ")c++;return new e.Combinator(d)}if(d===":"&&b.charAt(c+1)===":"){c+=2;while(b.charAt(c)===" ")c++;return new e.Combinator("::")}return b.charAt(c-1)===" "?new e.Combinator(" "):new e.Combinator(null)},selector:function(){var a,d,f=[],g,h;while(d=s(this.element)){g=b.charAt(c),f.push(d);if(g==="{"||g==="}"||g===";"||g===",")break}if(f.length>0)return new e.Selector(f)},tag:function(){return s(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||s("*")},attribute:function(){var a="",b,c,d;if(!!s("[")){if(b=s(/^[a-zA-Z-]+/)||s(this.entities.quoted))(d=s(/^[|~*$^]?=/))&&(c=s(this.entities.quoted)||s(/^[\w-]+/))?a=[b,d,c.toCSS?c.toCSS():c].join(""):a=b;if(!s("]"))return;if(a)return"["+a+"]"}},block:function(){var a;if(s("{")&&(a=s(this.primary))&&s("}"))return a},ruleset:function(){var a=[],b,d,g;p();if(g=/^([.#: \w-]+)[\s\n]*\{/.exec(j[f]))c+=g[0].length-1,a=[new e.Selector([new e.Element(null,g[1])])];else while(b=s(this.selector)){a.push(b),s(this.comment);if(!s(","))break;s(this.comment)}if(a.length>0&&(d=s(this.block)))return new e.Ruleset(a,d);i=c,q()},rule:function(){var a,d,g=b.charAt(c),k,l;p();if(g!=="."&&g!=="#"&&g!=="&")if(a=s(this.variable)||s(this.property)){a.charAt(0)!="@"&&(l=/^([^@+\/'"*`(;{}-]*);/.exec(j[f]))?(c+=l[0].length-1,d=new e.Anonymous(l[1])):a==="font"?d=s(this.font):d=s(this.value),k=s(this.important);if(d&&s(this.end))return new e.Rule(a,d,k,h);i=c,q()}},"import":function(){var a;if(s(/^@import\s+/)&&(a=s(this.entities.quoted)||s(this.entities.url))&&s(";"))return new e.Import(a,o)},directive:function(){var a,d,f,g;if(b.charAt(c)==="@"){if(d=s(this["import"]))return d;if(a=s(/^@media|@page|@-[-a-z]+/)){g=(s(/^[^{]+/)||"").trim();if(f=s(this.block))return new e.Directive(a+" "+g,f)}else if(a=s(/^@[-a-z]+/))if(a==="@font-face"){if(f=s(this.block))return new e.Directive(a,f)}else if((d=s(this.entity))&&s(";"))return new e.Directive(a,d)}},font:function(){var a=[],b=[],c,d,f,g;while(g=s(this.shorthand)||s(this.entity))b.push(g);a.push(new e.Expression(b));if(s(","))while(g=s(this.expression)){a.push(g);if(!s(","))break}return new e.Value(a)},value:function(){var a,b=[],c;while(a=s(this.expression)){b.push(a);if(!s(","))break}if(b.length>0)return new e.Value(b)},important:function(){if(b.charAt(c)==="!")return s(/^! *important/)},sub:function(){var a;if(s("(")&&(a=s(this.expression))&&s(")"))return a},multiplication:function(){var a,b,c,d;if(a=s(this.operand)){while((c=s("/")||s("*"))&&(b=s(this.operand)))d=new e.Operation(c,[d||a,b]);return d||a}},addition:function(){var a,d,f,g;if(a=s(this.multiplication)){while((f=s(/^[-+]\s+/)||b.charAt(c-1)!=" "&&(s("+")||s("-")))&&(d=s(this.multiplication)))g=new e.Operation(f,[g||a,d]);return g||a}},operand:function(){var a,d=b.charAt(c+1);b.charAt(c)==="-"&&(d==="@"||d==="(")&&(a=s("-"));var f=s(this.sub)||s(this.entities.dimension)||s(this.entities.color)||s(this.entities.variable)||s(this.entities.call);return a?new e.Operation("*",[new e.Dimension(-1),f]):f},expression:function(){var a,b,c=[],d;while(a=s(this.addition)||s(this.entity))c.push(a);if(c.length>0)return new e.Expression(c)},property:function(){var a;if(a=s(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]}}}},typeof a!="undefined"&&(d.Parser.importer=function(a,b,c,d){a.charAt(0)!=="/"&&b.length>0&&(a=b[0]+a),o({href:a,title:a,type:d.mime},c,!0)}),function(a){function d(a){return Math.min(1,Math.max(0,a))}function c(b){if(b instanceof a.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);if(typeof b=="number")return b;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function b(b){return a.functions.hsla(b.h,b.s,b.l,b.a)}a.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(b,d,e,f){var g=[b,d,e].map(function(a){return c(a)}),f=c(f);return new a.Color(g,f)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,d,e){function h(a){a=a<0?a+1:a>1?a-1:a;return a*6<1?g+(f-g)*a*6:a*2<1?f:a*3<2?g+(f-g)*(2/3-a)*6:g}a=c(a)%360/360,b=c(b),d=c(d),e=c(e);var f=d<=.5?d*(b+1):d+b-d*b,g=d*2-f;return this.rgba(h(a+1/3)*255,h(a)*255,h(a-1/3)*255,e)},hue:function(b){return new a.Dimension(Math.round(b.toHSL().h))},saturation:function(b){return new a.Dimension(Math.round(b.toHSL().s*100),"%")},lightness:function(b){return new a.Dimension(Math.round(b.toHSL().l*100),"%")},alpha:function(b){return new a.Dimension(b.toHSL().a)},saturate:function(a,c){var e=a.toHSL();e.s+=c.value/100,e.s=d(e.s);return b(e)},desaturate:function(a,c){var e=a.toHSL();e.s-=c.value/100,e.s=d(e.s);return b(e)},lighten:function(a,c){var e=a.toHSL();e.l+=c.value/100,e.l=d(e.l);return b(e)},darken:function(a,c){var e=a.toHSL();e.l-=c.value/100,e.l=d(e.l);return b(e)},fadein:function(a,c){var e=a.toHSL();e.a+=c.value/100,e.a=d(e.a);return b(e)},fadeout:function(a,c){var e=a.toHSL();e.a-=c.value/100,e.a=d(e.a);return b(e)},spin:function(a,c){var d=a.toHSL(),e=(d.h+c.value)%360;d.h=e<0?360+e:e;return b(d)},mix:function(b,c,d){var e=d.value/100,f=e*2-1,g=b.toHSL().a-c.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[b.rgb[0]*h+c.rgb[0]*i,b.rgb[1]*h+c.rgb[1]*i,b.rgb[2]*h+c.rgb[2]*i],k=b.alpha*e+c.alpha*(1-e);return new a.Color(j,k)},greyscale:function(b){return this.desaturate(b,new a.Dimension(100))},e:function(b){return new a.Anonymous(b instanceof a.JavaScript?b.evaluated:b)},escape:function(b){return new a.Anonymous(encodeURI(b.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(b){var c=Array.prototype.slice.call(arguments,1),d=b.value;for(var e=0;e255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},operate:function(b,c){var d=[];c instanceof a.Color||(c=c.toColor());for(var e=0;e<3;e++)d[e]=a.operate(b,this.rgb[e],c.rgb[e]);return new a.Color(d,this.alpha+c.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,e=Math.max(a,b,c),f=Math.min(a,b,c),g,h,i=(e+f)/2,j=e-f;if(e===f)g=h=0;else{h=i>.5?j/(2-e-f):j/(e+f);switch(e){case a:g=(b-c)/j+(b":a.compress?">":" > "}[this.value]}}(c("less/tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={eval:function(b){return this.value.length>1?new a.Expression(this.value.map(function(a){return a.eval(b)})):this.value[0].eval(b)},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(" ")}}}(c("less/tree")),function(a){a.Import=function(b,c){var d=this;this._path=b,b instanceof a.Quoted?this.path=/\.(le?|c)ss$/.test(b.value)?b.value:b.value+".less":this.path=b.value.value||b.value,this.css=/css$/.test(this.path),this.css||c.push(this.path,function(a){if(!a)throw new Error("Error parsing "+d.path);d.root=a})},a.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(b){var c;if(this.css)return this;c=new a.Ruleset(null,this.root.rules.slice(0));for(var d=0;d0){for(var f=0;f0&&c>this.params.length)return!1;d=Math.min(c,this.arity);for(var e=0;e1?Array.prototype.push.apply(d,e.find(new a.Selector(b.elements.slice(1)),c)):d.push(e);break}});return this._lookups[g]=d},toCSS:function(b,c){var d=[],e=[],f=[],g=[],h,i;if(!this.root)if(b.length===0)g=this.selectors.map(function(a){return[a]});else for(var j=0;j0&&(h=g.map(function(a){return a.map(function(a){return a.toCSS(c)}).join("").trim()}).join(c.compress?",":g.length>3?",\n":", "),d.push(h,(c.compress?"{":" {\n ")+e.join(c.compress?"":"\n ")+(c.compress?"}":"\n}\n"))),d.push(f);return d.join("")+(c.compress?"\n":"")}}}(c("less/tree")),function(a){a.Selector=function(a){this.elements=a,this.elements[0].combinator.value===""&&(this.elements[0].combinator.value=" ")},a.Selector.prototype.match=function(a){return this.elements[0].value===a.elements[0].value?!0:!1},a.Selector.prototype.toCSS=function(a){if(this._css)return this._css;return this._css=this.elements.map(function(b){return typeof b=="string"?" "+b.trim():b.toCSS(a)}).join("")}}(c("less/tree")),function(b){b.URL=function(b,c){b.data?this.attrs=b:(!/^(?:https?:\/|file:\/|data:\/)?\//.test(b.value)&&c.length>0&&typeof a!="undefined"&&(b.value=c[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value)),this.value=b,this.paths=c)},b.URL.prototype={toCSS:function(){return"url("+(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(a){return this.attrs?this:new b.URL(this.value.eval(a),this.paths)}}}(c("less/tree")),function(a){a.Value=function(a){this.value=a,this.is="value"},a.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}}(c("less/tree")),function(a){a.Variable=function(a,b){this.name=a,this.index=b},a.Variable.prototype={eval:function(b){var c,d,e=this.name;e.indexOf("@@")==0&&(e="@"+(new a.Variable(e.slice(1))).eval(b).value);if(c=a.find(b.frames,function(a){if(d=a.variable(e))return d.value.eval(b)}))return c;throw{message:"variable "+e+" is undefined",index:this.index}}}}(c("less/tree")),c("less/tree").find=function(a,b){for(var c=0,d;c0||g?"development":"production"),d.async=!1,d.poll=d.poll||(g?1e3:1500),d.watch=function(){return this.watchMode=!0},d.unwatch=function(){return this.watchMode=!1},d.env==="development"?(d.optimization=0,/!watch/.test(location.hash)&&d.watch(),d.watchTimer=setInterval(function(){d.watchMode&&n(function(a,b,c){a&&q(a.toCSS(),b,c.lastModified)})},d.poll)):d.optimization=3;var h;try{h=typeof a.localStorage=="undefined"?null:a.localStorage}catch(i){h=null}var j=document.getElementsByTagName("link"),k=/^text\/(x-)?less$/;d.sheets=[];for(var l=0;l>> 0;
+ for (var i = 0; i < len; i++) {
+ if (i in this) {
+ block.call(thisObject, this[i], i, this);
+ }
+ }
+ };
+}
+if (!Array.prototype.map) {
+ Array.prototype.map = function(fun /*, thisp*/) {
+ var len = this.length >>> 0;
+ var res = new Array(len);
+ var thisp = arguments[1];
+
+ for (var i = 0; i < len; i++) {
+ if (i in this) {
+ res[i] = fun.call(thisp, this[i], i, this);
+ }
+ }
+ return res;
+ };
+}
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function (block /*, thisp */) {
+ var values = [];
+ var thisp = arguments[1];
+ for (var i = 0; i < this.length; i++) {
+ if (block.call(thisp, this[i])) {
+ values.push(this[i]);
+ }
+ }
+ return values;
+ };
+}
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function(fun /*, initial*/) {
+ var len = this.length >>> 0;
+ var i = 0;
+
+ // no value to return if no initial value and an empty array
+ if (len === 0 && arguments.length === 1) throw new TypeError();
+
+ if (arguments.length >= 2) {
+ var rv = arguments[1];
+ } else {
+ do {
+ if (i in this) {
+ rv = this[i++];
+ break;
+ }
+ // if array contains no values, no initial value to return
+ if (++i >= len) throw new TypeError();
+ } while (true);
+ }
+ for (; i < len; i++) {
+ if (i in this) {
+ rv = fun.call(null, rv, this[i], i, this);
+ }
+ }
+ return rv;
+ };
+}
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function (value /*, fromIndex */ ) {
+ var length = this.length;
+ var i = arguments[1] || 0;
+
+ if (!length) return -1;
+ if (i >= length) return -1;
+ if (i < 0) i += length;
+
+ for (; i < length; i++) {
+ if (!Object.prototype.hasOwnProperty.call(this, i)) { continue }
+ if (value === this[i]) return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+//
+if (!Object.keys) {
+ Object.keys = function (object) {
+ var keys = [];
+ for (var name in object) {
+ if (Object.prototype.hasOwnProperty.call(object, name)) {
+ keys.push(name);
+ }
+ }
+ return keys;
+ };
+}
+
+//
+// String
+//
+if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return String(this).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+ };
+}
+var less, tree;
+
+if (typeof(window) === 'undefined') {
+ less = exports,
+ tree = require('less/tree');
+} else {
+ if (typeof(window.less) === 'undefined') { window.less = {} }
+ less = window.less,
+ tree = window.less.tree = {};
+}
+//
+// less.js - parser
+//
+// A relatively straight-forward predictive parser.
+// There is no tokenization/lexing stage, the input is parsed
+// in one sweep.
+//
+// To make the parser fast enough to run in the browser, several
+// optimization had to be made:
+//
+// - Matching and slicing on a huge input is often cause of slowdowns.
+// The solution is to chunkify the input into smaller strings.
+// The chunks are stored in the `chunks` var,
+// `j` holds the current chunk index, and `current` holds
+// the index of the current chunk in relation to `input`.
+// This gives us an almost 4x speed-up.
+//
+// - In many cases, we don't need to match individual tokens;
+// for example, if a value doesn't hold any variables, operations
+// or dynamic references, the parser can effectively 'skip' it,
+// treating it as a literal.
+// An example would be '1px solid #000' - which evaluates to itself,
+// we don't need to know what the individual components are.
+// The drawback, of course is that you don't get the benefits of
+// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,
+// and a smaller speed-up in the code-gen.
+//
+//
+// Token matching is done with the `$` function, which either takes
+// a terminal string or regexp, or a non-terminal function to call.
+// It also takes care of moving all the indices forwards.
+//
+//
+less.Parser = function Parser(env) {
+ var input, // LeSS input string
+ i, // current index in `input`
+ j, // current chunk
+ temp, // temporarily holds a chunk's state, for backtracking
+ memo, // temporarily holds `i`, when backtracking
+ furthest, // furthest index the parser has gone to
+ chunks, // chunkified input
+ current, // index of current chunk, in `input`
+ parser;
+
+ var that = this;
+
+ // This function is called after all files
+ // have been imported through `@import`.
+ var finish = function () {};
+
+ var imports = this.imports = {
+ paths: env && env.paths || [], // Search paths, when importing
+ queue: [], // Files which haven't been imported yet
+ files: {}, // Holds the imported parse trees
+ mime: env && env.mime, // MIME type of .less files
+ push: function (path, callback) {
+ var that = this;
+ this.queue.push(path);
+
+ //
+ // Import a file asynchronously
+ //
+ less.Parser.importer(path, this.paths, function (root) {
+ that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue
+ that.files[path] = root; // Store the root
+
+ callback(root);
+
+ if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing
+ }, env);
+ }
+ };
+
+ function save() { temp = chunks[j], memo = i, current = i }
+ function restore() { chunks[j] = temp, i = memo, current = i }
+
+ function sync() {
+ if (i > current) {
+ chunks[j] = chunks[j].slice(i - current);
+ current = i;
+ }
+ }
+ //
+ // Parse from a token, regexp or string, and move forward if match
+ //
+ function $(tok) {
+ var match, args, length, c, index, endIndex, k, mem;
+
+ //
+ // Non-terminal
+ //
+ if (tok instanceof Function) {
+ return tok.call(parser.parsers);
+ //
+ // Terminal
+ //
+ // Either match a single character in the input,
+ // or match a regexp in the current chunk (chunk[j]).
+ //
+ } else if (typeof(tok) === 'string') {
+ match = input.charAt(i) === tok ? tok : null;
+ length = 1;
+ sync ();
+ } else {
+ sync ();
+
+ if (match = tok.exec(chunks[j])) {
+ length = match[0].length;
+ } else {
+ return null;
+ }
+ }
+
+ // The match is confirmed, add the match length to `i`,
+ // and consume any extra white-space characters (' ' || '\n')
+ // which come after that. The reason for this is that LeSS's
+ // grammar is mostly white-space insensitive.
+ //
+ if (match) {
+ mem = i += length;
+ endIndex = i + chunks[j].length - length;
+
+ while (i < endIndex) {
+ c = input.charCodeAt(i);
+ if (! (c === 32 || c === 10 || c === 9)) { break }
+ i++;
+ }
+ chunks[j] = chunks[j].slice(length + (i - mem));
+ current = i;
+
+ if (chunks[j].length === 0 && j < chunks.length - 1) { j++ }
+
+ if(typeof(match) === 'string') {
+ return match;
+ } else {
+ return match.length === 1 ? match[0] : match;
+ }
+ }
+ }
+
+ // Same as $(), but don't change the state of the parser,
+ // just return the match.
+ function peek(tok) {
+ if (typeof(tok) === 'string') {
+ return input.charAt(i) === tok;
+ } else {
+ if (tok.test(chunks[j])) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ this.env = env = env || {};
+
+ // The optimization level dictates the thoroughness of the parser,
+ // the lower the number, the less nodes it will create in the tree.
+ // This could matter for debugging, or if you want to access
+ // the individual nodes in the tree.
+ this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
+
+ this.env.filename = this.env.filename || null;
+
+ //
+ // The Parser
+ //
+ return parser = {
+
+ imports: imports,
+ //
+ // Parse an input string into an abstract syntax tree,
+ // call `callback` when done.
+ //
+ parse: function (str, callback) {
+ var root, start, end, zone, line, lines, buff = [], c, error = null;
+
+ i = j = current = furthest = 0;
+ chunks = [];
+ input = str.replace(/\r\n/g, '\n');
+
+ // Split the input into chunks.
+ chunks = (function (chunks) {
+ var j = 0,
+ skip = /[^"'`\{\}\/\(\)]+/g,
+ comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
+ level = 0,
+ match,
+ chunk = chunks[0],
+ inParam,
+ inString;
+
+ for (var i = 0, c, cc; i < input.length; i++) {
+ skip.lastIndex = i;
+ if (match = skip.exec(input)) {
+ if (match.index === i) {
+ i += match[0].length;
+ chunk.push(match[0]);
+ }
+ }
+ c = input.charAt(i);
+ comment.lastIndex = i;
+
+ if (!inString && !inParam && c === '/') {
+ cc = input.charAt(i + 1);
+ if (cc === '/' || cc === '*') {
+ if (match = comment.exec(input)) {
+ if (match.index === i) {
+ i += match[0].length;
+ chunk.push(match[0]);
+ c = input.charAt(i);
+ }
+ }
+ }
+ }
+
+ if (c === '{' && !inString && !inParam) { level ++;
+ chunk.push(c);
+ } else if (c === '}' && !inString && !inParam) { level --;
+ chunk.push(c);
+ chunks[++j] = chunk = [];
+ } else if (c === '(' && !inString && !inParam) {
+ chunk.push(c);
+ inParam = true;
+ } else if (c === ')' && !inString && inParam) {
+ chunk.push(c);
+ inParam = false;
+ } else {
+ if (c === '"' || c === "'" || c === '`') {
+ if (! inString) {
+ inString = c;
+ } else {
+ inString = inString === c ? false : inString;
+ }
+ }
+ chunk.push(c);
+ }
+ }
+ if (level > 0) {
+ throw {
+ type: 'Syntax',
+ message: "Missing closing `}`",
+ filename: env.filename
+ };
+ }
+
+ return chunks.map(function (c) { return c.join('') });;
+ })([[]]);
+
+ // Start with the primary rule.
+ // The whole syntax tree is held under a Ruleset node,
+ // with the `root` property set to true, so no `{}` are
+ // output. The callback is called when the input is parsed.
+ root = new(tree.Ruleset)([], $(this.parsers.primary));
+ root.root = true;
+
+ root.toCSS = (function (evaluate) {
+ var line, lines, column;
+
+ return function (options, variables) {
+ var frames = [];
+
+ options = options || {};
+ //
+ // Allows setting variables with a hash, so:
+ //
+ // `{ color: new(tree.Color)('#f01') }` will become:
+ //
+ // new(tree.Rule)('@color',
+ // new(tree.Value)([
+ // new(tree.Expression)([
+ // new(tree.Color)('#f01')
+ // ])
+ // ])
+ // )
+ //
+ if (typeof(variables) === 'object' && !Array.isArray(variables)) {
+ variables = Object.keys(variables).map(function (k) {
+ var value = variables[k];
+
+ if (! (value instanceof tree.Value)) {
+ if (! (value instanceof tree.Expression)) {
+ value = new(tree.Expression)([value]);
+ }
+ value = new(tree.Value)([value]);
+ }
+ return new(tree.Rule)('@' + k, value, false, 0);
+ });
+ frames = [new(tree.Ruleset)(null, variables)];
+ }
+
+ try {
+ var css = evaluate.call(this, { frames: frames })
+ .toCSS([], { compress: options.compress || false });
+ } catch (e) {
+ lines = input.split('\n');
+ line = getLine(e.index);
+
+ for (var n = e.index, column = -1;
+ n >= 0 && input.charAt(n) !== '\n';
+ n--) { column++ }
+
+ throw {
+ type: e.type,
+ message: e.message,
+ filename: env.filename,
+ index: e.index,
+ line: typeof(line) === 'number' ? line + 1 : null,
+ callLine: e.call && (getLine(e.call) + 1),
+ callExtract: lines[getLine(e.call)],
+ stack: e.stack,
+ column: column,
+ extract: [
+ lines[line - 1],
+ lines[line],
+ lines[line + 1]
+ ]
+ };
+ }
+ if (options.compress) {
+ return css.replace(/(\s)+/g, "$1");
+ } else {
+ return css;
+ }
+
+ function getLine(index) {
+ return index ? (input.slice(0, index).match(/\n/g) || "").length : null;
+ }
+ };
+ })(root.eval);
+
+ // If `i` is smaller than the `input.length - 1`,
+ // it means the parser wasn't able to parse the whole
+ // string, so we've got a parsing error.
+ //
+ // We try to extract a \n delimited string,
+ // showing the line where the parse error occured.
+ // We split it up into two parts (the part which parsed,
+ // and the part which didn't), so we can color them differently.
+ if (i < input.length - 1) {
+ i = furthest;
+ lines = input.split('\n');
+ line = (input.slice(0, i).match(/\n/g) || "").length + 1;
+
+ for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ }
+
+ error = {
+ name: "ParseError",
+ message: "Syntax Error on line " + line,
+ index: i,
+ filename: env.filename,
+ line: line,
+ column: column,
+ extract: [
+ lines[line - 2],
+ lines[line - 1],
+ lines[line]
+ ]
+ };
+ }
+
+ if (this.imports.queue.length > 0) {
+ finish = function () { callback(error, root) };
+ } else {
+ callback(error, root);
+ }
+ },
+
+ //
+ // Here in, the parsing rules/functions
+ //
+ // The basic structure of the syntax tree generated is as follows:
+ //
+ // Ruleset -> Rule -> Value -> Expression -> Entity
+ //
+ // Here's some LESS code:
+ //
+ // .class {
+ // color: #fff;
+ // border: 1px solid #000;
+ // width: @w + 4px;
+ // > .child {...}
+ // }
+ //
+ // And here's what the parse tree might look like:
+ //
+ // Ruleset (Selector '.class', [
+ // Rule ("color", Value ([Expression [Color #fff]]))
+ // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]]))
+ // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]]))
+ // Ruleset (Selector [Element '>', '.child'], [...])
+ // ])
+ //
+ // In general, most rules will try to parse a token with the `$()` function, and if the return
+ // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
+ // first, before parsing, that's when we use `peek()`.
+ //
+ parsers: {
+ //
+ // The `primary` rule is the *entry* and *exit* point of the parser.
+ // The rules here can appear at any level of the parse tree.
+ //
+ // The recursive nature of the grammar is an interplay between the `block`
+ // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
+ // as represented by this simplified grammar:
+ //
+ // primary → (ruleset | rule)+
+ // ruleset → selector+ block
+ // block → '{' primary '}'
+ //
+ // Only at one point is the primary rule not called from the
+ // block rule: at the root level.
+ //
+ primary: function () {
+ var node, root = [];
+
+ while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
+ $(this.mixin.call) || $(this.comment) || $(this.directive))
+ || $(/^[\s\n]+/)) {
+ node && root.push(node);
+ }
+ return root;
+ },
+
+ // We create a Comment node for CSS comments `/* */`,
+ // but keep the LeSS comments `//` silent, by just skipping
+ // over them.
+ comment: function () {
+ var comment;
+
+ if (input.charAt(i) !== '/') return;
+
+ if (input.charAt(i + 1) === '/') {
+ return new(tree.Comment)($(/^\/\/.*/), true);
+ } else if (comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
+ return new(tree.Comment)(comment);
+ }
+ },
+
+ //
+ // Entities are tokens which can be found inside an Expression
+ //
+ entities: {
+ //
+ // A string, which supports escaping " and '
+ //
+ // "milky way" 'he\'s the one!'
+ //
+ quoted: function () {
+ var str, j = i, e;
+
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
+ if (input.charAt(j) !== '"' && input.charAt(j) !== "'") return;
+
+ e && $('~');
+
+ if (str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) {
+ return new(tree.Quoted)(str[0], str[1] || str[2], e);
+ }
+ },
+
+ //
+ // A catch-all word, such as:
+ //
+ // black border-collapse
+ //
+ keyword: function () {
+ var k;
+ if (k = $(/^[A-Za-z-]+/)) { return new(tree.Keyword)(k) }
+ },
+
+ //
+ // A function call
+ //
+ // rgb(255, 0, 255)
+ //
+ // We also try to catch IE's `alpha()`, but let the `alpha` parser
+ // deal with the details.
+ //
+ // The arguments are parsed with the `entities.arguments` parser.
+ //
+ call: function () {
+ var name, args;
+
+ if (! (name = /^([\w-]+|%)\(/.exec(chunks[j]))) return;
+
+ name = name[1].toLowerCase();
+
+ if (name === 'url') { return null }
+ else { i += name.length }
+
+ if (name === 'alpha') { return $(this.alpha) }
+
+ $('('); // Parse the '(' and consume whitespace.
+
+ args = $(this.entities.arguments);
+
+ if (! $(')')) return;
+
+ if (name) { return new(tree.Call)(name, args) }
+ },
+ arguments: function () {
+ var args = [], arg;
+
+ while (arg = $(this.expression)) {
+ args.push(arg);
+ if (! $(',')) { break }
+ }
+ return args;
+ },
+ literal: function () {
+ return $(this.entities.dimension) ||
+ $(this.entities.color) ||
+ $(this.entities.quoted);
+ },
+
+ //
+ // Parse url() tokens
+ //
+ // We use a specific rule for urls, because they don't really behave like
+ // standard function calls. The difference is that the argument doesn't have
+ // to be enclosed within a string, so it can't be parsed as an Expression.
+ //
+ url: function () {
+ var value;
+
+ if (input.charAt(i) !== 'u' || !$(/^url\(/)) return;
+ value = $(this.entities.quoted) || $(this.entities.variable) ||
+ $(this.entities.dataURI) || $(/^[-\w%@$\/.&=:;#+?~]+/) || "";
+ if (! $(')')) throw new(Error)("missing closing ) for url()");
+
+ return new(tree.URL)((value.value || value.data || value instanceof tree.Variable)
+ ? value : new(tree.Anonymous)(value), imports.paths);
+ },
+
+ dataURI: function () {
+ var obj;
+
+ if ($(/^data:/)) {
+ obj = {};
+ obj.mime = $(/^[^\/]+\/[^,;)]+/) || '';
+ obj.charset = $(/^;\s*charset=[^,;)]+/) || '';
+ obj.base64 = $(/^;\s*base64/) || '';
+ obj.data = $(/^,\s*[^)]+/);
+
+ if (obj.data) { return obj }
+ }
+ },
+
+ //
+ // A Variable entity, such as `@fink`, in
+ //
+ // width: @fink + 2px
+ //
+ // We use a different parser for variable definitions,
+ // see `parsers.variable`.
+ //
+ variable: function () {
+ var name, index = i;
+
+ if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
+ return new(tree.Variable)(name, index);
+ }
+ },
+
+ //
+ // A Hexadecimal color
+ //
+ // #4F3C2F
+ //
+ // `rgb` and `hsl` colors are parsed through the `entities.call` parser.
+ //
+ color: function () {
+ var rgb;
+
+ if (input.charAt(i) === '#' && (rgb = $(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
+ return new(tree.Color)(rgb[1]);
+ }
+ },
+
+ //
+ // A Dimension, that is, a number and a unit
+ //
+ // 0.5em 95%
+ //
+ dimension: function () {
+ var value, c = input.charCodeAt(i);
+ if ((c > 57 || c < 45) || c === 47) return;
+
+ if (value = $(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) {
+ return new(tree.Dimension)(value[1], value[2]);
+ }
+ },
+
+ //
+ // JavaScript code to be evaluated
+ //
+ // `window.location.href`
+ //
+ javascript: function () {
+ var str, j = i, e;
+
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
+ if (input.charAt(j) !== '`') { return }
+
+ e && $('~');
+
+ if (str = $(/^`([^`]*)`/)) {
+ return new(tree.JavaScript)(str[1], i, e);
+ }
+ }
+ },
+
+ //
+ // The variable part of a variable definition. Used in the `rule` parser
+ //
+ // @fink:
+ //
+ variable: function () {
+ var name;
+
+ if (input.charAt(i) === '@' && (name = $(/^(@[\w-]+)\s*:/))) { return name[1] }
+ },
+
+ //
+ // A font size/line-height shorthand
+ //
+ // small/12px
+ //
+ // We need to peek first, or we'll match on keywords and dimensions
+ //
+ shorthand: function () {
+ var a, b;
+
+ if (! peek(/^[@\w.%-]+\/[@\w.-]+/)) return;
+
+ if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) {
+ return new(tree.Shorthand)(a, b);
+ }
+ },
+
+ //
+ // Mixins
+ //
+ mixin: {
+ //
+ // A Mixin call, with an optional argument list
+ //
+ // #mixins > .square(#fff);
+ // .rounded(4px, black);
+ // .button;
+ //
+ // The `while` loop is there because mixins can be
+ // namespaced, but we only support the child and descendant
+ // selector for now.
+ //
+ call: function () {
+ var elements = [], e, c, args, index = i, s = input.charAt(i);
+
+ if (s !== '.' && s !== '#') { return }
+
+ while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
+ elements.push(new(tree.Element)(c, e));
+ c = $('>');
+ }
+ $('(') && (args = $(this.entities.arguments)) && $(')');
+
+ if (elements.length > 0 && ($(';') || peek('}'))) {
+ return new(tree.mixin.Call)(elements, args, index);
+ }
+ },
+
+ //
+ // A Mixin definition, with a list of parameters
+ //
+ // .rounded (@radius: 2px, @color) {
+ // ...
+ // }
+ //
+ // Until we have a finer grained state-machine, we have to
+ // do a look-ahead, to make sure we don't have a mixin call.
+ // See the `rule` function for more information.
+ //
+ // We start by matching `.rounded (`, and then proceed on to
+ // the argument list, which has optional default values.
+ // We store the parameters in `params`, with a `value` key,
+ // if there is a value, such as in the case of `@radius`.
+ //
+ // Once we've got our params list, and a closing `)`, we parse
+ // the `{...}` block.
+ //
+ definition: function () {
+ var name, params = [], match, ruleset, param, value;
+
+ if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
+ peek(/^[^{]*(;|})/)) return;
+
+ if (match = $(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)) {
+ name = match[1];
+
+ while (param = $(this.entities.variable) || $(this.entities.literal)
+ || $(this.entities.keyword)) {
+ // Variable
+ if (param instanceof tree.Variable) {
+ if ($(':')) {
+ if (value = $(this.expression)) {
+ params.push({ name: param.name, value: value });
+ } else {
+ throw new(Error)("Expected value");
+ }
+ } else {
+ params.push({ name: param.name });
+ }
+ } else {
+ params.push({ value: param });
+ }
+ if (! $(',')) { break }
+ }
+ if (! $(')')) throw new(Error)("Expected )");
+
+ ruleset = $(this.block);
+
+ if (ruleset) {
+ return new(tree.mixin.Definition)(name, params, ruleset);
+ }
+ }
+ }
+ },
+
+ //
+ // Entities are the smallest recognized token,
+ // and can be found inside a rule's value.
+ //
+ entity: function () {
+ return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) ||
+ $(this.entities.call) || $(this.entities.keyword) || $(this.entities.javascript) ||
+ $(this.comment);
+ },
+
+ //
+ // A Rule terminator. Note that we use `peek()` to check for '}',
+ // because the `block` rule will be expecting it, but we still need to make sure
+ // it's there, if ';' was ommitted.
+ //
+ end: function () {
+ return $(';') || peek('}');
+ },
+
+ //
+ // IE's alpha function
+ //
+ // alpha(opacity=88)
+ //
+ alpha: function () {
+ var value;
+
+ if (! $(/^opacity=/i)) return;
+ if (value = $(/^\d+/) || $(this.entities.variable)) {
+ if (! $(')')) throw new(Error)("missing closing ) for alpha()");
+ return new(tree.Alpha)(value);
+ }
+ },
+
+ //
+ // A Selector Element
+ //
+ // div
+ // + h1
+ // #socks
+ // input[type="text"]
+ //
+ // Elements are the building blocks for Selectors,
+ // they are made out of a `Combinator` (see combinator rule),
+ // and an element name, such as a tag a class, or `*`.
+ //
+ element: function () {
+ var e, t, c;
+
+ c = $(this.combinator);
+ e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/);
+
+ if (e) { return new(tree.Element)(c, e) }
+ },
+
+ //
+ // Combinators combine elements together, in a Selector.
+ //
+ // Because our parser isn't white-space sensitive, special care
+ // has to be taken, when parsing the descendant combinator, ` `,
+ // as it's an empty space. We have to check the previous character
+ // in the input, to see if it's a ` ` character. More info on how
+ // we deal with this in *combinator.js*.
+ //
+ combinator: function () {
+ var match, c = input.charAt(i);
+
+ if (c === '>' || c === '&' || c === '+' || c === '~') {
+ i++;
+ while (input.charAt(i) === ' ') { i++ }
+ return new(tree.Combinator)(c);
+ } else if (c === ':' && input.charAt(i + 1) === ':') {
+ i += 2;
+ while (input.charAt(i) === ' ') { i++ }
+ return new(tree.Combinator)('::');
+ } else if (input.charAt(i - 1) === ' ') {
+ return new(tree.Combinator)(" ");
+ } else {
+ return new(tree.Combinator)(null);
+ }
+ },
+
+ //
+ // A CSS Selector
+ //
+ // .class > div + h1
+ // li a:hover
+ //
+ // Selectors are made out of one or more Elements, see above.
+ //
+ selector: function () {
+ var sel, e, elements = [], c, match;
+
+ while (e = $(this.element)) {
+ c = input.charAt(i);
+ elements.push(e)
+ if (c === '{' || c === '}' || c === ';' || c === ',') { break }
+ }
+
+ if (elements.length > 0) { return new(tree.Selector)(elements) }
+ },
+ tag: function () {
+ return $(/^[a-zA-Z][a-zA-Z-]*[0-9]?/) || $('*');
+ },
+ attribute: function () {
+ var attr = '', key, val, op;
+
+ if (! $('[')) return;
+
+ if (key = $(/^[a-zA-Z-]+/) || $(this.entities.quoted)) {
+ if ((op = $(/^[|~*$^]?=/)) &&
+ (val = $(this.entities.quoted) || $(/^[\w-]+/))) {
+ attr = [key, op, val.toCSS ? val.toCSS() : val].join('');
+ } else { attr = key }
+ }
+
+ if (! $(']')) return;
+
+ if (attr) { return "[" + attr + "]" }
+ },
+
+ //
+ // The `block` rule is used by `ruleset` and `mixin.definition`.
+ // It's a wrapper around the `primary` rule, with added `{}`.
+ //
+ block: function () {
+ var content;
+
+ if ($('{') && (content = $(this.primary)) && $('}')) {
+ return content;
+ }
+ },
+
+ //
+ // div, .class, body > p {...}
+ //
+ ruleset: function () {
+ var selectors = [], s, rules, match;
+ save();
+
+ if (match = /^([.#: \w-]+)[\s\n]*\{/.exec(chunks[j])) {
+ i += match[0].length - 1;
+ selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
+ } else {
+ while (s = $(this.selector)) {
+ selectors.push(s);
+ $(this.comment);
+ if (! $(',')) { break }
+ $(this.comment);
+ }
+ }
+
+ if (selectors.length > 0 && (rules = $(this.block))) {
+ return new(tree.Ruleset)(selectors, rules);
+ } else {
+ // Backtrack
+ furthest = i;
+ restore();
+ }
+ },
+ rule: function () {
+ var name, value, c = input.charAt(i), important, match;
+ save();
+
+ if (c === '.' || c === '#' || c === '&') { return }
+
+ if (name = $(this.variable) || $(this.property)) {
+ if ((name.charAt(0) != '@') && (match = /^([^@+\/'"*`(;{}-]*);/.exec(chunks[j]))) {
+ i += match[0].length - 1;
+ value = new(tree.Anonymous)(match[1]);
+ } else if (name === "font") {
+ value = $(this.font);
+ } else {
+ value = $(this.value);
+ }
+ important = $(this.important);
+
+ if (value && $(this.end)) {
+ return new(tree.Rule)(name, value, important, memo);
+ } else {
+ furthest = i;
+ restore();
+ }
+ }
+ },
+
+ //
+ // An @import directive
+ //
+ // @import "lib";
+ //
+ // Depending on our environemnt, importing is done differently:
+ // In the browser, it's an XHR request, in Node, it would be a
+ // file-system operation. The function used for importing is
+ // stored in `import`, which we pass to the Import constructor.
+ //
+ "import": function () {
+ var path;
+ if ($(/^@import\s+/) &&
+ (path = $(this.entities.quoted) || $(this.entities.url)) &&
+ $(';')) {
+ return new(tree.Import)(path, imports);
+ }
+ },
+
+ //
+ // A CSS Directive
+ //
+ // @charset "utf-8";
+ //
+ directive: function () {
+ var name, value, rules, types;
+
+ if (input.charAt(i) !== '@') return;
+
+ if (value = $(this['import'])) {
+ return value;
+ } else if (name = $(/^@media|@page|@-[-a-z]+/)) {
+ types = ($(/^[^{]+/) || '').trim();
+ if (rules = $(this.block)) {
+ return new(tree.Directive)(name + " " + types, rules);
+ }
+ } else if (name = $(/^@[-a-z]+/)) {
+ if (name === '@font-face') {
+ if (rules = $(this.block)) {
+ return new(tree.Directive)(name, rules);
+ }
+ } else if ((value = $(this.entity)) && $(';')) {
+ return new(tree.Directive)(name, value);
+ }
+ }
+ },
+ font: function () {
+ var value = [], expression = [], weight, shorthand, font, e;
+
+ while (e = $(this.shorthand) || $(this.entity)) {
+ expression.push(e);
+ }
+ value.push(new(tree.Expression)(expression));
+
+ if ($(',')) {
+ while (e = $(this.expression)) {
+ value.push(e);
+ if (! $(',')) { break }
+ }
+ }
+ return new(tree.Value)(value);
+ },
+
+ //
+ // A Value is a comma-delimited list of Expressions
+ //
+ // font-family: Baskerville, Georgia, serif;
+ //
+ // In a Rule, a Value represents everything after the `:`,
+ // and before the `;`.
+ //
+ value: function () {
+ var e, expressions = [], important;
+
+ while (e = $(this.expression)) {
+ expressions.push(e);
+ if (! $(',')) { break }
+ }
+
+ if (expressions.length > 0) {
+ return new(tree.Value)(expressions);
+ }
+ },
+ important: function () {
+ if (input.charAt(i) === '!') {
+ return $(/^! *important/);
+ }
+ },
+ sub: function () {
+ var e;
+
+ if ($('(') && (e = $(this.expression)) && $(')')) {
+ return e;
+ }
+ },
+ multiplication: function () {
+ var m, a, op, operation;
+ if (m = $(this.operand)) {
+ while ((op = ($('/') || $('*'))) && (a = $(this.operand))) {
+ operation = new(tree.Operation)(op, [operation || m, a]);
+ }
+ return operation || m;
+ }
+ },
+ addition: function () {
+ var m, a, op, operation;
+ if (m = $(this.multiplication)) {
+ while ((op = $(/^[-+]\s+/) || (input.charAt(i - 1) != ' ' && ($('+') || $('-')))) &&
+ (a = $(this.multiplication))) {
+ operation = new(tree.Operation)(op, [operation || m, a]);
+ }
+ return operation || m;
+ }
+ },
+
+ //
+ // An operand is anything that can be part of an operation,
+ // such as a Color, or a Variable
+ //
+ operand: function () {
+ var negate, p = input.charAt(i + 1);
+
+ if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
+ var o = $(this.sub) || $(this.entities.dimension) ||
+ $(this.entities.color) || $(this.entities.variable) ||
+ $(this.entities.call);
+ return negate ? new(tree.Operation)('*', [new(tree.Dimension)(-1), o])
+ : o;
+ },
+
+ //
+ // Expressions either represent mathematical operations,
+ // or white-space delimited Entities.
+ //
+ // 1px solid black
+ // @var * 2
+ //
+ expression: function () {
+ var e, delim, entities = [], d;
+
+ while (e = $(this.addition) || $(this.entity)) {
+ entities.push(e);
+ }
+ if (entities.length > 0) {
+ return new(tree.Expression)(entities);
+ }
+ },
+ property: function () {
+ var name;
+
+ if (name = $(/^(\*?-?[-a-z_0-9]+)\s*:/)) {
+ return name[1];
+ }
+ }
+ }
+ };
+};
+
+if (typeof(window) !== 'undefined') {
+ //
+ // Used by `@import` directives
+ //
+ less.Parser.importer = function (path, paths, callback, env) {
+ if (path.charAt(0) !== '/' && paths.length > 0) {
+ path = paths[0] + path;
+ }
+ // We pass `true` as 3rd argument, to force the reload of the import.
+ // This is so we can get the syntax tree as opposed to just the CSS output,
+ // as we need this to evaluate the current stylesheet.
+ loadStyleSheet({ href: path, title: path, type: env.mime }, callback, true);
+ };
+}
+
+(function (tree) {
+
+tree.functions = {
+ rgb: function (r, g, b) {
+ return this.rgba(r, g, b, 1.0);
+ },
+ rgba: function (r, g, b, a) {
+ var rgb = [r, g, b].map(function (c) { return number(c) }),
+ a = number(a);
+ return new(tree.Color)(rgb, a);
+ },
+ hsl: function (h, s, l) {
+ return this.hsla(h, s, l, 1.0);
+ },
+ hsla: function (h, s, l, a) {
+ h = (number(h) % 360) / 360;
+ s = number(s); l = number(l); a = number(a);
+
+ var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
+ var m1 = l * 2 - m2;
+
+ return this.rgba(hue(h + 1/3) * 255,
+ hue(h) * 255,
+ hue(h - 1/3) * 255,
+ a);
+
+ function hue(h) {
+ h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
+ if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
+ else if (h * 2 < 1) return m2;
+ else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;
+ else return m1;
+ }
+ },
+ hue: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().h));
+ },
+ saturation: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%');
+ },
+ lightness: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
+ },
+ alpha: function (color) {
+ return new(tree.Dimension)(color.toHSL().a);
+ },
+ saturate: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.s += amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ desaturate: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.s -= amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ lighten: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l += amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ darken: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l -= amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ fadein: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a += amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ fadeout: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a -= amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ spin: function (color, amount) {
+ var hsl = color.toHSL();
+ var hue = (hsl.h + amount.value) % 360;
+
+ hsl.h = hue < 0 ? 360 + hue : hue;
+
+ return hsla(hsl);
+ },
+ //
+ // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
+ // http://sass-lang.com
+ //
+ mix: function (color1, color2, weight) {
+ var p = weight.value / 100.0;
+ var w = p * 2 - 1;
+ var a = color1.toHSL().a - color2.toHSL().a;
+
+ var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
+ var w2 = 1 - w1;
+
+ var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
+ color1.rgb[1] * w1 + color2.rgb[1] * w2,
+ color1.rgb[2] * w1 + color2.rgb[2] * w2];
+
+ var alpha = color1.alpha * p + color2.alpha * (1 - p);
+
+ return new(tree.Color)(rgb, alpha);
+ },
+ greyscale: function (color) {
+ return this.desaturate(color, new(tree.Dimension)(100));
+ },
+ e: function (str) {
+ return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
+ },
+ escape: function (str) {
+ return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"));
+ },
+ '%': function (quoted /* arg, arg, ...*/) {
+ var args = Array.prototype.slice.call(arguments, 1),
+ str = quoted.value;
+
+ for (var i = 0; i < args.length; i++) {
+ str = str.replace(/%[sda]/i, function(token) {
+ var value = token.match(/s/i) ? args[i].value : args[i].toCSS();
+ return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
+ });
+ }
+ str = str.replace(/%%/g, '%');
+ return new(tree.Quoted)('"' + str + '"', str);
+ },
+ round: function (n) {
+ if (n instanceof tree.Dimension) {
+ return new(tree.Dimension)(Math.round(number(n)), n.unit);
+ } else if (typeof(n) === 'number') {
+ return Math.round(n);
+ } else {
+ throw {
+ error: "RuntimeError",
+ message: "math functions take numbers as parameters"
+ };
+ }
+ }
+};
+
+function hsla(hsla) {
+ return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a);
+}
+
+function number(n) {
+ if (n instanceof tree.Dimension) {
+ return parseFloat(n.unit == '%' ? n.value / 100 : n.value);
+ } else if (typeof(n) === 'number') {
+ return n;
+ } else {
+ throw {
+ error: "RuntimeError",
+ message: "color functions take numbers as parameters"
+ };
+ }
+}
+
+function clamp(val) {
+ return Math.min(1, Math.max(0, val));
+}
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Alpha = function (val) {
+ this.value = val;
+};
+tree.Alpha.prototype = {
+ toCSS: function () {
+ return "alpha(opacity=" +
+ (this.value.toCSS ? this.value.toCSS() : this.value) + ")";
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Anonymous = function (string) {
+ this.value = string.value || string;
+};
+tree.Anonymous.prototype = {
+ toCSS: function () {
+ return this.value;
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+//
+// A function call node.
+//
+tree.Call = function (name, args) {
+ this.name = name;
+ this.args = args;
+};
+tree.Call.prototype = {
+ //
+ // When evaluating a function call,
+ // we either find the function in `tree.functions` [1],
+ // in which case we call it, passing the evaluated arguments,
+ // or we simply print it out as it appeared originally [2].
+ //
+ // The *functions.js* file contains the built-in functions.
+ //
+ // The reason why we evaluate the arguments, is in the case where
+ // we try to pass a variable to a function, like: `saturate(@color)`.
+ // The function should receive the value, not the variable.
+ //
+ eval: function (env) {
+ var args = this.args.map(function (a) { return a.eval(env) });
+
+ if (this.name in tree.functions) { // 1.
+ return tree.functions[this.name].apply(tree.functions, args);
+ } else { // 2.
+ return new(tree.Anonymous)(this.name +
+ "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")");
+ }
+ },
+
+ toCSS: function (env) {
+ return this.eval(env).toCSS();
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+//
+// RGB Colors - #ff0014, #eee
+//
+tree.Color = function (rgb, a) {
+ //
+ // The end goal here, is to parse the arguments
+ // into an integer triplet, such as `128, 255, 0`
+ //
+ // This facilitates operations and conversions.
+ //
+ if (Array.isArray(rgb)) {
+ this.rgb = rgb;
+ } else if (rgb.length == 6) {
+ this.rgb = rgb.match(/.{2}/g).map(function (c) {
+ return parseInt(c, 16);
+ });
+ } else if (rgb.length == 8) {
+ this.alpha = parseInt(rgb.substring(0,2), 16) / 255.0;
+ this.rgb = rgb.substr(2).match(/.{2}/g).map(function (c) {
+ return parseInt(c, 16);
+ });
+ } else {
+ this.rgb = rgb.split('').map(function (c) {
+ return parseInt(c + c, 16);
+ });
+ }
+ this.alpha = typeof(a) === 'number' ? a : 1;
+};
+tree.Color.prototype = {
+ eval: function () { return this },
+
+ //
+ // If we have some transparency, the only way to represent it
+ // is via `rgba`. Otherwise, we use the hex representation,
+ // which has better compatibility with older browsers.
+ // Values are capped between `0` and `255`, rounded and zero-padded.
+ //
+ toCSS: function () {
+ if (this.alpha < 1.0) {
+ return "rgba(" + this.rgb.map(function (c) {
+ return Math.round(c);
+ }).concat(this.alpha).join(', ') + ")";
+ } else {
+ return '#' + this.rgb.map(function (i) {
+ i = Math.round(i);
+ i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
+ return i.length === 1 ? '0' + i : i;
+ }).join('');
+ }
+ },
+
+ //
+ // Operations have to be done per-channel, if not,
+ // channels will spill onto each other. Once we have
+ // our result, in the form of an integer triplet,
+ // we create a new Color node to hold the result.
+ //
+ operate: function (op, other) {
+ var result = [];
+
+ if (! (other instanceof tree.Color)) {
+ other = other.toColor();
+ }
+
+ for (var c = 0; c < 3; c++) {
+ result[c] = tree.operate(op, this.rgb[c], other.rgb[c]);
+ }
+ return new(tree.Color)(result, this.alpha + other.alpha);
+ },
+
+ toHSL: function () {
+ var r = this.rgb[0] / 255,
+ g = this.rgb[1] / 255,
+ b = this.rgb[2] / 255,
+ a = this.alpha;
+
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
+ var h, s, l = (max + min) / 2, d = max - min;
+
+ if (max === min) {
+ h = s = 0;
+ } else {
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+
+ switch (max) {
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+ case g: h = (b - r) / d + 2; break;
+ case b: h = (r - g) / d + 4; break;
+ }
+ h /= 6;
+ }
+ return { h: h * 360, s: s, l: l, a: a };
+ }
+};
+
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Comment = function (value, silent) {
+ this.value = value;
+ this.silent = !!silent;
+};
+tree.Comment.prototype = {
+ toCSS: function (env) {
+ return env.compress ? '' : this.value;
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+//
+// A number with a unit
+//
+tree.Dimension = function (value, unit) {
+ this.value = parseFloat(value);
+ this.unit = unit || null;
+};
+
+tree.Dimension.prototype = {
+ eval: function () { return this },
+ toColor: function () {
+ return new(tree.Color)([this.value, this.value, this.value]);
+ },
+ toCSS: function () {
+ var css = this.value + this.unit;
+ return css;
+ },
+
+ // In an operation between two Dimensions,
+ // we default to the first Dimension's unit,
+ // so `1px + 2em` will yield `3px`.
+ // In the future, we could implement some unit
+ // conversions such that `100cm + 10mm` would yield
+ // `101cm`.
+ operate: function (op, other) {
+ return new(tree.Dimension)
+ (tree.operate(op, this.value, other.value),
+ this.unit || other.unit);
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Directive = function (name, value) {
+ this.name = name;
+ if (Array.isArray(value)) {
+ this.ruleset = new(tree.Ruleset)([], value);
+ } else {
+ this.value = value;
+ }
+};
+tree.Directive.prototype = {
+ toCSS: function (ctx, env) {
+ if (this.ruleset) {
+ this.ruleset.root = true;
+ return this.name + (env.compress ? '{' : ' {\n ') +
+ this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') +
+ (env.compress ? '}': '\n}\n');
+ } else {
+ return this.name + ' ' + this.value.toCSS() + ';\n';
+ }
+ },
+ eval: function (env) {
+ env.frames.unshift(this);
+ this.ruleset = this.ruleset && this.ruleset.eval(env);
+ env.frames.shift();
+ return this;
+ },
+ variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
+ find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
+ rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Element = function (combinator, value) {
+ this.combinator = combinator instanceof tree.Combinator ?
+ combinator : new(tree.Combinator)(combinator);
+ this.value = value.trim();
+};
+tree.Element.prototype.toCSS = function (env) {
+ return this.combinator.toCSS(env || {}) + this.value;
+};
+
+tree.Combinator = function (value) {
+ if (value === ' ') {
+ this.value = ' ';
+ } else {
+ this.value = value ? value.trim() : "";
+ }
+};
+tree.Combinator.prototype.toCSS = function (env) {
+ return {
+ '' : '',
+ ' ' : ' ',
+ '&' : '',
+ ':' : ' :',
+ '::': '::',
+ '+' : env.compress ? '+' : ' + ',
+ '~' : env.compress ? '~' : ' ~ ',
+ '>' : env.compress ? '>' : ' > '
+ }[this.value];
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Expression = function (value) { this.value = value };
+tree.Expression.prototype = {
+ eval: function (env) {
+ if (this.value.length > 1) {
+ return new(tree.Expression)(this.value.map(function (e) {
+ return e.eval(env);
+ }));
+ } else if (this.value.length === 1) {
+ return this.value[0].eval(env);
+ } else {
+ return this;
+ }
+ },
+ toCSS: function (env) {
+ return this.value.map(function (e) {
+ return e.toCSS(env);
+ }).join(' ');
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+//
+// CSS @import node
+//
+// The general strategy here is that we don't want to wait
+// for the parsing to be completed, before we start importing
+// the file. That's because in the context of a browser,
+// most of the time will be spent waiting for the server to respond.
+//
+// On creation, we push the import path to our import queue, though
+// `import,push`, we also pass it a callback, which it'll call once
+// the file has been fetched, and parsed.
+//
+tree.Import = function (path, imports) {
+ var that = this;
+
+ this._path = path;
+
+ // The '.less' extension is optional
+ if (path instanceof tree.Quoted) {
+ this.path = /\.(le?|c)ss$/.test(path.value) ? path.value : path.value + '.less';
+ } else {
+ this.path = path.value.value || path.value;
+ }
+
+ this.css = /css$/.test(this.path);
+
+ // Only pre-compile .less files
+ if (! this.css) {
+ imports.push(this.path, function (root) {
+ if (! root) {
+ throw new(Error)("Error parsing " + that.path);
+ }
+ that.root = root;
+ });
+ }
+};
+
+//
+// The actual import node doesn't return anything, when converted to CSS.
+// The reason is that it's used at the evaluation stage, so that the rules
+// it imports can be treated like any other rules.
+//
+// In `eval`, we make sure all Import nodes get evaluated, recursively, so
+// we end up with a flat structure, which can easily be imported in the parent
+// ruleset.
+//
+tree.Import.prototype = {
+ toCSS: function () {
+ if (this.css) {
+ return "@import " + this._path.toCSS() + ';\n';
+ } else {
+ return "";
+ }
+ },
+ eval: function (env) {
+ var ruleset;
+
+ if (this.css) {
+ return this;
+ } else {
+ ruleset = new(tree.Ruleset)(null, this.root.rules.slice(0));
+
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.Import) {
+ Array.prototype
+ .splice
+ .apply(ruleset.rules,
+ [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+ return ruleset.rules;
+ }
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.JavaScript = function (string, index, escaped) {
+ this.escaped = escaped;
+ this.expression = string;
+ this.index = index;
+};
+tree.JavaScript.prototype = {
+ eval: function (env) {
+ var result,
+ that = this,
+ context = {};
+
+ var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
+ return tree.jsify(new(tree.Variable)('@' + name, that.index).eval(env));
+ });
+
+ try {
+ expression = new(Function)('return (' + expression + ')');
+ } catch (e) {
+ throw { message: "JavaScript evaluation error: `" + expression + "`" ,
+ index: this.index };
+ }
+
+ for (var k in env.frames[0].variables()) {
+ context[k.slice(1)] = {
+ value: env.frames[0].variables()[k].value,
+ toJS: function () {
+ return this.value.eval(env).toCSS();
+ }
+ };
+ }
+
+ try {
+ result = expression.call(context);
+ } catch (e) {
+ throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" ,
+ index: this.index };
+ }
+ if (typeof(result) === 'string') {
+ return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index);
+ } else if (Array.isArray(result)) {
+ return new(tree.Anonymous)(result.join(', '));
+ } else {
+ return new(tree.Anonymous)(result);
+ }
+ }
+};
+
+})(require('less/tree'));
+
+(function (tree) {
+
+tree.Keyword = function (value) { this.value = value };
+tree.Keyword.prototype = {
+ eval: function () { return this },
+ toCSS: function () { return this.value }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.mixin = {};
+tree.mixin.Call = function (elements, args, index) {
+ this.selector = new(tree.Selector)(elements);
+ this.arguments = args;
+ this.index = index;
+};
+tree.mixin.Call.prototype = {
+ eval: function (env) {
+ var mixins, rules = [], match = false;
+
+ for (var i = 0; i < env.frames.length; i++) {
+ if ((mixins = env.frames[i].find(this.selector)).length > 0) {
+ for (var m = 0; m < mixins.length; m++) {
+ if (mixins[m].match(this.arguments, env)) {
+ try {
+ Array.prototype.push.apply(
+ rules, mixins[m].eval(env, this.arguments).rules);
+ match = true;
+ } catch (e) {
+ throw { message: e.message, index: e.index, stack: e.stack, call: this.index };
+ }
+ }
+ }
+ if (match) {
+ return rules;
+ } else {
+ throw { message: 'No matching definition was found for `' +
+ this.selector.toCSS().trim() + '(' +
+ this.arguments.map(function (a) {
+ return a.toCSS();
+ }).join(', ') + ")`",
+ index: this.index };
+ }
+ }
+ }
+ throw { message: this.selector.toCSS().trim() + " is undefined",
+ index: this.index };
+ }
+};
+
+tree.mixin.Definition = function (name, params, rules) {
+ this.name = name;
+ this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
+ this.params = params;
+ this.arity = params.length;
+ this.rules = rules;
+ this._lookups = {};
+ this.required = params.reduce(function (count, p) {
+ if (!p.name || (p.name && !p.value)) { return count + 1 }
+ else { return count }
+ }, 0);
+ this.parent = tree.Ruleset.prototype;
+ this.frames = [];
+};
+tree.mixin.Definition.prototype = {
+ toCSS: function () { return "" },
+ variable: function (name) { return this.parent.variable.call(this, name) },
+ variables: function () { return this.parent.variables.call(this) },
+ find: function () { return this.parent.find.apply(this, arguments) },
+ rulesets: function () { return this.parent.rulesets.apply(this) },
+
+ eval: function (env, args) {
+ var frame = new(tree.Ruleset)(null, []), context, _arguments = [];
+
+ for (var i = 0, val; i < this.params.length; i++) {
+ if (this.params[i].name) {
+ if (val = (args && args[i]) || this.params[i].value) {
+ frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env)));
+ } else {
+ throw { message: "wrong number of arguments for " + this.name +
+ ' (' + args.length + ' for ' + this.arity + ')' };
+ }
+ }
+ }
+ for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) {
+ _arguments.push(args[i] || this.params[i].value);
+ }
+ frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments).eval(env)));
+
+ return new(tree.Ruleset)(null, this.rules.slice(0)).eval({
+ frames: [this, frame].concat(this.frames, env.frames)
+ });
+ },
+ match: function (args, env) {
+ var argsLength = (args && args.length) || 0, len;
+
+ if (argsLength < this.required) { return false }
+ if ((this.required > 0) && (argsLength > this.params.length)) { return false }
+
+ len = Math.min(argsLength, this.arity);
+
+ for (var i = 0; i < len; i++) {
+ if (!this.params[i].name) {
+ if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Operation = function (op, operands) {
+ this.op = op.trim();
+ this.operands = operands;
+};
+tree.Operation.prototype.eval = function (env) {
+ var a = this.operands[0].eval(env),
+ b = this.operands[1].eval(env),
+ temp;
+
+ if (a instanceof tree.Dimension && b instanceof tree.Color) {
+ if (this.op === '*' || this.op === '+') {
+ temp = b, b = a, a = temp;
+ } else {
+ throw { name: "OperationError",
+ message: "Can't substract or divide a color from a number" };
+ }
+ }
+ return a.operate(this.op, b);
+};
+
+tree.operate = function (op, a, b) {
+ switch (op) {
+ case '+': return a + b;
+ case '-': return a - b;
+ case '*': return a * b;
+ case '/': return a / b;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Quoted = function (str, content, escaped, i) {
+ this.escaped = escaped;
+ this.value = content || '';
+ this.quote = str.charAt(0);
+ this.index = i;
+};
+tree.Quoted.prototype = {
+ toCSS: function () {
+ if (this.escaped) {
+ return this.value;
+ } else {
+ return this.quote + this.value + this.quote;
+ }
+ },
+ eval: function (env) {
+ var that = this;
+ this.value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
+ return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
+ }).replace(/@\{([\w-]+)\}/g, function (_, name) {
+ return new(tree.Variable)('@' + name, that.index).eval(env).value;
+ });
+ return this;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Rule = function (name, value, important, index) {
+ this.name = name;
+ this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
+ this.important = important ? ' ' + important.trim() : '';
+ this.index = index;
+
+ if (name.charAt(0) === '@') {
+ this.variable = true;
+ } else { this.variable = false }
+};
+tree.Rule.prototype.toCSS = function (env) {
+ if (this.variable) { return "" }
+ else {
+ return this.name + (env.compress ? ':' : ': ') +
+ this.value.toCSS(env) +
+ this.important + ";";
+ }
+};
+
+tree.Rule.prototype.eval = function (context) {
+ return new(tree.Rule)(this.name, this.value.eval(context), this.important, this.index);
+};
+
+tree.Shorthand = function (a, b) {
+ this.a = a;
+ this.b = b;
+};
+
+tree.Shorthand.prototype = {
+ toCSS: function (env) {
+ return this.a.toCSS(env) + "/" + this.b.toCSS(env);
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Ruleset = function (selectors, rules) {
+ this.selectors = selectors;
+ this.rules = rules;
+ this._lookups = {};
+};
+tree.Ruleset.prototype = {
+ eval: function (env) {
+ var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0));
+
+ ruleset.root = this.root;
+
+ // push the current ruleset to the frames stack
+ env.frames.unshift(ruleset);
+
+ // Evaluate imports
+ if (ruleset.root) {
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.Import) {
+ Array.prototype.splice
+ .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+ }
+
+ // Store the frames around mixin definitions,
+ // so they can be evaluated like closures when the time comes.
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.mixin.Definition) {
+ ruleset.rules[i].frames = env.frames.slice(0);
+ }
+ }
+
+ // Evaluate mixin calls.
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.mixin.Call) {
+ Array.prototype.splice
+ .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+
+ // Evaluate everything else
+ for (var i = 0, rule; i < ruleset.rules.length; i++) {
+ rule = ruleset.rules[i];
+
+ if (! (rule instanceof tree.mixin.Definition)) {
+ ruleset.rules[i] = rule.eval ? rule.eval(env) : rule;
+ }
+ }
+
+ // Pop the stack
+ env.frames.shift();
+
+ return ruleset;
+ },
+ match: function (args) {
+ return !args || args.length === 0;
+ },
+ variables: function () {
+ if (this._variables) { return this._variables }
+ else {
+ return this._variables = this.rules.reduce(function (hash, r) {
+ if (r instanceof tree.Rule && r.variable === true) {
+ hash[r.name] = r;
+ }
+ return hash;
+ }, {});
+ }
+ },
+ variable: function (name) {
+ return this.variables()[name];
+ },
+ rulesets: function () {
+ if (this._rulesets) { return this._rulesets }
+ else {
+ return this._rulesets = this.rules.filter(function (r) {
+ return (r instanceof tree.Ruleset) || (r instanceof tree.mixin.Definition);
+ });
+ }
+ },
+ find: function (selector, self) {
+ self = self || this;
+ var rules = [], rule, match,
+ key = selector.toCSS();
+
+ if (key in this._lookups) { return this._lookups[key] }
+
+ this.rulesets().forEach(function (rule) {
+ if (rule !== self) {
+ for (var j = 0; j < rule.selectors.length; j++) {
+ if (match = selector.match(rule.selectors[j])) {
+ if (selector.elements.length > 1) {
+ Array.prototype.push.apply(rules, rule.find(
+ new(tree.Selector)(selector.elements.slice(1)), self));
+ } else {
+ rules.push(rule);
+ }
+ break;
+ }
+ }
+ }
+ });
+ return this._lookups[key] = rules;
+ },
+ //
+ // Entry point for code generation
+ //
+ // `context` holds an array of arrays.
+ //
+ toCSS: function (context, env) {
+ var css = [], // The CSS output
+ rules = [], // node.Rule instances
+ rulesets = [], // node.Ruleset instances
+ paths = [], // Current selectors
+ selector, // The fully rendered selector
+ rule;
+
+ if (! this.root) {
+ if (context.length === 0) {
+ paths = this.selectors.map(function (s) { return [s] });
+ } else {
+ for (var s = 0; s < this.selectors.length; s++) {
+ for (var c = 0; c < context.length; c++) {
+ paths.push(context[c].concat([this.selectors[s]]));
+ }
+ }
+ }
+ }
+
+ // Compile rules and rulesets
+ for (var i = 0; i < this.rules.length; i++) {
+ rule = this.rules[i];
+
+ if (rule.rules || (rule instanceof tree.Directive)) {
+ rulesets.push(rule.toCSS(paths, env));
+ } else if (rule instanceof tree.Comment) {
+ if (!rule.silent) {
+ if (this.root) {
+ rulesets.push(rule.toCSS(env));
+ } else {
+ rules.push(rule.toCSS(env));
+ }
+ }
+ } else {
+ if (rule.toCSS && !rule.variable) {
+ rules.push(rule.toCSS(env));
+ } else if (rule.value && !rule.variable) {
+ rules.push(rule.value.toString());
+ }
+ }
+ }
+
+ rulesets = rulesets.join('');
+
+ // If this is the root node, we don't render
+ // a selector, or {}.
+ // Otherwise, only output if this ruleset has rules.
+ if (this.root) {
+ css.push(rules.join(env.compress ? '' : '\n'));
+ } else {
+ if (rules.length > 0) {
+ selector = paths.map(function (p) {
+ return p.map(function (s) {
+ return s.toCSS(env);
+ }).join('').trim();
+ }).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
+ css.push(selector,
+ (env.compress ? '{' : ' {\n ') +
+ rules.join(env.compress ? '' : '\n ') +
+ (env.compress ? '}' : '\n}\n'));
+ }
+ }
+ css.push(rulesets);
+
+ return css.join('') + (env.compress ? '\n' : '');
+ }
+};
+})(require('less/tree'));
+(function (tree) {
+
+tree.Selector = function (elements) {
+ this.elements = elements;
+ if (this.elements[0].combinator.value === "") {
+ this.elements[0].combinator.value = ' ';
+ }
+};
+tree.Selector.prototype.match = function (other) {
+ if (this.elements[0].value === other.elements[0].value) {
+ return true;
+ } else {
+ return false;
+ }
+};
+tree.Selector.prototype.toCSS = function (env) {
+ if (this._css) { return this._css }
+
+ return this._css = this.elements.map(function (e) {
+ if (typeof(e) === 'string') {
+ return ' ' + e.trim();
+ } else {
+ return e.toCSS(env);
+ }
+ }).join('');
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.URL = function (val, paths) {
+ if (val.data) {
+ this.attrs = val;
+ } else {
+ // Add the base path if the URL is relative and we are in the browser
+ if (!/^(?:https?:\/|file:\/|data:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
+ val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value);
+ }
+ this.value = val;
+ this.paths = paths;
+ }
+};
+tree.URL.prototype = {
+ toCSS: function () {
+ return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data
+ : this.value.toCSS()) + ")";
+ },
+ eval: function (ctx) {
+ return this.attrs ? this : new(tree.URL)(this.value.eval(ctx), this.paths);
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Value = function (value) {
+ this.value = value;
+ this.is = 'value';
+};
+tree.Value.prototype = {
+ eval: function (env) {
+ if (this.value.length === 1) {
+ return this.value[0].eval(env);
+ } else {
+ return new(tree.Value)(this.value.map(function (v) {
+ return v.eval(env);
+ }));
+ }
+ },
+ toCSS: function (env) {
+ return this.value.map(function (e) {
+ return e.toCSS(env);
+ }).join(env.compress ? ',' : ', ');
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Variable = function (name, index) { this.name = name, this.index = index };
+tree.Variable.prototype = {
+ eval: function (env) {
+ var variable, v, name = this.name;
+
+ if (name.indexOf('@@') == 0) {
+ name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value;
+ }
+
+ if (variable = tree.find(env.frames, function (frame) {
+ if (v = frame.variable(name)) {
+ return v.value.eval(env);
+ }
+ })) { return variable }
+ else {
+ throw { message: "variable " + name + " is undefined",
+ index: this.index };
+ }
+ }
+};
+
+})(require('less/tree'));
+require('less/tree').find = function (obj, fun) {
+ for (var i = 0, r; i < obj.length; i++) {
+ if (r = fun.call(obj, obj[i])) { return r }
+ }
+ return null;
+};
+require('less/tree').jsify = function (obj) {
+ if (Array.isArray(obj.value) && (obj.value.length > 1)) {
+ return '[' + obj.value.map(function (v) { return v.toCSS(false) }).join(', ') + ']';
+ } else {
+ return obj.toCSS(false);
+ }
+};
+//
+// browser.js - client-side engine
+//
+
+var isFileProtocol = (location.protocol === 'file:' ||
+ location.protocol === 'chrome:' ||
+ location.protocol === 'chrome-extension:' ||
+ location.protocol === 'resource:');
+
+less.env = less.env || (location.hostname == '127.0.0.1' ||
+ location.hostname == '0.0.0.0' ||
+ location.hostname == 'localhost' ||
+ location.port.length > 0 ||
+ isFileProtocol ? 'development'
+ : 'production');
+
+// Load styles asynchronously (default: false)
+//
+// This is set to `false` by default, so that the body
+// doesn't start loading before the stylesheets are parsed.
+// Setting this to `true` can result in flickering.
+//
+less.async = false;
+
+// Interval between watch polls
+less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
+
+//
+// Watch mode
+//
+less.watch = function () { return this.watchMode = true };
+less.unwatch = function () { return this.watchMode = false };
+
+if (less.env === 'development') {
+ less.optimization = 0;
+
+ if (/!watch/.test(location.hash)) {
+ less.watch();
+ }
+ less.watchTimer = setInterval(function () {
+ if (less.watchMode) {
+ loadStyleSheets(function (root, sheet, env) {
+ if (root) {
+ createCSS(root.toCSS(), sheet, env.lastModified);
+ }
+ });
+ }
+ }, less.poll);
+} else {
+ less.optimization = 3;
+}
+
+var cache;
+
+try {
+ cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
+} catch (_) {
+ cache = null;
+}
+
+//
+// Get all tags with the 'rel' attribute set to "stylesheet/less"
+//
+var links = document.getElementsByTagName('link');
+var typePattern = /^text\/(x-)?less$/;
+
+less.sheets = [];
+
+for (var i = 0; i < links.length; i++) {
+ if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
+ (links[i].type.match(typePattern)))) {
+ less.sheets.push(links[i]);
+ }
+}
+
+
+less.refresh = function (reload) {
+ var startTime, endTime;
+ startTime = endTime = new(Date);
+
+ loadStyleSheets(function (root, sheet, env) {
+ if (env.local) {
+ log("loading " + sheet.href + " from cache.");
+ } else {
+ log("parsed " + sheet.href + " successfully.");
+ createCSS(root.toCSS(), sheet, env.lastModified);
+ }
+ log("css for " + sheet.href + " generated in " + (new(Date) - endTime) + 'ms');
+ (env.remaining === 0) && log("css generated in " + (new(Date) - startTime) + 'ms');
+ endTime = new(Date);
+ }, reload);
+
+ loadStyles();
+};
+less.refreshStyles = loadStyles;
+
+less.refresh(less.env === 'development');
+
+function loadStyles() {
+ var styles = document.getElementsByTagName('style');
+ for (var i = 0; i < styles.length; i++) {
+ if (styles[i].type.match(typePattern)) {
+ new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
+ styles[i].type = 'text/css';
+ styles[i].innerHTML = tree.toCSS();
+ });
+ }
+ }
+}
+
+function loadStyleSheets(callback, reload) {
+ for (var i = 0; i < less.sheets.length; i++) {
+ loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1));
+ }
+}
+
+function loadStyleSheet(sheet, callback, reload, remaining) {
+ var url = window.location.href.replace(/[#?].*$/, '');
+ var href = sheet.href.replace(/\?.*$/, '');
+ var css = cache && cache.getItem(href);
+ var timestamp = cache && cache.getItem(href + ':timestamp');
+ var styles = { css: css, timestamp: timestamp };
+
+ // Stylesheets in IE don't always return the full path
+ if (! /^(https?|file):/.test(href)) {
+ if (href.charAt(0) == "/") {
+ href = window.location.protocol + "//" + window.location.host + href;
+ } else {
+ href = url.slice(0, url.lastIndexOf('/') + 1) + href;
+ }
+ }
+
+ xhr(sheet.href, sheet.type, function (data, lastModified) {
+ if (!reload && styles && lastModified &&
+ (new(Date)(lastModified).valueOf() ===
+ new(Date)(styles.timestamp).valueOf())) {
+ // Use local copy
+ createCSS(styles.css, sheet);
+ callback(null, sheet, { local: true, remaining: remaining });
+ } else {
+ // Use remote copy (re-parse)
+ try {
+ new(less.Parser)({
+ optimization: less.optimization,
+ paths: [href.replace(/[\w\.-]+$/, '')],
+ mime: sheet.type
+ }).parse(data, function (e, root) {
+ if (e) { return error(e, href) }
+ try {
+ callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining });
+ removeNode(document.getElementById('less-error-message:' + extractId(href)));
+ } catch (e) {
+ error(e, href);
+ }
+ });
+ } catch (e) {
+ error(e, href);
+ }
+ }
+ }, function (status, url) {
+ throw new(Error)("Couldn't load " + url + " (" + status + ")");
+ });
+}
+
+function extractId(href) {
+ return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' ) // Remove protocol & domain
+ .replace(/^\//, '' ) // Remove root /
+ .replace(/\?.*$/, '' ) // Remove query
+ .replace(/\.[^\.\/]+$/, '' ) // Remove file extension
+ .replace(/[^\.\w-]+/g, '-') // Replace illegal characters
+ .replace(/\./g, ':'); // Replace dots with colons(for valid id)
+}
+
+function createCSS(styles, sheet, lastModified) {
+ var css;
+
+ // Strip the query-string
+ var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : '';
+
+ // If there is no title set, use the filename, minus the extension
+ var id = 'less:' + (sheet.title || extractId(href));
+
+ // If the stylesheet doesn't exist, create a new node
+ if ((css = document.getElementById(id)) === null) {
+ css = document.createElement('style');
+ css.type = 'text/css';
+ css.media = sheet.media || 'screen';
+ css.id = id;
+ document.getElementsByTagName('head')[0].appendChild(css);
+ }
+
+ if (css.styleSheet) { // IE
+ try {
+ css.styleSheet.cssText = styles;
+ } catch (e) {
+ throw new(Error)("Couldn't reassign styleSheet.cssText.");
+ }
+ } else {
+ (function (node) {
+ if (css.childNodes.length > 0) {
+ if (css.firstChild.nodeValue !== node.nodeValue) {
+ css.replaceChild(node, css.firstChild);
+ }
+ } else {
+ css.appendChild(node);
+ }
+ })(document.createTextNode(styles));
+ }
+
+ // Don't update the local store if the file wasn't modified
+ if (lastModified && cache) {
+ log('saving ' + href + ' to cache.');
+ cache.setItem(href, styles);
+ cache.setItem(href + ':timestamp', lastModified);
+ }
+}
+
+function xhr(url, type, callback, errback) {
+ var xhr = getXMLHttpRequest();
+ var async = isFileProtocol ? false : less.async;
+
+ if (typeof(xhr.overrideMimeType) === 'function') {
+ xhr.overrideMimeType('text/css');
+ }
+ xhr.open('GET', url, async);
+ xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
+ xhr.send(null);
+
+ if (isFileProtocol) {
+ if (xhr.status === 0) {
+ callback(xhr.responseText);
+ } else {
+ errback(xhr.status, url);
+ }
+ } else if (async) {
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState == 4) {
+ handleResponse(xhr, callback, errback);
+ }
+ };
+ } else {
+ handleResponse(xhr, callback, errback);
+ }
+
+ function handleResponse(xhr, callback, errback) {
+ if (xhr.status >= 200 && xhr.status < 300) {
+ callback(xhr.responseText,
+ xhr.getResponseHeader("Last-Modified"));
+ } else if (typeof(errback) === 'function') {
+ errback(xhr.status, url);
+ }
+ }
+}
+
+function getXMLHttpRequest() {
+ if (window.XMLHttpRequest) {
+ return new(XMLHttpRequest);
+ } else {
+ try {
+ return new(ActiveXObject)("MSXML2.XMLHTTP.3.0");
+ } catch (e) {
+ log("browser doesn't support AJAX.");
+ return null;
+ }
+ }
+}
+
+function removeNode(node) {
+ return node && node.parentNode.removeChild(node);
+}
+
+function log(str) {
+ if (less.env == 'development' && typeof(console) !== "undefined") { console.log('less: ' + str) }
+}
+
+function error(e, href) {
+ var id = 'less-error-message:' + extractId(href);
+
+ var template = ['',
+ '[-1] {0} ',
+ '[0] {current} ',
+ '[1] {2} ',
+ ' '].join('\n');
+
+ var elem = document.createElement('div'), timer, content;
+
+ elem.id = id;
+ elem.className = "less-error-message";
+
+ content = '' + (e.message || 'There is an error in your .less file') +
+ ' ' + '' + href + " ";
+
+ if (e.extract) {
+ content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':
' +
+ template.replace(/\[(-?\d)\]/g, function (_, i) {
+ return (parseInt(e.line) + parseInt(i)) || '';
+ }).replace(/\{(\d)\}/g, function (_, i) {
+ return e.extract[parseInt(i)] || '';
+ }).replace(/\{current\}/, e.extract[1].slice(0, e.column) + '' +
+ e.extract[1].slice(e.column) + ' ');
+ }
+ elem.innerHTML = content;
+
+ // CSS for error messages
+ createCSS([
+ '.less-error-message ul, .less-error-message li {',
+ 'list-style-type: none;',
+ 'margin-right: 15px;',
+ 'padding: 4px 0;',
+ 'margin: 0;',
+ '}',
+ '.less-error-message label {',
+ 'font-size: 12px;',
+ 'margin-right: 15px;',
+ 'padding: 4px 0;',
+ 'color: #cc7777;',
+ '}',
+ '.less-error-message pre {',
+ 'color: #ee4444;',
+ 'padding: 4px 0;',
+ 'margin: 0;',
+ 'display: inline-block;',
+ '}',
+ '.less-error-message pre.ctx {',
+ 'color: #dd4444;',
+ '}',
+ '.less-error-message h3 {',
+ 'font-size: 20px;',
+ 'font-weight: bold;',
+ 'padding: 15px 0 5px 0;',
+ 'margin: 0;',
+ '}',
+ '.less-error-message a {',
+ 'color: #10a',
+ '}',
+ '.less-error-message .error {',
+ 'color: red;',
+ 'font-weight: bold;',
+ 'padding-bottom: 2px;',
+ 'border-bottom: 1px dashed red;',
+ '}'
+ ].join('\n'), { title: 'error-message' });
+
+ elem.style.cssText = [
+ "font-family: Arial, sans-serif",
+ "border: 1px solid #e00",
+ "background-color: #eee",
+ "border-radius: 5px",
+ "-webkit-border-radius: 5px",
+ "-moz-border-radius: 5px",
+ "color: #e00",
+ "padding: 15px",
+ "margin-bottom: 15px"
+ ].join(';');
+
+ if (less.env == 'development') {
+ timer = setInterval(function () {
+ if (document.body) {
+ if (document.getElementById(id)) {
+ document.body.replaceChild(elem, document.getElementById(id));
+ } else {
+ document.body.insertBefore(elem, document.body.firstChild);
+ }
+ clearInterval(timer);
+ }
+ }, 10);
+ }
+}
+
+})(window);
diff --git a/node_modules/anvil.js/node_modules/less/dist/less-1.1.1.min.js b/node_modules/anvil.js/node_modules/less/dist/less-1.1.1.min.js
new file mode 100644
index 0000000..c204123
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/dist/less-1.1.1.min.js
@@ -0,0 +1,16 @@
+//
+// LESS - Leaner CSS v1.1.1
+// http://lesscss.org
+//
+// Copyright (c) 2009-2011, Alexis Sellier
+// Licensed under the Apache 2.0 License.
+//
+//
+// LESS - Leaner CSS v1.1.1
+// http://lesscss.org
+//
+// Copyright (c) 2009-2011, Alexis Sellier
+// Licensed under the Apache 2.0 License.
+//
+(function(a,b){function v(a,b){var c="less-error-message:"+p(b),e=["",'[-1] {0} ',"[0] {current} ",'[1] {2} '," "].join("\n"),f=document.createElement("div"),g,h;f.id=c,f.className="less-error-message",h=""+(a.message||"There is an error in your .less file")+" "+''+b+" ",a.extract&&(h+="on line "+a.line+", column "+(a.column+1)+":
"+e.replace(/\[(-?\d)\]/g,function(b,c){return parseInt(a.line)+parseInt(c)||""}).replace(/\{(\d)\}/g,function(b,c){return a.extract[parseInt(c)]||""}).replace(/\{current\}/,a.extract[1].slice(0,a.column)+''+a.extract[1].slice(a.column)+" ")),f.innerHTML=h,q([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #ee4444;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.ctx {","color: #dd4444;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}function u(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function t(a){return a&&a.parentNode.removeChild(a)}function s(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){u("browser doesn't support AJAX.");return null}}function r(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var f=s(),h=g?!1:d.async;typeof f.overrideMimeType=="function"&&f.overrideMimeType("text/css"),f.open("GET",a,h),f.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),f.send(null),g?f.status===0?c(f.responseText):e(f.status,a):h?f.onreadystatechange=function(){f.readyState==4&&i(f,c,e)}:i(f,c,e)}function q(a,b,c){var d,e=b.href?b.href.replace(/\?.*$/,""):"",f="less:"+(b.title||p(e));(d=document.getElementById(f))===null&&(d=document.createElement("style"),d.type="text/css",d.media=b.media||"screen",d.id=f,document.getElementsByTagName("head")[0].appendChild(d));if(d.styleSheet)try{d.styleSheet.cssText=a}catch(g){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(a){d.childNodes.length>0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));c&&h&&(u("saving "+e+" to cache."),h.setItem(e,a),h.setItem(e+":timestamp",c))}function p(a){return a.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function o(b,c,e,f){var g=a.location.href.replace(/[#?].*$/,""),i=b.href.replace(/\?.*$/,""),j=h&&h.getItem(i),k=h&&h.getItem(i+":timestamp"),l={css:j,timestamp:k};/^(https?|file):/.test(i)||(i.charAt(0)=="/"?i=a.location.protocol+"//"+a.location.host+i:i=g.slice(0,g.lastIndexOf("/")+1)+i),r(b.href,b.type,function(a,g){if(!e&&l&&g&&(new Date(g)).valueOf()===(new Date(l.timestamp)).valueOf())q(l.css,b),c(null,b,{local:!0,remaining:f});else try{(new d.Parser({optimization:d.optimization,paths:[i.replace(/[\w\.-]+$/,"")],mime:b.type})).parse(a,function(a,d){if(a)return v(a,i);try{c(d,b,{local:!1,lastModified:g,remaining:f}),t(document.getElementById("less-error-message:"+p(i)))}catch(a){v(a,i)}})}catch(h){v(h,i)}},function(a,b){throw new Error("Couldn't load "+b+" ("+a+")")})}function n(a,b){for(var c=0;c>>0;for(var d=0;d>>0,c=Array(b),d=arguments[1];for(var e=0;e>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else for(;;){if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}for(;c=b)return-1;c<0&&(c+=b);for(;ck&&(j[f]=j[f].slice(c-k),k=c)}function q(){j[f]=g,c=h,k=c}function p(){g=j[f],h=c,k=c}var b,c,f,g,h,i,j,k,l,m=this,n=function(){},o=this.imports={paths:a&&a.paths||[],queue:[],files:{},mime:a&&a.mime,push:function(b,c){var e=this;this.queue.push(b),d.Parser.importer(b,this.paths,function(a){e.queue.splice(e.queue.indexOf(b),1),e.files[b]=a,c(a),e.queue.length===0&&n()},a)}};this.env=a=a||{},this.optimization="optimization"in this.env?this.env.optimization:1,this.env.filename=this.env.filename||null;return l={imports:o,parse:function(d,g){var h,l,m,o,p,q,r=[],t,u=null;c=f=k=i=0,j=[],b=d.replace(/\r\n/g,"\n"),j=function(c){var d=0,e=/[^"'`\{\}\/\(\)]+/g,f=/\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,g=0,h,i=c[0],j,k;for(var l=0,m,n;l0)throw{type:"Syntax",message:"Missing closing `}`",filename:a.filename};return c.map(function(a){return a.join("")})}([[]]),h=new e.Ruleset([],s(this.parsers.primary)),h.root=!0,h.toCSS=function(c){var d,f,g;return function(g,h){function n(a){return a?(b.slice(0,a).match(/\n/g)||"").length:null}var i=[];g=g||{},typeof h=="object"&&!Array.isArray(h)&&(h=Object.keys(h).map(function(a){var b=h[a];b instanceof e.Value||(b instanceof e.Expression||(b=new e.Expression([b])),b=new e.Value([b]));return new e.Rule("@"+a,b,!1,0)}),i=[new e.Ruleset(null,h)]);try{var j=c.call(this,{frames:i}).toCSS([],{compress:g.compress||!1})}catch(k){f=b.split("\n"),d=n(k.index);for(var l=k.index,m=-1;l>=0&&b.charAt(l)!=="\n";l--)m++;throw{type:k.type,message:k.message,filename:a.filename,index:k.index,line:typeof d=="number"?d+1:null,callLine:k.call&&n(k.call)+1,callExtract:f[n(k.call)],stack:k.stack,column:m,extract:[f[d-1],f[d],f[d+1]]}}return g.compress?j.replace(/(\s)+/g,"$1"):j}}(h.eval);if(c=0&&b.charAt(v)!=="\n";v--)w++;u={name:"ParseError",message:"Syntax Error on line "+p,index:c,filename:a.filename,line:p,column:w,extract:[q[p-2],q[p-1],q[p]]}}this.imports.queue.length>0?n=function(){g(u,h)}:g(u,h)},parsers:{primary:function(){var a,b=[];while((a=s(this.mixin.definition)||s(this.rule)||s(this.ruleset)||s(this.mixin.call)||s(this.comment)||s(this.directive))||s(/^[\s\n]+/))a&&b.push(a);return b},comment:function(){var a;if(b.charAt(c)==="/"){if(b.charAt(c+1)==="/")return new e.Comment(s(/^\/\/.*/),!0);if(a=s(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/))return new e.Comment(a)}},entities:{quoted:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==='"'||b.charAt(d)==="'"){f&&s("~");if(a=s(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/))return new e.Quoted(a[0],a[1]||a[2],f)}},keyword:function(){var a;if(a=s(/^[A-Za-z-]+/))return new e.Keyword(a)},call:function(){var a,b;if(!!(a=/^([\w-]+|%)\(/.exec(j[f]))){a=a[1].toLowerCase();if(a==="url")return null;c+=a.length;if(a==="alpha")return s(this.alpha);s("("),b=s(this.entities.arguments);if(!s(")"))return;if(a)return new e.Call(a,b)}},arguments:function(){var a=[],b;while(b=s(this.expression)){a.push(b);if(!s(","))break}return a},literal:function(){return s(this.entities.dimension)||s(this.entities.color)||s(this.entities.quoted)},url:function(){var a;if(b.charAt(c)==="u"&&!!s(/^url\(/)){a=s(this.entities.quoted)||s(this.entities.variable)||s(this.entities.dataURI)||s(/^[-\w%@$\/.&=:;#+?~]+/)||"";if(!s(")"))throw new Error("missing closing ) for url()");return new e.URL(a.value||a.data||a instanceof e.Variable?a:new e.Anonymous(a),o.paths)}},dataURI:function(){var a;if(s(/^data:/)){a={},a.mime=s(/^[^\/]+\/[^,;)]+/)||"",a.charset=s(/^;\s*charset=[^,;)]+/)||"",a.base64=s(/^;\s*base64/)||"",a.data=s(/^,\s*[^)]+/);if(a.data)return a}},variable:function(){var a,d=c;if(b.charAt(c)==="@"&&(a=s(/^@@?[\w-]+/)))return new e.Variable(a,d)},color:function(){var a;if(b.charAt(c)==="#"&&(a=s(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/)))return new e.Color(a[1])},dimension:function(){var a,d=b.charCodeAt(c);if(!(d>57||d<45||d===47))if(a=s(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/))return new e.Dimension(a[1],a[2])},javascript:function(){var a,d=c,f;b.charAt(d)==="~"&&(d++,f=!0);if(b.charAt(d)==="`"){f&&s("~");if(a=s(/^`([^`]*)`/))return new e.JavaScript(a[1],c,f)}}},variable:function(){var a;if(b.charAt(c)==="@"&&(a=s(/^(@[\w-]+)\s*:/)))return a[1]},shorthand:function(){var a,b;if(!!t(/^[@\w.%-]+\/[@\w.-]+/)&&(a=s(this.entity))&&s("/")&&(b=s(this.entity)))return new e.Shorthand(a,b)},mixin:{call:function(){var a=[],d,f,g,h=c,i=b.charAt(c);if(i==="."||i==="#"){while(d=s(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/))a.push(new e.Element(f,d)),f=s(">");s("(")&&(g=s(this.entities.arguments))&&s(")");if(a.length>0&&(s(";")||t("}")))return new e.mixin.Call(a,g,h)}},definition:function(){var a,d=[],f,g,h,i;if(!(b.charAt(c)!=="."&&b.charAt(c)!=="#"||t(/^[^{]*(;|})/)))if(f=s(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)){a=f[1];while(h=s(this.entities.variable)||s(this.entities.literal)||s(this.entities.keyword)){if(h instanceof e.Variable)if(s(":"))if(i=s(this.expression))d.push({name:h.name,value:i});else throw new Error("Expected value");else d.push({name:h.name});else d.push({value:h});if(!s(","))break}if(!s(")"))throw new Error("Expected )");g=s(this.block);if(g)return new e.mixin.Definition(a,d,g)}}},entity:function(){return s(this.entities.literal)||s(this.entities.variable)||s(this.entities.url)||s(this.entities.call)||s(this.entities.keyword)||s(this.entities.javascript)||s(this.comment)},end:function(){return s(";")||t("}")},alpha:function(){var a;if(!!s(/^opacity=/i))if(a=s(/^\d+/)||s(this.entities.variable)){if(!s(")"))throw new Error("missing closing ) for alpha()");return new e.Alpha(a)}},element:function(){var a,b,c;c=s(this.combinator),a=s(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)||s("*")||s(this.attribute)||s(/^\([^)@]+\)/);if(a)return new e.Element(c,a)},combinator:function(){var a,d=b.charAt(c);if(d===">"||d==="&"||d==="+"||d==="~"){c++;while(b.charAt(c)===" ")c++;return new e.Combinator(d)}if(d===":"&&b.charAt(c+1)===":"){c+=2;while(b.charAt(c)===" ")c++;return new e.Combinator("::")}return b.charAt(c-1)===" "?new e.Combinator(" "):new e.Combinator(null)},selector:function(){var a,d,f=[],g,h;while(d=s(this.element)){g=b.charAt(c),f.push(d);if(g==="{"||g==="}"||g===";"||g===",")break}if(f.length>0)return new e.Selector(f)},tag:function(){return s(/^[a-zA-Z][a-zA-Z-]*[0-9]?/)||s("*")},attribute:function(){var a="",b,c,d;if(!!s("[")){if(b=s(/^[a-zA-Z-]+/)||s(this.entities.quoted))(d=s(/^[|~*$^]?=/))&&(c=s(this.entities.quoted)||s(/^[\w-]+/))?a=[b,d,c.toCSS?c.toCSS():c].join(""):a=b;if(!s("]"))return;if(a)return"["+a+"]"}},block:function(){var a;if(s("{")&&(a=s(this.primary))&&s("}"))return a},ruleset:function(){var a=[],b,d,g;p();if(g=/^([.#: \w-]+)[\s\n]*\{/.exec(j[f]))c+=g[0].length-1,a=[new e.Selector([new e.Element(null,g[1])])];else while(b=s(this.selector)){a.push(b),s(this.comment);if(!s(","))break;s(this.comment)}if(a.length>0&&(d=s(this.block)))return new e.Ruleset(a,d);i=c,q()},rule:function(){var a,d,g=b.charAt(c),k,l;p();if(g!=="."&&g!=="#"&&g!=="&")if(a=s(this.variable)||s(this.property)){a.charAt(0)!="@"&&(l=/^([^@+\/'"*`(;{}-]*);/.exec(j[f]))?(c+=l[0].length-1,d=new e.Anonymous(l[1])):a==="font"?d=s(this.font):d=s(this.value),k=s(this.important);if(d&&s(this.end))return new e.Rule(a,d,k,h);i=c,q()}},"import":function(){var a;if(s(/^@import\s+/)&&(a=s(this.entities.quoted)||s(this.entities.url))&&s(";"))return new e.Import(a,o)},directive:function(){var a,d,f,g;if(b.charAt(c)==="@"){if(d=s(this["import"]))return d;if(a=s(/^@media|@page|@-[-a-z]+/)){g=(s(/^[^{]+/)||"").trim();if(f=s(this.block))return new e.Directive(a+" "+g,f)}else if(a=s(/^@[-a-z]+/))if(a==="@font-face"){if(f=s(this.block))return new e.Directive(a,f)}else if((d=s(this.entity))&&s(";"))return new e.Directive(a,d)}},font:function(){var a=[],b=[],c,d,f,g;while(g=s(this.shorthand)||s(this.entity))b.push(g);a.push(new e.Expression(b));if(s(","))while(g=s(this.expression)){a.push(g);if(!s(","))break}return new e.Value(a)},value:function(){var a,b=[],c;while(a=s(this.expression)){b.push(a);if(!s(","))break}if(b.length>0)return new e.Value(b)},important:function(){if(b.charAt(c)==="!")return s(/^! *important/)},sub:function(){var a;if(s("(")&&(a=s(this.expression))&&s(")"))return a},multiplication:function(){var a,b,c,d;if(a=s(this.operand)){while((c=s("/")||s("*"))&&(b=s(this.operand)))d=new e.Operation(c,[d||a,b]);return d||a}},addition:function(){var a,d,f,g;if(a=s(this.multiplication)){while((f=s(/^[-+]\s+/)||b.charAt(c-1)!=" "&&(s("+")||s("-")))&&(d=s(this.multiplication)))g=new e.Operation(f,[g||a,d]);return g||a}},operand:function(){var a,d=b.charAt(c+1);b.charAt(c)==="-"&&(d==="@"||d==="(")&&(a=s("-"));var f=s(this.sub)||s(this.entities.dimension)||s(this.entities.color)||s(this.entities.variable)||s(this.entities.call);return a?new e.Operation("*",[new e.Dimension(-1),f]):f},expression:function(){var a,b,c=[],d;while(a=s(this.addition)||s(this.entity))c.push(a);if(c.length>0)return new e.Expression(c)},property:function(){var a;if(a=s(/^(\*?-?[-a-z_0-9]+)\s*:/))return a[1]}}}},typeof a!="undefined"&&(d.Parser.importer=function(a,b,c,d){a.charAt(0)!=="/"&&b.length>0&&(a=b[0]+a),o({href:a,title:a,type:d.mime},c,!0)}),function(a){function d(a){return Math.min(1,Math.max(0,a))}function c(b){if(b instanceof a.Dimension)return parseFloat(b.unit=="%"?b.value/100:b.value);if(typeof b=="number")return b;throw{error:"RuntimeError",message:"color functions take numbers as parameters"}}function b(b){return a.functions.hsla(b.h,b.s,b.l,b.a)}a.functions={rgb:function(a,b,c){return this.rgba(a,b,c,1)},rgba:function(b,d,e,f){var g=[b,d,e].map(function(a){return c(a)}),f=c(f);return new a.Color(g,f)},hsl:function(a,b,c){return this.hsla(a,b,c,1)},hsla:function(a,b,d,e){function h(a){a=a<0?a+1:a>1?a-1:a;return a*6<1?g+(f-g)*a*6:a*2<1?f:a*3<2?g+(f-g)*(2/3-a)*6:g}a=c(a)%360/360,b=c(b),d=c(d),e=c(e);var f=d<=.5?d*(b+1):d+b-d*b,g=d*2-f;return this.rgba(h(a+1/3)*255,h(a)*255,h(a-1/3)*255,e)},hue:function(b){return new a.Dimension(Math.round(b.toHSL().h))},saturation:function(b){return new a.Dimension(Math.round(b.toHSL().s*100),"%")},lightness:function(b){return new a.Dimension(Math.round(b.toHSL().l*100),"%")},alpha:function(b){return new a.Dimension(b.toHSL().a)},saturate:function(a,c){var e=a.toHSL();e.s+=c.value/100,e.s=d(e.s);return b(e)},desaturate:function(a,c){var e=a.toHSL();e.s-=c.value/100,e.s=d(e.s);return b(e)},lighten:function(a,c){var e=a.toHSL();e.l+=c.value/100,e.l=d(e.l);return b(e)},darken:function(a,c){var e=a.toHSL();e.l-=c.value/100,e.l=d(e.l);return b(e)},fadein:function(a,c){var e=a.toHSL();e.a+=c.value/100,e.a=d(e.a);return b(e)},fadeout:function(a,c){var e=a.toHSL();e.a-=c.value/100,e.a=d(e.a);return b(e)},spin:function(a,c){var d=a.toHSL(),e=(d.h+c.value)%360;d.h=e<0?360+e:e;return b(d)},mix:function(b,c,d){var e=d.value/100,f=e*2-1,g=b.toHSL().a-c.toHSL().a,h=((f*g==-1?f:(f+g)/(1+f*g))+1)/2,i=1-h,j=[b.rgb[0]*h+c.rgb[0]*i,b.rgb[1]*h+c.rgb[1]*i,b.rgb[2]*h+c.rgb[2]*i],k=b.alpha*e+c.alpha*(1-e);return new a.Color(j,k)},greyscale:function(b){return this.desaturate(b,new a.Dimension(100))},e:function(b){return new a.Anonymous(b instanceof a.JavaScript?b.evaluated:b)},escape:function(b){return new a.Anonymous(encodeURI(b.value).replace(/=/g,"%3D").replace(/:/g,"%3A").replace(/#/g,"%23").replace(/;/g,"%3B").replace(/\(/g,"%28").replace(/\)/g,"%29"))},"%":function(b){var c=Array.prototype.slice.call(arguments,1),d=b.value;for(var e=0;e255?255:a<0?0:a).toString(16);return a.length===1?"0"+a:a}).join("")},operate:function(b,c){var d=[];c instanceof a.Color||(c=c.toColor());for(var e=0;e<3;e++)d[e]=a.operate(b,this.rgb[e],c.rgb[e]);return new a.Color(d,this.alpha+c.alpha)},toHSL:function(){var a=this.rgb[0]/255,b=this.rgb[1]/255,c=this.rgb[2]/255,d=this.alpha,e=Math.max(a,b,c),f=Math.min(a,b,c),g,h,i=(e+f)/2,j=e-f;if(e===f)g=h=0;else{h=i>.5?j/(2-e-f):j/(e+f);switch(e){case a:g=(b-c)/j+(b":a.compress?">":" > "}[this.value]}}(c("less/tree")),function(a){a.Expression=function(a){this.value=a},a.Expression.prototype={eval:function(b){return this.value.length>1?new a.Expression(this.value.map(function(a){return a.eval(b)})):this.value.length===1?this.value[0].eval(b):this},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(" ")}}}(c("less/tree")),function(a){a.Import=function(b,c){var d=this;this._path=b,b instanceof a.Quoted?this.path=/\.(le?|c)ss$/.test(b.value)?b.value:b.value+".less":this.path=b.value.value||b.value,this.css=/css$/.test(this.path),this.css||c.push(this.path,function(a){if(!a)throw new Error("Error parsing "+d.path);d.root=a})},a.Import.prototype={toCSS:function(){return this.css?"@import "+this._path.toCSS()+";\n":""},eval:function(b){var c;if(this.css)return this;c=new a.Ruleset(null,this.root.rules.slice(0));for(var d=0;d0){for(var f=0;f0&&c>this.params.length)return!1;d=Math.min(c,this.arity);for(var e=0;e1?Array.prototype.push.apply(d,e.find(new a.Selector(b.elements.slice(1)),c)):d.push(e);break}});return this._lookups[g]=d},toCSS:function(b,c){var d=[],e=[],f=[],g=[],h,i;if(!this.root)if(b.length===0)g=this.selectors.map(function(a){return[a]});else for(var j=0;j0&&(h=g.map(function(a){return a.map(function(a){return a.toCSS(c)}).join("").trim()}).join(c.compress?",":g.length>3?",\n":", "),d.push(h,(c.compress?"{":" {\n ")+e.join(c.compress?"":"\n ")+(c.compress?"}":"\n}\n"))),d.push(f);return d.join("")+(c.compress?"\n":"")}}}(c("less/tree")),function(a){a.Selector=function(a){this.elements=a,this.elements[0].combinator.value===""&&(this.elements[0].combinator.value=" ")},a.Selector.prototype.match=function(a){return this.elements[0].value===a.elements[0].value?!0:!1},a.Selector.prototype.toCSS=function(a){if(this._css)return this._css;return this._css=this.elements.map(function(b){return typeof b=="string"?" "+b.trim():b.toCSS(a)}).join("")}}(c("less/tree")),function(b){b.URL=function(b,c){b.data?this.attrs=b:(!/^(?:https?:\/|file:\/|data:\/)?\//.test(b.value)&&c.length>0&&typeof a!="undefined"&&(b.value=c[0]+(b.value.charAt(0)==="/"?b.value.slice(1):b.value)),this.value=b,this.paths=c)},b.URL.prototype={toCSS:function(){return"url("+(this.attrs?"data:"+this.attrs.mime+this.attrs.charset+this.attrs.base64+this.attrs.data:this.value.toCSS())+")"},eval:function(a){return this.attrs?this:new b.URL(this.value.eval(a),this.paths)}}}(c("less/tree")),function(a){a.Value=function(a){this.value=a,this.is="value"},a.Value.prototype={eval:function(b){return this.value.length===1?this.value[0].eval(b):new a.Value(this.value.map(function(a){return a.eval(b)}))},toCSS:function(a){return this.value.map(function(b){return b.toCSS(a)}).join(a.compress?",":", ")}}}(c("less/tree")),function(a){a.Variable=function(a,b){this.name=a,this.index=b},a.Variable.prototype={eval:function(b){var c,d,e=this.name;e.indexOf("@@")==0&&(e="@"+(new a.Variable(e.slice(1))).eval(b).value);if(c=a.find(b.frames,function(a){if(d=a.variable(e))return d.value.eval(b)}))return c;throw{message:"variable "+e+" is undefined",index:this.index}}}}(c("less/tree"
+)),c("less/tree").find=function(a,b){for(var c=0,d;c1?"["+a.value.map(function(a){return a.toCSS(!1)}).join(", ")+"]":a.toCSS(!1)};var g=location.protocol==="file:"||location.protocol==="chrome:"||location.protocol==="chrome-extension:"||location.protocol==="resource:";d.env=d.env||(location.hostname=="127.0.0.1"||location.hostname=="0.0.0.0"||location.hostname=="localhost"||location.port.length>0||g?"development":"production"),d.async=!1,d.poll=d.poll||(g?1e3:1500),d.watch=function(){return this.watchMode=!0},d.unwatch=function(){return this.watchMode=!1},d.env==="development"?(d.optimization=0,/!watch/.test(location.hash)&&d.watch(),d.watchTimer=setInterval(function(){d.watchMode&&n(function(a,b,c){a&&q(a.toCSS(),b,c.lastModified)})},d.poll)):d.optimization=3;var h;try{h=typeof a.localStorage=="undefined"?null:a.localStorage}catch(i){h=null}var j=document.getElementsByTagName("link"),k=/^text\/(x-)?less$/;d.sheets=[];for(var l=0;l>> 0;
+ for (var i = 0; i < len; i++) {
+ if (i in this) {
+ block.call(thisObject, this[i], i, this);
+ }
+ }
+ };
+}
+if (!Array.prototype.map) {
+ Array.prototype.map = function(fun /*, thisp*/) {
+ var len = this.length >>> 0;
+ var res = new Array(len);
+ var thisp = arguments[1];
+
+ for (var i = 0; i < len; i++) {
+ if (i in this) {
+ res[i] = fun.call(thisp, this[i], i, this);
+ }
+ }
+ return res;
+ };
+}
+if (!Array.prototype.filter) {
+ Array.prototype.filter = function (block /*, thisp */) {
+ var values = [];
+ var thisp = arguments[1];
+ for (var i = 0; i < this.length; i++) {
+ if (block.call(thisp, this[i])) {
+ values.push(this[i]);
+ }
+ }
+ return values;
+ };
+}
+if (!Array.prototype.reduce) {
+ Array.prototype.reduce = function(fun /*, initial*/) {
+ var len = this.length >>> 0;
+ var i = 0;
+
+ // no value to return if no initial value and an empty array
+ if (len === 0 && arguments.length === 1) throw new TypeError();
+
+ if (arguments.length >= 2) {
+ var rv = arguments[1];
+ } else {
+ do {
+ if (i in this) {
+ rv = this[i++];
+ break;
+ }
+ // if array contains no values, no initial value to return
+ if (++i >= len) throw new TypeError();
+ } while (true);
+ }
+ for (; i < len; i++) {
+ if (i in this) {
+ rv = fun.call(null, rv, this[i], i, this);
+ }
+ }
+ return rv;
+ };
+}
+if (!Array.prototype.indexOf) {
+ Array.prototype.indexOf = function (value /*, fromIndex */ ) {
+ var length = this.length;
+ var i = arguments[1] || 0;
+
+ if (!length) return -1;
+ if (i >= length) return -1;
+ if (i < 0) i += length;
+
+ for (; i < length; i++) {
+ if (!Object.prototype.hasOwnProperty.call(this, i)) { continue }
+ if (value === this[i]) return i;
+ }
+ return -1;
+ };
+}
+
+//
+// Object
+//
+if (!Object.keys) {
+ Object.keys = function (object) {
+ var keys = [];
+ for (var name in object) {
+ if (Object.prototype.hasOwnProperty.call(object, name)) {
+ keys.push(name);
+ }
+ }
+ return keys;
+ };
+}
+
+//
+// String
+//
+if (!String.prototype.trim) {
+ String.prototype.trim = function () {
+ return String(this).replace(/^\s\s*/, '').replace(/\s\s*$/, '');
+ };
+}
+var less, tree;
+
+if (typeof(window) === 'undefined') {
+ less = exports,
+ tree = require('less/tree');
+} else {
+ if (typeof(window.less) === 'undefined') { window.less = {} }
+ less = window.less,
+ tree = window.less.tree = {};
+}
+//
+// less.js - parser
+//
+// A relatively straight-forward predictive parser.
+// There is no tokenization/lexing stage, the input is parsed
+// in one sweep.
+//
+// To make the parser fast enough to run in the browser, several
+// optimization had to be made:
+//
+// - Matching and slicing on a huge input is often cause of slowdowns.
+// The solution is to chunkify the input into smaller strings.
+// The chunks are stored in the `chunks` var,
+// `j` holds the current chunk index, and `current` holds
+// the index of the current chunk in relation to `input`.
+// This gives us an almost 4x speed-up.
+//
+// - In many cases, we don't need to match individual tokens;
+// for example, if a value doesn't hold any variables, operations
+// or dynamic references, the parser can effectively 'skip' it,
+// treating it as a literal.
+// An example would be '1px solid #000' - which evaluates to itself,
+// we don't need to know what the individual components are.
+// The drawback, of course is that you don't get the benefits of
+// syntax-checking on the CSS. This gives us a 50% speed-up in the parser,
+// and a smaller speed-up in the code-gen.
+//
+//
+// Token matching is done with the `$` function, which either takes
+// a terminal string or regexp, or a non-terminal function to call.
+// It also takes care of moving all the indices forwards.
+//
+//
+less.Parser = function Parser(env) {
+ var input, // LeSS input string
+ i, // current index in `input`
+ j, // current chunk
+ temp, // temporarily holds a chunk's state, for backtracking
+ memo, // temporarily holds `i`, when backtracking
+ furthest, // furthest index the parser has gone to
+ chunks, // chunkified input
+ current, // index of current chunk, in `input`
+ parser;
+
+ var that = this;
+
+ // This function is called after all files
+ // have been imported through `@import`.
+ var finish = function () {};
+
+ var imports = this.imports = {
+ paths: env && env.paths || [], // Search paths, when importing
+ queue: [], // Files which haven't been imported yet
+ files: {}, // Holds the imported parse trees
+ mime: env && env.mime, // MIME type of .less files
+ push: function (path, callback) {
+ var that = this;
+ this.queue.push(path);
+
+ //
+ // Import a file asynchronously
+ //
+ less.Parser.importer(path, this.paths, function (root) {
+ that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue
+ that.files[path] = root; // Store the root
+
+ callback(root);
+
+ if (that.queue.length === 0) { finish() } // Call `finish` if we're done importing
+ }, env);
+ }
+ };
+
+ function save() { temp = chunks[j], memo = i, current = i }
+ function restore() { chunks[j] = temp, i = memo, current = i }
+
+ function sync() {
+ if (i > current) {
+ chunks[j] = chunks[j].slice(i - current);
+ current = i;
+ }
+ }
+ //
+ // Parse from a token, regexp or string, and move forward if match
+ //
+ function $(tok) {
+ var match, args, length, c, index, endIndex, k, mem;
+
+ //
+ // Non-terminal
+ //
+ if (tok instanceof Function) {
+ return tok.call(parser.parsers);
+ //
+ // Terminal
+ //
+ // Either match a single character in the input,
+ // or match a regexp in the current chunk (chunk[j]).
+ //
+ } else if (typeof(tok) === 'string') {
+ match = input.charAt(i) === tok ? tok : null;
+ length = 1;
+ sync ();
+ } else {
+ sync ();
+
+ if (match = tok.exec(chunks[j])) {
+ length = match[0].length;
+ } else {
+ return null;
+ }
+ }
+
+ // The match is confirmed, add the match length to `i`,
+ // and consume any extra white-space characters (' ' || '\n')
+ // which come after that. The reason for this is that LeSS's
+ // grammar is mostly white-space insensitive.
+ //
+ if (match) {
+ mem = i += length;
+ endIndex = i + chunks[j].length - length;
+
+ while (i < endIndex) {
+ c = input.charCodeAt(i);
+ if (! (c === 32 || c === 10 || c === 9)) { break }
+ i++;
+ }
+ chunks[j] = chunks[j].slice(length + (i - mem));
+ current = i;
+
+ if (chunks[j].length === 0 && j < chunks.length - 1) { j++ }
+
+ if(typeof(match) === 'string') {
+ return match;
+ } else {
+ return match.length === 1 ? match[0] : match;
+ }
+ }
+ }
+
+ // Same as $(), but don't change the state of the parser,
+ // just return the match.
+ function peek(tok) {
+ if (typeof(tok) === 'string') {
+ return input.charAt(i) === tok;
+ } else {
+ if (tok.test(chunks[j])) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+ }
+
+ this.env = env = env || {};
+
+ // The optimization level dictates the thoroughness of the parser,
+ // the lower the number, the less nodes it will create in the tree.
+ // This could matter for debugging, or if you want to access
+ // the individual nodes in the tree.
+ this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
+
+ this.env.filename = this.env.filename || null;
+
+ //
+ // The Parser
+ //
+ return parser = {
+
+ imports: imports,
+ //
+ // Parse an input string into an abstract syntax tree,
+ // call `callback` when done.
+ //
+ parse: function (str, callback) {
+ var root, start, end, zone, line, lines, buff = [], c, error = null;
+
+ i = j = current = furthest = 0;
+ chunks = [];
+ input = str.replace(/\r\n/g, '\n');
+
+ // Split the input into chunks.
+ chunks = (function (chunks) {
+ var j = 0,
+ skip = /[^"'`\{\}\/\(\)]+/g,
+ comment = /\/\*(?:[^*]|\*+[^\/*])*\*+\/|\/\/.*/g,
+ level = 0,
+ match,
+ chunk = chunks[0],
+ inParam,
+ inString;
+
+ for (var i = 0, c, cc; i < input.length; i++) {
+ skip.lastIndex = i;
+ if (match = skip.exec(input)) {
+ if (match.index === i) {
+ i += match[0].length;
+ chunk.push(match[0]);
+ }
+ }
+ c = input.charAt(i);
+ comment.lastIndex = i;
+
+ if (!inString && !inParam && c === '/') {
+ cc = input.charAt(i + 1);
+ if (cc === '/' || cc === '*') {
+ if (match = comment.exec(input)) {
+ if (match.index === i) {
+ i += match[0].length;
+ chunk.push(match[0]);
+ c = input.charAt(i);
+ }
+ }
+ }
+ }
+
+ if (c === '{' && !inString && !inParam) { level ++;
+ chunk.push(c);
+ } else if (c === '}' && !inString && !inParam) { level --;
+ chunk.push(c);
+ chunks[++j] = chunk = [];
+ } else if (c === '(' && !inString && !inParam) {
+ chunk.push(c);
+ inParam = true;
+ } else if (c === ')' && !inString && inParam) {
+ chunk.push(c);
+ inParam = false;
+ } else {
+ if (c === '"' || c === "'" || c === '`') {
+ if (! inString) {
+ inString = c;
+ } else {
+ inString = inString === c ? false : inString;
+ }
+ }
+ chunk.push(c);
+ }
+ }
+ if (level > 0) {
+ throw {
+ type: 'Syntax',
+ message: "Missing closing `}`",
+ filename: env.filename
+ };
+ }
+
+ return chunks.map(function (c) { return c.join('') });;
+ })([[]]);
+
+ // Start with the primary rule.
+ // The whole syntax tree is held under a Ruleset node,
+ // with the `root` property set to true, so no `{}` are
+ // output. The callback is called when the input is parsed.
+ root = new(tree.Ruleset)([], $(this.parsers.primary));
+ root.root = true;
+
+ root.toCSS = (function (evaluate) {
+ var line, lines, column;
+
+ return function (options, variables) {
+ var frames = [];
+
+ options = options || {};
+ //
+ // Allows setting variables with a hash, so:
+ //
+ // `{ color: new(tree.Color)('#f01') }` will become:
+ //
+ // new(tree.Rule)('@color',
+ // new(tree.Value)([
+ // new(tree.Expression)([
+ // new(tree.Color)('#f01')
+ // ])
+ // ])
+ // )
+ //
+ if (typeof(variables) === 'object' && !Array.isArray(variables)) {
+ variables = Object.keys(variables).map(function (k) {
+ var value = variables[k];
+
+ if (! (value instanceof tree.Value)) {
+ if (! (value instanceof tree.Expression)) {
+ value = new(tree.Expression)([value]);
+ }
+ value = new(tree.Value)([value]);
+ }
+ return new(tree.Rule)('@' + k, value, false, 0);
+ });
+ frames = [new(tree.Ruleset)(null, variables)];
+ }
+
+ try {
+ var css = evaluate.call(this, { frames: frames })
+ .toCSS([], { compress: options.compress || false });
+ } catch (e) {
+ lines = input.split('\n');
+ line = getLine(e.index);
+
+ for (var n = e.index, column = -1;
+ n >= 0 && input.charAt(n) !== '\n';
+ n--) { column++ }
+
+ throw {
+ type: e.type,
+ message: e.message,
+ filename: env.filename,
+ index: e.index,
+ line: typeof(line) === 'number' ? line + 1 : null,
+ callLine: e.call && (getLine(e.call) + 1),
+ callExtract: lines[getLine(e.call)],
+ stack: e.stack,
+ column: column,
+ extract: [
+ lines[line - 1],
+ lines[line],
+ lines[line + 1]
+ ]
+ };
+ }
+ if (options.compress) {
+ return css.replace(/(\s)+/g, "$1");
+ } else {
+ return css;
+ }
+
+ function getLine(index) {
+ return index ? (input.slice(0, index).match(/\n/g) || "").length : null;
+ }
+ };
+ })(root.eval);
+
+ // If `i` is smaller than the `input.length - 1`,
+ // it means the parser wasn't able to parse the whole
+ // string, so we've got a parsing error.
+ //
+ // We try to extract a \n delimited string,
+ // showing the line where the parse error occured.
+ // We split it up into two parts (the part which parsed,
+ // and the part which didn't), so we can color them differently.
+ if (i < input.length - 1) {
+ i = furthest;
+ lines = input.split('\n');
+ line = (input.slice(0, i).match(/\n/g) || "").length + 1;
+
+ for (var n = i, column = -1; n >= 0 && input.charAt(n) !== '\n'; n--) { column++ }
+
+ error = {
+ name: "ParseError",
+ message: "Syntax Error on line " + line,
+ index: i,
+ filename: env.filename,
+ line: line,
+ column: column,
+ extract: [
+ lines[line - 2],
+ lines[line - 1],
+ lines[line]
+ ]
+ };
+ }
+
+ if (this.imports.queue.length > 0) {
+ finish = function () { callback(error, root) };
+ } else {
+ callback(error, root);
+ }
+ },
+
+ //
+ // Here in, the parsing rules/functions
+ //
+ // The basic structure of the syntax tree generated is as follows:
+ //
+ // Ruleset -> Rule -> Value -> Expression -> Entity
+ //
+ // Here's some LESS code:
+ //
+ // .class {
+ // color: #fff;
+ // border: 1px solid #000;
+ // width: @w + 4px;
+ // > .child {...}
+ // }
+ //
+ // And here's what the parse tree might look like:
+ //
+ // Ruleset (Selector '.class', [
+ // Rule ("color", Value ([Expression [Color #fff]]))
+ // Rule ("border", Value ([Expression [Dimension 1px][Keyword "solid"][Color #000]]))
+ // Rule ("width", Value ([Expression [Operation "+" [Variable "@w"][Dimension 4px]]]))
+ // Ruleset (Selector [Element '>', '.child'], [...])
+ // ])
+ //
+ // In general, most rules will try to parse a token with the `$()` function, and if the return
+ // value is truly, will return a new node, of the relevant type. Sometimes, we need to check
+ // first, before parsing, that's when we use `peek()`.
+ //
+ parsers: {
+ //
+ // The `primary` rule is the *entry* and *exit* point of the parser.
+ // The rules here can appear at any level of the parse tree.
+ //
+ // The recursive nature of the grammar is an interplay between the `block`
+ // rule, which represents `{ ... }`, the `ruleset` rule, and this `primary` rule,
+ // as represented by this simplified grammar:
+ //
+ // primary → (ruleset | rule)+
+ // ruleset → selector+ block
+ // block → '{' primary '}'
+ //
+ // Only at one point is the primary rule not called from the
+ // block rule: at the root level.
+ //
+ primary: function () {
+ var node, root = [];
+
+ while ((node = $(this.mixin.definition) || $(this.rule) || $(this.ruleset) ||
+ $(this.mixin.call) || $(this.comment) || $(this.directive))
+ || $(/^[\s\n]+/)) {
+ node && root.push(node);
+ }
+ return root;
+ },
+
+ // We create a Comment node for CSS comments `/* */`,
+ // but keep the LeSS comments `//` silent, by just skipping
+ // over them.
+ comment: function () {
+ var comment;
+
+ if (input.charAt(i) !== '/') return;
+
+ if (input.charAt(i + 1) === '/') {
+ return new(tree.Comment)($(/^\/\/.*/), true);
+ } else if (comment = $(/^\/\*(?:[^*]|\*+[^\/*])*\*+\/\n?/)) {
+ return new(tree.Comment)(comment);
+ }
+ },
+
+ //
+ // Entities are tokens which can be found inside an Expression
+ //
+ entities: {
+ //
+ // A string, which supports escaping " and '
+ //
+ // "milky way" 'he\'s the one!'
+ //
+ quoted: function () {
+ var str, j = i, e;
+
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
+ if (input.charAt(j) !== '"' && input.charAt(j) !== "'") return;
+
+ e && $('~');
+
+ if (str = $(/^"((?:[^"\\\r\n]|\\.)*)"|'((?:[^'\\\r\n]|\\.)*)'/)) {
+ return new(tree.Quoted)(str[0], str[1] || str[2], e);
+ }
+ },
+
+ //
+ // A catch-all word, such as:
+ //
+ // black border-collapse
+ //
+ keyword: function () {
+ var k;
+ if (k = $(/^[A-Za-z-]+/)) { return new(tree.Keyword)(k) }
+ },
+
+ //
+ // A function call
+ //
+ // rgb(255, 0, 255)
+ //
+ // We also try to catch IE's `alpha()`, but let the `alpha` parser
+ // deal with the details.
+ //
+ // The arguments are parsed with the `entities.arguments` parser.
+ //
+ call: function () {
+ var name, args;
+
+ if (! (name = /^([\w-]+|%)\(/.exec(chunks[j]))) return;
+
+ name = name[1].toLowerCase();
+
+ if (name === 'url') { return null }
+ else { i += name.length }
+
+ if (name === 'alpha') { return $(this.alpha) }
+
+ $('('); // Parse the '(' and consume whitespace.
+
+ args = $(this.entities.arguments);
+
+ if (! $(')')) return;
+
+ if (name) { return new(tree.Call)(name, args) }
+ },
+ arguments: function () {
+ var args = [], arg;
+
+ while (arg = $(this.expression)) {
+ args.push(arg);
+ if (! $(',')) { break }
+ }
+ return args;
+ },
+ literal: function () {
+ return $(this.entities.dimension) ||
+ $(this.entities.color) ||
+ $(this.entities.quoted);
+ },
+
+ //
+ // Parse url() tokens
+ //
+ // We use a specific rule for urls, because they don't really behave like
+ // standard function calls. The difference is that the argument doesn't have
+ // to be enclosed within a string, so it can't be parsed as an Expression.
+ //
+ url: function () {
+ var value;
+
+ if (input.charAt(i) !== 'u' || !$(/^url\(/)) return;
+ value = $(this.entities.quoted) || $(this.entities.variable) ||
+ $(this.entities.dataURI) || $(/^[-\w%@$\/.&=:;#+?~]+/) || "";
+ if (! $(')')) throw new(Error)("missing closing ) for url()");
+
+ return new(tree.URL)((value.value || value.data || value instanceof tree.Variable)
+ ? value : new(tree.Anonymous)(value), imports.paths);
+ },
+
+ dataURI: function () {
+ var obj;
+
+ if ($(/^data:/)) {
+ obj = {};
+ obj.mime = $(/^[^\/]+\/[^,;)]+/) || '';
+ obj.charset = $(/^;\s*charset=[^,;)]+/) || '';
+ obj.base64 = $(/^;\s*base64/) || '';
+ obj.data = $(/^,\s*[^)]+/);
+
+ if (obj.data) { return obj }
+ }
+ },
+
+ //
+ // A Variable entity, such as `@fink`, in
+ //
+ // width: @fink + 2px
+ //
+ // We use a different parser for variable definitions,
+ // see `parsers.variable`.
+ //
+ variable: function () {
+ var name, index = i;
+
+ if (input.charAt(i) === '@' && (name = $(/^@@?[\w-]+/))) {
+ return new(tree.Variable)(name, index);
+ }
+ },
+
+ //
+ // A Hexadecimal color
+ //
+ // #4F3C2F
+ //
+ // `rgb` and `hsl` colors are parsed through the `entities.call` parser.
+ //
+ color: function () {
+ var rgb;
+
+ if (input.charAt(i) === '#' && (rgb = $(/^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})/))) {
+ return new(tree.Color)(rgb[1]);
+ }
+ },
+
+ //
+ // A Dimension, that is, a number and a unit
+ //
+ // 0.5em 95%
+ //
+ dimension: function () {
+ var value, c = input.charCodeAt(i);
+ if ((c > 57 || c < 45) || c === 47) return;
+
+ if (value = $(/^(-?\d*\.?\d+)(px|%|em|pc|ex|in|deg|s|ms|pt|cm|mm|rad|grad|turn)?/)) {
+ return new(tree.Dimension)(value[1], value[2]);
+ }
+ },
+
+ //
+ // JavaScript code to be evaluated
+ //
+ // `window.location.href`
+ //
+ javascript: function () {
+ var str, j = i, e;
+
+ if (input.charAt(j) === '~') { j++, e = true } // Escaped strings
+ if (input.charAt(j) !== '`') { return }
+
+ e && $('~');
+
+ if (str = $(/^`([^`]*)`/)) {
+ return new(tree.JavaScript)(str[1], i, e);
+ }
+ }
+ },
+
+ //
+ // The variable part of a variable definition. Used in the `rule` parser
+ //
+ // @fink:
+ //
+ variable: function () {
+ var name;
+
+ if (input.charAt(i) === '@' && (name = $(/^(@[\w-]+)\s*:/))) { return name[1] }
+ },
+
+ //
+ // A font size/line-height shorthand
+ //
+ // small/12px
+ //
+ // We need to peek first, or we'll match on keywords and dimensions
+ //
+ shorthand: function () {
+ var a, b;
+
+ if (! peek(/^[@\w.%-]+\/[@\w.-]+/)) return;
+
+ if ((a = $(this.entity)) && $('/') && (b = $(this.entity))) {
+ return new(tree.Shorthand)(a, b);
+ }
+ },
+
+ //
+ // Mixins
+ //
+ mixin: {
+ //
+ // A Mixin call, with an optional argument list
+ //
+ // #mixins > .square(#fff);
+ // .rounded(4px, black);
+ // .button;
+ //
+ // The `while` loop is there because mixins can be
+ // namespaced, but we only support the child and descendant
+ // selector for now.
+ //
+ call: function () {
+ var elements = [], e, c, args, index = i, s = input.charAt(i);
+
+ if (s !== '.' && s !== '#') { return }
+
+ while (e = $(/^[#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/)) {
+ elements.push(new(tree.Element)(c, e));
+ c = $('>');
+ }
+ $('(') && (args = $(this.entities.arguments)) && $(')');
+
+ if (elements.length > 0 && ($(';') || peek('}'))) {
+ return new(tree.mixin.Call)(elements, args, index);
+ }
+ },
+
+ //
+ // A Mixin definition, with a list of parameters
+ //
+ // .rounded (@radius: 2px, @color) {
+ // ...
+ // }
+ //
+ // Until we have a finer grained state-machine, we have to
+ // do a look-ahead, to make sure we don't have a mixin call.
+ // See the `rule` function for more information.
+ //
+ // We start by matching `.rounded (`, and then proceed on to
+ // the argument list, which has optional default values.
+ // We store the parameters in `params`, with a `value` key,
+ // if there is a value, such as in the case of `@radius`.
+ //
+ // Once we've got our params list, and a closing `)`, we parse
+ // the `{...}` block.
+ //
+ definition: function () {
+ var name, params = [], match, ruleset, param, value;
+
+ if ((input.charAt(i) !== '.' && input.charAt(i) !== '#') ||
+ peek(/^[^{]*(;|})/)) return;
+
+ if (match = $(/^([#.](?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+)\s*\(/)) {
+ name = match[1];
+
+ while (param = $(this.entities.variable) || $(this.entities.literal)
+ || $(this.entities.keyword)) {
+ // Variable
+ if (param instanceof tree.Variable) {
+ if ($(':')) {
+ if (value = $(this.expression)) {
+ params.push({ name: param.name, value: value });
+ } else {
+ throw new(Error)("Expected value");
+ }
+ } else {
+ params.push({ name: param.name });
+ }
+ } else {
+ params.push({ value: param });
+ }
+ if (! $(',')) { break }
+ }
+ if (! $(')')) throw new(Error)("Expected )");
+
+ ruleset = $(this.block);
+
+ if (ruleset) {
+ return new(tree.mixin.Definition)(name, params, ruleset);
+ }
+ }
+ }
+ },
+
+ //
+ // Entities are the smallest recognized token,
+ // and can be found inside a rule's value.
+ //
+ entity: function () {
+ return $(this.entities.literal) || $(this.entities.variable) || $(this.entities.url) ||
+ $(this.entities.call) || $(this.entities.keyword) || $(this.entities.javascript) ||
+ $(this.comment);
+ },
+
+ //
+ // A Rule terminator. Note that we use `peek()` to check for '}',
+ // because the `block` rule will be expecting it, but we still need to make sure
+ // it's there, if ';' was ommitted.
+ //
+ end: function () {
+ return $(';') || peek('}');
+ },
+
+ //
+ // IE's alpha function
+ //
+ // alpha(opacity=88)
+ //
+ alpha: function () {
+ var value;
+
+ if (! $(/^opacity=/i)) return;
+ if (value = $(/^\d+/) || $(this.entities.variable)) {
+ if (! $(')')) throw new(Error)("missing closing ) for alpha()");
+ return new(tree.Alpha)(value);
+ }
+ },
+
+ //
+ // A Selector Element
+ //
+ // div
+ // + h1
+ // #socks
+ // input[type="text"]
+ //
+ // Elements are the building blocks for Selectors,
+ // they are made out of a `Combinator` (see combinator rule),
+ // and an element name, such as a tag a class, or `*`.
+ //
+ element: function () {
+ var e, t, c;
+
+ c = $(this.combinator);
+ e = $(/^(?:[.#]?|:*)(?:[\w-]|\\(?:[a-fA-F0-9]{1,6} ?|[^a-fA-F0-9]))+/) || $('*') || $(this.attribute) || $(/^\([^)@]+\)/);
+
+ if (e) { return new(tree.Element)(c, e) }
+ },
+
+ //
+ // Combinators combine elements together, in a Selector.
+ //
+ // Because our parser isn't white-space sensitive, special care
+ // has to be taken, when parsing the descendant combinator, ` `,
+ // as it's an empty space. We have to check the previous character
+ // in the input, to see if it's a ` ` character. More info on how
+ // we deal with this in *combinator.js*.
+ //
+ combinator: function () {
+ var match, c = input.charAt(i);
+
+ if (c === '>' || c === '&' || c === '+' || c === '~') {
+ i++;
+ while (input.charAt(i) === ' ') { i++ }
+ return new(tree.Combinator)(c);
+ } else if (c === ':' && input.charAt(i + 1) === ':') {
+ i += 2;
+ while (input.charAt(i) === ' ') { i++ }
+ return new(tree.Combinator)('::');
+ } else if (input.charAt(i - 1) === ' ') {
+ return new(tree.Combinator)(" ");
+ } else {
+ return new(tree.Combinator)(null);
+ }
+ },
+
+ //
+ // A CSS Selector
+ //
+ // .class > div + h1
+ // li a:hover
+ //
+ // Selectors are made out of one or more Elements, see above.
+ //
+ selector: function () {
+ var sel, e, elements = [], c, match;
+
+ while (e = $(this.element)) {
+ c = input.charAt(i);
+ elements.push(e)
+ if (c === '{' || c === '}' || c === ';' || c === ',') { break }
+ }
+
+ if (elements.length > 0) { return new(tree.Selector)(elements) }
+ },
+ tag: function () {
+ return $(/^[a-zA-Z][a-zA-Z-]*[0-9]?/) || $('*');
+ },
+ attribute: function () {
+ var attr = '', key, val, op;
+
+ if (! $('[')) return;
+
+ if (key = $(/^[a-zA-Z-]+/) || $(this.entities.quoted)) {
+ if ((op = $(/^[|~*$^]?=/)) &&
+ (val = $(this.entities.quoted) || $(/^[\w-]+/))) {
+ attr = [key, op, val.toCSS ? val.toCSS() : val].join('');
+ } else { attr = key }
+ }
+
+ if (! $(']')) return;
+
+ if (attr) { return "[" + attr + "]" }
+ },
+
+ //
+ // The `block` rule is used by `ruleset` and `mixin.definition`.
+ // It's a wrapper around the `primary` rule, with added `{}`.
+ //
+ block: function () {
+ var content;
+
+ if ($('{') && (content = $(this.primary)) && $('}')) {
+ return content;
+ }
+ },
+
+ //
+ // div, .class, body > p {...}
+ //
+ ruleset: function () {
+ var selectors = [], s, rules, match;
+ save();
+
+ if (match = /^([.#: \w-]+)[\s\n]*\{/.exec(chunks[j])) {
+ i += match[0].length - 1;
+ selectors = [new(tree.Selector)([new(tree.Element)(null, match[1])])];
+ } else {
+ while (s = $(this.selector)) {
+ selectors.push(s);
+ $(this.comment);
+ if (! $(',')) { break }
+ $(this.comment);
+ }
+ }
+
+ if (selectors.length > 0 && (rules = $(this.block))) {
+ return new(tree.Ruleset)(selectors, rules);
+ } else {
+ // Backtrack
+ furthest = i;
+ restore();
+ }
+ },
+ rule: function () {
+ var name, value, c = input.charAt(i), important, match;
+ save();
+
+ if (c === '.' || c === '#' || c === '&') { return }
+
+ if (name = $(this.variable) || $(this.property)) {
+ if ((name.charAt(0) != '@') && (match = /^([^@+\/'"*`(;{}-]*);/.exec(chunks[j]))) {
+ i += match[0].length - 1;
+ value = new(tree.Anonymous)(match[1]);
+ } else if (name === "font") {
+ value = $(this.font);
+ } else {
+ value = $(this.value);
+ }
+ important = $(this.important);
+
+ if (value && $(this.end)) {
+ return new(tree.Rule)(name, value, important, memo);
+ } else {
+ furthest = i;
+ restore();
+ }
+ }
+ },
+
+ //
+ // An @import directive
+ //
+ // @import "lib";
+ //
+ // Depending on our environemnt, importing is done differently:
+ // In the browser, it's an XHR request, in Node, it would be a
+ // file-system operation. The function used for importing is
+ // stored in `import`, which we pass to the Import constructor.
+ //
+ "import": function () {
+ var path;
+ if ($(/^@import\s+/) &&
+ (path = $(this.entities.quoted) || $(this.entities.url)) &&
+ $(';')) {
+ return new(tree.Import)(path, imports);
+ }
+ },
+
+ //
+ // A CSS Directive
+ //
+ // @charset "utf-8";
+ //
+ directive: function () {
+ var name, value, rules, types;
+
+ if (input.charAt(i) !== '@') return;
+
+ if (value = $(this['import'])) {
+ return value;
+ } else if (name = $(/^@media|@page|@-[-a-z]+/)) {
+ types = ($(/^[^{]+/) || '').trim();
+ if (rules = $(this.block)) {
+ return new(tree.Directive)(name + " " + types, rules);
+ }
+ } else if (name = $(/^@[-a-z]+/)) {
+ if (name === '@font-face') {
+ if (rules = $(this.block)) {
+ return new(tree.Directive)(name, rules);
+ }
+ } else if ((value = $(this.entity)) && $(';')) {
+ return new(tree.Directive)(name, value);
+ }
+ }
+ },
+ font: function () {
+ var value = [], expression = [], weight, shorthand, font, e;
+
+ while (e = $(this.shorthand) || $(this.entity)) {
+ expression.push(e);
+ }
+ value.push(new(tree.Expression)(expression));
+
+ if ($(',')) {
+ while (e = $(this.expression)) {
+ value.push(e);
+ if (! $(',')) { break }
+ }
+ }
+ return new(tree.Value)(value);
+ },
+
+ //
+ // A Value is a comma-delimited list of Expressions
+ //
+ // font-family: Baskerville, Georgia, serif;
+ //
+ // In a Rule, a Value represents everything after the `:`,
+ // and before the `;`.
+ //
+ value: function () {
+ var e, expressions = [], important;
+
+ while (e = $(this.expression)) {
+ expressions.push(e);
+ if (! $(',')) { break }
+ }
+
+ if (expressions.length > 0) {
+ return new(tree.Value)(expressions);
+ }
+ },
+ important: function () {
+ if (input.charAt(i) === '!') {
+ return $(/^! *important/);
+ }
+ },
+ sub: function () {
+ var e;
+
+ if ($('(') && (e = $(this.expression)) && $(')')) {
+ return e;
+ }
+ },
+ multiplication: function () {
+ var m, a, op, operation;
+ if (m = $(this.operand)) {
+ while ((op = ($('/') || $('*'))) && (a = $(this.operand))) {
+ operation = new(tree.Operation)(op, [operation || m, a]);
+ }
+ return operation || m;
+ }
+ },
+ addition: function () {
+ var m, a, op, operation;
+ if (m = $(this.multiplication)) {
+ while ((op = $(/^[-+]\s+/) || (input.charAt(i - 1) != ' ' && ($('+') || $('-')))) &&
+ (a = $(this.multiplication))) {
+ operation = new(tree.Operation)(op, [operation || m, a]);
+ }
+ return operation || m;
+ }
+ },
+
+ //
+ // An operand is anything that can be part of an operation,
+ // such as a Color, or a Variable
+ //
+ operand: function () {
+ var negate, p = input.charAt(i + 1);
+
+ if (input.charAt(i) === '-' && (p === '@' || p === '(')) { negate = $('-') }
+ var o = $(this.sub) || $(this.entities.dimension) ||
+ $(this.entities.color) || $(this.entities.variable) ||
+ $(this.entities.call);
+ return negate ? new(tree.Operation)('*', [new(tree.Dimension)(-1), o])
+ : o;
+ },
+
+ //
+ // Expressions either represent mathematical operations,
+ // or white-space delimited Entities.
+ //
+ // 1px solid black
+ // @var * 2
+ //
+ expression: function () {
+ var e, delim, entities = [], d;
+
+ while (e = $(this.addition) || $(this.entity)) {
+ entities.push(e);
+ }
+ if (entities.length > 0) {
+ return new(tree.Expression)(entities);
+ }
+ },
+ property: function () {
+ var name;
+
+ if (name = $(/^(\*?-?[-a-z_0-9]+)\s*:/)) {
+ return name[1];
+ }
+ }
+ }
+ };
+};
+
+if (typeof(window) !== 'undefined') {
+ //
+ // Used by `@import` directives
+ //
+ less.Parser.importer = function (path, paths, callback, env) {
+ if (path.charAt(0) !== '/' && paths.length > 0) {
+ path = paths[0] + path;
+ }
+ // We pass `true` as 3rd argument, to force the reload of the import.
+ // This is so we can get the syntax tree as opposed to just the CSS output,
+ // as we need this to evaluate the current stylesheet.
+ loadStyleSheet({ href: path, title: path, type: env.mime }, callback, true);
+ };
+}
+
+(function (tree) {
+
+tree.functions = {
+ rgb: function (r, g, b) {
+ return this.rgba(r, g, b, 1.0);
+ },
+ rgba: function (r, g, b, a) {
+ var rgb = [r, g, b].map(function (c) { return number(c) }),
+ a = number(a);
+ return new(tree.Color)(rgb, a);
+ },
+ hsl: function (h, s, l) {
+ return this.hsla(h, s, l, 1.0);
+ },
+ hsla: function (h, s, l, a) {
+ h = (number(h) % 360) / 360;
+ s = number(s); l = number(l); a = number(a);
+
+ var m2 = l <= 0.5 ? l * (s + 1) : l + s - l * s;
+ var m1 = l * 2 - m2;
+
+ return this.rgba(hue(h + 1/3) * 255,
+ hue(h) * 255,
+ hue(h - 1/3) * 255,
+ a);
+
+ function hue(h) {
+ h = h < 0 ? h + 1 : (h > 1 ? h - 1 : h);
+ if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
+ else if (h * 2 < 1) return m2;
+ else if (h * 3 < 2) return m1 + (m2 - m1) * (2/3 - h) * 6;
+ else return m1;
+ }
+ },
+ hue: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().h));
+ },
+ saturation: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().s * 100), '%');
+ },
+ lightness: function (color) {
+ return new(tree.Dimension)(Math.round(color.toHSL().l * 100), '%');
+ },
+ alpha: function (color) {
+ return new(tree.Dimension)(color.toHSL().a);
+ },
+ saturate: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.s += amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ desaturate: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.s -= amount.value / 100;
+ hsl.s = clamp(hsl.s);
+ return hsla(hsl);
+ },
+ lighten: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l += amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ darken: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.l -= amount.value / 100;
+ hsl.l = clamp(hsl.l);
+ return hsla(hsl);
+ },
+ fadein: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a += amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ fadeout: function (color, amount) {
+ var hsl = color.toHSL();
+
+ hsl.a -= amount.value / 100;
+ hsl.a = clamp(hsl.a);
+ return hsla(hsl);
+ },
+ spin: function (color, amount) {
+ var hsl = color.toHSL();
+ var hue = (hsl.h + amount.value) % 360;
+
+ hsl.h = hue < 0 ? 360 + hue : hue;
+
+ return hsla(hsl);
+ },
+ //
+ // Copyright (c) 2006-2009 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein
+ // http://sass-lang.com
+ //
+ mix: function (color1, color2, weight) {
+ var p = weight.value / 100.0;
+ var w = p * 2 - 1;
+ var a = color1.toHSL().a - color2.toHSL().a;
+
+ var w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;
+ var w2 = 1 - w1;
+
+ var rgb = [color1.rgb[0] * w1 + color2.rgb[0] * w2,
+ color1.rgb[1] * w1 + color2.rgb[1] * w2,
+ color1.rgb[2] * w1 + color2.rgb[2] * w2];
+
+ var alpha = color1.alpha * p + color2.alpha * (1 - p);
+
+ return new(tree.Color)(rgb, alpha);
+ },
+ greyscale: function (color) {
+ return this.desaturate(color, new(tree.Dimension)(100));
+ },
+ e: function (str) {
+ return new(tree.Anonymous)(str instanceof tree.JavaScript ? str.evaluated : str);
+ },
+ escape: function (str) {
+ return new(tree.Anonymous)(encodeURI(str.value).replace(/=/g, "%3D").replace(/:/g, "%3A").replace(/#/g, "%23").replace(/;/g, "%3B").replace(/\(/g, "%28").replace(/\)/g, "%29"));
+ },
+ '%': function (quoted /* arg, arg, ...*/) {
+ var args = Array.prototype.slice.call(arguments, 1),
+ str = quoted.value;
+
+ for (var i = 0; i < args.length; i++) {
+ str = str.replace(/%[sda]/i, function(token) {
+ var value = token.match(/s/i) ? args[i].value : args[i].toCSS();
+ return token.match(/[A-Z]$/) ? encodeURIComponent(value) : value;
+ });
+ }
+ str = str.replace(/%%/g, '%');
+ return new(tree.Quoted)('"' + str + '"', str);
+ },
+ round: function (n) {
+ if (n instanceof tree.Dimension) {
+ return new(tree.Dimension)(Math.round(number(n)), n.unit);
+ } else if (typeof(n) === 'number') {
+ return Math.round(n);
+ } else {
+ throw {
+ error: "RuntimeError",
+ message: "math functions take numbers as parameters"
+ };
+ }
+ }
+};
+
+function hsla(hsla) {
+ return tree.functions.hsla(hsla.h, hsla.s, hsla.l, hsla.a);
+}
+
+function number(n) {
+ if (n instanceof tree.Dimension) {
+ return parseFloat(n.unit == '%' ? n.value / 100 : n.value);
+ } else if (typeof(n) === 'number') {
+ return n;
+ } else {
+ throw {
+ error: "RuntimeError",
+ message: "color functions take numbers as parameters"
+ };
+ }
+}
+
+function clamp(val) {
+ return Math.min(1, Math.max(0, val));
+}
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Alpha = function (val) {
+ this.value = val;
+};
+tree.Alpha.prototype = {
+ toCSS: function () {
+ return "alpha(opacity=" +
+ (this.value.toCSS ? this.value.toCSS() : this.value) + ")";
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Anonymous = function (string) {
+ this.value = string.value || string;
+};
+tree.Anonymous.prototype = {
+ toCSS: function () {
+ return this.value;
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+//
+// A function call node.
+//
+tree.Call = function (name, args) {
+ this.name = name;
+ this.args = args;
+};
+tree.Call.prototype = {
+ //
+ // When evaluating a function call,
+ // we either find the function in `tree.functions` [1],
+ // in which case we call it, passing the evaluated arguments,
+ // or we simply print it out as it appeared originally [2].
+ //
+ // The *functions.js* file contains the built-in functions.
+ //
+ // The reason why we evaluate the arguments, is in the case where
+ // we try to pass a variable to a function, like: `saturate(@color)`.
+ // The function should receive the value, not the variable.
+ //
+ eval: function (env) {
+ var args = this.args.map(function (a) { return a.eval(env) });
+
+ if (this.name in tree.functions) { // 1.
+ return tree.functions[this.name].apply(tree.functions, args);
+ } else { // 2.
+ return new(tree.Anonymous)(this.name +
+ "(" + args.map(function (a) { return a.toCSS() }).join(', ') + ")");
+ }
+ },
+
+ toCSS: function (env) {
+ return this.eval(env).toCSS();
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+//
+// RGB Colors - #ff0014, #eee
+//
+tree.Color = function (rgb, a) {
+ //
+ // The end goal here, is to parse the arguments
+ // into an integer triplet, such as `128, 255, 0`
+ //
+ // This facilitates operations and conversions.
+ //
+ if (Array.isArray(rgb)) {
+ this.rgb = rgb;
+ } else if (rgb.length == 6) {
+ this.rgb = rgb.match(/.{2}/g).map(function (c) {
+ return parseInt(c, 16);
+ });
+ } else if (rgb.length == 8) {
+ this.alpha = parseInt(rgb.substring(0,2), 16) / 255.0;
+ this.rgb = rgb.substr(2).match(/.{2}/g).map(function (c) {
+ return parseInt(c, 16);
+ });
+ } else {
+ this.rgb = rgb.split('').map(function (c) {
+ return parseInt(c + c, 16);
+ });
+ }
+ this.alpha = typeof(a) === 'number' ? a : 1;
+};
+tree.Color.prototype = {
+ eval: function () { return this },
+
+ //
+ // If we have some transparency, the only way to represent it
+ // is via `rgba`. Otherwise, we use the hex representation,
+ // which has better compatibility with older browsers.
+ // Values are capped between `0` and `255`, rounded and zero-padded.
+ //
+ toCSS: function () {
+ if (this.alpha < 1.0) {
+ return "rgba(" + this.rgb.map(function (c) {
+ return Math.round(c);
+ }).concat(this.alpha).join(', ') + ")";
+ } else {
+ return '#' + this.rgb.map(function (i) {
+ i = Math.round(i);
+ i = (i > 255 ? 255 : (i < 0 ? 0 : i)).toString(16);
+ return i.length === 1 ? '0' + i : i;
+ }).join('');
+ }
+ },
+
+ //
+ // Operations have to be done per-channel, if not,
+ // channels will spill onto each other. Once we have
+ // our result, in the form of an integer triplet,
+ // we create a new Color node to hold the result.
+ //
+ operate: function (op, other) {
+ var result = [];
+
+ if (! (other instanceof tree.Color)) {
+ other = other.toColor();
+ }
+
+ for (var c = 0; c < 3; c++) {
+ result[c] = tree.operate(op, this.rgb[c], other.rgb[c]);
+ }
+ return new(tree.Color)(result, this.alpha + other.alpha);
+ },
+
+ toHSL: function () {
+ var r = this.rgb[0] / 255,
+ g = this.rgb[1] / 255,
+ b = this.rgb[2] / 255,
+ a = this.alpha;
+
+ var max = Math.max(r, g, b), min = Math.min(r, g, b);
+ var h, s, l = (max + min) / 2, d = max - min;
+
+ if (max === min) {
+ h = s = 0;
+ } else {
+ s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
+
+ switch (max) {
+ case r: h = (g - b) / d + (g < b ? 6 : 0); break;
+ case g: h = (b - r) / d + 2; break;
+ case b: h = (r - g) / d + 4; break;
+ }
+ h /= 6;
+ }
+ return { h: h * 360, s: s, l: l, a: a };
+ }
+};
+
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Comment = function (value, silent) {
+ this.value = value;
+ this.silent = !!silent;
+};
+tree.Comment.prototype = {
+ toCSS: function (env) {
+ return env.compress ? '' : this.value;
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+//
+// A number with a unit
+//
+tree.Dimension = function (value, unit) {
+ this.value = parseFloat(value);
+ this.unit = unit || null;
+};
+
+tree.Dimension.prototype = {
+ eval: function () { return this },
+ toColor: function () {
+ return new(tree.Color)([this.value, this.value, this.value]);
+ },
+ toCSS: function () {
+ var css = this.value + this.unit;
+ return css;
+ },
+
+ // In an operation between two Dimensions,
+ // we default to the first Dimension's unit,
+ // so `1px + 2em` will yield `3px`.
+ // In the future, we could implement some unit
+ // conversions such that `100cm + 10mm` would yield
+ // `101cm`.
+ operate: function (op, other) {
+ return new(tree.Dimension)
+ (tree.operate(op, this.value, other.value),
+ this.unit || other.unit);
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Directive = function (name, value) {
+ this.name = name;
+ if (Array.isArray(value)) {
+ this.ruleset = new(tree.Ruleset)([], value);
+ } else {
+ this.value = value;
+ }
+};
+tree.Directive.prototype = {
+ toCSS: function (ctx, env) {
+ if (this.ruleset) {
+ this.ruleset.root = true;
+ return this.name + (env.compress ? '{' : ' {\n ') +
+ this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') +
+ (env.compress ? '}': '\n}\n');
+ } else {
+ return this.name + ' ' + this.value.toCSS() + ';\n';
+ }
+ },
+ eval: function (env) {
+ env.frames.unshift(this);
+ this.ruleset = this.ruleset && this.ruleset.eval(env);
+ env.frames.shift();
+ return this;
+ },
+ variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) },
+ find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) },
+ rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Element = function (combinator, value) {
+ this.combinator = combinator instanceof tree.Combinator ?
+ combinator : new(tree.Combinator)(combinator);
+ this.value = value.trim();
+};
+tree.Element.prototype.toCSS = function (env) {
+ return this.combinator.toCSS(env || {}) + this.value;
+};
+
+tree.Combinator = function (value) {
+ if (value === ' ') {
+ this.value = ' ';
+ } else {
+ this.value = value ? value.trim() : "";
+ }
+};
+tree.Combinator.prototype.toCSS = function (env) {
+ return {
+ '' : '',
+ ' ' : ' ',
+ '&' : '',
+ ':' : ' :',
+ '::': '::',
+ '+' : env.compress ? '+' : ' + ',
+ '~' : env.compress ? '~' : ' ~ ',
+ '>' : env.compress ? '>' : ' > '
+ }[this.value];
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Expression = function (value) { this.value = value };
+tree.Expression.prototype = {
+ eval: function (env) {
+ if (this.value.length > 1) {
+ return new(tree.Expression)(this.value.map(function (e) {
+ return e.eval(env);
+ }));
+ } else if (this.value.length === 1) {
+ return this.value[0].eval(env);
+ } else {
+ return this;
+ }
+ },
+ toCSS: function (env) {
+ return this.value.map(function (e) {
+ return e.toCSS(env);
+ }).join(' ');
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+//
+// CSS @import node
+//
+// The general strategy here is that we don't want to wait
+// for the parsing to be completed, before we start importing
+// the file. That's because in the context of a browser,
+// most of the time will be spent waiting for the server to respond.
+//
+// On creation, we push the import path to our import queue, though
+// `import,push`, we also pass it a callback, which it'll call once
+// the file has been fetched, and parsed.
+//
+tree.Import = function (path, imports) {
+ var that = this;
+
+ this._path = path;
+
+ // The '.less' extension is optional
+ if (path instanceof tree.Quoted) {
+ this.path = /\.(le?|c)ss$/.test(path.value) ? path.value : path.value + '.less';
+ } else {
+ this.path = path.value.value || path.value;
+ }
+
+ this.css = /css$/.test(this.path);
+
+ // Only pre-compile .less files
+ if (! this.css) {
+ imports.push(this.path, function (root) {
+ if (! root) {
+ throw new(Error)("Error parsing " + that.path);
+ }
+ that.root = root;
+ });
+ }
+};
+
+//
+// The actual import node doesn't return anything, when converted to CSS.
+// The reason is that it's used at the evaluation stage, so that the rules
+// it imports can be treated like any other rules.
+//
+// In `eval`, we make sure all Import nodes get evaluated, recursively, so
+// we end up with a flat structure, which can easily be imported in the parent
+// ruleset.
+//
+tree.Import.prototype = {
+ toCSS: function () {
+ if (this.css) {
+ return "@import " + this._path.toCSS() + ';\n';
+ } else {
+ return "";
+ }
+ },
+ eval: function (env) {
+ var ruleset;
+
+ if (this.css) {
+ return this;
+ } else {
+ ruleset = new(tree.Ruleset)(null, this.root.rules.slice(0));
+
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.Import) {
+ Array.prototype
+ .splice
+ .apply(ruleset.rules,
+ [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+ return ruleset.rules;
+ }
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.JavaScript = function (string, index, escaped) {
+ this.escaped = escaped;
+ this.expression = string;
+ this.index = index;
+};
+tree.JavaScript.prototype = {
+ eval: function (env) {
+ var result,
+ that = this,
+ context = {};
+
+ var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) {
+ return tree.jsify(new(tree.Variable)('@' + name, that.index).eval(env));
+ });
+
+ try {
+ expression = new(Function)('return (' + expression + ')');
+ } catch (e) {
+ throw { message: "JavaScript evaluation error: `" + expression + "`" ,
+ index: this.index };
+ }
+
+ for (var k in env.frames[0].variables()) {
+ context[k.slice(1)] = {
+ value: env.frames[0].variables()[k].value,
+ toJS: function () {
+ return this.value.eval(env).toCSS();
+ }
+ };
+ }
+
+ try {
+ result = expression.call(context);
+ } catch (e) {
+ throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" ,
+ index: this.index };
+ }
+ if (typeof(result) === 'string') {
+ return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index);
+ } else if (Array.isArray(result)) {
+ return new(tree.Anonymous)(result.join(', '));
+ } else {
+ return new(tree.Anonymous)(result);
+ }
+ }
+};
+
+})(require('less/tree'));
+
+(function (tree) {
+
+tree.Keyword = function (value) { this.value = value };
+tree.Keyword.prototype = {
+ eval: function () { return this },
+ toCSS: function () { return this.value }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.mixin = {};
+tree.mixin.Call = function (elements, args, index) {
+ this.selector = new(tree.Selector)(elements);
+ this.arguments = args;
+ this.index = index;
+};
+tree.mixin.Call.prototype = {
+ eval: function (env) {
+ var mixins, args, rules = [], match = false;
+
+ for (var i = 0; i < env.frames.length; i++) {
+ if ((mixins = env.frames[i].find(this.selector)).length > 0) {
+ args = this.arguments && this.arguments.map(function (a) { return a.eval(env) });
+ for (var m = 0; m < mixins.length; m++) {
+ if (mixins[m].match(args, env)) {
+ try {
+ Array.prototype.push.apply(
+ rules, mixins[m].eval(env, this.arguments).rules);
+ match = true;
+ } catch (e) {
+ throw { message: e.message, index: e.index, stack: e.stack, call: this.index };
+ }
+ }
+ }
+ if (match) {
+ return rules;
+ } else {
+ throw { message: 'No matching definition was found for `' +
+ this.selector.toCSS().trim() + '(' +
+ this.arguments.map(function (a) {
+ return a.toCSS();
+ }).join(', ') + ")`",
+ index: this.index };
+ }
+ }
+ }
+ throw { message: this.selector.toCSS().trim() + " is undefined",
+ index: this.index };
+ }
+};
+
+tree.mixin.Definition = function (name, params, rules) {
+ this.name = name;
+ this.selectors = [new(tree.Selector)([new(tree.Element)(null, name)])];
+ this.params = params;
+ this.arity = params.length;
+ this.rules = rules;
+ this._lookups = {};
+ this.required = params.reduce(function (count, p) {
+ if (!p.name || (p.name && !p.value)) { return count + 1 }
+ else { return count }
+ }, 0);
+ this.parent = tree.Ruleset.prototype;
+ this.frames = [];
+};
+tree.mixin.Definition.prototype = {
+ toCSS: function () { return "" },
+ variable: function (name) { return this.parent.variable.call(this, name) },
+ variables: function () { return this.parent.variables.call(this) },
+ find: function () { return this.parent.find.apply(this, arguments) },
+ rulesets: function () { return this.parent.rulesets.apply(this) },
+
+ eval: function (env, args) {
+ var frame = new(tree.Ruleset)(null, []), context, _arguments = [];
+
+ for (var i = 0, val; i < this.params.length; i++) {
+ if (this.params[i].name) {
+ if (val = (args && args[i]) || this.params[i].value) {
+ frame.rules.unshift(new(tree.Rule)(this.params[i].name, val.eval(env)));
+ } else {
+ throw { message: "wrong number of arguments for " + this.name +
+ ' (' + args.length + ' for ' + this.arity + ')' };
+ }
+ }
+ }
+ for (var i = 0; i < Math.max(this.params.length, args && args.length); i++) {
+ _arguments.push(args[i] || this.params[i].value);
+ }
+ frame.rules.unshift(new(tree.Rule)('@arguments', new(tree.Expression)(_arguments).eval(env)));
+
+ return new(tree.Ruleset)(null, this.rules.slice(0)).eval({
+ frames: [this, frame].concat(this.frames, env.frames)
+ });
+ },
+ match: function (args, env) {
+ var argsLength = (args && args.length) || 0, len;
+
+ if (argsLength < this.required) { return false }
+ if ((this.required > 0) && (argsLength > this.params.length)) { return false }
+
+ len = Math.min(argsLength, this.arity);
+
+ for (var i = 0; i < len; i++) {
+ if (!this.params[i].name) {
+ if (args[i].eval(env).toCSS() != this.params[i].value.eval(env).toCSS()) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Operation = function (op, operands) {
+ this.op = op.trim();
+ this.operands = operands;
+};
+tree.Operation.prototype.eval = function (env) {
+ var a = this.operands[0].eval(env),
+ b = this.operands[1].eval(env),
+ temp;
+
+ if (a instanceof tree.Dimension && b instanceof tree.Color) {
+ if (this.op === '*' || this.op === '+') {
+ temp = b, b = a, a = temp;
+ } else {
+ throw { name: "OperationError",
+ message: "Can't substract or divide a color from a number" };
+ }
+ }
+ return a.operate(this.op, b);
+};
+
+tree.operate = function (op, a, b) {
+ switch (op) {
+ case '+': return a + b;
+ case '-': return a - b;
+ case '*': return a * b;
+ case '/': return a / b;
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Quoted = function (str, content, escaped, i) {
+ this.escaped = escaped;
+ this.value = content || '';
+ this.quote = str.charAt(0);
+ this.index = i;
+};
+tree.Quoted.prototype = {
+ toCSS: function () {
+ if (this.escaped) {
+ return this.value;
+ } else {
+ return this.quote + this.value + this.quote;
+ }
+ },
+ eval: function (env) {
+ var that = this;
+ var value = this.value.replace(/`([^`]+)`/g, function (_, exp) {
+ return new(tree.JavaScript)(exp, that.index, true).eval(env).value;
+ }).replace(/@\{([\w-]+)\}/g, function (_, name) {
+ var v = new(tree.Variable)('@' + name, that.index).eval(env);
+ return v.value || v.toCSS();
+ });
+ return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index);
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Rule = function (name, value, important, index) {
+ this.name = name;
+ this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]);
+ this.important = important ? ' ' + important.trim() : '';
+ this.index = index;
+
+ if (name.charAt(0) === '@') {
+ this.variable = true;
+ } else { this.variable = false }
+};
+tree.Rule.prototype.toCSS = function (env) {
+ if (this.variable) { return "" }
+ else {
+ return this.name + (env.compress ? ':' : ': ') +
+ this.value.toCSS(env) +
+ this.important + ";";
+ }
+};
+
+tree.Rule.prototype.eval = function (context) {
+ return new(tree.Rule)(this.name, this.value.eval(context), this.important, this.index);
+};
+
+tree.Shorthand = function (a, b) {
+ this.a = a;
+ this.b = b;
+};
+
+tree.Shorthand.prototype = {
+ toCSS: function (env) {
+ return this.a.toCSS(env) + "/" + this.b.toCSS(env);
+ },
+ eval: function () { return this }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Ruleset = function (selectors, rules) {
+ this.selectors = selectors;
+ this.rules = rules;
+ this._lookups = {};
+};
+tree.Ruleset.prototype = {
+ eval: function (env) {
+ var ruleset = new(tree.Ruleset)(this.selectors, this.rules.slice(0));
+
+ ruleset.root = this.root;
+
+ // push the current ruleset to the frames stack
+ env.frames.unshift(ruleset);
+
+ // Evaluate imports
+ if (ruleset.root) {
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.Import) {
+ Array.prototype.splice
+ .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+ }
+
+ // Store the frames around mixin definitions,
+ // so they can be evaluated like closures when the time comes.
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.mixin.Definition) {
+ ruleset.rules[i].frames = env.frames.slice(0);
+ }
+ }
+
+ // Evaluate mixin calls.
+ for (var i = 0; i < ruleset.rules.length; i++) {
+ if (ruleset.rules[i] instanceof tree.mixin.Call) {
+ Array.prototype.splice
+ .apply(ruleset.rules, [i, 1].concat(ruleset.rules[i].eval(env)));
+ }
+ }
+
+ // Evaluate everything else
+ for (var i = 0, rule; i < ruleset.rules.length; i++) {
+ rule = ruleset.rules[i];
+
+ if (! (rule instanceof tree.mixin.Definition)) {
+ ruleset.rules[i] = rule.eval ? rule.eval(env) : rule;
+ }
+ }
+
+ // Pop the stack
+ env.frames.shift();
+
+ return ruleset;
+ },
+ match: function (args) {
+ return !args || args.length === 0;
+ },
+ variables: function () {
+ if (this._variables) { return this._variables }
+ else {
+ return this._variables = this.rules.reduce(function (hash, r) {
+ if (r instanceof tree.Rule && r.variable === true) {
+ hash[r.name] = r;
+ }
+ return hash;
+ }, {});
+ }
+ },
+ variable: function (name) {
+ return this.variables()[name];
+ },
+ rulesets: function () {
+ if (this._rulesets) { return this._rulesets }
+ else {
+ return this._rulesets = this.rules.filter(function (r) {
+ return (r instanceof tree.Ruleset) || (r instanceof tree.mixin.Definition);
+ });
+ }
+ },
+ find: function (selector, self) {
+ self = self || this;
+ var rules = [], rule, match,
+ key = selector.toCSS();
+
+ if (key in this._lookups) { return this._lookups[key] }
+
+ this.rulesets().forEach(function (rule) {
+ if (rule !== self) {
+ for (var j = 0; j < rule.selectors.length; j++) {
+ if (match = selector.match(rule.selectors[j])) {
+ if (selector.elements.length > 1) {
+ Array.prototype.push.apply(rules, rule.find(
+ new(tree.Selector)(selector.elements.slice(1)), self));
+ } else {
+ rules.push(rule);
+ }
+ break;
+ }
+ }
+ }
+ });
+ return this._lookups[key] = rules;
+ },
+ //
+ // Entry point for code generation
+ //
+ // `context` holds an array of arrays.
+ //
+ toCSS: function (context, env) {
+ var css = [], // The CSS output
+ rules = [], // node.Rule instances
+ rulesets = [], // node.Ruleset instances
+ paths = [], // Current selectors
+ selector, // The fully rendered selector
+ rule;
+
+ if (! this.root) {
+ if (context.length === 0) {
+ paths = this.selectors.map(function (s) { return [s] });
+ } else {
+ for (var s = 0; s < this.selectors.length; s++) {
+ for (var c = 0; c < context.length; c++) {
+ paths.push(context[c].concat([this.selectors[s]]));
+ }
+ }
+ }
+ }
+
+ // Compile rules and rulesets
+ for (var i = 0; i < this.rules.length; i++) {
+ rule = this.rules[i];
+
+ if (rule.rules || (rule instanceof tree.Directive)) {
+ rulesets.push(rule.toCSS(paths, env));
+ } else if (rule instanceof tree.Comment) {
+ if (!rule.silent) {
+ if (this.root) {
+ rulesets.push(rule.toCSS(env));
+ } else {
+ rules.push(rule.toCSS(env));
+ }
+ }
+ } else {
+ if (rule.toCSS && !rule.variable) {
+ rules.push(rule.toCSS(env));
+ } else if (rule.value && !rule.variable) {
+ rules.push(rule.value.toString());
+ }
+ }
+ }
+
+ rulesets = rulesets.join('');
+
+ // If this is the root node, we don't render
+ // a selector, or {}.
+ // Otherwise, only output if this ruleset has rules.
+ if (this.root) {
+ css.push(rules.join(env.compress ? '' : '\n'));
+ } else {
+ if (rules.length > 0) {
+ selector = paths.map(function (p) {
+ return p.map(function (s) {
+ return s.toCSS(env);
+ }).join('').trim();
+ }).join(env.compress ? ',' : (paths.length > 3 ? ',\n' : ', '));
+ css.push(selector,
+ (env.compress ? '{' : ' {\n ') +
+ rules.join(env.compress ? '' : '\n ') +
+ (env.compress ? '}' : '\n}\n'));
+ }
+ }
+ css.push(rulesets);
+
+ return css.join('') + (env.compress ? '\n' : '');
+ }
+};
+})(require('less/tree'));
+(function (tree) {
+
+tree.Selector = function (elements) {
+ this.elements = elements;
+ if (this.elements[0].combinator.value === "") {
+ this.elements[0].combinator.value = ' ';
+ }
+};
+tree.Selector.prototype.match = function (other) {
+ if (this.elements[0].value === other.elements[0].value) {
+ return true;
+ } else {
+ return false;
+ }
+};
+tree.Selector.prototype.toCSS = function (env) {
+ if (this._css) { return this._css }
+
+ return this._css = this.elements.map(function (e) {
+ if (typeof(e) === 'string') {
+ return ' ' + e.trim();
+ } else {
+ return e.toCSS(env);
+ }
+ }).join('');
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.URL = function (val, paths) {
+ if (val.data) {
+ this.attrs = val;
+ } else {
+ // Add the base path if the URL is relative and we are in the browser
+ if (!/^(?:https?:\/|file:\/|data:\/)?\//.test(val.value) && paths.length > 0 && typeof(window) !== 'undefined') {
+ val.value = paths[0] + (val.value.charAt(0) === '/' ? val.value.slice(1) : val.value);
+ }
+ this.value = val;
+ this.paths = paths;
+ }
+};
+tree.URL.prototype = {
+ toCSS: function () {
+ return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data
+ : this.value.toCSS()) + ")";
+ },
+ eval: function (ctx) {
+ return this.attrs ? this : new(tree.URL)(this.value.eval(ctx), this.paths);
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Value = function (value) {
+ this.value = value;
+ this.is = 'value';
+};
+tree.Value.prototype = {
+ eval: function (env) {
+ if (this.value.length === 1) {
+ return this.value[0].eval(env);
+ } else {
+ return new(tree.Value)(this.value.map(function (v) {
+ return v.eval(env);
+ }));
+ }
+ },
+ toCSS: function (env) {
+ return this.value.map(function (e) {
+ return e.toCSS(env);
+ }).join(env.compress ? ',' : ', ');
+ }
+};
+
+})(require('less/tree'));
+(function (tree) {
+
+tree.Variable = function (name, index) { this.name = name, this.index = index };
+tree.Variable.prototype = {
+ eval: function (env) {
+ var variable, v, name = this.name;
+
+ if (name.indexOf('@@') == 0) {
+ name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value;
+ }
+
+ if (variable = tree.find(env.frames, function (frame) {
+ if (v = frame.variable(name)) {
+ return v.value.eval(env);
+ }
+ })) { return variable }
+ else {
+ throw { message: "variable " + name + " is undefined",
+ index: this.index };
+ }
+ }
+};
+
+})(require('less/tree'));
+require('less/tree').find = function (obj, fun) {
+ for (var i = 0, r; i < obj.length; i++) {
+ if (r = fun.call(obj, obj[i])) { return r }
+ }
+ return null;
+};
+require('less/tree').jsify = function (obj) {
+ if (Array.isArray(obj.value) && (obj.value.length > 1)) {
+ return '[' + obj.value.map(function (v) { return v.toCSS(false) }).join(', ') + ']';
+ } else {
+ return obj.toCSS(false);
+ }
+};
+//
+// browser.js - client-side engine
+//
+
+var isFileProtocol = (location.protocol === 'file:' ||
+ location.protocol === 'chrome:' ||
+ location.protocol === 'chrome-extension:' ||
+ location.protocol === 'resource:');
+
+less.env = less.env || (location.hostname == '127.0.0.1' ||
+ location.hostname == '0.0.0.0' ||
+ location.hostname == 'localhost' ||
+ location.port.length > 0 ||
+ isFileProtocol ? 'development'
+ : 'production');
+
+// Load styles asynchronously (default: false)
+//
+// This is set to `false` by default, so that the body
+// doesn't start loading before the stylesheets are parsed.
+// Setting this to `true` can result in flickering.
+//
+less.async = false;
+
+// Interval between watch polls
+less.poll = less.poll || (isFileProtocol ? 1000 : 1500);
+
+//
+// Watch mode
+//
+less.watch = function () { return this.watchMode = true };
+less.unwatch = function () { return this.watchMode = false };
+
+if (less.env === 'development') {
+ less.optimization = 0;
+
+ if (/!watch/.test(location.hash)) {
+ less.watch();
+ }
+ less.watchTimer = setInterval(function () {
+ if (less.watchMode) {
+ loadStyleSheets(function (root, sheet, env) {
+ if (root) {
+ createCSS(root.toCSS(), sheet, env.lastModified);
+ }
+ });
+ }
+ }, less.poll);
+} else {
+ less.optimization = 3;
+}
+
+var cache;
+
+try {
+ cache = (typeof(window.localStorage) === 'undefined') ? null : window.localStorage;
+} catch (_) {
+ cache = null;
+}
+
+//
+// Get all tags with the 'rel' attribute set to "stylesheet/less"
+//
+var links = document.getElementsByTagName('link');
+var typePattern = /^text\/(x-)?less$/;
+
+less.sheets = [];
+
+for (var i = 0; i < links.length; i++) {
+ if (links[i].rel === 'stylesheet/less' || (links[i].rel.match(/stylesheet/) &&
+ (links[i].type.match(typePattern)))) {
+ less.sheets.push(links[i]);
+ }
+}
+
+
+less.refresh = function (reload) {
+ var startTime, endTime;
+ startTime = endTime = new(Date);
+
+ loadStyleSheets(function (root, sheet, env) {
+ if (env.local) {
+ log("loading " + sheet.href + " from cache.");
+ } else {
+ log("parsed " + sheet.href + " successfully.");
+ createCSS(root.toCSS(), sheet, env.lastModified);
+ }
+ log("css for " + sheet.href + " generated in " + (new(Date) - endTime) + 'ms');
+ (env.remaining === 0) && log("css generated in " + (new(Date) - startTime) + 'ms');
+ endTime = new(Date);
+ }, reload);
+
+ loadStyles();
+};
+less.refreshStyles = loadStyles;
+
+less.refresh(less.env === 'development');
+
+function loadStyles() {
+ var styles = document.getElementsByTagName('style');
+ for (var i = 0; i < styles.length; i++) {
+ if (styles[i].type.match(typePattern)) {
+ new(less.Parser)().parse(styles[i].innerHTML || '', function (e, tree) {
+ styles[i].type = 'text/css';
+ styles[i].innerHTML = tree.toCSS();
+ });
+ }
+ }
+}
+
+function loadStyleSheets(callback, reload) {
+ for (var i = 0; i < less.sheets.length; i++) {
+ loadStyleSheet(less.sheets[i], callback, reload, less.sheets.length - (i + 1));
+ }
+}
+
+function loadStyleSheet(sheet, callback, reload, remaining) {
+ var url = window.location.href.replace(/[#?].*$/, '');
+ var href = sheet.href.replace(/\?.*$/, '');
+ var css = cache && cache.getItem(href);
+ var timestamp = cache && cache.getItem(href + ':timestamp');
+ var styles = { css: css, timestamp: timestamp };
+
+ // Stylesheets in IE don't always return the full path
+ if (! /^(https?|file):/.test(href)) {
+ if (href.charAt(0) == "/") {
+ href = window.location.protocol + "//" + window.location.host + href;
+ } else {
+ href = url.slice(0, url.lastIndexOf('/') + 1) + href;
+ }
+ }
+
+ xhr(sheet.href, sheet.type, function (data, lastModified) {
+ if (!reload && styles && lastModified &&
+ (new(Date)(lastModified).valueOf() ===
+ new(Date)(styles.timestamp).valueOf())) {
+ // Use local copy
+ createCSS(styles.css, sheet);
+ callback(null, sheet, { local: true, remaining: remaining });
+ } else {
+ // Use remote copy (re-parse)
+ try {
+ new(less.Parser)({
+ optimization: less.optimization,
+ paths: [href.replace(/[\w\.-]+$/, '')],
+ mime: sheet.type
+ }).parse(data, function (e, root) {
+ if (e) { return error(e, href) }
+ try {
+ callback(root, sheet, { local: false, lastModified: lastModified, remaining: remaining });
+ removeNode(document.getElementById('less-error-message:' + extractId(href)));
+ } catch (e) {
+ error(e, href);
+ }
+ });
+ } catch (e) {
+ error(e, href);
+ }
+ }
+ }, function (status, url) {
+ throw new(Error)("Couldn't load " + url + " (" + status + ")");
+ });
+}
+
+function extractId(href) {
+ return href.replace(/^[a-z]+:\/\/?[^\/]+/, '' ) // Remove protocol & domain
+ .replace(/^\//, '' ) // Remove root /
+ .replace(/\?.*$/, '' ) // Remove query
+ .replace(/\.[^\.\/]+$/, '' ) // Remove file extension
+ .replace(/[^\.\w-]+/g, '-') // Replace illegal characters
+ .replace(/\./g, ':'); // Replace dots with colons(for valid id)
+}
+
+function createCSS(styles, sheet, lastModified) {
+ var css;
+
+ // Strip the query-string
+ var href = sheet.href ? sheet.href.replace(/\?.*$/, '') : '';
+
+ // If there is no title set, use the filename, minus the extension
+ var id = 'less:' + (sheet.title || extractId(href));
+
+ // If the stylesheet doesn't exist, create a new node
+ if ((css = document.getElementById(id)) === null) {
+ css = document.createElement('style');
+ css.type = 'text/css';
+ css.media = sheet.media || 'screen';
+ css.id = id;
+ document.getElementsByTagName('head')[0].appendChild(css);
+ }
+
+ if (css.styleSheet) { // IE
+ try {
+ css.styleSheet.cssText = styles;
+ } catch (e) {
+ throw new(Error)("Couldn't reassign styleSheet.cssText.");
+ }
+ } else {
+ (function (node) {
+ if (css.childNodes.length > 0) {
+ if (css.firstChild.nodeValue !== node.nodeValue) {
+ css.replaceChild(node, css.firstChild);
+ }
+ } else {
+ css.appendChild(node);
+ }
+ })(document.createTextNode(styles));
+ }
+
+ // Don't update the local store if the file wasn't modified
+ if (lastModified && cache) {
+ log('saving ' + href + ' to cache.');
+ cache.setItem(href, styles);
+ cache.setItem(href + ':timestamp', lastModified);
+ }
+}
+
+function xhr(url, type, callback, errback) {
+ var xhr = getXMLHttpRequest();
+ var async = isFileProtocol ? false : less.async;
+
+ if (typeof(xhr.overrideMimeType) === 'function') {
+ xhr.overrideMimeType('text/css');
+ }
+ xhr.open('GET', url, async);
+ xhr.setRequestHeader('Accept', type || 'text/x-less, text/css; q=0.9, */*; q=0.5');
+ xhr.send(null);
+
+ if (isFileProtocol) {
+ if (xhr.status === 0) {
+ callback(xhr.responseText);
+ } else {
+ errback(xhr.status, url);
+ }
+ } else if (async) {
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState == 4) {
+ handleResponse(xhr, callback, errback);
+ }
+ };
+ } else {
+ handleResponse(xhr, callback, errback);
+ }
+
+ function handleResponse(xhr, callback, errback) {
+ if (xhr.status >= 200 && xhr.status < 300) {
+ callback(xhr.responseText,
+ xhr.getResponseHeader("Last-Modified"));
+ } else if (typeof(errback) === 'function') {
+ errback(xhr.status, url);
+ }
+ }
+}
+
+function getXMLHttpRequest() {
+ if (window.XMLHttpRequest) {
+ return new(XMLHttpRequest);
+ } else {
+ try {
+ return new(ActiveXObject)("MSXML2.XMLHTTP.3.0");
+ } catch (e) {
+ log("browser doesn't support AJAX.");
+ return null;
+ }
+ }
+}
+
+function removeNode(node) {
+ return node && node.parentNode.removeChild(node);
+}
+
+function log(str) {
+ if (less.env == 'development' && typeof(console) !== "undefined") { console.log('less: ' + str) }
+}
+
+function error(e, href) {
+ var id = 'less-error-message:' + extractId(href);
+
+ var template = ['',
+ '[-1] {0} ',
+ '[0] {current} ',
+ '[1] {2} ',
+ ' '].join('\n');
+
+ var elem = document.createElement('div'), timer, content;
+
+ elem.id = id;
+ elem.className = "less-error-message";
+
+ content = '' + (e.message || 'There is an error in your .less file') +
+ ' ' + '' + href + " ";
+
+ if (e.extract) {
+ content += 'on line ' + e.line + ', column ' + (e.column + 1) + ':
' +
+ template.replace(/\[(-?\d)\]/g, function (_, i) {
+ return (parseInt(e.line) + parseInt(i)) || '';
+ }).replace(/\{(\d)\}/g, function (_, i) {
+ return e.extract[parseInt(i)] || '';
+ }).replace(/\{current\}/, e.extract[1].slice(0, e.column) + '' +
+ e.extract[1].slice(e.column) + ' ');
+ }
+ elem.innerHTML = content;
+
+ // CSS for error messages
+ createCSS([
+ '.less-error-message ul, .less-error-message li {',
+ 'list-style-type: none;',
+ 'margin-right: 15px;',
+ 'padding: 4px 0;',
+ 'margin: 0;',
+ '}',
+ '.less-error-message label {',
+ 'font-size: 12px;',
+ 'margin-right: 15px;',
+ 'padding: 4px 0;',
+ 'color: #cc7777;',
+ '}',
+ '.less-error-message pre {',
+ 'color: #ee4444;',
+ 'padding: 4px 0;',
+ 'margin: 0;',
+ 'display: inline-block;',
+ '}',
+ '.less-error-message pre.ctx {',
+ 'color: #dd4444;',
+ '}',
+ '.less-error-message h3 {',
+ 'font-size: 20px;',
+ 'font-weight: bold;',
+ 'padding: 15px 0 5px 0;',
+ 'margin: 0;',
+ '}',
+ '.less-error-message a {',
+ 'color: #10a',
+ '}',
+ '.less-error-message .error {',
+ 'color: red;',
+ 'font-weight: bold;',
+ 'padding-bottom: 2px;',
+ 'border-bottom: 1px dashed red;',
+ '}'
+ ].join('\n'), { title: 'error-message' });
+
+ elem.style.cssText = [
+ "font-family: Arial, sans-serif",
+ "border: 1px solid #e00",
+ "background-color: #eee",
+ "border-radius: 5px",
+ "-webkit-border-radius: 5px",
+ "-moz-border-radius: 5px",
+ "color: #e00",
+ "padding: 15px",
+ "margin-bottom: 15px"
+ ].join(';');
+
+ if (less.env == 'development') {
+ timer = setInterval(function () {
+ if (document.body) {
+ if (document.getElementById(id)) {
+ document.body.replaceChild(elem, document.getElementById(id));
+ } else {
+ document.body.insertBefore(elem, document.body.firstChild);
+ }
+ clearInterval(timer);
+ }
+ }, 10);
+ }
+}
+
+})(window);
diff --git a/node_modules/anvil.js/node_modules/less/dist/less-1.1.2.min.js b/node_modules/anvil.js/node_modules/less/dist/less-1.1.2.min.js
new file mode 100644
index 0000000..9b2fc8a
--- /dev/null
+++ b/node_modules/anvil.js/node_modules/less/dist/less-1.1.2.min.js
@@ -0,0 +1,16 @@
+//
+// LESS - Leaner CSS v1.1.2
+// http://lesscss.org
+//
+// Copyright (c) 2009-2011, Alexis Sellier
+// Licensed under the Apache 2.0 License.
+//
+//
+// LESS - Leaner CSS v1.1.2
+// http://lesscss.org
+//
+// Copyright (c) 2009-2011, Alexis Sellier
+// Licensed under the Apache 2.0 License.
+//
+(function(a,b){function v(a,b){var c="less-error-message:"+p(b),e=["",'[-1] {0} ',"[0] {current} ",'[1] {2} '," "].join("\n"),f=document.createElement("div"),g,h;f.id=c,f.className="less-error-message",h=""+(a.message||"There is an error in your .less file")+" "+''+b+" ",a.extract&&(h+="on line "+a.line+", column "+(a.column+1)+":
"+e.replace(/\[(-?\d)\]/g,function(b,c){return parseInt(a.line)+parseInt(c)||""}).replace(/\{(\d)\}/g,function(b,c){return a.extract[parseInt(c)]||""}).replace(/\{current\}/,a.extract[1].slice(0,a.column)+''+a.extract[1].slice(a.column)+" ")),f.innerHTML=h,q([".less-error-message ul, .less-error-message li {","list-style-type: none;","margin-right: 15px;","padding: 4px 0;","margin: 0;","}",".less-error-message label {","font-size: 12px;","margin-right: 15px;","padding: 4px 0;","color: #cc7777;","}",".less-error-message pre {","color: #ee4444;","padding: 4px 0;","margin: 0;","display: inline-block;","}",".less-error-message pre.ctx {","color: #dd4444;","}",".less-error-message h3 {","font-size: 20px;","font-weight: bold;","padding: 15px 0 5px 0;","margin: 0;","}",".less-error-message a {","color: #10a","}",".less-error-message .error {","color: red;","font-weight: bold;","padding-bottom: 2px;","border-bottom: 1px dashed red;","}"].join("\n"),{title:"error-message"}),f.style.cssText=["font-family: Arial, sans-serif","border: 1px solid #e00","background-color: #eee","border-radius: 5px","-webkit-border-radius: 5px","-moz-border-radius: 5px","color: #e00","padding: 15px","margin-bottom: 15px"].join(";"),d.env=="development"&&(g=setInterval(function(){document.body&&(document.getElementById(c)?document.body.replaceChild(f,document.getElementById(c)):document.body.insertBefore(f,document.body.firstChild),clearInterval(g))},10))}function u(a){d.env=="development"&&typeof console!="undefined"&&console.log("less: "+a)}function t(a){return a&&a.parentNode.removeChild(a)}function s(){if(a.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(b){u("browser doesn't support AJAX.");return null}}function r(a,b,c,e){function i(b,c,d){b.status>=200&&b.status<300?c(b.responseText,b.getResponseHeader("Last-Modified")):typeof d=="function"&&d(b.status,a)}var f=s(),h=g?!1:d.async;typeof f.overrideMimeType=="function"&&f.overrideMimeType("text/css"),f.open("GET",a,h),f.setRequestHeader("Accept",b||"text/x-less, text/css; q=0.9, */*; q=0.5"),f.send(null),g?f.status===0?c(f.responseText):e(f.status,a):h?f.onreadystatechange=function(){f.readyState==4&&i(f,c,e)}:i(f,c,e)}function q(a,b,c){var d,e=b.href?b.href.replace(/\?.*$/,""):"",f="less:"+(b.title||p(e));(d=document.getElementById(f))===null&&(d=document.createElement("style"),d.type="text/css",d.media=b.media||"screen",d.id=f,document.getElementsByTagName("head")[0].appendChild(d));if(d.styleSheet)try{d.styleSheet.cssText=a}catch(g){throw new Error("Couldn't reassign styleSheet.cssText.")}else(function(a){d.childNodes.length>0?d.firstChild.nodeValue!==a.nodeValue&&d.replaceChild(a,d.firstChild):d.appendChild(a)})(document.createTextNode(a));c&&h&&(u("saving "+e+" to cache."),h.setItem(e,a),h.setItem(e+":timestamp",c))}function p(a){return a.replace(/^[a-z]+:\/\/?[^\/]+/,"").replace(/^\//,"").replace(/\?.*$/,"").replace(/\.[^\.\/]+$/,"").replace(/[^\.\w-]+/g,"-").replace(/\./g,":")}function o(b,c,e,f){var g=a.location.href.replace(/[#?].*$/,""),i=b.href.replace(/\?.*$/,""),j=h&&h.getItem(i),k=h&&h.getItem(i+":timestamp"),l={css:j,timestamp:k};/^(https?|file):/.test(i)||(i.charAt(0)=="/"?i=a.location.protocol+"//"+a.location.host+i:i=g.slice(0,g.lastIndexOf("/")+1)+i),r(b.href,b.type,function(a,g){if(!e&&l&&g&&(new Date(g)).valueOf()===(new Date(l.timestamp)).valueOf())q(l.css,b),c(null,b,{local:!0,remaining:f});else try{(new d.Parser({optimization:d.optimization,paths:[i.replace(/[\w\.-]+$/,"")],mime:b.type})).parse(a,function(a,d){if(a)return v(a,i);try{c(d,b,{local:!1,lastModified:g,remaining:f}),t(document.getElementById("less-error-message:"+p(i)))}catch(a){v(a,i)}})}catch(h){v(h,i)}},function(a,b){throw new Error("Couldn't load "+b+" ("+a+")")})}function n(a,b){for(var c=0;c>>0;for(var d=0;d>>0,c=Array(b),d=arguments[1];for(var e=0;e>>0,c=0;if(b===0&&arguments.length===1)throw new TypeError;if(arguments.length>=2)var d=arguments[1];else for(;;){if(c in this){d=this[c++];break}if(++c>=b)throw new TypeError}for(;c=b)return-1;c<0&&(c+=b);for(;c