text: "use strict";
  /********************************************************************************
   * Copyright (C) 2018 TypeFox and others.
   *
   * This program and the accompanying materials are made available under the
   * terms of the Eclipse Public License v. 2.0 which is available at
   * http://www.eclipse.org/legal/epl-2.0.
   *
   * This Source Code may also be made available under the following Secondary
   * Licenses when the conditions for such availability set forth in the Eclipse
   * Public License v. 2.0 are satisfied: GNU General Public License, version 2
   * with the GNU Classpath Exception which is available at
   * https://www.gnu.org/software/classpath/license.html.
   *
   * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
   ********************************************************************************/
  var __extends = (this && this.__extends) || (function () {
      var extendStatics = function (d, b) {
          extendStatics = Object.setPrototypeOf ||
              ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
              function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
          return extendStatics(d, b);
      }
      return function (d, b) {
          extendStatics(d, b);
          function __() { this.constructor = d; }
          d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
  })();
  var __assign = (this && this.__assign) || function () {
      __assign = Object.assign || function(t) {
          for (var s, i = 1, n = arguments.length; i < n; i++) {
              s = arguments[i];
              for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                  t[p] = s[p];
          }
          return t;
      };
      return __assign.apply(this, arguments);
  };
  Object.defineProperty(exports, "__esModule", { value: true });
  var monaco_editor_1 = require("./monaco-editor");
  var MonacoDiffEditor = /** @class */ (function (_super) {
      __extends(MonacoDiffEditor, _super);
      function MonacoDiffEditor(uri, node, originalModel, modifiedModel, m2p, p2m, diffNavigatorFactory, options, override) {
          var _this = _super.call(this, uri, modifiedModel, node, m2p, p2m, options, override) || this;
          _this.uri = uri;
          _this.node = node;
          _this.originalModel = originalModel;
          _this.modifiedModel = modifiedModel;
          _this.m2p = m2p;
          _this.p2m = p2m;
          _this.diffNavigatorFactory = diffNavigatorFactory;
          _this.documents.add(originalModel);
          var original = originalModel.textEditorModel;
          var modified = modifiedModel.textEditorModel;
          _this._diffNavigator = diffNavigatorFactory.createdDiffNavigator(_this._diffEditor, options);
          _this._diffEditor.setModel({ original: original, modified: modified });
          return _this;
      }
      Object.defineProperty(MonacoDiffEditor.prototype, "diffEditor", {
          get: function () {
              return this._diffEditor;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(MonacoDiffEditor.prototype, "diffNavigator", {
          get: function () {
              return this._diffNavigator;
          },
          enumerable: true,
          configurable: true
      });
      MonacoDiffEditor.prototype.create = function (options, override) {
          this._diffEditor = monaco.editor.createDiffEditor(this.node, __assign({}, options, { fixedOverflowWidgets: true }), override);
          this.editor = this._diffEditor.getModifiedEditor();
          return this._diffEditor;
      };
      MonacoDiffEditor.prototype.resize = function (dimension) {
          if (this.node) {
              var layoutSize = this.computeLayoutSize(this.node, dimension);
              this._diffEditor.layout(layoutSize);
          }
      };
      MonacoDiffEditor.prototype.isActionSupported = function (id) {
          var action = this._diffEditor.getSupportedActions().find(function (a) { return a.id === id; });
          return !!action && action.isSupported() && _super.prototype.isActionSupported.call(this, id);
      };
      MonacoDiffEditor.prototype.deltaDecorations = function (params) {
          console.warn('`deltaDecorations` should be called on either the original, or the modified editor.');
          return [];
      };
      return MonacoDiffEditor;
  }(monaco_editor_1.MonacoEditor));
  exports.MonacoDiffEditor = MonacoDiffEditor;
  //# sourceMappingURL=monaco-diff-editor.js.map