(function(){function diff_match_patch(){this.Diff_Timeout=1;this.Diff_EditCost=4;this.Match_Threshold=0.5;this.Match_Distance=1E3;this.Patch_DeleteThreshold=0.5;this.Patch_Margin=4;this.Match_MaxBits=32} diff_match_patch.prototype.diff_main=function(a,b,c,d){“undefined”==typeof d&&(d=0>=this.Diff_Timeout?Number.MAX_VALUE:(new Date).getTime()+1E3*this.Diff_Timeout);if(null==a||null==b)throw Error(“Null input. (diff_main)”);if(a==b)return a?[]:[];“undefined”==typeof c&&(c=!0);var e=c,f=this.diff_commonPrefix(a,b);c=a.substring(0,f);a=a.substring(f);b=b.substring(f);var f=this.diff_commonSuffix(a,b),g=a.substring(a.length-f);a=a.substring(0,a.length-f);b=b.substring(0,b.length-f);a=this.diff_compute_(a, b,e,d);c&&a.unshift();g&&a.push();this.diff_cleanupMerge(a);return a}; diff_match_patch.prototype.diff_compute_=function(a,b,c,d){if(!a)return[];if(!b)return[];var e=a.length>b.length?a:b,f=a.length>b.length?b:a,g=e.indexOf(f);return-1!=g?(c=[,[0,f],],a.length>b.length&&(c[0]=c[0]=-1),c):1==f.length?[,[1,b]]:(e=this.diff_halfMatch_(a,b))?(f=e,a=e,g=e,b=e,e=e,f=this.diff_main(f,g,c,d),c=this.diff_main(a,b,c,d),f.concat([],c)):c&&100<a.length&&100<b.length?this.diff_lineMode_(a,b, d):this.diff_bisect_(a,b,d)}; diff_match_patch.prototype.diff_lineMode_=function(a,b,c){var d=this.diff_linesToChars_(a,b);a=d.chars1;b=d.chars2;d=d.lineArray;a=this.diff_main(a,b,!1,c);this.diff_charsToLines_(a,d);this.diff_cleanupSemantic(a);a.push();for(var e=d=b=0,f=“”,g=“”;b<a.length;){switch(a[0]){case 1:e++;g+=a[1];break;case -1:d++;f+=a[1];break;case 0:if(1<=d&&1<=e){a.splice(b-d-e,d+e);b=b-d-e;d=this.diff_main(f,g,!1,c);for(e=d.length-1;0<=e;e--)a.splice(b,0,d);b+=d.length}d=e=0;g=f=“”}b++}a.pop();return a}; diff_match_patch.prototype.diff_bisect_=function(a,b,c){for(var d=a.length,e=b.length,f=Math.ceil((d+e)/2),g=f,h=2*f,j=Array(h),i=Array(h),k=0;k
”);switch(h){case 1:b='<ins style=“background:#e6ffe6;”>'j
“</ins>”;break;case -1:b='<del style=“background:#ffe6e6;”>'j
“</del>”;break;case 0:b=“<span>”j
“</span>”}}return b.join(“”)}; diff_match_patch.prototype.diff_text1=function(a){for(var b=[],c=0;ce
“) does not equal source text length (”a.length
“).”);return c};diff_match_patch.prototype.match_main=function(a,b,c){if(null==a||null==b||null==c)throw Error(“Null input. (match_main)”);c=Math.max(0,Math.min(c,a.length));return a==b?0:a.length?a.substring(c,c+b.length)==b?c:this.match_bitap_(a,b,c):-1}; diff_match_patch.prototype.match_bitap_=function(a,b,c){function d(a,d){var e=a/b.length,g=Math.abs(c-d);return!f.Match_Distance?g?1:e:e+g/f.Match_Distance}if(b.length>this.Match_MaxBits)throw Error(“Pattern too long for this browser.”);var e=this.match_alphabet_(b),f=this,g=this.Match_Threshold,h=a.indexOf(b,c);-1!=h&&(g=Math.min(d(0,h),g),h=a.lastIndexOf(b,c+b.length),-1!=h&&(g=Math.min(d(0,h),g)));for(var j=1<<b.length-1,h=-1,i,k,q=b.length+a.length,r,t=0;t<b.length;t++){i=0;for(k=q;i<k;)d(t,c+ k)<=g?i=k:q=k,k=Math.floor((q-i)/2+i);q=k;i=Math.max(1,c-k+1);var p=Math.min(c+k,a.length)+b.length;k=Array(p+2);for(k=(1<<t)-1;p>=i;p–){var w=e;k=0===t?(k<<1|1)&w:(k<<1|1)&w|((r|r)<<1|1)|r;if(k&j&&(w=d(t,p-1),w<=g))if(g=w,h=p-1,h>c)i=Math.max(1,2*c-h);else break}if(d(t+1,c)>g)break;r=k}return h}; diff_match_patch.prototype.match_alphabet_=function(a){for(var b={},c=0;ce
'” in: '+g);c++}}return b};diff_match_patch.patch_obj=function(){this.diffs=[];this.start2=this.start1=null;this.length2=this.length1=0}; diff_match_patch.patch_obj.prototype.toString=function(){var a,b;a=0===this.length1?this.start1+“,0”:1==this.length1?this.start1+1:this.start1+1+“,”+this.length1;b=0===this.length2?this.start2+“,0”:1==this.length2?this.start2+1:this.start2+1+“,”+this.length2;a=[“@@ -”a
“ +”b
“ @@n”];var c;for(b=0;b<this.diffs.length;b++){switch(this.diffs[0]){case 1:c=“+”;break;case -1:c=“-”;break;case 0:c=“ ”}a=c+encodeURI(this.diffs[1])+“n”}return a.join(“”).replace(/%20/g,“ ”)}; this.diff_match_patch=diff_match_patch;this.DIFF_DELETE=-1;this.DIFF_INSERT=1;this.DIFF_EQUAL=0;})()