2022-12-17 07:49:14 +08:00
|
|
|
var Cf=Object.create;var _a=Object.defineProperty;var Lf=Object.getOwnPropertyDescriptor;var Ef=Object.getOwnPropertyNames;var zf=Object.getPrototypeOf,Mf=Object.prototype.hasOwnProperty;var Oe=(u,N)=>()=>(N||u((N={exports:{}}).exports,N),N.exports);var Af=(u,N,A,P)=>{if(N&&typeof N=="object"||typeof N=="function")for(let S of Ef(N))!Mf.call(u,S)&&S!==A&&_a(u,S,{get:()=>N[S],enumerable:!(P=Lf(N,S))||P.enumerable});return u};var Be=(u,N,A)=>(A=u!=null?Cf(zf(u)):{},Af(N||!u||!u.__esModule?_a(A,"default",{value:u,enumerable:!0}):A,u));var Pe=Oe((vo,yo)=>{(function(u,N){typeof vo=="object"&&typeof yo<"u"?yo.exports=N():typeof define=="function"&&define.amd?define(N):(u=u||self,u.CodeMirror=N())})(vo,function(){"use strict";var u=navigator.userAgent,N=navigator.platform,A=/gecko\/\d/i.test(u),P=/MSIE \d/.test(u),S=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),D=/Edge\/(\d+)/.exec(u),h=P||S||D,I=h&&(P?document.documentMode||6:+(D||S)[1]),w=!D&&/WebKit\//.test(u),z=w&&/Qt\/\d+\.\d+/.test(u),T=!D&&/Chrome\/(\d+)/.exec(u),m=T&&+T[1],x=/Opera\//.test(u),p=/Apple Computer/.test(navigator.vendor),v=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(u),_=/PhantomJS/.test(u),y=p&&(/Mobile\/\w+/.test(u)||navigator.maxTouchPoints>2),B=/Android/.test(u),k=y||B||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(u),q=y||/Mac/.test(N),$=/\bCrOS\b/.test(u),V=/win/i.test(N),oe=x&&u.match(/Version\/(\d*\.\d*)/);oe&&(oe=Number(oe[1])),oe&&oe>=15&&(x=!1,w=!0);var G=q&&(z||x&&(oe==null||oe<12.11)),X=A||h&&I>=9;function U(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Q=function(e,t){var r=e.className,n=U(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function R(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function O(e,t){return R(e).appendChild(t)}function f(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function W(e,t,r,n){var i=f(e,t,r,n);return i.setAttribute("role","presentation"),i}var j;document.createRange?j=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:j=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch{return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function M(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function L(){var e;try{e=document.activeElement}catch{e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function J(e,t){var r=e.className;U(t).test(r)||(e.className+=(r?" ":"")+t)}function Y(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!U(r[n]).test(t)&&(t+=" "+r[n]);return t}var b=function(e){e.select()};y?b=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:h&&(b=function(e){try{e.select()}catch{}});function g(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ae(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function me(e,t,r,n,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=n||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=r-l%r,o=a+1}}var se=function(){this.id=null,this.f=null,this.time=0,this.handler=g(this.onTimeout,this)};se.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},se.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function de(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var Le=50,Me={toString:function(){return"CodeMirror.Pass"}},re={scroll:!1},fe={origin:"*mouse"},ye={origin:"+move"};function De(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);o==-1&&
|
2022-02-26 20:01:44 +08:00
|
|
|
|
2022-12-17 07:49:14 +08:00
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(`
|
|
|
|
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Rr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},_i=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jt=null;function Ht(e){if(jt!=null)return jt;var t=O(e,f("span","x")),r=t.getBoundingClientRect(),n=j(t,0,1).getBoundingClientRect();return jt=Math.abs(r.left-n.left)>1}var Ut={},Xt={};function Yt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Ut[e]=t}function wi(e,t){Xt[e]=t}function kn(e){if(typeof e=="string"&&Xt.hasOwnProperty(e))e=Xt[e];else if(e&&typeof e.name=="string"&&Xt.hasOwnProperty(e.name)){var t=Xt[e.name];typeof t=="string"&&(t={name:t}),e=Ge(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return kn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return kn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function cn(e,t){t=kn(t);var r=Ut[t.name];if(!r)return cn(e,"text/plain");var n=r(e,t);if(kt.hasOwnProperty(t.name)){var i=kt[t.name];for(var o in i)!i.hasOwnProperty(o)||(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var kt={};function _n(e,t){var r=kt.hasOwnProperty(e)?kt[e]:kt[e]={};ae(t,r)}function Qt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function qn(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),!(!r||r.mode==e));)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Wr(e,t,r){return e.startState?e.startState(t,r):!0}var Xe=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=me(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?me(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return me(this.string,null,this.tabSize)-(this.lineStart?me(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(l){return r?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(n(i)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.
|
|
|
|
`?(ie=E.appendChild(f("span",K[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),ie.setAttribute("cm-text",K[0]),e.col+=1):(ie=e.cm.options.specialCharPlaceholder(K[0]),ie.setAttribute("cm-text",K[0]),h&&I<9?E.appendChild(f("span",[ie])):E.appendChild(ie),e.col+=1);e.map.push(e.pos,e.pos+1,ie),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,r||n||i||d||o||l){var ge=r||"";n&&(ge+=n),i&&(ge+=i);var he=f("span",[E],ge,o);if(l)for(var ve in l)l.hasOwnProperty(ve)&&ve!="style"&&ve!="class"&&he.setAttribute(ve,l[ve]);return e.content.appendChild(he)}e.content.appendChild(E)}}function $u(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&r&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="\xA0"),n+=o,r=o==" "}return n}function Ku(e,t){return function(r,n,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var d=r.pos,E=d+n.length;;){for(var F=void 0,K=0;K<t.length&&(F=t[K],!(F.to>d&&F.from<=d));K++);if(F.to>=E)return e(r,n,i,o,l,a,s);e(r,n.slice(0,F.to-d),i,o,null,a,s),o=null,n=n.slice(F.to-d),d=F.to}}}function Bo(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Gu(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(!n){for(var l=1;l<r.length;l+=2)t.addToken(t,i.slice(o,o=r[l]),Ro(r[l+1],t.cm.options));return}for(var a=i.length,s=0,d=1,E="",F,K,H=0,ee,ie,ce,pe,ge;;){if(H==s){ee=ie=ce=K="",ge=null,pe=null,H=1/0;for(var he=[],ve=void 0,Te=0;Te<n.length;++Te){var Se=n[Te],Ie=Se.marker;if(Ie.type=="bookmark"&&Se.from==s&&Ie.widgetNode)he.push(Ie);else if(Se.from<=s&&(Se.to==null||Se.to>s||Ie.collapsed&&Se.to==s&&Se.from==s)){if(Se.to!=null&&Se.to!=s&&H>Se.to&&(H=Se.to,ie=""),Ie.className&&(ee+=" "+Ie.className),Ie.css&&(K=(K?K+";":"")+Ie.css),Ie.startStyle&&Se.from==s&&(ce+=" "+Ie.startStyle),Ie.endStyle&&Se.to==H&&(ve||(ve=[])).push(Ie.endStyle,Se.to),Ie.title&&((ge||(ge={})).title=Ie.title),Ie.attributes)for(var Ze in Ie.attributes)(ge||(ge={}))[Ze]=Ie.attributes[Ze];Ie.collapsed&&(!pe||Li(pe.marker,Ie)<0)&&(pe=Se)}else Se.from>s&&H>Se.from&&(H=Se.from)}if(ve)for(var dt=0;dt<ve.length;dt+=2)ve[dt+1]==H&&(ie+=" "+ve[dt]);if(!pe||pe.from==s)for(var Je=0;Je<he.length;++Je)Bo(t,0,he[Je]);if(pe&&(pe.from||0)==s){if(Bo(t,(pe.to==null?a+1:pe.to)-s,pe.marker,pe.from==null),pe.to==null)return;pe.to==s&&(pe=!1)}}if(s>=a)break;for(var Mt=Math.min(a,H);;){if(E){var Ct=s+E.length;if(!pe){var it=Ct>Mt?E.slice(0,Mt-s):E;t.addToken(t,it,F?F+ee:ee,ce,s+it.length==H?ie:"",K,ge)}if(Ct>=Mt){E=E.slice(Mt-s),s=Mt;break}s=Ct,ce=""}E=i.slice(o,o=r[d++]),F=Ro(r[d++],t.cm.options)}}}function jo(e,t,r){this.line=t,this.rest=qu(t),this.size=this.rest?je(xe(this.rest))-r+1:1,this.node=this.text=null,this.hidden=fn(e,t)}function Zr(e,t,r){for(var n=[],i,o=t;o<r;o=i){var l=new jo(e.doc,ke(e.doc,o),o);i=o+l.size,n.push(l)}return n}var Bn=null;function Zu(e){Bn?Bn.ops.push(e):e.ownsGroup=Bn={ops:[e],delayedCallbacks:[]}}function Xu(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Yu(e,t){var r=e.ownsGroup;if(!!r)try{Xu(r)}finally{Bn=null,t(r)}}var cr=null;function ut(e,t){var r=or(e,t);if(!!r.length){var n=Array.prototype.slice.call(arguments,2),i;Bn?i=Bn.delayedCallbacks:cr?i=cr:(i=cr=[],setTimeout(Qu,0));for(var o=function(a){i.push(function(){return r[a].apply(null,n)})},l=0;l<r.length;++l)o(l)}}function Qu(){var e=cr;cr=null;for(var t=0;t<e.length;++t)e[t]()}function Ho(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?Vu(e,t):o=="gutter"?$o(e,t,r,n):o=="class"?Ai(e,t):o=="widget"&&ec(e,t,n)}t.changes=null}function fr(e){return e.node==e.text&&(e.node=f("div",null,null,"position:
|
2022-06-24 18:50:56 +08:00
|
|
|
top: `+ve+"px; width: "+(Te??s-he)+`px;
|
2022-12-17 07:49:14 +08:00
|
|
|
height: `+(Se-ve)+"px"))}function F(he,ve,Te){var Se=ke(i,he),Ie=Se.text.length,Ze,dt;function Je(it,Lt){return Qr(e,c(he,it),"div",Se,Lt)}function Mt(it,Lt,ht){var at=ll(e,Se,null,it),ot=Lt=="ltr"==(ht=="after")?"left":"right",tt=ht=="after"?at.begin:at.end-(/\s/.test(Se.text.charAt(at.end-1))?2:1);return Je(tt,ot)[ot]}var Ct=bt(Se,i.direction);return qe(Ct,ve||0,Te??Ie,function(it,Lt,ht,at){var ot=ht=="ltr",tt=Je(it,ot?"left":"right"),Et=Je(Lt-1,ot?"right":"left"),rr=ve==null&&it==0,bn=Te==null&&Lt==Ie,yt=at==0,Zt=!Ct||at==Ct.length-1;if(Et.top-tt.top<=3){var pt=(d?rr:bn)&&yt,go=(d?bn:rr)&&Zt,ln=pt?a:(ot?tt:Et).left,Fn=go?s:(ot?Et:tt).right;E(ln,tt.top,Fn-ln,tt.bottom)}else{var In,wt,ir,mo;ot?(In=d&&rr&&yt?a:tt.left,wt=d?s:Mt(it,ht,"before"),ir=d?a:Mt(Lt,ht,"after"),mo=d&&bn&&Zt?s:Et.right):(In=d?Mt(it,ht,"before"):a,wt=!d&&rr&&yt?s:tt.right,ir=!d&&bn&&Zt?a:Et.left,mo=d?Mt(Lt,ht,"after"):s),E(In,tt.top,wt-In,tt.bottom),tt.bottom<Et.top&&E(a,tt.bottom,null,Et.top),E(ir,Et.top,mo-ir,Et.bottom)}(!Ze||Vr(tt,Ze)<0)&&(Ze=tt),Vr(Et,Ze)<0&&(Ze=Et),(!dt||Vr(tt,dt)<0)&&(dt=tt),Vr(Et,dt)<0&&(dt=Et)}),{start:Ze,end:dt}}var K=t.from(),H=t.to();if(K.line==H.line)F(K.line,K.ch,H.ch);else{var ee=ke(i,K.line),ie=ke(i,H.line),ce=Nt(ee)==Nt(ie),pe=F(K.line,K.ch,ce?ee.text.length+1:null).end,ge=F(H.line,ce?0:null,H.ch).start;ce&&(pe.top<ge.top-2?(E(pe.right,pe.top,null,pe.bottom),E(a,ge.top,ge.left,ge.bottom)):E(pe.right,pe.top,ge.left-pe.right,pe.bottom)),pe.bottom<ge.top&&E(a,pe.bottom,null,ge.top)}r.appendChild(o)}function Hi(e){if(!!e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||$n(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function cl(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||$i(e))}function Ui(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&$n(e))},100)}function $i(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ve(e,"focus",e,t),e.state.focused=!0,J(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),w&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Hi(e))}function $n(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ve(e,"blur",e,t),e.state.focused=!1,Q(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function ei(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,l=0;l<t.view.length;l++){var a=t.view[l],s=e.options.lineWrapping,d=void 0,E=0;if(!a.hidden){if(i+=a.line.height,h&&I<8){var F=a.node.offsetTop+a.node.offsetHeight;d=F-r,r=F}else{var K=a.node.getBoundingClientRect();d=K.bottom-K.top,!s&&a.text.firstChild&&(E=a.text.firstChild.getBoundingClientRect().right-K.left-1)}var H=a.line.height-d;if((H>.005||H<-.005)&&(i<n&&(o-=H),Ot(a.line,d),fl(a.line),a.rest))for(var ee=0;ee<a.rest.length;ee++)fl(a.rest[ee]);if(E>e.display.sizerWidth){var ie=Math.ceil(E/Un(e.display));ie>e.display.maxLineLength&&(e.display.maxLineLength=ie,e.display.maxLine=a.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function fl(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function ti(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Xr(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,o=Vt(t,n),l=Vt(t,i);if(r&&r.ensure){var a=r.ensure.from.line,s=r.ensure.to.line;a<o?(o=a,l=Vt(t,tn(ke(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=Vt(t,tn(ke(t,s))-e.wrapper.clientH
|
|
|
|
top: `+(t.top-r.viewOffset-Xr(e.display))+`px;
|
|
|
|
height: `+(t.bottom-t.top+Kt(e)+r.barHeight)+`px;
|
|
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function hc(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(r=t.sticky=="before"?c(t.line,t.ch+1,"before"):t,t=t.ch?c(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var l=!1,a=qt(e,t),s=!r||r==t?a:qt(e,r);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-n,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+n};var d=Ki(e,i),E=e.doc.scrollTop,F=e.doc.scrollLeft;if(d.scrollTop!=null&&(mr(e,d.scrollTop),Math.abs(e.doc.scrollTop-E)>1&&(l=!0)),d.scrollLeft!=null&&(zn(e,d.scrollLeft),Math.abs(e.doc.scrollLeft-F)>1&&(l=!0)),!l)break}return i}function gc(e,t){var r=Ki(e,t);r.scrollTop!=null&&mr(e,r.scrollTop),r.scrollLeft!=null&&zn(e,r.scrollLeft)}function Ki(e,t){var r=e.display,n=Hn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,o=Fi(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Di(r),s=t.top<n,d=t.bottom>a-n;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var E=Math.min(t.top,(d?a:t.bottom)-o);E!=i&&(l.scrollTop=E)}var F=e.options.fixedGutter?0:r.gutters.offsetWidth,K=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-F,H=Tn(e)-r.gutters.offsetWidth,ee=t.right-t.left>H;return ee&&(t.right=t.left+H),t.left<10?l.scrollLeft=0:t.left<K?l.scrollLeft=Math.max(0,t.left+F-(ee?0:10)):t.right>H+K-3&&(l.scrollLeft=t.right+(ee?0:10)-H),l}function Gi(e,t){t!=null&&(ni(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Kn(e){ni(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function gr(e,t,r){(t!=null||r!=null)&&ni(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function mc(e,t){ni(e),e.curOp.scrollToPos=t}function ni(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=il(e,t.from),n=il(e,t.to);dl(e,r,n,t.margin)}}function dl(e,t,r,n){var i=Ki(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});gr(e,i.scrollLeft,i.scrollTop)}function mr(e,t){Math.abs(e.doc.scrollTop-t)<2||(A||Xi(e,{top:t}),pl(e,t,!0),A&&Xi(e),br(e,100))}function pl(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function zn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)&&(e.doc.scrollLeft=t,yl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function vr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Di(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Kt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Mn=function(e,t,r){this.cm=r;var n=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),Ce(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ce(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,h&&I<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Mn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.sty
|
|
|
|
`},setDirection:ft(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Dc(this.cm))})}),Tt.prototype.eachLine=Tt.prototype.iter;var Xl=0;function $c(e){var t=this;if(Yl(t),!(et(t,e)||nn(t.display,e))){st(e),h&&(Xl=+new Date);var r=Ln(t,e,!0),n=e.dataTransfer.files;if(!(!r||t.isReadOnly()))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,a=function(){++l==i&&ct(t,function(){r=we(t.doc,r);var H={from:r,to:r,text:t.doc.splitLines(o.filter(function(ee){return ee!=null}).join(t.doc.lineSeparator())),origin:"paste"};Yn(t.doc,H),Il(t.doc,hn(we(t.doc,r),we(t.doc,gn(H))))})()},s=function(H,ee){if(t.options.allowDropFileTypes&&de(t.options.allowDropFileTypes,H.type)==-1){a();return}var ie=new FileReader;ie.onerror=function(){return a()},ie.onload=function(){var ce=ie.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ce)){a();return}o[ee]=ce,a()},ie.readAsText(H)},d=0;d<n.length;d++)s(n[d],d);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var E=e.dataTransfer.getData("Text");if(E){var F;if(t.state.draggingText&&!t.state.draggingText.copy&&(F=t.listSelections()),si(t.doc,hn(r,r)),F)for(var K=0;K<F.length;++K)Qn(t.doc,"",F[K].anchor,F[K].head,"drag");t.replaceSelection(E,"around","paste"),t.display.input.focus()}}catch{}}}}function Kc(e,t){if(h&&(!e.state.draggingText||+new Date-Xl<100)){Bt(t);return}if(!(et(e,t)||nn(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!p)){var r=f("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",x&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),x&&r.parentNode.removeChild(r)}}function Gc(e,t){var r=Ln(e,t);if(!!r){var n=document.createDocumentFragment();ji(e,r,n),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),O(e.display.dragCursor,n)}}function Yl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ql(e){if(!!document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var o=0;o<r.length;o++)e(r[o])})}}var Jl=!1;function Zc(){Jl||(Xc(),Jl=!0)}function Xc(){var e;Ce(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ql(Yc)},100))}),Ce(window,"blur",function(){return Ql($n)})}function Yc(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var yn={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Er=0;Er<10;Er++)yn[Er+48]=yn[Er+96]=String(Er);for(var fi=65;fi<=90;fi++)yn[fi]=String.fromCharCode(fi);for(var zr=1;zr<=12;zr++)yn[zr+111]=yn[zr+63235]="F"+zr;var on={};on.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},on.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteL
|
|
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function na(e,t){var r=ke(e.doc,t),n=Nt(r);return n!=r&&(t=je(n)),ao(!0,e,n,t,1)}function ef(e,t){var r=ke(e.doc,t),n=Nu(r);return n!=r&&(t=je(n)),ao(!0,e,r,t,-1)}function ra(e,t){var r=na(e,t.line),n=ke(e.doc,r.line),i=bt(n,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(r.ch,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return c(r.line,l?0:o,r.sticky)}return r}function pi(e,t,r){if(typeof t=="string"&&(t=Mr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Me}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function tf(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Vn(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Vn(t,e.options.extraKeys,r,e)||Vn(t,e.options.keyMap,r,e)}var nf=new se;function Ar(e,t,r,n){var i=e.state.keySeq;if(i){if(Vl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:nf.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),ia(e,i+" "+t,r,n))return!0}return ia(e,t,r,n)}function ia(e,t,r,n){var i=tf(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ut(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(st(r),Hi(e)),!!i}function oa(e,t){var r=ta(t,!0);return r?t.shiftKey&&!e.state.keySeq?Ar(e,"Shift-"+r,t,function(n){return pi(e,n,!0)})||Ar(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return pi(e,n)}):Ar(e,r,t,function(n){return pi(e,n)}):!1}function rf(e,t,r){return Ar(e,"'"+r+"'",t,function(n){return pi(e,n,!0)})}var so=null;function la(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=L(),!et(t,e))){h&&I<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=oa(t,e);x&&(so=n?r:null,!n&&r==88&&!_i&&(q?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),A&&!q&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&of(t)}}function of(e){var t=e.display.lineDiv;J(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(Q(t,"CodeMirror-crosshair"),Fe(document,"keyup",r),Fe(document,"mouseover",r))}Ce(document,"keyup",r),Ce(document,"mouseover",r)}function aa(e){e.keyCode==16&&(this.doc.sel.shift=!1),et(this,e)}function sa(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(nn(t.display,e)||et(t,e)||e.ctrlKey&&!e.altKey||q&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(x&&r==so){so=null,st(e);return}if(!(x&&(!e.which||e.which<10)&&oa(t,e))){var i=String.fromCharCode(n??r);i!="\b"&&(rf(t,e,i)||t.display.input.onKeyPress(e))}}}var lf=400,uo=function(e,t,r){this.time=e,this.pos=t,this.button=r};uo.prototype.compare=function(e,t,r){return this.time+lf>e&&C(t,this.pos)==0&&r==this.button};var Dr,Fr;function af(e,t){var r=+new Date;return Fr&&Fr.compare(r,e,t)?(Dr=Fr=null,"triple"):Dr&&Dr.compare(r,e,t)?(Fr=new uo(r,e,t),Dr=null,"double"):(Dr=new uo(r,e,t),Fr=null,"single")}function ua(e){var t=this,r=t.display;if(!(et(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,nn(r,e)){w||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(!co(t,e)){var n=Ln(t,e),i=On(e),o=n?af(n,i):"single";window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(n&&sf(t,i,n,o,e))&&(i==1?n?cf(t,n,o,e):ar(e)==r.scroller&&st(e):i==2?(n&&ai(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(X?t.display.input.onContextMenu(e):Ui(t)))}}}function sf(e,t,r,n,i){var o="Click";return n=="double"?o="Double"+o:n=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Ar(e,ea(o,i),i,function(l){if(typeof l=="string"&&(l=Mr[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,r)!=Me}finally{e.state.suppressEdits=!1}return a})}function uf(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null)
|
|
|
|
`)==t){if(n.ranges.length%Wt.text.length==0){d=[];for(var E=0;E<Wt.text.length;E++)d.push(o.splitLines(Wt.text[E]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(d=He(s,function(pe){return[pe]}));for(var F=e.curOp.updateInput,K=n.ranges.length-1;K>=0;K--){var H=n.ranges[K],ee=H.from(),ie=H.to();H.empty()&&(r&&r>0?ee=c(ee.line,ee.ch-r):e.state.overwrite&&!a?ie=c(ie.line,Math.min(ke(o,ie.line).text.length,ie.ch+xe(s).length)):a&&Wt&&Wt.lineWise&&Wt.text.join(`
|
2022-02-26 20:01:44 +08:00
|
|
|
`)==s.join(`
|
2022-12-17 07:49:14 +08:00
|
|
|
`)&&(ee=ie=c(ee.line,0)));var ce={from:ee,to:ie,text:d?d[K%d.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};Yn(e.doc,ce),ut(e,"inputRead",e,ce)}t&&!a&&ma(e,t),Kn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=F),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ga(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&zt(t,function(){return po(t,r,0,null,"paste")}),!0}function ma(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=Ir(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ke(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Ir(e,i.head.line,"smart"));l&&ut(e,"electricInput",e,i.head.line)}}}function va(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:c(i,0),head:c(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function ya(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function ba(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return w?e.style.width="1000px":e.setAttribute("wrap","off"),y&&(e.style.border="1px solid black"),ya(e),t}function bf(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,i){var o=this.options,l=o[n];o[n]==i&&n!="mode"||(o[n]=i,t.hasOwnProperty(n)&&ct(this,t[n])(this,i,l),Ve(this,"optionChange",this,n))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,i){this.state.keyMaps[i?"push":"unshift"](di(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==n||i[o].name==n)return i.splice(o,1),!0},addOverlay:_t(function(n,i){var o=n.token?n:e.getMode(this.options,n);if(o.startState)throw new Error("Overlays may not be stateful.");nt(this.state.overlays,{mode:o,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,St(this)}),removeOverlay:_t(function(n){for(var i=this.state.overlays,o=0;o<i.length;++o){var l=i[o].modeSpec;if(l==n||typeof n=="string"&&l.name==n){i.splice(o,1),this.state.modeGen++,St(this);return}}}),indentLine:_t(function(n,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Sn(this.doc,n)&&Ir(this,n,i,o)}),indentSelection:_t(function(n){for(var i=this.doc.sel.ranges,o=-1,l=0;l<i.length;l++){var a=i[l];if(a.empty())a.head.line>o&&(Ir(this,a.head.line,n,!0),o=a.head.line,l==this.doc.sel.primIndex&&Kn(this));else{var s=a.from(),d=a.to(),E=Math.max(o,s.line);o=Math.min(this.lastLine(),d.line-(d.ch?0:1))+1;for(var F=E;F<o;++F)Ir(this,F,n);var K=this.doc.sel.ranges;s.ch==0&&i.length==K.length&&K[l].from().ch>0&&io(this.doc,l,new Ue(s,K[l].to()),re)}}}),getTokenAt:function(n,i){return Eo(this,n,i)},getLineTokens:function(n,i){return Eo(this,c(n),i,!0)},getTokenTypeAt:function(n){n=we(this.doc,n);var i=To(this,ke(this.doc,n.line)),o=0,l=(i.length-1)/2,a=n.ch,s;if(a==0)s=i[2];else for(;;){var d=o+l>>1;if((d?i[d*2-1]:0)>=a)l=d;else if(i[d*2+1]<a)o=d+1;else{s=i[d*2+2];break}}var E=s?s.indexOf("overlay "):-1;return E<0?s:E==0?null:s.slice(0,E-1)},getModeAt:function(n){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(n).state).mode:i},getHelper:function(n,i){return this.getHelpers(n,i)[0]},getHelpers:function(n,i){var o=[];if(!r.hasOwnProperty(i))return o;var l=r[i],a=this.getModeAt(n);if(typeof a[i]=="string")l[a[i]
|
|
|
|
`,ce=le(ie,H)?"w":K&&ie==`
|
|
|
|
`?"n":!K||/\s/.test(ie)?null:"p";if(K&&!ee&&!ce&&(ce="s"),F&&F!=ce){r<0&&(r=1,E(),t.sticky="after");break}if(ce&&(F=ce),r>0&&!E(!ee))break}var pe=ui(e,t,o,l,!0);return ne(o,pe)&&(pe.hitSide=!0),pe}function xa(e,t,r,n){var i=e.doc,o=t.left,l;if(n=="page"){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(a-.5*Hn(e.display),3);l=(r>0?t.bottom:t.top)+r*s}else n=="line"&&(l=r>0?t.bottom+3:t.top-3);for(var d;d=Ni(e,o,l),!!d.outside;){if(r<0?l<=0:l>=i.height){d.hitSide=!0;break}l+=r*5}return d}var Ke=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new se,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ke.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;i.contentEditable=!0,ya(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function o(a){for(var s=a.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}Ce(i,"paste",function(a){!o(a)||et(n,a)||ga(a,n)||I<=11&&setTimeout(ct(n,function(){return t.updateFromDOM()}),20)}),Ce(i,"compositionstart",function(a){t.composing={data:a.data,done:!1}}),Ce(i,"compositionupdate",function(a){t.composing||(t.composing={data:a.data,done:!1})}),Ce(i,"compositionend",function(a){t.composing&&(a.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ce(i,"touchstart",function(){return r.forceCompositionEnd()}),Ce(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(a){if(!(!o(a)||et(n,a))){if(n.somethingSelected())gi({lineWise:!1,text:n.getSelections()}),a.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var s=va(n);gi({lineWise:!0,text:s.text}),a.type=="cut"&&n.operation(function(){n.setSelections(s.ranges,0,re),n.replaceSelection("",null,"cut")})}else return;if(a.clipboardData){a.clipboardData.clearData();var d=Wt.text.join(`
|
|
|
|
`);if(a.clipboardData.setData("Text",d),a.clipboardData.getData("Text")==d){a.preventDefault();return}}var E=ba(),F=E.firstChild;n.display.lineSpace.insertBefore(E,n.display.lineSpace.firstChild),F.value=Wt.text.join(`
|
|
|
|
`);var K=L();b(F),setTimeout(function(){n.display.lineSpace.removeChild(E),K.focus(),K==i&&r.showPrimarySelection()},50)}}Ce(i,"copy",l),Ce(i,"cut",l)},Ke.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ke.prototype.prepareSelection=function(){var e=ul(this.cm,!1);return e.focus=L()==this.div,e},Ke.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Ke.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ke.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=mi(t,e.anchorNode,e.anchorOffset),l=mi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&l&&!l.bad&&C(Re(o,l),n)==0&&C(ze(o,l),i)==0)){var a=t.display.view,s=n.line>=t.display.viewFrom&&ka(t,n)||{node:a[0].measure.map[2],offset:0},d=i.line<t.display.viewTo&&ka(t,i);if(!d){var E=a[a.length-1].measure,F=E.maps?E.maps[E.maps.length-1]:E.map;d={node:F[F.length-1],offset:F[F.length-2]-F[F.length-3]}}if(!s||!d){e.removeAllRanges();return}var K=e.rangeCount&&e.getRangeAt(0),H;try{H=j(s.node,s.offset,d.offset,d.node)}catch{}H&&(!A&&t.state.focused?(e.collapse(s.node,s.offset),H.collapsed||(e.removeAllRanges(),e.addRange(H))):(e.removeAllRanges(),e.addRange(H)),K&&e.anchorNode==null?e.addRange(K):A&&this.startGracePeriod()),this.rememberSelection()}},Ke.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},Ke.prototype.showMultipleSelections=function(e){O(this.cm.display.cursorDiv,e.cursors),O(this.cm.display.selectionDiv,e.selection)},Ke.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ke.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return M(this.div,t)},Ke.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||L()!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ke.prototype.blur=function(){this.div.blur()},Ke.prototype.getField=function(){return this.div},Ke.prototype.supportsTouch=function(){return!0},Ke.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):zt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function r(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,r))}this.polling.set(this.cm.options.pollInterval,r)},Ke.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ke.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(B&&T&&this.cm.display.gutterSpecs.length&&xf(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var r=mi(t,e.anchorNode,e.anchorOffset),n=mi(t,e.focusNode,e.focusOffset);r&&n&&zt(t,function(){vt(t.doc,hn(r,n),re),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},Ke.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=c(n.line-1,ke(e.doc,n.line-1).length)),i.ch==ke(e.doc,i.line).text.length&&i.line<e.lastLine()
|
|
|
|
`),b(i))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}}Ce(i,"cut",o),Ce(i,"copy",o),Ce(e.scroller,"paste",function(l){if(!(nn(e,l)||et(n,l))){if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),Ce(e.lineSpace,"selectstart",function(l){nn(e,l)||st(l)}),Ce(i,"compositionstart",function(){var l=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ce(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},rt.prototype.createField=function(e){this.wrapper=ba(),this.textarea=this.wrapper.firstChild},rt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},rt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ul(e);if(e.options.moveInputWithCursor){var i=qt(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},rt.prototype.showSelection=function(e){var t=this.cm,r=t.display;O(r.cursorDiv,e.cursors),O(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},rt.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&b(this.textarea),h&&I>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",h&&I>=9&&(this.hasSelection=null))}},rt.prototype.getField=function(){return this.textarea},rt.prototype.supportsTouch=function(){return!1},rt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!k||L()!=this.textarea))try{this.textarea.focus()}catch{}},rt.prototype.blur=function(){this.textarea.blur()},rt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},rt.prototype.receivedFocus=function(){this.slowPoll()},rt.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},rt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},rt.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Rr(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(h&&I>=9&&this.hasSelection===i||q&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!n&&(n="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(n.length,i.length);l<a&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return zt(t,function(){po(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
|
|
|
|
`)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},rt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},rt.prototype.onKeyPress=function(){h&&I>=9&&(this.hasSelection=null),this.fastPoll()},rt.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Ln(r,e),l=n.scroller.scrollTop;if(!o||x)return;var a=r.options.resetSelectionOnContextMenu;a&&r.doc.sel.contains(o)==-1&&ct(r,vt)(r.doc,hn(o),re);var s=i.style.cssText,d=t.wrapper.style.cssText,E=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
|
|
top: `+(e.clientY-E.top-5)+"px; left: "+(e.clientX-E.left-5)+`px;
|
|
|
|
z-index: 1000; background: `+(h?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var F;w&&(F=window.scrollY),n.input.focus(),w&&window.scrollTo(null,F),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=H,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function K(){if(i.selectionStart!=null){var ie=r.somethingSelected(),ce="\u200B"+(ie?i.value:"");i.value="\u21DA",i.value=ce,t.prevInput=ie?"":"\u200B",i.selectionStart=1,i.selectionEnd=ce.length,n.selForContextMenu=r.doc.sel}}function H(){if(t.contextMenuPending==H&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=s,h&&I<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),i.selectionStart!=null)){(!h||h&&I<9)&&K();var ie=0,ce=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?ct(r,Rl)(r):ie++<10?n.detectingSelectAll=setTimeout(ce,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(ce,200)}}if(h&&I>=9&&K(),X){Bt(e);var ee=function(){Fe(window,"mouseup",ee),setTimeout(H,20)};Ce(window,"mouseup",ee)}else setTimeout(H,50)},rt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},rt.prototype.setUneditable=function(){},rt.prototype.needsContentAttribute=!1;function wf(e,t){if(t=t?ae(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=L();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=a.getValue()}var i;if(e.form&&(Ce(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=n,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,n(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(Fe(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=Qe(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function Sf(e){e.off=Fe,e.on=Ce,e.wheelEventPixels=Mc,e.Doc=Tt,e.splitLines=Nn,e.countColumn=me,e.findColumn=De,e.isWordChar=Z,e.Pass=Me,e.signal=Ve,e.Line=Wn,e.changeEnd=gn,e.scrollbarModel=gl,e.Pos=c,e.cmpPos=C,e.modes=Ut,e.mimeModes=Xt,e.resolveMode=kn,e.getMode=cn,e.modeExtensions=kt,e.extendMode=_n,e.copyState=Qt,e.startState=Wr,e.innerMode=qn,e.commands=Mr,e.keyMap=on,e.keyName=ta,e.isModifierKey=Vl,e.lookupKey=Vn,e.normalizeKeyMap=Jc,e.StringStream=Xe,e.SharedTextMarker=Lr,e.TextMarker=vn,e.LineWidget=Cr,e.e_preventDefault=st,e.e_stopPropagation=Ft,e.e_stop=Bt,e.addClass=J,e.contains=M,e.rmClass=Q,e.keyNames=yn}gf(Qe),bf(Qe);var Tf="iter insert remove copy getEditor constructor".split(" ");for(var vi in Tt.prototype)Tt.prototype.hasOwnProperty(vi)&&de(Tf,vi)<0&&(Qe.prototype[vi]=function(e){return function(){return e.apply(this.doc,arguments)}}(Tt.prototype[vi]));return un(Tt),Qe.inputStyles={textarea:rt,contenteditable:Ke},Qe.defineMode=function(e){!Qe.defaults.mode&&e!="null"&&(Qe.defaults.mode=e),Yt.apply(this,arguments)},Qe.defineMIME=wi,Qe.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Qe.defineMIME("text/plain","null"),Qe.defineExtension=function(e,t){Qe.prototype[e]=t},Qe.defineDocExtension=function(e,t){Tt.prototype[e]=t},Qe.fromTextArea=wf,Sf(Qe),Qe.version="5.65.5",Qe})});var wa=Oe((Or,bo)=>{(function(u,N){typeof Or=="object"&&typeof bo=="object"?bo.exports=N():typeof define=="function"&&define.amd?define([],N):typeof Or=="object"?Or.ClipboardJS=N():u.ClipboardJS=N()})(Or,function(){return N={686:function(P,w,D){"use strict";D.d(w,{default:function(){return oe}});var w=D(279),h=D.n(w),w=D(370),I=D.n(w),w=D(817),z=D.n(w);function T(G){try{return document.execCommand(G)}catch{return}}var m=function(G){return G=z()(G),T("cut"),G};function x(R,X){var U,Q,R=(U=R,Q=document.documentElement.g
|
|
|
|
`&&(S.innerActive=S.inner=null);else for(var h=0;h<A.length;++h){var I=A[h];I.open===`
|
|
|
|
`&&(S.innerActive=I,S.inner=u.startState(I.mode,D.indent?D.indent(S.outer,"",""):0))}},electricChars:N.electricChars,innerMode:function(S){return S.inner?{state:S.inner,mode:S.innerActive.mode}:{state:S.outer,mode:N}}}}})});var du=Oe((cu,fu)=>{(function(u){typeof cu=="object"&&typeof fu=="object"?u(Pe(),uu()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../../addon/mode/multiplex"],u):u(CodeMirror)})(function(u){"use strict";u.defineMode("twig:inner",function(){var N=["and","as","autoescape","endautoescape","block","do","endblock","else","elseif","extends","for","endfor","embed","endembed","filter","endfilter","flush","from","if","endif","in","is","include","import","not","or","set","spaceless","endspaceless","with","endwith","trans","endtrans","blocktrans","endblocktrans","macro","endmacro","use","verbatim","endverbatim"],A=/^[+\-*&%=<>!?|~^]/,P=/^[:\[\(\{]/,S=["true","false","null","empty","defined","divisibleby","divisible by","even","odd","iterable","sameas","same as"],D=/^(\d[+\-\*\/])?\d+(\.\d+)?/;N=new RegExp("(("+N.join(")|(")+"))\\b"),S=new RegExp("(("+S.join(")|(")+"))\\b");function h(I,w){var z=I.peek();if(w.incomment)return I.skipTo("#}")?(I.eatWhile(/\#|}/),w.incomment=!1):I.skipToEnd(),"comment";if(w.intag){if(w.operator){if(w.operator=!1,I.match(S))return"atom";if(I.match(D))return"number"}if(w.sign){if(w.sign=!1,I.match(S))return"atom";if(I.match(D))return"number"}if(w.instring)return z==w.instring&&(w.instring=!1),I.next(),"string";if(z=="'"||z=='"')return w.instring=z,I.next(),"string";if(I.match(w.intag+"}")||I.eat("-")&&I.match(w.intag+"}"))return w.intag=!1,"tag";if(I.match(A))return w.operator=!0,"operator";if(I.match(P))w.sign=!0;else if(I.eat(" ")||I.sol()){if(I.match(N))return"keyword";if(I.match(S))return"atom";if(I.match(D))return"number";I.sol()&&I.next()}else I.next();return"variable"}else if(I.eat("{")){if(I.eat("#"))return w.incomment=!0,I.skipTo("#}")?(I.eatWhile(/\#|}/),w.incomment=!1):I.skipToEnd(),"comment";if(z=I.eat(/\{|%/))return w.intag=z,z=="{"&&(w.intag="}"),I.eat("-"),"tag"}I.next()}return{startState:function(){return{}},token:function(I,w){return h(I,w)}}}),u.defineMode("twig",function(N,A){var P=u.getMode(N,"twig:inner");return!A||!A.base?P:u.multiplexingMode(u.getMode(N,A.base),{open:/\{[{#%]/,close:/[}#%]\}/,mode:P,parseDelimiters:!0})}),u.defineMIME("text/x-twig","twig")})});var gu=Oe((pu,hu)=>{(function(u){typeof pu=="object"&&typeof hu=="object"?u(Pe()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";u.defineMode("vb",function(N,A){var P="error";function S(L){return new RegExp("^(("+L.join(")|(")+"))\\b","i")}var D=new RegExp("^[\\+\\-\\*/%&\\\\|\\^~<>!]"),h=new RegExp("^[\\(\\)\\[\\]\\{\\}@,:`=;\\.]"),I=new RegExp("^((==)|(<>)|(<=)|(>=)|(<>)|(<<)|(>>)|(//)|(\\*\\*))"),w=new RegExp("^((\\+=)|(\\-=)|(\\*=)|(%=)|(/=)|(&=)|(\\|=)|(\\^=))"),z=new RegExp("^((//=)|(>>=)|(<<=)|(\\*\\*=))"),T=new RegExp("^[_A-Za-z][_A-Za-z0-9]*"),m=["class","module","sub","enum","select","while","if","function","get","set","property","try","structure","synclock","using","with"],x=["else","elseif","case","catch","finally"],p=["next","loop"],v=["and","andalso","or","orelse","xor","in","not","is","isnot","like"],_=S(v),y=["#const","#else","#elseif","#end","#if","#region","addhandler","addressof","alias","as","byref","byval","cbool","cbyte","cchar","cdate","cdbl","cdec","cint","clng","cobj","compare","const","continue","csbyte","cshort","csng","cstr","cuint","culng","cushort","declare","default","delegate","dim","directcast","each","erase","error","event","exit","explicit","false","for","friend","gettype","goto","handles","implements","imports","infer","inherits","interface","isfalse","istrue","lib","me","mod","mustinherit","mustoverride","my","mybase","myclass","namespace","narrowing","new","nothing","notinheritable","notoverridable","of","off","on","operator","option","optional","out","overloads","overridable","overrides","paramarray","partial","private","protected","public","raiseevent","readonly","redim","r
|
|
|
|
`);let A=u.textContent.trimEnd(),P="";if(N!==null){let D=N.className.replace("language-","");P=Pr(D,A)}let S=(0,xn.default)(function(D){u.parentNode.replaceChild(D,u)},{value:A,mode:P,lineNumbers:!0,lineWrapping:!1,theme:Nr(),readOnly:!0});Df(S)}function Df(u){let N='<svg viewBox="0 0 24 24" width="16" height="16" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>',A=document.createElement("div");A.classList.add("CodeMirror-copy"),A.innerHTML=N,u.display.wrapper.appendChild(A),new Tu.default(A,{text:function(S){return u.getValue()}}).on("success",S=>{A.classList.add("success"),setTimeout(()=>{A.classList.remove("success")},240)})}function Pr(u,N){u=u.trim().replace(/^\./g,"").toLowerCase();let A=typeof wo[u];return A==="undefined"?"":A==="function"?wo[u](N):wo[u]}function Nr(){let u=document.documentElement.classList.contains("dark-mode");return window.codeTheme||(u?"darcula":"default")}function yd(u,N,A){return(0,xn.default)(u,{value:N,mode:Pr(A,N),lineNumbers:!0,lineWrapping:!1,theme:Nr(),readOnly:!0})}function bd(u,N){let A=u.textContent;return(0,xn.default)(function(P){u.parentNode.insertBefore(P,u),u.style.display="none"},{value:A,mode:Pr(N,A),lineNumbers:!0,lineWrapping:!1,theme:Nr()})}function xd(u,N){return xn.default.fromTextArea(u,{mode:Pr(N,u.value),lineNumbers:!0,lineWrapping:!1,theme:Nr()})}function kd(u,N,A){u.setOption("mode",Pr(N,A))}function _d(u,N){u.setValue(N),setTimeout(()=>{Ff(u)},10)}function Ff(u){u.refresh()}function wd(u){let A={value:u.textContent,mode:"markdown",lineNumbers:!0,lineWrapping:!0,theme:Nr(),scrollPastEnd:!0};return window.$events.emitPublic(u,"editor-markdown-cm::pre-init",{config:A}),(0,xn.default)(function(P){u.parentNode.insertBefore(P,u),u.style.display="none"},A)}function Sd(){return xn.default.keyMap.default==xn.default.keyMap.macDefault?"Cmd":"Ctrl"}export{Sd as getMetaKey,md as highlight,vd as highlightWithin,xd as inlineEditor,wd as markdownEditor,bd as popupEditor,_d as setContent,kd as setMode,Ff as updateLayout,yd as wysiwygView};
|
2022-02-26 20:01:44 +08:00
|
|
|
/*!
|
2022-06-24 18:50:56 +08:00
|
|
|
* clipboard.js v2.0.11
|
2022-02-26 20:01:44 +08:00
|
|
|
* https://clipboardjs.com/
|
|
|
|
*
|
|
|
|
* Licensed MIT © Zeno Rocha
|
|
|
|
*/
|
|
|
|
//# sourceMappingURL=code.js.map
|