(self.webpackChunkopencelium=self.webpackChunkopencelium||[]).push([[504],{14504:(e,n,t)=>{!function(e){"use strict";var n={},t=/[^\s\u00a0]/,i=e.Pos,l=e.cmpPos;function o(e){var n=e.search(t);return-1==n?0:n}function a(e,n){var t=e.getMode();return!1!==t.useInnerComments&&t.innerMode?e.getModeAt(n):t}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=n);for(var t=this,l=1/0,o=this.listSelections(),a=null,r=o.length-1;r>=0;r--){var m=o[r].from(),c=o[r].to();m.line>=l||(c.line>=l&&(c=i(l,0)),l=m.line,null==a?t.uncomment(m,c,e)?a="un":(t.lineComment(m,c,e),a="line"):"un"==a?t.uncomment(m,c,e):t.lineComment(m,c,e))}})),e.defineExtension("lineComment",(function(e,l,r){r||(r=n);var m,c,g=this,s=a(g,e),f=g.getLine(e.line);if(null!=f&&(m=e,c=f,!/\bstring\b/.test(g.getTokenTypeAt(i(m.line,0)))||/^[\'\"\`]/.test(c))){var u=r.lineComment||s.lineComment;if(u){var h=Math.min(0!=l.ch||l.line==e.line?l.line+1:l.line,g.lastLine()+1),d=null==r.padding?" ":r.padding,C=r.commentBlankLines||e.line==l.line;g.operation((function(){if(r.indent){for(var n=null,l=e.line;l<h;++l){var a=(m=g.getLine(l)).slice(0,o(m));(null==n||n.length>a.length)&&(n=a)}for(l=e.line;l<h;++l){var m=g.getLine(l),c=n.length;(C||t.test(m))&&(m.slice(0,c)!=n&&(c=o(m)),g.replaceRange(n+u+d,i(l,0),i(l,c)))}}else for(l=e.line;l<h;++l)(C||t.test(g.getLine(l)))&&g.replaceRange(u+d,i(l,0))}))}else(r.blockCommentStart||s.blockCommentStart)&&(r.fullLines=!0,g.blockComment(e,l,r))}})),e.defineExtension("blockComment",(function(e,o,r){r||(r=n);var m=this,c=a(m,e),g=r.blockCommentStart||c.blockCommentStart,s=r.blockCommentEnd||c.blockCommentEnd;if(g&&s){if(!/\bcomment\b/.test(m.getTokenTypeAt(i(e.line,0)))){var f=Math.min(o.line,m.lastLine());f!=e.line&&0==o.ch&&t.test(m.getLine(f))&&--f;var u=null==r.padding?" ":r.padding;e.line>f||m.operation((function(){if(0!=r.fullLines){var n=t.test(m.getLine(f));m.replaceRange(u+s,i(f)),m.replaceRange(g+u,i(e.line,0));var a=r.blockCommentLead||c.blockCommentLead;if(null!=a)for(var h=e.line+1;h<=f;++h)(h!=f||n)&&m.replaceRange(a+u,i(h,0))}else{var d=0==l(m.getCursor("to"),o),C=!m.somethingSelected();m.replaceRange(s,o),d&&m.setSelection(C?o:m.getCursor("from"),o),m.replaceRange(g,e)}}))}}else(r.lineComment||c.lineComment)&&0!=r.fullLines&&m.lineComment(e,o,r)})),e.defineExtension("uncomment",(function(e,l,o){o||(o=n);var r,m=this,c=a(m,e),g=Math.min(0!=l.ch||l.line==e.line?l.line:l.line-1,m.lastLine()),s=Math.min(e.line,g),f=o.lineComment||c.lineComment,u=[],h=null==o.padding?" ":o.padding;e:if(f){for(var d=s;d<=g;++d){var C=m.getLine(d),p=C.indexOf(f);if(p>-1&&!/comment/.test(m.getTokenTypeAt(i(d,p+1)))&&(p=-1),-1==p&&t.test(C))break e;if(p>-1&&t.test(C.slice(0,p)))break e;u.push(C)}if(m.operation((function(){for(var e=s;e<=g;++e){var n=u[e-s],t=n.indexOf(f),l=t+f.length;t<0||(n.slice(l,l+h.length)==h&&(l+=h.length),r=!0,m.replaceRange("",i(e,t),i(e,l)))}})),r)return!0}var v=o.blockCommentStart||c.blockCommentStart,k=o.blockCommentEnd||c.blockCommentEnd;if(!v||!k)return!1;var b=o.blockCommentLead||c.blockCommentLead,L=m.getLine(s),x=L.indexOf(v);if(-1==x)return!1;var R=g==s?L:m.getLine(g),O=R.indexOf(k,g==s?x+v.length:0),T=i(s,x+1),S=i(g,O+1);if(-1==O||!/comment/.test(m.getTokenTypeAt(T))||!/comment/.test(m.getTokenTypeAt(S))||m.getRange(T,S,"\n").indexOf(k)>-1)return!1;var E=L.lastIndexOf(v,e.ch),M=-1==E?-1:L.slice(0,e.ch).indexOf(k,E+v.length);if(-1!=E&&-1!=M&&M+k.length!=e.ch)return!1;M=R.indexOf(k,l.ch);var A=R.slice(l.ch).lastIndexOf(v,M-l.ch);return E=-1==M||-1==A?-1:l.ch+A,(-1==M||-1==E||E==l.ch)&&(m.operation((function(){m.replaceRange("",i(g,O-(h&&R.slice(O-h.length,O)==h?h.length:0)),i(g,O+k.length));var e=x+v.length;if(h&&L.slice(e,e+h.length)==h&&(e+=h.length),m.replaceRange("",i(s,x),i(s,e)),b)for(var n=s+1;n<=g;++n){var l=m.getLine(n),o=l.indexOf(b);if(-1!=o&&!t.test(l.slice(0,o))){var a=o+b.length;h&&l.slice(a,a+h.length)==h&&(a+=h.length),m.replaceRange("",i(n,o),i(n,a))}}})),!0)}))}(t(4631))}}]);