@liascript/editor 1.1.34--0.17.9 → 1.1.34--1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/dist/ace.js +1 -1
- package/dist/ext-diff.js +1 -1
- package/dist/ext-inline_autocomplete.js +1 -1
- package/dist/ext-language_tools.js +1 -1
- package/dist/ext-options.js +1 -1
- package/dist/ext-prompt.js +1 -1
- package/dist/ext-settings_menu.js +1 -1
- package/dist/icon.1234bfbe.svg +1 -0
- package/dist/{icon.1775260a.ttf → icon.66170d1c.ttf} +0 -0
- package/dist/icon.7f5db96d.woff +0 -0
- package/dist/{icon.eecda2c2.eot → icon.86e0e5ca.eot} +0 -0
- package/dist/icon.b0b6f2f3.woff2 +0 -0
- package/dist/{index.2e6af433.js → index.0adf7e2c.js} +1 -1
- package/dist/index.17bf0eed.js +1 -0
- package/dist/index.2c23dc71.js +1 -0
- package/dist/index.2d71cf3d.js +6 -0
- package/dist/index.50dfbedd.js +1 -0
- package/dist/{index.68c6e58b.js → index.571c392b.js} +1 -1
- package/dist/index.646a7ae0.js +1 -0
- package/dist/index.6bb82f82.js +1 -0
- package/dist/{index.04f78d29.js → index.7d5de7ec.js} +1 -1
- package/dist/index.aa2791ec.css +1 -0
- package/dist/index.c76f8851.js +1 -0
- package/dist/index.cb6253c2.js +1 -0
- package/dist/index.ce849469.js +6 -0
- package/dist/index.d3b39202.js +1 -0
- package/dist/index.db4bd5ae.js +1 -0
- package/dist/index.f04edc19.css +1 -0
- package/dist/index.html +1 -1
- package/dist/mode-plsql.js +1 -1
- package/dist/theme-cloud_editor.js +1 -1
- package/dist/theme-cloud_editor_dark.js +1 -1
- package/package.json +16 -15
- package/dist/icon.4c409dfc.woff +0 -0
- package/dist/icon.5d3b24ed.woff2 +0 -0
- package/dist/icon.854409f5.svg +0 -1
- package/dist/index.0552aff9.js +0 -1
- package/dist/index.0f7cccdb.js +0 -1
- package/dist/index.291c6225.js +0 -6
- package/dist/index.2aba4af3.js +0 -1
- package/dist/index.3a9c93a4.js +0 -1
- package/dist/index.523280ee.js +0 -6
- package/dist/index.60b27406.js +0 -1
- package/dist/index.7ac5d5e2.js +0 -1
- package/dist/index.8bb880f2.js +0 -1
- package/dist/index.d749f1d9.js +0 -1
- package/dist/index.d87d2002.css +0 -1
- package/dist/index.fffa7b8a.js +0 -1
package/dist/ext-diff.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
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.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(){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(void 0),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,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(C.contains(m)||B.contains(g))break;if(!L(i[g-1],r[m-1],s))break}f>0&&(B.addRange(new V(n.original.startLineNumber-f,n.original.startLineNumber)),C.addRange(new V(n.modified.startLineNumber-f,n.modified.startLineNumber)));var v=void 0;for(v=0;v<c;v++){g=n.original.endLineNumberExclusive+v,m=n.modified.endLineNumberExclusive+v;if(g>i.length||m>r.length)break;if(C.contains(m)||B.contains(g))break;if(!L(i[g-1],r[m-1],s))break}v>0&&(B.addRange(new V(n.original.endLineNumberExclusive,n.original.endLineNumberExclusive+v)),C.addRange(new V(n.modified.endLineNumberExclusive,n.modified.endLineNumberExclusive+v))),(f>0||v>0)&&(p[t]=new J(new V(n.original.startLineNumber-f,n.original.endLineNumberExclusive+v),new V(n.modified.startLineNumber-f,n.modified.endLineNumberExclusive+v)))};for(b=0;b<p.length;b++)Z(b);return p}function L(e,t,n){var i,r;if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;var o=(new le).compute(new ge([e],new H(1,1,1,e.length),!1),new ge([t],new H(1,1,1,t.length),!1),n),s=0,a=ne.invert(o.diffs,e.length);try{for(var u=I(a),l=u.next();!l.done;l=u.next()){l.value.seq1Range.forEach((function(t){f(e.charCodeAt(t))||s++}))}}catch(e){i={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var h=function(t){for(var n=0,i=0;i<e.length;i++)f(t.charCodeAt(i))||n++;return n}(e.length>t.length?e:t);return s/h>.6&&h>10}function x(e,t,n){var i=n;return i=R(e,t,i),i=function(e,t,n){if(!e.getBoundaryScore||!t.getBoundaryScore)return n;for(var i=0;i<n.length;i++){var r=i>0?n[i-1]:void 0,o=n[i],s=i+1<n.length?n[i+1]:void 0,a=new F(r?r.seq1Range.endExclusive+1:0,s?s.seq1Range.start-1:e.length),u=new F(r?r.seq2Range.endExclusive+1:0,s?s.seq2Range.start-1:t.length);o.seq1Range.isEmpty?n[i]=N(o,e,t,a,u):o.seq2Range.isEmpty&&(n[i]=N(o.swap(),t,e,u,a).swap())}return n}(e,t,i=R(e,t,i)),i}function R(e,t,n){if(0===n.length)return n;var i=[];i.push(n[0]);for(var r=1;r<n.length;r++){var o=i[i.length-1];if((l=n[r]).seq1Range.isEmpty||l.seq2Range.isEmpty){var s=l.seq1Range.start-o.seq1Range.endExclusive,a=void 0;for(a=1;a<=s&&(e.getElement(l.seq1Range.start-a)===e.getElement(l.seq1Range.endExclusive-a)&&t.getElement(l.seq2Range.start-a)===t.getElement(l.seq2Range.endExclusive-a));a++);if(--a===s){i[i.length-1]=new ne(new F(o.seq1Range.start,l.seq1Range.endExclusive-s),new F(o.seq2Range.start,l.seq2Range.endExclusive-s));continue}l=l.delta(-a)}i.push(l)}var u=[];for(r=0;r<i.length-1;r++){var l,h=i[r+1];if((l=i[r]).seq1Range.isEmpty||l.seq2Range.isEmpty){s=h.seq1Range.start-l.seq1Range.endExclusive,a=void 0;for(a=0;a<s&&(e.isStronglyEqual(l.seq1Range.start+a,l.seq1Range.endExclusive+a)&&t.isStronglyEqual(l.seq2Range.start+a,l.seq2Range.endExclusive+a));a++);if(a===s){i[r+1]=new ne(new F(l.seq1Range.start+s,h.seq1Range.endExclusive),new F(l.seq2Range.start+s,h.seq2Range.endExclusive));continue}a>0&&(l=l.delta(a))}u.push(l)}return i.length>0&&u.push(i[i.length-1]),u}function N(e,t,n,i,r){for(var o=1;e.seq1Range.start-o>=i.start&&e.seq2Range.start-o>=r.start&&n.isStronglyEqual(e.seq2Range.start-o,e.seq2Range.endExclusive-o)&&o<100;)o++;o--;for(var s=0;e.seq1Range.start+s<i.endExclusive&&e.seq2Range.endExclusive+s<r.endExclusive&&n.isStronglyEqual(e.seq2Range.start+s,e.seq2Range.endExclusive+s)&&s<100;)s++;if(0===o&&0===s)return e;for(var a=0,u=-1,l=-o;l<=s;l++){var h=e.seq2Range.start+l,d=e.seq2Range.endExclusive+l,c=e.seq1Range.start+l,f=t.getBoundaryScore(c)+n.getBoundaryScore(h)+n.getBoundaryScore(d);f>u&&(u=f,a=l)}return e.delta(a)}function S(e,t,n){var i,r,o=[];try{for(var s=I(n),a=s.next();!a.done;a=s.next()){var u=a.value,l=o[o.length-1];l?u.seq1Range.start-l.seq1Range.endExclusive<=2||u.seq2Range.start-l.seq2Range.endExclusive<=2?o[o.length-1]=new ne(l.seq1Range.join(u.seq1Range),l.seq2Range.join(u.seq2Range)):o.push(u):o.push(u)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function A(e,t,n,i,r){function o(n,o){if(!(n.offset1<u.offset1||n.offset2<u.offset2)){var l=i(e,n.offset1),h=i(t,n.offset2);if(l&&h){for(var d=new ne(l,h),c=d.intersect(o),f=c.seq1Range.length,g=c.seq2Range.length;s.length>0;){var m=s[0];if(!(m.seq1Range.intersects(d.seq1Range)||m.seq2Range.intersects(d.seq2Range)))break;var p=i(e,m.seq1Range.start),v=i(t,m.seq2Range.start),y=new ne(p,v),w=y.intersect(m);if(f+=w.seq1Range.length,g+=w.seq2Range.length,!((d=d.join(y)).seq1Range.endExclusive>=m.seq1Range.endExclusive))break;s.shift()}(r&&f+g<d.seq1Range.length+d.seq2Range.length||f+g<2*(d.seq1Range.length+d.seq2Range.length)/3)&&a.push(d),u=d.getEndExclusives()}}}void 0===r&&(r=!1);for(var s=ne.invert(n,e.length),a=[],u=new ie(0,0);s.length>0;){var l=s.shift();l.seq1Range.isEmpty||(o(l.getStarts(),l),o(l.getEndExclusives().delta(-1),l))}var h=function(e,t){var n=[];for(;e.length>0||t.length>0;){var i=e[0],r=t[0],o=void 0;o=i&&(!r||i.seq1Range.start<r.seq1Range.start)?e.shift():t.shift(),n.length>0&&n[n.length-1].seq1Range.endExclusive>=o.seq1Range.start?n[n.length-1]=n[n.length-1].join(o):n.push(o)}return n}(n,a);return h}function _(e){for(var t=0;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}function C(e,t,n){var i=(new ve).computeDiff(e,t,n);return null==i?void 0:i.changes.map((function(e){var t=e.innerChanges;return{origStart:e.original.startLineNumber-1,origEnd:e.original.endLineNumberExclusive-1,editStart:e.modified.startLineNumber-1,editEnd:e.modified.endLineNumberExclusive-1,charChanges:null==t?void 0:t.map((function(e){return{originalStartLineNumber:e.originalRange.startLineNumber-1,originalStartColumn:e.originalRange.startColumn-1,originalEndLineNumber:e.originalRange.endLineNumber-1,originalEndColumn:e.originalRange.endColumn-1,modifiedStartLineNumber:e.modifiedRange.startLineNumber-1,modifiedStartColumn:e.modifiedRange.startColumn-1,modifiedEndLineNumber:e.modifiedRange.endLineNumber-1,modifiedEndColumn:e.modifiedRange.endColumn-1}}))}}))}var B,$,M,k,q,D,T=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)}}(),O=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,n[0]&&(a=0)),a;)try{if(r=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){a.label=n[1];break}if(6===n[0]&&a.label<s[1]){a.label=s[1],s=n;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(n);break}s[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=n(0),u.throw=n(1),u.return=n(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u},I=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.")},W=function(e,t){return e-t},P=function(e){function t(n){var i=e.call(this,n||"An unexpected bug occurred.")||this;return Object.setPrototypeOf(i,t.prototype),i}return T(t,e),t}(Error),F=function(){function e(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new P("Invalid range: ".concat(this.toString()))}return e.fromTo=function(t,n){return new e(t,n)},e.addRange=function(t,n){for(var i=0;i<n.length&&n[i].endExclusive<t.start;)i++;for(var r=i;r<n.length&&n[r].start<=t.endExclusive;)r++;if(i===r)n.splice(i,0,t);else{var o=Math.min(t.start,n[i].start),s=Math.max(t.endExclusive,n[r-1].endExclusive);n.splice(i,r-i,new e(o,s))}},e.tryCreate=function(t,n){return t>n?void 0:new e(t,n)},e.ofLength=function(t){return new e(0,t)},e.ofStartAndLength=function(t,n){return new e(t,t+n)},e.emptyAt=function(t){return new e(t,t)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.start===this.endExclusive},enumerable:!1,configurable:!0}),e.prototype.delta=function(t){return new e(this.start+t,this.endExclusive+t)},e.prototype.deltaStart=function(t){return new e(this.start+t,this.endExclusive)},e.prototype.deltaEnd=function(t){return new e(this.start,this.endExclusive+t)},Object.defineProperty(e.prototype,"length",{get:function(){return this.endExclusive-this.start},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[".concat(this.start,", ").concat(this.endExclusive,")")},e.prototype.equals=function(e){return this.start===e.start&&this.endExclusive===e.endExclusive},e.prototype.containsRange=function(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive},e.prototype.contains=function(e){return this.start<=e&&e<this.endExclusive},e.prototype.join=function(t){return new e(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))},e.prototype.intersect=function(t){var n=Math.max(this.start,t.start),i=Math.min(this.endExclusive,t.endExclusive);return n<=i?new e(n,i):void 0},e.prototype.intersectionLength=function(e){var t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,n-t)},e.prototype.intersects=function(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)},e.prototype.intersectsOrTouches=function(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)},e.prototype.isBefore=function(e){return this.endExclusive<=e.start},e.prototype.isAfter=function(e){return this.start>=e.endExclusive},e.prototype.slice=function(e){return e.slice(this.start,this.endExclusive)},e.prototype.substring=function(e){return e.substring(this.start,this.endExclusive)},e.prototype.clip=function(e){if(this.isEmpty)throw new P("Invalid clipping range: ".concat(this.toString()));return Math.max(this.start,Math.min(this.endExclusive-1,e))},e.prototype.clipCyclic=function(e){if(this.isEmpty)throw new P("Invalid clipping range: ".concat(this.toString()));return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e},e.prototype.map=function(e){for(var t=[],n=this.start;n<this.endExclusive;n++)t.push(e(n));return t},e.prototype.forEach=function(e){for(var t=this.start;t<this.endExclusive;t++)e(t)},e}(),j=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column},e.prototype.isBeforeOrEqual=function(t){return e.isBeforeOrEqual(this,t)},e.isBeforeOrEqual=function(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column},e}(),H=function(){function e(e,t,n,i){e>n||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.column<e.startColumn)&&!(t.lineNumber===e.endLineNumber&&t.column>e.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber)&&(!(t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)))},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber)&&(!(t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var i,r,o,s;return n.startLineNumber<t.startLineNumber?(i=n.startLineNumber,r=n.startColumn):n.startLineNumber===t.startLineNumber?(i=n.startLineNumber,r=Math.min(n.startColumn,t.startColumn)):(i=t.startLineNumber,r=t.startColumn),n.endLineNumber>t.endLineNumber?(o=n.endLineNumber,s=n.endColumn):n.endLineNumber===t.endLineNumber?(o=n.endLineNumber,s=Math.max(n.endColumn,t.endColumn)):(o=t.endLineNumber,s=t.endColumn),new e(i,r,o,s)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var i=t.startLineNumber,r=t.startColumn,o=t.endLineNumber,s=t.endColumn,a=n.startLineNumber,u=n.startColumn,l=n.endLineNumber,h=n.endColumn;return i<a?(i=a,r=u):i===a&&(r=Math.max(r,u)),o>l?(o=l,s=h):o===l&&(s=Math.min(s,h)),i>o||i===o&&r>s?null:new e(i,r,o,s)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return e.getEndPosition(this)},e.getEndPosition=function(e){return new j(e.endLineNumber,e.endColumn)},e.prototype.getStartPosition=function(){return e.getStartPosition(this)},e.getStartPosition=function(e){return new j(e.startLineNumber,e.startColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.prototype.collapseToEnd=function(){return e.collapseToEnd(this)},e.collapseToEnd=function(t){return new e(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e}(),z=function(){function e(e){this._array=e,this._findLastMonotonousLastIdx=0}return e.prototype.findLastMonotonous=function(e){var t,n;if($.assertInvariants){if(this._prevFindLastPredicate)try{for(var i=I(this._array),r=i.next();!r.done;r=i.next()){var o=r.value;if(this._prevFindLastPredicate(o)&&!e(o))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}this._prevFindLastPredicate=e}var s=u(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=s+1,-1===s?void 0:this._array[s]},e}();($=z).assertInvariants=!1;var V=function(){function e(e,t){if(e>t)throw new P("startLineNumber ".concat(e," cannot be after endLineNumberExclusive ").concat(t));this.startLineNumber=e,this.endLineNumberExclusive=t}return e.fromRangeInclusive=function(t){return new e(t.startLineNumber,t.endLineNumber+1)},e.join=function(t){if(0===t.length)throw new P("lineRanges cannot be empty");for(var n=t[0].startLineNumber,i=t[0].endLineNumberExclusive,r=1;r<t.length;r++)n=Math.min(n,t[r].startLineNumber),i=Math.max(i,t[r].endLineNumberExclusive);return new e(n,i)},e.ofLength=function(t,n){return new e(t,t+n)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.startLineNumber===this.endLineNumberExclusive},enumerable:!1,configurable:!0}),e.prototype.delta=function(t){return new e(this.startLineNumber+t,this.endLineNumberExclusive+t)},Object.defineProperty(e.prototype,"length",{get:function(){return this.endLineNumberExclusive-this.startLineNumber},enumerable:!1,configurable:!0}),e.prototype.join=function(t){return new e(Math.min(this.startLineNumber,t.startLineNumber),Math.max(this.endLineNumberExclusive,t.endLineNumberExclusive))},e.prototype.intersect=function(t){var n=Math.max(this.startLineNumber,t.startLineNumber),i=Math.min(this.endLineNumberExclusive,t.endLineNumberExclusive);return n<=i?new e(n,i):void 0},e.prototype.overlapOrTouch=function(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive},e.prototype.toInclusiveRange=function(){return this.isEmpty?null:new H(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)},e.prototype.toOffsetRange=function(){return new F(this.startLineNumber-1,this.endLineNumberExclusive-1)},e}(),G=function(){function e(e){void 0===e&&(e=[]),this._normalizedRanges=e}return Object.defineProperty(e.prototype,"ranges",{get:function(){return this._normalizedRanges},enumerable:!1,configurable:!0}),e.prototype.addRange=function(e){if(0!==e.length){var t=l(this._normalizedRanges,(function(t){return t.endLineNumberExclusive>=e.startLineNumber})),n=u(this._normalizedRanges,(function(t){return t.startLineNumber<=e.endLineNumberExclusive}))+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){var i=this._normalizedRanges[t];this._normalizedRanges[t]=i.join(e)}else{i=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,i)}}},e.prototype.contains=function(e){var t=a(this._normalizedRanges,(function(t){return t.startLineNumber<=e}));return!!t&&t.endLineNumberExclusive>e},e.prototype.subtractFrom=function(t){var n=l(this._normalizedRanges,(function(e){return e.endLineNumberExclusive>=t.startLineNumber})),i=u(this._normalizedRanges,(function(e){return e.startLineNumber<=t.endLineNumberExclusive}))+1;if(n===i)return new e([t]);for(var r=[],o=t.startLineNumber,s=n;s<i;s++){var a=this._normalizedRanges[s];a.startLineNumber>o&&r.push(new V(o,a.startLineNumber)),o=a.endLineNumberExclusive}return o<t.endLineNumberExclusive&&r.push(new V(o,t.endLineNumberExclusive)),new e(r)},e.prototype.getIntersection=function(t){for(var n=[],i=0,r=0;i<this._normalizedRanges.length&&r<t._normalizedRanges.length;){var o=this._normalizedRanges[i],s=t._normalizedRanges[r],a=o.intersect(s);a&&!a.isEmpty&&n.push(a),o.endLineNumberExclusive<s.endLineNumberExclusive?i++:r++}return new e(n)},e.prototype.getWithDelta=function(t){return new e(this._normalizedRanges.map((function(e){return e.delta(t)})))},e}(),X=function(){function e(e,t){this.lineCount=e,this.columnCount=t}return e.prototype.toLineRange=function(){return V.ofLength(1,this.lineCount)},e.prototype.addToPosition=function(e){return 0===this.lineCount?new j(e.lineNumber,e.column+this.columnCount):new j(e.lineNumber+this.lineCount,this.columnCount+1)},e}();(M=X).zero=new M(0,0);var U=function(){function e(e,t){(function(e,t){if(void 0===t&&(t="unexpected state"),!e)throw new P("Assertion Failed: ".concat(t))})(t>=1),this._getLineContent=e,this._lineCount=t}return e.prototype.getValueOfRange=function(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);for(var t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1),n=e.startLineNumber+1;n<e.endLineNumber;n++)t+="\n"+this._getLineContent(n);return t+="\n"+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1)},e.prototype.getLineLength=function(e){return this._getLineContent(e).length},Object.defineProperty(e.prototype,"length",{get:function(){var e=this._getLineContent(this._lineCount);return new X(this._lineCount-1,e.length)},enumerable:!1,configurable:!0}),e}(),Z=function(e){function t(t){return e.call(this,(function(e){return t[e-1]}),t.length)||this}return T(t,e),t}(U),K=function(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n},Y=function(e,t){this.lineRangeMapping=e,this.changes=t},J=function(){function e(e,t){this.original=e,this.modified=t}return e.prototype.join=function(t){return new e(this.original.join(t.original),this.modified.join(t.modified))},Object.defineProperty(e.prototype,"changedLineCount",{get:function(){return Math.max(this.original.length,this.modified.length)},enumerable:!1,configurable:!0}),e.prototype.toRangeMapping=function(){var e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new ee(e,t);if(1===this.original.startLineNumber||1===this.modified.startLineNumber){if(1!==this.modified.startLineNumber||1!==this.original.startLineNumber)throw new P("not a valid diff");return new ee(new H(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new H(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}return new ee(new H(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new H(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))},e.prototype.toRangeMapping2=function(e,t){if(d(this.original.endLineNumberExclusive,e)&&d(this.modified.endLineNumberExclusive,t))return new ee(new H(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new H(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new ee(H.fromPositions(new j(this.original.startLineNumber,1),h(new j(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),H.fromPositions(new j(this.modified.startLineNumber,1),h(new j(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new ee(H.fromPositions(h(new j(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),h(new j(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),H.fromPositions(h(new j(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),h(new j(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new P},e}(),Q=function(e){function t(t,n,i){var r=e.call(this,t,n)||this;return r.innerChanges=i,r}return T(t,e),t.fromRangeMappings=function(e){return new t(V.join(e.map((function(e){return V.fromRangeInclusive(e.originalRange)}))),V.join(e.map((function(e){return V.fromRangeInclusive(e.modifiedRange)}))),e)},t.prototype.flip=function(){var e;return new t(this.modified,this.original,null===(e=this.innerChanges)||void 0===e?void 0:e.map((function(e){return e.flip()})))},t.prototype.withInnerChangesFromLineRanges=function(){return new t(this.original,this.modified,[this.toRangeMapping()])},t}(J),ee=function(){function e(e,t){this.originalRange=e,this.modifiedRange=t}return e.join=function(e){if(0===e.length)throw new P("Cannot join an empty list of range mappings");for(var t=e[0],n=1;n<e.length;n++)t=t.join(e[n]);return t},e.assertSorted=function(e){for(var t=1;t<e.length;t++){var n=e[t-1],i=e[t];if(!n.originalRange.getEndPosition().isBeforeOrEqual(i.originalRange.getStartPosition())||!n.modifiedRange.getEndPosition().isBeforeOrEqual(i.modifiedRange.getStartPosition()))throw new P("Range mappings must be sorted")}},e.prototype.flip=function(){return new e(this.modifiedRange,this.originalRange)},e.prototype.join=function(t){return new e(this.originalRange.plusRange(t.originalRange),this.modifiedRange.plusRange(t.modifiedRange))},e}(),te=function(){function e(e,t){this.diffs=e,this.hitTimeout=t}return e.trivial=function(t,n){return new e([new ne(F.ofLength(t.length),F.ofLength(n.length))],!1)},e.trivialTimedOut=function(t,n){return new e([new ne(F.ofLength(t.length),F.ofLength(n.length))],!0)},e}(),ne=function(){function e(e,t){this.seq1Range=e,this.seq2Range=t}return e.invert=function(t,n){var i=[];return function(e,t){for(var n=0;n<=e.length;n++)t(0===n?void 0:e[n-1],n===e.length?void 0:e[n])}(t,(function(t,r){i.push(e.fromOffsetPairs(t?t.getEndExclusives():ie.zero,r?r.getStarts():new ie(n,(t?t.seq2Range.endExclusive-t.seq1Range.endExclusive:0)+n)))})),i},e.fromOffsetPairs=function(t,n){return new e(new F(t.offset1,n.offset1),new F(t.offset2,n.offset2))},e.assertSorted=function(e){var t,n,i=void 0;try{for(var r=I(e),o=r.next();!o.done;o=r.next()){var s=o.value;if(i&&!(i.seq1Range.endExclusive<=s.seq1Range.start&&i.seq2Range.endExclusive<=s.seq2Range.start))throw new P("Sequence diffs must be sorted");i=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.swap=function(){return new e(this.seq2Range,this.seq1Range)},e.prototype.join=function(t){return new e(this.seq1Range.join(t.seq1Range),this.seq2Range.join(t.seq2Range))},e.prototype.delta=function(t){return 0===t?this:new e(this.seq1Range.delta(t),this.seq2Range.delta(t))},e.prototype.deltaStart=function(t){return 0===t?this:new e(this.seq1Range.deltaStart(t),this.seq2Range.deltaStart(t))},e.prototype.deltaEnd=function(t){return 0===t?this:new e(this.seq1Range.deltaEnd(t),this.seq2Range.deltaEnd(t))},e.prototype.intersect=function(t){var n=this.seq1Range.intersect(t.seq1Range),i=this.seq2Range.intersect(t.seq2Range);return n&&i?new e(n,i):void 0},e.prototype.getStarts=function(){return new ie(this.seq1Range.start,this.seq2Range.start)},e.prototype.getEndExclusives=function(){return new ie(this.seq1Range.endExclusive,this.seq2Range.endExclusive)},e}(),ie=function(){function e(e,t){this.offset1=e,this.offset2=t}return e.prototype.delta=function(e){return 0===e?this:new k(this.offset1+e,this.offset2+e)},e.prototype.equals=function(e){return this.offset1===e.offset1&&this.offset2===e.offset2},e}();(k=ie).zero=new k(0,0),k.max=new k(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);var re=function(){function e(){}return e.prototype.isValid=function(){return!0},e}();(q=re).instance=new q;var oe=function(){function e(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new P("timeout must be positive")}return e.prototype.isValid=function(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid},e.prototype.disable=function(){this.timeout=Number.MAX_SAFE_INTEGER,this.isValid=function(){return!0},this.valid=!0},e}(),se=function(){function e(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}return e.prototype.get=function(e,t){return this.array[e+t*this.width]},e.prototype.set=function(e,t,n){this.array[e+t*this.width]=n},e}(),ae=function(){function e(e,t,n){this.range=e,this.lines=t,this.source=n,this.histogram=[];for(var i=0,r=e.startLineNumber-1;r<e.endLineNumberExclusive-1;r++){for(var o=t[r],s=0;s<o.length;s++){i++;var a=o[s],u=D.getKey(a);this.histogram[u]=(this.histogram[u]||0)+1}i++;var l=D.getKey("\n");this.histogram[l]=(this.histogram[l]||0)+1}this.totalCount=i}return e.getKey=function(e){var t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t},e.prototype.computeSimilarity=function(e){for(var t,n,i=0,r=Math.max(this.histogram.length,e.histogram.length),o=0;o<r;o++)i+=Math.abs((null!==(t=this.histogram[o])&&void 0!==t?t:0)-(null!==(n=e.histogram[o])&&void 0!==n?n:0));return 1-i/(this.totalCount+e.totalCount)},e}();(D=ae).chrKeys=new Map;var ue=function(){function e(){}return e.prototype.compute=function(e,t,n,i){function r(e,t){(e+1!==p||t+1!==v)&&m.push(new ne(new F(e+1,p),new F(t+1,v))),p=e,v=t}if(void 0===n&&(n=re.instance),0===e.length||0===t.length)return te.trivial(e,t);for(var o=new se(e.length,t.length),s=new se(e.length,t.length),a=new se(e.length,t.length),u=0;u<e.length;u++)for(var l=0;l<t.length;l++){if(!n.isValid())return te.trivialTimedOut(e,t);var h=0===u?0:o.get(u-1,l),d=0===l?0:o.get(u,l-1),c=void 0;e.getElement(u)===t.getElement(l)?(c=0===u||0===l?0:o.get(u-1,l-1),u>0&&l>0&&3===s.get(u-1,l-1)&&(c+=a.get(u-1,l-1)),c+=i?i(u,l):1):c=-1;var f=Math.max(h,d,c);if(f===c){var g=u>0&&l>0?a.get(u-1,l-1):0;a.set(u,l,g+1),s.set(u,l,3)}else f===h?(a.set(u,l,0),s.set(u,l,1)):f===d&&(a.set(u,l,0),s.set(u,l,2));o.set(u,l,f)}for(var m=[],p=e.length,v=t.length,y=e.length-1,w=t.length-1;y>=0&&w>=0;)3===s.get(y,w)?(r(y,w),y--,w--):1===s.get(y,w)?y--:w--;return r(-1,-1),m.reverse(),new te(m,!1)},e}(),le=function(){function e(){}return e.prototype.compute=function(e,t,n){function i(e,t){for(;e<r.length&&t<o.length&&r.getElement(e)===o.getElement(t);)e++,t++;return e}if(void 0===n&&(n=re.instance),0===e.length||0===t.length)return te.trivial(e,t);var r=e,o=t,s=0,a=new de;a.set(0,i(0,0));var u=new ce;u.set(0,0===a.get(0)?null:new he(null,0,0,a.get(0)));var l=0;e:for(;;){if(s++,!n.isValid())return te.trivialTimedOut(r,o);var h=-Math.min(s,o.length+s%2),d=Math.min(s,r.length+s%2);for(l=h;l<=d;l+=2){var c=l===d?-1:a.get(l+1),f=l===h?-1:a.get(l-1)+1,g=Math.min(Math.max(c,f),r.length),m=g-l;if(!(g>r.length||m>o.length)){var p=i(g,m);a.set(l,p);var v=g===c?u.get(l+1):u.get(l-1);if(u.set(l,p!==g?new he(v,g,m,p-g):v),a.get(l)===r.length&&a.get(l)-l===o.length)break e}}}for(var y=u.get(l),w=[],b=r.length,E=o.length;;){var L=y?y.x+y.length:0,x=y?y.y+y.length:0;if((L!==b||x!==E)&&w.push(new ne(new F(L,b),new F(x,E))),!y)break;b=y.x,E=y.y,y=y.prev}return w.reverse(),new te(w,!1)},e}(),he=function(e,t,n,i){this.prev=e,this.x=t,this.y=n,this.length=i},de=function(){function e(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}return e.prototype.get=function(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]},e.prototype.set=function(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){var n=this.negativeArr;this.negativeArr=new Int32Array(2*n.length),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){n=this.positiveArr;this.positiveArr=new Int32Array(2*n.length),this.positiveArr.set(n)}this.positiveArr[e]=t}},e}(),ce=function(){function e(){this.positiveArr=[],this.negativeArr=[]}return e.prototype.get=function(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]},e.prototype.set=function(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t},e}(),fe=function(){function e(){this.map=new Map}return e.prototype.add=function(e,t){var n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)},e.prototype.forEach=function(e,t){var n=this.map.get(e);n&&n.forEach(t)},e.prototype.get=function(e){var t=this.map.get(e);return t||new Set},e}(),ge=function(){function e(e,t,n){this.lines=e,this.range=t,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(var i=this.range.startLineNumber;i<=this.range.endLineNumber;i++){var r=e[i-1],o=0;i===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,r=r.substring(o)),this.lineStartOffsets.push(o);var s=0;if(!n){var a=r.trimStart();s=r.length-a.length,r=a.trimEnd()}this.trimmedWsLengthsByLineIdx.push(s);for(var u=i===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-s,r.length):r.length,l=0;l<u;l++)this.elements.push(r.charCodeAt(l));i<this.range.endLineNumber&&(this.elements.push("\n".charCodeAt(0)),this.firstElementOffsetByLineIdx.push(this.elements.length))}}return e.prototype.toString=function(){return'Slice: "'.concat(this.text,'"')},Object.defineProperty(e.prototype,"text",{get:function(){return this.getText(new F(0,this.length))},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){return this.elements.slice(e.start,e.endExclusive).map((function(e){return String.fromCharCode(e)})).join("")},e.prototype.getElement=function(e){return this.elements[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.elements.length},enumerable:!1,configurable:!0}),e.prototype.getBoundaryScore=function(e){var t=v(e>0?this.elements[e-1]:-1),n=v(e<this.elements.length?this.elements[e]:-1);if(7===t&&8===n)return 0;if(8===t)return 150;var i=0;return t!==n&&(i+=10,0===t&&1===n&&(i+=1)),i+=p(t),i+=p(n)},e.prototype.translateOffset=function(e,t){void 0===t&&(t="right");var n=u(this.firstElementOffsetByLineIdx,(function(t){return t<=e})),i=e-this.firstElementOffsetByLineIdx[n];return new j(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+i+(0===i&&"left"===t?0:this.trimmedWsLengthsByLineIdx[n]))},e.prototype.translateRange=function(e){var t=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(t)?H.fromPositions(n,n):H.fromPositions(t,n)},e.prototype.findWordContaining=function(e){if(!(e<0||e>=this.elements.length)&&g(this.elements[e])){for(var t=e;t>0&&g(this.elements[t-1]);)t--;for(var n=e;n<this.elements.length&&g(this.elements[n]);)n++;return new F(t,n)}},e.prototype.findSubWordContaining=function(e){if(!(e<0||e>=this.elements.length)&&g(this.elements[e])){for(var t=e;t>0&&g(this.elements[t-1])&&!m(this.elements[t]);)t--;for(var n=e;n<this.elements.length&&g(this.elements[n])&&!m(this.elements[n]);)n++;return new F(t,n)}},e.prototype.countLinesIn=function(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber},e.prototype.isStronglyEqual=function(e,t){return this.elements[e]===this.elements[t]},e.prototype.extendToFullLines=function(e){var t,n,i=null!==(t=a(this.firstElementOffsetByLineIdx,(function(t){return t<=e.start})))&&void 0!==t?t:0,r=null!==(n=function(e,t){var n=l(e,t);return n===e.length?void 0:e[n]}(this.firstElementOffsetByLineIdx,(function(t){return e.endExclusive<=t})))&&void 0!==n?n:this.elements.length;return new F(i,r)},e}(),me=((B={})[0]=0,B[1]=0,B[2]=0,B[3]=10,B[4]=2,B[5]=30,B[6]=3,B[7]=10,B[8]=10,B),pe=function(){function e(e,t){this.trimmedHash=e,this.lines=t}return e.prototype.getElement=function(e){return this.trimmedHash[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.trimmedHash.length},enumerable:!1,configurable:!0}),e.prototype.getBoundaryScore=function(e){return 1e3-((0===e?0:_(this.lines[e-1]))+(e===this.lines.length?0:_(this.lines[e])))},e.prototype.getText=function(e){return this.lines.slice(e.start,e.endExclusive).join("\n")},e.prototype.isStronglyEqual=function(e,t){return this.lines[e]===this.lines[t]},e}(),ve=function(){function e(){this.dynamicProgrammingDiffing=new ue,this.myersDiffingAlgorithm=new le}return e.prototype.computeDiff=function(e,t,n){function i(e){var t=h.get(e);return void 0===t&&(t=h.size,h.set(e,t)),t}var r,o,a=this;if(e.length<=1&&function(e,t,n){if(void 0===n&&(n=function(e,t){return e===t}),e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}(e,t,(function(e,t){return e===t})))return new K([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new K([new Q(new V(1,e.length+1),new V(1,t.length+1),[new ee(new H(1,1,e.length,e[e.length-1].length+1),new H(1,1,t.length,t[t.length-1].length+1))])],[],!1);var u=0===n.maxComputationTimeMs?re.instance:new oe(n.maxComputationTimeMs),l=!n.ignoreTrimWhitespace,h=new Map,d=e.map((function(e){return i(e.trim())})),f=t.map((function(e){return i(e.trim())})),g=new pe(d,e),m=new pe(f,t),p=g.length+m.length<1700?a.dynamicProgrammingDiffing.compute(g,m,u,(function(n,i){return e[n]===t[i]?0===t[i].length?.1:1+Math.log(1+t[i].length):.99})):a.myersDiffingAlgorithm.compute(g,m,u),v=p.diffs,y=p.hitTimeout;v=x(g,m,v),v=function(e,t,n){var i=n;if(0===i.length)return i;var r,o=0;do{r=!1;for(var s=[i[0]],a=function(t){var n=i[t],o=s[s.length-1],a=function(t,i){var r=new F(o.seq1Range.endExclusive,n.seq1Range.start);return e.getText(r).replace(/\s/g,"").length<=4&&(t.seq1Range.length+t.seq2Range.length>5||i.seq1Range.length+i.seq2Range.length>5)}(o,n);a?(r=!0,s[s.length-1]=s[s.length-1].join(n)):s.push(n)},u=1;u<i.length;u++)a(u);i=s}while(o++<10&&r);return i}(g,0,v);var w=[],b=function(i){var r,o;if(l)for(var s=0;s<i;s++){var h=E+s,d=L+s;if(e[h]!==t[d]){var c=a.refineDiff(e,t,new ne(new F(h,h+1),new F(d,d+1)),u,l,n);try{for(var f=(r=void 0,I(c.mappings)),g=f.next();!g.done;g=f.next()){var m=g.value;w.push(m)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}c.hitTimeout&&(y=!0)}}},E=0,L=0,R=function(i){var r,o;s((function(){return i.seq1Range.start-E==i.seq2Range.start-L}));var a=i.seq1Range.start-E;b(a),E=i.seq1Range.endExclusive,L=i.seq2Range.endExclusive;var h=N.refineDiff(e,t,i,u,l,n);h.hitTimeout&&(y=!0);try{for(var d=(r=void 0,I(h.mappings)),c=d.next();!c.done;c=d.next()){var f=c.value;w.push(f)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}},N=this;try{for(var S=I(v),A=S.next();!A.done;A=S.next()){R(A.value)}}catch(e){r={error:e}}finally{try{A&&!A.done&&(o=S.return)&&o.call(S)}finally{if(r)throw r.error}}b(e.length-E);var _=c(w,new Z(e),new Z(t)),C=[];return n.computeMoves&&(C=this.computeMoves(_,e,t,d,f,u,l,n)),s((function(){function n(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;var n=t[e.lineNumber-1];return!(e.column<1||e.column>n.length+1)}function i(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1)&&!(e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}var r,o,s,a;try{for(var u=I(_),l=u.next();!l.done;l=u.next()){var h=l.value;if(!h.innerChanges)return!1;try{for(var d=(s=void 0,I(h.innerChanges)),c=d.next();!c.done;c=d.next()){var f=c.value;if(!(n(f.modifiedRange.getStartPosition(),t)&&n(f.modifiedRange.getEndPosition(),t)&&n(f.originalRange.getStartPosition(),e)&&n(f.originalRange.getEndPosition(),e)))return!1}}catch(e){s={error:e}}finally{try{c&&!c.done&&(a=d.return)&&a.call(d)}finally{if(s)throw s.error}}if(!i(h.modified,t)||!i(h.original,e))return!1}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return!0})),new K(_,C,y)},e.prototype.computeMoves=function(e,t,n,i,r,o,s,a){var u=this,l=y(e,t,n,i,r,o).map((function(e){var i=c(u.refineDiff(t,n,new ne(e.original.toOffsetRange(),e.modified.toOffsetRange()),o,s,a).mappings,new Z(t),new Z(n),!0);return new Y(e,i)}));return l},e.prototype.refineDiff=function(e,t,n,i,r,o){var s=function(e){return new J(new V(e.seq1Range.start+1,e.seq1Range.endExclusive+1),new V(e.seq2Range.start+1,e.seq2Range.endExclusive+1))}(n),a=s.toRangeMapping2(e,t),u=new ge(e,a.originalRange,r),l=new ge(t,a.modifiedRange,r),h=u.length+l.length<500?this.dynamicProgrammingDiffing.compute(u,l,i):this.myersDiffingAlgorithm.compute(u,l,i),d=h.diffs;d=x(u,l,d),d=A(u,l,d,(function(e,t){return e.findWordContaining(t)})),o.extendToSubwords&&(d=A(u,l,d,(function(e,t){return e.findSubWordContaining(t)}),!0)),d=S(0,0,d),d=function(e,t,n){var i=n;if(0===i.length)return i;var r,o=0;do{r=!1;for(var s=[i[0]],a=function(n){var o=i[n],a=s[s.length-1],u=function(n,i){function r(e){return Math.min(e,v)}var s=new F(a.seq1Range.endExclusive,o.seq1Range.start);if(e.countLinesIn(s)>5||s.length>500)return!1;var u=e.getText(s).trim();if(u.length>20||u.split(/\r\n|\r|\n/).length>1)return!1;var l=e.countLinesIn(n.seq1Range),h=n.seq1Range.length,d=t.countLinesIn(n.seq2Range),c=n.seq2Range.length,f=e.countLinesIn(i.seq1Range),g=i.seq1Range.length,m=t.countLinesIn(i.seq2Range),p=i.seq2Range.length,v=130;return Math.pow(Math.pow(r(40*l+h),1.5)+Math.pow(r(40*d+c),1.5),1.5)+Math.pow(Math.pow(r(40*f+g),1.5)+Math.pow(r(40*m+p),1.5),1.5)>1.3*Math.pow(Math.pow(v,1.5),1.5)}(a,o);u?(r=!0,s[s.length-1]=s[s.length-1].join(o)):s.push(o)},u=1;u<i.length;u++)a(u);i=s}while(o++<10&&r);var l=[];return function(e,t){for(var n=0;n<e.length;n++)t(0===n?void 0:e[n-1],e[n],n+1===e.length?void 0:e[n+1])}(i,(function(t,n,i){function r(e){return e.length>0&&e.trim().length<=3&&n.seq1Range.length+n.seq2Range.length>100}var o=n,s=e.extendToFullLines(n.seq1Range),a=e.getText(new F(s.start,n.seq1Range.start));r(a)&&(o=o.deltaStart(-a.length));var u=e.getText(new F(n.seq1Range.endExclusive,s.endExclusive));r(u)&&(o=o.deltaEnd(u.length));var h=ne.fromOffsetPairs(t?t.getEndExclusives():ie.zero,i?i.getStarts():ie.max),d=o.intersect(h);l.length>0&&d.getStarts().equals(l[l.length-1].getEndExclusives())?l[l.length-1]=l[l.length-1].join(d):l.push(d)})),l}(u,l,d);var c=d.map((function(e){return new ee(u.translateRange(e.seq1Range),l.translateRange(e.seq2Range))}));return{mappings:c,hitTimeout:h.hitTimeout}},e}();t.computeDiff=C;var ye=e("../../../range").Range,we=e("../base_diff_view").DiffChunk,be=function(){function e(){}return e.prototype.compute=function(e,t,n){return n||(n={}),n.maxComputationTimeMs||(n.maxComputationTimeMs=500),(C(e,t,n)||[]).map((function(e){return new we(new ye(e.origStart,0,e.origEnd,0),new ye(e.editStart,0,e.editEnd,0),e.charChanges)}))},e}();t.DiffProvider=be})),ace.define("ace/ext/diff",["require","exports","module","ace/ext/diff/inline_diff_view","ace/ext/diff/split_diff_view","ace/ext/diff/providers/default"],(function(e,t,n){var i=e("./diff/inline_diff_view").InlineDiffView,r=e("./diff/split_diff_view").SplitDiffView,o=e("./diff/providers/default").DiffProvider;t.InlineDiffView=i,t.SplitDiffView=r,t.DiffProvider=o,t.createDiffView=function(e,t){var n;return(e=e||{}).diffProvider=e.diffProvider||new o,n=e.inline?new i(e):new r(e),t&&n.setOptions(t),n}})),ace.require(["ace/ext/diff"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));
|
|
1
|
+
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(C.contains(m)||B.contains(g))break;if(!L(i[g-1],r[m-1],s))break}f>0&&(B.addRange(new V(n.original.startLineNumber-f,n.original.startLineNumber)),C.addRange(new V(n.modified.startLineNumber-f,n.modified.startLineNumber)));var v=void 0;for(v=0;v<c;v++){g=n.original.endLineNumberExclusive+v,m=n.modified.endLineNumberExclusive+v;if(g>i.length||m>r.length)break;if(C.contains(m)||B.contains(g))break;if(!L(i[g-1],r[m-1],s))break}v>0&&(B.addRange(new V(n.original.endLineNumberExclusive,n.original.endLineNumberExclusive+v)),C.addRange(new V(n.modified.endLineNumberExclusive,n.modified.endLineNumberExclusive+v))),(f>0||v>0)&&(p[t]=new J(new V(n.original.startLineNumber-f,n.original.endLineNumberExclusive+v),new V(n.modified.startLineNumber-f,n.modified.endLineNumberExclusive+v)))};for(b=0;b<p.length;b++)Z(b);return p}function L(e,t,n){var i,r;if(e.trim()===t.trim())return!0;if(e.length>300&&t.length>300)return!1;var o=(new le).compute(new ge([e],new H(1,1,1,e.length),!1),new ge([t],new H(1,1,1,t.length),!1),n),s=0,a=ne.invert(o.diffs,e.length);try{for(var u=I(a),l=u.next();!l.done;l=u.next()){l.value.seq1Range.forEach((function(t){f(e.charCodeAt(t))||s++}))}}catch(e){i={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(i)throw i.error}}var h=function(t){for(var n=0,i=0;i<e.length;i++)f(t.charCodeAt(i))||n++;return n}(e.length>t.length?e:t);return s/h>.6&&h>10}function x(e,t,n){var i=n;return i=R(e,t,i),i=function(e,t,n){if(!e.getBoundaryScore||!t.getBoundaryScore)return n;for(var i=0;i<n.length;i++){var r=i>0?n[i-1]:void 0,o=n[i],s=i+1<n.length?n[i+1]:void 0,a=new F(r?r.seq1Range.endExclusive+1:0,s?s.seq1Range.start-1:e.length),u=new F(r?r.seq2Range.endExclusive+1:0,s?s.seq2Range.start-1:t.length);o.seq1Range.isEmpty?n[i]=N(o,e,t,a,u):o.seq2Range.isEmpty&&(n[i]=N(o.swap(),t,e,u,a).swap())}return n}(e,t,i=R(e,t,i)),i}function R(e,t,n){if(0===n.length)return n;var i=[];i.push(n[0]);for(var r=1;r<n.length;r++){var o=i[i.length-1];if((l=n[r]).seq1Range.isEmpty||l.seq2Range.isEmpty){var s=l.seq1Range.start-o.seq1Range.endExclusive,a=void 0;for(a=1;a<=s&&(e.getElement(l.seq1Range.start-a)===e.getElement(l.seq1Range.endExclusive-a)&&t.getElement(l.seq2Range.start-a)===t.getElement(l.seq2Range.endExclusive-a));a++);if(--a===s){i[i.length-1]=new ne(new F(o.seq1Range.start,l.seq1Range.endExclusive-s),new F(o.seq2Range.start,l.seq2Range.endExclusive-s));continue}l=l.delta(-a)}i.push(l)}var u=[];for(r=0;r<i.length-1;r++){var l,h=i[r+1];if((l=i[r]).seq1Range.isEmpty||l.seq2Range.isEmpty){s=h.seq1Range.start-l.seq1Range.endExclusive,a=void 0;for(a=0;a<s&&(e.isStronglyEqual(l.seq1Range.start+a,l.seq1Range.endExclusive+a)&&t.isStronglyEqual(l.seq2Range.start+a,l.seq2Range.endExclusive+a));a++);if(a===s){i[r+1]=new ne(new F(l.seq1Range.start+s,h.seq1Range.endExclusive),new F(l.seq2Range.start+s,h.seq2Range.endExclusive));continue}a>0&&(l=l.delta(a))}u.push(l)}return i.length>0&&u.push(i[i.length-1]),u}function N(e,t,n,i,r){for(var o=1;e.seq1Range.start-o>=i.start&&e.seq2Range.start-o>=r.start&&n.isStronglyEqual(e.seq2Range.start-o,e.seq2Range.endExclusive-o)&&o<100;)o++;o--;for(var s=0;e.seq1Range.start+s<i.endExclusive&&e.seq2Range.endExclusive+s<r.endExclusive&&n.isStronglyEqual(e.seq2Range.start+s,e.seq2Range.endExclusive+s)&&s<100;)s++;if(0===o&&0===s)return e;for(var a=0,u=-1,l=-o;l<=s;l++){var h=e.seq2Range.start+l,d=e.seq2Range.endExclusive+l,c=e.seq1Range.start+l,f=t.getBoundaryScore(c)+n.getBoundaryScore(h)+n.getBoundaryScore(d);f>u&&(u=f,a=l)}return e.delta(a)}function S(e,t,n){var i,r,o=[];try{for(var s=I(n),a=s.next();!a.done;a=s.next()){var u=a.value,l=o[o.length-1];l?u.seq1Range.start-l.seq1Range.endExclusive<=2||u.seq2Range.start-l.seq2Range.endExclusive<=2?o[o.length-1]=new ne(l.seq1Range.join(u.seq1Range),l.seq2Range.join(u.seq2Range)):o.push(u):o.push(u)}}catch(e){i={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function A(e,t,n,i,r){function o(n,o){if(!(n.offset1<u.offset1||n.offset2<u.offset2)){var l=i(e,n.offset1),h=i(t,n.offset2);if(l&&h){for(var d=new ne(l,h),c=d.intersect(o),f=c.seq1Range.length,g=c.seq2Range.length;s.length>0;){var m=s[0];if(!(m.seq1Range.intersects(d.seq1Range)||m.seq2Range.intersects(d.seq2Range)))break;var p=i(e,m.seq1Range.start),v=i(t,m.seq2Range.start),y=new ne(p,v),w=y.intersect(m);if(f+=w.seq1Range.length,g+=w.seq2Range.length,!((d=d.join(y)).seq1Range.endExclusive>=m.seq1Range.endExclusive))break;s.shift()}(r&&f+g<d.seq1Range.length+d.seq2Range.length||f+g<2*(d.seq1Range.length+d.seq2Range.length)/3)&&a.push(d),u=d.getEndExclusives()}}}void 0===r&&(r=!1);for(var s=ne.invert(n,e.length),a=[],u=new ie(0,0);s.length>0;){var l=s.shift();l.seq1Range.isEmpty||(o(l.getStarts(),l),o(l.getEndExclusives().delta(-1),l))}var h=function(e,t){var n=[];for(;e.length>0||t.length>0;){var i=e[0],r=t[0],o=void 0;o=i&&(!r||i.seq1Range.start<r.seq1Range.start)?e.shift():t.shift(),n.length>0&&n[n.length-1].seq1Range.endExclusive>=o.seq1Range.start?n[n.length-1]=n[n.length-1].join(o):n.push(o)}return n}(n,a);return h}function _(e){for(var t=0;t<e.length&&(32===e.charCodeAt(t)||9===e.charCodeAt(t));)t++;return t}function C(e,t,n){var i=(new ve).computeDiff(e,t,n);return null==i?void 0:i.changes.map((function(e){var t=e.innerChanges;return{origStart:e.original.startLineNumber-1,origEnd:e.original.endLineNumberExclusive-1,editStart:e.modified.startLineNumber-1,editEnd:e.modified.endLineNumberExclusive-1,charChanges:null==t?void 0:t.map((function(e){return{originalStartLineNumber:e.originalRange.startLineNumber-1,originalStartColumn:e.originalRange.startColumn-1,originalEndLineNumber:e.originalRange.endLineNumber-1,originalEndColumn:e.originalRange.endColumn-1,modifiedStartLineNumber:e.modifiedRange.startLineNumber-1,modifiedStartColumn:e.modifiedRange.startColumn-1,modifiedEndLineNumber:e.modifiedRange.endLineNumber-1,modifiedEndColumn:e.modifiedRange.endColumn-1}}))}}))}var B,$,M,k,q,D,T=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)}}(),O=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;u&&(u=0,n[0]&&(a=0)),a;)try{if(r=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[2&n[0],s.value]),n[0]){case 0:case 1:s=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(s=a.trys,(s=s.length>0&&s[s.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){a.label=n[1];break}if(6===n[0]&&a.label<s[1]){a.label=s[1],s=n;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(n);break}s[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=n(0),u.throw=n(1),u.return=n(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u},I=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.")},W=function(e,t){return e-t},P=function(e){function t(n){var i=e.call(this,n||"An unexpected bug occurred.")||this;return Object.setPrototypeOf(i,t.prototype),i}return T(t,e),t}(Error),F=function(){function e(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new P("Invalid range: ".concat(this.toString()))}return e.fromTo=function(t,n){return new e(t,n)},e.addRange=function(t,n){for(var i=0;i<n.length&&n[i].endExclusive<t.start;)i++;for(var r=i;r<n.length&&n[r].start<=t.endExclusive;)r++;if(i===r)n.splice(i,0,t);else{var o=Math.min(t.start,n[i].start),s=Math.max(t.endExclusive,n[r-1].endExclusive);n.splice(i,r-i,new e(o,s))}},e.tryCreate=function(t,n){return t>n?void 0:new e(t,n)},e.ofLength=function(t){return new e(0,t)},e.ofStartAndLength=function(t,n){return new e(t,t+n)},e.emptyAt=function(t){return new e(t,t)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.start===this.endExclusive},enumerable:!1,configurable:!0}),e.prototype.delta=function(t){return new e(this.start+t,this.endExclusive+t)},e.prototype.deltaStart=function(t){return new e(this.start+t,this.endExclusive)},e.prototype.deltaEnd=function(t){return new e(this.start,this.endExclusive+t)},Object.defineProperty(e.prototype,"length",{get:function(){return this.endExclusive-this.start},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return"[".concat(this.start,", ").concat(this.endExclusive,")")},e.prototype.equals=function(e){return this.start===e.start&&this.endExclusive===e.endExclusive},e.prototype.containsRange=function(e){return this.start<=e.start&&e.endExclusive<=this.endExclusive},e.prototype.contains=function(e){return this.start<=e&&e<this.endExclusive},e.prototype.join=function(t){return new e(Math.min(this.start,t.start),Math.max(this.endExclusive,t.endExclusive))},e.prototype.intersect=function(t){var n=Math.max(this.start,t.start),i=Math.min(this.endExclusive,t.endExclusive);return n<=i?new e(n,i):void 0},e.prototype.intersectionLength=function(e){var t=Math.max(this.start,e.start),n=Math.min(this.endExclusive,e.endExclusive);return Math.max(0,n-t)},e.prototype.intersects=function(e){return Math.max(this.start,e.start)<Math.min(this.endExclusive,e.endExclusive)},e.prototype.intersectsOrTouches=function(e){return Math.max(this.start,e.start)<=Math.min(this.endExclusive,e.endExclusive)},e.prototype.isBefore=function(e){return this.endExclusive<=e.start},e.prototype.isAfter=function(e){return this.start>=e.endExclusive},e.prototype.slice=function(e){return e.slice(this.start,this.endExclusive)},e.prototype.substring=function(e){return e.substring(this.start,this.endExclusive)},e.prototype.clip=function(e){if(this.isEmpty)throw new P("Invalid clipping range: ".concat(this.toString()));return Math.max(this.start,Math.min(this.endExclusive-1,e))},e.prototype.clipCyclic=function(e){if(this.isEmpty)throw new P("Invalid clipping range: ".concat(this.toString()));return e<this.start?this.endExclusive-(this.start-e)%this.length:e>=this.endExclusive?this.start+(e-this.start)%this.length:e},e.prototype.map=function(e){for(var t=[],n=this.start;n<this.endExclusive;n++)t.push(e(n));return t},e.prototype.forEach=function(e){for(var t=this.start;t<this.endExclusive;t++)e(t)},e}(),j=function(){function e(e,t){this.lineNumber=e,this.column=t}return e.prototype.equals=function(t){return e.equals(this,t)},e.equals=function(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column},e.prototype.isBefore=function(t){return e.isBefore(this,t)},e.isBefore=function(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<t.column},e.prototype.isBeforeOrEqual=function(t){return e.isBeforeOrEqual(this,t)},e.isBeforeOrEqual=function(e,t){return e.lineNumber<t.lineNumber||!(t.lineNumber<e.lineNumber)&&e.column<=t.column},e}(),H=function(){function e(e,t,n,i){e>n||e===n&&t>i?(this.startLineNumber=n,this.startColumn=i,this.endLineNumber=e,this.endColumn=t):(this.startLineNumber=e,this.startColumn=t,this.endLineNumber=n,this.endColumn=i)}return e.prototype.isEmpty=function(){return e.isEmpty(this)},e.isEmpty=function(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn},e.prototype.containsPosition=function(t){return e.containsPosition(this,t)},e.containsPosition=function(e,t){return!(t.lineNumber<e.startLineNumber||t.lineNumber>e.endLineNumber)&&(!(t.lineNumber===e.startLineNumber&&t.column<e.startColumn)&&!(t.lineNumber===e.endLineNumber&&t.column>e.endColumn))},e.prototype.containsRange=function(t){return e.containsRange(this,t)},e.containsRange=function(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber)&&(!(t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>e.endColumn)))},e.prototype.strictContainsRange=function(t){return e.strictContainsRange(this,t)},e.strictContainsRange=function(e,t){return!(t.startLineNumber<e.startLineNumber||t.endLineNumber<e.startLineNumber)&&(!(t.startLineNumber>e.endLineNumber||t.endLineNumber>e.endLineNumber)&&(!(t.startLineNumber===e.startLineNumber&&t.startColumn<=e.startColumn)&&!(t.endLineNumber===e.endLineNumber&&t.endColumn>=e.endColumn)))},e.prototype.plusRange=function(t){return e.plusRange(this,t)},e.plusRange=function(t,n){var i,r,o,s;return n.startLineNumber<t.startLineNumber?(i=n.startLineNumber,r=n.startColumn):n.startLineNumber===t.startLineNumber?(i=n.startLineNumber,r=Math.min(n.startColumn,t.startColumn)):(i=t.startLineNumber,r=t.startColumn),n.endLineNumber>t.endLineNumber?(o=n.endLineNumber,s=n.endColumn):n.endLineNumber===t.endLineNumber?(o=n.endLineNumber,s=Math.max(n.endColumn,t.endColumn)):(o=t.endLineNumber,s=t.endColumn),new e(i,r,o,s)},e.prototype.intersectRanges=function(t){return e.intersectRanges(this,t)},e.intersectRanges=function(t,n){var i=t.startLineNumber,r=t.startColumn,o=t.endLineNumber,s=t.endColumn,a=n.startLineNumber,u=n.startColumn,l=n.endLineNumber,h=n.endColumn;return i<a?(i=a,r=u):i===a&&(r=Math.max(r,u)),o>l?(o=l,s=h):o===l&&(s=Math.min(s,h)),i>o||i===o&&r>s?null:new e(i,r,o,s)},e.prototype.equalsRange=function(t){return e.equalsRange(this,t)},e.equalsRange=function(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn},e.prototype.getEndPosition=function(){return e.getEndPosition(this)},e.getEndPosition=function(e){return new j(e.endLineNumber,e.endColumn)},e.prototype.getStartPosition=function(){return e.getStartPosition(this)},e.getStartPosition=function(e){return new j(e.startLineNumber,e.startColumn)},e.prototype.collapseToStart=function(){return e.collapseToStart(this)},e.collapseToStart=function(t){return new e(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn)},e.prototype.collapseToEnd=function(){return e.collapseToEnd(this)},e.collapseToEnd=function(t){return new e(t.endLineNumber,t.endColumn,t.endLineNumber,t.endColumn)},e.fromPositions=function(t,n){return void 0===n&&(n=t),new e(t.lineNumber,t.column,n.lineNumber,n.column)},e}(),z=function(){function e(e){this._array=e,this._findLastMonotonousLastIdx=0}return e.prototype.findLastMonotonous=function(e){var t,n;if($.assertInvariants){if(this._prevFindLastPredicate)try{for(var i=I(this._array),r=i.next();!r.done;r=i.next()){var o=r.value;if(this._prevFindLastPredicate(o)&&!e(o))throw new Error("MonotonousArray: current predicate must be weaker than (or equal to) the previous predicate.")}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}this._prevFindLastPredicate=e}var s=u(this._array,e,this._findLastMonotonousLastIdx);return this._findLastMonotonousLastIdx=s+1,-1===s?void 0:this._array[s]},e}();($=z).assertInvariants=!1;var V=function(){function e(e,t){if(e>t)throw new P("startLineNumber ".concat(e," cannot be after endLineNumberExclusive ").concat(t));this.startLineNumber=e,this.endLineNumberExclusive=t}return e.fromRangeInclusive=function(t){return new e(t.startLineNumber,t.endLineNumber+1)},e.join=function(t){if(0===t.length)throw new P("lineRanges cannot be empty");for(var n=t[0].startLineNumber,i=t[0].endLineNumberExclusive,r=1;r<t.length;r++)n=Math.min(n,t[r].startLineNumber),i=Math.max(i,t[r].endLineNumberExclusive);return new e(n,i)},e.ofLength=function(t,n){return new e(t,t+n)},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.startLineNumber===this.endLineNumberExclusive},enumerable:!1,configurable:!0}),e.prototype.delta=function(t){return new e(this.startLineNumber+t,this.endLineNumberExclusive+t)},Object.defineProperty(e.prototype,"length",{get:function(){return this.endLineNumberExclusive-this.startLineNumber},enumerable:!1,configurable:!0}),e.prototype.join=function(t){return new e(Math.min(this.startLineNumber,t.startLineNumber),Math.max(this.endLineNumberExclusive,t.endLineNumberExclusive))},e.prototype.intersect=function(t){var n=Math.max(this.startLineNumber,t.startLineNumber),i=Math.min(this.endLineNumberExclusive,t.endLineNumberExclusive);return n<=i?new e(n,i):void 0},e.prototype.overlapOrTouch=function(e){return this.startLineNumber<=e.endLineNumberExclusive&&e.startLineNumber<=this.endLineNumberExclusive},e.prototype.toInclusiveRange=function(){return this.isEmpty?null:new H(this.startLineNumber,1,this.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER)},e.prototype.toOffsetRange=function(){return new F(this.startLineNumber-1,this.endLineNumberExclusive-1)},e}(),G=function(){function e(e){void 0===e&&(e=[]),this._normalizedRanges=e}return Object.defineProperty(e.prototype,"ranges",{get:function(){return this._normalizedRanges},enumerable:!1,configurable:!0}),e.prototype.addRange=function(e){if(0!==e.length){var t=l(this._normalizedRanges,(function(t){return t.endLineNumberExclusive>=e.startLineNumber})),n=u(this._normalizedRanges,(function(t){return t.startLineNumber<=e.endLineNumberExclusive}))+1;if(t===n)this._normalizedRanges.splice(t,0,e);else if(t===n-1){var i=this._normalizedRanges[t];this._normalizedRanges[t]=i.join(e)}else{i=this._normalizedRanges[t].join(this._normalizedRanges[n-1]).join(e);this._normalizedRanges.splice(t,n-t,i)}}},e.prototype.contains=function(e){var t=a(this._normalizedRanges,(function(t){return t.startLineNumber<=e}));return!!t&&t.endLineNumberExclusive>e},e.prototype.subtractFrom=function(t){var n=l(this._normalizedRanges,(function(e){return e.endLineNumberExclusive>=t.startLineNumber})),i=u(this._normalizedRanges,(function(e){return e.startLineNumber<=t.endLineNumberExclusive}))+1;if(n===i)return new e([t]);for(var r=[],o=t.startLineNumber,s=n;s<i;s++){var a=this._normalizedRanges[s];a.startLineNumber>o&&r.push(new V(o,a.startLineNumber)),o=a.endLineNumberExclusive}return o<t.endLineNumberExclusive&&r.push(new V(o,t.endLineNumberExclusive)),new e(r)},e.prototype.getIntersection=function(t){for(var n=[],i=0,r=0;i<this._normalizedRanges.length&&r<t._normalizedRanges.length;){var o=this._normalizedRanges[i],s=t._normalizedRanges[r],a=o.intersect(s);a&&!a.isEmpty&&n.push(a),o.endLineNumberExclusive<s.endLineNumberExclusive?i++:r++}return new e(n)},e.prototype.getWithDelta=function(t){return new e(this._normalizedRanges.map((function(e){return e.delta(t)})))},e}(),X=function(){function e(e,t){this.lineCount=e,this.columnCount=t}return e.prototype.toLineRange=function(){return V.ofLength(1,this.lineCount)},e.prototype.addToPosition=function(e){return 0===this.lineCount?new j(e.lineNumber,e.column+this.columnCount):new j(e.lineNumber+this.lineCount,this.columnCount+1)},e}();(M=X).zero=new M(0,0);var U=function(){function e(e,t){(function(e,t){if(void 0===t&&(t="unexpected state"),!e)throw new P("Assertion Failed: ".concat(t))})(t>=1),this._getLineContent=e,this._lineCount=t}return e.prototype.getValueOfRange=function(e){if(e.startLineNumber===e.endLineNumber)return this._getLineContent(e.startLineNumber).substring(e.startColumn-1,e.endColumn-1);for(var t=this._getLineContent(e.startLineNumber).substring(e.startColumn-1),n=e.startLineNumber+1;n<e.endLineNumber;n++)t+="\n"+this._getLineContent(n);return t+="\n"+this._getLineContent(e.endLineNumber).substring(0,e.endColumn-1)},e.prototype.getLineLength=function(e){return this._getLineContent(e).length},Object.defineProperty(e.prototype,"length",{get:function(){var e=this._getLineContent(this._lineCount);return new X(this._lineCount-1,e.length)},enumerable:!1,configurable:!0}),e}(),Z=function(e){function t(t){return e.call(this,(function(e){return t[e-1]}),t.length)||this}return T(t,e),t}(U),K=function(e,t,n){this.changes=e,this.moves=t,this.hitTimeout=n},Y=function(e,t){this.lineRangeMapping=e,this.changes=t},J=function(){function e(e,t){this.original=e,this.modified=t}return e.prototype.join=function(t){return new e(this.original.join(t.original),this.modified.join(t.modified))},Object.defineProperty(e.prototype,"changedLineCount",{get:function(){return Math.max(this.original.length,this.modified.length)},enumerable:!1,configurable:!0}),e.prototype.toRangeMapping=function(){var e=this.original.toInclusiveRange(),t=this.modified.toInclusiveRange();if(e&&t)return new ee(e,t);if(1===this.original.startLineNumber||1===this.modified.startLineNumber){if(1!==this.modified.startLineNumber||1!==this.original.startLineNumber)throw new P("not a valid diff");return new ee(new H(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new H(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1))}return new ee(new H(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),new H(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER,this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER))},e.prototype.toRangeMapping2=function(e,t){if(d(this.original.endLineNumberExclusive,e)&&d(this.modified.endLineNumberExclusive,t))return new ee(new H(this.original.startLineNumber,1,this.original.endLineNumberExclusive,1),new H(this.modified.startLineNumber,1,this.modified.endLineNumberExclusive,1));if(!this.original.isEmpty&&!this.modified.isEmpty)return new ee(H.fromPositions(new j(this.original.startLineNumber,1),h(new j(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),H.fromPositions(new j(this.modified.startLineNumber,1),h(new j(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));if(this.original.startLineNumber>1&&this.modified.startLineNumber>1)return new ee(H.fromPositions(h(new j(this.original.startLineNumber-1,Number.MAX_SAFE_INTEGER),e),h(new j(this.original.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),e)),H.fromPositions(h(new j(this.modified.startLineNumber-1,Number.MAX_SAFE_INTEGER),t),h(new j(this.modified.endLineNumberExclusive-1,Number.MAX_SAFE_INTEGER),t)));throw new P},e}(),Q=function(e){function t(t,n,i){var r=e.call(this,t,n)||this;return r.innerChanges=i,r}return T(t,e),t.fromRangeMappings=function(e){return new t(V.join(e.map((function(e){return V.fromRangeInclusive(e.originalRange)}))),V.join(e.map((function(e){return V.fromRangeInclusive(e.modifiedRange)}))),e)},t.prototype.flip=function(){var e;return new t(this.modified,this.original,null===(e=this.innerChanges)||void 0===e?void 0:e.map((function(e){return e.flip()})))},t.prototype.withInnerChangesFromLineRanges=function(){return new t(this.original,this.modified,[this.toRangeMapping()])},t}(J),ee=function(){function e(e,t){this.originalRange=e,this.modifiedRange=t}return e.join=function(e){if(0===e.length)throw new P("Cannot join an empty list of range mappings");for(var t=e[0],n=1;n<e.length;n++)t=t.join(e[n]);return t},e.assertSorted=function(e){for(var t=1;t<e.length;t++){var n=e[t-1],i=e[t];if(!n.originalRange.getEndPosition().isBeforeOrEqual(i.originalRange.getStartPosition())||!n.modifiedRange.getEndPosition().isBeforeOrEqual(i.modifiedRange.getStartPosition()))throw new P("Range mappings must be sorted")}},e.prototype.flip=function(){return new e(this.modifiedRange,this.originalRange)},e.prototype.join=function(t){return new e(this.originalRange.plusRange(t.originalRange),this.modifiedRange.plusRange(t.modifiedRange))},e}(),te=function(){function e(e,t){this.diffs=e,this.hitTimeout=t}return e.trivial=function(t,n){return new e([new ne(F.ofLength(t.length),F.ofLength(n.length))],!1)},e.trivialTimedOut=function(t,n){return new e([new ne(F.ofLength(t.length),F.ofLength(n.length))],!0)},e}(),ne=function(){function e(e,t){this.seq1Range=e,this.seq2Range=t}return e.invert=function(t,n){var i=[];return function(e,t){for(var n=0;n<=e.length;n++)t(0===n?void 0:e[n-1],n===e.length?void 0:e[n])}(t,(function(t,r){i.push(e.fromOffsetPairs(t?t.getEndExclusives():ie.zero,r?r.getStarts():new ie(n,(t?t.seq2Range.endExclusive-t.seq1Range.endExclusive:0)+n)))})),i},e.fromOffsetPairs=function(t,n){return new e(new F(t.offset1,n.offset1),new F(t.offset2,n.offset2))},e.assertSorted=function(e){var t,n,i=void 0;try{for(var r=I(e),o=r.next();!o.done;o=r.next()){var s=o.value;if(i&&!(i.seq1Range.endExclusive<=s.seq1Range.start&&i.seq2Range.endExclusive<=s.seq2Range.start))throw new P("Sequence diffs must be sorted");i=s}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},e.prototype.swap=function(){return new e(this.seq2Range,this.seq1Range)},e.prototype.join=function(t){return new e(this.seq1Range.join(t.seq1Range),this.seq2Range.join(t.seq2Range))},e.prototype.delta=function(t){return 0===t?this:new e(this.seq1Range.delta(t),this.seq2Range.delta(t))},e.prototype.deltaStart=function(t){return 0===t?this:new e(this.seq1Range.deltaStart(t),this.seq2Range.deltaStart(t))},e.prototype.deltaEnd=function(t){return 0===t?this:new e(this.seq1Range.deltaEnd(t),this.seq2Range.deltaEnd(t))},e.prototype.intersect=function(t){var n=this.seq1Range.intersect(t.seq1Range),i=this.seq2Range.intersect(t.seq2Range);return n&&i?new e(n,i):void 0},e.prototype.getStarts=function(){return new ie(this.seq1Range.start,this.seq2Range.start)},e.prototype.getEndExclusives=function(){return new ie(this.seq1Range.endExclusive,this.seq2Range.endExclusive)},e}(),ie=function(){function e(e,t){this.offset1=e,this.offset2=t}return e.prototype.delta=function(e){return 0===e?this:new k(this.offset1+e,this.offset2+e)},e.prototype.equals=function(e){return this.offset1===e.offset1&&this.offset2===e.offset2},e}();(k=ie).zero=new k(0,0),k.max=new k(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);var re=function(){function e(){}return e.prototype.isValid=function(){return!0},e}();(q=re).instance=new q;var oe=function(){function e(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new P("timeout must be positive")}return e.prototype.isValid=function(){return!(Date.now()-this.startTime<this.timeout)&&this.valid&&(this.valid=!1),this.valid},e.prototype.disable=function(){this.timeout=Number.MAX_SAFE_INTEGER,this.isValid=function(){return!0},this.valid=!0},e}(),se=function(){function e(e,t){this.width=e,this.height=t,this.array=[],this.array=new Array(e*t)}return e.prototype.get=function(e,t){return this.array[e+t*this.width]},e.prototype.set=function(e,t,n){this.array[e+t*this.width]=n},e}(),ae=function(){function e(e,t,n){this.range=e,this.lines=t,this.source=n,this.histogram=[];for(var i=0,r=e.startLineNumber-1;r<e.endLineNumberExclusive-1;r++){for(var o=t[r],s=0;s<o.length;s++){i++;var a=o[s],u=D.getKey(a);this.histogram[u]=(this.histogram[u]||0)+1}i++;var l=D.getKey("\n");this.histogram[l]=(this.histogram[l]||0)+1}this.totalCount=i}return e.getKey=function(e){var t=this.chrKeys.get(e);return void 0===t&&(t=this.chrKeys.size,this.chrKeys.set(e,t)),t},e.prototype.computeSimilarity=function(e){for(var t,n,i=0,r=Math.max(this.histogram.length,e.histogram.length),o=0;o<r;o++)i+=Math.abs((null!==(t=this.histogram[o])&&void 0!==t?t:0)-(null!==(n=e.histogram[o])&&void 0!==n?n:0));return 1-i/(this.totalCount+e.totalCount)},e}();(D=ae).chrKeys=new Map;var ue=function(){function e(){}return e.prototype.compute=function(e,t,n,i){function r(e,t){(e+1!==p||t+1!==v)&&m.push(new ne(new F(e+1,p),new F(t+1,v))),p=e,v=t}if(void 0===n&&(n=re.instance),0===e.length||0===t.length)return te.trivial(e,t);for(var o=new se(e.length,t.length),s=new se(e.length,t.length),a=new se(e.length,t.length),u=0;u<e.length;u++)for(var l=0;l<t.length;l++){if(!n.isValid())return te.trivialTimedOut(e,t);var h=0===u?0:o.get(u-1,l),d=0===l?0:o.get(u,l-1),c=void 0;e.getElement(u)===t.getElement(l)?(c=0===u||0===l?0:o.get(u-1,l-1),u>0&&l>0&&3===s.get(u-1,l-1)&&(c+=a.get(u-1,l-1)),c+=i?i(u,l):1):c=-1;var f=Math.max(h,d,c);if(f===c){var g=u>0&&l>0?a.get(u-1,l-1):0;a.set(u,l,g+1),s.set(u,l,3)}else f===h?(a.set(u,l,0),s.set(u,l,1)):f===d&&(a.set(u,l,0),s.set(u,l,2));o.set(u,l,f)}for(var m=[],p=e.length,v=t.length,y=e.length-1,w=t.length-1;y>=0&&w>=0;)3===s.get(y,w)?(r(y,w),y--,w--):1===s.get(y,w)?y--:w--;return r(-1,-1),m.reverse(),new te(m,!1)},e}(),le=function(){function e(){}return e.prototype.compute=function(e,t,n){function i(e,t){for(;e<r.length&&t<o.length&&r.getElement(e)===o.getElement(t);)e++,t++;return e}if(void 0===n&&(n=re.instance),0===e.length||0===t.length)return te.trivial(e,t);var r=e,o=t,s=0,a=new de;a.set(0,i(0,0));var u=new ce;u.set(0,0===a.get(0)?null:new he(null,0,0,a.get(0)));var l=0;e:for(;;){if(s++,!n.isValid())return te.trivialTimedOut(r,o);var h=-Math.min(s,o.length+s%2),d=Math.min(s,r.length+s%2);for(l=h;l<=d;l+=2){var c=l===d?-1:a.get(l+1),f=l===h?-1:a.get(l-1)+1,g=Math.min(Math.max(c,f),r.length),m=g-l;if(!(g>r.length||m>o.length)){var p=i(g,m);a.set(l,p);var v=g===c?u.get(l+1):u.get(l-1);if(u.set(l,p!==g?new he(v,g,m,p-g):v),a.get(l)===r.length&&a.get(l)-l===o.length)break e}}}for(var y=u.get(l),w=[],b=r.length,E=o.length;;){var L=y?y.x+y.length:0,x=y?y.y+y.length:0;if((L!==b||x!==E)&&w.push(new ne(new F(L,b),new F(x,E))),!y)break;b=y.x,E=y.y,y=y.prev}return w.reverse(),new te(w,!1)},e}(),he=function(e,t,n,i){this.prev=e,this.x=t,this.y=n,this.length=i},de=function(){function e(){this.positiveArr=new Int32Array(10),this.negativeArr=new Int32Array(10)}return e.prototype.get=function(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]},e.prototype.set=function(e,t){if(e<0){if((e=-e-1)>=this.negativeArr.length){var n=this.negativeArr;this.negativeArr=new Int32Array(2*n.length),this.negativeArr.set(n)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){n=this.positiveArr;this.positiveArr=new Int32Array(2*n.length),this.positiveArr.set(n)}this.positiveArr[e]=t}},e}(),ce=function(){function e(){this.positiveArr=[],this.negativeArr=[]}return e.prototype.get=function(e){return e<0?(e=-e-1,this.negativeArr[e]):this.positiveArr[e]},e.prototype.set=function(e,t){e<0?(e=-e-1,this.negativeArr[e]=t):this.positiveArr[e]=t},e}(),fe=function(){function e(){this.map=new Map}return e.prototype.add=function(e,t){var n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)},e.prototype.forEach=function(e,t){var n=this.map.get(e);n&&n.forEach(t)},e.prototype.get=function(e){var t=this.map.get(e);return t||new Set},e}(),ge=function(){function e(e,t,n){this.lines=e,this.range=t,this.considerWhitespaceChanges=n,this.elements=[],this.firstElementOffsetByLineIdx=[],this.lineStartOffsets=[],this.trimmedWsLengthsByLineIdx=[],this.firstElementOffsetByLineIdx.push(0);for(var i=this.range.startLineNumber;i<=this.range.endLineNumber;i++){var r=e[i-1],o=0;i===this.range.startLineNumber&&this.range.startColumn>1&&(o=this.range.startColumn-1,r=r.substring(o)),this.lineStartOffsets.push(o);var s=0;if(!n){var a=r.trimStart();s=r.length-a.length,r=a.trimEnd()}this.trimmedWsLengthsByLineIdx.push(s);for(var u=i===this.range.endLineNumber?Math.min(this.range.endColumn-1-o-s,r.length):r.length,l=0;l<u;l++)this.elements.push(r.charCodeAt(l));i<this.range.endLineNumber&&(this.elements.push("\n".charCodeAt(0)),this.firstElementOffsetByLineIdx.push(this.elements.length))}}return e.prototype.toString=function(){return'Slice: "'.concat(this.text,'"')},Object.defineProperty(e.prototype,"text",{get:function(){return this.getText(new F(0,this.length))},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){return this.elements.slice(e.start,e.endExclusive).map((function(e){return String.fromCharCode(e)})).join("")},e.prototype.getElement=function(e){return this.elements[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.elements.length},enumerable:!1,configurable:!0}),e.prototype.getBoundaryScore=function(e){var t=v(e>0?this.elements[e-1]:-1),n=v(e<this.elements.length?this.elements[e]:-1);if(7===t&&8===n)return 0;if(8===t)return 150;var i=0;return t!==n&&(i+=10,0===t&&1===n&&(i+=1)),i+=p(t),i+=p(n)},e.prototype.translateOffset=function(e,t){void 0===t&&(t="right");var n=u(this.firstElementOffsetByLineIdx,(function(t){return t<=e})),i=e-this.firstElementOffsetByLineIdx[n];return new j(this.range.startLineNumber+n,1+this.lineStartOffsets[n]+i+(0===i&&"left"===t?0:this.trimmedWsLengthsByLineIdx[n]))},e.prototype.translateRange=function(e){var t=this.translateOffset(e.start,"right"),n=this.translateOffset(e.endExclusive,"left");return n.isBefore(t)?H.fromPositions(n,n):H.fromPositions(t,n)},e.prototype.findWordContaining=function(e){if(!(e<0||e>=this.elements.length)&&g(this.elements[e])){for(var t=e;t>0&&g(this.elements[t-1]);)t--;for(var n=e;n<this.elements.length&&g(this.elements[n]);)n++;return new F(t,n)}},e.prototype.findSubWordContaining=function(e){if(!(e<0||e>=this.elements.length)&&g(this.elements[e])){for(var t=e;t>0&&g(this.elements[t-1])&&!m(this.elements[t]);)t--;for(var n=e;n<this.elements.length&&g(this.elements[n])&&!m(this.elements[n]);)n++;return new F(t,n)}},e.prototype.countLinesIn=function(e){return this.translateOffset(e.endExclusive).lineNumber-this.translateOffset(e.start).lineNumber},e.prototype.isStronglyEqual=function(e,t){return this.elements[e]===this.elements[t]},e.prototype.extendToFullLines=function(e){var t,n,i=null!==(t=a(this.firstElementOffsetByLineIdx,(function(t){return t<=e.start})))&&void 0!==t?t:0,r=null!==(n=function(e,t){var n=l(e,t);return n===e.length?void 0:e[n]}(this.firstElementOffsetByLineIdx,(function(t){return e.endExclusive<=t})))&&void 0!==n?n:this.elements.length;return new F(i,r)},e}(),me=((B={})[0]=0,B[1]=0,B[2]=0,B[3]=10,B[4]=2,B[5]=30,B[6]=3,B[7]=10,B[8]=10,B),pe=function(){function e(e,t){this.trimmedHash=e,this.lines=t}return e.prototype.getElement=function(e){return this.trimmedHash[e]},Object.defineProperty(e.prototype,"length",{get:function(){return this.trimmedHash.length},enumerable:!1,configurable:!0}),e.prototype.getBoundaryScore=function(e){return 1e3-((0===e?0:_(this.lines[e-1]))+(e===this.lines.length?0:_(this.lines[e])))},e.prototype.getText=function(e){return this.lines.slice(e.start,e.endExclusive).join("\n")},e.prototype.isStronglyEqual=function(e,t){return this.lines[e]===this.lines[t]},e}(),ve=function(){function e(){this.dynamicProgrammingDiffing=new ue,this.myersDiffingAlgorithm=new le}return e.prototype.computeDiff=function(e,t,n){function i(e){var t=h.get(e);return void 0===t&&(t=h.size,h.set(e,t)),t}var r,o,a=this;if(e.length<=1&&function(e,t,n){if(void 0===n&&(n=function(e,t){return e===t}),e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var i=0,r=e.length;i<r;i++)if(!n(e[i],t[i]))return!1;return!0}(e,t,(function(e,t){return e===t})))return new K([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new K([new Q(new V(1,e.length+1),new V(1,t.length+1),[new ee(new H(1,1,e.length,e[e.length-1].length+1),new H(1,1,t.length,t[t.length-1].length+1))])],[],!1);var u=0===n.maxComputationTimeMs?re.instance:new oe(n.maxComputationTimeMs),l=!n.ignoreTrimWhitespace,h=new Map,d=e.map((function(e){return i(e.trim())})),f=t.map((function(e){return i(e.trim())})),g=new pe(d,e),m=new pe(f,t),p=g.length+m.length<1700?a.dynamicProgrammingDiffing.compute(g,m,u,(function(n,i){return e[n]===t[i]?0===t[i].length?.1:1+Math.log(1+t[i].length):.99})):a.myersDiffingAlgorithm.compute(g,m,u),v=p.diffs,y=p.hitTimeout;v=x(g,m,v),v=function(e,t,n){var i=n;if(0===i.length)return i;var r,o=0;do{r=!1;for(var s=[i[0]],a=function(t){var n=i[t],o=s[s.length-1],a=function(t,i){var r=new F(o.seq1Range.endExclusive,n.seq1Range.start);return e.getText(r).replace(/\s/g,"").length<=4&&(t.seq1Range.length+t.seq2Range.length>5||i.seq1Range.length+i.seq2Range.length>5)}(o,n);a?(r=!0,s[s.length-1]=s[s.length-1].join(n)):s.push(n)},u=1;u<i.length;u++)a(u);i=s}while(o++<10&&r);return i}(g,0,v);var w=[],b=function(i){var r,o;if(l)for(var s=0;s<i;s++){var h=E+s,d=L+s;if(e[h]!==t[d]){var c=a.refineDiff(e,t,new ne(new F(h,h+1),new F(d,d+1)),u,l,n);try{for(var f=(r=void 0,I(c.mappings)),g=f.next();!g.done;g=f.next()){var m=g.value;w.push(m)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}c.hitTimeout&&(y=!0)}}},E=0,L=0,R=function(i){var r,o;s((function(){return i.seq1Range.start-E==i.seq2Range.start-L}));var a=i.seq1Range.start-E;b(a),E=i.seq1Range.endExclusive,L=i.seq2Range.endExclusive;var h=N.refineDiff(e,t,i,u,l,n);h.hitTimeout&&(y=!0);try{for(var d=(r=void 0,I(h.mappings)),c=d.next();!c.done;c=d.next()){var f=c.value;w.push(f)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}},N=this;try{for(var S=I(v),A=S.next();!A.done;A=S.next()){R(A.value)}}catch(e){r={error:e}}finally{try{A&&!A.done&&(o=S.return)&&o.call(S)}finally{if(r)throw r.error}}b(e.length-E);var _=c(w,new Z(e),new Z(t)),C=[];return n.computeMoves&&(C=this.computeMoves(_,e,t,d,f,u,l,n)),s((function(){function n(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;var n=t[e.lineNumber-1];return!(e.column<1||e.column>n.length+1)}function i(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1)&&!(e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}var r,o,s,a;try{for(var u=I(_),l=u.next();!l.done;l=u.next()){var h=l.value;if(!h.innerChanges)return!1;try{for(var d=(s=void 0,I(h.innerChanges)),c=d.next();!c.done;c=d.next()){var f=c.value;if(!(n(f.modifiedRange.getStartPosition(),t)&&n(f.modifiedRange.getEndPosition(),t)&&n(f.originalRange.getStartPosition(),e)&&n(f.originalRange.getEndPosition(),e)))return!1}}catch(e){s={error:e}}finally{try{c&&!c.done&&(a=d.return)&&a.call(d)}finally{if(s)throw s.error}}if(!i(h.modified,t)||!i(h.original,e))return!1}}catch(e){r={error:e}}finally{try{l&&!l.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return!0})),new K(_,C,y)},e.prototype.computeMoves=function(e,t,n,i,r,o,s,a){var u=this,l=y(e,t,n,i,r,o).map((function(e){var i=c(u.refineDiff(t,n,new ne(e.original.toOffsetRange(),e.modified.toOffsetRange()),o,s,a).mappings,new Z(t),new Z(n),!0);return new Y(e,i)}));return l},e.prototype.refineDiff=function(e,t,n,i,r,o){var s=function(e){return new J(new V(e.seq1Range.start+1,e.seq1Range.endExclusive+1),new V(e.seq2Range.start+1,e.seq2Range.endExclusive+1))}(n),a=s.toRangeMapping2(e,t),u=new ge(e,a.originalRange,r),l=new ge(t,a.modifiedRange,r),h=u.length+l.length<500?this.dynamicProgrammingDiffing.compute(u,l,i):this.myersDiffingAlgorithm.compute(u,l,i),d=h.diffs;d=x(u,l,d),d=A(u,l,d,(function(e,t){return e.findWordContaining(t)})),o.extendToSubwords&&(d=A(u,l,d,(function(e,t){return e.findSubWordContaining(t)}),!0)),d=S(0,0,d),d=function(e,t,n){var i=n;if(0===i.length)return i;var r,o=0;do{r=!1;for(var s=[i[0]],a=function(n){var o=i[n],a=s[s.length-1],u=function(n,i){function r(e){return Math.min(e,v)}var s=new F(a.seq1Range.endExclusive,o.seq1Range.start);if(e.countLinesIn(s)>5||s.length>500)return!1;var u=e.getText(s).trim();if(u.length>20||u.split(/\r\n|\r|\n/).length>1)return!1;var l=e.countLinesIn(n.seq1Range),h=n.seq1Range.length,d=t.countLinesIn(n.seq2Range),c=n.seq2Range.length,f=e.countLinesIn(i.seq1Range),g=i.seq1Range.length,m=t.countLinesIn(i.seq2Range),p=i.seq2Range.length,v=130;return Math.pow(Math.pow(r(40*l+h),1.5)+Math.pow(r(40*d+c),1.5),1.5)+Math.pow(Math.pow(r(40*f+g),1.5)+Math.pow(r(40*m+p),1.5),1.5)>1.3*Math.pow(Math.pow(v,1.5),1.5)}(a,o);u?(r=!0,s[s.length-1]=s[s.length-1].join(o)):s.push(o)},u=1;u<i.length;u++)a(u);i=s}while(o++<10&&r);var l=[];return function(e,t){for(var n=0;n<e.length;n++)t(0===n?void 0:e[n-1],e[n],n+1===e.length?void 0:e[n+1])}(i,(function(t,n,i){function r(e){return e.length>0&&e.trim().length<=3&&n.seq1Range.length+n.seq2Range.length>100}var o=n,s=e.extendToFullLines(n.seq1Range),a=e.getText(new F(s.start,n.seq1Range.start));r(a)&&(o=o.deltaStart(-a.length));var u=e.getText(new F(n.seq1Range.endExclusive,s.endExclusive));r(u)&&(o=o.deltaEnd(u.length));var h=ne.fromOffsetPairs(t?t.getEndExclusives():ie.zero,i?i.getStarts():ie.max),d=o.intersect(h);l.length>0&&d.getStarts().equals(l[l.length-1].getEndExclusives())?l[l.length-1]=l[l.length-1].join(d):l.push(d)})),l}(u,l,d);var c=d.map((function(e){return new ee(u.translateRange(e.seq1Range),l.translateRange(e.seq2Range))}));return{mappings:c,hitTimeout:h.hitTimeout}},e}();t.computeDiff=C;var ye=e("../../../range").Range,we=e("../base_diff_view").DiffChunk,be=function(){function e(){}return e.prototype.compute=function(e,t,n){return n||(n={}),n.maxComputationTimeMs||(n.maxComputationTimeMs=500),(C(e,t,n)||[]).map((function(e){return new we(new ye(e.origStart,0,e.origEnd,0),new ye(e.editStart,0,e.editEnd,0),e.charChanges)}))},e}();t.DiffProvider=be})),ace.define("ace/ext/diff",["require","exports","module","ace/ext/diff/inline_diff_view","ace/ext/diff/split_diff_view","ace/ext/diff/providers/default"],(function(e,t,n){var i=e("./diff/inline_diff_view").InlineDiffView,r=e("./diff/split_diff_view").SplitDiffView,o=e("./diff/providers/default").DiffProvider;t.InlineDiffView=i,t.SplitDiffView=r,t.DiffProvider=o,t.createDiffView=function(e,t){var n;return(e=e||{}).diffProvider=e.diffProvider||new o,n=e.inline?new i(e):new r(e),t&&n.setOptions(t),n}})),ace.require(["ace/ext/diff"],(function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)}));
|