admin08077/Githubgemini
0
1function A(){}A.prototype={diff:function(e,t){var r,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=u.callback;typeof u=="function"&&(o=u,u={}),this.options=u;var i=this;function s(l){return o?(setTimeout(function(){o(void 0,l)},0),!0):l}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var f=t.length,c=e.length,p=1,a=f+c;u.maxEditLength&&(a=Math.min(a,u.maxEditLength));var v=(r=u.timeout)!==null&&r!==void 0?r:1/0,y=Date.now()+v,d=[{oldPos:-1,lastComponent:void 0}],g=this.extractCommon(d[0],t,e,0);if(d[0].oldPos+1>=c&&g+1>=f)return s([{value:this.join(t),count:t.length}]);var w=-1/0,C=1/0;function L(){for(var l=Math.max(w,-p);l<=Math.min(C,p);l+=2){var m=void 0,x=d[l-1],T=d[l+1];x&&(d[l-1]=void 0);var D=!1;if(T){var I=T.oldPos-l;D=T&&0<=I&&I<f}var E=x&&x.oldPos+1<c;if(!D&&!E){d[l]=void 0;continue}if(!E||D&&x.oldPos+1<T.oldPos?m=i.addToPath(T,!0,void 0,0):m=i.addToPath(x,void 0,!0,1),g=i.extractCommon(m,t,e,l),m.oldPos+1>=c&&g+1>=f)return s(U(i,m.lastComponent,t,e,i.useLongestToken));d[l]=m,m.oldPos+1>=c&&(C=Math.min(C,l-1)),g+1>=f&&(w=Math.max(w,l+1))}p++}if(o)(function l(){setTimeout(function(){if(p>a||Date.now()>y)return o();L()||l()},0)})();else for(;p<=a&&Date.now()<=y;){var h=L();if(h)return h}},addToPath:function(e,t,r,u){var o=e.lastComponent;return o&&o.added===t&&o.removed===r?{oldPos:e.oldPos+u,lastComponent:{count:o.count+1,added:t,removed:r,previousComponent:o.previousComponent}}:{oldPos:e.oldPos+u,lastComponent:{count:1,added:t,removed:r,previousComponent:o}}},extractCommon:function(e,t,r,u){for(var o=t.length,i=r.length,s=e.oldPos,f=s-u,c=0;f+1<o&&s+1<i&&this.equals(t[f+1],r[s+1]);)f++,s++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=s,f},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],r=0;r<e.length;r++)e[r]&&t.push(e[r]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}};function U(n,e,t,r,u){for(var o=[],i;e;)o.push(e),i=e.previousComponent,delete e.previousComponent,e=i;o.reverse();for(var s=0,f=o.length,c=0,p=0;s<f;s++){var a=o[s];if(a.removed){if(a.value=n.join(r.slice(p,p+a.count)),p+=a.count,s&&o[s-1].added){var y=o[s-1];o[s-1]=o[s],o[s]=y}}else{if(!a.added&&u){var v=t.slice(c,c+a.count);v=v.map(function(g,w){var C=r[p+w];return C.length>g.length?C:g}),a.value=n.join(v)}else a.value=n.join(t.slice(c,c+a.count));c+=a.count,a.added||(p+=a.count)}}var d=o[f-1];return f>1&&typeof d.value=="string"&&(d.added||d.removed)&&n.equals("",d.value)&&(o[f-2].value+=d.value,o.pop()),o}var b=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,J=/\S/,R=new A;R.equals=function(n,e){return this.options.ignoreCase&&(n=n.toLowerCase(),e=e.toLowerCase()),n===e||this.options.ignoreWhitespace&&!J.test(n)&&!J.test(e)};R.tokenize=function(n){for(var e=n.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),t=0;t<e.length-1;t++)!e[t+1]&&e[t+2]&&b.test(e[t])&&b.test(e[t+2])&&(e[t]+=e[t+2],e.splice(t+1,2),t--);return e};var H=new A;H.tokenize=function(n){this.options.stripTrailingCr&&(n=n.replace(/\r\n/g,`2`));var e=[],t=n.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var r=0;r<t.length;r++){var u=t[r];r%2&&!this.options.newlineIsToken?e[e.length-1]+=u:(this.options.ignoreWhitespace&&(u=u.trim()),e.push(u))}return e};function Z(n,e,t){return H.diff(n,e,t)}var G=new A;G.tokenize=function(n){return n.split(/(\S.+?[.!?])(?=\s+|$)/)};var Q=new A;Q.tokenize=function(n){return n.split(/([{}:;,]|\s+)/)};function $(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$=function(e){return typeof e}:$=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$(n)}function F(n){return X(n)||Y(n)||j(n)||B()}function X(n){if(Array.isArray(n))return N(n)}function Y(n){if(typeof Symbol<"u"&&Symbol.iterator in Object(n))return Array.from(n)}function j(n,e){if(n){if(typeof n=="string")return N(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return N(n,e)}}function N(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function B(){throw new TypeError(`Invalid attempt to spread non-iterable instance.3In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var K=Object.prototype.toString,z=new A;z.useLongestToken=!0;z.tokenize=H.tokenize;z.castInput=function(n){var e=this.options,t=e.undefinedReplacement,r=e.stringifyReplacer,u=r===void 0?function(o,i){return typeof i>"u"?t:i}:r;return typeof n=="string"?n:JSON.stringify(O(n,null,null,u),u," ")};z.equals=function(n,e){return A.prototype.equals.call(z,n.replace(/,([\r\n])/g,"$1"),e.replace(/,([\r\n])/g,"$1"))};function O(n,e,t,r,u){e=e||[],t=t||[],r&&(n=r(u,n));var o;for(o=0;o<e.length;o+=1)if(e[o]===n)return t[o];var i;if(K.call(n)==="[object Array]"){for(e.push(n),i=new Array(n.length),t.push(i),o=0;o<n.length;o+=1)i[o]=O(n[o],e,t,r,u);return e.pop(),t.pop(),i}if(n&&n.toJSON&&(n=n.toJSON()),$(n)==="object"&&n!==null){e.push(n),i={},t.push(i);var s=[],f;for(f in n)n.hasOwnProperty(f)&&s.push(f);for(s.sort(),o=0;o<s.length;o+=1)f=s[o],i[f]=O(n[f],e,t,r,f);e.pop(),t.pop()}else i=n;return i}var q=new A;q.tokenize=function(n){return n.slice()};q.join=q.removeEmpty=function(n){return n};function S(n,e,t,r,u,o,i){i||(i={}),typeof i.context>"u"&&(i.context=4);var s=Z(t,r,i);if(!s)return;s.push({value:"",lines:[]});function f(C){return C.map(function(L){return" "+L})}for(var c=[],p=0,a=0,v=[],y=1,d=1,g=function(L){var h=s[L],l=h.lines||h.value.replace(/\n$/,"").split(`4`);if(h.lines=l,h.added||h.removed){var m;if(!p){var x=s[L-1];p=y,a=d,x&&(v=i.context>0?f(x.lines.slice(-i.context)):[],p-=v.length,a-=v.length)}(m=v).push.apply(m,F(l.map(function(P){return(h.added?"+":"-")+P}))),h.added?d+=l.length:y+=l.length}else{if(p)if(l.length<=i.context*2&&L<s.length-2){var T;(T=v).push.apply(T,F(f(l)))}else{var D,I=Math.min(l.length,i.context);(D=v).push.apply(D,F(f(l.slice(0,I))));var E={oldStart:p,oldLines:y-p+I,newStart:a,newLines:d-a+I,lines:v};if(L>=s.length-2&&l.length<=i.context){var M=/\n$/.test(t),V=/\n$/.test(r),W=l.length==0&&v.length>E.oldLines;!M&&W&&t.length>0&&v.splice(E.oldLines,0,"\\ No newline at end of file"),(!M&&!W||!V)&&v.push("\\ No newline at end of file")}c.push(E),p=0,a=0,v=[]}y+=l.length,d+=l.length}},w=0;w<s.length;w++)g(w);return{oldFileName:n,newFileName:e,oldHeader:u,newHeader:o,hunks:c}}function _(n){if(Array.isArray(n))return n.map(_).join(`5`);var e=[];n.oldFileName==n.newFileName&&e.push("Index: "+n.oldFileName),e.push("==================================================================="),e.push("--- "+n.oldFileName+(typeof n.oldHeader>"u"?"":" "+n.oldHeader)),e.push("+++ "+n.newFileName+(typeof n.newHeader>"u"?"":" "+n.newHeader));for(var t=0;t<n.hunks.length;t++){var r=n.hunks[t];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),e.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@"),e.push.apply(e,r.lines)}return e.join(`6`)+`7`}function k(n,e,t,r,u,o,i){return _(S(n,e,t,r,u,o,i))}function ee(n,e,t,r,u,o){return k(n,n,e,t,r,u,o)}export{ee as c,Z as d};8//# sourceMappingURL=diff-CqM5-8zX.js.map9 