"]$/))i+=o[s].replace(/&/g,"&").replace(//g,">").replace(/"/g,""");else{var p=o.charCodeAt(s);i+=p<=31&&9!=p&&10!=p&&13!=p?"�":p<128?e.lib.sprintf("%02s;",p.toString(16).toUpperCase()):e.lib.sprintf("%04s;",p.toString(16).toUpperCase())}return e.Markup(i,"html_attr")}throw new e.Error("escape strategy unsupported")}},e:function(t,r){return e.filters.escape(t,r)},nl2br:function(t){if(void 0!==t&&null!==t){var r="BACKSLASH_n_replace",n="
"+r;return t=e.filters.escape(t).replace(/\r\n/g,n).replace(/\r/g,n).replace(/\n/g,n),t=e.lib.replaceAll(t,r,"\n"),e.Markup(t)}},number_format:function(e,t){var r=e,n=t&&t[0]?t[0]:void 0,o=t&&void 0!==t[1]?t[1]:".",i=t&&void 0!==t[2]?t[2]:",";r=(r+"").replace(/[^0-9+\-Ee.]/g,"");var s=isFinite(+r)?+r:0,p=isFinite(+n)?Math.abs(n):0,a="",l=function(e,t){var r=Math.pow(10,t);return""+Math.round(e*r)/r};return a=(p?l(s,p):""+Math.round(s)).split("."),a[0].length>3&&(a[0]=a[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,i)),(a[1]||"").length=0;i--)if(n.indexOf(o.charAt(i))===-1){o=o.substring(0,i+1);break}return n.indexOf(o.charAt(0))===-1?o:""}},truncate:function(e,t){var r=30,n=!1,o="...";if(e+="",t&&(t[0]&&(r=t[0]),t[1]&&(n=t[1]),t[2]&&(o=t[2])),e.length>r){if(n&&(r=e.indexOf(" ",r),r===-1))return e;e=e.substr(0,r)+o}return e},slice:function(t,r){if(void 0!==t&&null!==t){if(void 0===r||r.length<1)throw new e.Error("slice filter expects at least 1 argument");var n=r[0]||0,o=r.length>1?r[1]:t.length,i=n>=0?n:Math.max(t.length+n,0);if(e.lib.is("Array",t)){for(var s=[],p=i;p2)throw new e.Error("split filter expects 1 or 2 argument");if(e.lib.is("String",t)){var n=r[0],o=r[1],i=t.split(n);if(void 0===o)return i;if(o<0)return t.split(n,i.length+o);var s=[];if(""==n)for(;i.length>0;){for(var p="",a=0;a0;a++)p+=i.shift();s.push(p)}else{for(var a=0;a0;a++)s.push(i.shift());i.length>0&&s.push(i.join(n))}return s}throw new e.Error("split filter expects value to be a string")}},last:function(t){if(e.lib.is("Object",t)){var r;return r=void 0===t._keys?Object.keys(t):t._keys,t[r[r.length-1]]}return t[t.length-1]},raw:function(t){return e.Markup(t)},batch:function(t,r){var n,o,i,s=r.shift(),p=r.shift();if(!e.lib.is("Array",t))throw new e.Error("batch filter expects items to be an array");if(!e.lib.is("Number",s))throw new e.Error("batch filter expects size to be a number");if(s=Math.ceil(s),n=e.lib.chunkArray(t,s),p&&t.length%s!=0){for(o=n.pop(),i=s-o.length;i--;)o.push(p);n.push(o)}return n},round:function(t,r){r=r||[];var n=r.length>0?r[0]:0,o=r.length>1?r[1]:"common";if(t=parseFloat(t),n&&!e.lib.is("Number",n))throw new e.Error("round filter expects precision to be a number");if("common"===o)return e.lib.round(t,n);if(!e.lib.is("Function",Math[o]))throw new e.Error("round filter expects method to be 'floor', 'ceil', or 'common'");return Math[o](t*Math.pow(10,n))/Math.pow(10,n)}},e.filter=function(t,r,n){if(!e.filters[t])throw"Unable to find filter "+t;return e.filters[t].apply(this,[r,n])},e.filter.extend=function(t,r){e.filters[t]=r},e}},function(e,t){e.exports=function(t){var r='Template "{name}" is not defined.';return t.functions={range:function(e,t,r){var n,o,i,s=[],p=r||1,a=!1;if(isNaN(e)||isNaN(t)?isNaN(e)&&isNaN(t)?(a=!0,n=e.charCodeAt(0),o=t.charCodeAt(0)):(n=isNaN(e)?0:e,o=isNaN(t)?0:t):(n=parseInt(e,10),o=parseInt(t,10)),i=!(n>o))for(;n<=o;)s.push(a?String.fromCharCode(n):n),n+=p;else for(;n>=o;)s.push(a?String.fromCharCode(n):n),n-=p;return s},cycle:function(e,t){var r=t%e.length;return e[r]},dump:function(){var e="\n",r=" ",n=0,o="",i=Array.prototype.slice.call(arguments),s=function(e){for(var t="";e>0;)e--,t+=r;return t},p=function(t){o+=s(n),"object"==typeof t?a(t):"function"==typeof t?o+="function()"+e:"string"==typeof t?o+="string("+t.length+') "'+t+'"'+e:"number"==typeof t?o+="number("+t+")"+e:"boolean"==typeof t&&(o+="bool("+t+")"+e)},a=function(t){var r;if(null===t)o+="NULL"+e;else if(void 0===t)o+="undefined"+e;else if("object"==typeof t){o+=s(n)+typeof t,n++,o+="("+function(e){var t,r=0;for(t in e)e.hasOwnProperty(t)&&r++;return r}(t)+") {"+e;for(r in t)o+=s(n)+"["+r+"]=> "+e,p(t[r]);n--,o+=s(n)+"}"+e}else p(t)};return 0==i.length&&i.push(this.context),t.forEach(i,function(e){a(e)}),o},date:function(e,r){var n;if(void 0===e||null===e||""===e)n=new Date;else if(t.lib.is("Date",e))n=e;else if(t.lib.is("String",e))n=e.match(/^[0-9]+$/)?new Date(1e3*e):new Date(1e3*t.lib.strtotime(e));else{if(!t.lib.is("Number",e))throw new t.Error("Unable to parse date "+e);n=new Date(1e3*e)}return n},block:function(e){return this.originalBlockTokens[e]?t.logic.parse.apply(this,[this.originalBlockTokens[e],this.context]).output:this.blocks[e]},parent:function(){return t.placeholders.parent},attribute:function(e,r,n){return t.lib.is("Object",e)&&e.hasOwnProperty(r)?"function"==typeof e[r]?e[r].apply(void 0,n):e[r]:e[r]||void 0},max:function(e){return t.lib.is("Object",e)?(delete e._keys,t.lib.max(e)):t.lib.max.apply(null,arguments)},min:function(e){return t.lib.is("Object",e)?(delete e._keys,t.lib.min(e)):t.lib.min.apply(null,arguments)},template_from_string:function(e){return void 0===e&&(e=""),t.Templates.parsers.twig({options:this.options,data:e})},random:function(e){function r(e){var t=Math.floor(Math.random()*n),r=[0,e],o=Math.min.apply(null,r),i=Math.max.apply(null,r);return o+Math.floor((i-o+1)*t/n)}var n=2147483648;if(t.lib.is("Number",e))return r(e);if(t.lib.is("String",e))return e.charAt(r(e.length-1));if(t.lib.is("Array",e))return e[r(e.length-1)];if(t.lib.is("Object",e)){var o=Object.keys(e);return e[o[r(o.length-1)]]}return r(n-1)},source:function(n,o){var i,s,p,a=!1,l="undefined"!=typeof e&&"undefined"!=typeof e.exports&&"undefined"==typeof window;l?(s="fs",p=__dirname+"/"+n):(s="ajax",p=n);var c={id:n,path:p,method:s,parser:"source",async:!1,fetchTemplateSource:!0};"undefined"==typeof o&&(o=!1);try{i=t.Templates.loadRemote(n,c),"undefined"==typeof i||null===i?i="":a=!0}catch(e){t.log.debug("Twig.functions.source: ","Problem loading template ",e)}return a||o?i:r.replace("{name}",n)}},t._function=function(e,r,n){if(!t.functions[e])throw"Unable to find function "+e;return t.functions[e](r,n)},t._function.extend=function(e,r){t.functions[e]=r},t}},function(e,t,r){e.exports=function(e){return e.lib={},e.lib.sprintf=r(8),e.lib.vsprintf=r(9),e.lib.round=r(10),e.lib.max=r(11),e.lib.min=r(12),e.lib.strip_tags=r(13),e.lib.strtotime=r(14),e.lib.date=r(15),e.lib.boolval=r(16),e.lib.is=function(e,t){var r=Object.prototype.toString.call(t).slice(8,-1);return void 0!==t&&null!==t&&r===e},e.lib.copy=function(e){var t,r={};for(t in e)r[t]=e[t];return r},e.lib.extend=function(e,t){var r,n=Object.keys(t);for(r=n.length;r--;)e[n[r]]=t[n[r]];return e},e.lib.replaceAll=function(e,t,r){return e.split(t).join(r)},e.lib.chunkArray=function(t,r){var n=[],o=0,i=t.length;if(r<1||!e.lib.is("Array",t))return[];for(;o=t?"":new Array(1+t-e.length>>>0).join(r);return n?e+o:o+e},i=function(e,t,r,n,i,s){var p=n-e.length;return p>0&&(e=r||!i?o(e,n,s,r):[e.slice(0,t.length),o("",p,"0",!0),e.slice(t.length)].join("")),e},s=function(e,t,r,n,s,p,a){var l=e>>>0;return r=r&&l&&{2:"0b",8:"0",16:"0x"}[t]||"",e=r+o(l.toString(t),p||0,"0",!1),i(e,r,n,s,a)},p=function(e,t,r,n,o,s){return null!==n&&void 0!==n&&(e=e.slice(0,n)),i(e,"",t,r,o,s)},a=function(e,n,a,l,c,u){var f,h,y,d,g;if("%%"===e)return"%";var m,x=!1,v="",b=!1,w=!1,k=" ",_=a.length;for(m=0;m<_;m++)switch(a.charAt(m)){case" ":v=" ";break;case"+":v="+";break;case"-":x=!0;break;case"'":k=a.charAt(m+1);break;case"0":b=!0,k="0";break;case"#":w=!0}if(l=l?"*"===l?+t[r++]:"*"===l.charAt(0)?+t[l.slice(1,-1)]:+l:0,l<0&&(l=-l,x=!0),!isFinite(l))throw new Error("sprintf: (minimum-)width must be finite");switch(c=c?"*"===c?+t[r++]:"*"===c.charAt(0)?+t[c.slice(1,-1)]:+c:"fFeE".indexOf(u)>-1?6:"d"===u?0:void 0,g=n?t[n.slice(0,-1)]:t[r++],u){case"s":return p(g+"",x,l,c,b,k);case"c":return p(String.fromCharCode(+g),x,l,c,b);case"b":return s(g,2,w,x,l,c,b);case"o":return s(g,8,w,x,l,c,b);case"x":return s(g,16,w,x,l,c,b);case"X":return s(g,16,w,x,l,c,b).toUpperCase();case"u":return s(g,10,w,x,l,c,b);case"i":case"d":return f=+g||0,f=Math.round(f-f%1),h=f<0?"-":v,g=h+o(String(Math.abs(f)),c,"0",!1),i(g,h,x,l,b);case"e":case"E":case"f":case"F":case"g":case"G":return f=+g,h=f<0?"-":v,y=["toExponential","toFixed","toPrecision"]["efg".indexOf(u.toLowerCase())],d=["toString","toUpperCase"]["eEfFgG".indexOf(u)%2],g=h+Math.abs(f)[y](c),i(g,h,x,l,b)[d]();default:return e}};return n.replace(e,a)}},function(e,t,r){"use strict";e.exports=function(e,t){var n=r(8);return n.apply(this,[e].concat(t))}},function(e,t){"use strict";e.exports=function(e,t,r){var n,o,i,s;if(t|=0,n=Math.pow(10,t),e*=n,s=e>0|-(e<0),i=e%1===.5*s,o=Math.floor(e),i)switch(r){case"PHP_ROUND_HALF_DOWN":e=o+(s<0);break;case"PHP_ROUND_HALF_EVEN":e=o+o%2*s;break;case"PHP_ROUND_HALF_ODD":e=o+!(o%2);break;default:e=o+(s>0)}return(i?e:Math.round(e))/n}},function(e,t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};e.exports=function(){var e,t,n=0,o=0,i=arguments,s=i.length,p=function(e){if("[object Array]"===Object.prototype.toString.call(e))return e;var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(e[r]);return t},a=function e(t,n){var o=0,i=0,s=0,a=0,l=0;if(t===n)return 0;if("object"===("undefined"==typeof t?"undefined":r(t))){if("object"===("undefined"==typeof n?"undefined":r(n))){if(t=p(t),n=p(n),l=t.length,a=n.length,a>l)return 1;if(a0?1:-1:n===t?0:n>t?1:-1};if(0===s)throw new Error("At least one value should be passed to max()");if(1===s){if("object"!==r(i[0]))throw new Error("Wrong parameter count for max()");if(e=p(i[0]),0===e.length)throw new Error("Array must contain at least one element for max()")}else e=i;for(t=e[0],n=1,o=e.length;nl)return 1;if(a0?1:-1:n===t?0:n>t?1:-1};if(0===s)throw new Error("At least one value should be passed to min()");if(1===s){if("object"!==r(i[0]))throw new Error("Wrong parameter count for min()");if(e=p(i[0]),0===e.length)throw new Error("Array must contain at least one element for min()")}else e=i;for(t=e[0],n=1,o=e.length;n/g)||[]).join("");var r=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,n=/|<\?(?:php)?[\s\S]*?\?>/gi;return e.replace(n,"").replace(r,function(e,r){return t.indexOf("<"+r.toLowerCase()+">")>-1?e:""})}},function(e,t){"use strict";e.exports=function(e,t){function r(e,t,r){var n,o=l[t];"undefined"!=typeof o&&(n=o-a.getDay(),0===n?n=7*r:n>0&&"last"===e?n-=7:n<0&&"next"===e&&(n+=7),a.setDate(a.getDate()+n))}function n(e){var t=e.split(" "),n=t[0],o=t[1].substring(0,3),i=/\d+/.test(n),s="ago"===t[2],p=("last"===n?-1:1)*(s?-1:1);if(i&&(p*=parseInt(n,10)),c.hasOwnProperty(o)&&!t[1].match(/^mon(day|\.)?$/i))return a["set"+c[o]](a["get"+c[o]]()+p);if("wee"===o)return a.setDate(a.getDate()+7*p);if("next"===n||"last"===n)r(n,o,p);else if(!i)return!1;return!0}var o,i,s,p,a,l,c,u,f,h,y,d=!1;if(!e)return d;e=e.replace(/^\s+|\s+$/g,"").replace(/\s{2,}/g," ").replace(/[\t\r\n]/g,"").toLowerCase();var g=new RegExp(["^(\\d{1,4})","([\\-\\.\\/:])","(\\d{1,2})","([\\-\\.\\/:])","(\\d{1,4})","(?:\\s(\\d{1,2}):(\\d{2})?:?(\\d{2})?)?","(?:\\s([A-Z]+)?)?$"].join(""));if(i=e.match(g),i&&i[2]===i[4])if(i[1]>1901)switch(i[2]){case"-":return i[3]>12||i[5]>31?d:new Date(i[1],parseInt(i[3],10)-1,i[5],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3;case".":return d;case"/":return i[3]>12||i[5]>31?d:new Date(i[1],parseInt(i[3],10)-1,i[5],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3}else if(i[5]>1901)switch(i[2]){case"-":return i[3]>12||i[1]>31?d:new Date(i[5],parseInt(i[3],10)-1,i[1],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3;case".":return i[3]>12||i[1]>31?d:new Date(i[5],parseInt(i[3],10)-1,i[1],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3;case"/":return i[1]>12||i[3]>31?d:new Date(i[5],parseInt(i[1],10)-1,i[3],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3}else switch(i[2]){case"-":return i[3]>12||i[5]>31||i[1]<70&&i[1]>38?d:(p=i[1]>=0&&i[1]<=38?+i[1]+2e3:i[1],new Date(p,parseInt(i[3],10)-1,i[5],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3);case".":return i[5]>=70?i[3]>12||i[1]>31?d:new Date(i[5],parseInt(i[3],10)-1,i[1],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3:i[5]<60&&!i[6]?i[1]>23||i[3]>59?d:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),i[1]||0,i[3]||0,i[5]||0,i[9]||0)/1e3):d;case"/":return i[1]>12||i[3]>31||i[5]<70&&i[5]>38?d:(p=i[5]>=0&&i[5]<=38?+i[5]+2e3:i[5],new Date(p,parseInt(i[1],10)-1,i[3],i[6]||0,i[7]||0,i[8]||0,i[9]||0)/1e3);case":":return i[1]>23||i[3]>59||i[5]>59?d:(s=new Date,new Date(s.getFullYear(),s.getMonth(),s.getDate(),i[1]||0,i[3]||0,i[5]||0)/1e3)}if("now"===e)return null===t||isNaN(t)?(new Date).getTime()/1e3|0:0|t;if(!isNaN(o=Date.parse(e)))return o/1e3|0;if(g=new RegExp(["^([0-9]{4}-[0-9]{2}-[0-9]{2})","[ t]","([0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?)","([\\+-][0-9]{2}(:[0-9]{2})?|z)"].join("")),i=e.match(g),i&&("z"===i[4]?i[4]="Z":i[4].match(/^([\+-][0-9]{2})$/)&&(i[4]=i[4]+":00"),!isNaN(o=Date.parse(i[1]+"T"+i[2]+i[4]))))return o/1e3|0;if(a=t?new Date(1e3*t):new Date,l={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6},c={yea:"FullYear",mon:"Month",day:"Date",hou:"Hours",min:"Minutes",sec:"Seconds"},f="(years?|months?|weeks?|days?|hours?|minutes?|min|seconds?|sec|sunday|sun\\.?|monday|mon\\.?|tuesday|tue\\.?|wednesday|wed\\.?|thursday|thu\\.?|friday|fri\\.?|saturday|sat\\.?)",h="([+-]?\\d+\\s"+f+"|(last|next)\\s"+f+")(\\sago)?",i=e.match(new RegExp(h,"gi")),!i)return d;for(y=0,u=i.length;y9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return r.getHours()>11?"pm":"am"},A:function(){return n.a().toUpperCase()},B:function(){var e=3600*r.getUTCHours(),t=60*r.getUTCMinutes(),n=r.getUTCSeconds();return p(Math.floor((e+t+n+3600)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return p(n.g(),2)},H:function(){return p(n.G(),2)},i:function(){return p(r.getMinutes(),2)},s:function(){return p(r.getSeconds(),2)},u:function(){return p(1e3*r.getMilliseconds(),6)},e:function(){var e="Not supported (see source code of date() for timezone on how to add support)";throw new Error(e)},I:function(){var e=new Date(n.Y(),0),t=Date.UTC(n.Y(),0),r=new Date(n.Y(),6),o=Date.UTC(n.Y(),6);return e-t!==r-o?1:0},O:function(){var e=r.getTimezoneOffset(),t=Math.abs(e);return(e>0?"-":"+")+p(100*Math.floor(t/60)+t%60,4)},P:function(){var e=n.O();return e.substr(0,3)+":"+e.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(i,s)},r:function(){return"D, d M Y H:i:s O".replace(i,s)},U:function(){return r/1e3|0}};var a=function(e,t){return r=void 0===t?new Date:t instanceof Date?new Date(t):new Date(1e3*t),e.replace(i,s)};return a(e,t)}},function(e,t){"use strict";e.exports=function(e){return e!==!1&&(0!==e&&0!==e&&(""!==e&&"0"!==e&&((!Array.isArray(e)||0!==e.length)&&(null!==e&&void 0!==e))))}},function(e,t){e.exports=function(e){"use strict";e.Templates.registerLoader("ajax",function(t,r,n,o){var i,s,p=r.precompiled,a=this.parsers[r.parser]||this.parser.twig;if("undefined"==typeof XMLHttpRequest)throw new e.Error('Unsupported platform: Unable to do ajax requests because there is no "XMLHTTPRequest" implementation');return s=new XMLHttpRequest,s.onreadystatechange=function(){var l=null;4===s.readyState&&(200===s.status||window.cordova&&0==s.status?(e.log.debug("Got template ",s.responseText),l=p===!0?JSON.parse(s.responseText):s.responseText,r.url=t,r.data=l,i=a.call(this,r),"function"==typeof n&&n(i)):"function"==typeof o&&o(s))},s.open("GET",t,!!r.async),s.send(),!!r.async||i})}},function(e,t,r){e.exports=function(e){"use strict";var t,n;try{t=r(19),n=r(20)}catch(e){}e.Templates.registerLoader("fs",function(r,o,i,s){var p,a=null,l=o.precompiled,c=this.parsers[o.parser]||this.parser.twig;if(!t||!n)throw new e.Error('Unsupported platform: Unable to load from file because there is no "fs" or "path" implementation');var u=function(e,t){return e?void("function"==typeof s&&s(e)):(l===!0&&(t=JSON.parse(t)),o.data=t,o.path=o.path||r,p=c.call(this,o),void("function"==typeof i&&i(p)))};if(o.path=o.path||r,o.async)return t.stat(o.path,function(r,n){return r||!n.isFile()?void("function"==typeof s&&s(new e.Error("Unable to find template file "+o.path))):void t.readFile(o.path,"utf8",u)}),!0;try{if(!t.statSync(o.path).isFile())throw new e.Error("Unable to find template file "+o.path)}catch(t){throw new e.Error("Unable to find template file "+o.path)}return a=t.readFileSync(o.path,"utf8"),u(void 0,a),p})}},function(e,t){},function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!o;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,o="/"===s.charAt(0))}return t=r(n(t.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+t||"."},t.normalize=function(e){var o=t.isAbsolute(e),i="/"===s(e,-1);return e=r(n(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&i&&(e+="/"),(o?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(n(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var o=n(e.split("/")),i=n(r.split("/")),s=Math.min(o.length,i.length),p=s,a=0;a1)for(var r=1;r=0){if(i=r.split(","),2!==i.length)throw new e.Error("Invalid expression in for loop: "+r);t.key_var=i[0].trim(),
-t.value_var=i[1].trim()}else t.value_var=r;return t.expression=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,o&&(t.conditional=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:o}]).stack),delete t.match,t},parse:function(t,r,n){var o,i,s=e.expression.parse.apply(this,[t.expression,r]),p=[],a=0,l=this,c=t.conditional,u=function(e,t){var n=void 0!==c;return{index:e+1,index0:e,revindex:n?void 0:t-e,revindex0:n?void 0:t-e-1,first:0===e,last:n?void 0:e===t-1,length:n?void 0:t,parent:r}},f=function(n,i){var s=e.ChildContext(r);s[t.value_var]=i,t.key_var&&(s[t.key_var]=n),s.loop=u(a,o),(void 0===c||e.expression.parse.apply(l,[c,s]))&&(p.push(e.parse.apply(l,[t.output,s])),a+=1),delete s.loop,delete s[t.value_var],delete s[t.key_var],e.merge(r,s,!0)};return e.lib.is("Array",s)?(o=s.length,e.forEach(s,function(e){var t=a;f(t,e)})):e.lib.is("Object",s)&&(i=void 0!==s._keys?s._keys:Object.keys(s),o=i.length,e.forEach(i,function(e){"_keys"!==e&&f(e,s[e])})),n=0===p.length,{chain:n,output:e.output.apply(this,[p])}}},{type:e.logic.type.endfor,regex:/^endfor$/,next:[],open:!1},{type:e.logic.type.set,regex:/^set\s+([a-zA-Z0-9_,\s]+)\s*=\s*([\s\S]+)$/,next:[],open:!0,compile:function(t){var r=t.match[1].trim(),n=t.match[2],o=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack;return t.key=r,t.expression=o,delete t.match,t},parse:function(t,r,n){var o=e.expression.parse.apply(this,[t.expression,r]),i=t.key;return o===r&&(o=e.lib.copy(o)),r[i]=o,{chain:n,context:r}}},{type:e.logic.type.setcapture,regex:/^set\s+([a-zA-Z0-9_,\s]+)$/,next:[e.logic.type.endset],open:!0,compile:function(e){var t=e.match[1].trim();return e.key=t,delete e.match,e},parse:function(t,r,n){var o=e.parse.apply(this,[t.output,r]),i=t.key;return this.context[i]=o,r[i]=o,{chain:n,context:r}}},{type:e.logic.type.endset,regex:/^endset$/,next:[],open:!1},{type:e.logic.type.filter,regex:/^filter\s+(.+)$/,next:[e.logic.type.endfilter],open:!0,compile:function(t){var r="|"+t.match[1].trim();return t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack,delete t.match,t},parse:function(t,r,n){var o=e.parse.apply(this,[t.output,r]),i=[{type:e.expression.type.string,value:o}].concat(t.stack),s=e.expression.parse.apply(this,[i,r]);return{chain:n,output:s}}},{type:e.logic.type.endfilter,regex:/^endfilter$/,next:[],open:!1},{type:e.logic.type.block,regex:/^block\s+([a-zA-Z0-9_]+)$/,next:[e.logic.type.endblock],open:!0,compile:function(e){return e.block=e.match[1].trim(),delete e.match,e},parse:function(t,r,n){var o,i,s=e.indexOf(this.importedBlocks,t.block)>-1,p=this.blocks[t.block]&&e.indexOf(this.blocks[t.block],e.placeholders.parent)>-1;return(void 0===this.blocks[t.block]||s||p||r.loop||t.overwrite)&&(o=t.expression?e.expression.parse.apply(this,[{type:e.expression.type.string,value:e.expression.parse.apply(this,[t.output,r])},r]):e.expression.parse.apply(this,[{type:e.expression.type.string,value:e.parse.apply(this,[t.output,r])},r]),s&&this.importedBlocks.splice(this.importedBlocks.indexOf(t.block),1),p?this.blocks[t.block]=e.Markup(this.blocks[t.block].replace(e.placeholders.parent,o)):this.blocks[t.block]=o,this.originalBlockTokens[t.block]={type:t.type,block:t.block,output:t.output,overwrite:!0}),i=this.child.blocks[t.block]?this.child.blocks[t.block]:this.blocks[t.block],{chain:n,output:i}}},{type:e.logic.type.shortblock,regex:/^block\s+([a-zA-Z0-9_]+)\s+(.+)$/,next:[],open:!0,compile:function(t){return t.expression=t.match[2].trim(),t.output=e.expression.compile({type:e.expression.type.expression,value:t.expression}).stack,t.block=t.match[1].trim(),delete t.match,t},parse:function(t,r,n){return e.logic.handler[e.logic.type.block].parse.apply(this,arguments)}},{type:e.logic.type.endblock,regex:/^endblock(?:\s+([a-zA-Z0-9_]+))?$/,next:[],open:!1},{type:e.logic.type.extends_,regex:/^extends\s+(.+)$/,next:[],open:!0,compile:function(t){var r=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack,t},parse:function(t,r,n){var o,i=e.ChildContext(r),s=e.expression.parse.apply(this,[t.stack,r]);return this.extend=s,o=s instanceof e.Template?s:this.importFile(s),o.render(i),e.lib.extend(r,i),{chain:n,output:""}}},{type:e.logic.type.use,regex:/^use\s+(.+)$/,next:[],open:!0,compile:function(t){var r=t.match[1].trim();return delete t.match,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:r}]).stack,t},parse:function(t,r,n){var o=e.expression.parse.apply(this,[t.stack,r]);return this.importBlocks(o),{chain:n,output:""}}},{type:e.logic.type.include,regex:/^include\s+(.+?)(?:\s|$)(ignore missing(?:\s|$))?(?:with\s+([\S\s]+?))?(?:\s|$)(only)?$/,next:[],open:!0,compile:function(t){var r=t.match,n=r[1].trim(),o=void 0!==r[2],i=r[3],s=void 0!==r[4]&&r[4].length;return delete t.match,t.only=s,t.ignoreMissing=o,t.stack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:n}]).stack,void 0!==i&&(t.withStack=e.expression.compile.apply(this,[{type:e.expression.type.expression,value:i.trim()}]).stack),t},parse:function(t,r,n){var o,i,s,p={};if(t.only||(p=e.ChildContext(r)),void 0!==t.withStack){o=e.expression.parse.apply(this,[t.withStack,r]);for(i in o)o.hasOwnProperty(i)&&(p[i]=o[i])}var a=e.expression.parse.apply(this,[t.stack,r]);if(a instanceof e.Template)s=a;else try{s=this.importFile(a)}catch(e){if(t.ignoreMissing)return{chain:n,output:""};throw e}return{chain:n,output:s.render(p)}}},{type:e.logic.type.spaceless,regex:/^spaceless$/,next:[e.logic.type.endspaceless],open:!0,parse:function(t,r,n){var o=e.parse.apply(this,[t.output,r]),i=/>\s+<").trim();return s=e.Markup(s),{chain:n,output:s}}},{type:e.logic.type.endspaceless,regex:/^endspaceless$/,next:[],open:!1},{type:e.logic.type.macro,regex:/^macro\s+([a-zA-Z0-9_]+)\s*\(\s*((?:[a-zA-Z0-9_]+(?:,\s*)?)*)\s*\)$/,next:[e.logic.type.endmacro],open:!0,compile:function(t){for(var r=t.match[1],n=t.match[2].split(/[\s,]+/),o=0;o0;)e.logic.extend(e.logic.definitions.shift());return e.logic.compile=function(t){var r=t.value.trim(),n=e.logic.tokenize.apply(this,[r]),o=e.logic.handler[n.type];return o.compile&&(n=o.compile.apply(this,[n]),e.log.trace("Twig.logic.compile: ","Compiled logic token to ",n)),n},e.logic.tokenize=function(t){var r={},n=null,o=null,i=null,s=null,p=null,a=null;t=t.trim();for(n in e.logic.handler)if(e.logic.handler.hasOwnProperty(n))for(o=e.logic.handler[n].type,i=e.logic.handler[n].regex,s=[],i instanceof Array?s=i:s.push(i);s.length>0;)if(p=s.shift(),a=p.exec(t.trim()),null!==a)return r.type=o,r.match=a,e.log.trace("Twig.logic.tokenize: ","Matched a ",o," regular expression of ",a),r;throw new e.Error("Unable to parse '"+t.trim()+"'")},e.logic.parse=function(t,r,n){var o,i="";return r=r||{},e.log.debug("Twig.logic.parse: ","Parsing logic token ",t),o=e.logic.handler[t.type],o.parse&&(i=o.parse.apply(this,[t,r,n])),i},e}},function(e,t){e.exports=function(e){"use strict";e.Templates.registerParser("source",function(e){return e.data||""})}},function(e,t){e.exports=function(e){"use strict";e.Templates.registerParser("twig",function(t){return new e.Template(t)})}},function(e,t,r){e.exports=function(e){"use strict";return e.path={},e.path.parsePath=function(t,r){var n=null,r=r||"";if("object"==typeof t&&"object"==typeof t.options&&(n=t.options.namespaces),"object"==typeof n&&r.indexOf("::")>0||r.indexOf("@")>=0){for(var o in n)n.hasOwnProperty(o)&&(r=r.replace(o+"::",n[o]),r=r.replace("@"+o,n[o]));return r}return e.path.relativePath(t,r)},e.path.relativePath=function(t,n){var o,i,s,p="/",a=[],n=n||"";if(t.url)o="undefined"!=typeof t.base?t.base+("/"===t.base.charAt(t.base.length-1)?"":"/"):t.url;else if(t.path){var l=r(20),c=l.sep||p,u=new RegExp("^\\.{1,2}"+c.replace("\\","\\\\"));n=n.replace(/\//g,c),void 0!==t.base&&null==n.match(u)?(n=n.replace(t.base,""),o=t.base+c):o=l.normalize(t.path),o=o.replace(c+c,c),p=c}else{if(!t.name&&!t.id||!t.method||"fs"===t.method||"ajax"===t.method)throw new e.Error("Cannot extend an inline template.");o=t.base||t.name||t.id}for(i=o.split(p),i.pop(),i=i.concat(n.split(p));i.length>0;)s=i.shift(),"."==s||(".."==s&&a.length>0&&".."!=a[a.length-1]?a.pop():a.push(s));return a.join(p)},e}},function(e,t){e.exports=function(e){"use strict";return e.tests={empty:function(e){if(null===e||void 0===e)return!0;if("number"==typeof e)return!1;if(e.length&&e.length>0)return!1;for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},odd:function(e){return e%2===1},even:function(e){return e%2===0},divisibleby:function(e,t){return e%t[0]===0},defined:function(e){return void 0!==e},none:function(e){return null===e},null:function(e){return this.none(e)},"same as":function(e,t){return e===t[0]},sameas:function(t,r){return console.warn("`sameas` is deprecated use `same as`"),e.tests["same as"](t,r)},iterable:function(t){return t&&(e.lib.is("Array",t)||e.lib.is("Object",t))}},e.test=function(t,r,n){if(!e.tests[t])throw"Test "+t+" is not defined.";return e.tests[t](r,n)},e.test.extend=function(t,r){e.tests[t]=r},e}},function(e,t){e.exports=function(e){"use strict";return e.exports={VERSION:e.VERSION},e.exports.twig=function(t){var r=t.id,n={strict_variables:t.strict_variables||!1,autoescape:null!=t.autoescape&&t.autoescape||!1,allowInlineIncludes:t.allowInlineIncludes||!1,rethrow:t.rethrow||!1,namespaces:t.namespaces};if(e.cache&&r&&e.validateId(r),void 0!==t.debug&&(e.debug=t.debug),void 0!==t.trace&&(e.trace=t.trace),void 0!==t.data)return e.Templates.parsers.twig({data:t.data,path:t.hasOwnProperty("path")?t.path:void 0,module:t.module,id:r,options:n});if(void 0!==t.ref){if(void 0!==t.id)throw new e.Error("Both ref and id cannot be set on a twig.js template.");return e.Templates.load(t.ref)}if(void 0!==t.method){if(!e.Templates.isRegisteredLoader(t.method))throw new e.Error('Loader for "'+t.method+'" is not defined.');return e.Templates.loadRemote(t.name||t.href||t.path||r||void 0,{id:r,method:t.method,parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error)}return void 0!==t.href?e.Templates.loadRemote(t.href,{id:r,method:"ajax",parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error):void 0!==t.path?e.Templates.loadRemote(t.path,{id:r,method:"fs",parser:t.parser||"twig",base:t.base,module:t.module,precompiled:t.precompiled,async:t.async,options:n},t.load,t.error):void 0},e.exports.extendFilter=function(t,r){e.filter.extend(t,r)},e.exports.extendFunction=function(t,r){e._function.extend(t,r)},e.exports.extendTest=function(t,r){e.test.extend(t,r)},e.exports.extendTag=function(t){e.logic.extend(t)},e.exports.extend=function(t){t(e)},e.exports.compile=function(t,r){var n,o=r.filename,i=r.filename;return n=new e.Template({data:t,path:i,id:o,options:r.settings["twig options"]}),function(e){return n.render(e)}},e.exports.renderFile=function(t,r,n){"function"==typeof r&&(n=r,r={}),r=r||{};var o=r.settings||{},i={path:t,base:o.views,load:function(e){n(null,""+e.render(r))}},s=o["twig options"];if(s)for(var p in s)s.hasOwnProperty(p)&&(i[p]=s[p]);e.exports.twig(i)},e.exports.__express=e.exports.renderFile,e.exports.cache=function(t){e.cache=t},e.exports.path=e.path,e.exports.filters=e.filters,e}}])});
\ No newline at end of file
diff --git a/node_modules/walk/LICENSE b/node_modules/walk/LICENSE
deleted file mode 100644
index d804d51..0000000
--- a/node_modules/walk/LICENSE
+++ /dev/null
@@ -1,41 +0,0 @@
-Copyright 2011 AJ ONeal
-
-This is open source software; you can redistribute it and/or modify it under the
-terms of either:
-
- a) the "MIT License"
- b) the "Apache-2.0 License"
-
-MIT 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.
-
-Apache-2.0 License Summary
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/node_modules/walk/README.md b/node_modules/walk/README.md
deleted file mode 100644
index 9a1595b..0000000
--- a/node_modules/walk/README.md
+++ /dev/null
@@ -1,306 +0,0 @@
-node-walk
-====
-
-| Sponsored by [ppl](https://ppl.family)
-
-nodejs walk implementation.
-
-This is somewhat of a port python's `os.walk`, but using Node.JS conventions.
-
- * EventEmitter
- * Asynchronous
- * Chronological (optionally)
- * Built-in flow-control
- * includes Synchronous version (same API as Asynchronous)
-
-As few file descriptors are opened at a time as possible.
-This is particularly well suited for single hard disks which are not flash or solid state.
-
-Installation
-----
-
-```bash
-npm install --save walk
-```
-
-Getting Started
-====
-
-```javascript
-(function () {
- "use strict";
-
- var walk = require('walk');
- var fs = require('fs');
- var walker;
-
- walker = walk.walk("/tmp", options);
-
- walker.on("file", function (root, fileStats, next) {
- fs.readFile(fileStats.name, function () {
- // doStuff
- next();
- });
- });
-
- walker.on("errors", function (root, nodeStatsArray, next) {
- next();
- });
-
- walker.on("end", function () {
- console.log("all done");
- });
-}());
-```
-
-Common Events
------
-
-All single event callbacks are in the form of `function (root, stat, next) {}`.
-
-All multiple event callbacks callbacks are in the form of `function (root, stats, next) {}`, except **names** which is an array of strings.
-
-All **error** event callbacks are in the form `function (root, stat/stats, next) {}`.
-**`stat.error`** contains the error.
-
-* `names`
-* `directory`
-* `directories`
-* `file`
-* `files`
-* `end`
-* `nodeError` (`stat` failed)
-* `directoryError` (`stat` succedded, but `readdir` failed)
-* `errors` (a collection of any errors encountered)
-
-
-A typical `stat` event looks like this:
-
-```javascript
-{ dev: 16777223,
- mode: 33188,
- nlink: 1,
- uid: 501,
- gid: 20,
- rdev: 0,
- blksize: 4096,
- ino: 49868100,
- size: 5617,
- blocks: 16,
- atime: Mon Jan 05 2015 18:18:10 GMT-0700 (MST),
- mtime: Thu Sep 25 2014 21:21:28 GMT-0600 (MDT),
- ctime: Thu Sep 25 2014 21:21:28 GMT-0600 (MDT),
- birthtime: Thu Sep 25 2014 21:21:28 GMT-0600 (MDT),
- name: 'README.md',
- type: 'file' }
-```
-
-Advanced Example
-====
-
-Both Asynchronous and Synchronous versions are provided.
-
-```javascript
-(function () {
- "use strict";
-
- var walk = require('walk');
- var fs = require('fs');
- var options;
- var walker;
-
- options = {
- followLinks: false
- // directories with these keys will be skipped
- , filters: ["Temp", "_Temp"]
- };
-
- walker = walk.walk("/tmp", options);
-
- // OR
- // walker = walk.walkSync("/tmp", options);
-
- walker.on("names", function (root, nodeNamesArray) {
- nodeNamesArray.sort(function (a, b) {
- if (a > b) return 1;
- if (a < b) return -1;
- return 0;
- });
- });
-
- walker.on("directories", function (root, dirStatsArray, next) {
- // dirStatsArray is an array of `stat` objects with the additional attributes
- // * type
- // * error
- // * name
-
- next();
- });
-
- walker.on("file", function (root, fileStats, next) {
- fs.readFile(fileStats.name, function () {
- // doStuff
- next();
- });
- });
-
- walker.on("errors", function (root, nodeStatsArray, next) {
- next();
- });
-
- walker.on("end", function () {
- console.log("all done");
- });
-}());
-```
-
-### Sync
-
-Note: You **can't use EventEmitter** if you want truly synchronous walker
-(although it's synchronous under the hood, it appears not to be due to the use of `process.nextTick()`).
-
-Instead **you must use `options.listeners`** for truly synchronous walker.
-
-Although the sync version uses all of the `fs.readSync`, `fs.readdirSync`, and other sync methods,
-I don't think I can prevent the `process.nextTick()` that `EventEmitter` calls.
-
-```javascript
-(function () {
- "use strict";
-
- var walk = require('walk');
- var fs = require('fs');
- var options;
- var walker;
-
- // To be truly synchronous in the emitter and maintain a compatible api,
- // the listeners must be listed before the object is created
- options = {
- listeners: {
- names: function (root, nodeNamesArray) {
- nodeNamesArray.sort(function (a, b) {
- if (a > b) return 1;
- if (a < b) return -1;
- return 0;
- });
- }
- , directories: function (root, dirStatsArray, next) {
- // dirStatsArray is an array of `stat` objects with the additional attributes
- // * type
- // * error
- // * name
-
- next();
- }
- , file: function (root, fileStats, next) {
- fs.readFile(fileStats.name, function () {
- // doStuff
- next();
- });
- }
- , errors: function (root, nodeStatsArray, next) {
- next();
- }
- }
- };
-
- walker = walk.walkSync("/tmp", options);
-
- console.log("all done");
-}());
-```
-
-API
-====
-
-Emitted Values
-
- * `on('XYZ', function(root, stats, next) {})`
-
- * `root` - the containing the files to be inspected
- * *stats[Array]* - a single `stats` object or an array with some added attributes
- * type - 'file', 'directory', etc
- * error
- * name - the name of the file, dir, etc
- * next - no more files will be read until this is called
-
-Single Events - fired immediately
-
- * `end` - No files, dirs, etc left to inspect
-
- * `directoryError` - Error when `fstat` succeeded, but reading path failed (Probably due to permissions).
- * `nodeError` - Error `fstat` did not succeeded.
- * `node` - a `stats` object for a node of any type
- * `file` - includes links when `followLinks` is `true`
- * `directory` - **NOTE** you could get a recursive loop if `followLinks` and a directory links to its parent
- * `symbolicLink` - always empty when `followLinks` is `true`
- * `blockDevice`
- * `characterDevice`
- * `FIFO`
- * `socket`
-
-Events with Array Arguments - fired after all files in the dir have been `stat`ed
-
- * `names` - before any `stat` takes place. Useful for sorting and filtering.
- * Note: the array is an array of `string`s, not `stat` objects
- * Note: the `next` argument is a `noop`
-
- * `errors` - errors encountered by `fs.stat` when reading ndes in a directory
- * `nodes` - an array of `stats` of any type
- * `files`
- * `directories` - modification of this array - sorting, removing, etc - affects traversal
- * `symbolicLinks`
- * `blockDevices`
- * `characterDevices`
- * `FIFOs`
- * `sockets`
-
-**Warning** beware of infinite loops when `followLinks` is true (using `walk-recurse` varient).
-
-Comparisons
-====
-
-Tested on my `/System` containing 59,490 (+ self) directories (and lots of files).
-The size of the text output was 6mb.
-
-`find`:
- time bash -c "find /System -type d | wc"
- 59491 97935 6262916
-
- real 2m27.114s
- user 0m1.193s
- sys 0m14.859s
-
-`find.js`:
-
-Note that `find.js` omits the start directory
-
- time bash -c "node examples/find.js /System -type d | wc"
- 59490 97934 6262908
-
- # Test 1
- real 2m52.273s
- user 0m20.374s
- sys 0m27.800s
-
- # Test 2
- real 2m23.725s
- user 0m18.019s
- sys 0m23.202s
-
- # Test 3
- real 2m50.077s
- user 0m17.661s
- sys 0m24.008s
-
-In conclusion node.js asynchronous walk is much slower than regular "find".
-
-LICENSE
-===
-
-`node-walk` is available under the following licenses:
-
- * MIT
- * Apache 2
-
-Copyright 2011 - Present AJ ONeal
diff --git a/node_modules/walk/lib/node-type-emitter.js b/node_modules/walk/lib/node-type-emitter.js
deleted file mode 100644
index 59c0f58..0000000
--- a/node_modules/walk/lib/node-type-emitter.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*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(flag) {
- if (flag) {
- stats.flag = flag;
- }
- 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/walk/lib/walk-async-only.js b/node_modules/walk/lib/walk-async-only.js
deleted file mode 100644
index 41b30ca..0000000
--- a/node_modules/walk/lib/walk-async-only.js
+++ /dev/null
@@ -1,93 +0,0 @@
-(function () {
- "use strict"
-
- // Array.prototype.forEachAsync(next, item, i, collection)
- require('futures/forEachAsync');
-
- function noop() {}
-
- var fs = require('fs'),
- path = require('path'),
- 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);
- files.forEachAsync(function (cont, file) {
- emitter.emit('name', curpath, file, noop);
- fs.lstat(curpath + path.sep + 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, path.sep, v].join('');
- }
-
- curpath = pathname;
- walk();
-
- return emitter;
- }
-
- module.exports = create;
-}());
diff --git a/node_modules/walk/lib/walk.js b/node_modules/walk/lib/walk.js
deleted file mode 100644
index ee8ade5..0000000
--- a/node_modules/walk/lib/walk.js
+++ /dev/null
@@ -1,302 +0,0 @@
-// Adapted from work by jorge@jorgechamorro.com on 2010-11-25
-(function () {
- "use strict";
-
- function noop() {}
-
- var fs = require('fs')
- , forEachAsync = require('foreachasync').forEachAsync
- , EventEmitter = require('events').EventEmitter
- , TypeEmitter = require('./node-type-emitter')
- , util = require('util')
- , path = require('path')
- ;
-
- function appendToDirs(stat) {
- /*jshint validthis:true*/
- if(stat.flag && stat.flag === NO_DESCEND) { return; }
- 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
- ;
-
- options = options || {};
- me._wStat = options.followLinks && 'stat' || 'lstat';
- me._wStatSync = me._wStat + 'Sync';
- me._wsync = sync;
- me._wq = [];
- me._wqueue = [me._wq];
- me._wcurpath = undefined;
- me._wfilters = options.filters || [];
- me._wfirstrun = true;
- me._wcurpath = pathname;
-
- if (me._wsync) {
- //console.log('_walkSync');
- me._wWalk = me._wWalkSync;
- } else {
- //console.log('_walkASync');
- me._wWalk = me._wWalkAsync;
- }
-
- options.listeners = options.listeners || {};
- Object.keys(options.listeners).forEach(function (event) {
- var callbacks = options.listeners[event]
- ;
-
- if ('function' === typeof callbacks) {
- callbacks = [callbacks];
- }
-
- callbacks.forEach(function (callback) {
- me.on(event, callback);
- });
- });
-
- 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);
- // TODO v3.0 (don't noop the next if there are listeners)
- 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 + path.sep + file;
-
- if (!me._wsync) {
- // TODO how to remove this anony?
- fs[me._wStat](statPath, function (err, stat) {
- me._wLstatHandler(err, stat);
- });
- return;
- }
-
- try {
- me._wLstatHandler(null, fs[me._wStatSync](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) {
- // TODO v3.0 (don't noop the next)
- // .errors is an array of stats with { name: name, error: error }
- 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
- , parent
- , child
- ;
-
- me._wfnodegroups = fnodeGroups;
- me._wcurfiles = files;
-
- // no error, great
- if (!err) {
- me._wReadFiles();
- return;
- }
-
- // TODO path.sep
- me._wcurpath = me._wcurpath.replace(/\/$/, '');
-
- // error? not first run? => directory error
- if (!me._wfirstrun) {
- // TODO v3.0 (don't noop the next if there are listeners)
- me.emit('directoryError', me._wcurpath, { error: err }, noop);
- // TODO v3.0
- //me.emit('directoryError', me._wcurpath.replace(/^(.*)\/.*$/, '$1'), { name: me._wcurpath.replace(/^.*\/(.*)/, '$1'), error: err }, noop);
- me._wReadFiles();
- return;
- }
-
- // error? first run? => maybe a file, maybe a true error
- me._wfirstrun = false;
-
- // readdir failed (might be a file), try a stat on the parent
- parent = me._wcurpath.replace(/^(.*)\/.*$/, '$1');
- fs[me._wStat](parent, function (e, stat) {
-
- if (stat) {
- // success
- // now try stat on this as a child of the parent directory
- child = me._wcurpath.replace(/^.*\/(.*)$/, '$1');
- me._wcurfiles = [child];
- me._wcurpath = parent;
- } else {
- // TODO v3.0
- //me.emit('directoryError', me._wcurpath.replace(/^(.*)\/.*$/, '$1'), { name: me._wcurpath.replace(/^.*\/(.*)/, '$1'), error: err }, noop);
- // TODO v3.0 (don't noop the next)
- // the original readdir error, not the parent stat error
- me.emit('nodeError', me._wcurpath, { error: err }, noop);
- }
-
- me._wReadFiles();
- });
- };
- Walker.prototype._wFilter = function () {
- var me = this
- , exclude
- ;
-
- // Stop directories that contain filter keywords
- // from continuing through the walk process
- exclude = me._wfilters.some(function (filter) {
- if (me._wcurpath.match(filter)) {
- return true;
- }
- });
-
- return exclude;
- };
- Walker.prototype._wWalkSync = function () {
- //console.log('walkSync');
- var err
- , files
- , me = this
- ;
-
- try {
- files = fs.readdirSync(me._wcurpath);
- } catch(e) {
- err = e;
- }
-
- me._wReaddirHandler(err, files);
- };
- Walker.prototype._wWalkAsync = function () {
- //console.log('walkAsync');
- 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();
- while (me._wq.length && me._wFilter()) {
- me._wcurpath = me._wq.pop();
- }
- if (me._wcurpath && !me._wFilter()) {
- me._wWalk();
- } else {
- me._wNext();
- }
- return;
- }
- me._wqueue.length -= 1;
- if (me._wqueue.length) {
- me._wq = me._wqueue[me._wqueue.length - 1];
- return me._wNext();
- }
-
- // To not break compatibility
- //process.nextTick(function () {
- me.emit('end');
- //});
- };
- Walker.prototype._wJoinPath = function (v, i, o) {
- var me = this
- ;
-
- o[i] = [me._wcurpath, path.sep, 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/walk/package.json b/node_modules/walk/package.json
deleted file mode 100644
index 701d7dd..0000000
--- a/node_modules/walk/package.json
+++ /dev/null
@@ -1,68 +0,0 @@
-{
- "_from": "walk@2.3.x",
- "_id": "walk@2.3.14",
- "_inBundle": false,
- "_integrity": "sha512-5skcWAUmySj6hkBdH6B6+3ddMjVQYH5Qy9QGbPmN8kVmLteXk+yVXg+yfk1nbX30EYakahLrr8iPcCxJQSCBeg==",
- "_location": "/walk",
- "_phantomChildren": {},
- "_requested": {
- "type": "range",
- "registry": true,
- "raw": "walk@2.3.x",
- "name": "walk",
- "escapedName": "walk",
- "rawSpec": "2.3.x",
- "saveSpec": null,
- "fetchSpec": "2.3.x"
- },
- "_requiredBy": [
- "/twig"
- ],
- "_resolved": "https://registry.npmjs.org/walk/-/walk-2.3.14.tgz",
- "_shasum": "60ec8631cfd23276ae1e7363ce11d626452e1ef3",
- "_spec": "walk@2.3.x",
- "_where": "/home/marvin/IdeaProjects/untitled/node_modules/twig",
- "author": {
- "name": "AJ ONeal",
- "email": "coolaj86@gmail.com"
- },
- "bugs": {
- "url": "https://git.coolaj86.com/coolaj86/fs-walk.js/issues"
- },
- "bundleDependencies": false,
- "contributors": [],
- "dependencies": {
- "foreachasync": "^3.0.0"
- },
- "deprecated": false,
- "description": "A node port of python's os.walk",
- "devDependencies": {},
- "directories": {
- "example": "examples",
- "test": "test"
- },
- "files": [
- "lib"
- ],
- "homepage": "https://git.coolaj86.com/coolaj86/fs-walk.js",
- "keywords": [
- "util",
- "os",
- "sys",
- "fs",
- "walk",
- "walkSync"
- ],
- "lib": ".",
- "license": "(MIT OR Apache-2.0)",
- "main": "./lib/walk.js",
- "name": "walk",
- "repository": {
- "url": "https://git.coolaj86.com/coolaj86/fs-walk.js.git"
- },
- "scripts": {
- "test": "./test/walk-test.sh"
- },
- "url": "http://git.coolaj86.com/coolaj86/fs-walk.js",
- "version": "2.3.14"
-}
--
cgit v1.2.3