2025-10-02 14:58:30 +07:00
var ss = Object . defineProperty ; var Sd = Object . getOwnPropertyDescriptor ; var Td = Object . getOwnPropertyNames ; var Ld = Object . prototype . hasOwnProperty ; var Cd = ( o , p ) => ( ) => ( o && ( p = o ( o = 0 ) ) , p ) ; var Ke = ( o , p ) => ( ) => ( p || o ( ( p = { exports : { } } ) . exports , p ) , p . exports ) ; var Ed = ( o , p , v , C ) => { if ( p && typeof p == "object" || typeof p == "function" ) for ( let b of Td ( p ) ) ! Ld . call ( o , b ) && b !== v && ss ( o , b , { get : ( ) => p [ b ] , enumerable : ! ( C = Sd ( p , b ) ) || C . enumerable } ) ; return o } ; var zd = o => Ed ( ss ( { } , "__esModule" , { value : ! 0 } ) , o ) ; var We = Ke ( ( Yo , Qo ) => { ( function ( o , p ) { typeof Yo == "object" && typeof Qo < "u" ? Qo . exports = p ( ) : typeof define == "function" && define . amd ? define ( p ) : ( o = o || self , o . CodeMirror = p ( ) ) } ) ( Yo , ( function ( ) { "use strict" ; var o = navigator . userAgent , p = navigator . platform , v = /gecko\/\d/i . test ( o ) , C = /MSIE \d/ . test ( o ) , b = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/ . exec ( o ) , S = /Edge\/(\d+)/ . exec ( o ) , s = C || b || S , h = s && ( C ? document . documentMode || 6 : + ( S || b ) [ 1 ] ) , g = ! S && /WebKit\// . test ( o ) , T = g && /Qt\/\d+\.\d+/ . test ( o ) , w = ! S && /Chrome\/(\d+)/ . exec ( o ) , c = w && + w [ 1 ] , d = /Opera\// . test ( o ) , k = /Apple Computer/ . test ( navigator . vendor ) , z = /Mac OS X 1\d\D([8-9]|\d\d)\D/ . test ( o ) , M = /PhantomJS/ . test ( o ) , _ = k && ( /Mobile\/\w+/ . test ( o ) || navigator . maxTouchPoints > 2 ) , W = /Android/ . test ( o ) , E = _ || W || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i . test ( o ) , O = _ || /Mac/ . test ( p ) , G = /\bCrOS\b/ . test ( o ) , J = /win/i . test ( p ) , re = d && o . match ( /Version\/(\d*\.\d*)/ ) ; re && ( re = Number ( re [ 1 ] ) ) , re && re >= 15 && ( d = ! 1 , g = ! 0 ) ; var q = O && ( T || d && ( re == null || re < 12.11 ) ) , I = v || s && h >= 9 ; function D ( e ) { return new RegExp ( "(^|\\s)" + e + "(?:$|\\s)\\s*" ) } var Q = function ( e , t ) { var n = e . className , r = D ( t ) . exec ( n ) ; if ( r ) { var i = n . slice ( r . index + r [ 0 ] . length ) ; e . className = n . slice ( 0 , r . index ) + ( i ? r [ 1 ] + i : "" ) } } ; function j ( e ) { for ( var t = e . childNodes . length ; t > 0 ; -- t ) e . removeChild ( e . firstChild ) ; return e } function V ( e , t ) { return j ( e ) . appendChild ( t ) } function y ( e , t , n , r ) { var i = document . createElement ( e ) ; if ( n && ( i . className = n ) , r && ( i . style . cssText = r ) , typeof t == "string" ) i . appendChild ( document . createTextNode ( t ) ) ; else if ( t ) for ( var a = 0 ; a < t . length ; ++ a ) i . appendChild ( t [ a ] ) ; return i } function K ( e , t , n , r ) { var i = y ( e , t , n , r ) ; return i . setAttribute ( "role" , "presentation" ) , i } var X ; document . createRange ? X = function ( e , t , n , r ) { var i = document . createRange ( ) ; return i . setEnd ( r || e , n ) , i . setStart ( e , t ) , i } : X = function ( e , t , n ) { var r = document . body . createTextRange ( ) ; try { r . moveToElementText ( e . parentNode ) } catch { return r } return r . collapse ( ! 0 ) , r . moveEnd ( "character" , n ) , r . moveStart ( "character" , t ) , r } ; function N ( 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 R ( e ) { var t = e . ownerDocument || e , n ; try { n = e . activeElement } catch { n = t . body || null } for ( ; n && n . shadowRoot && n . shadowRoot . activeElement ; ) n = n . shadowRoot . activeElement ; return n } function le ( e , t ) { var n = e . className ; D ( t ) . test ( n ) || ( e . className += ( n ? " " : "" ) + t ) } function xe ( e , t ) { for ( var n = e . split ( " " ) , r = 0 ; r < n . length ; r ++ ) n [ r ] && ! D ( n [ r ] ) . test ( t ) && ( t += " " + n [ r ] ) ; return t } var F = function ( e ) { e . select ( ) } ; _ ? F = function ( e ) { e . selectionStart = 0 , e . selectionEnd = e . value . length } : s && ( F = function ( e ) { try { e . select ( ) } catch { } } ) ; function L ( e ) { return e . display . wrapper . ownerDocument } function de ( e ) { return ze ( e . display . wrapper ) } function ze ( e ) { return e . getRootNode ? e . getRootNode ( ) : e . ownerDocument } function pe ( e ) { return L ( e ) . defaultView } function Ee ( e ) { var t = Array . prototype . slice . call ( arguments , 1 ) ; return function ( ) { return e . apply ( null , t ) } } function ge ( e , t , n ) { t || ( t = { } ) ; for ( var r in e ) e . hasOwnProperty ( r ) && ( n !== ! 1 || ! t . hasOwnProperty ( r ) ) && ( t [ r ] = e [ r ] ) ; return t } function Oe ( e , t , n , r , i ) { t == null && ( t = e . search ( /[^\s\u00a0]/ ) , t == - 1 && ( t = e . length ) ) ; for ( var a = r || 0 , l = i || 0 ; ; ) { var u = e . indexOf ( " " , a ) ; if ( u < 0 || u >= t ) return l + ( t - a ) ; l += u - a , l += n - l % n , a = u + 1 } } var qe = function ( ) { this . id = null , this . f = null , this . time = 0 , this . handler = Ee ( this . onTimeout , this ) } ; qe . prototype . onTimeout = function ( e ) { e . id = 0 , e . time <= + new Date ? e . f ( ) : setTimeout ( e . handler , e . time - + new Date ) } , qe . prototype . set = function ( e , t ) { this . f = t ; var n = + new Date + e ; ( ! this . id || n < this . time ) && ( clearTimeout ( this . id ) , this . id = setTimeout ( this . handler , e ) , this . time = n ) } ; function Se ( e , t ) { for ( var n = 0 ; n < e . length ; ++ n ) if ( e [ n ] == t ) return n ; return - 1 } var Be = 50 , Ze = { toString : function ( ) { return
2024-12-25 23:09:07 +08:00
b ` .split(/ \n /).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf( `
2025-10-02 14:58:30 +07:00
` ,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)==" \r "?i-1:i),l=a.indexOf(" \r ");l!=-1?(n.push(a.slice(0,l)),t+=l+1):(n.push(a),t=i+1)}return n}:function(e){return e.split(/ \r \n ?| \n /)},hr=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},ti=(function(){var e=y("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(), $ t=null;function to(e){if( $ t!=null)return $ t;var t=V(e,y("span","x")),n=t.getBoundingClientRect(),r=X(t,0,1).getBoundingClientRect();return $ t=Math.abs(n.left-r.left)>1}var Wr={},Kt={};function Gt(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Wr[e]=t}function Cr(e,t){Kt[e]=t}function Ur(e){if(typeof e=="string"&&Kt.hasOwnProperty(e))e=Kt[e];else if(e&&typeof e.name=="string"&&Kt.hasOwnProperty(e.name)){var t=Kt[e.name];typeof t=="string"&&(t={name:t}),e=oe(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[ \w \- ]+ \/ [ \w \- ]+ \+ xml $ /.test(e))return Ur("application/xml");if(typeof e=="string"&&/^[ \w \- ]+ \/ [ \w \- ]+ \+ json $ /.test(e))return Ur("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function $ r(e,t){t=Ur(t);var n=Wr[t.name];if(!n)return $ r(e,"text/plain");var r=n(e,t);if(gr.hasOwnProperty(t.name)){var i=gr[t.name];for(var a in i)i.hasOwnProperty(a)&&(r.hasOwnProperty(a)&&(r["_"+a]=r[a]),r[a]=i[a])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)r[l]=t.modeProps[l];return r}var gr={};function Kr(e,t){var n=gr.hasOwnProperty(e)?gr[e]:gr[e]={};ge(t,n)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function _n(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Gr(e,t,n){return e.startState?e.startState(t,n):!0}var at=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};at.prototype.eol=function(){return this.pos>=this.string.length},at.prototype.sol=function(){return this.pos==this.lineStart},at.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},at.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},at.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},at.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},at.prototype.eatSpace=function(){for(var e=this.pos;/[ \s \u 00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},at.prototype.skipToEnd=function(){this.pos=this.string.length},at.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},at.prototype.backUp=function(e){this.pos-=e},at.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Oe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.indentation=function(){return Oe(this.string,null,this.tabSize)-(this.lineStart?Oe(this.string,this.lineStart,this.tabSize):0)},at.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(l){return n?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},at.prototype.current=function(){return this.string.slice(this.start,this.pos)},at.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},at.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},at
` ? ( ue = A . appendChild ( y ( "span" , ee [ 0 ] == "\r" ? "\u240D" : "\u2424" , "cm-invalidchar" ) ) , ue . setAttribute ( "cm-text" , ee [ 0 ] ) , e . col += 1 ) : ( ue = e . cm . options . specialCharPlaceholder ( ee [ 0 ] ) , ue . setAttribute ( "cm-text" , ee [ 0 ] ) , s && h < 9 ? A . appendChild ( y ( "span" , [ ue ] ) ) : A . appendChild ( ue ) , e . col += 1 ) ; e . map . push ( e . pos , e . pos + 1 , ue ) , e . pos ++ } } if ( e . trailingSpace = u . charCodeAt ( t . length - 1 ) == 32 , n || r || i || m || a || l ) { var _e = n || "" ; r && ( _e += r ) , i && ( _e += i ) ; var be = y ( "span" , [ A ] , _e , a ) ; if ( l ) for ( var Ce in l ) l . hasOwnProperty ( Ce ) && Ce != "style" && Ce != "class" && be . setAttribute ( Ce , l [ Ce ] ) ; return e . content . appendChild ( be ) } e . content . appendChild ( A ) } } function Wc ( e , t ) { if ( e . length > 1 && ! / / . test ( e ) ) return e ; for ( var n = t , r = "" , i = 0 ; i < e . length ; i ++ ) { var a = e . charAt ( i ) ; a == " " && n && ( i == e . length - 1 || e . charCodeAt ( i + 1 ) == 32 ) && ( a = "\xA0" ) , r += a , n = a == " " } return r } function Uc ( e , t ) { return function ( n , r , i , a , l , u , f ) { i = i ? i + " cm-force-border" : "cm-force-border" ; for ( var m = n . pos , A = m + r . length ; ; ) { for ( var B = void 0 , ee = 0 ; ee < t . length && ( B = t [ ee ] , ! ( B . to > m && B . from <= m ) ) ; ee ++ ) ; if ( B . to >= A ) return e ( n , r , i , a , l , u , f ) ; e ( n , r . slice ( 0 , B . to - m ) , i , a , null , u , f ) , a = null , r = r . slice ( B . to - m ) , m = B . to } } } function Ea ( e , t , n , r ) { var i = ! r && n . widgetNode ; i && e . map . push ( e . pos , e . pos + t , i ) , ! r && e . cm . display . input . needsContentAttribute && ( i || ( i = e . content . appendChild ( document . createElement ( "span" ) ) ) , i . setAttribute ( "cm-marker" , n . id ) ) , i && ( e . cm . display . input . setUneditable ( i ) , e . content . appendChild ( i ) ) , e . pos += t , e . trailingSpace = ! 1 } function $c ( e , t , n ) { var r = e . markedSpans , i = e . text , a = 0 ; if ( ! r ) { for ( var l = 1 ; l < n . length ; l += 2 ) t . addToken ( t , i . slice ( a , a = n [ l ] ) , La ( n [ l + 1 ] , t . cm . options ) ) ; return } for ( var u = i . length , f = 0 , m = 1 , A = "" , B , ee , Y = 0 , ie , ue , me , ve , _e ; ; ) { if ( Y == f ) { ie = ue = me = ee = "" , _e = null , ve = null , Y = 1 / 0 ; for ( var be = [ ] , Ce = void 0 , Ne = 0 ; Ne < r . length ; ++ Ne ) { var Fe = r [ Ne ] , $e = Fe . marker ; if ( $e . type == "bookmark" && Fe . from == f && $e . widgetNode ) be . push ( $e ) ; else if ( Fe . from <= f && ( Fe . to == null || Fe . to > f || $e . collapsed && Fe . to == f && Fe . from == f ) ) { if ( Fe . to != null && Fe . to != f && Y > Fe . to && ( Y = Fe . to , ue = "" ) , $e . className && ( ie += " " + $e . className ) , $e . css && ( ee = ( ee ? ee + ";" : "" ) + $e . css ) , $e . startStyle && Fe . from == f && ( me += " " + $e . startStyle ) , $e . endStyle && Fe . to == Y && ( Ce || ( Ce = [ ] ) ) . push ( $e . endStyle , Fe . to ) , $e . title && ( ( _e || ( _e = { } ) ) . title = $e . title ) , $e . attributes ) for ( var Ve in $e . attributes ) ( _e || ( _e = { } ) ) [ Ve ] = $e . attributes [ Ve ] ; $e . collapsed && ( ! ve || oo ( ve . marker , $e ) < 0 ) && ( ve = Fe ) } else Fe . from > f && Y > Fe . from && ( Y = Fe . from ) } if ( Ce ) for ( var vt = 0 ; vt < Ce . length ; vt += 2 ) Ce [ vt + 1 ] == Y && ( ue += " " + Ce [ vt ] ) ; if ( ! ve || ve . from == f ) for ( var rt = 0 ; rt < be . length ; ++ rt ) Ea ( t , 0 , be [ rt ] ) ; if ( ve && ( ve . from || 0 ) == f ) { if ( Ea ( t , ( ve . to == null ? u + 1 : ve . to ) - f , ve . marker , ve . from == null ) , ve . to == null ) return ; ve . to == f && ( ve = ! 1 ) } } if ( f >= u ) break ; for ( var Ot = Math . min ( u , Y ) ; ; ) { if ( A ) { var At = f + A . length ; if ( ! ve ) { var ut = At > Ot ? A . slice ( 0 , Ot - f ) : A ; t . addToken ( t , ut , B ? B + ie : ie , me , f + ut . length == Y ? ue : "" , ee , _e ) } if ( At >= Ot ) { A = A . slice ( Ot - f ) , f = Ot ; break } f = At , me = "" } A = i . slice ( a , a = n [ m ++ ] ) , B = La ( n [ m ++ ] , t . cm . options ) } } } function za ( e , t , n ) { this . line = t , this . rest = Nc ( t ) , this . size = this . rest ? x ( ce ( this . rest ) ) - n + 1 : 1 , this . node = this . text = null , this . hidden = mr ( e , t ) } function si ( e , t , n ) { for ( var r = [ ] , i , a = t ; a < n ; a = i ) { var l = new za ( e . doc , Ae ( e . doc , a ) , a ) ; i = a + l . size , r . push ( l ) } return r } var Yr = null ; function Kc ( e ) { Yr ? Yr . ops . push ( e ) : e . ownsGroup = Yr = { ops : [ e ] , delayedCallbacks : [ ] } } function Gc ( e ) { var t = e . delayedCallbacks , n = 0 ; do { for ( ; n < t . length ; n ++ ) t [ n ] . call ( null ) ; for ( var r = 0 ; r < e . ops . length ; r ++ ) { var i = e . ops [ r ] ; if ( i . cursorActivityHandlers ) for ( ; i . cursorActivityCalled < i . cursorActivityHandlers . length ; ) i . cursorActivityHandlers [ i . cursorActivityCalled ++ ] . call ( null , i . cm ) } } while ( n < t . length ) } function Zc ( e , t ) { var n = e . ownsGroup ; if ( n ) try { Gc ( n ) } finally { Yr = null , t ( n ) } } var Tn = null ; function ht ( e , t ) { var n = nr ( e , t ) ; if ( n . length ) { var r = Array . prototype . slice . call ( arguments , 2 ) , i ; Yr ? i = Yr . delayedCallbacks : Tn ? i = Tn : ( i = Tn = [ ] , setTimeout ( Xc , 0 ) ) ; for ( var a = function ( u ) { i . push ( function ( ) { return n [ u ] . apply ( null , r ) } ) } , l = 0 ; l < n . length ; ++ l ) a ( l ) } } function Xc ( ) { var e = Tn ; Tn = null ; for ( var t = 0 ; t < e . length ; ++ t ) e [ t ] ( ) } function Ma ( e , t , n , r ) { for ( var i = 0 ; i < t . changes . length ; i ++ ) { var a = t . changes [ i ] ; a == "text" ? Qc ( e , t ) : a == "gutter" ? Da ( e , t , n , r ) : a == "class" ? uo ( e , t ) : a == "widget" && Vc ( e , t , r ) } t . changes = null } function Ln ( e ) { return e . node == e . text && ( e . node = y ( "div" , null , null , "p
2024-12-25 23:09:07 +08:00
top: `+Ce+" px ; width : "+(Ne??f-be)+`px;
2025-10-02 14:58:30 +07:00
height: `+(Fe-Ce)+" px "))}function B(be,Ce,Ne){var Fe=Ae(i,be),$e=Fe.text.length,Ve,vt;function rt(ut,Dt){return fi(e,ne(be,ut)," div ",Fe,Dt)}function Ot(ut,Dt,yt){var ft=Ga(e,Fe,null,ut),ct=Dt==" ltr "==(yt==" after ")?" left ":" right ",lt=yt==" after "?ft.begin:ft.end-(/\s/.test(Fe.text.charAt(ft.end-1))?2:1);return rt(lt,ct)[ct]}var At=Pe(Fe,i.direction);return nt(At,Ce||0,Ne??$e,function(ut,Dt,yt,ft){var ct=yt==" ltr ",lt=rt(ut,ct?" left ":" right "),qt=rt(Dt-1,ct?" right ":" left "),pn=Ce==null&&ut==0,Sr=Ne==null&&Dt==$e,St=ft==0,rr=!At||ft==At.length-1;if(qt.top-lt.top<=3){var bt=(m?pn:Sr)&&St,Zo=(m?Sr:pn)&&rr,cr=bt?u:(ct?lt:qt).left,Nr=Zo?f:(ct?qt:lt).right;A(cr,lt.top,Nr-cr,lt.bottom)}else{var Or,Lt,hn,Xo;ct?(Or=m&&pn&&St?u:lt.left,Lt=m?f:Ot(ut,yt," before "),hn=m?u:Ot(Dt,yt," after "),Xo=m&&Sr&&rr?f:qt.right):(Or=m?Ot(ut,yt," before "):u,Lt=!m&&pn&&St?f:lt.right,hn=!m&&Sr&&rr?u:qt.left,Xo=m?Ot(Dt,yt," after "):f),A(Or,lt.top,Lt-Or,lt.bottom),lt.bottom<qt.top&&A(u,lt.bottom,null,qt.top),A(hn,qt.top,Xo-hn,qt.bottom)}(!Ve||pi(lt,Ve)<0)&&(Ve=lt),pi(qt,Ve)<0&&(Ve=qt),(!vt||pi(lt,vt)<0)&&(vt=lt),pi(qt,vt)<0&&(vt=qt)}),{start:Ve,end:vt}}var ee=t.from(),Y=t.to();if(ee.line==Y.line)B(ee.line,ee.ch,Y.ch);else{var ie=Ae(i,ee.line),ue=Ae(i,Y.line),me=Zt(ie)==Zt(ue),ve=B(ee.line,ee.ch,me?ie.text.length+1:null).end,_e=B(Y.line,me?0:null,Y.ch).start;me&&(ve.top<_e.top-2?(A(ve.right,ve.top,null,ve.bottom),A(u,_e.top,_e.left,_e.bottom)):A(ve.right,ve.top,_e.left-ve.right,ve.bottom)),ve.bottom<_e.top&&A(u,ve.bottom,null,_e.top)}n.appendChild(a)}function ko(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility=" ",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||en(e),t.cursorDiv.style.visibility=(n=!n)?" ":" hidden "},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility=" hidden ")}}function Qa(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||So(e))}function wo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&en(e))},100)}function So(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!=" nocursor "&&(e.state.focused||(it(e," focus ",e,t),e.state.focused=!0,le(e.display.wrapper," CodeMirror - focused "),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),g&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e))}function en(e,t){e.state.delayingBlurEvent||(e.state.focused&&(it(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 hi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,l=0;l<t.view.length;l++){var u=t.view[l],f=e.options.lineWrapping,m=void 0,A=0;if(!u.hidden){if(i+=u.line.height,s&&h<8){var B=u.node.offsetTop+u.node.offsetHeight;m=B-n,n=B}else{var ee=u.node.getBoundingClientRect();m=ee.bottom-ee.top,!f&&u.text.firstChild&&(A=u.text.firstChild.getBoundingClientRect().right-ee.left-1)}var Y=u.line.height-m;if((Y>.005||Y<-.005)&&(i<r&&(a-=Y),Bt(u.line,m),Va(u.line),u.rest))for(var ie=0;ie<u.rest.length;ie++)Va(u.rest[ie]);if(A>e.display.sizerWidth){var ue=Math.ceil(A/Jr(e.display));ue>e.display.maxLineLength&&(e.display.maxLineLength=ue,e.display.maxLine=u.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function Va(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function gi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-ui(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,a=P(t,r),l=P(t,i);if(n&&n.ensure){var u=n.ensure.from.line,f=n.ensure.to.line;u<a?(a=u,l=P(t,ar(Ae(t,u))+e.wrapper.clientHeight)):Math.min(f,t.lastLine())>=l&&(a=P(t,ar(Ae(t,f))-e.wrapper.
2024-12-25 23:09:07 +08:00
top: `+(t.top-n.viewOffset-ui(e.display))+`px;
height: `+(t.bottom-t.top+er(e)+n.barHeight)+`px;
2025-10-02 14:58:30 +07:00
left: `+t.left+" px ; width : "+Math.max(2,t.right-t.left)+" px ; ");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function pf(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky==" before "?ne(t.line,t.ch+1," before "):t,t=t.ch?ne(t.line,t.sticky==" before "?t.ch-1:t.ch," after "):t);for(var a=0;a<5;a++){var l=!1,u=Xt(e,t),f=!n||n==t?u:Xt(e,n);i={left:Math.min(u.left,f.left),top:Math.min(u.top,f.top)-r,right:Math.max(u.left,f.left),bottom:Math.max(u.bottom,f.bottom)+r};var m=To(e,i),A=e.doc.scrollTop,B=e.doc.scrollLeft;if(m.scrollTop!=null&&(An(e,m.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(l=!0)),m.scrollLeft!=null&&(Dr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-B)>1&&(l=!0)),!l)break}return i}function hf(e,t){var n=To(e,t);n.scrollTop!=null&&An(e,n.scrollTop),n.scrollLeft!=null&&Dr(e,n.scrollLeft)}function To(e,t){var n=e.display,r=Vr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,a=fo(e),l={};t.bottom-t.top>a&&(t.bottom=t.top+a);var u=e.doc.height+co(n),f=t.top<r,m=t.bottom>u-r;if(t.top<i)l.scrollTop=f?0:t.top;else if(t.bottom>i+a){var A=Math.min(t.top,(m?u:t.bottom)-a);A!=i&&(l.scrollTop=A)}var B=e.options.fixedGutter?0:n.gutters.offsetWidth,ee=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-B,Y=Er(e)-n.gutters.offsetWidth,ie=t.right-t.left>Y;return ie&&(t.right=t.left+Y),t.left<10?l.scrollLeft=0:t.left<ee?l.scrollLeft=Math.max(0,t.left+B-(ie?0:10)):t.right>Y+ee-3&&(l.scrollLeft=t.right+(ie?0:10)-Y),l}function Lo(e,t){t!=null&&(mi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function tn(e){mi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Mn(e,t,n){(t!=null||n!=null)&&mi(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function gf(e,t){mi(e),e.curOp.scrollToPos=t}function mi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=$a(e,t.from),r=$a(e,t.to);Ja(e,n,r,t.margin)}}function Ja(e,t,n,r){var i=To(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Mn(e,i.scrollLeft,i.scrollTop)}function An(e,t){Math.abs(e.doc.scrollTop-t)<2||(v||Eo(e,{top:t}),el(e,t,!0),v&&Eo(e),Fn(e,100))}function el(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Dr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,ol(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Dn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+co(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?n:0,docHeight:r,scrollHeight:r+er(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var qr=function(e,t,n){this.cm=n;var r=this.vert=y(" div ",[y(" div ",null,null," min - width : 1 px ")]," CodeMirror - vscrollbar "),i=this.horiz=y(" div ",[y(" div ",null,null," height : 100 % ; min - height : 1 px ")]," CodeMirror - hscrollbar ");r.tabIndex=i.tabIndex=-1,e(r),e(i),Ie(r," scroll ",function(){r.clientHeight&&t(r.scrollTop," vertical ")}),Ie(i," scroll ",function(){i.clientWidth&&t(i.scrollLeft," horizontal ")}),this.checkedZeroWidth=!1,s&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth=" 18 px ")};qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display=" block ",this.vert.style.bottom=t?r+" px ":" 0 ";var i=e.viewHeight-(t?r:0);this.vert.firstChil
`},setDirection:mt(function(e){e!=" rtl "&&(e=" ltr "),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Af(this.cm))})}),Mt.prototype.eachLine=Mt.prototype.iter;var Nl=0;function Uf(e){var t=this;if(Ol(t),!(ot(t,e)||lr(t.display,e))){kt(e),s&&(Nl=+new Date);var n=Mr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,a=Array(i),l=0,u=function(){++l==i&>(t,function(){n=je(t.doc,n);var Y={from:n,to:n,text:t.doc.splitLines(a.filter(function(ie){return ie!=null}).join(t.doc.lineSeparator())),origin:" paste "};an(t.doc,Y),_l(t.doc,yr(je(t.doc,n),je(t.doc,xr(Y))))})()},f=function(Y,ie){if(t.options.allowDropFileTypes&&Se(t.options.allowDropFileTypes,Y.type)==-1){u();return}var ue=new FileReader;ue.onerror=function(){return u()},ue.onload=function(){var me=ue.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(me)){u();return}a[ie]=me,u()},ue.readAsText(Y)},m=0;m<r.length;m++)f(r[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData(" Text ");if(A){var B;if(t.state.draggingText&&!t.state.draggingText.copy&&(B=t.listSelections()),ki(t.doc,yr(n,n)),B)for(var ee=0;ee<B.length;++ee)ln(t.doc," ",B[ee].anchor,B[ee].head," drag ");t.replaceSelection(A," around "," paste "),t.display.input.focus()}}catch{}}}}function $f(e,t){if(s&&(!e.state.draggingText||+new Date-Nl<100)){dr(t);return}if(!(ot(e,t)||lr(e.display,t))&&(t.dataTransfer.setData(" Text ",e.getSelection()),t.dataTransfer.effectAllowed=" copyMove ",t.dataTransfer.setDragImage&&!k)){var n=y(" img ",null,null," position : fixed ; left : 0 ; top : 0 ; ");n.src=" data : image / gif ; base64 , R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw == ",d&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n)}}function Kf(e,t){var n=Mr(e,t);if(n){var r=document.createDocumentFragment();_o(e,n,r),e.display.dragCursor||(e.display.dragCursor=y(" div ",null," CodeMirror - cursors CodeMirror - dragcursors "),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),V(e.display.dragCursor,r)}}function Ol(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Pl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName(" CodeMirror "),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var a=0;a<n.length;a++)e(n[a])})}}var Bl=!1;function Gf(){Bl||(Zf(),Bl=!0)}function Zf(){var e;Ie(window," resize ",function(){e==null&&(e=setTimeout(function(){e=null,Pl(Xf)},100))}),Ie(window," blur ",function(){return Pl(en)})}function Xf(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var wr={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"},Wn=0;Wn<10;Wn++)wr[Wn+48]=wr[Wn+96]=String(Wn);for(var Ti=65;Ti<=90;Ti++)wr[Ti]=String.fromCharCode(Ti);for(var Un=1;Un<=12;Un++)wr[Un+111]=wr[Un+63235]="F"+Un;var ur={};ur.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"},ur.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"delete
` , "start" ) } , toggleOverwrite : function ( e ) { return e . toggleOverwrite ( ) } } ; function Wl ( e , t ) { var n = Ae ( e . doc , t ) , r = Zt ( n ) ; return r != n && ( t = x ( r ) ) , jo ( ! 0 , e , r , t , 1 ) } function Jf ( e , t ) { var n = Ae ( e . doc , t ) , r = Ic ( n ) ; return r != n && ( t = x ( r ) ) , jo ( ! 0 , e , n , t , - 1 ) } function Ul ( e , t ) { var n = Wl ( e , t . line ) , r = Ae ( e . doc , n . line ) , i = Pe ( r , e . doc . direction ) ; if ( ! i || i [ 0 ] . level == 0 ) { var a = Math . max ( n . ch , r . text . search ( /\S/ ) ) , l = t . line == n . line && t . ch <= a && t . ch ; return ne ( n . line , l ? 0 : a , n . sticky ) } return n } function Ci ( e , t , n ) { if ( typeof t == "string" && ( t = $n [ t ] , ! t ) ) return ! 1 ; e . display . input . ensurePolled ( ) ; var r = e . display . shift , i = ! 1 ; try { e . isReadOnly ( ) && ( e . state . suppressEdits = ! 0 ) , n && ( e . display . shift = ! 1 ) , i = t ( e ) != Ze } finally { e . display . shift = r , e . state . suppressEdits = ! 1 } return i } function ed ( e , t , n ) { for ( var r = 0 ; r < e . state . keyMaps . length ; r ++ ) { var i = un ( t , e . state . keyMaps [ r ] , n , e ) ; if ( i ) return i } return e . options . extraKeys && un ( t , e . options . extraKeys , n , e ) || un ( t , e . options . keyMap , n , e ) } var td = new qe ; function Kn ( e , t , n , r ) { var i = e . state . keySeq ; if ( i ) { if ( jl ( t ) ) return "handled" ; if ( /\'$/ . test ( t ) ? e . state . keySeq = null : td . set ( 50 , function ( ) { e . state . keySeq == i && ( e . state . keySeq = null , e . display . input . reset ( ) ) } ) , $l ( e , i + " " + t , n , r ) ) return ! 0 } return $l ( e , t , n , r ) } function $l ( e , t , n , r ) { var i = ed ( e , t , r ) ; return i == "multi" && ( e . state . keySeq = t ) , i == "handled" && ht ( e , "keyHandled" , e , t , n ) , ( i == "handled" || i == "multi" ) && ( kt ( n ) , ko ( e ) ) , ! ! i } function Kl ( e , t ) { var n = Hl ( t , ! 0 ) ; return n ? t . shiftKey && ! e . state . keySeq ? Kn ( e , "Shift-" + n , t , function ( r ) { return Ci ( e , r , ! 0 ) } ) || Kn ( e , n , t , function ( r ) { if ( typeof r == "string" ? /^go[A-Z]/ . test ( r ) : r . motion ) return Ci ( e , r ) } ) : Kn ( e , n , t , function ( r ) { return Ci ( e , r ) } ) : ! 1 } function rd ( e , t , n ) { return Kn ( e , "'" + n + "'" , t , function ( r ) { return Ci ( e , r , ! 0 ) } ) } var Ro = null ; function Gl ( e ) { var t = this ; if ( ! ( e . target && e . target != t . display . input . getField ( ) ) && ( t . curOp . focus = R ( de ( t ) ) , ! ot ( t , e ) ) ) { s && h < 11 && e . keyCode == 27 && ( e . returnValue = ! 1 ) ; var n = e . keyCode ; t . display . shift = n == 16 || e . shiftKey ; var r = Kl ( t , e ) ; d && ( Ro = r ? n : null , ! r && n == 88 && ! ti && ( O ? e . metaKey : e . ctrlKey ) && t . replaceSelection ( "" , null , "cut" ) ) , v && ! O && ! r && n == 46 && e . shiftKey && ! e . ctrlKey && document . execCommand && document . execCommand ( "cut" ) , n == 18 && ! /\bCodeMirror-crosshair\b/ . test ( t . display . lineDiv . className ) && nd ( t ) } } function nd ( e ) { var t = e . display . lineDiv ; le ( t , "CodeMirror-crosshair" ) ; function n ( r ) { ( r . keyCode == 18 || ! r . altKey ) && ( Q ( t , "CodeMirror-crosshair" ) , _t ( document , "keyup" , n ) , _t ( document , "mouseover" , n ) ) } Ie ( document , "keyup" , n ) , Ie ( document , "mouseover" , n ) } function Zl ( e ) { e . keyCode == 16 && ( this . doc . sel . shift = ! 1 ) , ot ( this , e ) } function Xl ( e ) { var t = this ; if ( ! ( e . target && e . target != t . display . input . getField ( ) ) && ! ( lr ( t . display , e ) || ot ( t , e ) || e . ctrlKey && ! e . altKey || O && e . metaKey ) ) { var n = e . keyCode , r = e . charCode ; if ( d && n == Ro ) { Ro = null , kt ( e ) ; return } if ( ! ( d && ( ! e . which || e . which < 10 ) && Kl ( t , e ) ) ) { var i = String . fromCharCode ( r ? ? n ) ; i != "\b" && ( rd ( t , e , i ) || t . display . input . onKeyPress ( e ) ) } } } var id = 400 , Ho = function ( e , t , n ) { this . time = e , this . pos = t , this . button = n } ; Ho . prototype . compare = function ( e , t , n ) { return this . time + id > e && ye ( t , this . pos ) == 0 && n == this . button } ; var Gn , Zn ; function od ( e , t ) { var n = + new Date ; return Zn && Zn . compare ( n , e , t ) ? ( Gn = Zn = null , "triple" ) : Gn && Gn . compare ( n , e , t ) ? ( Zn = new Ho ( n , e , t ) , Gn = null , "double" ) : ( Gn = new Ho ( n , e , t ) , Zn = null , "single" ) } function Yl ( e ) { var t = this , n = t . display ; if ( ! ( ot ( t , e ) || n . activeTouch && n . input . supportsTouch ( ) ) ) { if ( n . input . ensurePolled ( ) , n . shift = e . shiftKey , lr ( n , e ) ) { g || ( n . scroller . draggable = ! 1 , setTimeout ( function ( ) { return n . scroller . draggable = ! 0 } , 100 ) ) ; return } if ( ! Wo ( t , e ) ) { var r = Mr ( t , e ) , i = Ut ( e ) , a = r ? od ( r , i ) : "single" ; pe ( t ) . focus ( ) , i == 1 && t . state . selectingText && t . state . selectingText ( e ) , ! ( r && ad ( t , i , r , a , e ) ) && ( i == 1 ? r ? sd ( t , r , a , e ) : yn ( e ) == n . scroller && kt ( e ) : i == 2 ? ( r && _i ( t . doc , r ) , setTimeout ( function ( ) { return n . input . focus ( ) } , 20 ) ) : i == 3 && ( I ? t . display . input . onContextMenu ( e ) : wo ( t ) ) ) } } } function ad ( e , t , n , r , i ) { var a = "Click" ; return r == "double" ? a = "Double" + a : r == "triple" && ( a = "Triple" + a ) , a = ( t == 1 ? "Left" : t == 2 ? "Middle" : "Right" ) + a , Kn ( e , Rl ( a , i ) , i , function ( l ) { if ( typeof l == "string" && ( l = $n [ l ] ) , ! l ) return ! 1 ; var u = ! 1 ; try { e . isReadOnly ( ) && ( e . state . suppressEdits = ! 0 ) , u = l ( e , n ) != Ze } finally { e . state . suppressEdits = ! 1 } return u } ) } function ld ( e , t , n ) { var r = e . getOption ( "configureMouse" ) , i = r ? r ( e , t , n ) : { } ; if ( i . unit ==
2025-09-21 18:07:30 +08:00
` )==t){if(r.ranges.length%Qt.text.length==0){m=[];for(var A=0;A<Qt.text.length;A++)m.push(a.splitLines(Qt.text[A]))}}else f.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(m=He(f,function(ve){return[ve]}));for(var B=e.curOp.updateInput,ee=r.ranges.length-1;ee>=0;ee--){var Y=r.ranges[ee],ie=Y.from(),ue=Y.to();Y.empty()&&(n&&n>0?ie=ne(ie.line,ie.ch-n):e.state.overwrite&&!u?ue=ne(ue.line,Math.min(Ae(a,ue.line).text.length,ue.ch+ce(f).length)):u&&Qt&&Qt.lineWise&&Qt.text.join( `
2024-12-25 23:09:07 +08:00
` )==f.join( `
2025-10-02 14:58:30 +07:00
` )&&(ie=ue=ne(ie.line,0)));var me={from:ie,to:ue,text:m?m[ee%m.length]:f,origin:i||(u?"paste":e.state.cutIncoming>l?"cut":"+input")};an(e.doc,me),ht(e,"inputRead",e,me)}t&&!u&&ns(e,t),tn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=B),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function rs(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Nt(t,function(){return $ o(t,n,0,null,"paste")}),!0}function ns(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var a=e.getModeAt(i.head),l=!1;if(a.electricChars){for(var u=0;u<a.electricChars.length;u++)if(t.indexOf(a.electricChars.charAt(u))>-1){l=Xn(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Xn(e,i.head.line,"smart"));l&&ht(e,"electricInput",e,i.head.line)}}}function is(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,a={anchor:ne(i,0),head:ne(i+1,0)};n.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:n}}function Ko(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function os(){var e=y("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=y("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return g?e.style.width="1000px":e.setAttribute("wrap","off"),_&&(e.style.border="1px solid black"),t}function vd(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){pe(this).focus(),this.display.input.focus()},setOption:function(r,i){var a=this.options,l=a[r];a[r]==i&&r!="mode"||(a[r]=i,t.hasOwnProperty(r)&>(this,t[r])(this,i,l),it(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Li(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==r||i[a].name==r)return i.splice(a,1),!0},addOverlay:Tt(function(r,i){var a=r.token?r:e.getMode(this.options,r);if(a.startState)throw new Error("Overlays may not be stateful.");te(this.state.overlays,{mode:a,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,zt(this)}),removeOverlay:Tt(function(r){for(var i=this.state.overlays,a=0;a<i.length;++a){var l=i[a].modeSpec;if(l==r||typeof r=="string"&&l.name==r){i.splice(a,1),this.state.modeGen++,zt(this);return}}}),indentLine:Tt(function(r,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),ae(this.doc,r)&&Xn(this,r,i,a)}),indentSelection:Tt(function(r){for(var i=this.doc.sel.ranges,a=-1,l=0;l<i.length;l++){var u=i[l];if(u.empty())u.head.line>a&&(Xn(this,u.head.line,r,!0),a=u.head.line,l==this.doc.sel.primIndex&&tn(this));else{var f=u.from(),m=u.to(),A=Math.max(a,f.line);a=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var B=A;B<a;++B)Xn(this,B,r);var ee=this.doc.sel.ranges;f.ch==0&&i.length==ee.length&&ee[l].from().ch>0&&Oo(this.doc,l,new Ye(f,ee[l].to()),ke)}}}),getTokenAt:function(r,i){return ga(this,r,i)},getLineTokens:function(r,i){return ga(this,ne(r),i,!0)},getTokenTypeAt:function(r){r=je(this.doc,r);var i=da(this,Ae(this.doc,r.line)),a=0,l=(i.length-1)/2,u=r.ch,f;if(u==0)f=i[2];else for(;;){var m=a+l>>1;if((m?i[m*2-1]:0)>=u)l=m;else if(i[m*2+1]<u)a=m+1;else{f=i[m*2+2];break}}var A=f?f.indexOf("overlay "):-1;return A<0?f:A==0?null:f.slice(0,A-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var a=[];if(!n.hasOwnProperty(i))return a;var l=n[i],u=this.getModeAt(r);if(typeof u[i]=="strin
2025-05-03 02:07:59 +07:00
` , me = Me ( ue , Y ) ? "w" : ee && ue == `
2025-10-02 14:58:30 +07:00
` ? "n" : ! ee || /\s/ . test ( ue ) ? null : "p" ; if ( ee && ! ie && ! me && ( me = "s" ) , B && B != me ) { n < 0 && ( n = 1 , A ( ) , t . sticky = "after" ) ; break } if ( me && ( B = me ) , n > 0 && ! A ( ! ie ) ) break } var ve = wi ( e , t , a , l , ! 0 ) ; return Xe ( a , ve ) && ( ve . hitSide = ! 0 ) , ve } function as ( e , t , n , r ) { var i = e . doc , a = t . left , l ; if ( r == "page" ) { var u = Math . min ( e . display . wrapper . clientHeight , pe ( e ) . innerHeight || i ( e ) . documentElement . clientHeight ) , f = Math . max ( u - . 5 * Vr ( e . display ) , 3 ) ; l = ( n > 0 ? t . bottom : t . top ) + n * f } else r == "line" && ( l = n > 0 ? t . bottom + 3 : t . top - 3 ) ; for ( var m ; m = mo ( e , a , l ) , ! ! m . outside ; ) { if ( n < 0 ? l <= 0 : l >= i . height ) { m . hitSide = ! 0 ; break } l += n * 5 } return m } var Qe = function ( e ) { this . cm = e , this . lastAnchorNode = this . lastAnchorOffset = this . lastFocusNode = this . lastFocusOffset = null , this . polling = new qe , this . composing = null , this . gracePeriod = ! 1 , this . readDOMTimeout = null } ; Qe . prototype . init = function ( e ) { var t = this , n = this , r = n . cm , i = n . div = e . lineDiv ; i . contentEditable = ! 0 , Ko ( i , r . options . spellcheck , r . options . autocorrect , r . options . autocapitalize ) ; function a ( u ) { for ( var f = u . target ; f ; f = f . parentNode ) { if ( f == i ) return ! 0 ; if ( /\bCodeMirror-(?:line)?widget\b/ . test ( f . className ) ) break } return ! 1 } Ie ( i , "paste" , function ( u ) { ! a ( u ) || ot ( r , u ) || rs ( u , r ) || h <= 11 && setTimeout ( gt ( r , function ( ) { return t . updateFromDOM ( ) } ) , 20 ) } ) , Ie ( i , "compositionstart" , function ( u ) { t . composing = { data : u . data , done : ! 1 } } ) , Ie ( i , "compositionupdate" , function ( u ) { t . composing || ( t . composing = { data : u . data , done : ! 1 } ) } ) , Ie ( i , "compositionend" , function ( u ) { t . composing && ( u . data != t . composing . data && t . readFromDOMSoon ( ) , t . composing . done = ! 0 ) } ) , Ie ( i , "touchstart" , function ( ) { return n . forceCompositionEnd ( ) } ) , Ie ( i , "input" , function ( ) { t . composing || t . readFromDOMSoon ( ) } ) ; function l ( u ) { if ( ! ( ! a ( u ) || ot ( r , u ) ) ) { if ( r . somethingSelected ( ) ) zi ( { lineWise : ! 1 , text : r . getSelections ( ) } ) , u . type == "cut" && r . replaceSelection ( "" , null , "cut" ) ; else if ( r . options . lineWiseCopyCut ) { var f = is ( r ) ; zi ( { lineWise : ! 0 , text : f . text } ) , u . type == "cut" && r . operation ( function ( ) { r . setSelections ( f . ranges , 0 , ke ) , r . replaceSelection ( "" , null , "cut" ) } ) } else return ; if ( u . clipboardData ) { u . clipboardData . clearData ( ) ; var m = Qt . text . join ( `
2025-09-21 18:07:30 +08:00
` ) ; if ( u . clipboardData . setData ( "Text" , m ) , u . clipboardData . getData ( "Text" ) == m ) { u . preventDefault ( ) ; return } } var A = os ( ) , B = A . firstChild ; Ko ( B ) , r . display . lineSpace . insertBefore ( A , r . display . lineSpace . firstChild ) , B . value = Qt . text . join ( `
2025-10-02 14:58:30 +07:00
` ) ; var ee = R ( ze ( i ) ) ; F ( B ) , setTimeout ( function ( ) { r . display . lineSpace . removeChild ( A ) , ee . focus ( ) , ee == i && n . showPrimarySelection ( ) } , 50 ) } } Ie ( i , "copy" , l ) , Ie ( i , "cut" , l ) } , Qe . prototype . screenReaderLabelChanged = function ( e ) { e ? this . div . setAttribute ( "aria-label" , e ) : this . div . removeAttribute ( "aria-label" ) } , Qe . prototype . prepareSelection = function ( ) { var e = Ya ( this . cm , ! 1 ) ; return e . focus = R ( ze ( this . div ) ) == this . div , e } , Qe . prototype . showSelection = function ( e , t ) { ! e || ! this . cm . display . view . length || ( ( e . focus || t ) && this . showPrimarySelection ( ) , this . showMultipleSelections ( e ) ) } , Qe . prototype . getSelection = function ( ) { return this . cm . display . wrapper . ownerDocument . getSelection ( ) } , Qe . prototype . showPrimarySelection = function ( ) { var e = this . getSelection ( ) , t = this . cm , n = t . doc . sel . primary ( ) , r = n . from ( ) , i = n . to ( ) ; if ( t . display . viewTo == t . display . viewFrom || r . line >= t . display . viewTo || i . line < t . display . viewFrom ) { e . removeAllRanges ( ) ; return } var a = Mi ( t , e . anchorNode , e . anchorOffset ) , l = Mi ( t , e . focusNode , e . focusOffset ) ; if ( ! ( a && ! a . bad && l && ! l . bad && ye ( Zr ( a , l ) , r ) == 0 && ye ( Et ( a , l ) , i ) == 0 ) ) { var u = t . display . view , f = r . line >= t . display . viewFrom && ls ( t , r ) || { node : u [ 0 ] . measure . map [ 2 ] , offset : 0 } , m = i . line < t . display . viewTo && ls ( t , i ) ; if ( ! m ) { var A = u [ u . length - 1 ] . measure , B = A . maps ? A . maps [ A . maps . length - 1 ] : A . map ; m = { node : B [ B . length - 1 ] , offset : B [ B . length - 2 ] - B [ B . length - 3 ] } } if ( ! f || ! m ) { e . removeAllRanges ( ) ; return } var ee = e . rangeCount && e . getRangeAt ( 0 ) , Y ; try { Y = X ( f . node , f . offset , m . offset , m . node ) } catch { } Y && ( ! v && t . state . focused ? ( e . collapse ( f . node , f . offset ) , Y . collapsed || ( e . removeAllRanges ( ) , e . addRange ( Y ) ) ) : ( e . removeAllRanges ( ) , e . addRange ( Y ) ) , ee && e . anchorNode == null ? e . addRange ( ee ) : v && this . startGracePeriod ( ) ) , this . rememberSelection ( ) } } , Qe . 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 ) } , Qe . prototype . showMultipleSelections = function ( e ) { V ( this . cm . display . cursorDiv , e . cursors ) , V ( this . cm . display . selectionDiv , e . selection ) } , Qe . prototype . rememberSelection = function ( ) { var e = this . getSelection ( ) ; this . lastAnchorNode = e . anchorNode , this . lastAnchorOffset = e . anchorOffset , this . lastFocusNode = e . focusNode , this . lastFocusOffset = e . focusOffset } , Qe . prototype . selectionInEditor = function ( ) { var e = this . getSelection ( ) ; if ( ! e . rangeCount ) return ! 1 ; var t = e . getRangeAt ( 0 ) . commonAncestorContainer ; return N ( this . div , t ) } , Qe . prototype . focus = function ( ) { this . cm . options . readOnly != "nocursor" && ( ( ! this . selectionInEditor ( ) || R ( ze ( this . div ) ) != this . div ) && this . showSelection ( this . prepareSelection ( ) , ! 0 ) , this . div . focus ( ) ) } , Qe . prototype . blur = function ( ) { this . div . blur ( ) } , Qe . prototype . getField = function ( ) { return this . div } , Qe . prototype . supportsTouch = function ( ) { return ! 0 } , Qe . prototype . receivedFocus = function ( ) { var e = this , t = this ; this . selectionInEditor ( ) ? setTimeout ( function ( ) { return e . pollSelection ( ) } , 20 ) : Nt ( this . cm , function ( ) { return t . cm . curOp . selectionChanged = ! 0 } ) ; function n ( ) { t . cm . state . focused && ( t . pollSelection ( ) , t . polling . set ( t . cm . options . pollInterval , n ) ) } this . polling . set ( this . cm . options . pollInterval , n ) } , Qe . prototype . selectionChanged = function ( ) { var e = this . getSelection ( ) ; return e . anchorNode != this . lastAnchorNode || e . anchorOffset != this . lastAnchorOffset || e . focusNode != this . lastFocusNode || e . focusOffset != this . lastFocusOffset } , Qe . prototype . pollSelection = function ( ) { if ( ! ( this . readDOMTimeout != null || this . gracePeriod || ! this . selectionChanged ( ) ) ) { var e = this . getSelection ( ) , t = this . cm ; if ( W && w && this . cm . display . gutterSpecs . length && bd ( e . anchorNode ) ) { this . cm . triggerOnKeyDown ( { type : "keydown" , keyCode : 8 , preventDefault : Math . abs } ) , this . blur ( ) , this . focus ( ) ; return } if ( ! this . composing ) { this . rememberSelection ( ) ; var n = Mi ( t , e . anchorNode , e . anchorOffset ) , r = Mi ( t , e . focusNode , e . focusOffset ) ; n && r && Nt ( t , function ( ) { wt ( t . doc , yr ( n , r ) , ke ) , ( n . bad || r . bad ) && ( t . curOp . selectionChanged = ! 0 ) } ) } } } , Qe . prototype . pollContent = function ( ) { this . readDOMTimeout != null && ( clearTimeout ( this . readDOMTimeout ) , this . readDOMTimeout = null ) ; var e = this . cm , t = e . display , n = e . doc . sel . primary ( ) , r = n . from ( ) , i = n . to ( ) ; if ( r . ch == 0 && r . line > e . firstLine ( ) && ( r = ne ( r . line - 1 , Ae ( e . doc , r . line - 1 ) . length ) ) , i . ch == Ae ( e . doc , i .
` ),F(i))}else return;l.type=="cut"&&(r.state.cutIncoming=+new Date)}}Ie(i,"cut",a),Ie(i,"copy",a),Ie(e.scroller,"paste",function(l){if(!(lr(e,l)||ot(r,l))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var u=new Event("paste");u.clipboardData=l.clipboardData,i.dispatchEvent(u)}}),Ie(e.lineSpace,"selectstart",function(l){lr(e,l)||kt(l)}),Ie(i,"compositionstart",function(){var l=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:l,range:r.markText(l,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},st.prototype.createField=function(e){this.wrapper=os(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;Ko(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},st.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},st.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Ya(e);if(e.options.moveInputWithCursor){var i=Xt(e,n.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-a.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-a.left))}return r},st.prototype.showSelection=function(e){var t=this.cm,n=t.display;V(n.cursorDiv,e.cursors),V(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},st.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&F(this.textarea),s&&h>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",s&&h>=9&&(this.hasSelection=null));this.resetting=!1}},st.prototype.getField=function(){return this.textarea},st.prototype.supportsTouch=function(){return!1},st.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!E||R(ze(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},st.prototype.blur=function(){this.textarea.blur()},st.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},st.prototype.receivedFocus=function(){this.slowPoll()},st.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},st.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},st.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||hr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(s&&h>=9&&this.hasSelection===i||O&&/[ \u f700- \u f7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!r&&(r=" \u 200B"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,u=Math.min(r.length,i.length);l<u&&r.charCodeAt(l)==i.charCodeAt(l);)++l;return Nt(t,function(){ $ o(t,i.slice(l),r.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf( `
2024-12-25 23:09:07 +08:00
` )>-1?n.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},st.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},st.prototype.onKeyPress=function(){s&&h>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=Mr(n,e),l=r.scroller.scrollTop;if(!a||d)return;var u=n.options.resetSelectionOnContextMenu;u&&n.doc.sel.contains(a)==-1&>(n,wt)(n.doc,yr(a),ke);var f=i.style.cssText,m=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText= ` position : absolute ; width : 30 px ; height : 30 px ;
top : ` +(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+ ` px ;
z - index : 1000 ; background : ` +(s?"rgba(255, 255, 255, .05)":"transparent")+ ` ;
2025-10-02 14:58:30 +07:00
outline : none ; border - width : 0 ; outline : none ; overflow : hidden ; opacity : . 05 ; filter : alpha ( opacity = 5 ) ; ` ;var B;g&&(B=i.ownerDocument.defaultView.scrollY),r.input.focus(),g&&i.ownerDocument.defaultView.scrollTo(null,B),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=Y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function ee(){if(i.selectionStart!=null){var ue=n.somethingSelected(),me=" \u 200B"+(ue?i.value:"");i.value=" \u 21DA",i.value=me,t.prevInput=ue?"":" \u 200B",i.selectionStart=1,i.selectionEnd=me.length,r.selForContextMenu=n.doc.sel}}function Y(){if(t.contextMenuPending==Y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=f,s&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),i.selectionStart!=null)){(!s||s&&h<9)&&ee();var ue=0,me=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput==" \u 200B"?gt(n,Ll)(n):ue++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(s&&h>=9&&ee(),I){dr(e);var ie=function(){_t(window,"mouseup",ie),setTimeout(Y,20)};Ie(window,"mouseup",ie)}else setTimeout(Y,50)},st.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},st.prototype.setUneditable=function(){},st.prototype.needsContentAttribute=!1;function _d(e,t){if(t=t?ge(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 n=R(ze(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=u.getValue()}var i;if(e.form&&(Ie(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){r(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(f){f.save=r,f.getTextArea=function(){return e},f.toTextArea=function(){f.toTextArea=isNaN,r(),e.parentNode.removeChild(f.getWrapperElement()),e.style.display="",e.form&&(_t(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var u=tt(function(f){return e.parentNode.insertBefore(f,e.nextSibling)},t);return u}function kd(e){e.off=_t,e.on=Ie,e.wheelEventPixels=zf,e.Doc=Mt,e.splitLines=Ht,e.countColumn=Oe,e.findColumn=Ge,e.isWordChar=we,e.Pass=Ze,e.signal=it,e.Line=Xr,e.changeEnd=xr,e.scrollbarModel=rl,e.Pos=ne,e.cmpPos=ye,e.modes=Wr,e.mimeModes=Kt,e.resolveMode=Ur,e.getMode= $ r,e.modeExtensions=gr,e.extendMode=Kr,e.copyState=Vt,e.startState=Gr,e.innerMode=_n,e.commands= $ n,e.keyMap=ur,e.keyName=Hl,e.isModifierKey=jl,e.lookupKey=un,e.normalizeKeyMap=Qf,e.StringStream=at,e.SharedTextMarker=Hn,e.TextMarker=kr,e.LineWidget=Rn,e.e_preventDefault=kt,e.e_stopPropagation=Rr,e.e_stop=dr,e.addClass=le,e.contains=N,e.rmClass=Q,e.keyNames=wr}pd(tt),vd(tt);var wd="iter insert remove copy getEditor constructor".split(" ");for(var Ai in Mt.prototype)Mt.prototype.hasOwnProperty(Ai)&&Se(wd,Ai)<0&&(tt.prototype[Ai]=(function(e){return function(){return e.apply(this.doc,arguments)}})(Mt.prototype[Ai]));return Wt(Mt),tt.inputStyles={textarea:st,contenteditable:Qe},tt.defineMode=function(e){!tt.defaults.mode&&e!="null"&&(tt.defaults.mode=e),Gt.apply(this,arguments)},tt.defineMIME=Cr,tt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),tt.defineMIME("text/plain","null"),tt.defineExtension=function(e,t){tt.prototype[e]=t},tt.defineDocExtension=function(e,t){Mt.prototype[e]=t},tt.fromTextArea=_d,kd(tt),tt.version="5.65.20",tt}))});var Yn=Ke((us,cs)=>{(function(o){typeof us=="object"&&typeof cs=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(p,v,C){return{startState:function(){return{base:o.startState(p),overlay:o.startState(v),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(b){return{base:o.copyState(p,b.base),overlay:o.copyState(v,b.overlay)
` } else { var O = M [ 1 ] , G = M [ 5 ] , J = ! ( C . test ( M [ 2 ] ) || M [ 2 ] . indexOf ( ">" ) >= 0 ) , re = J ? parseInt ( M [ 3 ] , 10 ) + 1 + M [ 4 ] : M [ 2 ] . replace ( "x" , " " ) ; h [ g ] = `
` + O + re + G , J && b ( S , T ) } } S . replaceSelections ( h ) } ; function b ( S , s ) { var h = s . line , g = 0 , T = 0 , w = p . exec ( S . getLine ( h ) ) , c = w [ 1 ] ; do { g += 1 ; var d = h + g , k = S . getLine ( d ) , z = p . exec ( k ) ; if ( z ) { var M = z [ 1 ] , _ = parseInt ( w [ 3 ] , 10 ) + g - T , W = parseInt ( z [ 3 ] , 10 ) , E = W ; if ( c === M && ! isNaN ( W ) ) _ === W && ( E = W + 1 ) , _ > W && ( E = _ + 1 ) , S . replaceRange ( k . replace ( p , M + E + z [ 4 ] + z [ 5 ] ) , { line : d , ch : 0 } , { line : d , ch : k . length } ) ; else { if ( c . length > M . length || c . length < M . length && g === 1 ) return ; T += 1 } } } while ( z ) } } ) } ) ; var ms = Ke ( ( hs , gs ) => { ( function ( o ) { typeof hs == "object" && typeof gs == "object" ? o ( We ( ) ) : typeof define == "function" && define . amd ? define ( [ "../../lib/codemirror" ] , o ) : o ( CodeMirror ) } ) ( function ( o ) { o . defineOption ( "placeholder" , "" , function ( h , g , T ) { var w = T && T != o . Init ; if ( g && ! w ) h . on ( "blur" , b ) , h . on ( "change" , S ) , h . on ( "swapDoc" , S ) , o . on ( h . getInputField ( ) , "compositionupdate" , h . state . placeholderCompose = function ( ) { C ( h ) } ) , S ( h ) ; else if ( ! g && w ) { h . off ( "blur" , b ) , h . off ( "change" , S ) , h . off ( "swapDoc" , S ) , o . off ( h . getInputField ( ) , "compositionupdate" , h . state . placeholderCompose ) , p ( h ) ; var c = h . getWrapperElement ( ) ; c . className = c . className . replace ( " CodeMirror-empty" , "" ) } g && ! h . hasFocus ( ) && b ( h ) } ) ; function p ( h ) { h . state . placeholder && ( h . state . placeholder . parentNode . removeChild ( h . state . placeholder ) , h . state . placeholder = null ) } function v ( h ) { p ( h ) ; var g = h . state . placeholder = document . createElement ( "pre" ) ; g . style . cssText = "height: 0; overflow: visible" , g . style . direction = h . getOption ( "direction" ) , g . className = "CodeMirror-placeholder CodeMirror-line-like" ; var T = h . getOption ( "placeholder" ) ; typeof T == "string" && ( T = document . createTextNode ( T ) ) , g . appendChild ( T ) , h . display . lineSpace . insertBefore ( g , h . display . lineSpace . firstChild ) } function C ( h ) { setTimeout ( function ( ) { var g = ! 1 ; if ( h . lineCount ( ) == 1 ) { var T = h . getInputField ( ) ; g = T . nodeName == "TEXTAREA" ? ! h . getLine ( 0 ) . length : ! /[^\u200b]/ . test ( T . querySelector ( ".CodeMirror-line" ) . textContent ) } g ? v ( h ) : p ( h ) } , 20 ) } function b ( h ) { s ( h ) && v ( h ) } function S ( h ) { var g = h . getWrapperElement ( ) , T = s ( h ) ; g . className = g . className . replace ( " CodeMirror-empty" , "" ) + ( T ? " CodeMirror-empty" : "" ) , T ? v ( h ) : p ( h ) } function s ( h ) { return h . lineCount ( ) === 1 && h . getLine ( 0 ) === "" } } ) } ) ; var ys = Ke ( ( vs , bs ) => { ( function ( o ) { typeof vs == "object" && typeof bs == "object" ? o ( We ( ) ) : typeof define == "function" && define . amd ? define ( [ "../../lib/codemirror" ] , o ) : o ( CodeMirror ) } ) ( function ( o ) { "use strict" ; o . defineOption ( "styleSelectedText" , ! 1 , function ( w , c , d ) { var k = d && d != o . Init ; c && ! k ? ( w . state . markedSelection = [ ] , w . state . markedSelectionStyle = typeof c == "string" ? c : "CodeMirror-selectedtext" , g ( w ) , w . on ( "cursorActivity" , p ) , w . on ( "change" , v ) ) : ! c && k && ( w . off ( "cursorActivity" , p ) , w . off ( "change" , v ) , h ( w ) , w . state . markedSelection = w . state . markedSelectionStyle = null ) } ) ; function p ( w ) { w . state . markedSelection && w . operation ( function ( ) { T ( w ) } ) } function v ( w ) { w . state . markedSelection && w . state . markedSelection . length && w . operation ( function ( ) { h ( w ) } ) } var C = 8 , b = o . Pos , S = o . cmpPos ; function s ( w , c , d , k ) { if ( S ( c , d ) != 0 ) for ( var z = w . state . markedSelection , M = w . state . markedSelectionStyle , _ = c . line ; ; ) { var W = _ == c . line ? c : b ( _ , 0 ) , E = _ + C , O = E >= d . line , G = O ? d : b ( E , 0 ) , J = w . markText ( W , G , { className : M } ) ; if ( k == null ? z . push ( J ) : z . splice ( k ++ , 0 , J ) , O ) break ; _ = E } } function h ( w ) { for ( var c = w . state . markedSelection , d = 0 ; d < c . length ; ++ d ) c [ d ] . clear ( ) ; c . length = 0 } function g ( w ) { h ( w ) ; for ( var c = w . listSelections ( ) , d = 0 ; d < c . length ; d ++ ) s ( w , c [ d ] . from ( ) , c [ d ] . to ( ) ) } function T ( w ) { if ( ! w . somethingSelected ( ) ) return h ( w ) ; if ( w . listSelections ( ) . length > 1 ) return g ( w ) ; var c = w . getCursor ( "start" ) , d = w . getCursor ( "end" ) , k = w . state . markedSelection ; if ( ! k . length ) return s ( w , c , d ) ; var z = k [ 0 ] . find ( ) , M = k [ k . length - 1 ] . find ( ) ; if ( ! z || ! M || d . line - c . line <= C || S ( c , M . to ) >= 0 || S ( d , z . from ) <= 0 ) return g ( w ) ; for ( ; S ( c , z . from ) > 0 ; ) k . shift ( ) . clear ( ) , z = k [ 0 ] . find ( ) ; for ( S ( c , z . from ) < 0 && ( z . to . line - c . line < C ? ( k . shift ( ) . clear ( ) , s ( w , c , z . to , 0 ) ) : s ( w , c , z . from , 0 ) ) ; S ( d , M . to ) < 0 ; ) k . pop ( ) . clear ( ) , M = k [ k . length - 1 ] . find ( ) ; S ( d , M . to ) > 0 && ( d . line - M . from . line < C ? ( k . pop ( ) . clear ( ) , s ( w , M . from , d ) ) : s ( w , M . to , d ) ) } } ) } ) ; var ks = Ke ( ( xs , _s ) => { ( function ( o ) { typeof xs == "object" && typeof _s == "object" ? o ( We ( ) ) : typeof define == "function" && define . amd ? define ( [ "../../lib/codemirror" ] , o ) : o ( CodeMirror ) } ) ( function ( o ) { "use strict" ; var p = o . Pos ; function v ( _ ) { var W = _ . flags ; return W ? ? ( _ . ignoreCase ? "i" : "" ) + ( _ . global ?
` +I}G=G*2,W.lastIndex=E.ch;var D=W.exec(O);if(D){var Q=O.slice(0,D.index).split( `
2025-09-21 18:07:30 +08:00
` ),j=D[0].split( `
2025-10-02 14:58:30 +07:00
` ),V=E.line+Q.length-1,y=Q[Q.length-1].length;return{from:p(V,y),to:p(V+j.length-1,j.length==1?y+j[0].length:j[j.length-1].length),match:D}}}}function h(_,W,E){for(var O,G=0;G<=_.length;){W.lastIndex=G;var J=W.exec(_);if(!J)break;var re=J.index+J[0].length;if(re>_.length-E)break;(!O||re>O.index+O[0].length)&&(O=J),G=J.index+1}return O}function g(_,W,E){W=C(W,"g");for(var O=E.line,G=E.ch,J=_.firstLine();O>=J;O--,G=-1){var re=_.getLine(O),q=h(re,W,G<0?0:re.length-G);if(q)return{from:p(O,q.index),to:p(O,q.index+q[0].length),match:q}}}function T(_,W,E){if(!b(W))return g(_,W,E);W=C(W,"gm");for(var O,G=1,J=_.getLine(E.line).length-E.ch,re=E.line,q=_.firstLine();re>=q;){for(var I=0;I<G&&re>=q;I++){var D=_.getLine(re--);O=O==null?D:D+ `
` +O}G*=2;var Q=h(O,W,J);if(Q){var j=O.slice(0,Q.index).split( `
2024-12-25 23:09:07 +08:00
` ),V=Q[0].split( `
2025-10-02 14:58:30 +07:00
` ),y=re+j.length,K=j[j.length-1].length;return{from:p(y,K),to:p(y+V.length-1,V.length==1?K+V[0].length:V[V.length-1].length),match:Q}}}}var w,c;String.prototype.normalize?(w=function(_){return _.normalize("NFD").toLowerCase()},c=function(_){return _.normalize("NFD")}):(w=function(_){return _.toLowerCase()},c=function(_){return _});function d(_,W,E,O){if(_.length==W.length)return E;for(var G=0,J=E+Math.max(0,_.length-W.length);;){if(G==J)return G;var re=G+J>>1,q=O(_.slice(0,re)).length;if(q==E)return re;q>E?J=re:G=re+1}}function k(_,W,E,O){if(!W.length)return null;var G=O?w:c,J=G(W).split(/ \r | \n \r ?/);e:for(var re=E.line,q=E.ch,I=_.lastLine()+1-J.length;re<=I;re++,q=0){var D=_.getLine(re).slice(q),Q=G(D);if(J.length==1){var j=Q.indexOf(J[0]);if(j==-1)continue e;var E=d(D,Q,j,G)+q;return{from:p(re,d(D,Q,j,G)+q),to:p(re,d(D,Q,j+J[0].length,G)+q)}}else{var V=Q.length-J[0].length;if(Q.slice(V)!=J[0])continue e;for(var y=1;y<J.length-1;y++)if(G(_.getLine(re+y))!=J[y])continue e;var K=_.getLine(re+J.length-1),X=G(K),N=J[J.length-1];if(X.slice(0,N.length)!=N)continue e;return{from:p(re,d(D,Q,V,G)+q),to:p(re+J.length-1,d(K,X,N.length,G))}}}}function z(_,W,E,O){if(!W.length)return null;var G=O?w:c,J=G(W).split(/ \r | \n \r ?/);e:for(var re=E.line,q=E.ch,I=_.firstLine()-1+J.length;re>=I;re--,q=-1){var D=_.getLine(re);q>-1&&(D=D.slice(0,q));var Q=G(D);if(J.length==1){var j=Q.lastIndexOf(J[0]);if(j==-1)continue e;return{from:p(re,d(D,Q,j,G)),to:p(re,d(D,Q,j+J[0].length,G))}}else{var V=J[J.length-1];if(Q.slice(0,V.length)!=V)continue e;for(var y=1,E=re-J.length+1;y<J.length-1;y++)if(G(_.getLine(E+y))!=J[y])continue e;var K=_.getLine(re+1-J.length),X=G(K);if(X.slice(X.length-J[0].length)!=J[0])continue e;return{from:p(re+1-J.length,d(K,X,K.length-J[0].length,G)),to:p(re,d(D,Q,V.length,G))}}}}function M(_,W,E,O){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=_,E=E?_.clipPos(E):p(0,0),this.pos={from:E,to:E};var G;typeof O=="object"?G=O.caseFold:(G=O,O=null),typeof W=="string"?(G==null&&(G=!1),this.matches=function(J,re){return(J?z:k)(_,W,re,G)}):(W=C(W,"gm"),!O||O.multiline!==!1?this.matches=function(J,re){return(J?T:s)(_,W,re)}:this.matches=function(J,re){return(J?g:S)(_,W,re)})}M.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(_){var W=this.doc.clipPos(_?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(W=p(W.line,W.ch),_?(W.ch--,W.ch<0&&(W.line--,W.ch=(this.doc.getLine(W.line)||"").length)):(W.ch++,W.ch>(this.doc.getLine(W.line)||"").length&&(W.ch=0,W.line++)),o.cmpPos(W,this.doc.clipPos(W))!=0))return this.atOccurrence=!1;var E=this.matches(_,W);if(this.afterEmptyMatch=E&&o.cmpPos(E.from,E.to)==0,E)return this.pos=E,this.atOccurrence=!0,this.pos.match||!0;var O=p(_?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:O,to:O},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(_,W){if(this.atOccurrence){var E=o.splitLines(_);this.doc.replaceRange(E,this.pos.from,this.pos.to,W),this.pos.to=p(this.pos.from.line+E.length-1,E[E.length-1].length+(E.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(_,W,E){return new M(this.doc,_,W,E)}),o.defineDocExtension("getSearchCursor",function(_,W,E){return new M(this,_,W,E)}),o.defineExtension("selectMatches",function(_,W){for(var E=[],O=this.getSearchCursor(_,this.getCursor("from"),W);O.findNext()&&!(o.cmpPos(O.to(),this.getCursor("to"))>0);)E.push({anchor:O.from(),head:O.to()});E.length&&this.setSelections(E,0)})})});var Vo=Ke((ws,Ss)=>{(function(o){typeof ws=="object"&&typeof Ss=="object"?o(We()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";function p(N,R,le,xe,F,L){this.indented=N,this.column=R,this.type=le,this.info=xe,this.align=F,this.prev=L}function v(N,R,le,xe){var F=N.indented;return N.context&&N.context.type=="statement"&&le!="statement"&&(F=N.context.indented),N.context=new p(F,R,le,xe,null,
2024-12-25 23:09:07 +08:00
` && ( b . innerActive = b . inner = null ) ; else for ( var s = 0 ; s < v . length ; ++ s ) { var h = v [ s ] ; h . open === `
2025-10-02 14:58:30 +07:00
` && ( b . innerActive = h , b . inner = o . startState ( h . mode , S . indent ? S . indent ( b . outer , "" , "" ) : 0 ) ) } } , electricChars : p . electricChars , innerMode : function ( b ) { return b . inner ? { state : b . inner , mode : b . innerActive . mode } : { state : b . outer , mode : p } } } } } ) } ) ; var lc = Ke ( ( oc , ac ) => { ( function ( o ) { typeof oc == "object" && typeof ac == "object" ? o ( We ( ) , Di ( ) , ic ( ) ) : typeof define == "function" && define . amd ? define ( [ "../../lib/codemirror" , "../../addon/mode/simple" , "../../addon/mode/multiplex" ] , o ) : o ( CodeMirror ) } ) ( function ( o ) { "use strict" ; o . defineSimpleMode ( "handlebars-tags" , { start : [ { regex : /\{\{\{/ , push : "handlebars_raw" , token : "tag" } , { regex : /\{\{!--/ , push : "dash_comment" , token : "comment" } , { regex : /\{\{!/ , push : "comment" , token : "comment" } , { regex : /\{\{/ , push : "handlebars" , token : "tag" } ] , handlebars _raw : [ { regex : /\}\}\}/ , pop : ! 0 , token : "tag" } ] , handlebars : [ { regex : /\}\}/ , pop : ! 0 , token : "tag" } , { regex : /"(?:[^\\"]|\\.)*"?/ , token : "string" } , { regex : /'(?:[^\\']|\\.)*'?/ , token : "string" } , { regex : />|[#\/]([A-Za-z_]\w*)/ , token : "keyword" } , { regex : /(?:else|this)\b/ , token : "keyword" } , { regex : /\d+/i , token : "number" } , { regex : /=|~|@|true|false/ , token : "atom" } , { regex : /(?:\.\.\/)*(?:[A-Za-z_][\w\.]*)+/ , token : "variable-2" } ] , dash _comment : [ { regex : /--\}\}/ , pop : ! 0 , token : "comment" } , { regex : /./ , token : "comment" } ] , comment : [ { regex : /\}\}/ , pop : ! 0 , token : "comment" } , { regex : /./ , token : "comment" } ] , meta : { blockCommentStart : "{{--" , blockCommentEnd : "--}}" } } ) , o . defineMode ( "handlebars" , function ( p , v ) { var C = o . getMode ( p , "handlebars-tags" ) ; return ! v || ! v . base ? C : o . multiplexingMode ( o . getMode ( p , v . base ) , { open : "{{" , close : /\}\}\}?/ , mode : C , parseDelimiters : ! 0 } ) } ) , o . defineMIME ( "text/x-handlebars-template" , "handlebars" ) } ) } ) ; var cc = Ke ( ( sc , uc ) => { ( function ( o ) { "use strict" ; typeof sc == "object" && typeof uc == "object" ? o ( We ( ) , Yn ( ) , mn ( ) , vn ( ) , Vu ( ) , gn ( ) , ea ( ) , ta ( ) , tc ( ) , lc ( ) ) : typeof define == "function" && define . amd ? define ( [ "../../lib/codemirror" , "../../addon/mode/overlay" , "../xml/xml" , "../javascript/javascript" , "../coffeescript/coffeescript" , "../css/css" , "../sass/sass" , "../stylus/stylus" , "../pug/pug" , "../handlebars/handlebars" ] , o ) : o ( CodeMirror ) } ) ( function ( o ) { var p = { script : [ [ "lang" , /coffee(script)?/ , "coffeescript" ] , [ "type" , /^(?:text|application)\/(?:x-)?coffee(?:script)?$/ , "coffeescript" ] , [ "lang" , /^babel$/ , "javascript" ] , [ "type" , /^text\/babel$/ , "javascript" ] , [ "type" , /^text\/ecmascript-\d+$/ , "javascript" ] ] , style : [ [ "lang" , /^stylus$/i , "stylus" ] , [ "lang" , /^sass$/i , "sass" ] , [ "lang" , /^less$/i , "text/x-less" ] , [ "lang" , /^scss$/i , "text/x-scss" ] , [ "type" , /^(text\/)?(x-)?styl(us)?$/i , "stylus" ] , [ "type" , /^text\/sass/i , "sass" ] , [ "type" , /^(text\/)?(x-)?scss$/i , "text/x-scss" ] , [ "type" , /^(text\/)?(x-)?less$/i , "text/x-less" ] ] , template : [ [ "lang" , /^vue-template$/i , "vue" ] , [ "lang" , /^pug$/i , "pug" ] , [ "lang" , /^handlebars$/i , "handlebars" ] , [ "type" , /^(text\/)?(x-)?pug$/i , "pug" ] , [ "type" , /^text\/x-handlebars-template$/i , "handlebars" ] , [ null , null , "vue-template" ] ] } ; o . defineMode ( "vue-template" , function ( v , C ) { var b = { token : function ( S ) { if ( S . match ( /^\{\{.*?\}\}/ ) ) return "meta mustache" ; for ( ; S . next ( ) && ! S . match ( "{{" , ! 1 ) ; ) ; return null } } ; return o . overlayMode ( o . getMode ( v , C . backdrop || "text/html" ) , b ) } ) , o . defineMode ( "vue" , function ( v ) { return o . getMode ( v , { name : "htmlmixed" , tags : p } ) } , "htmlmixed" , "xml" , "javascript" , "coffeescript" , "css" , "sass" , "stylus" , "pug" , "handlebars" ) , o . defineMIME ( "script/x-vue" , "vue" ) , o . defineMIME ( "text/x-vue" , "vue" ) } ) } ) ; var pc = Ke ( ( fc , dc ) => { ( function ( o ) { typeof fc == "object" && typeof dc == "object" ? o ( We ( ) ) : typeof define == "function" && define . amd ? define ( [ "../../lib/codemirror" ] , o ) : o ( CodeMirror ) } ) ( function ( o ) { "use strict" ; o . defineMode ( "yaml" , function ( ) { var p = [ "true" , "false" , "on" , "off" , "yes" , "no" ] , v = new RegExp ( "\\b((" + p . join ( ")|(" ) + "))$" , "i" ) ; return { token : function ( C , b ) { var S = C . peek ( ) , s = b . escaped ; if ( b . escaped = ! 1 , S == "#" && ( C . pos == 0 || /\s/ . test ( C . string . charAt ( C . pos - 1 ) ) ) ) return C . skipToEnd ( ) , "comment" ; if ( C . match ( /^('([^']|\\.)*'?|"([^"]|\\.)*"?)/ ) ) return "string" ; if ( b . literal && C . indentation ( ) > b . keyCol ) return C . skipToEnd ( ) , "string" ; if ( b . literal && ( b . literal = ! 1 ) , C . sol ( ) ) { if ( b . keyCol = 0 , b . pair = ! 1 , b . pairStart = ! 1 , C . match ( "---" ) || C . match ( "..." ) ) return "def" ; if ( C . match ( /\s*-\s+/ ) ) return "meta" } if ( C . match ( /^(\{|\}|\[|\])/ ) ) return S == "{" ? b . inlinePairs
2024-12-25 23:09:07 +08:00
` ,de= `
2025-10-02 14:58:30 +07:00
` +R;F&&xe++,F&&N.ch===0&&(de=R+ `
` ,xe--),jr(K,!1,[L,de]),K.setSelection({line:le,ch:0},{line:xe,ch:0})}var s=o.codemirror,h=s.getCursor("start"),g=s.getCursor("end"),T=s.getTokenAt({line:h.line,ch:h.ch||1}),w=s.getLineHandle(h.line),c=b(s,h.line,w,T),d,k,z;if(c==="single"){var M=w.text.slice(0,h.ch).replace(" ` "," "),_=w.text.slice(h.ch).replace(" ` ","");s.replaceRange(M+_,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch--,h!==g&&g.ch--,s.setSelection(h,g),s.focus()}else if(c==="fenced")if(h.line!==g.line||h.ch!==g.ch){for(d=h.line;d>=0&&(w=s.getLineHandle(d),!v(w));d--);var W=s.getTokenAt({line:d,ch:1}),E=C(W).fencedChars,O,G,J,re;v(s.getLineHandle(h.line))?(O="",G=h.line):v(s.getLineHandle(h.line-1))?(O="",G=h.line-1):(O=E+ `
2025-05-03 02:07:59 +07:00
` ,G=h.line),v(s.getLineHandle(g.line))?(J="",re=g.line,g.ch===0&&(re+=1)):g.ch!==0&&v(s.getLineHandle(g.line+1))?(J="",re=g.line+1):(J=E+ `
2025-10-02 14:58:30 +07:00
` ,re=g.line+1),g.ch===0&&(re-=1),s.operation(function(){s.replaceRange(J,{line:re,ch:0},{line:re+(J?0:1),ch:0}),s.replaceRange(O,{line:G,ch:0},{line:G+(O?0:1),ch:0})}),s.setSelection({line:G+(O?1:0),ch:0},{line:re+(O?1:-1),ch:0}),s.focus()}else{var q=h.line;if(v(s.getLineHandle(h.line))&&(b(s,h.line+1)==="fenced"?(d=h.line,q=h.line+1):(k=h.line,q=h.line-1)),d===void 0)for(d=q;d>=0&&(w=s.getLineHandle(d),!v(w));d--);if(k===void 0)for(z=s.lineCount(),k=q;k<z&&(w=s.getLineHandle(k),!v(w));k++);s.operation(function(){s.replaceRange("",{line:d,ch:0},{line:d+1,ch:0}),s.replaceRange("",{line:k-1,ch:0},{line:k,ch:0})}),s.focus()}else if(c==="indented"){if(h.line!==g.line||h.ch!==g.ch)d=h.line,k=g.line,g.ch===0&&k--;else{for(d=h.line;d>=0;d--)if(w=s.getLineHandle(d),!w.text.match(/^ \s * $ /)&&b(s,d,w)!=="indented"){d+=1;break}for(z=s.lineCount(),k=h.line;k<z;k++)if(w=s.getLineHandle(k),!w.text.match(/^ \s * $ /)&&b(s,k,w)!=="indented"){k-=1;break}}var I=s.getLineHandle(k+1),D=I&&s.getTokenAt({line:k+1,ch:I.text.length-1}),Q=D&&C(D).indentedCode;Q&&s.replaceRange( `
` ,{line:k+1,ch:0});for(var j=d;j<=k;j++)s.indentLine(j,"subtract");s.focus()}else{var V=h.line===g.line&&h.ch===g.ch&&h.ch===0,y=h.line!==g.line;V||y?S(s,h,g,p):jr(s,!1,[" ` "," ` "])}}function Bi(o){la(o.codemirror,"quote")}function Jn(o){Lr(o.codemirror,"smaller")}function ji(o){Lr(o.codemirror,"bigger")}function Ri(o){Lr(o.codemirror,void 0,1)}function Hi(o){Lr(o.codemirror,void 0,2)}function Wi(o){Lr(o.codemirror,void 0,3)}function na(o){Lr(o.codemirror,void 0,4)}function ia(o){Lr(o.codemirror,void 0,5)}function oa(o){Lr(o.codemirror,void 0,6)}function Ui(o){var p=o.codemirror,v="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(v=o.options.unorderedListStyle),la(p,"unordered-list",v)}function $ i(o){la(o.codemirror,"ordered-list")}function Ki(o){Pd(o.codemirror)}function Gi(o){var p=o.options,v="https://";if(p.promptURLs){var C=prompt(p.promptTexts.link,v);if(!C)return!1;v=bc(C)}xc(o,"link",p.insertTexts.link,v)}function Zi(o){var p=o.options,v="https://";if(p.promptURLs){var C=prompt(p.promptTexts.image,v);if(!C)return!1;v=bc(C)}xc(o,"image",p.insertTexts.image,v)}function bc(o){return encodeURI(o).replace(/([ \\ ()])/g," \\ $ 1")}function aa(o){o.openBrowseFileWindow()}function yc(o,p){var v=o.codemirror,C=Tr(v),b=o.options,S=p.substr(p.lastIndexOf("/")+1),s=S.substring(S.lastIndexOf(".")+1).replace(/ \? .* $ /,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(s))jr(v,C.image,b.insertTexts.uploadedImage,p);else{var h=b.insertTexts.link;h[0]="["+S,jr(v,C.link,h,p)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",S)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function Xi(o){var p=o.codemirror,v=Tr(p),C=o.options;jr(p,v.table,C.insertTexts.table)}function Yi(o){var p=o.codemirror,v=Tr(p),C=o.options;jr(p,v.image,C.insertTexts.horizontalRule)}function Qi(o){var p=o.codemirror;p.undo(),p.focus()}function Vi(o){var p=o.codemirror;p.redo(),p.focus()}function bn(o){var p=o.codemirror,v=p.getWrapperElement(),C=v.nextSibling,b=o.toolbarElements&&o.toolbarElements["side-by-side"],S=!1,s=v.parentNode;C.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&s.classList.remove("sided--no-fullscreen"),C.classList.remove("editor-preview-active-side"),b&&b.classList.remove("active"),v.classList.remove("CodeMirror-sided")):(setTimeout(function(){p.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?s.classList.add("sided--no-fullscreen"):Br(o)),C.classList.add("editor-preview-active-side")},1),b&&b.classList.add("active"),v.classList.add("CodeMirror-sided"),S=!0);var h=v.lastChild;if(h.classList.contains("editor-preview-active")){h.classList.remove("editor-preview-active");var g=o.toolbarElements.preview,T=o.toolbar_div;g.classList.remove("active"),T.classList.remove("disabled-for-preview")}var w=function(){var d=o.options.previewRender(o.value(),C);d!=null&&(C.innerHTML=d)};if(p.sideBySideRenderingFunction||(p.sideBySideRenderingFunction=w),S){var c=o.options.previewRender(o.value(),C);c!=null&&(C.innerHTML=c),p.on("update",p.sideBySideRenderingFunction)}else p.off("update",p.sideBySideRenderingFunction);p.refresh()}function Ji(o){var p=o.codemirror,v=p.getWrapperElement(),C=o.toolbar_div,b=o.options.toolbar?o.toolbarElements.preview:!1,S=v.lastChild,s=p.getWrapperElement().nextSibling;if(s.classList.contains("editor-preview-active-side")&&bn(o),!S||!S.classList.contains("editor-preview-full")){if(S=document.createElement("div"),S.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var h=0;h<o.options.previewClass.length;h++)S.classList.add(o.options.previewClass[h]);else typeof o.options.previewClass=="string"&&S.classList.add(o.options.previewClass);v.appendChild(S)}S.classList.contains("editor-preview-active")?(S.classList.remove("editor-preview-active"),b&&(b.classList.remove("active"),C.classList.remove("disabled-for-preview"))):(setTimeout(function(){S.classList.add("editor-preview-active")},1),b&&(b.classList.add("active
2024-12-25 23:09:07 +08:00
| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Text | Text | Text |
` ] , horizontalRule : [ "" , `
-----
2025-09-21 18:07:30 +08:00
` ] } , jd = { link : "URL for the link:" , image : "URL of the image:" } , Rd = { locale : "en-US" , format : { hour : "2-digit" , minute : "2-digit" } } , Hd = { bold : "**" , code : "```" , italic : "*" } , Wd = { sbInit : "Attach files by drag and dropping or pasting from clipboard." , sbOnDragEnter : "Drop image to upload it." , sbOnDrop : "Uploading image #images_names#..." , sbProgress : "Uploading #file_name#: #progress#%" , sbOnUploaded : "Uploaded #image_name#" , sizeUnits : " B, KB, MB" } , Ud = { noFileGiven : "You must select a file." , typeNotAllowed : "This image type is not allowed." , fileTooLarge : ` Image #image_name# is too big (#image_size#).
2025-10-02 14:58:30 +07:00
Maximum file size is #image_max_size#. ` , importError : "Something went wrong when uploading the image #image_name#." } ; Te . prototype . uploadImages = function ( o , p , v ) { if ( o . length !== 0 ) { for ( var C = [ ] , b = 0 ; b < o . length ; b ++ ) C . push ( o [ b ] . name ) , this . uploadImage ( o [ b ] , p , v ) ; this . updateStatusBar ( "upload-image" , this . options . imageTexts . sbOnDrop . replace ( "#images_names#" , C . join ( ", " ) ) ) } } ; Te . prototype . uploadImagesUsingCustomFunction = function ( o , p ) { if ( p . length !== 0 ) { for ( var v = [ ] , C = 0 ; C < p . length ; C ++ ) v . push ( p [ C ] . name ) , this . uploadImageUsingCustomFunction ( o , p [ C ] ) ; this . updateStatusBar ( "upload-image" , this . options . imageTexts . sbOnDrop . replace ( "#images_names#" , v . join ( ", " ) ) ) } } ; Te . prototype . updateStatusBar = function ( o , p ) { if ( this . gui . statusbar ) { var v = this . gui . statusbar . getElementsByClassName ( o ) ; v . length === 1 ? this . gui . statusbar . getElementsByClassName ( o ) [ 0 ] . textContent = p : v . length === 0 ? console . log ( "EasyMDE: status bar item " + o + " was not found." ) : console . log ( "EasyMDE: Several status bar items named " + o + " was found." ) } } ; Te . prototype . markdown = function ( o ) { if ( marked ) { var p ; if ( this . options && this . options . renderingConfig && this . options . renderingConfig . markedOptions ? p = this . options . renderingConfig . markedOptions : p = { } , this . options && this . options . renderingConfig && this . options . renderingConfig . singleLineBreaks === ! 1 ? p . breaks = ! 1 : p . breaks = ! 0 , this . options && this . options . renderingConfig && this . options . renderingConfig . codeSyntaxHighlighting === ! 0 ) { var v = this . options . renderingConfig . hljs || window . hljs ; v && ( p . highlight = function ( b , S ) { return S && v . getLanguage ( S ) ? v . highlight ( S , b ) . value : v . highlightAuto ( b ) . value } ) } marked . setOptions ( p ) ; var C = marked . parse ( o ) ; return this . options . renderingConfig && typeof this . options . renderingConfig . sanitizerFunction == "function" && ( C = this . options . renderingConfig . sanitizerFunction . call ( this , C ) ) , C = qd ( C ) , C = Fd ( C ) , C } } ; Te . prototype . render = function ( o ) { if ( o || ( o = this . element || document . getElementsByTagName ( "textarea" ) [ 0 ] ) , this . _rendered && this . _rendered === o ) return ; this . element = o ; var p = this . options , v = this , C = { } ; function b ( E ) { let O = E . getInputField ( ) , G = O . form ; if ( G ) { let J = Array . from ( G . elements ) . filter ( q => ! ( q . closest && q . closest ( ".editor-toolbar" ) || q . offsetParent === null ) ) , re = J . indexOf ( O ) ; re !== - 1 && re + 1 < J . length && J [ re + 1 ] && J [ re + 1 ] . focus ( ) } } function S ( E ) { let O = E . getInputField ( ) , G = O . form ; if ( G ) { let J = Array . from ( G . elements ) . filter ( q => ! ( q . closest && q . closest ( ".editor-toolbar" ) || q . offsetParent === null ) ) , re = J . indexOf ( O ) ; if ( re !== - 1 ) for ( let q = re - 1 ; q >= 0 ; q -- ) { let I = J [ q ] ; if ( I ) { I . focus ( ) ; break } } } } for ( var s in p . shortcuts ) p . shortcuts [ s ] !== null && Vn [ s ] !== null && ( function ( E ) { C [ vc ( p . shortcuts [ E ] ) ] = function ( ) { var O = Vn [ E ] ; typeof O == "function" ? O ( v ) : typeof O == "string" && window . open ( O , "_blank" ) } } ) ( s ) ; C . Enter = "newlineAndIndentContinueMarkdownList" , C . Tab = E => { let O = E . getSelection ( ) ; O && O . length > 0 ? E . execCommand ( "indentMore" ) : b ( E ) } , C [ "Shift-Tab" ] = E => { let O = E . getSelection ( ) ; O && O . length > 0 ? E . execCommand ( "indentLess" ) : S ( E ) } , C . Esc = function ( E ) { E . getOption ( "fullScreen" ) && Br ( v ) } , this . documentOnKeyDown = function ( E ) { E = E || window . event , E . keyCode == 27 && v . codemirror . getOption ( "fullScreen" ) && Br ( v ) } , document . addEventListener ( "keydown" , this . documentOnKeyDown , ! 1 ) ; var h , g ; p . overlayMode ? ( CodeMirror . defineMode ( "overlay-mode" , function ( E ) { return CodeMirror . overlayMode ( CodeMirror . getMode ( E , p . spellChecker !== ! 1 ? "spell-checker" : "gfm" ) , p . overlayMode . mode , p . overlayMode . combine ) } ) , h = "overlay-mode" , g = p . parsingConfig , g . gitHubSpice = ! 1 ) : ( h = p . parsingConfig , h . name = "gfm" , h . gitHubSpice = ! 1 ) , p . spellChecker !== ! 1 && ( h = "spell-checker" , g = p . parsingConfig , g . name = "gfm" , g . gitHubSpice = ! 1 , typeof p . spellChecker == "function" ? p . spellChecker ( { codeMirrorInstance : CodeMirror } ) : CodeMirrorSpellChecker ( { codeMirrorInstance : CodeMirror } ) ) ; function T ( E , O , G ) { return { addNew : ! 1 } } if ( CodeMirror . getMode ( "php" ) . mime = "text/x-php" , this . codemirror = CodeMirror . fromTextArea ( o , { mode : h , backdrop : g , theme : p . theme != null ? p . theme : "easymde" , tabSize : p . tabSize != null ? p . tabSize : 2 , indentUnit : p . tabSize != null ? p . tabSize : 2 , indentWithTabs : p . indentWithTabs !== ! 1 , lineNumbers : p . lineNumbers === ! 0 , autofocus : p . autofocus === ! 0 , extraKeys : C , direction : p . direction , lineWrapping : p . lineWrapping !== ! 1 , allowDropFileTypes : [ "text/plain" ] , placeholder : p