UNPKG

ace-builds

Version:
1 lines 93 kB
ace.define("ace/ext/diff/scroll_diff_decorator",["require","exports","module","ace/layer/decorators"],function(e,t,n){var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=this&&this.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=e("../../layer/decorators").Decorator,o=function(e){function t(t,n,r){var i=e.call(this,t,n)||this;return i.colors.dark["delete"]="rgba(255, 18, 18, 1)",i.colors.dark.insert="rgba(18, 136, 18, 1)",i.colors.light["delete"]="rgb(255,51,51)",i.colors.light.insert="rgb(32,133,72)",i.$zones=[],i.$forInlineDiff=r,i}return r(t,e),t.prototype.addZone=function(e,t,n){this.$zones.push({startRow:e,endRow:t,type:n})},t.prototype.setSessions=function(e,t){this.sessionA=e,this.sessionB=t},t.prototype.$updateDecorators=function(t){if(typeof this.canvas.getContext!="function")return;e.prototype.$updateDecorators.call(this,t);if(this.$zones.length>0){var n=this.renderer.theme.isDark===!0?this.colors.dark:this.colors.light,r=this.canvas.getContext("2d");this.$setDiffDecorators(r,n)}},t.prototype.$transformPosition=function(e,t){return t=="delete"?this.sessionA.documentToScreenRow(e,0):this.sessionB.documentToScreenRow(e,0)},t.prototype.$setDiffDecorators=function(e,t){function o(e,t){return e.from===t.from?e.to-t.to:e.from-t.from}var n,r,s=this,u=this.$zones;if(u){var a=[],f=u.filter(function(e){return e.type==="delete"}),l=u.filter(function(e){return e.type==="insert"});[f,l].forEach(function(e){e.forEach(function(e,n){var r=s.$transformPosition(e.startRow,e.type)*s.lineHeight,i=s.$transformPosition(e.endRow,e.type)*s.lineHeight+s.lineHeight,o=Math.round(s.heightRatio*r),u=Math.round(s.heightRatio*i),f=1,l=Math.round((o+u)/2),c=u-l;c<s.halfMinDecorationHeight&&(c=s.halfMinDecorationHeight);var h=a[a.length-1];n>0&&h&&h.type===e.type&&l-c<h.to+f&&(l=a[a.length-1].to+f+c),l-c<0&&(l=c),l+c>s.canvasHeight&&(l=s.canvasHeight-c),a.push({type:e.type,from:l-c,to:l+c,color:t[e.type]||null})})}),a=a.sort(o);try{for(var c=i(a),h=c.next();!h.done;h=c.next()){var p=h.value;e.fillStyle=p.color||null;var d=p.from,v=p.to,m=v-d;this.$forInlineDiff?e.fillRect(this.oneZoneWidth,d,2*this.oneZoneWidth,m):p.type=="delete"?e.fillRect(this.oneZoneWidth,d,this.oneZoneWidth,m):e.fillRect(2*this.oneZoneWidth,d,this.oneZoneWidth,m)}}catch(g){n={error:g}}finally{try{h&&!h.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}}},t.prototype.setZoneWidth=function(){this.oneZoneWidth=Math.round(this.canvasWidth/3)},t}(s);t.ScrollDiffDecorator=o}),ace.define("ace/ext/diff/styles-css.js",["require","exports","module"],function(e,t,n){t.cssText='\n/*\n * Line Markers\n */\n.ace_diff {\n position: absolute;\n z-index: 0;\n}\n.ace_diff.inline {\n z-index: 20;\n}\n/*\n * Light Colors \n */\n.ace_diff.insert {\n background-color: #EFFFF1;\n}\n.ace_diff.delete {\n background-color: #FFF1F1;\n}\n.ace_diff.aligned_diff {\n background: rgba(206, 194, 191, 0.26);\n background: repeating-linear-gradient(\n 45deg,\n rgba(122, 111, 108, 0.26),\n rgba(122, 111, 108, 0.26) 5px,\n rgba(0, 0, 0, 0) 5px,\n rgba(0, 0, 0, 0) 10px \n );\n}\n\n.ace_diff.insert.inline {\n background-color: rgb(74 251 74 / 18%); \n}\n.ace_diff.delete.inline {\n background-color: rgb(251 74 74 / 15%);\n}\n\n.ace_diff.delete.inline.empty {\n background-color: rgba(255, 128, 79, 0.7);\n width: 2px !important;\n}\n\n.ace_diff.insert.inline.empty {\n background-color: rgba(49, 230, 96, 0.7);\n width: 2px !important;\n}\n\n.ace_diff-active-line {\n border-bottom: 1px solid;\n border-top: 1px solid;\n background: transparent;\n position: absolute;\n box-sizing: border-box;\n border-color: #9191ac;\n}\n\n.ace_dark .ace_diff-active-line {\n background: transparent;\n border-color: #75777a;\n}\n \n\n/* gutter changes */\n.ace_mini-diff_gutter-enabled > .ace_gutter-cell,\n.ace_mini-diff_gutter-enabled > .ace_gutter-cell_svg-icons {\n padding-right: 13px;\n}\n\n.ace_mini-diff_gutter_other > .ace_gutter-cell,\n.ace_mini-diff_gutter_other > .ace_gutter-cell_svg-icons {\n display: none;\n}\n\n.ace_mini-diff_gutter_other {\n pointer-events: none;\n}\n\n\n.ace_mini-diff_gutter-enabled > .mini-diff-added {\n background-color: #EFFFF1;\n border-left: 3px solid #2BB534;\n padding-left: 16px;\n display: block;\n}\n\n.ace_mini-diff_gutter-enabled > .mini-diff-deleted {\n background-color: #FFF1F1;\n border-left: 3px solid #EA7158;\n padding-left: 16px;\n display: block;\n}\n\n\n.ace_mini-diff_gutter-enabled > .mini-diff-added:after {\n position: absolute;\n right: 2px;\n content: "+";\n color: darkgray;\n background-color: inherit;\n}\n\n.ace_mini-diff_gutter-enabled > .mini-diff-deleted:after {\n position: absolute;\n right: 2px;\n content: "-";\n color: darkgray;\n background-color: inherit;\n}\n.ace_fade-fold-widgets:hover > .ace_folding-enabled > .mini-diff-added:after,\n.ace_fade-fold-widgets:hover > .ace_folding-enabled > .mini-diff-deleted:after {\n display: none;\n}\n\n.ace_diff_other .ace_selection {\n filter: drop-shadow(1px 2px 3px darkgray);\n}\n\n.ace_hidden_marker-layer .ace_bracket {\n display: none;\n}\n\n\n\n/*\n * Dark Colors \n */\n\n.ace_dark .ace_diff.insert {\n background-color: #212E25;\n}\n.ace_dark .ace_diff.delete {\n background-color: #3F2222;\n}\n\n.ace_dark .ace_mini-diff_gutter-enabled > .mini-diff-added {\n background-color: #212E25;\n border-left-color:#00802F;\n}\n\n.ace_dark .ace_mini-diff_gutter-enabled > .mini-diff-deleted {\n background-color: #3F2222;\n border-left-color: #9C3838;\n}\n\n'}),ace.define("ace/ext/diff/gutter_decorator",["require","exports","module","ace/lib/dom"],function(e,t,n){var r=e("../../lib/dom"),i=function(){function e(e,t){this.gutterClass="ace_mini-diff_gutter-enabled",this.gutterCellsClasses={add:"mini-diff-added","delete":"mini-diff-deleted"},this.editor=e,this.type=t,this.chunks=[],this.attachToEditor()}return e.prototype.attachToEditor=function(){this.renderGutters=this.renderGutters.bind(this),r.addCssClass(this.editor.renderer.$gutterLayer.element,this.gutterClass),this.editor.renderer.$gutterLayer.on("afterRender",this.renderGutters)},e.prototype.renderGutters=function(e,t){var n=this,r=this.editor.renderer.$gutterLayer.$lines.cells;r.forEach(function(e){e.element.classList.remove(Object.values(n.gutterCellsClasses))});var i=this.type===-1?"old":"new",s=this.type===-1?this.gutterCellsClasses.delete:this.gutterCellsClasses.add;this.chunks.forEach(function(e){var t=e[i].start.row,n=e[i].end.row-1;r.forEach(function(e){e.row>=t&&e.row<=n&&e.element.classList.add(s)})})},e.prototype.setDecorations=function(e){this.chunks=e,this.renderGutters()},e.prototype.dispose=function(){r.removeCssClass(this.editor.renderer.$gutterLayer.element,this.gutterClass),this.editor.renderer.$gutterLayer.off("afterRender",this.renderGutters)},e}();t.MinimalGutterDiffDecorator=i}),ace.define("ace/ext/diff/base_diff_view",["require","exports","module","ace/lib/oop","ace/range","ace/lib/dom","ace/config","ace/line_widgets","ace/ext/diff/scroll_diff_decorator","ace/ext/diff/styles-css.js","ace/editor","ace/virtual_renderer","ace/undomanager","ace/layer/decorators","ace/theme/textmate","ace/multi_select","ace/edit_session","ace/ext/diff/gutter_decorator"],function(e,t,n){"use strict";var r=this&&this.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],o;try{while((t===void 0||t-->0)&&!(i=r.next()).done)s.push(i.value)}catch(u){o={error:u}}finally{try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(o)throw o.error}}return s},i=e("../../lib/oop"),s=e("../../range").Range,o=e("../../lib/dom"),u=e("../../config"),a=e("../../line_widgets").LineWidgets,f=e("./scroll_diff_decorator").ScrollDiffDecorator,l=e("./styles-css.js").cssText,c=e("../../editor").Editor,h=e("../../virtual_renderer").VirtualRenderer,p=e("../../undomanager").UndoManager,d=e("../../layer/decorators").Decorator;e("../../theme/textmate"),e("../../multi_select");var v=e("../../edit_session").EditSession,m=e("./gutter_decorator").MinimalGutterDiffDecorator,g={compute:function(e,t,n){return[]}},y=function(){function e(e,t){this.onChangeTheme=this.onChangeTheme.bind(this),this.onInput=this.onInput.bind(this),this.onChangeFold=this.onChangeFold.bind(this),this.realign=this.realign.bind(this),this.onSelect=this.onSelect.bind(this),this.onChangeWrapLimit=this.onChangeWrapLimit.bind(this),this.realignPending=!1,this.diffSession,this.chunks,this.inlineDiffEditor=e||!1,this.currentDiffIndex=0,this.diffProvider=g,t&&(this.container=t),o.importCssString(l,"diffview.css"),this.$ignoreTrimWhitespace=!1,this.$maxDiffs=5e3,this.$maxComputationTimeMs=150,this.$syncSelections=!1,this.$foldUnchangedOnInput=!1,this.markerB=new E(this,1),this.markerA=new E(this,-1)}return e.prototype.$setupModels=function(e){e.diffProvider&&this.setProvider(e.diffProvider),this.showSideA=e.inline==undefined?!0:e.inline==="a";var t={scrollPastEnd:.5,highlightActiveLine:!1,highlightGutterLine:!1,animatedScroll:!0,customScrollbar:!0,vScrollBarAlwaysVisible:!0,fadeFoldWidgets:!0,showFoldWidgets:!0,selectionStyle:"text"};this.savedOptionsA=e.editorA&&e.editorA.getOptions(t),this.savedOptionsB=e.editorB&&e.editorB.getOptions(t);if(!this.inlineDiffEditor||e.inline==="a")this.editorA=e.editorA||this.$setupModel(e.sessionA,e.valueA),this.container&&this.container.appendChild(this.editorA.container),this.editorA.setOptions(t);if(!this.inlineDiffEditor||e.inline==="b")this.editorB=e.editorB||this.$setupModel(e.sessionB,e.valueB),this.container&&this.container.appendChild(this.editorB.container),this.editorB.setOptions(t);if(this.inlineDiffEditor){this.activeEditor=this.showSideA?this.editorA:this.editorB,this.otherSession=this.showSideA?this.sessionB:this.sessionA;var n=this.activeEditor.getOptions();n.readOnly=!0,delete n.mode,this.otherEditor=new c(new h(null),undefined,n),this.showSideA?this.editorB=this.otherEditor:this.editorA=this.otherEditor}this.setDiffSession({sessionA:e.sessionA||(e.editorA?e.editorA.session:new v(e.valueA||"")),sessionB:e.sessionB||(e.editorB?e.editorB.session:new v(e.valueB||"")),chunks:[]}),this.setupScrollbars()},e.prototype.addGutterDecorators=function(){this.gutterDecoratorA||(this.gutterDecoratorA=new m(this.editorA,-1)),this.gutterDecoratorB||(this.gutterDecoratorB=new m(this.editorB,1))},e.prototype.$setupModel=function(e,t){var n=new c(new h,e);return n.session.setUndoManager(new p),t!=undefined&&n.setValue(t,-1),n},e.prototype.foldUnchanged=function(){var e=this.chunks,t="-".repeat(120),n={old:new s(0,0,0,0),"new":new s(0,0,0,0)},r=!1;for(var i=0;i<e.length+1;i++){var o=e[i]||{old:new s(this.sessionA.getLength(),0,this.sessionA.getLength(),0),"new":new s(this.sessionB.getLength(),0,this.sessionB.getLength(),0)},u=o.new.start.row-n.new.end.row-5;if(u>2){var a=n.old.end.row+2,f=this.sessionA.addFold(t,new s(a,0,a+u,Number.MAX_VALUE));a=n.new.end.row+2;var l=this.sessionB.addFold(t,new s(a,0,a+u,Number.MAX_VALUE));if(f||l)r=!0;l&&f&&(f.other=l,l.other=f)}n=o}return r},e.prototype.unfoldUnchanged=function(){var e=this.sessionA.getAllFolds();for(var t=e.length-1;t>=0;t--){var n=e[t];n.placeholder.length==120&&this.sessionA.removeFold(n)}},e.prototype.toggleFoldUnchanged=function(){this.foldUnchanged()||this.unfoldUnchanged()},e.prototype.setDiffSession=function(e){this.diffSession&&(this.$detachSessionsEventHandlers(),this.clearSelectionMarkers()),this.diffSession=e,this.sessionA=this.sessionB=null,this.diffSession&&(this.chunks=this.diffSession.chunks||[],this.editorA&&this.editorA.setSession(e.sessionA),this.editorB&&this.editorB.setSession(e.sessionB),this.sessionA=this.diffSession.sessionA,this.sessionB=this.diffSession.sessionB,this.$attachSessionsEventHandlers(),this.initSelectionMarkers()),this.otherSession=this.showSideA?this.sessionB:this.sessionA},e.prototype.$attachSessionsEventHandlers=function(){},e.prototype.$detachSessionsEventHandlers=function(){},e.prototype.getDiffSession=function(){return this.diffSession},e.prototype.setTheme=function(e){this.editorA&&this.editorA.setTheme(e),this.editorB&&this.editorB.setTheme(e)},e.prototype.getTheme=function(){return(this.editorA||this.editorB).getTheme()},e.prototype.onChangeTheme=function(e){var t=e&&e.theme||this.getTheme();this.editorA&&this.editorA.getTheme()!==t&&this.editorA.setTheme(t),this.editorB&&this.editorB.getTheme()!==t&&this.editorB.setTheme(t)},e.prototype.resize=function(e){this.editorA&&this.editorA.resize(e),this.editorB&&this.editorB.resize(e)},e.prototype.scheduleOnInput=function(){var e=this;if(this.$onInputTimer)return;this.$onInputTimer=setTimeout(function(){e.$onInputTimer=null,e.onInput()})},e.prototype.onInput=function(){var e=this;this.$onInputTimer&&clearTimeout(this.$onInputTimer);var t=this.sessionA.doc.getAllLines(),n=this.sessionB.doc.getAllLines();this.selectionRangeA=null,this.selectionRangeB=null;var r=this.$diffLines(t,n);this.diffSession.chunks=this.chunks=r,this.gutterDecoratorA&&this.gutterDecoratorA.setDecorations(r),this.gutterDecoratorB&&this.gutterDecoratorB.setDecorations(r);if(this.chunks&&this.chunks.length>this.$maxDiffs)return;this.align(),this.editorA&&this.editorA.renderer.updateBackMarkers(),this.editorB&&this.editorB.renderer.updateBackMarkers(),setTimeout(function(){e.updateScrollBarDecorators()},0),this.$foldUnchangedOnInput&&this.foldUnchanged()},e.prototype.setupScrollbars=function(){var e=this,t=function(t){setTimeout(function(){e.$setScrollBarDecorators(t),e.updateScrollBarDecorators()},0)};this.inlineDiffEditor?t(this.activeEditor.renderer):(t(this.editorA.renderer),t(this.editorB.renderer))},e.prototype.$setScrollBarDecorators=function(e){e.$scrollDecorator&&e.$scrollDecorator.destroy(),e.$scrollDecorator=new f(e.scrollBarV,e,this.inlineDiffEditor),e.$scrollDecorator.setSessions(this.sessionA,this.sessionB),e.scrollBarV.setVisible(!0),e.scrollBarV.element.style.bottom=e.scrollBarH.getHeight()+"px"},e.prototype.$resetDecorators=function(e){e.$scrollDecorator&&e.$scrollDecorator.destroy(),e.$scrollDecorator=new d(e.scrollBarV,e)},e.prototype.updateScrollBarDecorators=function(){var e=this;if(this.inlineDiffEditor){if(!this.activeEditor)return;this.activeEditor.renderer.$scrollDecorator.$zones=[]}else{if(!this.editorA||!this.editorB)return;this.editorA.renderer.$scrollDecorator.$zones=[],this.editorB.renderer.$scrollDecorator.$zones=[]}var t=function(e,t){if(!e)return;if(typeof e.renderer.$scrollDecorator.addZone!="function")return;t.old.start.row!=t.old.end.row&&e.renderer.$scrollDecorator.addZone(t.old.start.row,t.old.end.row-1,"delete"),t.new.start.row!=t.new.end.row&&e.renderer.$scrollDecorator.addZone(t.new.start.row,t.new.end.row-1,"insert")};this.inlineDiffEditor?(this.chunks&&this.chunks.forEach(function(n){t(e.activeEditor,n)}),this.activeEditor.renderer.$scrollDecorator.$updateDecorators(this.activeEditor.renderer.layerConfig)):(this.chunks&&this.chunks.forEach(function(n){t(e.editorA,n),t(e.editorB,n)}),this.editorA.renderer.$scrollDecorator.$updateDecorators(this.editorA.renderer.layerConfig),this.editorB.renderer.$scrollDecorator.$updateDecorators(this.editorB.renderer.layerConfig))},e.prototype.$diffLines=function(e,t){return this.diffProvider.compute(e,t,{ignoreTrimWhitespace:this.$ignoreTrimWhitespace,maxComputationTimeMs:this.$maxComputationTimeMs})},e.prototype.setProvider=function(e){this.diffProvider=e},e.prototype.$addWidget=function(e,t){var n=e.lineWidgets[t.row];n&&(t.rowsAbove+=n.rowsAbove>t.rowsAbove?n.rowsAbove:t.rowsAbove,t.rowCount+=n.rowCount),e.lineWidgets[t.row]=t,e.widgetManager.lineWidgets[t.row]=t,e.$resetRowCache(t.row);var r=e.getFoldAt(t.row,0);r&&e.widgetManager.updateOnFold({data:r,action:"add"},e)},e.prototype.$initWidgets=function(e){var t=e.session;t.widgetManager||(t.widgetManager=new a(t),t.widgetManager.attach(e)),e.session.lineWidgets=[],e.session.widgetManager.lineWidgets=[],e.session.$resetRowCache(0)},e.prototype.$screenRow=function(e,t){var n=t.documentToScreenPosition(e).row,r=e.row-t.getLength()+1;return r>0&&(n+=r),n},e.prototype.align=function(){},e.prototype.onChangeWrapLimit=function(e,t){},e.prototype.onSelect=function(e,t){this.searchHighlight(t),this.syncSelect(t)},e.prototype.syncSelect=function(e){if(this.$updatingSelection)return;var t=e.session===this.sessionA,n=e.getRange(),r=t?this.selectionRangeA:this.selectionRangeB;if(r&&n.isEqual(r))return;t?this.selectionRangeA=n:this.selectionRangeB=n,this.$updatingSelection=!0;var i=this.transformRange(n,t);this.$syncSelections&&(t?this.editorB:this.editorA).session.selection.setSelectionRange(i),this.$updatingSelection=!1,t?(this.selectionRangeA=n,this.selectionRangeB=i):(this.selectionRangeA=i,this.selectionRangeB=n),this.updateSelectionMarker(this.syncSelectionMarkerA,this.sessionA,this.selectionRangeA),this.updateSelectionMarker(this.syncSelectionMarkerB,this.sessionB,this.selectionRangeB)},e.prototype.updateSelectionMarker=function(e,t,n){e.setRange(n),t._signal("changeFrontMarker")},e.prototype.onChangeFold=function(e,t){var n=e.data;if(this.$syncingFold||!n||!e.action)return;this.scheduleRealign();var r=t===this.sessionA,i=r?this.sessionB:this.sessionA;e.action==="remove"&&(n.other?(n.other.other=null,i.removeFold(n.other)):n.lineWidget&&(i.widgetManager.addLineWidget(n.lineWidget),n.lineWidget=null,i.$editor&&i.$editor.renderer.updateBackMarkers()));if(e.action==="add"){var s=this.transformRange(n.range,r);if(s.isEmpty()){var o=s.start.row+1;i.lineWidgets[o]&&(n.lineWidget=i.lineWidgets[o],i.widgetManager.removeLineWidget(n.lineWidget),i.$editor&&i.$editor.renderer.updateBackMarkers())}else this.$syncingFold=!0,n.other=i.addFold(n.placeholder,s),n.other&&(n.other.other=n),this.$syncingFold=!1}},e.prototype.scheduleRealign=function(){this.realignPending||(this.realignPending=!0,this.editorA.renderer.on("beforeRender",this.realign),this.editorB.renderer.on("beforeRender",this.realign))},e.prototype.realign=function(){this.realignPending=!0,this.editorA.renderer.off("beforeRender",this.realign),this.editorB.renderer.off("beforeRender",this.realign),this.align(),this.realignPending=!1},e.prototype.detach=function(){if(!this.editorA||!this.editorB)return;this.savedOptionsA&&this.editorA.setOptions(this.savedOptionsA),this.savedOptionsB&&this.editorB.setOptions(this.savedOptionsB),this.editorA.renderer.off("beforeRender",this.realign),this.editorB.renderer.off("beforeRender",this.realign),this.$detachEventHandlers(),this.$removeLineWidgets(this.sessionA),this.$removeLineWidgets(this.sessionB),this.gutterDecoratorA&&this.gutterDecoratorA.dispose(),this.gutterDecoratorB&&this.gutterDecoratorB.dispose(),this.sessionA.selection.clearSelection(),this.sessionB.selection.clearSelection(),this.savedOptionsA&&this.savedOptionsA.customScrollbar&&this.$resetDecorators(this.editorA.renderer),this.savedOptionsB&&this.savedOptionsB.customScrollbar&&this.$resetDecorators(this.editorB.renderer)},e.prototype.$removeLineWidgets=function(e){e.lineWidgets=[],e.widgetManager.lineWidgets=[],e._signal("changeFold",{data:{start:{row:0}}})},e.prototype.$detachEventHandlers=function(){},e.prototype.destroy=function(){this.detach(),this.editorA&&this.editorA.destroy(),this.editorB&&this.editorB.destroy(),this.editorA=this.editorB=null},e.prototype.gotoNext=function(e){var t=this.activeEditor||this.editorA;this.inlineDiffEditor&&(t=this.editorA);var n=t==this.editorA,r=t.selection.lead.row,i=this.findChunkIndex(this.chunks,r,n),o=this.chunks[i+e]||this.chunks[i],u=t.session.getScrollTop();if(o){var a=o[n?"old":"new"],f=Math.max(a.start.row,a.end.row-1);t.selection.setRange(new s(f,0,f,0))}t.renderer.scrollSelectionIntoView(t.selection.lead,t.selection.anchor,.5),t.renderer.animateScrolling(u)},e.prototype.firstDiffSelected=function(){return this.currentDiffIndex<=1},e.prototype.lastDiffSelected=function(){return this.currentDiffIndex>this.chunks.length-1},e.prototype.transformRange=function(e,t){return s.fromPoints(this.transformPosition(e.start,t),this.transformPosition(e.end,t))},e.prototype.transformPosition=function(e,t){var n=this.findChunkIndex(this.chunks,e.row,t),i=this.chunks[n],s=this.sessionB.doc.clonePos,o=s(e),u=r(t?["old","new"]:["new","old"],2),a=u[0],f=u[1],l=0,c=!1;if(i)if(i[a].end.row<=e.row)o.row-=i[a].end.row-i[f].end.row;else if(i.charChanges)for(var h=0;h<i.charChanges.length;h++){var p=i.charChanges[h],d=p[a],v=p[f];if(d.end.row<e.row)continue;if(d.start.row>e.row)break;if(d.isMultiLine()&&d.contains(e.row,e.column)){o.row=v.start.row+e.row-d.start.row;var m=v.end.row;v.end.column===0&&m--,o.row>m&&(o.row=m,o.column=(t?this.sessionB:this.sessionA).getLine(m).length,c=!0),o.row=Math.min(o.row,m)}else{o.row=v.start.row;if(d.start.column>e.column)break;c=!0,!d.isEmpty()&&d.contains(e.row,e.column)?(o.column=v.start.column,l=e.column-d.start.column,l=Math.min(l,v.end.column-v.start.column)):(o=s(v.end),l=e.column-d.end.column)}}else i[a].start.row<=e.row&&(o.row+=i[f].start.row-i[a].start.row,o.row>=i[f].end.row&&(o.row=i[f].end.row-1,o.column=(t?this.sessionB:this.sessionA).getLine(o.row).length));if(!c){var g=r(t?[this.sessionA,this.sessionB]:[this.sessionB,this.sessionA],2),y=g[0],b=g[1];l-=this.$getDeltaIndent(y,b,e.row,o.row)}return o.column+=l,o},e.prototype.$getDeltaIndent=function(e,t,n,r){var i=this.$getIndent(e,n),s=this.$getIndent(t,r);return i-s},e.prototype.$getIndent=function(e,t){return e.getLine(t).match(/^\s*/)[0].length},e.prototype.printDiffs=function(){this.chunks.forEach(function(e){console.log(e.toString())})},e.prototype.findChunkIndex=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r],s=n?i.old:i.new;if(s.end.row<t)continue;if(s.start.row>t)break}return this.currentDiffIndex=r,r-1},e.prototype.searchHighlight=function(e){if(this.$syncSelections||this.inlineDiffEditor)return;var t=e.session,n=t===this.sessionA?this.sessionB:this.sessionA;n.highlight(t.$searchHighlight.regExp),n._signal("changeBackMarker")},e.prototype.initSelectionMarkers=function(){this.syncSelectionMarkerA=new S,this.syncSelectionMarkerB=new S,this.sessionA.addDynamicMarker(this.syncSelectionMarkerA,!0),this.sessionB.addDynamicMarker(this.syncSelectionMarkerB,!0)},e.prototype.clearSelectionMarkers=function(){this.sessionA.removeMarker(this.syncSelectionMarkerA.id),this.sessionB.removeMarker(this.syncSelectionMarkerB.id)},e}();u.defineOptions(y.prototype,"DiffView",{showOtherLineNumbers:{set:function(e){this.gutterLayer&&(this.gutterLayer.$renderer=e?null:b,this.editorA.renderer.updateFull())},initialValue:!0},folding:{set:function(e){this.editorA.setOption("showFoldWidgets",e),this.editorB.setOption("showFoldWidgets",e);if(!e){var t=[],n=[];this.chunks&&this.chunks.forEach(function(e){t.push(e.old.start,e.old.end),n.push(e.new.start,e.new.end)}),this.sessionA.unfold(t),this.sessionB.unfold(n)}}},syncSelections:{set:function(e){}},ignoreTrimWhitespace:{set:function(e){this.scheduleOnInput()}},wrap:{set:function(e){this.sessionA.setOption("wrap",e),this.sessionB.setOption("wrap",e)}},maxDiffs:{value:5e3},theme:{set:function(e){this.setTheme(e)},get:function(){return this.editorA.getTheme()}}});var b={getText:function(t){return""},getWidth:function(){return 0}};t.BaseDiffView=y;var w=function(){function e(t,n,r){this.old=t,this.new=n,this.charChanges=r&&r.map(function(t){return new e(new s(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn),new s(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn))})}return e}(),E=function(){function e(e,t){this.id,this.diffView=e,this.type=t}return e.prototype.update=function(e,t,n,r){var i,o,u,a=this.diffView;this.type===-1?(i="old",o="delete",u="insert"):(i="new",o="insert",u="delete");var f=a.$ignoreTrimWhitespace,l=a.chunks;if(n.lineWidgets&&!a.inlineDiffEditor)for(var c=r.firstRow;c<=r.lastRow;c++){var h=n.lineWidgets[c];if(!h||h.hidden)continue;var p=n.documentToScreenRow(c,0);if(h.rowsAbove>0){var d=new s(p-h.rowsAbove,0,p-1,Number.MAX_VALUE);t.drawFullLineMarker(e,d,"ace_diff aligned_diff",r)}var v=p+h.rowCount-(h.rowsAbove||0),d=new s(p+1,0,v,Number.MAX_VALUE);t.drawFullLineMarker(e,d,"ace_diff aligned_diff",r)}l.forEach(function(a){var l=a[i].start.row,c=a[i].end.row;if(c<r.firstRow||l>r.lastRow)return;var h=new s(l,0,c-1,1<<30);l!==c&&(h=h.toScreenRange(n),t.drawFullLineMarker(e,h,"ace_diff "+o,r));if(a.charChanges)for(var p=0;p<a.charChanges.length;p++){var d=a.charChanges[p][i];d.end.column==0&&d.end.row>d.start.row&&d.end.row==a[i].end.row&&(d.end.row--,d.end.column=Number.MAX_VALUE);if(f)for(var v=d.start.row;v<=d.end.row;v++){var m=void 0,g=void 0,y=n.getLine(v).match(/^\s*/)[0].length,b=n.getLine(v).length;v===d.start.row?m=d.start.column:m=y,v===d.end.row?g=d.end.column:g=b;var w=new s(v,m,v,g),E=w.toScreenRange(n);if(y===m&&b===g)continue;var S="inline "+o;w.isEmpty()&&m!==0&&(S="inline "+u+" empty"),t.drawSingleLineMarker(e,E,"ace_diff "+S,r)}else{var x=new s(d.start.row,d.start.column,d.end.row,d.end.column),E=x.toScreenRange(n),S="inline "+o;x.isEmpty()&&d.start.column!==0&&(S="inline empty "+u),E.isMultiLine()?t.drawTextMarker(e,E,"ace_diff "+S,r):t.drawSingleLineMarker(e,E,"ace_diff "+S,r)}}})},e}(),S=function(){function e(){this.id,this.type="fullLine",this.clazz="ace_diff-active-line"}return e.prototype.update=function(e,t,n,r){},e.prototype.setRange=function(e){var t=e.clone();t.end.column++,this.range=t},e}();t.DiffChunk=w,t.DiffHighlight=E}),ace.define("ace/ext/diff/inline_diff_view",["require","exports","module","ace/ext/diff/base_diff_view","ace/virtual_renderer","ace/config"],function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=e("./base_diff_view").BaseDiffView,s=e("../../virtual_renderer").VirtualRenderer,o=e("../../config"),u=function(e){function t(t,n){var r=this;return t=t||{},t.inline=t.inline||"a",r=e.call(this,!0,n)||this,r.init(t),r}return r(t,e),t.prototype.init=function(e){this.onSelect=this.onSelect.bind(this),this.onAfterRender=this.onAfterRender.bind(this),this.$setupModels(e),this.onChangeTheme(),o.resetOptions(this),o._signal("diffView",this);var t=this.activeEditor.renderer.$padding;this.addGutterDecorators(),this.otherEditor.renderer.setPadding(t),this.textLayer=this.otherEditor.renderer.$textLayer,this.markerLayer=this.otherEditor.renderer.$markerBack,this.gutterLayer=this.otherEditor.renderer.$gutterLayer,this.cursorLayer=this.otherEditor.renderer.$cursorLayer,this.otherEditor.renderer.$updateCachedSize=function(){};var n=this.activeEditor.renderer.$textLayer.element;n.parentNode.insertBefore(this.textLayer.element,n);var r=this.activeEditor.renderer.$markerBack.element;r.parentNode.insertBefore(this.markerLayer.element,r.nextSibling);var i=this.activeEditor.renderer.$gutterLayer.element;i.parentNode.insertBefore(this.gutterLayer.element,i.nextSibling),i.style.position="absolute",this.gutterLayer.element.style.position="absolute",this.gutterLayer.element.style.width="100%",this.gutterLayer.element.classList.add("ace_mini-diff_gutter_other"),this.gutterLayer.$updateGutterWidth=function(){},this.initMouse(),this.initTextInput(),this.initTextLayer(),this.initRenderer(),this.$attachEventHandlers(),this.selectEditor(this.activeEditor)},t.prototype.initRenderer=function(e){var t=this;e?delete this.activeEditor.renderer.$getLongestLine:this.editorA.renderer.$getLongestLine=this.editorB.renderer.$getLongestLine=function(){var e=s.prototype.$getLongestLine;return Math.max(e.call(t.editorA.renderer),e.call(t.editorB.renderer))}},t.prototype.initTextLayer=function(){function r(e,t){var r=0,i=e.length-1,s=-1;while(r<i){var o=Math.floor((r+i)/2),u=e[o][n].start.row;if(u<t)s=o,r=o+1;else{if(!(u>t)){s=o;break}i=o-1}}e[s+1]&&e[s+1][n].start.row<=t&&s++;var a=e[s]&&e[s][n];return a&&a.end.row>t?!0:!1}var e=this.textLayer.$renderLine,t=this;this.otherEditor.renderer.$textLayer.$renderLine=function(n,i,s){r(t.chunks,i)&&e.call(this,n,i,s)};var n=this.showSideA?"new":"old"},t.prototype.initTextInput=function(e){e?(this.otherEditor.textInput=this.othertextInput,this.otherEditor.container=this.otherEditorContainer):(this.othertextInput=this.otherEditor.textInput,this.otherEditor.textInput=this.activeEditor.textInput,this.otherEditorContainer=this.otherEditor.container,this.otherEditor.container=this.activeEditor.container)},t.prototype.selectEditor=function(e){e==this.activeEditor?(this.otherEditor.selection.clearSelection(),this.activeEditor.textInput.setHost(this.activeEditor),this.activeEditor.setStyle("ace_diff_other",!1),this.cursorLayer.element.remove(),this.activeEditor.renderer.$cursorLayer.element.style.display="block",this.showSideA&&(this.sessionA.removeMarker(this.syncSelectionMarkerA.id),this.sessionA.addDynamicMarker(this.syncSelectionMarkerA,!0)),this.markerLayer.element.classList.add("ace_hidden_marker-layer"),this.activeEditor.renderer.$markerBack.element.classList.remove("ace_hidden_marker-layer"),this.removeBracketHighlight(this.otherEditor)):(this.activeEditor.selection.clearSelection(),this.activeEditor.textInput.setHost(this.otherEditor),this.activeEditor.setStyle("ace_diff_other"),this.activeEditor.renderer.$cursorLayer.element.parentNode.appendChild(this.cursorLayer.element),this.activeEditor.renderer.$cursorLayer.element.style.display="none",this.activeEditor.$isFocused&&this.otherEditor.onFocus(),this.showSideA&&this.sessionA.removeMarker(this.syncSelectionMarkerA.id),this.markerLayer.element.classList.remove("ace_hidden_marker-layer"),this.activeEditor.renderer.$markerBack.element.classList.add("ace_hidden_marker-layer"),this.removeBracketHighlight(this.activeEditor))},t.prototype.removeBracketHighlight=function(e){var t=e.session;t.$bracketHighlight&&(t.$bracketHighlight.markerIds.forEach(function(e){t.removeMarker(e)}),t.$bracketHighlight=null)},t.prototype.initMouse=function(){var e=this;this.otherEditor.renderer.$loop=this.activeEditor.renderer.$loop,this.otherEditor.renderer.scroller={getBoundingClientRect:function(){return e.activeEditor.renderer.scroller.getBoundingClientRect()},style:this.activeEditor.renderer.scroller.style};var t=function(t){if(!t.domEvent)return;var n=t.editor.renderer.pixelToScreenCoordinates(t.clientX,t.clientY),r=e.activeEditor.session,i=e.otherEditor.session,s=r.screenToDocumentPosition(n.row,n.column,n.offsetX),o=i.screenToDocumentPosition(n.row,n.column,n.offsetX),u=r.documentToScreenPosition(s),a=i.documentToScreenPosition(o);t.editor==e.activeEditor&&(a.row==n.row&&u.row!=n.row?(t.type=="mousedown"&&e.selectEditor(e.otherEditor),t.propagationStopped=!0,t.defaultPrevented=!0,e.otherEditor.$mouseHandler.onMouseEvent(t.type,t.domEvent)):t.type=="mousedown"&&e.selectEditor(e.activeEditor))},n=["mousedown","click","mouseup","dblclick","tripleclick","quadclick"];n.forEach(function(n){e.activeEditor.on(n,t,!0),e.activeEditor.on("gutter"+n,t,!0)});var r=function(t){e.activeEditor.onFocus(t)},i=function(t){e.activeEditor.onBlur(t)};this.otherEditor.on("focus",r),this.otherEditor.on("blur",i),this.onMouseDetach=function(){n.forEach(function(n){e.activeEditor.off(n,t,!0),e.activeEditor.off("gutter"+n,t,!0)}),e.otherEditor.off("focus",r),e.otherEditor.off("blur",i)}},t.prototype.align=function(){var e=this;this.$initWidgets(e.editorA),this.$initWidgets(e.editorB),e.chunks.forEach(function(t){var n=e.$screenRow(t.old.end,e.sessionA)-e.$screenRow(t.old.start,e.sessionA),r=e.$screenRow(t.new.end,e.sessionB)-e.$screenRow(t.new.start,e.sessionB);e.$addWidget(e.sessionA,{rowCount:r,rowsAbove:t.old.end.row===0?r:0,row:t.old.end.row===0?0:t.old.end.row-1}),e.$addWidget(e.sessionB,{rowCount:n,rowsAbove:n,row:t.new.start.row})}),e.sessionA._emit("changeFold",{data:{start:{row:0}}}),e.sessionB._emit("changeFold",{data:{start:{row:0}}})},t.prototype.onChangeWrapLimit=function(){this.sessionB.adjustWrapLimit(this.sessionA.$wrapLimit),this.scheduleRealign()},t.prototype.$attachSessionsEventHandlers=function(){this.$attachSessionEventHandlers(this.editorA,this.markerA),this.$attachSessionEventHandlers(this.editorB,this.markerB),this.sessionA.on("changeWrapLimit",this.onChangeWrapLimit),this.sessionA.on("changeWrapMode",this.onChangeWrapLimit)},t.prototype.$attachSessionEventHandlers=function(e,t){e.session.on("changeFold",this.onChangeFold),e.session.addDynamicMarker(t),e.selection.on("changeCursor",this.onSelect),e.selection.on("changeSelection",this.onSelect)},t.prototype.$detachSessionsEventHandlers=function(){this.$detachSessionHandlers(this.editorA,this.markerA),this.$detachSessionHandlers(this.editorB,this.markerB),this.otherSession.bgTokenizer.lines.fill(undefined),this.sessionA.off("changeWrapLimit",this.onChangeWrapLimit),this.sessionA.off("changeWrapMode",this.onChangeWrapLimit)},t.prototype.$detachSessionHandlers=function(e,t){e.session.removeMarker(t.id),e.selection.off("changeCursor",this.onSelect),e.selection.off("changeSelection",this.onSelect),e.session.off("changeFold",this.onChangeFold)},t.prototype.$attachEventHandlers=function(){this.activeEditor.on("input",this.onInput),this.activeEditor.renderer.on("afterRender",this.onAfterRender),this.otherSession.on("change",this.onInput)},t.prototype.$detachEventHandlers=function(){this.$detachSessionsEventHandlers(),this.activeEditor.off("input",this.onInput),this.activeEditor.renderer.off("afterRender",this.onAfterRender),this.otherSession.off("change",this.onInput),this.textLayer.element.textContent="",this.textLayer.element.remove(),this.gutterLayer.element.textContent="",this.gutterLayer.element.remove(),this.markerLayer.element.textContent="",this.markerLayer.element.remove(),this.onMouseDetach(),this.selectEditor(this.activeEditor),this.clearSelectionMarkers(),this.otherEditor.setSession(null),this.otherEditor.renderer.$loop=null,this.initTextInput(!0),this.initRenderer(!0),this.otherEditor.destroy()},t.prototype.onAfterRender=function(e,t){var n=t.layerConfig,r=this.otherSession,i=this.otherEditor.renderer;r.$scrollTop=t.scrollTop,r.$scrollLeft=t.scrollLeft,["characterWidth","lineHeight","scrollTop","scrollLeft","scrollMargin","$padding","$size","layerConfig","$horizScroll","$vScroll"].forEach(function(e){i[e]=t[e]}),i.$computeLayerConfig();var s=i.layerConfig;this.gutterLayer.update(s),s.firstRowScreen=n.firstRowScreen,i.$cursorLayer.config=s,i.$cursorLayer.update(s),(e&i.CHANGE_LINES||e&i.CHANGE_FULL||e&i.CHANGE_SCROLL||e&i.CHANGE_TEXT)&&this.textLayer.update(s),this.markerLayer.setMarkers(this.otherSession.getMarkers()),this.markerLayer.update(s)},t.prototype.detach=function(){e.prototype.detach.call(this),this.otherEditor&&this.otherEditor.destroy()},t}(i);t.InlineDiffView=u}),ace.define("ace/ext/diff/split_diff_view",["require","exports","module","ace/ext/diff/base_diff_view","ace/config"],function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),i=e("./base_diff_view").BaseDiffView,s=e("../../config"),o=function(e){function t(t){var n=this;return t=t||{},n=e.call(this)||this,n.init(t),n}return r(t,e),t.prototype.init=function(e){this.onChangeTheme=this.onChangeTheme.bind(this),this.onMouseWheel=this.onMouseWheel.bind(this),this.onScroll=this.onScroll.bind(this),this.$setupModels(e),this.addGutterDecorators(),this.onChangeTheme(),s.resetOptions(this),s._signal("diffView",this),this.$attachEventHandlers()},t.prototype.onChangeWrapLimit=function(){this.scheduleRealign()},t.prototype.align=function(){var e=this;this.$initWidgets(e.editorA),this.$initWidgets(e.editorB),e.chunks.forEach(function(t){var n=e.$screenRow(t.old.start,e.sessionA),r=e.$screenRow(t.new.start,e.sessionB);n<r?e.$addWidget(e.sessionA,{rowCount:r-n,rowsAbove:t.old.start.row===0?r-n:0,row:t.old.start.row===0?0:t.old.start.row-1}):n>r&&e.$addWidget(e.sessionB,{rowCount:n-r,rowsAbove:t.new.start.row===0?n-r:0,row:t.new.start.row===0?0:t.new.start.row-1});var n=e.$screenRow(t.old.end,e.sessionA),r=e.$screenRow(t.new.end,e.sessionB);n<r?e.$addWidget(e.sessionA,{rowCount:r-n,rowsAbove:t.old.end.row===0?r-n:0,row:t.old.end.row===0?0:t.old.end.row-1}):n>r&&e.$addWidget(e.sessionB,{rowCount:n-r,rowsAbove:t.new.end.row===0?n-r:0,row:t.new.end.row===0?0:t.new.end.row-1})}),e.sessionA._emit("changeFold",{data:{start:{row:0}}}),e.sessionB._emit("changeFold",{data:{start:{row:0}}})},t.prototype.onScroll=function(e,t){this.syncScroll(this.sessionA===t?this.editorA.renderer:this.editorB.renderer)},t.prototype.syncScroll=function(e){if(this.$syncScroll==0)return;var t=this.editorA.renderer,n=this.editorB.renderer,r=e==t;if(t.$scrollAnimation&&n.$scrollAnimation)return;var i=Date.now();if(this.scrollSetBy!=e&&i-this.scrollSetAt<500)return;var s=r?t:n;if(this.scrollSetBy!=e){if(r&&this.scrollA==s.session.getScrollTop())return;if(!r&&this.scrollB==s.session.getScrollTop())return}var o=r?n:t,u=s.session.getScrollTop();this.$syncScroll=!1,r?(this.scrollA=s.session.getScrollTop(),this.scrollB=u):(this.scrollA=u,this.scrollB=s.session.getScrollTop()),this.scrollSetBy=e,o.session.setScrollTop(u),this.$syncScroll=!0,this.scrollSetAt=i},t.prototype.onMouseWheel=function(e){if(e.getAccelKey())return;e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=e.editor,n=t.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed);if(!n){var r=t==this.editorA?this.editorB:this.editorA;return r.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed)&&r.renderer.scrollBy(e.wheelX*e.speed,e.wheelY*e.speed),e.stop()}},t.prototype.$attachSessionsEventHandlers=function(){this.$attachSessionEventHandlers(this.editorA,this.markerA),this.$attachSessionEventHandlers(this.editorB,this.markerB)},t.prototype.$attachSessionEventHandlers=function(e,t){e.session.on("changeScrollTop",this.onScroll),e.session.on("changeFold",this.onChangeFold),e.session.addDynamicMarker(t),e.selection.on("changeCursor",this.onSelect),e.selection.on("changeSelection",this.onSelect),e.session.on("changeWrapLimit",this.onChangeWrapLimit),e.session.on("changeWrapMode",this.onChangeWrapLimit)},t.prototype.$detachSessionsEventHandlers=function(){this.$detachSessionHandlers(this.editorA,this.markerA),this.$detachSessionHandlers(this.editorB,this.markerB)},t.prototype.$detachSessionHandlers=function(e,t){e.session.off("changeScrollTop",this.onScroll),e.session.off("changeFold",this.onChangeFold),e.session.removeMarker(t.id),e.selection.off("changeCursor",this.onSelect),e.selection.off("changeSelection",this.onSelect),e.session.off("changeWrapLimit",this.onChangeWrapLimit),e.session.off("changeWrapMode",this.onChangeWrapLimit)},t.prototype.$attachEventHandlers=function(){this.editorA.renderer.on("themeChange",this.onChangeTheme),this.editorB.renderer.on("themeChange",this.onChangeTheme),this.editorA.on("mousewheel",this.onMouseWheel),this.editorB.on("mousewheel",this.onMouseWheel),this.editorA.on("input",this.onInput),this.editorB.on("input",this.onInput)},t.prototype.$detachEventHandlers=function(){this.$detachSessionsEventHandlers(),this.clearSelectionMarkers(),this.editorA.renderer.off("themeChange",this.onChangeTheme),this.editorB.renderer.off("themeChange",this.onChangeTheme),this.$detachEditorEventHandlers(this.editorA),this.$detachEditorEventHandlers(this.editorB)},t.prototype.$detachEditorEventHandlers=function(e){e.off("mousewheel",this.onMouseWheel),e.off("input",this.onInput)},t}(i);t.SplitDiffView=o}),ace.define("ace/ext/diff/providers/default",["require","exports","module","ace/range","ace/ext/diff/base_diff_view"],function(e,t,n){"use strict";function h(e,t,n){n===void 0&&(n=function(e,t){return e===t});if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}function p(e,t){var n,r,o,u,a,f,l,c;return i(this,function(i){switch(i.label){case 0:i.trys.push([0,8,9,10]),o=s(e),u=o.next(),i.label=1;case 1:if(!!u.done)return[3,7];a=u.value;if(r===undefined||!t(r,a))return[3,2];return n.push(a),[3,5];case 2:if(!n)return[3,4];return[4,n];case 3:i.sent(),i.label=4;case 4:n=[a],i.label=5;case 5:r=a,i.label=6;case 6:return u=o.next(),[3,1];case 7:return[3,10];case 8:return f=i.sent(),l={error:f},[3,10];case 9:try{u&&!u.done&&(c=o.return)&&c.call(o)}finally{if(l)throw l.error}return[7];case 10:if(!n)return[3,12];return[4,n];case 11:i.sent(),i.label=12;case 12:return[2]}})}function d(e,t){for(var n=0;n<=e.length;n++)t(n===0?undefined:e[n-1],n===e.length?undefined:e[n])}function v(e,t){for(var n=0;n<e.length;n++)t(n===0?undefined:e[n-1],e[n],n+1===e.length?undefined:e[n+1])}function m(e,t){var n,r;try{for(var i=s(t),o=i.next();!o.done;o=i.next()){var u=o.value;e.push(u)}}catch(a){n={error:a}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}function g(e,t){return function(n,r){return t(e(n),e(r))}}function b(e){return function(t,n){return-e(t,n)}}function E(e,t){t===void 0&&(t="unexpected state");if(!e)throw new w("Assertion Failed: ".concat(t))}function S(e){e()}function x(e,t){var n=0;while(n<e.length-1){var r=e[n],i=e[n+1];if(!t(r,i))return!1;n++}return!0}function k(e,t){var n=L(e,t);return n===-1?undefined:e[n]}function L(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);var i=n,s=r;while(i<s){var o=Math.floor((i+s)/2);t(e[o])?i=o+1:s=o}return i-1}function A(e,t){var n=O(e,t);return n===e.length?undefined:e[n]}function O(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=e.length);var i=n,s=r;while(i<s){var o=Math.floor((i+s)/2);t(e[o])?s=o:i=o+1}return i}function q(e,t){if(e.lineNumber<1)return new N(1,1);if(e.lineNumber>t.length)return new N(t.length,t[t.length-1].length+1);var n=t[e.lineNumber-1];return e.column>n.length+1?new N(e.lineNumber,n.length+1):e}function R(e,t){return e>=1&&e<=t.length}function W(e,t,n,r){var i,o;r===void 0&&(r=!1);var u=[];try{for(var a=s(p(e.map(function(e){return X(e,t,n)}),function(e,t){return e.original.overlapOrTouch(t.original)||e.modified.overlapOrTouch(t.modified)})),f=a.next();!f.done;f=a.next()){var l=f.value,c=l[0],h=l[l.length-1];u.push(new U(c.original.join(h.original),c.modified.join(h.modified),l.map(function(e){return e.innerChanges[0]})))}}catch(d){i={error:d}}finally{try{f&&!f.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}return S(function(){if(!r&&u.length>0){if(u[0].modified.startLineNumber!==u[0].original.startLineNumber)return!1;if(n.length.lineCount-u[u.length-1].modified.endLineNumberExclusive!==t.length.lineCount-u[u.length-1].original.endLineNumberExclusive)return!1}return x(u,function(e,t){return t.original.startLineNumber-e.original.endLineNumberExclusive===t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive<t.original.startLineNumber&&e.modified.endLineNumberExclusive<t.modified.startLineNumber})}),u}function X(e,t,n){var r=0,i=0;e.modifiedRange.endColumn===1&&e.originalRange.endColumn===1&&e.originalRange.startLineNumber+r<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+r<=e.modifiedRange.endLineNumber&&(i=-1),e.modifiedRange.startColumn-1>=n.getLineLength(e.modifiedRange.startLineNumber)&&e.originalRange.startColumn-1>=t.getLineLength(e.originalRange.startLineNumber)&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+i&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+i&&(r=1);var s=new _(e.originalRange.startLineNumber+r,e.originalRange.endLineNumber+1+i),o=new _(e.modifiedRange.startLineNumber+r,e.modifiedRange.endLineNumber+1+i);return new U(s,o,[e])}function Y(e){return e===32||e===9}function ut(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function at(e){return e>=65&&e<=90}function lt(e){return ft[e]}function ct(e){return e===10?8:e===13?7:Y(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:e===-1?3:e===44||e===59?5:4}function ht(e,t,n,r,i,s){var o=dt(e,t,n,s),u=o.moves,a=o.excludedChanges;if(!s.isValid())return[];var f=e.filter(function(e){return!a.has(e)}),l=vt(f,r,i,t,n,s);return m(u,l),u=gt(u),u=u.filter(function(e){var n=e.original.toOffsetRange().slice(t).map(function(e){return e.trim()}),r=n.join("\n");return r.length>=15&&pt(n,function(e){return e.length>=2})>=2}),u=yt(e,u),u}function pt(e,t){var n,r,i=0;try{for(var o=s(e),u=o.next();!u.done;u=o.next()){var a=u.value;t(a)&&i++}}catch(f){n={error:f}}finally{try{u&&!u.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}function dt(e,t,n,r){var i,o,u,a,f=[],l=e.filter(function(e){return e.modified.isEmpty&&e.original.length>=3}).map(function(e){return new Z(e.original,t,e)}),c=new Set(e.filter(function(e){return e.original.isEmpty&&e.modified.length>=3}).map(function(e){return new Z(e.modified,n,e)})),h=new Set;try{for(var p=s(l),d=p.next();!d.done;d=p.next()){var v=d.value,m=-1,g=void 0;try{for(var y=(u=void 0,s(c)),b=y.next();!b.done;b=y.next()){var w=b.value,E=v.computeSimilarity(w);E>m&&(m=E,g=w)}}catch(S){u={error:S}}finally{try{b&&!b.done&&(a=y.return)&&a.call(y)}finally{if(u)throw u.error}}m>.9&&g&&(c.delete(g),f.push(new I(v.range,g.range)),h.add(v.source),h.add(g.source));if(!r.isValid())return{moves:f,excludedChanges:h}}}catch(x){i={error:x}}finally{try{d&&!d.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}return{moves:f,excludedChanges:h}}function vt(e,t,n,r,i,o){var u,a,f,l,c,h,p,d,v=[],m=new st;try{for(var w=s(e),E=w.next();!E.done;E=w.next()){var S=E.value;for(var x=S.original.startLineNumber;x<S.original.endLineNumberExclusive-2;x++){var T="".concat(t[x-1],":").concat(t[x+1-1],":").concat(t[x+2-1]);m.add(T,{range:new _(x,x+3)})}}}catch(N){u={error:N}}finally{try{E&&!E.done&&(a=w.return)&&a.call(w)}finally{if(u)throw u.error}}var C=[];e.sort(g(function(e){return e.modified.startLineNumber},y));var L=function(e){var t=[],r=function(e){var r="".concat(n[e-1],":").concat(n[e+1-1],":").concat(n[e+2-1]),i=new _(e,e+3),o=[];m.forEach(r,function(e){var n,r,u=e.range;try{for(var a=(n=void 0,s(t)),f=a.next();!f.done;f=a.next()){var l=f.value;if(l.originalLineRange.endLineNumberExclusive+1===u.endLineNumberExclusive&&l.modifiedLineRange.endLineNumberExclusive+1===i.endLineNumberExclusive){l.originalLineRange=new _(l.originalLineRange.startLineNumber,u.endLineNumberExclusive),l.modifiedLineRange=new _(l.modifiedLineRange.startLineNumber,i.endLineNumberExclusive),o.push(l);return}}}catch(c){n={error:c}}finally{try{f&&!f.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var h={modifiedLineRange:i,originalLineRange:u};C.push(h),o.push(h)}),t=o};for(var i=e.modified.startLineNumber;i<e.modified.endLineNumberExclusive-2;i++)r(i);if(!o.isValid())return{value:[]}};try{for(var A=s(e),O=A.next();!O.done;O=A.next()){var S=O.value,P=L(S);if(typeof P=="object")return P.value}}catch(H){f={error:H}}finally{try{O&&!O.done&&(l=A.return)&&l.call(A)}finally{if(f)throw f.error}}C.sort(b(g(function(e){return e.modifiedLineRange.length},y)));var B=new D,j=new D;try{for(var F=s(C),q=F.next();!q.done;q=F.next()){var R=q.value,U=R.modifiedLineRange.startLineNumber-R.originalLineRange.startLineNumber,z=B.subtractFrom(R.modifiedLineRange),W=j.subtractFrom(R.originalLineRange).getWithDelta(U),X=z.getIntersection(W);try{for(var V=(p=void 0,s(X.ranges)),$=V.next();!$.done;$=V.next()){var J=$.value;if(J.length<3)continue;var K=J,Q=J.delta(-U);v.push(new I(Q,K)),B.addRange(K),j.addRange(Q)}}catch(G){p={error:G}}finally{try{$&&!$.done&&(d=V.return)&&d.call(V)}finally{if(p)throw p.error}}}}catch(Y){c={error:Y}}finally{try{q&&!q.done&&(h=F.return)&&h.call(F)}finally{if(c)throw c.error}}v.sort(g(function(e){return e.original.startLineNumber},y));var Z=new M(e),et=function(t){var n=v[t],s=Z.findLastMonotonous(function(e){return e.original.startLineNumber<=n.original.startLineNumber}),u=k(e,function(e){return e.modified.startLineNumber<=n.modified.startLineNumber}),a=Math.max(n.original.startLineNumber-s.original.startLineNumber,n.modified.startLineNumber-u.modified.startLineNumber),f=Z.findLastMonotonous(function(e){return e.original.startLineNumber<n.original.endLineNumberExclusive}),l=k(e,function(e){return e.modified.startLineNumber<n.modified.endLineNumberExclusive}),c=Math.max(f.original.endLineNumberExclusive-n.original.endLineNumberExclusive,l.modified.endLineNumberExclusive-n.modified.endLineNumberExclusive),h=void 0;for(h=0;h<a;h++){var p=n.original.startLineNumber-h-1,d=n.modified.startLineNumber-h-1;if(p>r.length||d>i.length)break;if(B.contains(d)||j.contains(p))break;if(!mt(r[p-1],i[d-1],o))break}h>0&&(j.addRa