Liferay.Loader.define("liferay!object-js-components-web$codemirror@5.65.12/addon/edit/continuelist",["module","exports","require","../../lib/codemirror"],(function(e,n,t){var i,r=void 0;window;i=function(e){"use strict";var n=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,i=/[*+-]\s/;function incrementRemainingMarkdownListNumbers(e,t){var i=t.line,r=0,o=0,a=n.exec(e.getLine(i)),s=a[1];do{var d=i+(r+=1),l=e.getLine(d),c=n.exec(l);if(c){var m=c[1],f=parseInt(a[3],10)+r-o,u=parseInt(c[3],10),p=u;if(s!==m||isNaN(u)){if(s.length>m.length)return;if(s.length<m.length&&1===r)return;o+=1}else f===u&&(p=u+1),f>u&&(p=f+1),e.replaceRange(l.replace(n,m+p+c[4]+c[5]),{line:d,ch:0},{line:d,ch:l.length})}}while(c)}e.commands.newlineAndIndentContinueMarkdownList=function(r){if(r.getOption("disableInput"))return e.Pass;for(var o=r.listSelections(),a=[],s=0;s<o.length;s++){var d=o[s].head,l=r.getStateAfter(d.line),c=e.innerMode(r.getMode(),l);if("markdown"!==c.mode.name&&"markdown"!==c.mode.helperType)return void r.execCommand("newlineAndIndent");var m=!1!==(l=c.state).list,f=0!==l.quote,u=r.getLine(d.line),p=n.exec(u),g=/^\s*$/.test(u.slice(0,d.ch));if(!o[s].empty()||!m&&!f||!p||g)return void r.execCommand("newlineAndIndent");if(t.test(u)){var h=f&&/>\s*$/.test(u),v=!/>\s*$/.test(u);(h||v)&&r.replaceRange("",{line:d.line,ch:0},{line:d.line,ch:d.ch+1}),a[s]="\n"}else{var w=p[1],b=p[5],x=!(i.test(p[2])||p[2].indexOf(">")>=0),L=x?parseInt(p[3],10)+1+p[4]:p[2].replace("x"," ");a[s]="\n"+w+L+b,x&&incrementRemainingMarkdownListNumbers(r,d)}}r.replaceSelections(a)}},"object"==typeof n&&"object"==typeof e?i(t("../../lib/codemirror")):"function"==typeof r&&r.amd?r(["../../lib/codemirror"],i):i(CodeMirror)}));
//# sourceMappingURL=continuelist.js.map