Liferay.Loader.define("liferay!layout-content-page-editor-web$codemirror@5.65.2/addon/selection/active-line",["module","exports","require","../../lib/codemirror"],(function(e,t,i){window,function(e){"use strict";var t="CodeMirror-activeline",i="CodeMirror-activeline-background",n="CodeMirror-activeline-gutter";function clearActiveLines(e){for(var a=0;a<e.state.activeLines.length;a++)e.removeLineClass(e.state.activeLines[a],"wrap",t),e.removeLineClass(e.state.activeLines[a],"background",i),e.removeLineClass(e.state.activeLines[a],"gutter",n)}function updateActiveLines(e,a){for(var r=[],o=0;o<a.length;o++){var c=a[o],s=e.getOption("styleActiveLine");if("object"==typeof s&&s.nonEmpty?c.anchor.line==c.head.line:c.empty()){var l=e.getLineHandleVisualStart(c.head.line);r[r.length-1]!=l&&r.push(l)}}(function sameArray(e,t){if(e.length!=t.length)return!1;for(var i=0;i<e.length;i++)if(e[i]!=t[i])return!1;return!0})(e.state.activeLines,r)||e.operation((function(){clearActiveLines(e);for(var a=0;a<r.length;a++)e.addLineClass(r[a],"wrap",t),e.addLineClass(r[a],"background",i),e.addLineClass(r[a],"gutter",n);e.state.activeLines=r}))}function selectionChange(e,t){updateActiveLines(e,t.ranges)}e.defineOption("styleActiveLine",!1,(function(t,i,n){var a=n!=e.Init&&n;i!=a&&(a&&(t.off("beforeSelectionChange",selectionChange),clearActiveLines(t),delete t.state.activeLines),i&&(t.state.activeLines=[],updateActiveLines(t,t.listSelections()),t.on("beforeSelectionChange",selectionChange)))}))}("object"==typeof t&&"object"==typeof e?i("../../lib/codemirror"):CodeMirror)}));
//# sourceMappingURL=active-line.js.map