Liferay.Loader.define("liferay!object-web$codemirror@5.65.12/addon/comment/continuecomment",["module","exports","require","../../lib/codemirror"],(function(e,n,t){var o,i=void 0;window;o=function(e){var n=/\S/g,t=String.prototype.repeat||function(e){return Array(e+1).join(this)};function continueComment(n){if(n.getOption("disableInput"))return e.Pass;for(var o,i=n.listSelections(),r=[],c=0;c<i.length;c++){var l=i[c].head;if(!/\bcomment\b/.test(n.getTokenTypeAt(l)))return e.Pass;var a=n.getModeAt(l);if(o){if(o!=a)return e.Pass}else o=a;var m,f,s=null,u=o.blockCommentStart,d=o.lineComment;if(u&&o.blockCommentContinue){var p=(m=n.getLine(l.line)).lastIndexOf(o.blockCommentEnd,l.ch-o.blockCommentEnd.length);if(-1!=p&&p==l.ch-o.blockCommentEnd.length||d&&(f=m.lastIndexOf(d,l.ch-1))>-1&&/\bcomment\b/.test(n.getTokenTypeAt({line:l.line,ch:f+1})));else if(l.ch>=u.length&&(f=m.lastIndexOf(u,l.ch-u.length))>-1&&f>p)if(nonspaceAfter(0,m)>=f)s=m.slice(0,f);else{var b,C=n.options.tabSize;f=e.countColumn(m,f,C),s=n.options.indentWithTabs?t.call("\t",b=Math.floor(f/C))+t.call(" ",f-C*b):t.call(" ",f)}else(f=m.indexOf(o.blockCommentContinue))>-1&&f<=l.ch&&f<=nonspaceAfter(0,m)&&(s=m.slice(0,f));null!=s&&(s+=o.blockCommentContinue)}if(null==s&&d&&continueLineCommentEnabled(n))if(null==m&&(m=n.getLine(l.line)),f=m.indexOf(d),l.ch||f){if(f>-1&&nonspaceAfter(0,m)>=f){if(!(s=nonspaceAfter(l.ch,m)>-1)){var h=n.getLine(l.line+1)||"",g=h.indexOf(d);s=g>-1&&nonspaceAfter(0,h)>=g||null}s&&(s=m.slice(0,f)+d+m.slice(f+d.length).match(/^\s*/)[0])}}else s="";if(null==s)return e.Pass;r[c]="\n"+s}n.operation((function(){for(var e=i.length-1;e>=0;e--)n.replaceRange(r[e],i[e].from(),i[e].to(),"+insert")}))}function nonspaceAfter(e,t){n.lastIndex=e;var o=n.exec(t);return o?o.index:-1}function continueLineCommentEnabled(e){var n=e.getOption("continueComments");return!n||"object"!=typeof n||!1!==n.continueLineComment}e.defineOption("continueComments",null,(function(n,t,o){if(o&&o!=e.Init&&n.removeKeyMap("continueComment"),t){var i="Enter";"string"==typeof t?i=t:"object"==typeof t&&t.key&&(i=t.key);var r={name:"continueComment"};r[i]=continueComment,n.addKeyMap(r)}}))},"object"==typeof n&&"object"==typeof e?o(t("../../lib/codemirror")):"function"==typeof i&&i.amd?i(["../../lib/codemirror"],o):o(CodeMirror)}));
//# sourceMappingURL=continuecomment.js.map