(function(f){if(typeofexports==="object"&&typeofmodule!=="undefined"){module.exports=f()}elseif(typeofdefine==="function"&&define.amd){define([],f)}else{varg;if(typeofwindow!=="undefined"){g=window}elseif(typeofglobal!=="undefined"){g=global}elseif(typeofself!=="undefined"){g=self}else{g=this}g.ejs=f()}})(function(){vardefine,module,exports;returnfunctione(t,n,r){functions(o,u){if(!n[o]){if(!t[o]){vara=typeofrequire=="function"&&require;if(!u&&a)returna(o,!0);if(i)returni(o,!0);varf=newError("Cannot find module '"+o+"'");throwf.code="MODULE_NOT_FOUND",f}varl=n[o]={exports:{}};t[o][0].call(l.exports,function(e){varn=t[o][1][e];returns(n?n:e)},l,l.exports,e,t,n,r)}returnn[o].exports}vari=typeofrequire=="function"&&require;for(varo=0;o<r.length;o++)s(r[o]);returns}({1:[function(require,module,exports){"use strict";varfs=require("fs");varpath=require("path");varutils=require("./utils");varscopeOptionWarned=false;var_VERSION_STRING=require("../package.json").version;var_DEFAULT_DELIMITER="%";var_DEFAULT_LOCALS_NAME="locals";var_NAME="ejs";var_REGEX_STRING="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";var_OPTS=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename"];var_OPTS_EXPRESS=_OPTS.concat("cache");var_BOM=/^\uFEFF/;exports.cache=utils.cache;exports.fileLoader=fs.readFileSync;exports.localsName=_DEFAULT_LOCALS_NAME;exports.resolveInclude=function(name,filename,isDir){vardirname=path.dirname;varextname=path.extname;varresolve=path.resolve;varincludePath=resolve(isDir?filename:dirname(filename),name);varext=extname(name);if(!ext){includePath+=".ejs"}returnincludePath};functiongetIncludePath(path,options){varincludePath;if(path.charAt(0)=="/"){includePath=exports.resolveInclude(path.replace(/^\/*/,""),options.root||"/",true)}else{if(!options.filename){thrownewError("`include` use relative path requires the 'filename' option.")}includePath=exports.resolveInclude(path,options.filename)}returnincludePath}functionhandleCache(options,template){varfunc;varfilename=options.filename;varhasTemplate=arguments.length>1;if(options.cache){if(!filename){thrownewError("cache option requires a filename")}func=exports.cache.get(filename);if(func){returnfunc}if(!hasTemplate){template=fileLoader(filename).toString().replace(_BOM,"")}}elseif(!hasTemplate){if(!filename){thrownewError("Internal EJS error: no file name or template "+"provided")}template=fileLoader(filename).toString().replace(_BOM,"")}func=exports.compile(template,options);if(options.cache){exports.cache.set(filename,func)}returnfunc}functiontryHandleCache(options,data,cb){varresult;try{result=handleCache(options)(data)}catch(err){returncb(err)}returncb(null,result)}functionfileLoader(filePath){returnexports.fileLoader(filePath)}functionincludeFile(path,options){varopts=utils.shallowCopy({},options);opts.filename=getIncludePath(path,opts);returnhandleCache(opts)}functionincludeSource(path,options){varopts=utils.shallowCopy({},options);varincludePath;vartemplate;includePath=getIncludePath(path,opts);template=fileLoader(includePath).toString().replace(_BOM,"");opts.filename=includePath;vartempl=newTemplate(template,opts);templ.generateSource();return{source:templ.source,filename:includePath,template:template}}functionrethrow(err,str,flnm,lineno,esc){varlines=str.split("\n");varstart=Math.max(lineno-3,0);varend=Math.min(lines.length,lineno+3);varfilename=esc(flnm);varcontext=lines.slice(start,end).map(function(line,i){varcurr=i+start+1;return(curr==lineno?" >> ":" ")+curr+"| "+line}).join("\n");err.path=filename;err.message=(filename||"ejs")+":"+lineno+"\n"+context+"\n\n"+err.message;throwerr}functionstripSemi(str){returnstr.replace(/;(\s*$)/,"$1")}exports.compile=functioncompile(template,opts){vartempl;if(opts&&opts.scope){if(!scopeOptionWarned){console.warn("`scope` option is deprecated and will be removed in EJS 3");scopeOptionWarned=true}if(!opts.context){opts.context=opts.scope}deleteopts.scope}templ=newTemplate(template,opts);returntemp