!functione(t,n,r){functions(o,u){if(!n[o]){if(!t[o]){vara="function"==typeofrequire&&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}for(vari="function"==typeofrequire&&require,o=0;o<r.length;o++)s(r[o]);returns}({1:[function(){},{}],2:[function(require,module,exports){(function(process){functionnormalizeArray(parts,allowAboveRoot){for(varup=0,i=parts.length-1;i>=0;i--){varlast=parts[i];"."===last?parts.splice(i,1):".."===last?(parts.splice(i,1),up++):up&&(parts.splice(i,1),up--)}if(allowAboveRoot)for(;up--;up)parts.unshift("..");returnparts}functionfilter(xs,f){if(xs.filter)returnxs.filter(f);for(varres=[],i=0;i<xs.length;i++)f(xs[i],i,xs)&&res.push(xs[i]);returnres}varsplitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,splitPath=function(filename){returnsplitPathRe.exec(filename).slice(1)};exports.resolve=function(){for(varresolvedPath="",resolvedAbsolute=!1,i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){varpath=i>=0?arguments[i]:process.cwd();if("string"!=typeofpath)thrownewTypeError("Arguments to path.resolve must be strings");path&&(resolvedPath=path+"/"+resolvedPath,resolvedAbsolute="/"===path.charAt(0))}returnresolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/"),(resolvedAbsolute?"/":"")+resolvedPath||"."},exports.normalize=function(path){varisAbsolute=exports.isAbsolute(path),trailingSlash="/"===substr(path,-1);returnpath=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/"),path||isAbsolute||(path="."),path&&trailingSlash&&(path+="/"),(isAbsolute?"/":"")+path},exports.isAbsolute=function(path){return"/"===path.charAt(0)},exports.join=function(){varpaths=Array.prototype.slice.call(arguments,0);returnexports.normalize(filter(paths,function(p){if("string"!=typeofp)thrownewTypeError("Arguments to path.join must be strings");returnp}).join("/"))},exports.relative=function(from,to){functiontrim(arr){for(varstart=0;start<arr.length&&""===arr[start];start++);for(varend=arr.length-1;end>=0&&""===arr[end];end--);returnstart>end?[]:arr.slice(start,end-start+1)}from=exports.resolve(from).substr(1),to=exports.resolve(to).substr(1);for(varfromParts=trim(from.split("/")),toParts=trim(to.split("/")),length=Math.min(fromParts.length,toParts.length),samePartsLength=length,i=0;length>i;i++)if(fromParts[i]!==toParts[i]){samePartsLength=i;break}for(varoutputParts=[],i=samePartsLength;i<fromParts.length;i++)outputParts.push("..");returnoutputParts=outputParts.concat(toParts.slice(samePartsLength)),outputParts.join("/")},exports.sep="/",exports.delimiter=":",exports.dirname=function(path){varresult=splitPath(path),root=result[0],dir=result[1];returnroot||dir?(dir&&(dir=dir.substr(0,dir.length-1)),root+dir):"."},exports.basename=function(path,ext){varf=splitPath(path)[2];returnext&&f.substr(-1*ext.length)===ext&&(f=f.substr(0,f.length-ext.length)),f},exports.extname=function(path){returnsplitPath(path)[3]};varsubstr="b"==="ab".substr(-1)?function(str,start,len){returnstr.substr(start,len)}:function(str,start,len){return0>start&&(start=str.length+start),str.substr(start,len)}}).call(this,require("_process"))},{_process:3}],3:[function(require,module){functioncleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}functiondrainQueue(){if(!draining){vartimeout=cachedSetTimeout(cleanUpNextTick);draining=!0;for(varlen=queue.length;len;){for(currentQueue=queue,queue=[];++queueIndex<len;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,len=queue.length}currentQueue=null,draining=!1,cachedClearTimeout(timeout)}}functionItem(fun,array){this.fun=fun,this.array=array}functionnoop(){}varcachedSetTimeout,cachedClearTimeout,process=module.exports={};!function(){try{
varamod=a.content.substr(1),bmod=b.content.substr(1);returnRematch.distance(amod,bmod)});SideBySidePrinter.prototype.makeDiffHtml=function(file,diffs){varfileDiffTemplate=hoganUtils.template(baseTemplatesPath,"file-diff"),filePathTemplate=hoganUtils.template(genericTemplatesPath,"file-path"),fileIconTemplate=hoganUtils.template(iconsBaseTemplatesPath,"file"),fileTagTemplate=hoganUtils.template(tagsBaseTemplatesPath,printerUtils.getFileTypeIcon(file));returnfileDiffTemplate.render({file:file,fileHtmlId:printerUtils.getHtmlId(file),diffs:diffs,filePath:filePathTemplate.render({fileDiffName:printerUtils.getDiffName(file)},{fileIcon:fileIconTemplate,fileTag:fileTagTemplate})})},SideBySidePrinter.prototype.generateSideBySideJsonHtml=function(diffFiles){varthat=this,content=diffFiles.map(function(file){vardiffs;returndiffs=file.blocks.length?that.generateSideBySideFileHtml(file):that.generateEmptyDiff(),that.makeDiffHtml(file,diffs)}).join("\n");returnhoganUtils.render(genericTemplatesPath,"wrapper",{content:content})},SideBySidePrinter.prototype.makeSideHtml=function(blockHeader){returnhoganUtils.render(genericTemplatesPath,"column-line-number",{diffParser:diffParser,blockHeader:blockHeader,lineClass:"d2h-code-side-linenumber",contentClass:"d2h-code-side-line"})},SideBySidePrinter.prototype.generateSideBySideFileHtml=function(file){varthat=this,fileHtml={};returnfileHtml.left="",fileHtml.right="",file.blocks.forEach(function(block){functionprocessChangeBlock(){varmatches,insertType,deleteType,comparisons=oldLines.length*newLines.length,maxComparisons=that.config.matchingMaxComparisons||2500,doMatching=maxComparisons>comparisons&&("lines"===that.config.matching||"words"===that.config.matching);doMatching?(matches=matcher(oldLines,newLines),insertType=diffParser.LINE_TYPE.INSERT_CHANGES,deleteType=diffParser.LINE_TYPE.DELETE_CHANGES):(matches=[[oldLines,newLines]],insertType=diffParser.LINE_TYPE.INSERTS,deleteType=diffParser.LINE_TYPE.DELETES),matches.forEach(function(match){oldLines=match[0],newLines=match[1];for(varcommon=Math.min(oldLines.length,newLines.length),max=Math.max(oldLines.length,newLines.length),j=0;common>j;j++){varoldLine=oldLines[j],newLine=newLines[j];that.config.isCombined=file.isCombined;vardiff=printerUtils.diffHighlight(oldLine.content,newLine.content,that.config);fileHtml.left+=that.generateSingleLineHtml(deleteType,oldLine.oldNumber,diff.first.line,diff.first.prefix),fileHtml.right+=that.generateSingleLineHtml(insertType,newLine.newNumber,diff.second.line,diff.second.prefix)}if(max>common){varoldSlice=oldLines.slice(common),newSlice=newLines.slice(common),tmpHtml=that.processLines(oldSlice,newSlice);fileHtml.left+=tmpHtml.left,fileHtml.right+=tmpHtml.right}}),oldLines=[],newLines=[]}fileHtml.left+=that.makeSideHtml(block.header),fileHtml.right+=that.makeSideHtml("");for(varoldLines=[],newLines=[],i=0;i<block.lines.length;i++){varline=block.lines[i],prefix=line.content[0],escapedLine=utils.escape(line.content.substr(1));line.type!==diffParser.LINE_TYPE.INSERTS&&(newLines.length>0||line.type!==diffParser.LINE_TYPE.DELETES&&oldLines.length>0)&&processChangeBlock(),line.type===diffParser.LINE_TYPE.CONTEXT?(fileHtml.left+=that.generateSingleLineHtml(line.type,line.oldNumber,escapedLine,prefix),fileHtml.right+=that.generateSingleLineHtml(line.type,line.newNumber,escapedLine,prefix)):line.type!==diffParser.LINE_TYPE.INSERTS||oldLines.length?line.type===diffParser.LINE_TYPE.DELETES?oldLines.push(line):line.type===diffParser.LINE_TYPE.INSERTS&&Boolean(oldLines.length)?newLines.push(line):(console.error("unknown state in html side-by-side generator"),processChangeBlock()):(fileHtml.left+=that.generateSingleLineHtml(diffParser.LINE_TYPE.CONTEXT,"","",""),fileHtml.right+=that.generateSingleLineHtml(line.type,line.newNumber,escapedLine,prefix))}processChangeBlock()}),fileHtml},SideBySidePrinter.prototype.processLines=function(oldLines,newLines){varthat=this,fileHtml={};fileHtml.left="",fileHtml.right="";for(varmaxLinesNumber=Math.max(oldLines.length,newLines.length),i=0;maxLinesNumber>i;i++){va