(self.webpackChunk_digicommerce_cms_admin=self.webpackChunk_digicommerce_cms_admin||[]).push([[5509],{59577:(C,x,_)=>{(function(l){l(_(27509))})(function(l){"use strict";l.defineOption("styleSelectedText",!1,function(e,t,r){var n=r&&r!=l.Init;t&&!n?(e.state.markedSelection=[],e.state.markedSelectionStyle=typeof t=="string"?t:"CodeMirror-selectedtext",v(e),e.on("cursorActivity",h),e.on("change",p)):!t&&n&&(e.off("cursorActivity",h),e.off("change",p),u(e),e.state.markedSelection=e.state.markedSelectionStyle=null)});function h(e){e.state.markedSelection&&e.operation(function(){y(e)})}function p(e){e.state.markedSelection&&e.state.markedSelection.length&&e.operation(function(){u(e)})}var f=8,S=l.Pos,o=l.cmpPos;function s(e,t,r,n){if(o(t,r)!=0)for(var i=e.state.markedSelection,a=e.state.markedSelectionStyle,c=t.line;;){var w=c==t.line?t:S(c,0),d=c+f,g=d>=r.line,b=g?r:S(d,0),k=e.markText(w,b,{className:a});if(n==null?i.push(k):i.splice(n++,0,k),g)break;c=d}}function u(e){for(var t=e.state.markedSelection,r=0;r<t.length;++r)t[r].clear();t.length=0}function v(e){u(e);for(var t=e.listSelections(),r=0;r<t.length;r++)s(e,t[r].from(),t[r].to())}function y(e){if(!e.somethingSelected())return u(e);if(e.listSelections().length>1)return v(e);var t=e.getCursor("start"),r=e.getCursor("end"),n=e.state.markedSelection;if(!n.length)return s(e,t,r);var i=n[0].find(),a=n[n.length-1].find();if(!i||!a||r.line-t.line<=f||o(t,a.to)>=0||o(r,i.from)<=0)return v(e);for(;o(t,i.from)>0;)n.shift().clear(),i=n[0].find();for(o(t,i.from)<0&&(i.to.line-t.line<f?(n.shift().clear(),s(e,t,i.to,0)):s(e,t,i.from,0));o(r,a.to)<0;)n.pop().clear(),a=n[n.length-1].find();o(r,a.to)>0&&(r.line-a.from.line<f?(n.pop().clear(),s(e,a.from,r)):s(e,a.to,r))}})}}]);
