UNPKG

@liascript/editor

Version:

An extended Markdown interpreter for the creation of interactive online courses.

1 lines 92.1 kB
ace.define("ace/ext/diff/scroll_diff_decorator",["require","exports","module","ace/layer/decorators"],(function(e,t,n){var i=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 i(){this.constructor=t}if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(e){function t(t,n,i){var r=e.call(this,t,n)||this;return r.colors.dark.delete="rgba(255, 18, 18, 1)",r.colors.dark.insert="rgba(18, 136, 18, 1)",r.colors.light.delete="rgb(255,51,51)",r.colors.light.insert="rgb(32,133,72)",r.$zones=[],r.$forInlineDiff=i,r}return i(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("function"==typeof this.canvas.getContext&&(e.prototype.$updateDecorators.call(this,t),this.$zones.length>0)){var n=!0===this.renderer.theme.isDark?this.colors.dark:this.colors.light,i=this.canvas.getContext("2d");this.$setDiffDecorators(i,n)}},t.prototype.$transformPosition=function(e,t){return"delete"==t?this.sessionA.documentToScreenRow(e,0):this.sessionB.documentToScreenRow(e,0)},t.prototype.$setDiffDecorators=function(e,t){var n,i,o=this,s=this.$zones;if(s){var a=[],u=s.filter((function(e){return"delete"===e.type})),l=s.filter((function(e){return"insert"===e.type}));[u,l].forEach((function(e){e.forEach((function(e,n){var i=o.$transformPosition(e.startRow,e.type)*o.lineHeight,r=o.$transformPosition(e.endRow,e.type)*o.lineHeight+o.lineHeight,s=Math.round(o.heightRatio*i),u=Math.round(o.heightRatio*r),l=Math.round((s+u)/2),h=u-l;h<o.halfMinDecorationHeight&&(h=o.halfMinDecorationHeight);var d=a[a.length-1];n>0&&d&&d.type===e.type&&l-h<d.to+1&&(l=a[a.length-1].to+1+h),l-h<0&&(l=h),l+h>o.canvasHeight&&(l=o.canvasHeight-h),a.push({type:e.type,from:l-h,to:l+h,color:t[e.type]||null})}))})),a=a.sort((function(e,t){return e.from===t.from?e.to-t.to:e.from-t.from}));try{for(var h=r(a),d=h.next();!d.done;d=h.next()){var c=d.value;e.fillStyle=c.color||null;var f=c.from,g=c.to-f;this.$forInlineDiff?e.fillRect(this.oneZoneWidth,f,2*this.oneZoneWidth,g):"delete"==c.type?e.fillRect(this.oneZoneWidth,f,this.oneZoneWidth,g):e.fillRect(2*this.oneZoneWidth,f,this.oneZoneWidth,g)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(n)throw n.error}}}},t.prototype.setZoneWidth=function(){this.oneZoneWidth=Math.round(this.canvasWidth/3)},t}(e("../../layer/decorators").Decorator);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 background-color: inherit;\n}\n\n.ace_mini-diff_gutter-enabled > .mini-diff-deleted:after {\n position: absolute;\n right: 2px;\n content: "-";\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.ace_hidden_marker-layer .ace_error_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 i=e("../../lib/dom"),r=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),i.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,i=this.editor.renderer.$gutterLayer.$lines.cells;i.forEach((function(e){e.element.classList.remove(Object.values(n.gutterCellsClasses))}));var r=-1===this.type?"old":"new",o=-1===this.type?this.gutterCellsClasses.delete:this.gutterCellsClasses.add;this.chunks.forEach((function(e){var t=e[r].start.row,n=e[r].end.row-1;i.forEach((function(e){e.row>=t&&e.row<=n&&e.element.classList.add(o)}))}))},e.prototype.setDecorations=function(e){this.chunks=e,this.renderGutters()},e.prototype.dispose=function(){i.removeCssClass(this.editor.renderer.$gutterLayer.element,this.gutterClass),this.editor.renderer.$gutterLayer.off("afterRender",this.renderGutters)},e}();t.MinimalGutterDiffDecorator=r})),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 i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,r,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)s.push(i.value)}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return s},r=(e("../../lib/oop"),e("../../range").Range),o=e("../../lib/dom"),s=e("../../config"),a=e("../../line_widgets").LineWidgets,u=e("./scroll_diff_decorator").ScrollDiffDecorator,l=e("./styles-css.js").cssText,h=e("../../editor").Editor,d=e("../../virtual_renderer").VirtualRenderer,c=e("../../undomanager").UndoManager,f=e("../../layer/decorators").Decorator;e("../../theme/textmate"),e("../../multi_select");var g=e("../../edit_session").EditSession,m=e("./gutter_decorator").MinimalGutterDiffDecorator,p={compute:function(e,t,n){return[]}};o.importCssString(l,"diffview.css");var v=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=p,t&&(this.container=t),this.$ignoreTrimWhitespace=!1,this.$maxDiffs=5e3,this.$maxComputationTimeMs=150,this.$syncSelections=!1,this.$foldUnchangedOnInput=!1,this.markerB=new b(this,1),this.markerA=new b(this,-1)}return e.prototype.$setupModels=function(e){e.diffProvider&&this.setProvider(e.diffProvider),this.showSideA=null==e.inline||"a"===e.inline;var t={scrollPastEnd:.5,highlightActiveLine:!1,highlightGutterLine:!1,animatedScroll:!0,customScrollbar:!0,vScrollBarAlwaysVisible:!0,fadeFoldWidgets:!0,showFoldWidgets:!0,selectionStyle:"text"};if(this.savedOptionsA=e.editorA&&e.editorA.getOptions(t),this.savedOptionsB=e.editorB&&e.editorB.getOptions(t),this.inlineDiffEditor&&"a"!==e.inline||(this.editorA=e.editorA||this.$setupModel(e.sessionA,e.valueA),this.container&&this.container.appendChild(this.editorA.container),this.editorA.setOptions(t)),this.inlineDiffEditor&&"b"!==e.inline||(this.editorB=e.editorB||this.$setupModel(e.sessionB,e.valueB),this.container&&this.container.appendChild(this.editorB.container),this.editorB.setOptions(t)),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 h(new d(null),void 0,n),this.showSideA?this.editorB=this.otherEditor:this.editorA=this.otherEditor}this.setDiffSession({sessionA:e.sessionA||(e.editorA?e.editorA.session:new g(e.valueA||"")),sessionB:e.sessionB||(e.editorB?e.editorB.session:new g(e.valueB||"")),chunks:[]}),this.otherEditor&&this.activeEditor&&this.otherSession.setOption("wrap",this.activeEditor.getOption("wrap")),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 h(new d,e);return n.session.setUndoManager(new c),null!=t&&n.setValue(t,-1),n},e.prototype.foldUnchanged=function(){for(var e=this.chunks,t="-".repeat(120),n={old:new r(0,0,0,0),new:new r(0,0,0,0)},i=!1,o=0;o<e.length+1;o++){var s=e[o]||{old:new r(this.sessionA.getLength(),0,this.sessionA.getLength(),0),new:new r(this.sessionB.getLength(),0,this.sessionB.getLength(),0)},a=s.new.start.row-n.new.end.row-5;if(a>2){var u=n.old.end.row+2,l=this.sessionA.addFold(t,new r(u,0,u+a,Number.MAX_VALUE));u=n.new.end.row+2;var h=this.sessionB.addFold(t,new r(u,0,u+a,Number.MAX_VALUE));(l||h)&&(i=!0),h&&l&&(l.other=h,h.other=l)}n=s}return i},e.prototype.unfoldUnchanged=function(){for(var e=this.sessionA.getAllFolds(),t=e.length-1;t>=0;t--){var n=e[t];120==n.placeholder.length&&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;this.$onInputTimer||(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 i=this.$diffLines(t,n);this.diffSession.chunks=this.chunks=i,this.gutterDecoratorA&&this.gutterDecoratorA.setDecorations(i),this.gutterDecoratorB&&this.gutterDecoratorB.setDecorations(i),this.chunks&&this.chunks.length>this.$maxDiffs||(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 u(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 f(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){e&&"function"==typeof e.renderer.$scrollDecorator.addZone&&(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 i=e.getFoldAt(t.row,0);i&&e.widgetManager.updateOnFold({data:i,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,i=e.row-t.getLength()+1;return i>0&&(n+=i),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){var t=e.session===this.sessionA,n=e.getRange(),i=t?this.selectionRangeA:this.selectionRangeB;if(!i||!n.isEqual(i)){t?this.selectionRangeA=n:this.selectionRangeB=n,this.$updatingSelection=!0;var r=this.transformRange(n,t);this.$syncSelections&&(t?this.editorB:this.editorA).session.selection.setSelectionRange(r),this.$updatingSelection=!1,t?(this.selectionRangeA=n,this.selectionRangeB=r):(this.selectionRangeA=r,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){this.scheduleRealign();var i=t===this.sessionA,r=i?this.sessionB:this.sessionA;if("remove"===e.action&&(n.other?(n.other.other=null,r.removeFold(n.other)):n.lineWidget&&(r.widgetManager.addLineWidget(n.lineWidget),n.lineWidget=null,r.$editor&&r.$editor.renderer.updateBackMarkers())),"add"===e.action){var o=this.transformRange(n.range,i);if(o.isEmpty()){var s=o.start.row+1;r.lineWidgets[s]&&(n.lineWidget=r.lineWidgets[s],r.widgetManager.removeLineWidget(n.lineWidget),r.$editor&&r.$editor.renderer.updateBackMarkers())}else this.$syncingFold=!0,n.other=r.addFold(n.placeholder,o),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(){this.editorA&&this.editorB&&(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,i=t.selection.lead.row,o=this.findChunkIndex(this.chunks,i,n),s=this.chunks[o+e]||this.chunks[o],a=t.session.getScrollTop();if(s){var u=s[n?"old":"new"],l=Math.max(u.start.row,u.end.row-1);t.selection.setRange(new r(l,0,l,0))}t.renderer.scrollSelectionIntoView(t.selection.lead,t.selection.anchor,.5),t.renderer.animateScrolling(a)},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 r.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),r=this.chunks[n],o=this.sessionB.doc.clonePos,s=o(e),a=i(t?["old","new"]:["new","old"],2),u=a[0],l=a[1],h=0,d=!1;if(r)if(r[u].end.row<=e.row)s.row-=r[u].end.row-r[l].end.row;else if(r.charChanges)for(var c=0;c<r.charChanges.length;c++){var f=r.charChanges[c],g=f[u],m=f[l];if(!(g.end.row<e.row)){if(g.start.row>e.row)break;if(g.isMultiLine()&&g.contains(e.row,e.column)){s.row=m.start.row+e.row-g.start.row;var p=m.end.row;0===m.end.column&&p--,s.row>p&&(s.row=p,s.column=(t?this.sessionB:this.sessionA).getLine(p).length,d=!0),s.row=Math.min(s.row,p)}else{if(s.row=m.start.row,g.start.column>e.column)break;d=!0,!g.isEmpty()&&g.contains(e.row,e.column)?(s.column=m.start.column,h=e.column-g.start.column,h=Math.min(h,m.end.column-m.start.column)):(s=o(m.end),h=e.column-g.end.column)}}}else r[u].start.row<=e.row&&(s.row+=r[l].start.row-r[u].start.row,s.row>=r[l].end.row&&(s.row=r[l].end.row-1,s.column=(t?this.sessionB:this.sessionA).getLine(s.row).length));if(!d){var v=i(t?[this.sessionA,this.sessionB]:[this.sessionB,this.sessionA],2),y=v[0],w=v[1];h-=this.$getDeltaIndent(y,w,e.row,s.row)}return s.column+=h,s},e.prototype.$getDeltaIndent=function(e,t,n,i){return this.$getIndent(e,n)-this.$getIndent(t,i)},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 i=0;i<e.length;i++){var r=e[i],o=n?r.old:r.new;if(!(o.end.row<t)&&o.start.row>t)break}return this.currentDiffIndex=i,i-1},e.prototype.searchHighlight=function(e){if(!this.$syncSelections&&!this.inlineDiffEditor){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 E,this.syncSelectionMarkerB=new E,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}();s.defineOptions(v.prototype,"DiffView",{showOtherLineNumbers:{set:function(e){this.gutterLayer&&(this.gutterLayer.$renderer=e?null:y,this.editorA.renderer.updateFull())},initialValue:!0},folding:{set:function(e){if(this.editorA.setOption("showFoldWidgets",e),this.editorB.setOption("showFoldWidgets",e),!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 y={getText:function(e){return""},getWidth:function(){return 0}};t.BaseDiffView=v;var w=function e(t,n,i){this.old=t,this.new=n,this.charChanges=i&&i.map((function(t){return new e(new r(t.originalStartLineNumber,t.originalStartColumn,t.originalEndLineNumber,t.originalEndColumn),new r(t.modifiedStartLineNumber,t.modifiedStartColumn,t.modifiedEndLineNumber,t.modifiedEndColumn))}))},b=function(){function e(e,t){this.id,this.diffView=e,this.type=t}return e.prototype.update=function(e,t,n,i){var o,s,a,u=this.diffView;-1===this.type?(o="old",s="delete",a="insert"):(o="new",s="insert",a="delete");var l=u.$ignoreTrimWhitespace,h=u.chunks;if(n.lineWidgets&&!u.inlineDiffEditor)for(var d=i.firstRow;d<=i.lastRow;d++){var c=n.lineWidgets[d];if(c&&!c.hidden){var f=n.documentToScreenRow(d,0);if(c.rowsAbove>0){var g=new r(f-c.rowsAbove,0,f-1,Number.MAX_VALUE);t.drawFullLineMarker(e,g,"ace_diff aligned_diff",i)}var m=f+c.rowCount-(c.rowsAbove||0);g=new r(f+1,0,m,Number.MAX_VALUE);t.drawFullLineMarker(e,g,"ace_diff aligned_diff",i)}}h.forEach((function(u){var h=u[o].start.row,d=u[o].end.row;if(!(d<i.firstRow||h>i.lastRow)){var c=new r(h,0,d-1,1<<30);if(h!==d&&(c=c.toScreenRange(n),t.drawFullLineMarker(e,c,"ace_diff "+s,i)),u.charChanges)for(var f=0;f<u.charChanges.length;f++){var g=u.charChanges[f][o];if(0==g.end.column&&g.end.row>g.start.row&&g.end.row==u[o].end.row&&(g.end.row--,g.end.column=Number.MAX_VALUE),l)for(var m=g.start.row;m<=g.end.row;m++){var p=void 0,v=void 0,y=n.getLine(m).match(/^\s*/)[0].length,w=n.getLine(m).length;p=m===g.start.row?g.start.column:y,v=m===g.end.row?g.end.column:w;var b=new r(m,p,m,v),E=b.toScreenRange(n);if(y!==p||w!==v){var L="inline "+s;b.isEmpty()&&0!==p&&(L="inline "+a+" empty"),t.drawSingleLineMarker(e,E,"ace_diff "+L,i)}}else{var x=new r(g.start.row,g.start.column,g.end.row,g.end.column);E=x.toScreenRange(n),L="inline "+s;x.isEmpty()&&0!==g.start.column&&(L="inline empty "+a),E.isMultiLine()?t.drawTextMarker(e,E,"ace_diff "+L,i):t.drawSingleLineMarker(e,E,"ace_diff "+L,i)}}}}))},e}(),E=function(){function e(){this.id,this.type="fullLine",this.clazz="ace_diff-active-line"}return e.prototype.update=function(e,t,n,i){},e.prototype.setRange=function(e){var t=e.clone();t.end.column++,this.range=t},e}();t.DiffChunk=w,t.DiffHighlight=b})),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 i=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 i(){this.constructor=t}if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=e("./base_diff_view").BaseDiffView,o=e("../../virtual_renderer").VirtualRenderer,s=e("../../config"),a=function(e){function t(t,n){var i=this;return(t=t||{}).inline=t.inline||"a",(i=e.call(this,!0,n)||this).init(t),i}return i(t,e),t.prototype.init=function(e){this.onSelect=this.onSelect.bind(this),this.onAfterRender=this.onAfterRender.bind(this),this.$setupModels(e),this.onChangeTheme(),s.resetOptions(this),s._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 i=this.activeEditor.renderer.$markerBack.element;i.parentNode.insertBefore(this.markerLayer.element,i.nextSibling);var r=this.activeEditor.renderer.$gutterLayer.element;r.parentNode.insertBefore(this.gutterLayer.element,r.nextSibling),r.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=o.prototype.$getLongestLine;return Math.max(e.call(t.editorA.renderer),e.call(t.editorB.renderer))}},t.prototype.initTextLayer=function(){function e(e,t){for(var n=0,r=e.length-1,o=-1;n<r;){var s=Math.floor((n+r)/2),a=e[s][i].start.row;if(a<t)o=s,n=s+1;else{if(!(a>t)){o=s;break}r=s-1}}e[o+1]&&e[o+1][i].start.row<=t&&o++;var u=e[o]&&e[o][i];return!!(u&&u.end.row>t)}var t=this.textLayer.$renderLine,n=this;this.otherEditor.renderer.$textLayer.$renderLine=function(i,r,o){e(n.chunks,r)&&t.call(this,i,r,o)};var i=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){var n=t.editor.renderer.pixelToScreenCoordinates(t.clientX,t.clientY),i=e.activeEditor.session,r=e.otherEditor.session,o=i.screenToDocumentPosition(n.row,n.column,n.offsetX),s=r.screenToDocumentPosition(n.row,n.column,n.offsetX),a=i.documentToScreenPosition(o),u=r.documentToScreenPosition(s);t.editor==e.activeEditor&&(u.row==n.row&&a.row!=n.row?("mousedown"==t.type&&e.selectEditor(e.otherEditor),t.propagationStopped=!0,t.defaultPrevented=!0,e.otherEditor.$mouseHandler.onMouseEvent(t.type,t.domEvent)):"mousedown"==t.type&&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 i=function(t){e.activeEditor.onFocus(t)},r=function(t){e.activeEditor.onBlur(t)};this.otherEditor.on("focus",i),this.otherEditor.on("blur",r),this.onMouseDetach=function(){n.forEach((function(n){e.activeEditor.off(n,t,!0),e.activeEditor.off("gutter"+n,t,!0)})),e.otherEditor.off("focus",i),e.otherEditor.off("blur",r)}},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),i=e.$screenRow(t.new.end,e.sessionB)-e.$screenRow(t.new.start,e.sessionB);e.$addWidget(e.sessionA,{rowCount:i,rowsAbove:0===t.old.end.row?i:0,row:0===t.old.end.row?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(e,t){this.otherSession.setOption("wrap",t.getOption("wrap")),this.otherSession.adjustWrapLimit(t.$wrapLimit),this.scheduleRealign(),this.activeEditor.renderer.updateFull()},t.prototype.$attachSessionsEventHandlers=function(){this.$attachSessionEventHandlers(this.editorA,this.markerA),this.$attachSessionEventHandlers(this.editorB,this.markerB);var e=this.activeEditor.session;e.on("changeWrapLimit",this.onChangeWrapLimit),e.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(void 0);var e=this.activeEditor.session;e.off("changeWrapLimit",this.onChangeWrapLimit),e.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,i=this.otherSession,r=this.otherEditor.renderer;i.$scrollTop=t.scrollTop,i.$scrollLeft=t.scrollLeft,["characterWidth","lineHeight","scrollTop","scrollLeft","scrollMargin","$padding","$size","layerConfig","$horizScroll","$vScroll"].forEach((function(e){r[e]=t[e]})),r.$computeLayerConfig();var o=r.layerConfig;this.gutterLayer.update(o),o.firstRowScreen=n.firstRowScreen,r.$cursorLayer.config=o,r.$cursorLayer.update(o),(e&r.CHANGE_LINES||e&r.CHANGE_FULL||e&r.CHANGE_SCROLL||e&r.CHANGE_TEXT)&&this.textLayer.update(o),this.markerLayer.setMarkers(this.otherSession.getMarkers()),this.markerLayer.update(o)},t.prototype.detach=function(){e.prototype.detach.call(this),this.otherEditor&&this.otherEditor.destroy()},t}(r);t.InlineDiffView=a})),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 i=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 i(){this.constructor=t}if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),r=e("./base_diff_view").BaseDiffView,o=e("../../config"),s=function(e){function t(t){var n=this;return t=t||{},(n=e.call(this)||this).init(t),n}return i(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(),o.resetOptions(this),o._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,i;(n=e.$screenRow(t.old.start,e.sessionA))<(i=e.$screenRow(t.new.start,e.sessionB))?e.$addWidget(e.sessionA,{rowCount:i-n,rowsAbove:0===t.old.start.row?i-n:0,row:0===t.old.start.row?0:t.old.start.row-1}):n>i&&e.$addWidget(e.sessionB,{rowCount:n-i,rowsAbove:0===t.new.start.row?n-i:0,row:0===t.new.start.row?0:t.new.start.row-1}),(n=e.$screenRow(t.old.end,e.sessionA))<(i=e.$screenRow(t.new.end,e.sessionB))?e.$addWidget(e.sessionA,{rowCount:i-n,rowsAbove:0===t.old.end.row?i-n:0,row:0===t.old.end.row?0:t.old.end.row-1}):n>i&&e.$addWidget(e.sessionB,{rowCount:n-i,rowsAbove:0===t.new.end.row?n-i:0,row:0===t.new.end.row?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(0!=this.$syncScroll){var t=this.editorA.renderer,n=this.editorB.renderer,i=e==t;if(!t.$scrollAnimation||!n.$scrollAnimation){var r=Date.now();if(!(this.scrollSetBy!=e&&r-this.scrollSetAt<500)){var o=i?t:n;if(this.scrollSetBy!=e){if(i&&this.scrollA==o.session.getScrollTop())return;if(!i&&this.scrollB==o.session.getScrollTop())return}var s=i?n:t,a=o.session.getScrollTop();this.$syncScroll=!1,i?(this.scrollA=o.session.getScrollTop(),this.scrollB=a):(this.scrollA=a,this.scrollB=o.session.getScrollTop()),this.scrollSetBy=e,s.session.setScrollTop(a),this.$syncScroll=!0,this.scrollSetAt=r}}}},t.prototype.onMouseWheel=function(e){if(!e.getAccelKey()){e.getShiftKey()&&e.wheelY&&!e.wheelX&&(e.wheelX=e.wheelY,e.wheelY=0);var t=e.editor;if(!t.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed)){var n=t==this.editorA?this.editorB:this.editorA;return n.renderer.isScrollableBy(e.wheelX*e.speed,e.wheelY*e.speed)&&n.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}(r);t.SplitDiffView=s})),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 i(e,t){var n,i,r,o,s,a,u,l;return O(this,(function(h){switch(h.label){case 0:h.trys.push([0,8,9,10]),r=I(e),o=r.next(),h.label=1;case 1:return o.done?[3,7]:(s=o.value,void 0!==i&&t(i,s)?(n.push(s),[3,5]):[3,2]);case 2:return n?[4,n]:[3,4];case 3:h.sent(),h.label=4;case 4:n=[s],h.label=5;case 5:i=s,h.label=6;case 6:return o=r.next(),[3,1];case 7:return[3,10];case 8:return a=h.sent(),u={error:a},[3,10];case 9:try{o&&!o.done&&(l=r.return)&&l.call(r)}finally{if(u)throw u.error}return[7];case 10:return n?[4,n]:[3,12];case 11:h.sent(),h.label=12;case 12:return[2]}}))}function r(e,t){var n,i;try{for(var r=I(t),o=r.next();!o.done;o=r.next()){var s=o.value;e.push(s)}}catch(e){n={error:e}}finally{try{o&&!o.done&&(i=r.return)&&i.call(r)}finally{if(n)throw n.error}}}function o(e,t){return function(n,i){return t(e(n),e(i))}}function s(e){e()}function a(e,t){var n=u(e,t);return-1===n?void 0:e[n]}function u(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=e.length);for(var r=n,o=i;r<o;){var s=Math.floor((r+o)/2);t(e[s])?r=s+1:o=s}return r-1}function l(e,t,n,i){void 0===n&&(n=0),void 0===i&&(i=e.length);for(var r=n,o=i;r<o;){var s=Math.floor((r+o)/2);t(e[s])?o=s:r=s+1}return r}function h(e,t){if(e.lineNumber<1)return new j(1,1);if(e.lineNumber>t.length)return new j(t.length,t[t.length-1].length+1);var n=t[e.lineNumber-1];return e.column>n.length+1?new j(e.lineNumber,n.length+1):e}function d(e,t){return e>=1&&e<=t.length}function c(e,t,n,r){var o,a;void 0===r&&(r=!1);var u=[];try{for(var l=I(i(e.map((function(e){return function(e,t,n){var i=0,r=0;1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+i<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+i<=e.modifiedRange.endLineNumber&&(r=-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+r&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+r&&(i=1);var o=new V(e.originalRange.startLineNumber+i,e.originalRange.endLineNumber+1+r),s=new V(e.modifiedRange.startLineNumber+i,e.modifiedRange.endLineNumber+1+r);return new Q(o,s,[e])}(e,t,n)})),(function(e,t){return e.original.overlapOrTouch(t.original)||e.modified.overlapOrTouch(t.modified)}))),h=l.next();!h.done;h=l.next()){var d=h.value,c=d[0],f=d[d.length-1];u.push(new Q(c.original.join(f.original),c.modified.join(f.modified),d.map((function(e){return e.innerChanges[0]}))))}}catch(e){o={error:e}}finally{try{h&&!h.done&&(a=l.return)&&a.call(l)}finally{if(o)throw o.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 function(e,t){for(var n=0;n<e.length-1;){if(!t(e[n],e[n+1]))return!1;n++}return!0}(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 f(e){return 32===e||9===e}function g(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}function m(e){return e>=65&&e<=90}function p(e){return me[e]}function v(e){return 10===e?8:13===e?7:f(e)?6:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:44===e||59===e?5:4}function y(e,t,n,i,s,u){var l=b(e,t,n,u),h=l.moves,d=l.excludedChanges;return u.isValid()?(r(h,E(e.filter((function(e){return!d.has(e)})),i,s,t,n,u)),h=function(e){if(0===e.length)return e;e.sort(o((function(e){return e.original.startLineNumber}),W));for(var t=[e[0]],n=1;n<e.length;n++){var i=t[t.length-1],r=e[n],s=r.original.startLineNumber-i.original.endLineNumberExclusive,a=r.modified.startLineNumber-i.modified.endLineNumberExclusive;s>=0&&a>=0&&s+a<=2?t[t.length-1]=i.join(r):t.push(r)}return t}(h),h=h.filter((function(e){var n=e.original.toOffsetRange().slice(t).map((function(e){return e.trim()}));return n.join("\n").length>=15&&w(n,(function(e){return e.length>=2}))>=2})),h=function(e,t){var n=new z(e);return t=t.filter((function(t){var i=n.findLastMonotonous((function(e){return e.original.startLineNumber<t.original.endLineNumberExclusive}))||new J(new V(1,1),new V(1,1)),r=a(e,(function(e){return e.modified.startLineNumber<t.modified.endLineNumberExclusive}));return i!==r})),t}(e,h),h):[]}function w(e,t){var n,i,r=0;try{for(var o=I(e),s=o.next();!s.done;s=o.next()){t(s.value)&&r++}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return r}function b(e,t,n,i){var r,o,s,a,u=[],l=e.filter((function(e){return e.modified.isEmpty&&e.original.length>=3})).map((function(e){return new ae(e.original,t,e)})),h=new Set(e.filter((function(e){return e.original.isEmpty&&e.modified.length>=3})).map((function(e){return new ae(e.modified,n,e)}))),d=new Set;try{for(var c=I(l),f=c.next();!f.done;f=c.next()){var g=f.value,m=-1,p=void 0;try{for(var v=(s=void 0,I(h)),y=v.next();!y.done;y=v.next()){var w=y.value,b=g.computeSimilarity(w);b>m&&(m=b,p=w)}}catch(e){s={error:e}}finally{try{y&&!y.done&&(a=v.return)&&a.call(v)}finally{if(s)throw s.error}}if(m>.9&&p&&(h.delete(p),u.push(new J(g.range,p.range)),d.add(g.source),d.add(p.source)),!i.isValid())return{moves:u,excludedChanges:d}}}catch(e){r={error:e}}finally{try{f&&!f.done&&(o=c.return)&&o.call(c)}finally{if(r)throw r.error}}return{moves:u,excludedChanges:d}}function E(e,t,n,i,r,s){var u,l,h,d,c,f,g,m,p=[],v=new fe;try{for(var y=I(e),w=y.next();!w.done;w=y.next())for(var b=(A=w.value).original.startLineNumber;b<A.original.endLineNumberExclusive-2;b++){var E="".concat(t[b-1],":").concat(t[b+1-1],":").concat(t[b+2-1]);v.add(E,{range:new V(b,b+3)})}}catch(e){u={error:e}}finally{try{w&&!w.done&&(l=y.return)&&l.call(y)}finally{if(u)throw u.error}}var x=[];e.sort(o((function(e){return e.modified.startLineNumber}),W));var R=function(e){for(var t=[],i=function(e){var i="".concat(n[e-1],":").concat(n[e+1-1],":").concat(n[e+2-1]),r=new V(e,e+3),o=[];v.forEach(i,(function(e){var n,i,s=e.range;try{for(var a=(n=void 0,I(t)),u=a.next();!u.done;u=a.next()){var l=u.value;if(l.originalLineRange.endLineNumberExclusive+1===s.endLineNumberExclusive&&l.modifiedLineRange.endLineNumberExclusive+1===r.endLineNumberExclusive)return l.originalLineRange=new V(l.originalLineRange.startLineNumber,s.endLineNumberExclusive),l.modifiedLineRange=new V(l.modifiedLineRange.startLineNumber,r.endLineNumberExclusive),void o.push(l)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}var h={modifiedLineRange:r,originalLineRange:s};x.push(h),o.push(h)})),t=o},r=e.modified.startLineNumber;r<e.modified.endLineNumberExclusive-2;r++)i(r);if(!s.isValid())return{value:[]}};try{for(var N=I(e),S=N.next();!S.done;S=N.next()){var A,_=R(A=S.value);if("object"==typeof _)return _.value}}catch(e){h={error:e}}finally{try{S&&!S.done&&(d=N.return)&&d.call(N)}finally{if(h)throw h.error}}x.sort(function(e){return function(t,n){return-e(t,n)}}(o((function(e){return e.modifiedLineRange.length}),W)));var C=new G,B=new G;try{for(var $=I(x),M=$.next();!M.done;M=$.next()){var k=M.value,q=k.modifiedLineRange.startLineNumber-k.originalLineRange.startLineNumber,D=C.subtractFrom(k.modifiedLineRange),T=B.subtractFrom(k.originalLineRange).getWithDelta(q),O=D.getIntersection(T);try{for(var P=(g=void 0,I(O.ranges)),F=P.next();!F.done;F=P.next()){var j=F.value;if(!(j.length<3)){var H=j,X=j.delta(-q);p.push(new J(X,H)),C.addRange(H),B.addRange(X)}}}catch(e){g={error:e}}finally{try{F&&!F.done&&(m=P.return)&&m.call(P)}finally{if(g)throw g.error}}}}catch(e){c={error:e}}finally{try{M&&!M.done&&(f=$.return)&&f.call($)}finally{if(c)throw c.error}}p.sort(o((function(e){return e.original.startLineNumber}),W));var U=new z(e),Z=function(t){var n=p[t],o=U.findLastMonotonous((function(e){return e.original.startLineNumber<=n.original.startLineNumber})),u=a(e,(function(e){return e.modified.startLineNumber<=n.modified.startLineNumber})),l=Math.max(n.original.startLineNumber-o.original.startLineNumber,n.modified.startLineNumber-u.modified.startLineNumber),h=U.findLastMonotonous((function(e){return e.original.startLineNumber<n.original.endLineNumberExclusive})),d=a(e,(function(e){return e.modified.startLineNumber<n.modified.endLineNumberExclusive})),c=Math.max(h.original.endLineNumberExclusive-n.original.endLineNumberExclusive,d.modified.endLineNumberExclusive-n.modified.endLineNumberExclusive),f=void 0;for(f=0;f<l;f++){var g=n.original.startLineNumber-f-1,m=n.modified.startLineNumber-f-1;if(g>i.length||m>r.length)break;if(