/*! diff v2.2.2 Software License Agreement (BSD License) Copyright (c) 2009-2015, Kevin Decker All rights reserved. Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Kevin Decker nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @license */ !function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.JsDiff=b():a.JsDiff=b()}(this,function(){/******/ return function(a){/******/ // The require function /******/ function b(d){/******/ // Check if module is in cache /******/ if(c[d])/******/ return c[d].exports;/******/ // Create a new module (and put it into the cache) /******/ var e=c[d]={/******/ exports:{},/******/ id:d,/******/ loaded:!1};/******/ // Return the exports of the module /******/ /******/ // Execute the module function /******/ /******/ // Flag the module as loaded /******/ return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}// webpackBootstrap /******/ // The module cache /******/ var c={};/******/ // Load entry module and return exports /******/ /******/ // expose the modules object (__webpack_modules__) /******/ /******/ // expose the module cache /******/ /******/ // __webpack_public_path__ /******/ return b.m=a,b.c=c,b.p="",b(0)}([/* 0 */ /***/ function(a,b,c){/*istanbul ignore start*/ "use strict";/*istanbul ignore start*/ function d(a){return a&&a.__esModule?a:{"default":a}}b.__esModule=!0,b.canonicalize=b.convertChangesToXML=b.convertChangesToDMP=b.parsePatch=b.applyPatches=b.applyPatch=b.createPatch=b.createTwoFilesPatch=b.structuredPatch=b.diffJson=b.diffCss=b.diffSentences=b.diffTrimmedLines=b.diffLines=b.diffWordsWithSpace=b.diffWords=b.diffChars=b.Diff=void 0;/*istanbul ignore end*/ var/*istanbul ignore start*/e=c(1),f=d(e),/*istanbul ignore start*/g=c(2),/*istanbul ignore start*/h=c(3),/*istanbul ignore start*/i=c(5),/*istanbul ignore start*/j=c(6),/*istanbul ignore start*/k=c(7),/*istanbul ignore start*/l=c(8),/*istanbul ignore start*/m=c(9),/*istanbul ignore start*/n=c(10),/*istanbul ignore start*/o=c(12),/*istanbul ignore start*/p=c(13),/*istanbul ignore start*/q=c(14);/* See LICENSE file for terms of use */ /* * Text diff implementation. * * This library supports the following APIS: * JsDiff.diffChars: Character by character diff * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace * JsDiff.diffLines: Line based diff * * JsDiff.diffCss: Diff targeted at CSS content * * These methods are based on the implementation proposed in * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986). * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927 */ b.Diff=f["default"],/*istanbul ignore start*/ b.diffChars=g.diffChars,/*istanbul ignore start*/ b.diffWords=h.diffWords,/*istanbul ignore start*/ b.diffWordsWithSpace=h.diffWordsWithSpace,/*istanbul ignore start*/ b.diffLines=i.diffLines,/*istanbul ignore start*/ b.diffTrimmedLines=i.diffTrimmedLines,/*istanbul ignore start*/ b.diffSentences=j.diffSentences,/*istanbul ignore start*/ b.diffCss=k.diffCss,/*istanbul ignore start*/ b.diffJson=l.diffJson,/*istanbul ignore start*/ b.structuredPatch=o.structuredPatch,/*istanbul ignore start*/ b.createTwoFilesPatch=o.createTwoFilesPatch,/*istanbul ignore start*/ b.createPatch=o.createPatch,/*istanbul ignore start*/ b.applyPatch=m.applyPatch,/*istanbul ignore start*/ b.applyPatches=m.applyPatches,/*istanbul ignore start*/ b.parsePatch=n.parsePatch,/*istanbul ignore start*/ b.convertChangesToDMP=p.convertChangesToDMP,/*istanbul ignore start*/ b.convertChangesToXML=q.convertChangesToXML,/*istanbul ignore start*/ b.canonicalize=l.canonicalize},/* 1 */ /***/ function(a,b){/*istanbul ignore start*/ "use strict";function c(){}function d(a,b,c,d,e){for(var f=0,g=b.length,h=0,i=0;g>f;f++){var j=b[f];if(j.removed){ // Reverse add and remove so removes are output first to match common convention // The diffing algorithm is tied to add then remove output and this is the simplest // route to get the desired output with minimal overhead. if(j.value=d.slice(i,i+j.count).join(""),i+=j.count,f&&b[f-1].added){var k=b[f-1];b[f-1]=b[f],b[f]=k}}else{if(!j.added&&e){var l=c.slice(h,h+j.count);l=l.map(function(a,b){var c=d[i+b];return c.length>a.length?c:a}),j.value=l.join("")}else j.value=c.slice(h,h+j.count).join("");h+=j.count, // Common case j.added||(i+=j.count)}} // Special case handle for when one terminal is ignored. For this case we merge the // terminal into the prior string and drop the change. var m=b[g-1];return g>1&&(m.added||m.removed)&&a.equals("",m.value)&&(b[g-2].value+=m.value,b.pop()),b}function e(a){return{newPos:a.newPos,components:a.components.slice(0)}}b.__esModule=!0,b["default"]=/*istanbul ignore end*/c,c.prototype={/*istanbul ignore start*/ /*istanbul ignore end*/ diff:function(a,b){function c(a){return h?(setTimeout(function(){h(void 0,a)},0),!0):a} // Main worker method. checks all permutations of a given edit length for acceptance. function f(){for(var f=-1*l;l>=f;f+=2){var g=void 0,h=n[f-1],m=n[f+1],o=(m?m.newPos:0)-f;h&&( // No one else is going to attempt to use this value, clear it n[f-1]=void 0);var p=h&&h.newPos+1=0&&k>o;if(p||q){ // If we have hit the end of both strings, then we are done if( // Select the diagonal that we want to branch from. We select the prior // path whose position in the new string is the farthest from the origin // and does not pass the bounds of the diff graph !p||q&&h.newPos=j&&o+1>=k)return c(d(i,g.components,b,a,i.useLongestToken)); // Otherwise track this path as a potential candidate and continue. n[f]=g}else // If this path is a terminal then prune n[f]=void 0}l++}/*istanbul ignore start*/ var/*istanbul ignore end*/g=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],h=g.callback;"function"==typeof g&&(h=g,g={}),this.options=g;var i=this;a=this.castInput(a),b=this.castInput(b),a=this.removeEmpty(this.tokenize(a)),b=this.removeEmpty(this.tokenize(b));var j=b.length,k=a.length,l=1,m=j+k,n=[{newPos:-1,components:[]}],o=this.extractCommon(n[0],b,a,0);if(n[0].newPos+1>=j&&o+1>=k) // Identity per the equality and tokenizer return c([{value:b.join(""),count:b.length}]); // Performs the length of edit iteration. Is a bit fugly as this has to support the // sync and async mode which is never fun. Loops over execEditLength until a value // is produced. if(h)!function q(){setTimeout(function(){ // This should not happen, but we want to be safe. /* istanbul ignore next */ // This should not happen, but we want to be safe. /* istanbul ignore next */ return l>m?h():void(f()||q())},0)}();else for(;m>=l;){var p=f();if(p)return p}},/*istanbul ignore start*/ /*istanbul ignore end*/ pushComponent:function(a,b,c){var d=a[a.length-1];d&&d.added===b&&d.removed===c? // We need to clone here as the component clone operation is just // as shallow array clone a[a.length-1]={count:d.count+1,added:b,removed:c}:a.push({count:1,added:b,removed:c})},/*istanbul ignore start*/ /*istanbul ignore end*/ extractCommon:function(a,b,c,d){for(var e=b.length,f=c.length,g=a.newPos,h=g-d,i=0;e>g+1&&f>h+1&&this.equals(b[g+1],c[h+1]);)g++,h++,i++;return i&&a.components.push({count:i}),a.newPos=g,h},/*istanbul ignore start*/ /*istanbul ignore end*/ equals:function(a,b){return a===b},/*istanbul ignore start*/ /*istanbul ignore end*/ removeEmpty:function(a){for(var b=[],c=0;ck))return!1;b++}}return!0}/*istanbul ignore start*/ var/*istanbul ignore end*/d=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if("string"==typeof b&&(b=/*istanbul ignore start*/(0,g.parsePatch)(b)),Array.isArray(b)){if(b.length>1)throw new Error("applyPatch only works with a single input.");b=b[0]} // Search best fit offsets for each hunk based on the previous ones for(var e=a.split("\n"),f=b.hunks,h=d.compareLine||function(a,b,c,d){/*istanbul ignore end*/ return b===d},j=0,k=d.fuzzFactor||0,l=0,m=0,n=void 0,o=void 0,p=0;p=a+g)return g;f=!0} // Check if trying to fit before text beginning, and if not, check it fits // before offset location return e?void 0:(f||(d=!0),a-g>=b?-g++:(e=!0,h()))}}},/* 12 */ /***/ function(a,b,c){/*istanbul ignore start*/ "use strict";/*istanbul ignore start*/ function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b0?j(h.lines.slice(-i.context)):[],m-=o.length,n-=o.length)} // Output our changes /*istanbul ignore start*/ (g=/*istanbul ignore end*/o).push.apply(/*istanbul ignore start*/g,/*istanbul ignore start*/d(/*istanbul ignore end*/f.map(function(a){return(b.added?"+":"-")+a}))), // Track the updated file position b.added?q+=f.length:p+=f.length}else{ // Identical context lines. Track line changes if(m) // Close out any changes that have been output (or join overlapping) if(f.length<=2*i.context&&a=k.length-2&&f.length<=i.context){ // EOF is inside this hunk var v=/\n$/.test(c),w=/\n$/.test(e);0!=f.length||v?v&&w||o.push("\\ No newline at end of file"): // special case: old has no eol and no trailing context; no-nl can end up before adds o.splice(u.oldLines,0,"\\ No newline at end of file")}l.push(u),m=0,n=0,o=[]}p+=f.length,q+=f.length}},s=0;s"):e.removed&&b.push(""),b.push(d(e.value)),e.added?b.push(""):e.removed&&b.push("")}return b.join("")}function d(a){var b=a;return b=b.replace(/&/g,"&"),b=b.replace(//g,">"),b=b.replace(/"/g,""")}b.__esModule=!0,b.convertChangesToXML=c}])});