@langsword/trace 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/trace.css +2 -2
- package/dist/trace.es.js +9421 -7551
- package/dist/trace.umd.js +76 -74
- package/package.json +1 -1
package/dist/trace.umd.js
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
(function(ke,Qe){typeof exports=="object"&&typeof module<"u"?Qe(exports,require("pinia"),require("axios"),require("vue")):typeof define=="function"&&define.amd?define(["exports","pinia","axios","vue"],Qe):(ke=typeof globalThis<"u"?globalThis:ke||self,Qe(ke.LangswordTrace={},ke.Pinia,ke.axios,ke.Vue))})(this,function(ke,Qe,$t,Rf){"use strict";var ov=Object.defineProperty;var Df=ke=>{throw TypeError(ke)};var lv=(ke,Qe,$t)=>Qe in ke?ov(ke,Qe,{enumerable:!0,configurable:!0,writable:!0,value:$t}):ke[Qe]=$t;var qe=(ke,Qe,$t)=>lv(ke,typeof Qe!="symbol"?Qe+"":Qe,$t),uv=(ke,Qe,$t)=>Qe.has(ke)||Df("Cannot "+$t);var Nf=(ke,Qe,$t)=>Qe.has(ke)?Df("Cannot add the same private member more than once"):Qe instanceof WeakSet?Qe.add(ke):Qe.set(ke,$t);var Ma=(ke,Qe,$t)=>(uv(ke,Qe,"access private method"),$t);var Kr,ao,Mf;var so=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ra={exports:{}},oo;function vr(){return oo||(oo=1,function(f,i){(function(s,l){f.exports=l()})(so,function(){var s=navigator.userAgent,l=navigator.platform,c=/gecko\/\d/i.test(s),g=/MSIE \d/.test(s),p=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(s),w=/Edge\/(\d+)/.exec(s),b=g||p||w,y=b&&(g?document.documentMode||6:+(w||p)[1]),k=!w&&/WebKit\//.test(s),_=k&&/Qt\/\d+\.\d+/.test(s),L=!w&&/Chrome\/(\d+)/.exec(s),H=L&&+L[1],F=/Opera\//.test(s),U=/Apple Computer/.test(navigator.vendor),M=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(s),A=/PhantomJS/.test(s),D=U&&(/Mobile\/\w+/.test(s)||navigator.maxTouchPoints>2),P=/Android/.test(s),G=D||P||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(s),J=D||/Mac/.test(l),ne=/\bCrOS\b/.test(s),te=/win/i.test(l),fe=F&&s.match(/Version\/(\d*\.\d*)/);fe&&(fe=Number(fe[1])),fe&&fe>=15&&(F=!1,k=!0);var Me=J&&(_||F&&(fe==null||fe<12.11)),Ee=c||b&&y>=9;function Oe(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Re=function(e,t){var n=e.className,r=Oe(t).exec(n);if(r){var a=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(a?r[1]+a:"")}};function $(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function V(e,t){return $(e).appendChild(t)}function T(e,t,n,r){var a=document.createElement(e);if(n&&(a.className=n),r&&(a.style.cssText=r),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)a.appendChild(t[o]);return a}function rt(e,t,n,r){var a=T(e,t,n,r);return a.setAttribute("role","presentation"),a}var st;document.createRange?st=function(e,t,n,r){var a=document.createRange();return a.setEnd(r||e,n),a.setStart(e,t),a}:st=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 I(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 N(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 K(e,t){var n=e.className;Oe(t).test(n)||(e.className+=(n?" ":"")+t)}function se(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!Oe(n[r]).test(t)&&(t+=" "+n[r]);return t}var Fe=function(e){e.select()};D?Fe=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:b&&(Fe=function(e){try{e.select()}catch{}});function ze(e){return e.display.wrapper.ownerDocument}function wt(e){return nt(e.display.wrapper)}function nt(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function pe(e){return ze(e).defaultView}function he(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function be(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 Ce(e,t,n,r,a){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,u=a||0;;){var h=e.indexOf(" ",o);if(h<0||h>=t)return u+(t-o);u+=h-o,u+=n-u%n,o=h+1}}var jt=function(){this.id=null,this.f=null,this.time=0,this.handler=he(this.onTimeout,this)};jt.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},jt.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 ye(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var pt=50,Qt={toString:function(){return"CodeMirror.Pass"}},St={scroll:!1},qt={origin:"*mouse"},Ct={origin:"+move"};function Ft(e,t,n){for(var r=0,a=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var u=o-r;if(o==e.length||a+u>=t)return r+Math.min(u,t-a);if(a+=o-r,a+=n-a%n,r=o+1,a>=t)return r}}var Kt=[""];function Lr(e){for(;Kt.length<=e;)Kt.push(de(Kt)+" ");return Kt[e]}function de(e){return e[e.length-1]}function Jt(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function mn(e,t,n){for(var r=0,a=n(t);r<e.length&&n(e[r])<=a;)r++;e.splice(r,0,t)}function yn(){}function Gr(e,t){var n;return Object.create?n=Object.create(e):(yn.prototype=e,n=new yn),t&&be(t,n),n}var bn=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ue(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||bn.test(e))}function ce(e,t){return t?t.source.indexOf("\\w")>-1&&ue(e)?!0:t.test(e):ue(e)}function ie(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Te=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function we(e){return e.charCodeAt(0)>=768&&Te.test(e)}function Dt(e,t,n){for(;(n<0?t>0:t<e.length)&&we(e.charAt(t));)t+=n;return t}function Gt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var a=(t+n)/2,o=r<0?Math.ceil(a):Math.floor(a);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function _r(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var a=!1,o=0;o<e.length;++o){var u=e[o];(u.from<n&&u.to>t||t==n&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,n),u.level==1?"rtl":"ltr",o),a=!0)}a||r(t,n,"ltr")}var Xr=null;function Er(e,t,n){var r;Xr=null;for(var a=0;a<e.length;++a){var o=e[a];if(o.from<t&&o.to>t)return a;o.to==t&&(o.from!=o.to&&n=="before"?r=a:Xr=a),o.from==t&&(o.from!=o.to&&n!="before"?r=a:Xr=a)}return r??Xr}var us=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,o=/[LRr]/,u=/[Lb1n]/,h=/[1n]/;function d(v,x,C){this.level=v,this.from=x,this.to=C}return function(v,x){var C=x=="ltr"?"L":"R";if(v.length==0||x=="ltr"&&!r.test(v))return!1;for(var O=v.length,E=[],z=0;z<O;++z)E.push(n(v.charCodeAt(z)));for(var B=0,q=C;B<O;++B){var X=E[B];X=="m"?E[B]=q:q=X}for(var Q=0,Y=C;Q<O;++Q){var ee=E[Q];ee=="1"&&Y=="r"?E[Q]="n":o.test(ee)&&(Y=ee,ee=="r"&&(E[Q]="R"))}for(var le=1,ae=E[0];le<O-1;++le){var xe=E[le];xe=="+"&&ae=="1"&&E[le+1]=="1"?E[le]="1":xe==","&&ae==E[le+1]&&(ae=="1"||ae=="n")&&(E[le]=ae),ae=xe}for(var We=0;We<O;++We){var ht=E[We];if(ht==",")E[We]="N";else if(ht=="%"){var Ke=void 0;for(Ke=We+1;Ke<O&&E[Ke]=="%";++Ke);for(var Rt=We&&E[We-1]=="!"||Ke<O&&E[Ke]=="1"?"1":"N",Ot=We;Ot<Ke;++Ot)E[Ot]=Rt;We=Ke-1}}for(var it=0,At=C;it<O;++it){var gt=E[it];At=="L"&>=="1"?E[it]="L":o.test(gt)&&(At=gt)}for(var ot=0;ot<O;++ot)if(a.test(E[ot])){var at=void 0;for(at=ot+1;at<O&&a.test(E[at]);++at);for(var Ze=(ot?E[ot-1]:C)=="L",It=(at<O?E[at]:C)=="L",qn=Ze==It?Ze?"L":"R":C,$r=ot;$r<at;++$r)E[$r]=qn;ot=at-1}for(var bt=[],gr,dt=0;dt<O;)if(u.test(E[dt])){var no=dt;for(++dt;dt<O&&u.test(E[dt]);++dt);bt.push(new d(0,no,dt))}else{var Tr=dt,an=bt.length,sn=x=="rtl"?1:0;for(++dt;dt<O&&E[dt]!="L";++dt);for(var kt=Tr;kt<dt;)if(h.test(E[kt])){Tr<kt&&(bt.splice(an,0,new d(1,Tr,kt)),an+=sn);var Kn=kt;for(++kt;kt<dt&&h.test(E[kt]);++kt);bt.splice(an,0,new d(2,Kn,kt)),an+=sn,Tr=kt}else++kt;Tr<dt&&bt.splice(an,0,new d(1,Tr,dt))}return x=="ltr"&&(bt[0].level==1&&(gr=v.match(/^\s+/))&&(bt[0].from=gr[0].length,bt.unshift(new d(0,0,gr[0].length))),de(bt).level==1&&(gr=v.match(/\s+$/))&&(de(bt).to-=gr[0].length,bt.push(new d(0,O-gr[0].length,O)))),x=="rtl"?bt.reverse():bt}}();function Le(e,t){var n=e.order;return n==null&&(n=e.order=us(e.text,t)),n}var ta=[],oe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ta).concat(n)}};function yr(e,t){return e._handlers&&e._handlers[t]||ta}function vt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,a=r&&r[t];if(a){var o=ye(a,n);o>-1&&(r[t]=a.slice(0,o).concat(a.slice(o+1)))}}}function Xe(e,t){var n=yr(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),a=0;a<n.length;++a)n[a].apply(null,r)}function Ye(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Xe(e,n||t.type,e,t),Tt(t)||t.codemirrorIgnore}function Xt(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)ye(n,t[r])==-1&&n.push(t[r])}function Nt(e,t){return yr(e,t).length>0}function er(e){e.prototype.on=function(t,n){oe(this,t,n)},e.prototype.off=function(t,n){vt(this,t,n)}}function mt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function wn(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Tt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Or(e){mt(e),wn(e)}function si(e){return e.target||e.srcElement}function tr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),J&&e.ctrlKey&&t==1&&(t=3),t}var fs=function(){if(b&&y<9)return!1;var e=T("div");return"draggable"in e||"dragDrop"in e}(),xn;function ra(e){if(xn==null){var t=T("span","");V(e,T("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(xn=t.offsetWidth<=1&&t.offsetHeight>2&&!(b&&y<8))}var n=xn?T("span",""):T("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var oi;function Ar(e){if(oi!=null)return oi;var t=V(e,document.createTextNode("AخA")),n=st(t,0,1).getBoundingClientRect(),r=st(t,1,2).getBoundingClientRect();return $(e),!n||n.left==n.right?!1:oi=r.right-n.right<3}var Yt=`
|
|
1
|
+
(function(Ie,it){typeof exports=="object"&&typeof module<"u"?it(exports,require("pinia"),require("axios"),require("vue")):typeof define=="function"&&define.amd?define(["exports","pinia","axios","vue"],it):(Ie=typeof globalThis<"u"?globalThis:Ie||self,it(Ie.LangswordTrace={},Ie.Pinia,Ie.axios,Ie.Vue))})(this,function(Ie,it,Yt,Kf){"use strict";var Xm=Object.defineProperty;var Uf=Ie=>{throw TypeError(Ie)};var Ym=(Ie,it,Yt)=>it in Ie?Xm(Ie,it,{enumerable:!0,configurable:!0,writable:!0,value:Yt}):Ie[it]=Yt;var Je=(Ie,it,Yt)=>Ym(Ie,typeof it!="symbol"?it+"":it,Yt),Vm=(Ie,it,Yt)=>it.has(Ie)||Uf("Cannot "+Yt);var qf=(Ie,it,Yt)=>it.has(Ie)?Uf("Cannot add the same private member more than once"):it instanceof WeakSet?it.add(Ie):it.set(Ie,Yt);var Ra=(Ie,it,Yt)=>(Vm(Ie,it,"access private method"),Yt);var Qn,so,Gf;var oo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Fa={exports:{}},lo;function Wt(){return lo||(lo=1,function(u,n){(function(a,o){u.exports=o()})(oo,function(){var a=navigator.userAgent,o=navigator.platform,f=/gecko\/\d/i.test(a),d=/MSIE \d/.test(a),p=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a),y=/Edge\/(\d+)/.exec(a),m=d||p||y,x=m&&(d?document.documentMode||6:+(y||p)[1]),S=!y&&/WebKit\//.test(a),A=S&&/Qt\/\d+\.\d+/.test(a),E=!y&&/Chrome\/(\d+)/.exec(a),W=E&&+E[1],B=/Opera\//.test(a),q=/Apple Computer/.test(navigator.vendor),F=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(a),N=/PhantomJS/.test(a),O=q&&(/Mobile\/\w+/.test(a)||navigator.maxTouchPoints>2),$=/Android/.test(a),X=O||$||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(a),ne=O||/Mac/.test(o),ue=/\bCrOS\b/.test(a),se=/win/i.test(o),he=B&&a.match(/Version\/(\d*\.\d*)/);he&&(he=Number(he[1])),he&&he>=15&&(B=!1,S=!0);var Oe=ne&&(A||B&&(he==null||he<12.11)),Re=f||m&&x>=9;function ie(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ze=function(e,t){var i=e.className,r=ie(t).exec(i);if(r){var s=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(s?r[1]+s:"")}};function H(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Q(e,t){return H(e).appendChild(t)}function k(e,t,i,r){var s=document.createElement(e);if(i&&(s.className=i),r&&(s.style.cssText=r),typeof t=="string")s.appendChild(document.createTextNode(t));else if(t)for(var l=0;l<t.length;++l)s.appendChild(t[l]);return s}function J(e,t,i,r){var s=k(e,t,i,r);return s.setAttribute("role","presentation"),s}var G;document.createRange?G=function(e,t,i,r){var s=document.createRange();return s.setEnd(r||e,i),s.setStart(e,t),s}:G=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function D(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,i;try{i=e.activeElement}catch{i=t.body||null}for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;return i}function K(e,t){var i=e.className;ie(t).test(i)||(e.className+=(i?" ":"")+t)}function de(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!ie(i[r]).test(t)&&(t+=" "+i[r]);return t}var L=function(e){e.select()};O?L=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:m&&(L=function(e){try{e.select()}catch{}});function w(e){return e.display.wrapper.ownerDocument}function oe(e){return Te(e.display.wrapper)}function Te(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function Z(e){return w(e).defaultView}function ce(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function ke(e,t,i){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(i!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function _e(e,t,i,r,s){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var l=r||0,c=s||0;;){var h=e.indexOf(" ",l);if(h<0||h>=t)return c+(t-l);c+=h-l,c+=i-c%i,l=h+1}}var ft=function(){this.id=null,this.f=null,this.time=0,this.handler=ce(this.onTimeout,this)};ft.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ft.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function we(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Me=50,Ke={toString:function(){return"CodeMirror.Pass"}},ct={scroll:!1},Pt={origin:"*mouse"},ht={origin:"+move"};function dt(e,t,i){for(var r=0,s=0;;){var l=e.indexOf(" ",r);l==-1&&(l=e.length);var c=l-r;if(l==e.length||s+c>=t)return r+Math.min(c,t-s);if(s+=l-r,s+=i-s%i,r=l+1,s>=t)return r}}var gt=[""];function qt(e){for(;gt.length<=e;)gt.push(be(gt)+" ");return gt[e]}function be(e){return e[e.length-1]}function kt(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function Gt(e,t,i){for(var r=0,s=i(t);r<e.length&&i(e[r])<=s;)r++;e.splice(r,0,t)}function In(){}function Zn(e,t){var i;return Object.create?i=Object.create(e):(In.prototype=e,i=new In),t&&ke(t,i),i}var wr=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ye(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||wr.test(e))}function xe(e,t){return t?t.source.indexOf("\\w")>-1&&ye(e)?!0:t.test(e):ye(e)}function pe(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Fe=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function De(e){return e.charCodeAt(0)>=768&&Fe.test(e)}function zt(e,t,i){for(;(i<0?t>0:t<e.length)&&De(e.charAt(t));)t+=i;return t}function Qt(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var s=(t+i)/2,l=r<0?Math.ceil(s):Math.floor(s);if(l==t)return e(l)?t:i;e(l)?i=l:t=l+r}}function On(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var s=!1,l=0;l<e.length;++l){var c=e[l];(c.from<i&&c.to>t||t==i&&c.to==t)&&(r(Math.max(c.from,t),Math.min(c.to,i),c.level==1?"rtl":"ltr",l),s=!0)}s||r(t,i,"ltr")}var er=null;function Nn(e,t,i){var r;er=null;for(var s=0;s<e.length;++s){var l=e[s];if(l.from<t&&l.to>t)return s;l.to==t&&(l.from!=l.to&&i=="before"?r=s:er=s),l.from==t&&(l.from!=l.to&&i!="before"?r=s:er=s)}return r??er}var fs=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(v){return v<=247?e.charAt(v):1424<=v&&v<=1524?"R":1536<=v&&v<=1785?t.charAt(v-1536):1774<=v&&v<=2220?"r":8192<=v&&v<=8203?"w":v==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,s=/[stwN]/,l=/[LRr]/,c=/[Lb1n]/,h=/[1n]/;function g(v,C,_){this.level=v,this.from=C,this.to=_}return function(v,C){var _=C=="ltr"?"L":"R";if(v.length==0||C=="ltr"&&!r.test(v))return!1;for(var M=v.length,I=[],z=0;z<M;++z)I.push(i(v.charCodeAt(z)));for(var U=0,V=_;U<M;++U){var ee=I[U];ee=="m"?I[U]=V:V=ee}for(var ae=0,te=_;ae<M;++ae){var le=I[ae];le=="1"&&te=="r"?I[ae]="n":l.test(le)&&(te=le,le=="r"&&(I[ae]="R"))}for(var ve=1,ge=I[0];ve<M-1;++ve){var Ae=I[ve];Ae=="+"&&ge=="1"&&I[ve+1]=="1"?I[ve]="1":Ae==","&&ge==I[ve+1]&&(ge=="1"||ge=="n")&&(I[ve]=ge),ge=Ae}for(var Ue=0;Ue<M;++Ue){var xt=I[Ue];if(xt==",")I[Ue]="N";else if(xt=="%"){var Qe=void 0;for(Qe=Ue+1;Qe<M&&I[Qe]=="%";++Qe);for(var Ht=Ue&&I[Ue-1]=="!"||Qe<M&&I[Qe]=="1"?"1":"N",Mt=Ue;Mt<Qe;++Mt)I[Mt]=Ht;Ue=Qe-1}}for(var lt=0,Rt=_;lt<M;++lt){var St=I[lt];Rt=="L"&&St=="1"?I[lt]="L":l.test(St)&&(Rt=St)}for(var pt=0;pt<M;++pt)if(s.test(I[pt])){var ut=void 0;for(ut=pt+1;ut<M&&s.test(I[ut]);++ut);for(var rt=(pt?I[pt-1]:_)=="L",Ft=(ut<M?I[ut]:_)=="L",Kr=rt==Ft?rt?"L":"R":_,Gn=pt;Gn<ut;++Gn)I[Gn]=Kr;pt=ut-1}for(var Lt=[],bn,wt=0;wt<M;)if(c.test(I[wt])){var io=wt;for(++wt;wt<M&&c.test(I[wt]);++wt);Lt.push(new g(0,io,wt))}else{var Dn=wt,fr=Lt.length,cr=C=="rtl"?1:0;for(++wt;wt<M&&I[wt]!="L";++wt);for(var Dt=Dn;Dt<wt;)if(h.test(I[Dt])){Dn<Dt&&(Lt.splice(fr,0,new g(1,Dn,Dt)),fr+=cr);var Xr=Dt;for(++Dt;Dt<wt&&h.test(I[Dt]);++Dt);Lt.splice(fr,0,new g(2,Xr,Dt)),fr+=cr,Dn=Dt}else++Dt;Dn<wt&&Lt.splice(fr,0,new g(1,Dn,wt))}return C=="ltr"&&(Lt[0].level==1&&(bn=v.match(/^\s+/))&&(Lt[0].from=bn[0].length,Lt.unshift(new g(0,0,bn[0].length))),be(Lt).level==1&&(bn=v.match(/\s+$/))&&(be(Lt).to-=bn[0].length,Lt.push(new g(0,M-bn[0].length,M)))),C=="rtl"?Lt.reverse():Lt}}();function Pe(e,t){var i=e.order;return i==null&&(i=e.order=fs(e.text,t)),i}var na=[],me=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||na).concat(i)}};function kn(e,t){return e._handlers&&e._handlers[t]||na}function Ct(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,s=r&&r[t];if(s){var l=we(s,i);l>-1&&(r[t]=s.slice(0,l).concat(s.slice(l+1)))}}}function et(e,t){var i=kn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),s=0;s<i.length;++s)i[s].apply(null,r)}function tt(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),et(e,i||t.type,e,t),At(t)||t.codemirrorIgnore}function Zt(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)we(i,t[r])==-1&&i.push(t[r])}function $t(e,t){return kn(e,t).length>0}function rn(e){e.prototype.on=function(t,i){me(this,t,i)},e.prototype.off=function(t,i){Ct(this,t,i)}}function Tt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function kr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function At(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Mn(e){Tt(e),kr(e)}function li(e){return e.target||e.srcElement}function an(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),ne&&e.ctrlKey&&t==1&&(t=3),t}var cs=function(){if(m&&x<9)return!1;var e=k("div");return"draggable"in e||"dragDrop"in e}(),Sr;function ra(e){if(Sr==null){var t=k("span","");Q(e,k("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Sr=t.offsetWidth<=1&&t.offsetHeight>2&&!(m&&x<8))}var i=Sr?k("span",""):k("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ui;function Rn(e){if(ui!=null)return ui;var t=Q(e,document.createTextNode("AخA")),i=G(t,0,1).getBoundingClientRect(),r=G(t,1,2).getBoundingClientRect();return H(e),!i||i.left==i.right?!1:ui=r.right-i.right<3}var en=`
|
|
2
2
|
|
|
3
|
-
b`.split(/\n/).length!=3?function(e){for(var t=0,
|
|
4
|
-
`,t);a==-1&&(a=e.length);var o=e.slice(t,e.charAt(a-1)=="\r"?a-1:a),u=o.indexOf("\r");u!=-1?(n.push(o.slice(0,u)),t+=u+1):(n.push(o),t=a+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ir=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},na=function(){var e=T("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),rr=null;function cs(e){if(rr!=null)return rr;var t=V(e,T("span","x")),n=t.getBoundingClientRect(),r=st(t,0,1).getBoundingClientRect();return rr=Math.abs(n.left-r.left)>1}var kn={},nr={};function ir(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),kn[e]=t}function Yr(e,t){nr[e]=t}function Sn(e){if(typeof e=="string"&&nr.hasOwnProperty(e))e=nr[e];else if(e&&typeof e.name=="string"&&nr.hasOwnProperty(e.name)){var t=nr[e.name];typeof t=="string"&&(t={name:t}),e=Gr(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Sn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Sn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Cn(e,t){t=Sn(t);var n=kn[t.name];if(!n)return Cn(e,"text/plain");var r=n(e,t);if(Dr.hasOwnProperty(t.name)){var a=Dr[t.name];for(var o in a)a.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=a[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var u in t.modeProps)r[u]=t.modeProps[u];return r}var Dr={};function Tn(e,t){var n=Dr.hasOwnProperty(e)?Dr[e]:Dr[e]={};be(t,n)}function cr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var a=t[r];a instanceof Array&&(a=a.concat([])),n[r]=a}return n}function li(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 Ln(e,t,n){return e.startState?e.startState(t,n):!0}var Ve=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};Ve.prototype.eol=function(){return this.pos>=this.string.length},Ve.prototype.sol=function(){return this.pos==this.lineStart},Ve.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ve.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ve.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},Ve.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Ve.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ve.prototype.skipToEnd=function(){this.pos=this.string.length},Ve.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},Ve.prototype.backUp=function(e){this.pos-=e},Ve.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ce(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Ce(this.string,this.lineStart,this.tabSize):0)},Ve.prototype.indentation=function(){return Ce(this.string,null,this.tabSize)-(this.lineStart?Ce(this.string,this.lineStart,this.tabSize):0)},Ve.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(u){return n?u.toLowerCase():u},a=this.string.substr(this.pos,e.length);if(r(a)==r(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)}},Ve.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ve.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Ve.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Ve.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function re(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var a=n.children[r],o=a.chunkSize();if(t<o){n=a;break}t-=o}return n.lines[t]}function br(e,t,n){var r=[],a=t.line;return e.iter(t.line,n.line+1,function(o){var u=o.text;a==n.line&&(u=u.slice(0,n.ch)),a==t.line&&(u=u.slice(t.ch)),r.push(u),++a}),r}function ui(e,t,n){var r=[];return e.iter(t,n,function(a){r.push(a.text)}),r}function Wt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function m(e){if(e.parent==null)return null;for(var t=e.parent,n=ye(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var a=0;r.children[a]!=t;++a)n+=r.children[a].chunkSize();return n+t.first}function S(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var a=e.children[r],o=a.height;if(t<o){e=a;continue e}t-=o,n+=a.chunkSize()}return n}while(!e.lines);for(var u=0;u<e.lines.length;++u){var h=e.lines[u],d=h.height;if(t<d)break;t-=d}return n+u}function W(e,t){return t>=e.first&&t<e.first+e.size}function j(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function R(e,t,n){if(n===void 0&&(n=null),!(this instanceof R))return new R(e,t,n);this.line=e,this.ch=t,this.sticky=n}function Z(e,t){return e.line-t.line||e.ch-t.ch}function Ae(e,t){return e.sticky==t.sticky&&Z(e,t)==0}function lt(e){return R(e.line,e.ch)}function Lt(e,t){return Z(e,t)<0?t:e}function _n(e,t){return Z(e,t)<0?e:t}function Dl(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.line<e.first)return R(e.first,0);var n=e.first+e.size-1;return t.line>n?R(n,re(e,n).text.length):lp(t,re(e,t.line).text.length)}function lp(e,t){var n=e.ch;return n==null||n>t?R(e.line,t):n<0?R(e.line,0):e}function Nl(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ge(e,t[r]);return n}var ia=function(e,t){this.state=e,this.lookAhead=t},hr=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};hr.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},hr.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},hr.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},hr.fromSaved=function(e,t,n){return t instanceof ia?new hr(e,cr(e.mode,t.state),n,t.lookAhead):new hr(e,cr(e.mode,t),n)},hr.prototype.save=function(e){var t=e!==!1?cr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ia(t,this.maxLookAhead):t};function Ml(e,t,n,r){var a=[e.state.modeGen],o={};Hl(e,t.text,e.doc.mode,n,function(v,x){return a.push(v,x)},o,r);for(var u=n.state,h=function(v){n.baseTokens=a;var x=e.state.overlays[v],C=1,O=0;n.state=!0,Hl(e,t.text,x.mode,n,function(E,z){for(var B=C;O<E;){var q=a[C];q>E&&a.splice(C,1,E,a[C+1],q),C+=2,O=Math.min(E,q)}if(z)if(x.opaque)a.splice(B,C-B,E,"overlay "+z),C=B+2;else for(;B<C;B+=2){var X=a[B+1];a[B+1]=(X?X+" ":"")+"overlay "+z}},o),n.state=u,n.baseTokens=null,n.baseTokenPos=1},d=0;d<e.state.overlays.length;++d)h(d);return{styles:a,classes:o.bgClass||o.textClass?o:null}}function Rl(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=fi(e,m(t)),a=t.text.length>e.options.maxHighlightLength&&cr(e.doc.mode,r.state),o=Ml(e,t,r);a&&(r.state=a),t.stateAfter=r.save(!a),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function fi(e,t,n){var r=e.doc,a=e.display;if(!r.mode.startState)return new hr(r,!0,t);var o=up(e,t,n),u=o>r.first&&re(r,o-1).stateAfter,h=u?hr.fromSaved(r,u,o):new hr(r,Ln(r.mode),o);return r.iter(o,t,function(d){hs(e,d.text,h);var v=h.line;d.stateAfter=v==t-1||v%5==0||v>=a.viewFrom&&v<a.viewTo?h.save():null,h.nextLine()}),n&&(r.modeFrontier=h.line),h}function hs(e,t,n,r){var a=e.doc.mode,o=new Ve(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&zl(a,n.state);!o.eol();)ds(a,o,n.state),o.start=o.pos}function zl(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=li(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function ds(e,t,n,r){for(var a=0;a<10;a++){r&&(r[0]=li(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var Pl=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function Fl(e,t,n,r){var a=e.doc,o=a.mode,u;t=ge(a,t);var h=re(a,t.line),d=fi(e,t.line,n),v=new Ve(h.text,e.options.tabSize,d),x;for(r&&(x=[]);(r||v.pos<t.ch)&&!v.eol();)v.start=v.pos,u=ds(o,v,d.state),r&&x.push(new Pl(v,u,cr(a.mode,d.state)));return r?x:new Pl(v,u,d.state)}function Wl(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function Hl(e,t,n,r,a,o,u){var h=n.flattenSpans;h==null&&(h=e.options.flattenSpans);var d=0,v=null,x=new Ve(t,e.options.tabSize,r),C,O=e.options.addModeClass&&[null];for(t==""&&Wl(zl(n,r.state),o);!x.eol();){if(x.pos>e.options.maxHighlightLength?(h=!1,u&&hs(e,t,r,x.pos),x.pos=t.length,C=null):C=Wl(ds(n,x,r.state,O),o),O){var E=O[0].name;E&&(C="m-"+(C?E+" "+C:E))}if(!h||v!=C){for(;d<x.start;)d=Math.min(x.start,d+5e3),a(d,v);v=C}x.start=x.pos}for(;d<x.pos;){var z=Math.min(x.pos,d+5e3);a(z,v),d=z}}function up(e,t,n){for(var r,a,o=e.doc,u=n?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>u;--h){if(h<=o.first)return o.first;var d=re(o,h-1),v=d.stateAfter;if(v&&(!n||h+(v instanceof ia?v.lookAhead:0)<=o.modeFrontier))return h;var x=Ce(d.text,null,e.options.tabSize);(a==null||r>x)&&(a=h-1,r=x)}return a}function fp(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var a=re(e,r).stateAfter;if(a&&(!(a instanceof ia)||r+a.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var $l=!1,wr=!1;function cp(){$l=!0}function hp(){wr=!0}function aa(e,t,n){this.marker=e,this.from=t,this.to=n}function ci(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function dp(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function pp(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function gp(e,t,n){var r;if(e)for(var a=0;a<e.length;++a){var o=e[a],u=o.marker,h=o.from==null||(u.inclusiveLeft?o.from<=t:o.from<t);if(h||o.from==t&&u.type=="bookmark"&&(!n||!o.marker.insertLeft)){var d=o.to==null||(u.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new aa(u,o.from,d?null:o.to))}}return r}function vp(e,t,n){var r;if(e)for(var a=0;a<e.length;++a){var o=e[a],u=o.marker,h=o.to==null||(u.inclusiveRight?o.to>=t:o.to>t);if(h||o.from==t&&u.type=="bookmark"&&(!n||o.marker.insertLeft)){var d=o.from==null||(u.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new aa(u,d?null:o.from-t,o.to==null?null:o.to-t))}}return r}function ps(e,t){if(t.full)return null;var n=W(e,t.from.line)&&re(e,t.from.line).markedSpans,r=W(e,t.to.line)&&re(e,t.to.line).markedSpans;if(!n&&!r)return null;var a=t.from.ch,o=t.to.ch,u=Z(t.from,t.to)==0,h=gp(n,a,u),d=vp(r,o,u),v=t.text.length==1,x=de(t.text).length+(v?a:0);if(h)for(var C=0;C<h.length;++C){var O=h[C];if(O.to==null){var E=ci(d,O.marker);E?v&&(O.to=E.to==null?null:E.to+x):O.to=a}}if(d)for(var z=0;z<d.length;++z){var B=d[z];if(B.to!=null&&(B.to+=x),B.from==null){var q=ci(h,B.marker);q||(B.from=x,v&&(h||(h=[])).push(B))}else B.from+=x,v&&(h||(h=[])).push(B)}h&&(h=Bl(h)),d&&d!=h&&(d=Bl(d));var X=[h];if(!v){var Q=t.text.length-2,Y;if(Q>0&&h)for(var ee=0;ee<h.length;++ee)h[ee].to==null&&(Y||(Y=[])).push(new aa(h[ee].marker,null,null));for(var le=0;le<Q;++le)X.push(Y);X.push(d)}return X}function Bl(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function mp(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(E){if(E.markedSpans)for(var z=0;z<E.markedSpans.length;++z){var B=E.markedSpans[z].marker;B.readOnly&&(!r||ye(r,B)==-1)&&(r||(r=[])).push(B)}}),!r)return null;for(var a=[{from:t,to:n}],o=0;o<r.length;++o)for(var u=r[o],h=u.find(0),d=0;d<a.length;++d){var v=a[d];if(!(Z(v.to,h.from)<0||Z(v.from,h.to)>0)){var x=[d,1],C=Z(v.from,h.from),O=Z(v.to,h.to);(C<0||!u.inclusiveLeft&&!C)&&x.push({from:v.from,to:h.from}),(O>0||!u.inclusiveRight&&!O)&&x.push({from:h.to,to:v.to}),a.splice.apply(a,x),d+=x.length-3}}return a}function Ul(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function jl(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function sa(e){return e.inclusiveLeft?-1:0}function oa(e){return e.inclusiveRight?1:0}function gs(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),a=t.find(),o=Z(r.from,a.from)||sa(e)-sa(t);if(o)return-o;var u=Z(r.to,a.to)||oa(e)-oa(t);return u||t.id-e.id}function ql(e,t){var n=wr&&e.markedSpans,r;if(n)for(var a=void 0,o=0;o<n.length;++o)a=n[o],a.marker.collapsed&&(t?a.from:a.to)==null&&(!r||gs(r,a.marker)<0)&&(r=a.marker);return r}function Kl(e){return ql(e,!0)}function la(e){return ql(e,!1)}function yp(e,t){var n=wr&&e.markedSpans,r;if(n)for(var a=0;a<n.length;++a){var o=n[a];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||gs(r,o.marker)<0)&&(r=o.marker)}return r}function Gl(e,t,n,r,a){var o=re(e,t),u=wr&&o.markedSpans;if(u)for(var h=0;h<u.length;++h){var d=u[h];if(d.marker.collapsed){var v=d.marker.find(0),x=Z(v.from,n)||sa(d.marker)-sa(a),C=Z(v.to,r)||oa(d.marker)-oa(a);if(!(x>=0&&C<=0||x<=0&&C>=0)&&(x<=0&&(d.marker.inclusiveRight&&a.inclusiveLeft?Z(v.to,n)>=0:Z(v.to,n)>0)||x>=0&&(d.marker.inclusiveRight&&a.inclusiveLeft?Z(v.from,r)<=0:Z(v.from,r)<0)))return!0}}}function ar(e){for(var t;t=Kl(e);)e=t.find(-1,!0).line;return e}function bp(e){for(var t;t=la(e);)e=t.find(1,!0).line;return e}function wp(e){for(var t,n;t=la(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function vs(e,t){var n=re(e,t),r=ar(n);return n==r?t:m(r)}function Xl(e,t){if(t>e.lastLine())return t;var n=re(e,t),r;if(!Nr(e,n))return t;for(;r=la(n);)n=r.find(1,!0).line;return m(n)+1}function Nr(e,t){var n=wr&&t.markedSpans;if(n){for(var r=void 0,a=0;a<n.length;++a)if(r=n[a],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&ms(e,t,r))return!0}}}function ms(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return ms(e,r.line,ci(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var a=void 0,o=0;o<t.markedSpans.length;++o)if(a=t.markedSpans[o],a.marker.collapsed&&!a.marker.widgetNode&&a.from==n.to&&(a.to==null||a.to!=n.from)&&(a.marker.inclusiveLeft||n.marker.inclusiveRight)&&ms(e,t,a))return!0}function xr(e){e=ar(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var a=n.lines[r];if(a==e)break;t+=a.height}for(var o=n.parent;o;n=o,o=n.parent)for(var u=0;u<o.children.length;++u){var h=o.children[u];if(h==n)break;t+=h.height}return t}function ua(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Kl(r);){var a=n.find(0,!0);r=a.from.line,t+=a.from.ch-a.to.ch}for(r=e;n=la(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function ys(e){var t=e.display,n=e.doc;t.maxLine=re(n,n.first),t.maxLineLength=ua(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var a=ua(r);a>t.maxLineLength&&(t.maxLineLength=a,t.maxLine=r)})}var En=function(e,t,n){this.text=e,jl(this,t),this.height=n?n(this):1};En.prototype.lineNo=function(){return m(this)},er(En);function xp(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ul(e),jl(e,n);var a=r?r(e):1;a!=e.height&&Wt(e,a)}function kp(e){e.parent=null,Ul(e)}var Sp={},Cp={};function Yl(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Cp:Sp;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Vl(e,t){var n=rt("span",null,null,k?"padding-right: .1px":null),r={pre:rt("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var o=a?t.rest[a-1]:t.line,u=void 0;r.pos=0,r.addToken=Lp,Ar(e.display.measure)&&(u=Le(o,e.doc.direction))&&(r.addToken=Ep(r.addToken,u)),r.map=[];var h=t!=e.display.externalMeasured&&m(o);Op(o,r,Rl(e,o,h)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=se(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=se(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ra(e.display.measure))),a==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(k){var d=r.content.lastChild;(/\bcm-tab\b/.test(d.className)||d.querySelector&&d.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Xe(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=se(r.pre.className,r.textClass||"")),r}function Tp(e){var t=T("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Lp(e,t,n,r,a,o,u){if(t){var h=e.splitSpaces?_p(t,e.trailingSpace):t,d=e.cm.state.specialChars,v=!1,x;if(!d.test(t))e.col+=t.length,x=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,x),b&&y<9&&(v=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var C=0;;){d.lastIndex=C;var O=d.exec(t),E=O?O.index-C:t.length-C;if(E){var z=document.createTextNode(h.slice(C,C+E));b&&y<9?x.appendChild(T("span",[z])):x.appendChild(z),e.map.push(e.pos,e.pos+E,z),e.col+=E,e.pos+=E}if(!O)break;C+=E+1;var B=void 0;if(O[0]==" "){var q=e.cm.options.tabSize,X=q-e.col%q;B=x.appendChild(T("span",Lr(X),"cm-tab")),B.setAttribute("role","presentation"),B.setAttribute("cm-text"," "),e.col+=X}else O[0]=="\r"||O[0]==`
|
|
5
|
-
`?(B=x.appendChild(T("span",O[0]=="\r"?"␍":"","cm-invalidchar")),B.setAttribute("cm-text",O[0]),e.col+=1):(B=e.cm.options.specialCharPlaceholder(O[0]),B.setAttribute("cm-text",O[0]),b&&y<9?x.appendChild(T("span",[B])):x.appendChild(B),e.col+=1);e.map.push(e.pos,e.pos+1,B),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,n||r||a||v||o||u){var Q=n||"";r&&(Q+=r),a&&(Q+=a);var Y=T("span",[x],Q,o);if(u)for(var ee in u)u.hasOwnProperty(ee)&&ee!="style"&&ee!="class"&&Y.setAttribute(ee,u[ee]);return e.content.appendChild(Y)}e.content.appendChild(x)}}function _p(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",a=0;a<e.length;a++){var o=e.charAt(a);o==" "&&n&&(a==e.length-1||e.charCodeAt(a+1)==32)&&(o=" "),r+=o,n=o==" "}return r}function Ep(e,t){return function(n,r,a,o,u,h,d){a=a?a+" cm-force-border":"cm-force-border";for(var v=n.pos,x=v+r.length;;){for(var C=void 0,O=0;O<t.length&&(C=t[O],!(C.to>v&&C.from<=v));O++);if(C.to>=x)return e(n,r,a,o,u,h,d);e(n,r.slice(0,C.to-v),a,o,null,h,d),o=null,r=r.slice(C.to-v),v=C.to}}}function Zl(e,t,n,r){var a=!r&&n.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!r&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",n.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function Op(e,t,n){var r=e.markedSpans,a=e.text,o=0;if(!r){for(var u=1;u<n.length;u+=2)t.addToken(t,a.slice(o,o=n[u]),Yl(n[u+1],t.cm.options));return}for(var h=a.length,d=0,v=1,x="",C,O,E=0,z,B,q,X,Q;;){if(E==d){z=B=q=O="",Q=null,X=null,E=1/0;for(var Y=[],ee=void 0,le=0;le<r.length;++le){var ae=r[le],xe=ae.marker;if(xe.type=="bookmark"&&ae.from==d&&xe.widgetNode)Y.push(xe);else if(ae.from<=d&&(ae.to==null||ae.to>d||xe.collapsed&&ae.to==d&&ae.from==d)){if(ae.to!=null&&ae.to!=d&&E>ae.to&&(E=ae.to,B=""),xe.className&&(z+=" "+xe.className),xe.css&&(O=(O?O+";":"")+xe.css),xe.startStyle&&ae.from==d&&(q+=" "+xe.startStyle),xe.endStyle&&ae.to==E&&(ee||(ee=[])).push(xe.endStyle,ae.to),xe.title&&((Q||(Q={})).title=xe.title),xe.attributes)for(var We in xe.attributes)(Q||(Q={}))[We]=xe.attributes[We];xe.collapsed&&(!X||gs(X.marker,xe)<0)&&(X=ae)}else ae.from>d&&E>ae.from&&(E=ae.from)}if(ee)for(var ht=0;ht<ee.length;ht+=2)ee[ht+1]==E&&(B+=" "+ee[ht]);if(!X||X.from==d)for(var Ke=0;Ke<Y.length;++Ke)Zl(t,0,Y[Ke]);if(X&&(X.from||0)==d){if(Zl(t,(X.to==null?h+1:X.to)-d,X.marker,X.from==null),X.to==null)return;X.to==d&&(X=!1)}}if(d>=h)break;for(var Rt=Math.min(h,E);;){if(x){var Ot=d+x.length;if(!X){var it=Ot>Rt?x.slice(0,Rt-d):x;t.addToken(t,it,C?C+z:z,q,d+it.length==E?B:"",O,Q)}if(Ot>=Rt){x=x.slice(Rt-d),d=Rt;break}d=Ot,q=""}x=a.slice(o,o=n[v++]),C=Yl(n[v++],t.cm.options)}}}function Ql(e,t,n){this.line=t,this.rest=wp(t),this.size=this.rest?m(de(this.rest))-n+1:1,this.node=this.text=null,this.hidden=Nr(e,t)}function fa(e,t,n){for(var r=[],a,o=t;o<n;o=a){var u=new Ql(e.doc,re(e.doc,o),o);a=o+u.size,r.push(u)}return r}var On=null;function Ap(e){On?On.ops.push(e):e.ownsGroup=On={ops:[e],delayedCallbacks:[]}}function Ip(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 a=e.ops[r];if(a.cursorActivityHandlers)for(;a.cursorActivityCalled<a.cursorActivityHandlers.length;)a.cursorActivityHandlers[a.cursorActivityCalled++].call(null,a.cm)}}while(n<t.length)}function Dp(e,t){var n=e.ownsGroup;if(n)try{Ip(n)}finally{On=null,t(n)}}var hi=null;function ut(e,t){var n=yr(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),a;On?a=On.delayedCallbacks:hi?a=hi:(a=hi=[],setTimeout(Np,0));for(var o=function(h){a.push(function(){return n[h].apply(null,r)})},u=0;u<n.length;++u)o(u)}}function Np(){var e=hi;hi=null;for(var t=0;t<e.length;++t)e[t]()}function Jl(e,t,n,r){for(var a=0;a<t.changes.length;a++){var o=t.changes[a];o=="text"?Rp(e,t):o=="gutter"?tu(e,t,n,r):o=="class"?bs(e,t):o=="widget"&&zp(e,t,r)}t.changes=null}function di(e){return e.node==e.text&&(e.node=T("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),b&&y<8&&(e.node.style.zIndex=2)),e.node}function Mp(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=di(t);t.background=r.insertBefore(T("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function eu(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Vl(e,t)}function Rp(e,t){var n=t.text.className,r=eu(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,bs(e,t)):n&&(t.text.className=n)}function bs(e,t){Mp(e,t),t.line.wrapClass?di(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function tu(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var a=di(t);t.gutterBackground=T("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),a.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var u=di(t),h=t.gutter=T("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),u.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(T("div",j(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var d=0;d<e.display.gutterSpecs.length;++d){var v=e.display.gutterSpecs[d].className,x=o.hasOwnProperty(v)&&o[v];x&&h.appendChild(T("div",[x],"CodeMirror-gutter-elt","left: "+r.gutterLeft[v]+"px; width: "+r.gutterWidth[v]+"px"))}}}function zp(e,t,n){t.alignable&&(t.alignable=null);for(var r=Oe("CodeMirror-linewidget"),a=t.node.firstChild,o=void 0;a;a=o)o=a.nextSibling,r.test(a.className)&&t.node.removeChild(a);ru(e,t,n)}function Pp(e,t,n,r){var a=eu(e,t);return t.text=t.node=a.pre,a.bgClass&&(t.bgClass=a.bgClass),a.textClass&&(t.textClass=a.textClass),bs(e,t),tu(e,t,n,r),ru(e,t,r),t.node}function ru(e,t,n){if(nu(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)nu(e,t.rest[r],t,n,!1)}function nu(e,t,n,r,a){if(t.widgets)for(var o=di(n),u=0,h=t.widgets;u<h.length;++u){var d=h[u],v=T("div",[d.node],"CodeMirror-linewidget"+(d.className?" "+d.className:""));d.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),Fp(d,v,n,r),e.display.input.setUneditable(v),a&&d.above?o.insertBefore(v,n.gutter||n.text):o.appendChild(v),ut(d,"redraw")}}function Fp(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var a=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(a-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=a+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function pi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!I(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),V(t.display.measure,T("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function kr(e,t){for(var n=si(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function ca(e){return e.lineSpace.offsetTop}function ws(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function iu(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=V(e.measure,T("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function dr(e){return pt-e.display.nativeBarWidth}function Vr(e){return e.display.scroller.clientWidth-dr(e)-e.display.barWidth}function xs(e){return e.display.scroller.clientHeight-dr(e)-e.display.barHeight}function Wp(e,t,n){var r=e.options.lineWrapping,a=r&&Vr(e);if(!t.measure.heights||r&&t.measure.width!=a){var o=t.measure.heights=[];if(r){t.measure.width=a;for(var u=t.text.firstChild.getClientRects(),h=0;h<u.length-1;h++){var d=u[h],v=u[h+1];Math.abs(d.bottom-v.bottom)>2&&o.push((d.bottom+v.top)/2-n.top)}}o.push(n.bottom-n.top)}}function au(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var a=0;a<e.rest.length;a++)if(m(e.rest[a])>n)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}}function Hp(e,t){t=ar(t);var n=m(t),r=e.display.externalMeasured=new Ql(e.doc,t,n);r.lineN=n;var a=r.built=Vl(e,r);return r.text=a.pre,V(e.display.lineMeasure,a.pre),r}function su(e,t,n,r){return pr(e,An(e,t),n,r)}function ks(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Jr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function An(e,t){var n=m(t),r=ks(e,n);r&&!r.text?r=null:r&&r.changes&&(Jl(e,r,n,_s(e)),e.curOp.forceUpdate=!0),r||(r=Hp(e,t));var a=au(r,t,n);return{line:t,view:r,rect:null,map:a.map,cache:a.cache,before:a.before,hasHeights:!1}}function pr(e,t,n,r,a){t.before&&(n=-1);var o=n+(r||""),u;return t.cache.hasOwnProperty(o)?u=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Wp(e,t.view,t.rect),t.hasHeights=!0),u=Bp(e,t,n,r),u.bogus||(t.cache[o]=u)),{left:u.left,right:u.right,top:a?u.rtop:u.top,bottom:a?u.rbottom:u.bottom}}var ou={left:0,right:0,top:0,bottom:0};function lu(e,t,n){for(var r,a,o,u,h,d,v=0;v<e.length;v+=3)if(h=e[v],d=e[v+1],t<h?(a=0,o=1,u="left"):t<d?(a=t-h,o=a+1):(v==e.length-3||t==d&&e[v+3]>t)&&(o=d-h,a=o-1,t>=d&&(u="right")),a!=null){if(r=e[v+2],h==d&&n==(r.insertLeft?"left":"right")&&(u=n),n=="left"&&a==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)r=e[(v-=3)+2],u="left";if(n=="right"&&a==d-h)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)r=e[(v+=3)+2],u="right";break}return{node:r,start:a,end:o,collapse:u,coverStart:h,coverEnd:d}}function $p(e,t){var n=ou;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var a=e.length-1;a>=0&&(n=e[a]).left==n.right;a--);return n}function Bp(e,t,n,r){var a=lu(t.map,n,r),o=a.node,u=a.start,h=a.end,d=a.collapse,v;if(o.nodeType==3){for(var x=0;x<4;x++){for(;u&&we(t.line.text.charAt(a.coverStart+u));)--u;for(;a.coverStart+h<a.coverEnd&&we(t.line.text.charAt(a.coverStart+h));)++h;if(b&&y<9&&u==0&&h==a.coverEnd-a.coverStart?v=o.parentNode.getBoundingClientRect():v=$p(st(o,u,h).getClientRects(),r),v.left||v.right||u==0)break;h=u,u=u-1,d="right"}b&&y<11&&(v=Up(e.display.measure,v))}else{u>0&&(d=r="right");var C;e.options.lineWrapping&&(C=o.getClientRects()).length>1?v=C[r=="right"?C.length-1:0]:v=o.getBoundingClientRect()}if(b&&y<9&&!u&&(!v||!v.left&&!v.right)){var O=o.parentNode.getClientRects()[0];O?v={left:O.left,right:O.left+Dn(e.display),top:O.top,bottom:O.bottom}:v=ou}for(var E=v.top-t.rect.top,z=v.bottom-t.rect.top,B=(E+z)/2,q=t.view.measure.heights,X=0;X<q.length-1&&!(B<q[X]);X++);var Q=X?q[X-1]:0,Y=q[X],ee={left:(d=="right"?v.right:v.left)-t.rect.left,right:(d=="left"?v.left:v.right)-t.rect.left,top:Q,bottom:Y};return!v.left&&!v.right&&(ee.bogus=!0),e.options.singleCursorHeightPerLine||(ee.rtop=E,ee.rbottom=z),ee}function Up(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!cs(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function uu(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function fu(e){e.display.externalMeasure=null,$(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)uu(e.display.view[t])}function gi(e){fu(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function cu(e){return L&&P?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function hu(e){return L&&P?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Ss(e){var t=ar(e),n=t.widgets,r=0;if(n)for(var a=0;a<n.length;++a)n[a].above&&(r+=pi(n[a]));return r}function ha(e,t,n,r,a){if(!a){var o=Ss(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var u=xr(t);if(r=="local"?u+=ca(e.display):u-=e.display.viewOffset,r=="page"||r=="window"){var h=e.display.lineSpace.getBoundingClientRect();u+=h.top+(r=="window"?0:hu(ze(e)));var d=h.left+(r=="window"?0:cu(ze(e)));n.left+=d,n.right+=d}return n.top+=u,n.bottom+=u,n}function du(e,t,n){if(n=="div")return t;var r=t.left,a=t.top;if(n=="page")r-=cu(ze(e)),a-=hu(ze(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,a+=o.top}var u=e.display.lineSpace.getBoundingClientRect();return{left:r-u.left,top:a-u.top}}function da(e,t,n,r,a){return r||(r=re(e.doc,t.line)),ha(e,r,su(e,r,t.ch,a),n)}function sr(e,t,n,r,a,o){r=r||re(e.doc,t.line),a||(a=An(e,r));function u(z,B){var q=pr(e,a,z,B?"right":"left",o);return B?q.left=q.right:q.right=q.left,ha(e,r,q,n)}var h=Le(r,e.doc.direction),d=t.ch,v=t.sticky;if(d>=r.text.length?(d=r.text.length,v="before"):d<=0&&(d=0,v="after"),!h)return u(v=="before"?d-1:d,v=="before");function x(z,B,q){var X=h[B],Q=X.level==1;return u(q?z-1:z,Q!=q)}var C=Er(h,d,v),O=Xr,E=x(d,C,v=="before");return O!=null&&(E.other=x(d,O,v!="before")),E}function pu(e,t){var n=0;t=ge(e.doc,t),e.options.lineWrapping||(n=Dn(e.display)*t.ch);var r=re(e.doc,t.line),a=xr(r)+ca(e.display);return{left:n,right:n,top:a,bottom:a+r.height}}function Cs(e,t,n,r,a){var o=R(e,t,n);return o.xRel=a,r&&(o.outside=r),o}function Ts(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Cs(r.first,0,null,-1,-1);var a=S(r,n),o=r.first+r.size-1;if(a>o)return Cs(r.first+r.size-1,re(r,o).text.length,null,1,1);t<0&&(t=0);for(var u=re(r,a);;){var h=jp(e,u,a,t,n),d=yp(u,h.ch+(h.xRel>0||h.outside>0?1:0));if(!d)return h;var v=d.find(1);if(v.line==a)return v;u=re(r,a=v.line)}}function gu(e,t,n,r){r-=Ss(t);var a=t.text.length,o=Gt(function(u){return pr(e,n,u-1).bottom<=r},a,0);return a=Gt(function(u){return pr(e,n,u).top>r},o,a),{begin:o,end:a}}function vu(e,t,n,r){n||(n=An(e,t));var a=ha(e,t,pr(e,n,r),"line").top;return gu(e,t,n,a)}function Ls(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function jp(e,t,n,r,a){a-=xr(t);var o=An(e,t),u=Ss(t),h=0,d=t.text.length,v=!0,x=Le(t,e.doc.direction);if(x){var C=(e.options.lineWrapping?Kp:qp)(e,t,n,o,x,r,a);v=C.level!=1,h=v?C.from:C.to-1,d=v?C.to:C.from-1}var O=null,E=null,z=Gt(function(le){var ae=pr(e,o,le);return ae.top+=u,ae.bottom+=u,Ls(ae,r,a,!1)?(ae.top<=a&&ae.left<=r&&(O=le,E=ae),!0):!1},h,d),B,q,X=!1;if(E){var Q=r-E.left<E.right-r,Y=Q==v;z=O+(Y?0:1),q=Y?"after":"before",B=Q?E.left:E.right}else{!v&&(z==d||z==h)&&z++,q=z==0?"after":z==t.text.length?"before":pr(e,o,z-(v?1:0)).bottom+u<=a==v?"after":"before";var ee=sr(e,R(n,z,q),"line",t,o);B=ee.left,X=a<ee.top?-1:a>=ee.bottom?1:0}return z=Dt(t.text,z,1),Cs(n,z,q,X,r-B)}function qp(e,t,n,r,a,o,u){var h=Gt(function(C){var O=a[C],E=O.level!=1;return Ls(sr(e,R(n,E?O.to:O.from,E?"before":"after"),"line",t,r),o,u,!0)},0,a.length-1),d=a[h];if(h>0){var v=d.level!=1,x=sr(e,R(n,v?d.from:d.to,v?"after":"before"),"line",t,r);Ls(x,o,u,!0)&&x.top>u&&(d=a[h-1])}return d}function Kp(e,t,n,r,a,o,u){var h=gu(e,t,r,u),d=h.begin,v=h.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var x=null,C=null,O=0;O<a.length;O++){var E=a[O];if(!(E.from>=v||E.to<=d)){var z=E.level!=1,B=pr(e,r,z?Math.min(v,E.to)-1:Math.max(d,E.from)).right,q=B<o?o-B+1e9:B-o;(!x||C>q)&&(x=E,C=q)}}return x||(x=a[a.length-1]),x.from<d&&(x={from:d,to:x.to,level:x.level}),x.to>v&&(x={from:x.from,to:v,level:x.level}),x}var Zr;function In(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Zr==null){Zr=T("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Zr.appendChild(document.createTextNode("x")),Zr.appendChild(T("br"));Zr.appendChild(document.createTextNode("x"))}V(e.measure,Zr);var n=Zr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),$(e.measure),n||1}function Dn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=T("span","xxxxxxxxxx"),n=T("pre",[t],"CodeMirror-line-like");V(e.measure,n);var r=t.getBoundingClientRect(),a=(r.right-r.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function _s(e){for(var t=e.display,n={},r={},a=t.gutters.clientLeft,o=t.gutters.firstChild,u=0;o;o=o.nextSibling,++u){var h=e.display.gutterSpecs[u].className;n[h]=o.offsetLeft+o.clientLeft+a,r[h]=o.clientWidth}return{fixedPos:Es(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Es(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function mu(e){var t=In(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Dn(e.display)-3);return function(a){if(Nr(e.doc,a))return 0;var o=0;if(a.widgets)for(var u=0;u<a.widgets.length;u++)a.widgets[u].height&&(o+=a.widgets[u].height);return n?o+(Math.ceil(a.text.length/r)||1)*t:o+t}}function Os(e){var t=e.doc,n=mu(e);t.iter(function(r){var a=n(r);a!=r.height&&Wt(r,a)})}function Qr(e,t,n,r){var a=e.display;if(!n&&si(t).getAttribute("cm-not-content")=="true")return null;var o,u,h=a.lineSpace.getBoundingClientRect();try{o=t.clientX-h.left,u=t.clientY-h.top}catch{return null}var d=Ts(e,o,u),v;if(r&&d.xRel>0&&(v=re(e.doc,d.line).text).length==d.ch){var x=Ce(v,v.length,e.options.tabSize)-v.length;d=R(d.line,Math.max(0,Math.round((o-iu(e.display).left)/Dn(e.display))-x))}return d}function Jr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function _t(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var a=e.display;if(r&&n<a.viewTo&&(a.updateLineNumbers==null||a.updateLineNumbers>t)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)wr&&vs(e.doc,t)<a.viewTo&&Rr(e);else if(n<=a.viewFrom)wr&&Xl(e.doc,n+r)>a.viewFrom?Rr(e):(a.viewFrom+=r,a.viewTo+=r);else if(t<=a.viewFrom&&n>=a.viewTo)Rr(e);else if(t<=a.viewFrom){var o=pa(e,n,n+r,1);o?(a.view=a.view.slice(o.index),a.viewFrom=o.lineN,a.viewTo+=r):Rr(e)}else if(n>=a.viewTo){var u=pa(e,t,t,-1);u?(a.view=a.view.slice(0,u.index),a.viewTo=u.lineN):Rr(e)}else{var h=pa(e,t,t,-1),d=pa(e,n,n+r,1);h&&d?(a.view=a.view.slice(0,h.index).concat(fa(e,h.lineN,d.lineN)).concat(a.view.slice(d.index)),a.viewTo+=r):Rr(e)}var v=a.externalMeasured;v&&(n<v.lineN?v.lineN+=r:t<v.lineN+v.size&&(a.externalMeasured=null))}function Mr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,a=e.display.externalMeasured;if(a&&t>=a.lineN&&t<a.lineN+a.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Jr(e,t)];if(o.node!=null){var u=o.changes||(o.changes=[]);ye(u,n)==-1&&u.push(n)}}}function Rr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function pa(e,t,n,r){var a=Jr(e,t),o,u=e.display.view;if(!wr||n==e.doc.first+e.doc.size)return{index:a,lineN:n};for(var h=e.display.viewFrom,d=0;d<a;d++)h+=u[d].size;if(h!=t){if(r>0){if(a==u.length-1)return null;o=h+u[a].size-t,a++}else o=h-t;t+=o,n+=o}for(;vs(e.doc,n)!=n;){if(a==(r<0?0:u.length-1))return null;n+=r*u[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:n}}function Gp(e,t,n){var r=e.display,a=r.view;a.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=fa(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=fa(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Jr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(fa(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Jr(e,n)))),r.viewTo=n}function yu(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var a=t[r];!a.hidden&&(!a.node||a.changes)&&++n}return n}function vi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function bu(e,t){t===void 0&&(t=!0);var n=e.doc,r={},a=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),u=e.options.$customCursor;u&&(t=!0);for(var h=0;h<n.sel.ranges.length;h++)if(!(!t&&h==n.sel.primIndex)){var d=n.sel.ranges[h];if(!(d.from().line>=e.display.viewTo||d.to().line<e.display.viewFrom)){var v=d.empty();if(u){var x=u(e,d);x&&As(e,x,a)}else(v||e.options.showCursorWhenSelecting)&&As(e,d.head,a);v||Xp(e,d,o)}}return r}function As(e,t,n){var r=sr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),a=n.appendChild(T("div"," ","CodeMirror-cursor"));if(a.style.left=r.left+"px",a.style.top=r.top+"px",a.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=da(e,t,"div",null,null),u=o.right-o.left;a.style.width=(u>0?u:e.defaultCharWidth())+"px"}if(r.other){var h=n.appendChild(T("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=r.other.left+"px",h.style.top=r.other.top+"px",h.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function ga(e,t){return e.top-t.top||e.left-t.left}function Xp(e,t,n){var r=e.display,a=e.doc,o=document.createDocumentFragment(),u=iu(e.display),h=u.left,d=Math.max(r.sizerWidth,Vr(e)-r.sizer.offsetLeft)-u.right,v=a.direction=="ltr";function x(Y,ee,le,ae){ee<0&&(ee=0),ee=Math.round(ee),ae=Math.round(ae),o.appendChild(T("div",null,"CodeMirror-selected","position: absolute; left: "+Y+`px;
|
|
6
|
-
top: `+
|
|
7
|
-
height: `+(
|
|
8
|
-
top: `+(t.top-
|
|
9
|
-
height: `+(t.bottom-t.top+
|
|
10
|
-
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(u),u.scrollIntoView(a),e.display.lineSpace.removeChild(u)}}}function Vp(e,t,n,r){r==null&&(r=0);var a;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?R(t.line,t.ch+1,"before"):t,t=t.ch?R(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var u=!1,h=sr(e,t),d=!n||n==t?h:sr(e,n);a={left:Math.min(h.left,d.left),top:Math.min(h.top,d.top)-r,right:Math.max(h.left,d.left),bottom:Math.max(h.bottom,d.bottom)+r};var v=Ms(e,a),x=e.doc.scrollTop,C=e.doc.scrollLeft;if(v.scrollTop!=null&&(yi(e,v.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(u=!0)),v.scrollLeft!=null&&(en(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-C)>1&&(u=!0)),!u)break}return a}function Zp(e,t){var n=Ms(e,t);n.scrollTop!=null&&yi(e,n.scrollTop),n.scrollLeft!=null&&en(e,n.scrollLeft)}function Ms(e,t){var n=e.display,r=In(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=xs(e),u={};t.bottom-t.top>o&&(t.bottom=t.top+o);var h=e.doc.height+ws(n),d=t.top<r,v=t.bottom>h-r;if(t.top<a)u.scrollTop=d?0:t.top;else if(t.bottom>a+o){var x=Math.min(t.top,(v?h:t.bottom)-o);x!=a&&(u.scrollTop=x)}var C=e.options.fixedGutter?0:n.gutters.offsetWidth,O=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-C,E=Vr(e)-n.gutters.offsetWidth,z=t.right-t.left>E;return z&&(t.right=t.left+E),t.left<10?u.scrollLeft=0:t.left<O?u.scrollLeft=Math.max(0,t.left+C-(z?0:10)):t.right>E+O-3&&(u.scrollLeft=t.right+(z?0:10)-E),u}function Rs(e,t){t!=null&&(ya(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Mn(e){ya(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function mi(e,t,n){(t!=null||n!=null)&&ya(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Qp(e,t){ya(e),e.curOp.scrollToPos=t}function ya(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=pu(e,t.from),r=pu(e,t.to);ku(e,n,r,t.margin)}}function ku(e,t,n,r){var a=Ms(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});mi(e,a.scrollLeft,a.scrollTop)}function yi(e,t){Math.abs(e.doc.scrollTop-t)<2||(c||Ps(e,{top:t}),Su(e,t,!0),c&&Ps(e),xi(e,100))}function Su(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 en(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,Eu(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function bi(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ws(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+dr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var tn=function(e,t,n){this.cm=n;var r=this.vert=T("div",[T("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=T("div",[T("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=a.tabIndex=-1,e(r),e(a),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,b&&y<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};tn.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 a=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},tn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},tn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},tn.prototype.zeroWidthHack=function(){var e=J&&!M?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new jt,this.disableVert=new jt},tn.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var a=e.getBoundingClientRect(),o=n=="vert"?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},tn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var wi=function(){};wi.prototype.update=function(){return{bottom:0,right:0}},wi.prototype.setScrollLeft=function(){},wi.prototype.setScrollTop=function(){},wi.prototype.clear=function(){};function Rn(e,t){t||(t=bi(e));var n=e.display.barWidth,r=e.display.barHeight;Cu(e,t);for(var a=0;a<4&&n!=e.display.barWidth||r!=e.display.barHeight;a++)n!=e.display.barWidth&&e.options.lineWrapping&&va(e),Cu(e,bi(e)),n=e.display.barWidth,r=e.display.barHeight}function Cu(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Tu={native:tn,null:wi};function Lu(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Re(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Tu[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?en(e,t):yi(e,t)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var Jp=0;function rn(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Jp,markArrays:null},Ap(e.curOp)}function nn(e){var t=e.curOp;t&&Dp(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;eg(n)})}function eg(e){for(var t=e.ops,n=0;n<t.length;n++)tg(t[n]);for(var r=0;r<t.length;r++)rg(t[r]);for(var a=0;a<t.length;a++)ng(t[a]);for(var o=0;o<t.length;o++)ig(t[o]);for(var u=0;u<t.length;u++)ag(t[u])}function tg(e){var t=e.cm,n=t.display;og(t),e.updateMaxLine&&ys(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ba(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function rg(e){e.updatedDisplay=e.mustUpdate&&zs(e.cm,e.update)}function ng(e){var t=e.cm,n=t.display;e.updatedDisplay&&va(t),e.barMeasure=bi(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=su(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+dr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Vr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function ig(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&en(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==N(wt(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Rn(t,e.barMeasure),e.updatedDisplay&&Ws(t,e.barMeasure),e.selectionChanged&&Is(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&wu(e.cm)}function ag(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&_u(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Su(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&en(t,e.scrollLeft,!0,!0),e.scrollToPos){var a=Vp(t,ge(r,e.scrollToPos.from),ge(r,e.scrollToPos.to),e.scrollToPos.margin);Yp(t,a)}var o=e.maybeHiddenMarkers,u=e.maybeUnhiddenMarkers;if(o)for(var h=0;h<o.length;++h)o[h].lines.length||Xe(o[h],"hide");if(u)for(var d=0;d<u.length;++d)u[d].lines.length&&Xe(u[d],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Xe(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Mt(e,t){if(e.curOp)return t();rn(e);try{return t()}finally{nn(e)}}function ft(e,t){return function(){if(e.curOp)return t.apply(e,arguments);rn(e);try{return t.apply(e,arguments)}finally{nn(e)}}}function xt(e){return function(){if(this.curOp)return e.apply(this,arguments);rn(this);try{return e.apply(this,arguments)}finally{nn(this)}}}function ct(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);rn(t);try{return e.apply(this,arguments)}finally{nn(t)}}}function xi(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,he(sg,e))}function sg(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fi(e,t.highlightFrontier),a=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var u=o.styles,h=o.text.length>e.options.maxHighlightLength?cr(t.mode,r.state):null,d=Ml(e,o,r,!0);h&&(r.state=h),o.styles=d.styles;var v=o.styleClasses,x=d.classes;x?o.styleClasses=x:v&&(o.styleClasses=null);for(var C=!u||u.length!=o.styles.length||v!=x&&(!v||!x||v.bgClass!=x.bgClass||v.textClass!=x.textClass),O=0;!C&&O<u.length;++O)C=u[O]!=o.styles[O];C&&a.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&hs(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return xi(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),a.length&&Mt(e,function(){for(var o=0;o<a.length;o++)Mr(e,a[o],"text")})}}var ba=function(e,t,n){var r=e.display;this.viewport=t,this.visible=ma(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Vr(e),this.force=n,this.dims=_s(e),this.events=[]};ba.prototype.signal=function(e,t){Nt(e,t)&&this.events.push(arguments)},ba.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Xe.apply(null,this.events[e])};function og(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=dr(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=dr(e)+"px",t.scrollbarsClipped=!0)}function lg(e){if(e.hasFocus())return null;var t=N(wt(e));if(!t||!I(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=pe(e).getSelection();r.anchorNode&&r.extend&&I(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function ug(e){if(!(!e||!e.activeElt||e.activeElt==N(nt(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&I(document.body,e.anchorNode)&&I(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function zs(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return Rr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&yu(e)==0)return!1;Ou(e)&&(Rr(e),t.dims=_s(e));var a=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),u=Math.min(a,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>u&&n.viewTo-u<20&&(u=Math.min(a,n.viewTo)),wr&&(o=vs(e.doc,o),u=Xl(e.doc,u));var h=o!=n.viewFrom||u!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Gp(e,o,u),n.viewOffset=xr(re(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var d=yu(e);if(!h&&d==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var v=lg(e);return d>4&&(n.lineDiv.style.display="none"),fg(e,n.updateLineNumbers,t.dims),d>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,ug(v),$(n.cursorDiv),$(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,h&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,xi(e,400)),n.updateLineNumbers=null,!0}function _u(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Vr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ws(e.display)-xs(e),n.top)}),t.visible=ma(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ma(e.display,e.doc,n));if(!zs(e,t))break;va(e);var a=bi(e);vi(e),Rn(e,a),Ws(e,a),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Ps(e,t){var n=new ba(e,t);if(zs(e,n)){va(e),_u(e,n);var r=bi(e);vi(e),Rn(e,r),Ws(e,r),n.finish()}}function fg(e,t,n){var r=e.display,a=e.options.lineNumbers,o=r.lineDiv,u=o.firstChild;function h(z){var B=z.nextSibling;return k&&J&&e.display.currentWheelTarget==z?z.style.display="none":z.parentNode.removeChild(z),B}for(var d=r.view,v=r.viewFrom,x=0;x<d.length;x++){var C=d[x];if(!C.hidden)if(!C.node||C.node.parentNode!=o){var O=Pp(e,C,v,n);o.insertBefore(O,u)}else{for(;u!=C.node;)u=h(u);var E=a&&t!=null&&t<=v&&C.lineNumber;C.changes&&(ye(C.changes,"gutter")>-1&&(E=!1),Jl(e,C,v,n)),E&&($(C.lineNumber),C.lineNumber.appendChild(document.createTextNode(j(e.options,v)))),u=C.node.nextSibling}v+=C.size}for(;u;)u=h(u)}function Fs(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ut(e,"gutterChanged",e)}function Ws(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+dr(e)+"px"}function Eu(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Es(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,o=r+"px",u=0;u<n.length;u++)if(!n[u].hidden){e.options.fixedGutter&&(n[u].gutter&&(n[u].gutter.style.left=o),n[u].gutterBackground&&(n[u].gutterBackground.style.left=o));var h=n[u].alignable;if(h)for(var d=0;d<h.length;d++)h[d].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+a+"px")}}function Ou(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=j(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var a=r.measure.appendChild(T("div",[T("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=a.firstChild.offsetWidth,u=a.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-u)+1,r.lineNumWidth=r.lineNumInnerWidth+u,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Fs(e.display),!0}return!1}function Hs(e,t){for(var n=[],r=!1,a=0;a<e.length;a++){var o=e[a],u=null;if(typeof o!="string"&&(u=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:u})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Au(e){var t=e.gutters,n=e.gutterSpecs;$(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var a=n[r],o=a.className,u=a.style,h=t.appendChild(T("div",null,"CodeMirror-gutter "+o));u&&(h.style.cssText=u),o=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Fs(e)}function ki(e){Au(e.display),_t(e),Eu(e)}function cg(e,t,n,r){var a=this;this.input=n,a.scrollbarFiller=T("div",null,"CodeMirror-scrollbar-filler"),a.scrollbarFiller.setAttribute("cm-not-content","true"),a.gutterFiller=T("div",null,"CodeMirror-gutter-filler"),a.gutterFiller.setAttribute("cm-not-content","true"),a.lineDiv=rt("div",null,"CodeMirror-code"),a.selectionDiv=T("div",null,null,"position: relative; z-index: 1"),a.cursorDiv=T("div",null,"CodeMirror-cursors"),a.measure=T("div",null,"CodeMirror-measure"),a.lineMeasure=T("div",null,"CodeMirror-measure"),a.lineSpace=rt("div",[a.measure,a.lineMeasure,a.selectionDiv,a.cursorDiv,a.lineDiv],null,"position: relative; outline: none");var o=rt("div",[a.lineSpace],"CodeMirror-lines");a.mover=T("div",[o],null,"position: relative"),a.sizer=T("div",[a.mover],"CodeMirror-sizer"),a.sizerWidth=null,a.heightForcer=T("div",null,null,"position: absolute; height: "+pt+"px; width: 1px;"),a.gutters=T("div",null,"CodeMirror-gutters"),a.lineGutter=null,a.scroller=T("div",[a.sizer,a.heightForcer,a.gutters],"CodeMirror-scroll"),a.scroller.setAttribute("tabIndex","-1"),a.wrapper=T("div",[a.scrollbarFiller,a.gutterFiller,a.scroller],"CodeMirror"),L&&H===105&&(a.wrapper.style.clipPath="inset(0px)"),a.wrapper.setAttribute("translate","no"),b&&y<8&&(a.gutters.style.zIndex=-1,a.scroller.style.paddingRight=0),!k&&!(c&&G)&&(a.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(a.wrapper):e(a.wrapper)),a.viewFrom=a.viewTo=t.first,a.reportedViewFrom=a.reportedViewTo=t.first,a.view=[],a.renderedView=null,a.externalMeasured=null,a.viewOffset=0,a.lastWrapHeight=a.lastWrapWidth=0,a.updateLineNumbers=null,a.nativeBarWidth=a.barHeight=a.barWidth=0,a.scrollbarsClipped=!1,a.lineNumWidth=a.lineNumInnerWidth=a.lineNumChars=null,a.alignWidgets=!1,a.cachedCharWidth=a.cachedTextHeight=a.cachedPaddingH=null,a.maxLine=null,a.maxLineLength=0,a.maxLineChanged=!1,a.wheelDX=a.wheelDY=a.wheelStartX=a.wheelStartY=null,a.shift=!1,a.selForContextMenu=null,a.activeTouch=null,a.gutterSpecs=Hs(r.gutters,r.lineNumbers),Au(a),n.init(a)}var wa=0,Sr=null;b?Sr=-.53:c?Sr=15:L?Sr=-.7:U&&(Sr=-1/3);function Iu(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function hg(e){var t=Iu(e);return t.x*=Sr,t.y*=Sr,t}function Du(e,t){L&&H==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=Iu(t),r=n.x,a=n.y,o=Sr;t.deltaMode===0&&(r=t.deltaX,a=t.deltaY,o=1);var u=e.display,h=u.scroller,d=h.scrollWidth>h.clientWidth,v=h.scrollHeight>h.clientHeight;if(r&&d||a&&v){if(a&&J&&k){e:for(var x=t.target,C=u.view;x!=h;x=x.parentNode)for(var O=0;O<C.length;O++)if(C[O].node==x){e.display.currentWheelTarget=x;break e}}if(r&&!c&&!F&&o!=null){a&&v&&yi(e,Math.max(0,h.scrollTop+a*o)),en(e,Math.max(0,h.scrollLeft+r*o)),(!a||a&&v)&&mt(t),u.wheelStartX=null;return}if(a&&o!=null){var E=a*o,z=e.doc.scrollTop,B=z+u.wrapper.clientHeight;E<0?z=Math.max(0,z+E-50):B=Math.min(e.doc.height,B+E+50),Ps(e,{top:z,bottom:B})}wa<20&&t.deltaMode!==0&&(u.wheelStartX==null?(u.wheelStartX=h.scrollLeft,u.wheelStartY=h.scrollTop,u.wheelDX=r,u.wheelDY=a,setTimeout(function(){if(u.wheelStartX!=null){var q=h.scrollLeft-u.wheelStartX,X=h.scrollTop-u.wheelStartY,Q=X&&u.wheelDY&&X/u.wheelDY||q&&u.wheelDX&&q/u.wheelDX;u.wheelStartX=u.wheelStartY=null,Q&&(Sr=(Sr*wa+Q)/(wa+1),++wa)}},200)):(u.wheelDX+=r,u.wheelDY+=a))}}var Ht=function(e,t){this.ranges=e,this.primIndex=t};Ht.prototype.primary=function(){return this.ranges[this.primIndex]},Ht.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!Ae(n.anchor,r.anchor)||!Ae(n.head,r.head))return!1}return!0},Ht.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ie(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new Ht(e,this.primIndex)},Ht.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ht.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(Z(t,r.from())>=0&&Z(e,r.to())<=0)return n}return-1};var Ie=function(e,t){this.anchor=e,this.head=t};Ie.prototype.from=function(){return _n(this.anchor,this.head)},Ie.prototype.to=function(){return Lt(this.anchor,this.head)},Ie.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function or(e,t,n){var r=e&&e.options.selectionsMayTouch,a=t[n];t.sort(function(O,E){return Z(O.from(),E.from())}),n=ye(t,a);for(var o=1;o<t.length;o++){var u=t[o],h=t[o-1],d=Z(h.to(),u.from());if(r&&!u.empty()?d>0:d>=0){var v=_n(h.from(),u.from()),x=Lt(h.to(),u.to()),C=h.empty()?u.from()==u.head:h.from()==h.head;o<=n&&--n,t.splice(--o,2,new Ie(C?x:v,C?v:x))}}return new Ht(t,n)}function zr(e,t){return new Ht([new Ie(e,t||e)],0)}function Pr(e){return e.text?R(e.from.line+e.text.length-1,de(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Nu(e,t){if(Z(e,t.from)<0)return e;if(Z(e,t.to)<=0)return Pr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Pr(t).ch-t.to.ch),R(n,r)}function $s(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var a=e.sel.ranges[r];n.push(new Ie(Nu(a.anchor,t),Nu(a.head,t)))}return or(e.cm,n,e.sel.primIndex)}function Mu(e,t,n){return e.line==t.line?R(n.line,e.ch-t.ch+n.ch):R(n.line+(e.line-t.line),e.ch)}function dg(e,t,n){for(var r=[],a=R(e.first,0),o=a,u=0;u<t.length;u++){var h=t[u],d=Mu(h.from,a,o),v=Mu(Pr(h),a,o);if(a=h.to,o=v,n=="around"){var x=e.sel.ranges[u],C=Z(x.head,x.anchor)<0;r[u]=new Ie(C?v:d,C?d:v)}else r[u]=new Ie(d,d)}return new Ht(r,e.sel.primIndex)}function Bs(e){e.doc.mode=Cn(e.options,e.doc.modeOption),Si(e)}function Si(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,xi(e,100),e.state.modeGen++,e.curOp&&_t(e)}function Ru(e,t){return t.from.ch==0&&t.to.ch==0&&de(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Us(e,t,n,r){function a(Q){return n?n[Q]:null}function o(Q,Y,ee){xp(Q,Y,ee,r),ut(Q,"change",Q,t)}function u(Q,Y){for(var ee=[],le=Q;le<Y;++le)ee.push(new En(v[le],a(le),r));return ee}var h=t.from,d=t.to,v=t.text,x=re(e,h.line),C=re(e,d.line),O=de(v),E=a(v.length-1),z=d.line-h.line;if(t.full)e.insert(0,u(0,v.length)),e.remove(v.length,e.size-v.length);else if(Ru(e,t)){var B=u(0,v.length-1);o(C,C.text,E),z&&e.remove(h.line,z),B.length&&e.insert(h.line,B)}else if(x==C)if(v.length==1)o(x,x.text.slice(0,h.ch)+O+x.text.slice(d.ch),E);else{var q=u(1,v.length-1);q.push(new En(O+x.text.slice(d.ch),E,r)),o(x,x.text.slice(0,h.ch)+v[0],a(0)),e.insert(h.line+1,q)}else if(v.length==1)o(x,x.text.slice(0,h.ch)+v[0]+C.text.slice(d.ch),a(0)),e.remove(h.line+1,z);else{o(x,x.text.slice(0,h.ch)+v[0],a(0)),o(C,O+C.text.slice(d.ch),E);var X=u(1,v.length-1);z>1&&e.remove(h.line+1,z-1),e.insert(h.line+1,X)}ut(e,"change",e,t)}function Fr(e,t,n){function r(a,o,u){if(a.linked)for(var h=0;h<a.linked.length;++h){var d=a.linked[h];if(d.doc!=o){var v=u&&d.sharedHist;n&&!v||(t(d.doc,v),r(d.doc,a,v))}}}r(e,null,!0)}function zu(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Os(e),Bs(e),Pu(e),e.options.direction=t.direction,e.options.lineWrapping||ys(e),e.options.mode=t.modeOption,_t(e)}function Pu(e){(e.doc.direction=="rtl"?K:Re)(e.display.lineDiv,"CodeMirror-rtl")}function pg(e){Mt(e,function(){Pu(e),_t(e)})}function xa(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function js(e,t){var n={from:lt(t.from),to:Pr(t),text:br(e,t.from,t.to)};return Hu(e,n,t.from.line,t.to.line+1),Fr(e,function(r){return Hu(r,n,t.from.line,t.to.line+1)},!0),n}function Fu(e){for(;e.length;){var t=de(e);if(t.ranges)e.pop();else break}}function gg(e,t){if(t)return Fu(e.done),de(e.done);if(e.done.length&&!de(e.done).ranges)return de(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),de(e.done)}function Wu(e,t,n,r){var a=e.history;a.undone.length=0;var o=+new Date,u,h;if((a.lastOp==r||a.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&a.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(u=gg(a,a.lastOp==r)))h=de(u.changes),Z(t.from,t.to)==0&&Z(t.from,h.to)==0?h.to=Pr(t):u.changes.push(js(e,t));else{var d=de(a.done);for((!d||!d.ranges)&&ka(e.sel,a.done),u={changes:[js(e,t)],generation:a.generation},a.done.push(u);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(n),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=o,a.lastOp=a.lastSelOp=r,a.lastOrigin=a.lastSelOrigin=t.origin,h||Xe(e,"historyAdded")}function vg(e,t,n,r){var a=t.charAt(0);return a=="*"||a=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function mg(e,t,n,r){var a=e.history,o=r&&r.origin;n==a.lastSelOp||o&&a.lastSelOrigin==o&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==o||vg(e,o,de(a.done),t))?a.done[a.done.length-1]=t:ka(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=o,a.lastSelOp=n,r&&r.clearRedo!==!1&&Fu(a.undone)}function ka(e,t){var n=de(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Hu(e,t,n,r){var a=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(u){u.markedSpans&&((a||(a=t["spans_"+e.id]={}))[o]=u.markedSpans),++o})}function yg(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function bg(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],a=0;a<t.text.length;++a)r.push(yg(n[a]));return r}function $u(e,t){var n=bg(e,t),r=ps(e,t);if(!n)return r;if(!r)return n;for(var a=0;a<n.length;++a){var o=n[a],u=r[a];if(o&&u)e:for(var h=0;h<u.length;++h){for(var d=u[h],v=0;v<o.length;++v)if(o[v].marker==d.marker)continue e;o.push(d)}else u&&(n[a]=u)}return n}function zn(e,t,n){for(var r=[],a=0;a<e.length;++a){var o=e[a];if(o.ranges){r.push(n?Ht.prototype.deepCopy.call(o):o);continue}var u=o.changes,h=[];r.push({changes:h});for(var d=0;d<u.length;++d){var v=u[d],x=void 0;if(h.push({from:v.from,to:v.to,text:v.text}),t)for(var C in v)(x=C.match(/^spans_(\d+)$/))&&ye(t,Number(x[1]))>-1&&(de(h)[C]=v[C],delete v[C])}}return r}function qs(e,t,n,r){if(r){var a=e.anchor;if(n){var o=Z(t,a)<0;o!=Z(n,a)<0?(a=t,t=n):o!=Z(t,n)<0&&(t=n)}return new Ie(a,t)}else return new Ie(n||t,t)}function Sa(e,t,n,r,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),yt(e,new Ht([qs(e.sel.primary(),t,n,a)],0),r)}function Bu(e,t,n){for(var r=[],a=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=qs(e.sel.ranges[o],t[o],null,a);var u=or(e.cm,r,e.sel.primIndex);yt(e,u,n)}function Ks(e,t,n,r){var a=e.sel.ranges.slice(0);a[t]=n,yt(e,or(e.cm,a,e.sel.primIndex),r)}function Uu(e,t,n,r){yt(e,zr(t,n),r)}function wg(e,t,n){var r={ranges:t.ranges,update:function(a){this.ranges=[];for(var o=0;o<a.length;o++)this.ranges[o]=new Ie(ge(e,a[o].anchor),ge(e,a[o].head))},origin:n&&n.origin};return Xe(e,"beforeSelectionChange",e,r),e.cm&&Xe(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?or(e.cm,r.ranges,r.ranges.length-1):t}function ju(e,t,n){var r=e.history.done,a=de(r);a&&a.ranges?(r[r.length-1]=t,Ca(e,t,n)):yt(e,t,n)}function yt(e,t,n){Ca(e,t,n),mg(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Ca(e,t,n){(Nt(e,"beforeSelectionChange")||e.cm&&Nt(e.cm,"beforeSelectionChange"))&&(t=wg(e,t,n));var r=n&&n.bias||(Z(t.primary().head,e.sel.primary().head)<0?-1:1);qu(e,Gu(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Mn(e.cm)}function qu(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Xt(e.cm)),ut(e,"cursorActivity",e))}function Ku(e){qu(e,Gu(e,e.sel,null,!1))}function Gu(e,t,n,r){for(var a,o=0;o<t.ranges.length;o++){var u=t.ranges[o],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],d=Ta(e,u.anchor,h&&h.anchor,n,r),v=u.head==u.anchor?d:Ta(e,u.head,h&&h.head,n,r);(a||d!=u.anchor||v!=u.head)&&(a||(a=t.ranges.slice(0,o)),a[o]=new Ie(d,v))}return a?or(e.cm,a,t.primIndex):t}function Pn(e,t,n,r,a){var o=re(e,t.line);if(o.markedSpans)for(var u=0;u<o.markedSpans.length;++u){var h=o.markedSpans[u],d=h.marker,v="selectLeft"in d?!d.selectLeft:d.inclusiveLeft,x="selectRight"in d?!d.selectRight:d.inclusiveRight;if((h.from==null||(v?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(x?h.to>=t.ch:h.to>t.ch))){if(a&&(Xe(d,"beforeCursorEnter"),d.explicitlyCleared))if(o.markedSpans){--u;continue}else break;if(!d.atomic)continue;if(n){var C=d.find(r<0?1:-1),O=void 0;if((r<0?x:v)&&(C=Xu(e,C,-r,C&&C.line==t.line?o:null)),C&&C.line==t.line&&(O=Z(C,n))&&(r<0?O<0:O>0))return Pn(e,C,t,r,a)}var E=d.find(r<0?-1:1);return(r<0?v:x)&&(E=Xu(e,E,r,E.line==t.line?o:null)),E?Pn(e,E,t,r,a):null}}return t}function Ta(e,t,n,r,a){var o=r||1,u=Pn(e,t,n,o,a)||!a&&Pn(e,t,n,o,!0)||Pn(e,t,n,-o,a)||!a&&Pn(e,t,n,-o,!0);return u||(e.cantEdit=!0,R(e.first,0))}function Xu(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ge(e,R(t.line-1)):null:n>0&&t.ch==(r||re(e,t.line)).text.length?t.line<e.first+e.size-1?R(t.line+1,0):null:new R(t.line,t.ch+n)}function Yu(e){e.setSelection(R(e.firstLine(),0),R(e.lastLine()),St)}function Vu(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(a,o,u,h){a&&(r.from=ge(e,a)),o&&(r.to=ge(e,o)),u&&(r.text=u),h!==void 0&&(r.origin=h)}),Xe(e,"beforeChange",e,r),e.cm&&Xe(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Fn(e,t,n){if(e.cm){if(!e.cm.curOp)return ft(e.cm,Fn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((Nt(e,"beforeChange")||e.cm&&Nt(e.cm,"beforeChange"))&&(t=Vu(e,t,!0),!t))){var r=$l&&!n&&mp(e,t.from,t.to);if(r)for(var a=r.length-1;a>=0;--a)Zu(e,{from:r[a].from,to:r[a].to,text:a?[""]:t.text,origin:t.origin});else Zu(e,t)}}function Zu(e,t){if(!(t.text.length==1&&t.text[0]==""&&Z(t.from,t.to)==0)){var n=$s(e,t);Wu(e,t,n,e.cm?e.cm.curOp.id:NaN),Ci(e,t,n,ps(e,t));var r=[];Fr(e,function(a,o){!o&&ye(r,a.history)==-1&&(tf(a.history,t),r.push(a.history)),Ci(a,t,null,ps(a,t))})}}function La(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var a=e.history,o,u=e.sel,h=t=="undo"?a.done:a.undone,d=t=="undo"?a.undone:a.done,v=0;v<h.length&&(o=h[v],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));v++);if(v!=h.length){for(a.lastOrigin=a.lastSelOrigin=null;;)if(o=h.pop(),o.ranges){if(ka(o,d),n&&!o.equals(e.sel)){yt(e,o,{clearRedo:!1});return}u=o}else if(r){h.push(o);return}else break;var x=[];ka(u,d),d.push({changes:x,generation:a.generation}),a.generation=o.generation||++a.maxGeneration;for(var C=Nt(e,"beforeChange")||e.cm&&Nt(e.cm,"beforeChange"),O=function(B){var q=o.changes[B];if(q.origin=t,C&&!Vu(e,q,!1))return h.length=0,{};x.push(js(e,q));var X=B?$s(e,q):de(h);Ci(e,q,X,$u(e,q)),!B&&e.cm&&e.cm.scrollIntoView({from:q.from,to:Pr(q)});var Q=[];Fr(e,function(Y,ee){!ee&&ye(Q,Y.history)==-1&&(tf(Y.history,q),Q.push(Y.history)),Ci(Y,q,null,$u(Y,q))})},E=o.changes.length-1;E>=0;--E){var z=O(E);if(z)return z.v}}}}function Qu(e,t){if(t!=0&&(e.first+=t,e.sel=new Ht(Jt(e.sel.ranges,function(a){return new Ie(R(a.anchor.line+t,a.anchor.ch),R(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm)){_t(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)Mr(e.cm,r,"gutter")}}function Ci(e,t,n,r){if(e.cm&&!e.cm.curOp)return ft(e.cm,Ci)(e,t,n,r);if(t.to.line<e.first){Qu(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var a=t.text.length-1-(e.first-t.from.line);Qu(e,a),t={from:R(e.first,0),to:R(t.to.line+a,t.to.ch),text:[de(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:R(o,re(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=br(e,t.from,t.to),n||(n=$s(e,t)),e.cm?xg(e.cm,t,r):Us(e,t,r),Ca(e,n,St),e.cantEdit&&Ta(e,R(e.firstLine(),0))&&(e.cantEdit=!1)}}function xg(e,t,n){var r=e.doc,a=e.display,o=t.from,u=t.to,h=!1,d=o.line;e.options.lineWrapping||(d=m(ar(re(r,o.line))),r.iter(d,u.line+1,function(E){if(E==a.maxLine)return h=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Xt(e),Us(r,t,n,mu(e)),e.options.lineWrapping||(r.iter(d,o.line+t.text.length,function(E){var z=ua(E);z>a.maxLineLength&&(a.maxLine=E,a.maxLineLength=z,a.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),fp(r,o.line),xi(e,400);var v=t.text.length-(u.line-o.line)-1;t.full?_t(e):o.line==u.line&&t.text.length==1&&!Ru(e.doc,t)?Mr(e,o.line,"text"):_t(e,o.line,u.line+1,v);var x=Nt(e,"changes"),C=Nt(e,"change");if(C||x){var O={from:o,to:u,text:t.text,removed:t.removed,origin:t.origin};C&&ut(e,"change",e,O),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(O)}e.display.selForContextMenu=null}function Wn(e,t,n,r,a){var o;r||(r=n),Z(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Fn(e,{from:n,to:r,text:t,origin:a})}function Ju(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function ef(e,t,n,r){for(var a=0;a<e.length;++a){var o=e[a],u=!0;if(o.ranges){o.copied||(o=e[a]=o.deepCopy(),o.copied=!0);for(var h=0;h<o.ranges.length;h++)Ju(o.ranges[h].anchor,t,n,r),Ju(o.ranges[h].head,t,n,r);continue}for(var d=0;d<o.changes.length;++d){var v=o.changes[d];if(n<v.from.line)v.from=R(v.from.line+r,v.from.ch),v.to=R(v.to.line+r,v.to.ch);else if(t<=v.to.line){u=!1;break}}u||(e.splice(0,a+1),a=0)}}function tf(e,t){var n=t.from.line,r=t.to.line,a=t.text.length-(r-n)-1;ef(e.done,n,r,a),ef(e.undone,n,r,a)}function Ti(e,t,n,r){var a=t,o=t;return typeof t=="number"?o=re(e,Dl(e,t)):a=m(t),a==null?null:(r(o,a)&&e.cm&&Mr(e.cm,a,n),o)}function Li(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Li.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var a=this.lines[n];this.height-=a.height,kp(a),ut(a,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function _i(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var a=e[r];t+=a.chunkSize(),n+=a.height,a.parent=this}this.size=t,this.height=n,this.parent=null}_i.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],a=r.chunkSize();if(e<a){var o=Math.min(t,a-e),u=r.height;if(r.removeInner(e,o),this.height-=u-r.height,a==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=a}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Li))){var h=[];this.collapse(h),this.children=[new Li(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var a=this.children[r],o=a.chunkSize();if(e<=o){if(a.insertInner(e,t,n),a.lines&&a.lines.length>50){for(var u=a.lines.length%25+25,h=u;h<a.lines.length;){var d=new Li(a.lines.slice(h,h+=25));a.height-=d.height,this.children.splice(++r,0,d),d.parent=this}a.lines=a.lines.slice(0,u),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new _i(t);if(e.parent){e.size-=n.size,e.height-=n.height;var a=ye(e.parent.children,e);e.parent.children.splice(a+1,0,n)}else{var r=new _i(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var a=this.children[r],o=a.chunkSize();if(e<o){var u=Math.min(t,o-e);if(a.iterN(e,u,n))return!0;if((t-=u)==0)break;e=0}else e-=o}}};var Ei=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Ei.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=m(n);if(!(r==null||!t)){for(var a=0;a<t.length;++a)t[a]==this&&t.splice(a--,1);t.length||(n.widgets=null);var o=pi(this);Wt(n,Math.max(0,n.height-o)),e&&(Mt(e,function(){rf(e,n,-o),Mr(e,r,"widget")}),ut(e,"lineWidgetCleared",e,this,r))}},Ei.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var a=pi(this)-t;a&&(Nr(this.doc,r)||Wt(r,r.height+a),n&&Mt(n,function(){n.curOp.forceUpdate=!0,rf(n,r,a),ut(n,"lineWidgetChanged",n,e,m(r))}))},er(Ei);function rf(e,t,n){xr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Rs(e,n)}function kg(e,t,n,r){var a=new Ei(e,n,r),o=e.cm;return o&&a.noHScroll&&(o.display.alignWidgets=!0),Ti(e,t,"widget",function(u){var h=u.widgets||(u.widgets=[]);if(a.insertAt==null?h.push(a):h.splice(Math.min(h.length,Math.max(0,a.insertAt)),0,a),a.line=u,o&&!Nr(e,u)){var d=xr(u)<e.scrollTop;Wt(u,u.height+pi(a)),d&&Rs(o,a.height),o.curOp.forceUpdate=!0}return!0}),o&&ut(o,"lineWidgetAdded",o,a,typeof t=="number"?t:m(t)),a}var nf=0,Wr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++nf};Wr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&rn(e),Nt(this,"clear")){var n=this.find();n&&ut(this,"clear",n.from,n.to)}for(var r=null,a=null,o=0;o<this.lines.length;++o){var u=this.lines[o],h=ci(u.markedSpans,this);e&&!this.collapsed?Mr(e,m(u),"text"):e&&(h.to!=null&&(a=m(u)),h.from!=null&&(r=m(u))),u.markedSpans=dp(u.markedSpans,h),h.from==null&&this.collapsed&&!Nr(this.doc,u)&&e&&Wt(u,In(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var d=0;d<this.lines.length;++d){var v=ar(this.lines[d]),x=ua(v);x>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&_t(e,r,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ku(e.doc)),e&&ut(e,"markerCleared",e,this,r,a),t&&nn(e),this.parent&&this.parent.clear()}},Wr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,a=0;a<this.lines.length;++a){var o=this.lines[a],u=ci(o.markedSpans,this);if(u.from!=null&&(n=R(t?o:m(o),u.from),e==-1))return n;if(u.to!=null&&(r=R(t?o:m(o),u.to),e==1))return r}return n&&{from:n,to:r}},Wr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||Mt(r,function(){var a=t.line,o=m(t.line),u=ks(r,o);if(u&&(uu(u),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Nr(n.doc,a)&&n.height!=null){var h=n.height;n.height=null;var d=pi(n)-h;d&&Wt(a,a.height+d)}ut(r,"markerChanged",r,e)})},Wr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||ye(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Wr.prototype.detachLine=function(e){if(this.lines.splice(ye(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},er(Wr);function Hn(e,t,n,r,a){if(r&&r.shared)return Sg(e,t,n,r,a);if(e.cm&&!e.cm.curOp)return ft(e.cm,Hn)(e,t,n,r,a);var o=new Wr(e,a),u=Z(t,n);if(r&&be(r,o,!1),u>0||u==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=rt("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Gl(e,t.line,t,n,o)||t.line!=n.line&&Gl(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");hp()}o.addToHistory&&Wu(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var h=t.line,d=e.cm,v;if(e.iter(h,n.line+1,function(C){d&&o.collapsed&&!d.options.lineWrapping&&ar(C)==d.display.maxLine&&(v=!0),o.collapsed&&h!=t.line&&Wt(C,0),pp(C,new aa(o,h==t.line?t.ch:null,h==n.line?n.ch:null),e.cm&&e.cm.curOp),++h}),o.collapsed&&e.iter(t.line,n.line+1,function(C){Nr(e,C)&&Wt(C,0)}),o.clearOnEnter&&oe(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(cp(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++nf,o.atomic=!0),d){if(v&&(d.curOp.updateMaxLine=!0),o.collapsed)_t(d,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var x=t.line;x<=n.line;x++)Mr(d,x,"text");o.atomic&&Ku(d.doc),ut(d,"markerAdded",d,o)}return o}var Oi=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};Oi.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ut(this,"clear")}},Oi.prototype.find=function(e,t){return this.primary.find(e,t)},er(Oi);function Sg(e,t,n,r,a){r=be(r),r.shared=!1;var o=[Hn(e,t,n,r,a)],u=o[0],h=r.widgetNode;return Fr(e,function(d){h&&(r.widgetNode=h.cloneNode(!0)),o.push(Hn(d,ge(d,t),ge(d,n),r,a));for(var v=0;v<d.linked.length;++v)if(d.linked[v].isParent)return;u=de(o)}),new Oi(o,u)}function af(e){return e.findMarks(R(e.first,0),e.clipPos(R(e.lastLine())),function(t){return t.parent})}function Cg(e,t){for(var n=0;n<t.length;n++){var r=t[n],a=r.find(),o=e.clipPos(a.from),u=e.clipPos(a.to);if(Z(o,u)){var h=Hn(e,o,u,r.primary,r.primary.type);r.markers.push(h),h.parent=r}}}function Tg(e){for(var t=function(r){var a=e[r],o=[a.primary.doc];Fr(a.primary.doc,function(d){return o.push(d)});for(var u=0;u<a.markers.length;u++){var h=a.markers[u];ye(o,h.doc)==-1&&(h.parent=null,a.markers.splice(u--,1))}},n=0;n<e.length;n++)t(n)}var Lg=0,Et=function(e,t,n,r,a){if(!(this instanceof Et))return new Et(e,t,n,r,a);n==null&&(n=0),_i.call(this,[new Li([new En("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=R(n,0);this.sel=zr(o),this.history=new xa(null),this.id=++Lg,this.modeOption=t,this.lineSep=r,this.direction=a=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Us(this,{from:o,to:o,text:e}),yt(this,zr(o),St)};Et.prototype=Gr(_i.prototype,{constructor:Et,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ui(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:ct(function(e){var t=R(this.first,0),n=this.first+this.size-1;Fn(this,{from:t,to:R(n,re(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&mi(this.cm,0,0),yt(this,zr(t),St)}),replaceRange:function(e,t,n,r){t=ge(this,t),n=n?ge(this,n):t,Wn(this,e,t,n,r)},getRange:function(e,t,n){var r=br(this,ge(this,e),ge(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(W(this,e))return re(this,e)},getLineNumber:function(e){return m(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=re(this,e)),ar(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ge(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ct(function(e,t,n){Uu(this,ge(this,typeof e=="number"?R(e,t||0):e),null,n)}),setSelection:ct(function(e,t,n){Uu(this,ge(this,e),ge(this,t||e),n)}),extendSelection:ct(function(e,t,n){Sa(this,ge(this,e),t&&ge(this,t),n)}),extendSelections:ct(function(e,t){Bu(this,Nl(this,e),t)}),extendSelectionsBy:ct(function(e,t){var n=Jt(this.sel.ranges,e);Bu(this,Nl(this,n),t)}),setSelections:ct(function(e,t,n){if(e.length){for(var r=[],a=0;a<e.length;a++)r[a]=new Ie(ge(this,e[a].anchor),ge(this,e[a].head||e[a].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),yt(this,or(this.cm,r,t),n)}}),addSelection:ct(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ie(ge(this,e),ge(this,t||e))),yt(this,or(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var a=br(this,t[r].from(),t[r].to());n=n?n.concat(a):a}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var a=br(this,n[r].from(),n[r].to());e!==!1&&(a=a.join(e||this.lineSeparator())),t[r]=a}return t},replaceSelection:function(e,t,n){for(var r=[],a=0;a<this.sel.ranges.length;a++)r[a]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:ct(function(e,t,n){for(var r=[],a=this.sel,o=0;o<a.ranges.length;o++){var u=a.ranges[o];r[o]={from:u.from(),to:u.to(),text:this.splitLines(e[o]),origin:n}}for(var h=t&&t!="end"&&dg(this,r,t),d=r.length-1;d>=0;d--)Fn(this,r[d]);h?ju(this,h):this.cm&&Mn(this.cm)}),undo:ct(function(){La(this,"undo")}),redo:ct(function(){La(this,"redo")}),undoSelection:ct(function(){La(this,"undo",!0)}),redoSelection:ct(function(){La(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var a=0;a<e.undone.length;a++)e.undone[a].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new xa(this.history),Fr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:zn(this.history.done),undone:zn(this.history.undone)}},setHistory:function(e){var t=this.history=new xa(this.history);t.done=zn(e.done.slice(0),null,!0),t.undone=zn(e.undone.slice(0),null,!0)},setGutterMarker:ct(function(e,t,n){return Ti(this,e,"gutter",function(r){var a=r.gutterMarkers||(r.gutterMarkers={});return a[t]=n,!n&&ie(a)&&(r.gutterMarkers=null),!0})}),clearGutter:ct(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Ti(t,n,"gutter",function(){return n.gutterMarkers[e]=null,ie(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!W(this,e)||(t=e,e=re(this,e),!e))return null}else if(t=m(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:ct(function(e,t,n){return Ti(this,e,t=="gutter"?"gutter":"class",function(r){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[a])r[a]=n;else{if(Oe(n).test(r[a]))return!1;r[a]+=" "+n}return!0})}),removeLineClass:ct(function(e,t,n){return Ti(this,e,t=="gutter"?"gutter":"class",function(r){var a=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[a];if(o)if(n==null)r[a]=null;else{var u=o.match(Oe(n));if(!u)return!1;var h=u.index+u[0].length;r[a]=o.slice(0,u.index)+(!u.index||h==o.length?"":" ")+o.slice(h)||null}else return!1;return!0})}),addLineWidget:ct(function(e,t,n){return kg(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Hn(this,ge(this,e),ge(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ge(this,e),Hn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ge(this,e);var t=[],n=re(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var a=n[r];(a.from==null||a.from<=e.ch)&&(a.to==null||a.to>=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,n){e=ge(this,e),t=ge(this,t);var r=[],a=e.line;return this.iter(e.line,t.line+1,function(o){var u=o.markedSpans;if(u)for(var h=0;h<u.length;h++){var d=u[h];!(d.to!=null&&a==e.line&&e.ch>=d.to||d.from==null&&a!=e.line||d.from!=null&&a==t.line&&d.from>=t.ch)&&(!n||n(d.marker))&&r.push(d.marker.parent||d.marker)}++a}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(a){var o=a.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),ge(this,R(n,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new Et(ui(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new Et(ui(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Cg(r,af(this)),r},unlinkDoc:function(e){if(e instanceof je&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Tg(af(this));break}}if(e.history==this.history){var r=[e.id];Fr(e,function(a){return r.push(a.id)},!0),e.history=new xa(null),e.history.done=zn(this.history.done,r),e.history.undone=zn(this.history.undone,r)}},iterLinkedDocs:function(e){Fr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Yt(e)},lineSeparator:function(){return this.lineSep||`
|
|
11
|
-
`},setDirection:ct(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&pg(this.cm))})}),Et.prototype.eachLine=Et.prototype.iter;var sf=0;function _g(e){var t=this;if(of(t),!(Ye(t,e)||kr(t.display,e))){mt(e),b&&(sf=+new Date);var n=Qr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var a=r.length,o=Array(a),u=0,h=function(){++u==a&&ft(t,function(){n=ge(t.doc,n);var E={from:n,to:n,text:t.doc.splitLines(o.filter(function(z){return z!=null}).join(t.doc.lineSeparator())),origin:"paste"};Fn(t.doc,E),ju(t.doc,zr(ge(t.doc,n),ge(t.doc,Pr(E))))})()},d=function(E,z){if(t.options.allowDropFileTypes&&ye(t.options.allowDropFileTypes,E.type)==-1){h();return}var B=new FileReader;B.onerror=function(){return h()},B.onload=function(){var q=B.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(q)){h();return}o[z]=q,h()},B.readAsText(E)},v=0;v<r.length;v++)d(r[v],v);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 x=e.dataTransfer.getData("Text");if(x){var C;if(t.state.draggingText&&!t.state.draggingText.copy&&(C=t.listSelections()),Ca(t.doc,zr(n,n)),C)for(var O=0;O<C.length;++O)Wn(t.doc,"",C[O].anchor,C[O].head,"drag");t.replaceSelection(x,"around","paste"),t.display.input.focus()}}catch{}}}}function Eg(e,t){if(b&&(!e.state.draggingText||+new Date-sf<100)){Or(t);return}if(!(Ye(e,t)||kr(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!U)){var n=T("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",F&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),F&&n.parentNode.removeChild(n)}}function Og(e,t){var n=Qr(e,t);if(n){var r=document.createDocumentFragment();As(e,n,r),e.display.dragCursor||(e.display.dragCursor=T("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),V(e.display.dragCursor,r)}}function of(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function lf(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var a=t[r].CodeMirror;a&&n.push(a)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var uf=!1;function Ag(){uf||(Ig(),uf=!0)}function Ig(){var e;oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,lf(Dg)},100))}),oe(window,"blur",function(){return lf(Nn)})}function Dg(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Hr={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"},Ai=0;Ai<10;Ai++)Hr[Ai+48]=Hr[Ai+96]=String(Ai);for(var _a=65;_a<=90;_a++)Hr[_a]=String.fromCharCode(_a);for(var Ii=1;Ii<=12;Ii++)Hr[Ii+111]=Hr[Ii+63235]="F"+Ii;var Cr={};Cr.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"},Cr.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Cr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Cr.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Cr.default=J?Cr.macDefault:Cr.pcDefault;function Ng(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,a,o,u=0;u<t.length-1;u++){var h=t[u];if(/^(cmd|meta|m)$/i.test(h))o=!0;else if(/^a(lt)?$/i.test(h))n=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))a=!0;else throw new Error("Unrecognized modifier name: "+h)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),a&&(e="Shift-"+e),e}function Mg(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var a=Jt(n.split(" "),Ng),o=0;o<a.length;o++){var u=void 0,h=void 0;o==a.length-1?(h=a.join(" "),u=r):(h=a.slice(0,o+1).join(" "),u="...");var d=t[h];if(!d)t[h]=u;else if(d!=u)throw new Error("Inconsistent bindings for "+h)}delete e[n]}for(var v in t)e[v]=t[v];return e}function $n(e,t,n,r){t=Ea(t);var a=t.call?t.call(e,r):t[e];if(a===!1)return"nothing";if(a==="...")return"multi";if(a!=null&&n(a))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return $n(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var u=$n(e,t.fallthrough[o],n,r);if(u)return u}}}function ff(e){var t=typeof e=="string"?e:Hr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function cf(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Me?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Me?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function hf(e,t){if(F&&e.keyCode==34&&e.char)return!1;var n=Hr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),cf(n,e,t))}function Ea(e){return typeof e=="string"?Cr[e]:e}function Bn(e,t){for(var n=e.doc.sel.ranges,r=[],a=0;a<n.length;a++){for(var o=t(n[a]);r.length&&Z(o.from,de(r).to)<=0;){var u=r.pop();if(Z(u.from,o.from)<0){o.from=u.from;break}}r.push(o)}Mt(e,function(){for(var h=r.length-1;h>=0;h--)Wn(e.doc,"",r[h].from,r[h].to,"+delete");Mn(e)})}function Gs(e,t,n){var r=Dt(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Xs(e,t,n){var r=Gs(e,t.ch,n);return r==null?null:new R(t.line,r,n<0?"after":"before")}function Ys(e,t,n,r,a){if(e){t.doc.direction=="rtl"&&(a=-a);var o=Le(n,t.doc.direction);if(o){var u=a<0?de(o):o[0],h=a<0==(u.level==1),d=h?"after":"before",v;if(u.level>0||t.doc.direction=="rtl"){var x=An(t,n);v=a<0?n.text.length-1:0;var C=pr(t,x,v).top;v=Gt(function(O){return pr(t,x,O).top==C},a<0==(u.level==1)?u.from:u.to-1,v),d=="before"&&(v=Gs(n,v,1))}else v=a<0?u.to:u.from;return new R(r,v,d)}}return new R(r,a<0?n.text.length:0,a<0?"before":"after")}function Rg(e,t,n,r){var a=Le(t,e.doc.direction);if(!a)return Xs(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=Er(a,n.ch,n.sticky),u=a[o];if(e.doc.direction=="ltr"&&u.level%2==0&&(r>0?u.to>n.ch:u.from<n.ch))return Xs(t,n,r);var h=function(X,Q){return Gs(t,X instanceof R?X.ch:X,Q)},d,v=function(X){return e.options.lineWrapping?(d=d||An(e,t),vu(e,t,d,X)):{begin:0,end:t.text.length}},x=v(n.sticky=="before"?h(n,-1):n.ch);if(e.doc.direction=="rtl"||u.level==1){var C=u.level==1==r<0,O=h(n,C?1:-1);if(O!=null&&(C?O<=u.to&&O<=x.end:O>=u.from&&O>=x.begin)){var E=C?"before":"after";return new R(n.line,O,E)}}var z=function(X,Q,Y){for(var ee=function(We,ht){return ht?new R(n.line,h(We,1),"before"):new R(n.line,We,"after")};X>=0&&X<a.length;X+=Q){var le=a[X],ae=Q>0==(le.level!=1),xe=ae?Y.begin:h(Y.end,-1);if(le.from<=xe&&xe<le.to||(xe=ae?le.from:h(le.to,-1),Y.begin<=xe&&xe<Y.end))return ee(xe,ae)}},B=z(o+r,r,x);if(B)return B;var q=r>0?x.end:h(x.begin,-1);return q!=null&&!(r>0&&q==t.text.length)&&(B=z(r>0?0:a.length-1,r,v(q)),B)?B:null}var Di={selectAll:Yu,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),St)},killLine:function(e){return Bn(e,function(t){if(t.empty()){var n=re(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:R(t.head.line+1,0)}:{from:t.head,to:R(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Bn(e,function(t){return{from:R(t.from().line,0),to:ge(e.doc,R(t.to().line+1,0))}})},delLineLeft:function(e){return Bn(e,function(t){return{from:R(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Bn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Bn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(R(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(R(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return df(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return pf(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return zg(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Ct)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Ct)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?pf(e,t.head):r},Ct)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,a=0;a<n.length;a++){var o=n[a].from(),u=Ce(e.getLine(o.line),o.ch,r);t.push(Lr(r-u%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Mt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var a=t[r].head,o=re(e.doc,a.line).text;if(o){if(a.ch==o.length&&(a=new R(a.line,a.ch-1)),a.ch>0)a=new R(a.line,a.ch+1),e.replaceRange(o.charAt(a.ch-1)+o.charAt(a.ch-2),R(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var u=re(e.doc,a.line-1).text;u&&(a=new R(a.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+u.charAt(u.length-1),R(a.line-1,u.length-1),a,"+transpose"))}}n.push(new Ie(a,a))}e.setSelections(n)})},newlineAndIndent:function(e){return Mt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Mn(e)})},openLine:function(e){return e.replaceSelection(`
|
|
12
|
-
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function df(e,t){var n=re(e.doc,t),r=ar(n);return r!=n&&(t=m(r)),Ys(!0,e,r,t,1)}function zg(e,t){var n=re(e.doc,t),r=bp(n);return r!=n&&(t=m(r)),Ys(!0,e,n,t,-1)}function pf(e,t){var n=df(e,t.line),r=re(e.doc,n.line),a=Le(r,e.doc.direction);if(!a||a[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),u=t.line==n.line&&t.ch<=o&&t.ch;return R(n.line,u?0:o,n.sticky)}return n}function Oa(e,t,n){if(typeof t=="string"&&(t=Di[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),a=t(e)!=Qt}finally{e.display.shift=r,e.state.suppressEdits=!1}return a}function Pg(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var a=$n(t,e.state.keyMaps[r],n,e);if(a)return a}return e.options.extraKeys&&$n(t,e.options.extraKeys,n,e)||$n(t,e.options.keyMap,n,e)}var Fg=new jt;function Ni(e,t,n,r){var a=e.state.keySeq;if(a){if(ff(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Fg.set(50,function(){e.state.keySeq==a&&(e.state.keySeq=null,e.display.input.reset())}),gf(e,a+" "+t,n,r))return!0}return gf(e,t,n,r)}function gf(e,t,n,r){var a=Pg(e,t,r);return a=="multi"&&(e.state.keySeq=t),a=="handled"&&ut(e,"keyHandled",e,t,n),(a=="handled"||a=="multi")&&(mt(n),Is(e)),!!a}function vf(e,t){var n=hf(t,!0);return n?t.shiftKey&&!e.state.keySeq?Ni(e,"Shift-"+n,t,function(r){return Oa(e,r,!0)})||Ni(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Oa(e,r)}):Ni(e,n,t,function(r){return Oa(e,r)}):!1}function Wg(e,t,n){return Ni(e,"'"+n+"'",t,function(r){return Oa(e,r,!0)})}var Vs=null;function mf(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=N(wt(t)),!Ye(t,e))){b&&y<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=vf(t,e);F&&(Vs=r?n:null,!r&&n==88&&!na&&(J?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),c&&!J&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Hg(t)}}function Hg(e){var t=e.display.lineDiv;K(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(Re(t,"CodeMirror-crosshair"),vt(document,"keyup",n),vt(document,"mouseover",n))}oe(document,"keyup",n),oe(document,"mouseover",n)}function yf(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ye(this,e)}function bf(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(kr(t.display,e)||Ye(t,e)||e.ctrlKey&&!e.altKey||J&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(F&&n==Vs){Vs=null,mt(e);return}if(!(F&&(!e.which||e.which<10)&&vf(t,e))){var a=String.fromCharCode(r??n);a!="\b"&&(Wg(t,e,a)||t.display.input.onKeyPress(e))}}}var $g=400,Zs=function(e,t,n){this.time=e,this.pos=t,this.button=n};Zs.prototype.compare=function(e,t,n){return this.time+$g>e&&Z(t,this.pos)==0&&n==this.button};var Mi,Ri;function Bg(e,t){var n=+new Date;return Ri&&Ri.compare(n,e,t)?(Mi=Ri=null,"triple"):Mi&&Mi.compare(n,e,t)?(Ri=new Zs(n,e,t),Mi=null,"double"):(Mi=new Zs(n,e,t),Ri=null,"single")}function wf(e){var t=this,n=t.display;if(!(Ye(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,kr(n,e)){k||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Qs(t,e)){var r=Qr(t,e),a=tr(e),o=r?Bg(r,a):"single";pe(t).focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ug(t,a,r,o,e))&&(a==1?r?qg(t,r,o,e):si(e)==n.scroller&&mt(e):a==2?(r&&Sa(t.doc,r),setTimeout(function(){return n.input.focus()},20)):a==3&&(Ee?t.display.input.onContextMenu(e):Ds(t)))}}}function Ug(e,t,n,r,a){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Ni(e,cf(o,a),a,function(u){if(typeof u=="string"&&(u=Di[u]),!u)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=u(e,n)!=Qt}finally{e.state.suppressEdits=!1}return h})}function jg(e,t,n){var r=e.getOption("configureMouse"),a=r?r(e,t,n):{};if(a.unit==null){var o=ne?n.shiftKey&&n.metaKey:n.altKey;a.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(a.extend==null||e.doc.extend)&&(a.extend=e.doc.extend||n.shiftKey),a.addNew==null&&(a.addNew=J?n.metaKey:n.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(J?n.altKey:n.ctrlKey)),a}function qg(e,t,n,r){b?setTimeout(he(wu,e),0):e.curOp.focus=N(wt(e));var a=jg(e,n,r),o=e.doc.sel,u;e.options.dragDrop&&fs&&!e.isReadOnly()&&n=="single"&&(u=o.contains(t))>-1&&(Z((u=o.ranges[u]).from(),t)<0||t.xRel>0)&&(Z(u.to(),t)>0||t.xRel<0)?Kg(e,r,t,a):Gg(e,r,t,a)}function Kg(e,t,n,r){var a=e.display,o=!1,u=ft(e,function(v){k&&(a.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ds(e)),vt(a.wrapper.ownerDocument,"mouseup",u),vt(a.wrapper.ownerDocument,"mousemove",h),vt(a.scroller,"dragstart",d),vt(a.scroller,"drop",u),o||(mt(v),r.addNew||Sa(e.doc,n,null,null,r.extend),k&&!U||b&&y==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),h=function(v){o=o||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},d=function(){return o=!0};k&&(a.scroller.draggable=!0),e.state.draggingText=u,u.copy=!r.moveOnDrag,oe(a.wrapper.ownerDocument,"mouseup",u),oe(a.wrapper.ownerDocument,"mousemove",h),oe(a.scroller,"dragstart",d),oe(a.scroller,"drop",u),e.state.delayingBlurEvent=!0,setTimeout(function(){return a.input.focus()},20),a.scroller.dragDrop&&a.scroller.dragDrop()}function xf(e,t,n){if(n=="char")return new Ie(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ie(R(t.line,0),ge(e.doc,R(t.line+1,0)));var r=n(e,t);return new Ie(r.from,r.to)}function Gg(e,t,n,r){b&&Ds(e);var a=e.display,o=e.doc;mt(t);var u,h,d=o.sel,v=d.ranges;if(r.addNew&&!r.extend?(h=o.sel.contains(n),h>-1?u=v[h]:u=new Ie(n,n)):(u=o.sel.primary(),h=o.sel.primIndex),r.unit=="rectangle")r.addNew||(u=new Ie(n,n)),n=Qr(e,t,!0,!0),h=-1;else{var x=xf(e,n,r.unit);r.extend?u=qs(u,x.anchor,x.head,r.extend):u=x}r.addNew?h==-1?(h=v.length,yt(o,or(e,v.concat([u]),h),{scroll:!1,origin:"*mouse"})):v.length>1&&v[h].empty()&&r.unit=="char"&&!r.extend?(yt(o,or(e,v.slice(0,h).concat(v.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),d=o.sel):Ks(o,h,u,qt):(h=0,yt(o,new Ht([u],0),qt),d=o.sel);var C=n;function O(Y){if(Z(C,Y)!=0)if(C=Y,r.unit=="rectangle"){for(var ee=[],le=e.options.tabSize,ae=Ce(re(o,n.line).text,n.ch,le),xe=Ce(re(o,Y.line).text,Y.ch,le),We=Math.min(ae,xe),ht=Math.max(ae,xe),Ke=Math.min(n.line,Y.line),Rt=Math.min(e.lastLine(),Math.max(n.line,Y.line));Ke<=Rt;Ke++){var Ot=re(o,Ke).text,it=Ft(Ot,We,le);We==ht?ee.push(new Ie(R(Ke,it),R(Ke,it))):Ot.length>it&&ee.push(new Ie(R(Ke,it),R(Ke,Ft(Ot,ht,le))))}ee.length||ee.push(new Ie(n,n)),yt(o,or(e,d.ranges.slice(0,h).concat(ee),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Y)}else{var At=u,gt=xf(e,Y,r.unit),ot=At.anchor,at;Z(gt.anchor,ot)>0?(at=gt.head,ot=_n(At.from(),gt.anchor)):(at=gt.anchor,ot=Lt(At.to(),gt.head));var Ze=d.ranges.slice(0);Ze[h]=Xg(e,new Ie(ge(o,ot),at)),yt(o,or(e,Ze,h),qt)}}var E=a.wrapper.getBoundingClientRect(),z=0;function B(Y){var ee=++z,le=Qr(e,Y,!0,r.unit=="rectangle");if(le)if(Z(le,C)!=0){e.curOp.focus=N(wt(e)),O(le);var ae=ma(a,o);(le.line>=ae.to||le.line<ae.from)&&setTimeout(ft(e,function(){z==ee&&B(Y)}),150)}else{var xe=Y.clientY<E.top?-20:Y.clientY>E.bottom?20:0;xe&&setTimeout(ft(e,function(){z==ee&&(a.scroller.scrollTop+=xe,B(Y))}),50)}}function q(Y){e.state.selectingText=!1,z=1/0,Y&&(mt(Y),a.input.focus()),vt(a.wrapper.ownerDocument,"mousemove",X),vt(a.wrapper.ownerDocument,"mouseup",Q),o.history.lastSelOrigin=null}var X=ft(e,function(Y){Y.buttons===0||!tr(Y)?q(Y):B(Y)}),Q=ft(e,q);e.state.selectingText=Q,oe(a.wrapper.ownerDocument,"mousemove",X),oe(a.wrapper.ownerDocument,"mouseup",Q)}function Xg(e,t){var n=t.anchor,r=t.head,a=re(e.doc,n.line);if(Z(n,r)==0&&n.sticky==r.sticky)return t;var o=Le(a);if(!o)return t;var u=Er(o,n.ch,n.sticky),h=o[u];if(h.from!=n.ch&&h.to!=n.ch)return t;var d=u+(h.from==n.ch==(h.level!=1)?0:1);if(d==0||d==o.length)return t;var v;if(r.line!=n.line)v=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Er(o,r.ch,r.sticky),C=x-u||(r.ch-n.ch)*(h.level==1?-1:1);x==d-1||x==d?v=C<0:v=C>0}var O=o[d+(v?-1:0)],E=v==(O.level==1),z=E?O.from:O.to,B=E?"after":"before";return n.ch==z&&n.sticky==B?t:new Ie(new R(n.line,z,B),r)}function kf(e,t,n,r){var a,o;if(t.touches)a=t.touches[0].clientX,o=t.touches[0].clientY;else try{a=t.clientX,o=t.clientY}catch{return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&mt(t);var u=e.display,h=u.lineDiv.getBoundingClientRect();if(o>h.bottom||!Nt(e,n))return Tt(t);o-=h.top-u.viewOffset;for(var d=0;d<e.display.gutterSpecs.length;++d){var v=u.gutters.childNodes[d];if(v&&v.getBoundingClientRect().right>=a){var x=S(e.doc,o),C=e.display.gutterSpecs[d];return Xe(e,n,e,x,C.className,t),Tt(t)}}}function Qs(e,t){return kf(e,t,"gutterClick",!0)}function Sf(e,t){kr(e.display,t)||Yg(e,t)||Ye(e,t,"contextmenu")||Ee||e.display.input.onContextMenu(t)}function Yg(e,t){return Nt(e,"gutterContextMenu")?kf(e,t,"gutterContextMenu",!1):!1}function Cf(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),gi(e)}var Un={toString:function(){return"CodeMirror.Init"}},Tf={},Aa={};function Vg(e){var t=e.optionHandlers;function n(r,a,o,u){e.defaults[r]=a,o&&(t[r]=u?function(h,d,v){v!=Un&&o(h,d,v)}:o)}e.defineOption=n,e.Init=Un,n("value","",function(r,a){return r.setValue(a)},!0),n("mode",null,function(r,a){r.doc.modeOption=a,Bs(r)},!0),n("indentUnit",2,Bs,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Si(r),gi(r),_t(r)},!0),n("lineSeparator",null,function(r,a){if(r.doc.lineSep=a,!!a){var o=[],u=r.doc.first;r.doc.iter(function(d){for(var v=0;;){var x=d.text.indexOf(a,v);if(x==-1)break;v=x+a.length,o.push(R(u,x))}u++});for(var h=o.length-1;h>=0;h--)Wn(r.doc,a,o[h],R(o[h].line,o[h].ch+a.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,a,o){r.state.specialChars=new RegExp(a.source+(a.test(" ")?"":"| "),"g"),o!=Un&&r.refresh()}),n("specialCharPlaceholder",Tp,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",G?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,a){return r.getInputField().spellcheck=a},!0),n("autocorrect",!1,function(r,a){return r.getInputField().autocorrect=a},!0),n("autocapitalize",!1,function(r,a){return r.getInputField().autocapitalize=a},!0),n("rtlMoveVisually",!te),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Cf(r),ki(r)},!0),n("keyMap","default",function(r,a,o){var u=Ea(a),h=o!=Un&&Ea(o);h&&h.detach&&h.detach(r,u),u.attach&&u.attach(r,h||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Qg,!0),n("gutters",[],function(r,a){r.display.gutterSpecs=Hs(a,r.options.lineNumbers),ki(r)},!0),n("fixedGutter",!0,function(r,a){r.display.gutters.style.left=a?Es(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Rn(r)},!0),n("scrollbarStyle","native",function(r){Lu(r),Rn(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,a){r.display.gutterSpecs=Hs(r.options.gutters,a),ki(r)},!0),n("firstLineNumber",1,ki,!0),n("lineNumberFormatter",function(r){return r},ki,!0),n("showCursorWhenSelecting",!1,vi,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,a){a=="nocursor"&&(Nn(r),r.display.input.blur()),r.display.input.readOnlyChanged(a)}),n("screenReaderLabel",null,function(r,a){a=a===""?null:a,r.display.input.screenReaderLabelChanged(a)}),n("disableInput",!1,function(r,a){a||r.display.input.reset()},!0),n("dragDrop",!0,Zg),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vi,!0),n("singleCursorHeightPerLine",!0,vi,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Si,!0),n("addModeClass",!1,Si,!0),n("pollInterval",100),n("undoDepth",200,function(r,a){return r.doc.history.undoDepth=a}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Si,!0),n("moveInputWithCursor",!0,function(r,a){a||r.display.input.resetPosition()}),n("tabindex",null,function(r,a){return r.display.input.getField().tabIndex=a||""}),n("autofocus",null),n("direction","ltr",function(r,a){return r.doc.setDirection(a)},!0),n("phrases",null)}function Zg(e,t,n){var r=n&&n!=Un;if(!t!=!r){var a=e.display.dragFunctions,o=t?oe:vt;o(e.display.scroller,"dragstart",a.start),o(e.display.scroller,"dragenter",a.enter),o(e.display.scroller,"dragover",a.over),o(e.display.scroller,"dragleave",a.leave),o(e.display.scroller,"drop",a.drop)}}function Qg(e){e.options.lineWrapping?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Re(e.display.wrapper,"CodeMirror-wrap"),ys(e)),Os(e),_t(e),gi(e),setTimeout(function(){return Rn(e)},100)}function je(e,t){var n=this;if(!(this instanceof je))return new je(e,t);this.options=t=t?be(t):{},be(Tf,t,!1);var r=t.value;typeof r=="string"?r=new Et(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var a=new je.inputStyles[t.inputStyle](this),o=this.display=new cg(e,r,a,t);o.wrapper.CodeMirror=this,Cf(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Lu(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new jt,keySeq:null,specialChars:null},t.autofocus&&!G&&o.input.focus(),b&&y<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Jg(this),Ag(),rn(this),this.curOp.forceUpdate=!0,zu(this,r),t.autofocus&&!G||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ns(n)},20):Nn(this);for(var u in Aa)Aa.hasOwnProperty(u)&&Aa[u](this,t[u],Un);Ou(this),t.finishInit&&t.finishInit(this);for(var h=0;h<Js.length;++h)Js[h](this);nn(this),k&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}je.defaults=Tf,je.optionHandlers=Aa;function Jg(e){var t=e.display;oe(t.scroller,"mousedown",ft(e,wf)),b&&y<11?oe(t.scroller,"dblclick",ft(e,function(d){if(!Ye(e,d)){var v=Qr(e,d);if(!(!v||Qs(e,d)||kr(e.display,d))){mt(d);var x=e.findWordAt(v);Sa(e.doc,x.anchor,x.head)}}})):oe(t.scroller,"dblclick",function(d){return Ye(e,d)||mt(d)}),oe(t.scroller,"contextmenu",function(d){return Sf(e,d)}),oe(t.input.getField(),"contextmenu",function(d){t.scroller.contains(d.target)||Sf(e,d)});var n,r={end:0};function a(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(d){if(d.touches.length!=1)return!1;var v=d.touches[0];return v.radiusX<=1&&v.radiusY<=1}function u(d,v){if(v.left==null)return!0;var x=v.left-d.left,C=v.top-d.top;return x*x+C*C>20*20}oe(t.scroller,"touchstart",function(d){if(!Ye(e,d)&&!o(d)&&!Qs(e,d)){t.input.ensurePolled(),clearTimeout(n);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-r.end<=300?r:null},d.touches.length==1&&(t.activeTouch.left=d.touches[0].pageX,t.activeTouch.top=d.touches[0].pageY)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(d){var v=t.activeTouch;if(v&&!kr(t,d)&&v.left!=null&&!v.moved&&new Date-v.start<300){var x=e.coordsChar(t.activeTouch,"page"),C;!v.prev||u(v,v.prev)?C=new Ie(x,x):!v.prev.prev||u(v,v.prev.prev)?C=e.findWordAt(x):C=new Ie(R(x.line,0),ge(e.doc,R(x.line+1,0))),e.setSelection(C.anchor,C.head),e.focus(),mt(d)}a()}),oe(t.scroller,"touchcancel",a),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(yi(e,t.scroller.scrollTop),en(e,t.scroller.scrollLeft,!0),Xe(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(d){return Du(e,d)}),oe(t.scroller,"DOMMouseScroll",function(d){return Du(e,d)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(d){Ye(e,d)||Or(d)},over:function(d){Ye(e,d)||(Og(e,d),Or(d))},start:function(d){return Eg(e,d)},drop:ft(e,_g),leave:function(d){Ye(e,d)||of(e)}};var h=t.input.getField();oe(h,"keyup",function(d){return yf.call(e,d)}),oe(h,"keydown",ft(e,mf)),oe(h,"keypress",ft(e,bf)),oe(h,"focus",function(d){return Ns(e,d)}),oe(h,"blur",function(d){return Nn(e,d)})}var Js=[];je.defineInitHook=function(e){return Js.push(e)};function zi(e,t,n,r){var a=e.doc,o;n==null&&(n="add"),n=="smart"&&(a.mode.indent?o=fi(e,t).state:n="prev");var u=e.options.tabSize,h=re(a,t),d=Ce(h.text,null,u);h.stateAfter&&(h.stateAfter=null);var v=h.text.match(/^\s*/)[0],x;if(!r&&!/\S/.test(h.text))x=0,n="not";else if(n=="smart"&&(x=a.mode.indent(o,h.text.slice(v.length),h.text),x==Qt||x>150)){if(!r)return;n="prev"}n=="prev"?t>a.first?x=Ce(re(a,t-1).text,null,u):x=0:n=="add"?x=d+e.options.indentUnit:n=="subtract"?x=d-e.options.indentUnit:typeof n=="number"&&(x=d+n),x=Math.max(0,x);var C="",O=0;if(e.options.indentWithTabs)for(var E=Math.floor(x/u);E;--E)O+=u,C+=" ";if(O<x&&(C+=Lr(x-O)),C!=v)return Wn(a,C,R(t,0),R(t,v.length),"+input"),h.stateAfter=null,!0;for(var z=0;z<a.sel.ranges.length;z++){var B=a.sel.ranges[z];if(B.head.line==t&&B.head.ch<v.length){var q=R(t,v.length);Ks(a,z,new Ie(q,q));break}}}var lr=null;function Ia(e){lr=e}function eo(e,t,n,r,a){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var u=+new Date-200,h=a=="paste"||e.state.pasteIncoming>u,d=Yt(t),v=null;if(h&&r.ranges.length>1)if(lr&&lr.text.join(`
|
|
13
|
-
`)==t){if(r.ranges.length%
|
|
14
|
-
`)==
|
|
15
|
-
`)&&(z=B=R(z.line,0)));var q={from:z,to:B,text:v?v[O%v.length]:d,origin:a||(h?"paste":e.state.cutIncoming>u?"cut":"+input")};Fn(e.doc,q),ut(e,"inputRead",e,q)}t&&!h&&_f(e,t),Mn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=C),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Lf(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Mt(t,function(){return eo(t,n,0,null,"paste")}),!0}function _f(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var a=n.ranges[r];if(!(a.head.ch>100||r&&n.ranges[r-1].head.line==a.head.line)){var o=e.getModeAt(a.head),u=!1;if(o.electricChars){for(var h=0;h<o.electricChars.length;h++)if(t.indexOf(o.electricChars.charAt(h))>-1){u=zi(e,a.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(re(e.doc,a.head.line).text.slice(0,a.head.ch))&&(u=zi(e,a.head.line,"smart"));u&&ut(e,"electricInput",e,a.head.line)}}}function Ef(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var a=e.doc.sel.ranges[r].head.line,o={anchor:R(a,0),head:R(a+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function to(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Of(){var e=T("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=T("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),D&&(e.style.border="1px solid black"),t}function ev(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){pe(this).focus(),this.display.input.focus()},setOption:function(r,a){var o=this.options,u=o[r];o[r]==a&&r!="mode"||(o[r]=a,t.hasOwnProperty(r)&&ft(this,t[r])(this,a,u),Xe(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,a){this.state.keyMaps[a?"push":"unshift"](Ea(r))},removeKeyMap:function(r){for(var a=this.state.keyMaps,o=0;o<a.length;++o)if(a[o]==r||a[o].name==r)return a.splice(o,1),!0},addOverlay:xt(function(r,a){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");mn(this.state.overlays,{mode:o,modeSpec:r,opaque:a&&a.opaque,priority:a&&a.priority||0},function(u){return u.priority}),this.state.modeGen++,_t(this)}),removeOverlay:xt(function(r){for(var a=this.state.overlays,o=0;o<a.length;++o){var u=a[o].modeSpec;if(u==r||typeof r=="string"&&u.name==r){a.splice(o,1),this.state.modeGen++,_t(this);return}}}),indentLine:xt(function(r,a,o){typeof a!="string"&&typeof a!="number"&&(a==null?a=this.options.smartIndent?"smart":"prev":a=a?"add":"subtract"),W(this.doc,r)&&zi(this,r,a,o)}),indentSelection:xt(function(r){for(var a=this.doc.sel.ranges,o=-1,u=0;u<a.length;u++){var h=a[u];if(h.empty())h.head.line>o&&(zi(this,h.head.line,r,!0),o=h.head.line,u==this.doc.sel.primIndex&&Mn(this));else{var d=h.from(),v=h.to(),x=Math.max(o,d.line);o=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var C=x;C<o;++C)zi(this,C,r);var O=this.doc.sel.ranges;d.ch==0&&a.length==O.length&&O[u].from().ch>0&&Ks(this.doc,u,new Ie(d,O[u].to()),St)}}}),getTokenAt:function(r,a){return Fl(this,r,a)},getLineTokens:function(r,a){return Fl(this,R(r),a,!0)},getTokenTypeAt:function(r){r=ge(this.doc,r);var a=Rl(this,re(this.doc,r.line)),o=0,u=(a.length-1)/2,h=r.ch,d;if(h==0)d=a[2];else for(;;){var v=o+u>>1;if((v?a[v*2-1]:0)>=h)u=v;else if(a[v*2+1]<h)o=v+1;else{d=a[v*2+2];break}}var x=d?d.indexOf("overlay "):-1;return x<0?d:x==0?null:d.slice(0,x-1)},getModeAt:function(r){var a=this.doc.mode;return a.innerMode?e.innerMode(a,this.getTokenAt(r).state).mode:a},getHelper:function(r,a){return this.getHelpers(r,a)[0]},getHelpers:function(r,a){var o=[];if(!n.hasOwnProperty(a))return o;var u=n[a],h=this.getModeAt(r);if(typeof h[a]=="string")u[h[a]]&&o.push(u[h[a]]);else if(h[a])for(var d=0;d<h[a].length;d++){var v=u[h[a][d]];v&&o.push(v)}else h.helperType&&u[h.helperType]?o.push(u[h.helperType]):u[h.name]&&o.push(u[h.name]);for(var x=0;x<u._global.length;x++){var C=u._global[x];C.pred(h,this)&&ye(o,C.val)==-1&&o.push(C.val)}return o},getStateAfter:function(r,a){var o=this.doc;return r=Dl(o,r??o.first+o.size-1),fi(this,r+1,a).state},cursorCoords:function(r,a){var o,u=this.doc.sel.primary();return r==null?o=u.head:typeof r=="object"?o=ge(this.doc,r):o=r?u.from():u.to(),sr(this,o,a||"page")},charCoords:function(r,a){return da(this,ge(this.doc,r),a||"page")},coordsChar:function(r,a){return r=du(this,r,a||"page"),Ts(this,r.left,r.top)},lineAtHeight:function(r,a){return r=du(this,{top:r,left:0},a||"page").top,S(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,a,o){var u=!1,h;if(typeof r=="number"){var d=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>d&&(r=d,u=!0),h=re(this.doc,r)}else h=r;return ha(this,h,{top:0,left:0},a||"page",o||u).top+(u?this.doc.height-xr(h):0)},defaultTextHeight:function(){return In(this.display)},defaultCharWidth:function(){return Dn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,a,o,u,h){var d=this.display;r=sr(this,ge(this.doc,r));var v=r.bottom,x=r.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),d.sizer.appendChild(a),u=="over")v=r.top;else if(u=="above"||u=="near"){var C=Math.max(d.wrapper.clientHeight,this.doc.height),O=Math.max(d.sizer.clientWidth,d.lineSpace.clientWidth);(u=="above"||r.bottom+a.offsetHeight>C)&&r.top>a.offsetHeight?v=r.top-a.offsetHeight:r.bottom+a.offsetHeight<=C&&(v=r.bottom),x+a.offsetWidth>O&&(x=O-a.offsetWidth)}a.style.top=v+"px",a.style.left=a.style.right="",h=="right"?(x=d.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(h=="left"?x=0:h=="middle"&&(x=(d.sizer.clientWidth-a.offsetWidth)/2),a.style.left=x+"px"),o&&Zp(this,{left:x,top:v,right:x+a.offsetWidth,bottom:v+a.offsetHeight})},triggerOnKeyDown:xt(mf),triggerOnKeyPress:xt(bf),triggerOnKeyUp:yf,triggerOnMouseDown:xt(wf),execCommand:function(r){if(Di.hasOwnProperty(r))return Di[r].call(null,this)},triggerElectric:xt(function(r){_f(this,r)}),findPosH:function(r,a,o,u){var h=1;a<0&&(h=-1,a=-a);for(var d=ge(this.doc,r),v=0;v<a&&(d=ro(this.doc,d,h,o,u),!d.hitSide);++v);return d},moveH:xt(function(r,a){var o=this;this.extendSelectionsBy(function(u){return o.display.shift||o.doc.extend||u.empty()?ro(o.doc,u.head,r,a,o.options.rtlMoveVisually):r<0?u.from():u.to()},Ct)}),deleteH:xt(function(r,a){var o=this.doc.sel,u=this.doc;o.somethingSelected()?u.replaceSelection("",null,"+delete"):Bn(this,function(h){var d=ro(u,h.head,r,a,!1);return r<0?{from:d,to:h.head}:{from:h.head,to:d}})}),findPosV:function(r,a,o,u){var h=1,d=u;a<0&&(h=-1,a=-a);for(var v=ge(this.doc,r),x=0;x<a;++x){var C=sr(this,v,"div");if(d==null?d=C.left:C.left=d,v=Af(this,C,h,o),v.hitSide)break}return v},moveV:xt(function(r,a){var o=this,u=this.doc,h=[],d=!this.display.shift&&!u.extend&&u.sel.somethingSelected();if(u.extendSelectionsBy(function(x){if(d)return r<0?x.from():x.to();var C=sr(o,x.head,"div");x.goalColumn!=null&&(C.left=x.goalColumn),h.push(C.left);var O=Af(o,C,r,a);return a=="page"&&x==u.sel.primary()&&Rs(o,da(o,O,"div").top-C.top),O},Ct),h.length)for(var v=0;v<u.sel.ranges.length;v++)u.sel.ranges[v].goalColumn=h[v]}),findWordAt:function(r){var a=this.doc,o=re(a,r.line).text,u=r.ch,h=r.ch;if(o){var d=this.getHelper(r,"wordChars");(r.sticky=="before"||h==o.length)&&u?--u:++h;for(var v=o.charAt(u),x=ce(v,d)?function(C){return ce(C,d)}:/\s/.test(v)?function(C){return/\s/.test(C)}:function(C){return!/\s/.test(C)&&!ce(C)};u>0&&x(o.charAt(u-1));)--u;for(;h<o.length&&x(o.charAt(h));)++h}return new Ie(R(r.line,u),R(r.line,h))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?K(this.display.cursorDiv,"CodeMirror-overwrite"):Re(this.display.cursorDiv,"CodeMirror-overwrite"),Xe(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==N(wt(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:xt(function(r,a){mi(this,r,a)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-dr(this)-this.display.barHeight,width:r.scrollWidth-dr(this)-this.display.barWidth,clientHeight:xs(this),clientWidth:Vr(this)}},scrollIntoView:xt(function(r,a){r==null?(r={from:this.doc.sel.primary().head,to:null},a==null&&(a=this.options.cursorScrollMargin)):typeof r=="number"?r={from:R(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=a||0,r.from.line!=null?Qp(this,r):ku(this,r.from,r.to,r.margin)}),setSize:xt(function(r,a){var o=this,u=function(d){return typeof d=="number"||/^\d+$/.test(String(d))?d+"px":d};r!=null&&(this.display.wrapper.style.width=u(r)),a!=null&&(this.display.wrapper.style.height=u(a)),this.options.lineWrapping&&fu(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(d){if(d.widgets){for(var v=0;v<d.widgets.length;v++)if(d.widgets[v].noHScroll){Mr(o,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,Xe(this,"refresh",this)}),operation:function(r){return Mt(this,r)},startOperation:function(){return rn(this)},endOperation:function(){return nn(this)},refresh:xt(function(){var r=this.display.cachedTextHeight;_t(this),this.curOp.forceUpdate=!0,gi(this),mi(this,this.doc.scrollLeft,this.doc.scrollTop),Fs(this.display),(r==null||Math.abs(r-In(this.display))>.5||this.options.lineWrapping)&&Os(this),Xe(this,"refresh",this)}),swapDoc:xt(function(r){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),zu(this,r),gi(this),this.display.input.reset(),mi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,ut(this,"swapDoc",this,a),a}),phrase:function(r){var a=this.options.phrases;return a&&Object.prototype.hasOwnProperty.call(a,r)?a[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},er(e),e.registerHelper=function(r,a,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][a]=o},e.registerGlobalHelper=function(r,a,o,u){e.registerHelper(r,a,u),n[r]._global.push({pred:o,val:u})}}function ro(e,t,n,r,a){var o=t,u=n,h=re(e,t.line),d=a&&e.direction=="rtl"?-n:n;function v(){var Q=t.line+d;return Q<e.first||Q>=e.first+e.size?!1:(t=new R(Q,t.ch,t.sticky),h=re(e,Q))}function x(Q){var Y;if(r=="codepoint"){var ee=h.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(ee))Y=null;else{var le=n>0?ee>=55296&&ee<56320:ee>=56320&&ee<57343;Y=new R(t.line,Math.max(0,Math.min(h.text.length,t.ch+n*(le?2:1))),-n)}}else a?Y=Rg(e.cm,h,t,n):Y=Xs(h,t,n);if(Y==null)if(!Q&&v())t=Ys(a,e.cm,h,t.line,d);else return!1;else t=Y;return!0}if(r=="char"||r=="codepoint")x();else if(r=="column")x(!0);else if(r=="word"||r=="group")for(var C=null,O=r=="group",E=e.cm&&e.cm.getHelper(t,"wordChars"),z=!0;!(n<0&&!x(!z));z=!1){var B=h.text.charAt(t.ch)||`
|
|
16
|
-
`,
|
|
17
|
-
`?"n":!
|
|
18
|
-
`);if(h.clipboardData.setData("Text",v),h.clipboardData.getData("Text")==v){h.preventDefault();return}}var
|
|
19
|
-
`);var
|
|
20
|
-
`),
|
|
21
|
-
`)>-1?
|
|
22
|
-
top: `+(e.clientY-
|
|
23
|
-
z-index: 1000; background: `+(
|
|
24
|
-
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var C;k&&(C=a.ownerDocument.defaultView.scrollY),r.input.focus(),k&&a.ownerDocument.defaultView.scrollTo(null,C),r.input.reset(),n.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=E,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function O(){if(a.selectionStart!=null){var B=n.somethingSelected(),q=""+(B?a.value:"");a.value="⇚",a.value=q,t.prevInput=B?"":"",a.selectionStart=1,a.selectionEnd=q.length,r.selForContextMenu=n.doc.sel}}function E(){if(t.contextMenuPending==E&&(t.contextMenuPending=!1,t.wrapper.style.cssText=v,a.style.cssText=d,b&&y<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=u),a.selectionStart!=null)){(!b||b&&y<9)&&O();var B=0,q=function(){r.selForContextMenu==n.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput==""?ft(n,Yu)(n):B++<10?r.detectingSelectAll=setTimeout(q,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(q,200)}}if(b&&y>=9&&O(),Ee){Or(e);var z=function(){vt(window,"mouseup",z),setTimeout(E,20)};oe(window,"mouseup",z)}else setTimeout(E,50)},et.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},et.prototype.setUneditable=function(){},et.prototype.needsContentAttribute=!1;function iv(e,t){if(t=t?be(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=N(nt(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=h.getValue()}var a;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;a=o.submit;try{var u=o.submit=function(){r(),o.submit=a,o.submit(),o.submit=u}}catch{}}t.finishInit=function(d){d.save=r,d.getTextArea=function(){return e},d.toTextArea=function(){d.toTextArea=isNaN,r(),e.parentNode.removeChild(d.getWrapperElement()),e.style.display="",e.form&&(vt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var h=je(function(d){return e.parentNode.insertBefore(d,e.nextSibling)},t);return h}function av(e){e.off=vt,e.on=oe,e.wheelEventPixels=hg,e.Doc=Et,e.splitLines=Yt,e.countColumn=Ce,e.findColumn=Ft,e.isWordChar=ue,e.Pass=Qt,e.signal=Xe,e.Line=En,e.changeEnd=Pr,e.scrollbarModel=Tu,e.Pos=R,e.cmpPos=Z,e.modes=kn,e.mimeModes=nr,e.resolveMode=Sn,e.getMode=Cn,e.modeExtensions=Dr,e.extendMode=Tn,e.copyState=cr,e.startState=Ln,e.innerMode=li,e.commands=Di,e.keyMap=Cr,e.keyName=hf,e.isModifierKey=ff,e.lookupKey=$n,e.normalizeKeyMap=Mg,e.StringStream=Ve,e.SharedTextMarker=Oi,e.TextMarker=Wr,e.LineWidget=Ei,e.e_preventDefault=mt,e.e_stopPropagation=wn,e.e_stop=Or,e.addClass=K,e.contains=I,e.rmClass=Re,e.keyNames=Hr}Vg(je),ev(je);var sv="iter insert remove copy getEditor constructor".split(" ");for(var Na in Et.prototype)Et.prototype.hasOwnProperty(Na)&&ye(sv,Na)<0&&(je.prototype[Na]=function(e){return function(){return e.apply(this.doc,arguments)}}(Et.prototype[Na]));return er(Et),je.inputStyles={textarea:et,contenteditable:Ne},je.defineMode=function(e){!je.defaults.mode&&e!="null"&&(je.defaults.mode=e),ir.apply(this,arguments)},je.defineMIME=Yr,je.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),je.defineMIME("text/plain","null"),je.defineExtension=function(e,t){je.prototype[e]=t},je.defineDocExtension=function(e,t){Et.prototype[e]=t},je.fromTextArea=iv,av(je),je.version="5.65.20",je})}(Ra)),Ra.exports}(function(f,i){(function(s){s(vr())})(function(s){s.defineMode("javascript",function(l,c){var g=l.indentUnit,p=c.statementIndent,w=c.jsonld,b=c.json||w,y=c.trackScope!==!1,k=c.typescript,_=c.wordCharacters||/[\w$\xa1-\uffff]/,L=function(){function m(lt){return{type:lt,style:"keyword"}}var S=m("keyword a"),W=m("keyword b"),j=m("keyword c"),R=m("keyword d"),Z=m("operator"),Ae={type:"atom",style:"atom"};return{if:m("if"),while:S,with:S,else:W,do:W,try:W,finally:W,return:R,break:R,continue:R,new:m("new"),delete:j,void:j,throw:j,debugger:m("debugger"),var:m("var"),const:m("var"),let:m("var"),function:m("function"),catch:m("catch"),for:m("for"),switch:m("switch"),case:m("case"),default:m("default"),in:Z,typeof:Z,instanceof:Z,true:Ae,false:Ae,null:Ae,undefined:Ae,NaN:Ae,Infinity:Ae,this:m("this"),class:m("class"),super:m("atom"),yield:j,export:m("export"),import:m("import"),extends:j,await:j}}(),H=/[+\-*&%=<>!?|~^@]/,F=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function U(m){for(var S=!1,W,j=!1;(W=m.next())!=null;){if(!S){if(W=="/"&&!j)return;W=="["?j=!0:j&&W=="]"&&(j=!1)}S=!S&&W=="\\"}}var M,A;function D(m,S,W){return M=m,A=W,S}function P(m,S){var W=m.next();if(W=='"'||W=="'")return S.tokenize=G(W),S.tokenize(m,S);if(W=="."&&m.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return D("number","number");if(W=="."&&m.match(".."))return D("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(W))return D(W);if(W=="="&&m.eat(">"))return D("=>","operator");if(W=="0"&&m.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return D("number","number");if(/\d/.test(W))return m.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),D("number","number");if(W=="/")return m.eat("*")?(S.tokenize=J,J(m,S)):m.eat("/")?(m.skipToEnd(),D("comment","comment")):Wt(m,S,1)?(U(m),m.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),D("regexp","string-2")):(m.eat("="),D("operator","operator",m.current()));if(W=="`")return S.tokenize=ne,ne(m,S);if(W=="#"&&m.peek()=="!")return m.skipToEnd(),D("meta","meta");if(W=="#"&&m.eatWhile(_))return D("variable","property");if(W=="<"&&m.match("!--")||W=="-"&&m.match("->")&&!/\S/.test(m.string.slice(0,m.start)))return m.skipToEnd(),D("comment","comment");if(H.test(W))return(W!=">"||!S.lexical||S.lexical.type!=">")&&(m.eat("=")?(W=="!"||W=="=")&&m.eat("="):/[<>*+\-|&?]/.test(W)&&(m.eat(W),W==">"&&m.eat(W))),W=="?"&&m.eat(".")?D("."):D("operator","operator",m.current());if(_.test(W)){m.eatWhile(_);var j=m.current();if(S.lastType!="."){if(L.propertyIsEnumerable(j)){var R=L[j];return D(R.type,R.style,j)}if(j=="async"&&m.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return D("async","keyword",j)}return D("variable","variable",j)}}function G(m){return function(S,W){var j=!1,R;if(w&&S.peek()=="@"&&S.match(F))return W.tokenize=P,D("jsonld-keyword","meta");for(;(R=S.next())!=null&&!(R==m&&!j);)j=!j&&R=="\\";return j||(W.tokenize=P),D("string","string")}}function J(m,S){for(var W=!1,j;j=m.next();){if(j=="/"&&W){S.tokenize=P;break}W=j=="*"}return D("comment","comment")}function ne(m,S){for(var W=!1,j;(j=m.next())!=null;){if(!W&&(j=="`"||j=="$"&&m.eat("{"))){S.tokenize=P;break}W=!W&&j=="\\"}return D("quasi","string-2",m.current())}var te="([{}])";function fe(m,S){S.fatArrowAt&&(S.fatArrowAt=null);var W=m.string.indexOf("=>",m.start);if(!(W<0)){if(k){var j=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(m.string.slice(m.start,W));j&&(W=j.index)}for(var R=0,Z=!1,Ae=W-1;Ae>=0;--Ae){var lt=m.string.charAt(Ae),Lt=te.indexOf(lt);if(Lt>=0&&Lt<3){if(!R){++Ae;break}if(--R==0){lt=="("&&(Z=!0);break}}else if(Lt>=3&&Lt<6)++R;else if(_.test(lt))Z=!0;else if(/["'\/`]/.test(lt))for(;;--Ae){if(Ae==0)return;var _n=m.string.charAt(Ae-1);if(_n==lt&&m.string.charAt(Ae-2)!="\\"){Ae--;break}}else if(Z&&!R){++Ae;break}}Z&&!R&&(S.fatArrowAt=Ae)}}var Me={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function Ee(m,S,W,j,R,Z){this.indented=m,this.column=S,this.type=W,this.prev=R,this.info=Z,j!=null&&(this.align=j)}function Oe(m,S){if(!y)return!1;for(var W=m.localVars;W;W=W.next)if(W.name==S)return!0;for(var j=m.context;j;j=j.prev)for(var W=j.vars;W;W=W.next)if(W.name==S)return!0}function Re(m,S,W,j,R){var Z=m.cc;for($.state=m,$.stream=R,$.marked=null,$.cc=Z,$.style=S,m.lexical.hasOwnProperty("align")||(m.lexical.align=!0);;){var Ae=Z.length?Z.pop():b?ye:Ce;if(Ae(W,j)){for(;Z.length&&Z[Z.length-1].lex;)Z.pop()();return $.marked?$.marked:W=="variable"&&Oe(m,j)?"variable-2":S}}}var $={state:null,marked:null,cc:null};function V(){for(var m=arguments.length-1;m>=0;m--)$.cc.push(arguments[m])}function T(){return V.apply(null,arguments),!0}function rt(m,S){for(var W=S;W;W=W.next)if(W.name==m)return!0;return!1}function st(m){var S=$.state;if($.marked="def",!!y){if(S.context){if(S.lexical.info=="var"&&S.context&&S.context.block){var W=I(m,S.context);if(W!=null){S.context=W;return}}else if(!rt(m,S.localVars)){S.localVars=new se(m,S.localVars);return}}c.globalVars&&!rt(m,S.globalVars)&&(S.globalVars=new se(m,S.globalVars))}}function I(m,S){if(S)if(S.block){var W=I(m,S.prev);return W?W==S.prev?S:new K(W,S.vars,!0):null}else return rt(m,S.vars)?S:new K(S.prev,new se(m,S.vars),!1);else return null}function N(m){return m=="public"||m=="private"||m=="protected"||m=="abstract"||m=="readonly"}function K(m,S,W){this.prev=m,this.vars=S,this.block=W}function se(m,S){this.name=m,this.next=S}var Fe=new se("this",new se("arguments",null));function ze(){$.state.context=new K($.state.context,$.state.localVars,!1),$.state.localVars=Fe}function wt(){$.state.context=new K($.state.context,$.state.localVars,!0),$.state.localVars=null}ze.lex=wt.lex=!0;function nt(){$.state.localVars=$.state.context.vars,$.state.context=$.state.context.prev}nt.lex=!0;function pe(m,S){var W=function(){var j=$.state,R=j.indented;if(j.lexical.type=="stat")R=j.lexical.indented;else for(var Z=j.lexical;Z&&Z.type==")"&&Z.align;Z=Z.prev)R=Z.indented;j.lexical=new Ee(R,$.stream.column(),m,null,j.lexical,S)};return W.lex=!0,W}function he(){var m=$.state;m.lexical.prev&&(m.lexical.type==")"&&(m.indented=m.lexical.indented),m.lexical=m.lexical.prev)}he.lex=!0;function be(m){function S(W){return W==m?T():m==";"||W=="}"||W==")"||W=="]"?V():T(S)}return S}function Ce(m,S){return m=="var"?T(pe("vardef",S),wn,be(";"),he):m=="keyword a"?T(pe("form"),Qt,Ce,he):m=="keyword b"?T(pe("form"),Ce,he):m=="keyword d"?$.stream.match(/^\s*$/,!1)?T():T(pe("stat"),qt,be(";"),he):m=="debugger"?T(be(";")):m=="{"?T(pe("}"),wt,Gt,he,nt):m==";"?T():m=="if"?($.state.lexical.info=="else"&&$.state.cc[$.state.cc.length-1]==he&&$.state.cc.pop()(),T(pe("form"),Qt,Ce,he,xn)):m=="function"?T(Yt):m=="for"?T(pe("form"),wt,ra,Ce,nt,he):m=="class"||k&&S=="interface"?($.marked="keyword",T(pe("form",m=="class"?m:S),kn,he)):m=="variable"?k&&S=="declare"?($.marked="keyword",T(Ce)):k&&(S=="module"||S=="enum"||S=="type")&&$.stream.match(/^\s*\w/,!1)?($.marked="keyword",S=="enum"?T(re):S=="type"?T(na,be("operator"),Le,be(";")):T(pe("form"),Tt,be("{"),pe("}"),Gt,he,he)):k&&S=="namespace"?($.marked="keyword",T(pe("form"),ye,Ce,he)):k&&S=="abstract"?($.marked="keyword",T(Ce)):T(pe("stat"),bn):m=="switch"?T(pe("form"),Qt,be("{"),pe("}","switch"),wt,Gt,he,he,nt):m=="case"?T(ye,be(":")):m=="default"?T(be(":")):m=="catch"?T(pe("form"),ze,jt,Ce,he,nt):m=="export"?T(pe("stat"),Sn,he):m=="import"?T(pe("stat"),Dr,he):m=="async"?T(Ce):S=="@"?T(ye,Ce):V(pe("stat"),ye,be(";"),he)}function jt(m){if(m=="(")return T(rr,be(")"))}function ye(m,S){return St(m,S,!1)}function pt(m,S){return St(m,S,!0)}function Qt(m){return m!="("?V():T(pe(")"),qt,be(")"),he)}function St(m,S,W){if($.state.fatArrowAt==$.stream.start){var j=W?Jt:de;if(m=="(")return T(ze,pe(")"),we(rr,")"),he,be("=>"),j,nt);if(m=="variable")return V(ze,Tt,be("=>"),j,nt)}var R=W?Ft:Ct;return Me.hasOwnProperty(m)?T(R):m=="function"?T(Yt,R):m=="class"||k&&S=="interface"?($.marked="keyword",T(pe("form"),cs,he)):m=="keyword c"||m=="async"?T(W?pt:ye):m=="("?T(pe(")"),qt,be(")"),he,R):m=="operator"||m=="spread"?T(W?pt:ye):m=="["?T(pe("]"),Ve,he,R):m=="{"?Dt(ce,"}",null,R):m=="quasi"?V(Kt,R):m=="new"?T(mn(W)):T()}function qt(m){return m.match(/[;\}\)\],]/)?V():V(ye)}function Ct(m,S){return m==","?T(qt):Ft(m,S,!1)}function Ft(m,S,W){var j=W==!1?Ct:Ft,R=W==!1?ye:pt;if(m=="=>")return T(ze,W?Jt:de,nt);if(m=="operator")return/\+\+|--/.test(S)||k&&S=="!"?T(j):k&&S=="<"&&$.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?T(pe(">"),we(Le,">"),he,j):S=="?"?T(ye,be(":"),R):T(R);if(m=="quasi")return V(Kt,j);if(m!=";"){if(m=="(")return Dt(pt,")","call",j);if(m==".")return T(ue,j);if(m=="[")return T(pe("]"),qt,be("]"),he,j);if(k&&S=="as")return $.marked="keyword",T(Le,j);if(m=="regexp")return $.state.lastType=$.marked="operator",$.stream.backUp($.stream.pos-$.stream.start-1),T(R)}}function Kt(m,S){return m!="quasi"?V():S.slice(S.length-2)!="${"?T(Kt):T(qt,Lr)}function Lr(m){if(m=="}")return $.marked="string-2",$.state.tokenize=ne,T(Kt)}function de(m){return fe($.stream,$.state),V(m=="{"?Ce:ye)}function Jt(m){return fe($.stream,$.state),V(m=="{"?Ce:pt)}function mn(m){return function(S){return S=="."?T(m?Gr:yn):S=="variable"&&k?T(Nt,m?Ft:Ct):V(m?pt:ye)}}function yn(m,S){if(S=="target")return $.marked="keyword",T(Ct)}function Gr(m,S){if(S=="target")return $.marked="keyword",T(Ft)}function bn(m){return m==":"?T(he,Ce):V(Ct,be(";"),he)}function ue(m){if(m=="variable")return $.marked="property",T()}function ce(m,S){if(m=="async")return $.marked="property",T(ce);if(m=="variable"||$.style=="keyword"){if($.marked="property",S=="get"||S=="set")return T(ie);var W;return k&&$.state.fatArrowAt==$.stream.start&&(W=$.stream.match(/^\s*:\s*/,!1))&&($.state.fatArrowAt=$.stream.pos+W[0].length),T(Te)}else{if(m=="number"||m=="string")return $.marked=w?"property":$.style+" property",T(Te);if(m=="jsonld-keyword")return T(Te);if(k&&N(S))return $.marked="keyword",T(ce);if(m=="[")return T(ye,_r,be("]"),Te);if(m=="spread")return T(pt,Te);if(S=="*")return $.marked="keyword",T(ce);if(m==":")return V(Te)}}function ie(m){return m!="variable"?V(Te):($.marked="property",T(Yt))}function Te(m){if(m==":")return T(pt);if(m=="(")return V(Yt)}function we(m,S,W){function j(R,Z){if(W?W.indexOf(R)>-1:R==","){var Ae=$.state.lexical;return Ae.info=="call"&&(Ae.pos=(Ae.pos||0)+1),T(function(lt,Lt){return lt==S||Lt==S?V():V(m)},j)}return R==S||Z==S?T():W&&W.indexOf(";")>-1?V(m):T(be(S))}return function(R,Z){return R==S||Z==S?T():V(m,j)}}function Dt(m,S,W){for(var j=3;j<arguments.length;j++)$.cc.push(arguments[j]);return T(pe(S,W),we(m,S),he)}function Gt(m){return m=="}"?T():V(Ce,Gt)}function _r(m,S){if(k){if(m==":")return T(Le);if(S=="?")return T(_r)}}function Xr(m,S){if(k&&(m==":"||S=="in"))return T(Le)}function Er(m){if(k&&m==":")return $.stream.match(/^\s*\w+\s+is\b/,!1)?T(ye,us,Le):T(Le)}function us(m,S){if(S=="is")return $.marked="keyword",T()}function Le(m,S){if(S=="keyof"||S=="typeof"||S=="infer"||S=="readonly")return $.marked="keyword",T(S=="typeof"?pt:Le);if(m=="variable"||S=="void")return $.marked="type",T(Xt);if(S=="|"||S=="&")return T(Le);if(m=="string"||m=="number"||m=="atom")return T(Xt);if(m=="[")return T(pe("]"),we(Le,"]",","),he,Xt);if(m=="{")return T(pe("}"),oe,he,Xt);if(m=="(")return T(we(Ye,")"),ta,Xt);if(m=="<")return T(we(Le,">"),Le);if(m=="quasi")return V(vt,Xt)}function ta(m){if(m=="=>")return T(Le)}function oe(m){return m.match(/[\}\)\]]/)?T():m==","||m==";"?T(oe):V(yr,oe)}function yr(m,S){if(m=="variable"||$.style=="keyword")return $.marked="property",T(yr);if(S=="?"||m=="number"||m=="string")return T(yr);if(m==":")return T(Le);if(m=="[")return T(be("variable"),Xr,be("]"),yr);if(m=="(")return V(Ir,yr);if(!m.match(/[;\}\)\],]/))return T()}function vt(m,S){return m!="quasi"?V():S.slice(S.length-2)!="${"?T(vt):T(Le,Xe)}function Xe(m){if(m=="}")return $.marked="string-2",$.state.tokenize=ne,T(vt)}function Ye(m,S){return m=="variable"&&$.stream.match(/^\s*[?:]/,!1)||S=="?"?T(Ye):m==":"?T(Le):m=="spread"?T(Ye):V(Le)}function Xt(m,S){if(S=="<")return T(pe(">"),we(Le,">"),he,Xt);if(S=="|"||m=="."||S=="&")return T(Le);if(m=="[")return T(Le,be("]"),Xt);if(S=="extends"||S=="implements")return $.marked="keyword",T(Le);if(S=="?")return T(Le,be(":"),Le)}function Nt(m,S){if(S=="<")return T(pe(">"),we(Le,">"),he,Xt)}function er(){return V(Le,mt)}function mt(m,S){if(S=="=")return T(Le)}function wn(m,S){return S=="enum"?($.marked="keyword",T(re)):V(Tt,_r,tr,fs)}function Tt(m,S){if(k&&N(S))return $.marked="keyword",T(Tt);if(m=="variable")return st(S),T();if(m=="spread")return T(Tt);if(m=="[")return Dt(si,"]");if(m=="{")return Dt(Or,"}")}function Or(m,S){return m=="variable"&&!$.stream.match(/^\s*:/,!1)?(st(S),T(tr)):(m=="variable"&&($.marked="property"),m=="spread"?T(Tt):m=="}"?V():m=="["?T(ye,be("]"),be(":"),Or):T(be(":"),Tt,tr))}function si(){return V(Tt,tr)}function tr(m,S){if(S=="=")return T(pt)}function fs(m){if(m==",")return T(wn)}function xn(m,S){if(m=="keyword b"&&S=="else")return T(pe("form","else"),Ce,he)}function ra(m,S){if(S=="await")return T(ra);if(m=="(")return T(pe(")"),oi,he)}function oi(m){return m=="var"?T(wn,Ar):m=="variable"?T(Ar):V(Ar)}function Ar(m,S){return m==")"?T():m==";"?T(Ar):S=="in"||S=="of"?($.marked="keyword",T(ye,Ar)):V(ye,Ar)}function Yt(m,S){if(S=="*")return $.marked="keyword",T(Yt);if(m=="variable")return st(S),T(Yt);if(m=="(")return T(ze,pe(")"),we(rr,")"),he,Er,Ce,nt);if(k&&S=="<")return T(pe(">"),we(er,">"),he,Yt)}function Ir(m,S){if(S=="*")return $.marked="keyword",T(Ir);if(m=="variable")return st(S),T(Ir);if(m=="(")return T(ze,pe(")"),we(rr,")"),he,Er,nt);if(k&&S=="<")return T(pe(">"),we(er,">"),he,Ir)}function na(m,S){if(m=="keyword"||m=="variable")return $.marked="type",T(na);if(S=="<")return T(pe(">"),we(er,">"),he)}function rr(m,S){return S=="@"&&T(ye,rr),m=="spread"?T(rr):k&&N(S)?($.marked="keyword",T(rr)):k&&m=="this"?T(_r,tr):V(Tt,_r,tr)}function cs(m,S){return m=="variable"?kn(m,S):nr(m,S)}function kn(m,S){if(m=="variable")return st(S),T(nr)}function nr(m,S){if(S=="<")return T(pe(">"),we(er,">"),he,nr);if(S=="extends"||S=="implements"||k&&m==",")return S=="implements"&&($.marked="keyword"),T(k?Le:ye,nr);if(m=="{")return T(pe("}"),ir,he)}function ir(m,S){if(m=="async"||m=="variable"&&(S=="static"||S=="get"||S=="set"||k&&N(S))&&$.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return $.marked="keyword",T(ir);if(m=="variable"||$.style=="keyword")return $.marked="property",T(Yr,ir);if(m=="number"||m=="string")return T(Yr,ir);if(m=="[")return T(ye,_r,be("]"),Yr,ir);if(S=="*")return $.marked="keyword",T(ir);if(k&&m=="(")return V(Ir,ir);if(m==";"||m==",")return T(ir);if(m=="}")return T();if(S=="@")return T(ye,ir)}function Yr(m,S){if(S=="!"||S=="?")return T(Yr);if(m==":")return T(Le,tr);if(S=="=")return T(pt);var W=$.state.lexical.prev,j=W&&W.info=="interface";return V(j?Ir:Yt)}function Sn(m,S){return S=="*"?($.marked="keyword",T(Ln,be(";"))):S=="default"?($.marked="keyword",T(ye,be(";"))):m=="{"?T(we(Cn,"}"),Ln,be(";")):V(Ce)}function Cn(m,S){if(S=="as")return $.marked="keyword",T(be("variable"));if(m=="variable")return V(pt,Cn)}function Dr(m){return m=="string"?T():m=="("?V(ye):m=="."?V(Ct):V(Tn,cr,Ln)}function Tn(m,S){return m=="{"?Dt(Tn,"}"):(m=="variable"&&st(S),S=="*"&&($.marked="keyword"),T(li))}function cr(m){if(m==",")return T(Tn,cr)}function li(m,S){if(S=="as")return $.marked="keyword",T(Tn)}function Ln(m,S){if(S=="from")return $.marked="keyword",T(ye)}function Ve(m){return m=="]"?T():V(we(pt,"]"))}function re(){return V(pe("form"),Tt,be("{"),pe("}"),we(br,"}"),he,he)}function br(){return V(Tt,tr)}function ui(m,S){return m.lastType=="operator"||m.lastType==","||H.test(S.charAt(0))||/[,.]/.test(S.charAt(0))}function Wt(m,S,W){return S.tokenize==P&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(S.lastType)||S.lastType=="quasi"&&/\{\s*$/.test(m.string.slice(0,m.pos-(W||0)))}return{startState:function(m){var S={tokenize:P,lastType:"sof",cc:[],lexical:new Ee((m||0)-g,0,"block",!1),localVars:c.localVars,context:c.localVars&&new K(null,null,!1),indented:m||0};return c.globalVars&&typeof c.globalVars=="object"&&(S.globalVars=c.globalVars),S},token:function(m,S){if(m.sol()&&(S.lexical.hasOwnProperty("align")||(S.lexical.align=!1),S.indented=m.indentation(),fe(m,S)),S.tokenize!=J&&m.eatSpace())return null;var W=S.tokenize(m,S);return M=="comment"?W:(S.lastType=M=="operator"&&(A=="++"||A=="--")?"incdec":M,Re(S,W,M,A,m))},indent:function(m,S){if(m.tokenize==J||m.tokenize==ne)return s.Pass;if(m.tokenize!=P)return 0;var W=S&&S.charAt(0),j=m.lexical,R;if(!/^\s*else\b/.test(S))for(var Z=m.cc.length-1;Z>=0;--Z){var Ae=m.cc[Z];if(Ae==he)j=j.prev;else if(Ae!=xn&&Ae!=nt)break}for(;(j.type=="stat"||j.type=="form")&&(W=="}"||(R=m.cc[m.cc.length-1])&&(R==Ct||R==Ft)&&!/^[,\.=+\-*:?[\(]/.test(S));)j=j.prev;p&&j.type==")"&&j.prev.type=="stat"&&(j=j.prev);var lt=j.type,Lt=W==lt;return lt=="vardef"?j.indented+(m.lastType=="operator"||m.lastType==","?j.info.length+1:0):lt=="form"&&W=="{"?j.indented:lt=="form"?j.indented+g:lt=="stat"?j.indented+(ui(m,S)?p||g:0):j.info=="switch"&&!Lt&&c.doubleIndentSwitch!=!1?j.indented+(/^(?:case|default)\b/.test(S)?g:2*g):j.align?j.column+(Lt?0:1):j.indented+(Lt?0:g)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:b?null:"/*",blockCommentEnd:b?null:"*/",blockCommentContinue:b?null:" * ",lineComment:b?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:b?"json":"javascript",jsonldMode:w,jsonMode:b,expressionAllowed:Wt,skipExpression:function(m){Re(m,"atom","atom","true",new s.StringStream("",2,null))}}}),s.registerHelper("wordChars","javascript",/[\w$]/),s.defineMIME("text/javascript","javascript"),s.defineMIME("text/ecmascript","javascript"),s.defineMIME("application/javascript","javascript"),s.defineMIME("application/x-javascript","javascript"),s.defineMIME("application/ecmascript","javascript"),s.defineMIME("application/json",{name:"javascript",json:!0}),s.defineMIME("application/x-json",{name:"javascript",json:!0}),s.defineMIME("application/manifest+json",{name:"javascript",json:!0}),s.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),s.defineMIME("text/typescript",{name:"javascript",typescript:!0}),s.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})(),function(f,i){(function(s){s(vr())})(function(s){var l={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},c=s.Pos;s.defineOption("autoCloseBrackets",!1,function(A,D,P){P&&P!=s.Init&&(A.removeKeyMap(p),A.state.closeBrackets=null),D&&(w(g(D,"pairs")),A.state.closeBrackets=D,A.addKeyMap(p))});function g(A,D){return D=="pairs"&&typeof A=="string"?A:typeof A=="object"&&A[D]!=null?A[D]:l[D]}var p={Backspace:k,Enter:_};function w(A){for(var D=0;D<A.length;D++){var P=A.charAt(D),G="'"+P+"'";p[G]||(p[G]=b(P))}}w(l.pairs+"`");function b(A){return function(D){return F(D,A)}}function y(A){var D=A.state.closeBrackets;if(!D||D.override)return D;var P=A.getModeAt(A.getCursor());return P.closeBrackets||D}function k(A){var D=y(A);if(!D||A.getOption("disableInput"))return s.Pass;for(var P=g(D,"pairs"),G=A.listSelections(),J=0;J<G.length;J++){if(!G[J].empty())return s.Pass;var ne=U(A,G[J].head);if(!ne||P.indexOf(ne)%2!=0)return s.Pass}for(var J=G.length-1;J>=0;J--){var te=G[J].head;A.replaceRange("",c(te.line,te.ch-1),c(te.line,te.ch+1),"+delete")}}function _(A){var D=y(A),P=D&&g(D,"explode");if(!P||A.getOption("disableInput"))return s.Pass;for(var G=A.listSelections(),J=0;J<G.length;J++){if(!G[J].empty())return s.Pass;var ne=U(A,G[J].head);if(!ne||P.indexOf(ne)%2!=0)return s.Pass}A.operation(function(){var te=A.lineSeparator()||`
|
|
25
|
-
`;A.replaceSelection(te+te,null),L(A,-1),G=A.listSelections();for(var fe=0;fe<G.length;fe++){var Me=G[fe].head.line;A.indentLine(Me,null,!0),A.indentLine(Me+1,null,!0)}})}function L(A,D){for(var P=[],G=A.listSelections(),J=0,ne=0;ne<G.length;ne++){var te=G[ne];te.head==A.getCursor()&&(J=ne);var fe=te.head.ch||D>0?{line:te.head.line,ch:te.head.ch+D}:{line:te.head.line-1};P.push({anchor:fe,head:fe})}A.setSelections(P,J)}function H(A){var D=s.cmpPos(A.anchor,A.head)>0;return{anchor:new c(A.anchor.line,A.anchor.ch+(D?-1:1)),head:new c(A.head.line,A.head.ch+(D?1:-1))}}function F(A,D){var P=y(A);if(!P||A.getOption("disableInput"))return s.Pass;var G=g(P,"pairs"),J=G.indexOf(D);if(J==-1)return s.Pass;for(var ne=g(P,"closeBefore"),te=g(P,"triples"),fe=G.charAt(J+1)==D,Me=A.listSelections(),Ee=J%2==0,Oe,Re=0;Re<Me.length;Re++){var $=Me[Re],V=$.head,T,rt=A.getRange(V,c(V.line,V.ch+1));if(Ee&&!$.empty())T="surround";else if((fe||!Ee)&&rt==D)fe&&M(A,V)?T="both":te.indexOf(D)>=0&&A.getRange(V,c(V.line,V.ch+3))==D+D+D?T="skipThree":T="skip";else if(fe&&V.ch>1&&te.indexOf(D)>=0&&A.getRange(c(V.line,V.ch-2),V)==D+D){if(V.ch>2&&/\bstring/.test(A.getTokenTypeAt(c(V.line,V.ch-2))))return s.Pass;T="addFour"}else if(fe){var st=V.ch==0?" ":A.getRange(c(V.line,V.ch-1),V);if(!s.isWordChar(rt)&&st!=D&&!s.isWordChar(st))T="both";else return s.Pass}else if(Ee&&(rt.length===0||/\s/.test(rt)||ne.indexOf(rt)>-1))T="both";else return s.Pass;if(!Oe)Oe=T;else if(Oe!=T)return s.Pass}var I=J%2?G.charAt(J-1):D,N=J%2?D:G.charAt(J+1);A.operation(function(){if(Oe=="skip")L(A,1);else if(Oe=="skipThree")L(A,3);else if(Oe=="surround"){for(var K=A.getSelections(),se=0;se<K.length;se++)K[se]=I+K[se]+N;A.replaceSelections(K,"around"),K=A.listSelections().slice();for(var se=0;se<K.length;se++)K[se]=H(K[se]);A.setSelections(K)}else Oe=="both"?(A.replaceSelection(I+N,null),A.triggerElectric(I+N),L(A,-1)):Oe=="addFour"&&(A.replaceSelection(I+I+I+I,"before"),L(A,1))})}function U(A,D){var P=A.getRange(c(D.line,D.ch-1),c(D.line,D.ch+1));return P.length==2?P:null}function M(A,D){var P=A.getTokenAt(c(D.line,D.ch+1));return/\bstring/.test(P.type)&&P.start==D.ch&&(D.ch==0||!/\bstring/.test(A.getTokenTypeAt(D)))}})}(),function(f,i){(function(s){s(vr())})(function(s){var l=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),c=s.Pos,g={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function p(L){return L&&L.bracketRegex||/[(){}[\]]/}function w(L,H,F){var U=L.getLineHandle(H.line),M=H.ch-1,A=F&&F.afterCursor;A==null&&(A=/(^| )cm-fat-cursor($| )/.test(L.getWrapperElement().className));var D=p(F),P=!A&&M>=0&&D.test(U.text.charAt(M))&&g[U.text.charAt(M)]||D.test(U.text.charAt(M+1))&&g[U.text.charAt(++M)];if(!P)return null;var G=P.charAt(1)==">"?1:-1;if(F&&F.strict&&G>0!=(M==H.ch))return null;var J=L.getTokenTypeAt(c(H.line,M+1)),ne=b(L,c(H.line,M+(G>0?1:0)),G,J,F);return ne==null?null:{from:c(H.line,M),to:ne&&ne.pos,match:ne&&ne.ch==P.charAt(0),forward:G>0}}function b(L,H,F,U,M){for(var A=M&&M.maxScanLineLength||1e4,D=M&&M.maxScanLines||1e3,P=[],G=p(M),J=F>0?Math.min(H.line+D,L.lastLine()+1):Math.max(L.firstLine()-1,H.line-D),ne=H.line;ne!=J;ne+=F){var te=L.getLine(ne);if(te){var fe=F>0?0:te.length-1,Me=F>0?te.length:-1;if(!(te.length>A))for(ne==H.line&&(fe=H.ch-(F<0?1:0));fe!=Me;fe+=F){var Ee=te.charAt(fe);if(G.test(Ee)&&(U===void 0||(L.getTokenTypeAt(c(ne,fe+1))||"")==(U||""))){var Oe=g[Ee];if(Oe&&Oe.charAt(1)==">"==F>0)P.push(Ee);else if(P.length)P.pop();else return{pos:c(ne,fe),ch:Ee}}}}}return ne-F==(F>0?L.lastLine():L.firstLine())?!1:null}function y(L,H,F){for(var U=L.state.matchBrackets.maxHighlightLineLength||1e3,M=F&&F.highlightNonMatching,A=[],D=L.listSelections(),P=0;P<D.length;P++){var G=D[P].empty()&&w(L,D[P].head,F);if(G&&(G.match||M!==!1)&&L.getLine(G.from.line).length<=U){var J=G.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";A.push(L.markText(G.from,c(G.from.line,G.from.ch+1),{className:J})),G.to&&L.getLine(G.to.line).length<=U&&A.push(L.markText(G.to,c(G.to.line,G.to.ch+1),{className:J}))}}if(A.length){l&&L.state.focused&&L.focus();var ne=function(){L.operation(function(){for(var te=0;te<A.length;te++)A[te].clear()})};if(H)setTimeout(ne,800);else return ne}}function k(L){L.operation(function(){L.state.matchBrackets.currentlyHighlighted&&(L.state.matchBrackets.currentlyHighlighted(),L.state.matchBrackets.currentlyHighlighted=null),L.state.matchBrackets.currentlyHighlighted=y(L,!1,L.state.matchBrackets)})}function _(L){L.state.matchBrackets&&L.state.matchBrackets.currentlyHighlighted&&(L.state.matchBrackets.currentlyHighlighted(),L.state.matchBrackets.currentlyHighlighted=null)}s.defineOption("matchBrackets",!1,function(L,H,F){F&&F!=s.Init&&(L.off("cursorActivity",k),L.off("focus",k),L.off("blur",_),_(L)),H&&(L.state.matchBrackets=typeof H=="object"?H:{},L.on("cursorActivity",k),L.on("focus",k),L.on("blur",_))}),s.defineExtension("matchBrackets",function(){y(this,!0)}),s.defineExtension("findMatchingBracket",function(L,H,F){return(F||typeof H=="boolean")&&(F?(F.strict=H,H=F):H=H?{strict:!0}:null),w(this,L,H)}),s.defineExtension("scanForBracket",function(L,H,F,U){return b(this,L,H,F,U)})})}();var zf={exports:{}};(function(f,i){(function(s){s(vr())})(function(s){function l(w,b,y,k){if(y&&y.call){var _=y;y=null}else var _=p(w,y,"rangeFinder");typeof b=="number"&&(b=s.Pos(b,0));var L=p(w,y,"minFoldSize");function H(A){var D=_(w,b);if(!D||D.to.line-D.from.line<L)return null;if(k==="fold")return D;for(var P=w.findMarksAt(D.from),G=0;G<P.length;++G)if(P[G].__isFold){if(!A)return null;D.cleared=!0,P[G].clear()}return D}var F=H(!0);if(p(w,y,"scanUp"))for(;!F&&b.line>w.firstLine();)b=s.Pos(b.line-1,0),F=H(!1);if(!(!F||F.cleared||k==="unfold")){var U=c(w,y,F);s.on(U,"mousedown",function(A){M.clear(),s.e_preventDefault(A)});var M=w.markText(F.from,F.to,{replacedWith:U,clearOnEnter:p(w,y,"clearOnEnter"),__isFold:!0});M.on("clear",function(A,D){s.signal(w,"unfold",w,A,D)}),s.signal(w,"fold",w,F.from,F.to)}}function c(w,b,y){var k=p(w,b,"widget");if(typeof k=="function"&&(k=k(y.from,y.to)),typeof k=="string"){var _=document.createTextNode(k);k=document.createElement("span"),k.appendChild(_),k.className="CodeMirror-foldmarker"}else k&&(k=k.cloneNode(!0));return k}s.newFoldFunction=function(w,b){return function(y,k){l(y,k,{rangeFinder:w,widget:b})}},s.defineExtension("foldCode",function(w,b,y){l(this,w,b,y)}),s.defineExtension("isFolded",function(w){for(var b=this.findMarksAt(w),y=0;y<b.length;++y)if(b[y].__isFold)return!0}),s.commands.toggleFold=function(w){w.foldCode(w.getCursor())},s.commands.fold=function(w){w.foldCode(w.getCursor(),null,"fold")},s.commands.unfold=function(w){w.foldCode(w.getCursor(),{scanUp:!1},"unfold")},s.commands.foldAll=function(w){w.operation(function(){for(var b=w.firstLine(),y=w.lastLine();b<=y;b++)w.foldCode(s.Pos(b,0),{scanUp:!1},"fold")})},s.commands.unfoldAll=function(w){w.operation(function(){for(var b=w.firstLine(),y=w.lastLine();b<=y;b++)w.foldCode(s.Pos(b,0),{scanUp:!1},"unfold")})},s.registerHelper("fold","combine",function(){var w=Array.prototype.slice.call(arguments,0);return function(b,y){for(var k=0;k<w.length;++k){var _=w[k](b,y);if(_)return _}}}),s.registerHelper("fold","auto",function(w,b){for(var y=w.getHelpers(b,"fold"),k=0;k<y.length;k++){var _=y[k](w,b);if(_)return _}});var g={rangeFinder:s.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};s.defineOption("foldOptions",null);function p(w,b,y){if(b&&b[y]!==void 0)return b[y];var k=w.options.foldOptions;return k&&k[y]!==void 0?k[y]:g[y]}s.defineExtension("foldOption",function(w,b){return p(this,w,b)})})})();var Pf=zf.exports;(function(f,i){(function(s){s(vr(),Pf)})(function(s){s.defineOption("foldGutter",!1,function(M,A,D){D&&D!=s.Init&&(M.clearGutter(M.state.foldGutter.options.gutter),M.state.foldGutter=null,M.off("gutterClick",_),M.off("changes",H),M.off("viewportChange",F),M.off("fold",U),M.off("unfold",U),M.off("swapDoc",H),M.off("optionChange",L)),A&&(M.state.foldGutter=new c(g(A)),k(M),M.on("gutterClick",_),M.on("changes",H),M.on("viewportChange",F),M.on("fold",U),M.on("unfold",U),M.on("swapDoc",H),M.on("optionChange",L))});var l=s.Pos;function c(M){this.options=M,this.from=this.to=0}function g(M){return M===!0&&(M={}),M.gutter==null&&(M.gutter="CodeMirror-foldgutter"),M.indicatorOpen==null&&(M.indicatorOpen="CodeMirror-foldgutter-open"),M.indicatorFolded==null&&(M.indicatorFolded="CodeMirror-foldgutter-folded"),M}function p(M,A){for(var D=M.findMarks(l(A,0),l(A+1,0)),P=0;P<D.length;++P)if(D[P].__isFold){var G=D[P].find(-1);if(G&&G.line===A)return D[P]}}function w(M){if(typeof M=="string"){var A=document.createElement("div");return A.className=M+" CodeMirror-guttermarker-subtle",A}else return M.cloneNode(!0)}function b(M,A,D){var P=M.state.foldGutter.options,G=A-1,J=M.foldOption(P,"minFoldSize"),ne=M.foldOption(P,"rangeFinder"),te=typeof P.indicatorFolded=="string"&&y(P.indicatorFolded),fe=typeof P.indicatorOpen=="string"&&y(P.indicatorOpen);M.eachLine(A,D,function(Me){++G;var Ee=null,Oe=Me.gutterMarkers;if(Oe&&(Oe=Oe[P.gutter]),p(M,G)){if(te&&Oe&&te.test(Oe.className))return;Ee=w(P.indicatorFolded)}else{var Re=l(G,0),$=ne&&ne(M,Re);if($&&$.to.line-$.from.line>=J){if(fe&&Oe&&fe.test(Oe.className))return;Ee=w(P.indicatorOpen)}}!Ee&&!Oe||M.setGutterMarker(Me,P.gutter,Ee)})}function y(M){return new RegExp("(^|\\s)"+M+"(?:$|\\s)\\s*")}function k(M){var A=M.getViewport(),D=M.state.foldGutter;D&&(M.operation(function(){b(M,A.from,A.to)}),D.from=A.from,D.to=A.to)}function _(M,A,D){var P=M.state.foldGutter;if(P){var G=P.options;if(D==G.gutter){var J=p(M,A);J?J.clear():M.foldCode(l(A,0),G)}}}function L(M,A){A=="mode"&&H(M)}function H(M){var A=M.state.foldGutter;if(A){var D=A.options;A.from=A.to=0,clearTimeout(A.changeUpdate),A.changeUpdate=setTimeout(function(){k(M)},D.foldOnChangeTimeSpan||600)}}function F(M){var A=M.state.foldGutter;if(A){var D=A.options;clearTimeout(A.changeUpdate),A.changeUpdate=setTimeout(function(){var P=M.getViewport();A.from==A.to||P.from-A.to>20||A.from-P.to>20?k(M):M.operation(function(){P.from<A.from&&(b(M,P.from,A.from),A.from=P.from),P.to>A.to&&(b(M,A.to,P.to),A.to=P.to)})},D.updateViewportTimeSpan||400)}}function U(M,A){var D=M.state.foldGutter;if(D){var P=A.line;P>=D.from&&P<D.to&&b(M,P,P+1)}}})})(),function(f,i){(function(s){s(vr())})(function(s){function l(c){return function(g,p){var w=p.line,b=g.getLine(w);function y(U){for(var M,A=p.ch,D=0;;){var P=A<=0?-1:b.lastIndexOf(U[0],A-1);if(P==-1){if(D==1)break;D=1,A=b.length;continue}if(D==1&&P<p.ch)break;if(M=g.getTokenTypeAt(s.Pos(w,P+1)),!/^(comment|string)/.test(M))return{ch:P+1,tokenType:M,pair:U};A=P-1}}function k(U){var M=1,A=g.lastLine(),D,P=U.ch,G;e:for(var J=w;J<=A;++J)for(var ne=g.getLine(J),te=J==w?P:0;;){var fe=ne.indexOf(U.pair[0],te),Me=ne.indexOf(U.pair[1],te);if(fe<0&&(fe=ne.length),Me<0&&(Me=ne.length),te=Math.min(fe,Me),te==ne.length)break;if(g.getTokenTypeAt(s.Pos(J,te+1))==U.tokenType){if(te==fe)++M;else if(!--M){D=J,G=te;break e}}++te}return D==null||w==D?null:{from:s.Pos(w,P),to:s.Pos(D,G)}}for(var _=[],L=0;L<c.length;L++){var H=y(c[L]);H&&_.push(H)}_.sort(function(U,M){return U.ch-M.ch});for(var L=0;L<_.length;L++){var F=k(_[L]);if(F)return F}return null}}s.registerHelper("fold","brace",l([["{","}"],["[","]"]])),s.registerHelper("fold","brace-paren",l([["{","}"],["[","]"],["(",")"]])),s.registerHelper("fold","import",function(c,g){function p(L){if(L<c.firstLine()||L>c.lastLine())return null;var H=c.getTokenAt(s.Pos(L,1));if(/\S/.test(H.string)||(H=c.getTokenAt(s.Pos(L,H.end+1))),H.type!="keyword"||H.string!="import")return null;for(var F=L,U=Math.min(c.lastLine(),L+10);F<=U;++F){var M=c.getLine(F),A=M.indexOf(";");if(A!=-1)return{startCh:H.end,end:s.Pos(F,A)}}}var w=g.line,b=p(w),y;if(!b||p(w-1)||(y=p(w-2))&&y.end.line==w-1)return null;for(var k=b.end;;){var _=p(k.line+1);if(_==null)break;k=_.end}return{from:c.clipPos(s.Pos(w,b.startCh+1)),to:k}}),s.registerHelper("fold","include",function(c,g){function p(_){if(_<c.firstLine()||_>c.lastLine())return null;var L=c.getTokenAt(s.Pos(_,1));if(/\S/.test(L.string)||(L=c.getTokenAt(s.Pos(_,L.end+1))),L.type=="meta"&&L.string.slice(0,8)=="#include")return L.start+8}var w=g.line,b=p(w);if(b==null||p(w-1)!=null)return null;for(var y=w;;){var k=p(y+1);if(k==null)break;++y}return{from:s.Pos(w,b+1),to:c.clipPos(s.Pos(y))}})})}(),function(f,i){(function(s){s(vr())})(function(s){function l(c,g){var p=c.getLine(g),w=p.search(/\S/);return w==-1||/\bcomment\b/.test(c.getTokenTypeAt(s.Pos(g,w+1)))?-1:s.countColumn(p,null,c.getOption("tabSize"))}s.registerHelper("fold","indent",function(c,g){var p=l(c,g.line);if(!(p<0)){for(var w=null,b=g.line+1,y=c.lastLine();b<=y;++b){var k=l(c,b);if(k!=-1)if(k>p)w=b;else break}if(w)return{from:s.Pos(g.line,c.getLine(g.line).length),to:s.Pos(w,c.getLine(w).length)}}})})}();const lo=Qe.defineStore("trace",{state:()=>({traces:[],currentTrace:null}),getters:{getTraces:f=>f.traces,getCurrentTrace:f=>f.currentTrace},actions:{setTraces(f){this.traces=f},setCurrentTrace(f){this.currentTrace=f}}});var uo={exports:{}};(function(f,i){(function(s,l){f.exports=l(vr())})(so,function(s){return function(l){function c(p){if(g[p])return g[p].exports;var w=g[p]={i:p,l:!1,exports:{}};return l[p].call(w.exports,w,w.exports,c),w.l=!0,w.exports}var g={};return c.m=l,c.c=g,c.i=function(p){return p},c.d=function(p,w,b){c.o(p,w)||Object.defineProperty(p,w,{configurable:!1,enumerable:!0,get:b})},c.n=function(p){var w=p&&p.__esModule?function(){return p.default}:function(){return p};return c.d(w,"a",w),w},c.o=function(p,w){return Object.prototype.hasOwnProperty.call(p,w)},c.p="/",c(c.s=3)}([function(l,c){l.exports=s},function(l,c,g){Object.defineProperty(c,"__esModule",{value:!0});var p=g(0),w=function(y){return y&&y.__esModule?y:{default:y}}(p),b=window.CodeMirror||w.default;typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(y,k){if(y==null)throw new TypeError("Cannot convert undefined or null to object");for(var _=Object(y),L=1;L<arguments.length;L++){var H=arguments[L];if(H!=null)for(var F in H)Object.prototype.hasOwnProperty.call(H,F)&&(_[F]=H[F])}return _},writable:!0,configurable:!0}),c.default={name:"codemirror",data:function(){return{content:"",codemirror:null,cminstance:null}},props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:"codemirror"},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},events:{type:Array,default:function(){return[]}},globalOptions:{type:Object,default:function(){return{}}},globalEvents:{type:Array,default:function(){return[]}}},watch:{options:{deep:!0,handler:function(y){for(var k in y)this.cminstance.setOption(k,y[k])}},merge:function(){this.$nextTick(this.switchMerge)},code:function(y){this.handerCodeChange(y)},value:function(y){this.handerCodeChange(y)}},methods:{initialize:function(){var y=this,k=Object.assign({},this.globalOptions,this.options);this.merge?(this.codemirror=b.MergeView(this.$refs.mergeview,k),this.cminstance=this.codemirror.edit):(this.codemirror=b.fromTextArea(this.$refs.textarea,k),this.cminstance=this.codemirror,this.cminstance.setValue(this.code||this.value||this.content)),this.cminstance.on("change",function(L){y.content=L.getValue(),y.$emit&&y.$emit("input",y.content)});var _={};["scroll","changes","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"].concat(this.events).concat(this.globalEvents).filter(function(L){return!_[L]&&(_[L]=!0)}).forEach(function(L){y.cminstance.on(L,function(){for(var H=arguments.length,F=Array(H),U=0;U<H;U++)F[U]=arguments[U];y.$emit.apply(y,[L].concat(F));var M=L.replace(/([A-Z])/g,"-$1").toLowerCase();M!==L&&y.$emit.apply(y,[M].concat(F))})}),this.$emit("ready",this.codemirror),this.unseenLineMarkers(),this.refresh()},refresh:function(){var y=this;this.$nextTick(function(){y.cminstance.refresh()})},destroy:function(){var y=this.cminstance.doc.cm.getWrapperElement();y&&y.remove&&y.remove()},handerCodeChange:function(y){if(y!==this.cminstance.getValue()){var k=this.cminstance.getScrollInfo();this.cminstance.setValue(y),this.content=y,this.cminstance.scrollTo(k.left,k.top)}this.unseenLineMarkers()},unseenLineMarkers:function(){var y=this;this.unseenLines!==void 0&&this.marker!==void 0&&this.unseenLines.forEach(function(k){var _=y.cminstance.lineInfo(k);y.cminstance.setGutterMarker(k,"breakpoints",_.gutterMarkers?null:y.marker())})},switchMerge:function(){var y=this.cminstance.doc.history,k=this.cminstance.doc.cleanGeneration;this.options.value=this.cminstance.getValue(),this.destroy(),this.initialize(),this.cminstance.doc.history=y,this.cminstance.doc.cleanGeneration=k}},mounted:function(){this.initialize()},beforeDestroy:function(){this.destroy()}}},function(l,c,g){Object.defineProperty(c,"__esModule",{value:!0});var p=g(1),w=g.n(p);for(var b in p)["default","default"].indexOf(b)<0&&function(L){g.d(c,L,function(){return p[L]})}(b);var y=g(5),k=g(4),_=k(w.a,y.a,!1,null,null,null);c.default=_.exports},function(l,c,g){function p(F){return F&&F.__esModule?F:{default:F}}Object.defineProperty(c,"__esModule",{value:!0}),c.install=c.codemirror=c.CodeMirror=void 0;var w=g(0),b=p(w),y=g(2),k=p(y),_=window.CodeMirror||b.default,L=function(F,U){U&&(U.options&&(k.default.props.globalOptions.default=function(){return U.options}),U.events&&(k.default.props.globalEvents.default=function(){return U.events})),F.component(k.default.name,k.default)},H={CodeMirror:_,codemirror:k.default,install:L};c.default=H,c.CodeMirror=_,c.codemirror=k.default,c.install=L},function(l,c){l.exports=function(g,p,w,b,y,k){var _,L=g=g||{},H=typeof g.default;H!=="object"&&H!=="function"||(_=g,L=g.default);var F=typeof L=="function"?L.options:L;p&&(F.render=p.render,F.staticRenderFns=p.staticRenderFns,F._compiled=!0),w&&(F.functional=!0),y&&(F._scopeId=y);var U;if(k?(U=function(D){D=D||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,D||typeof __VUE_SSR_CONTEXT__>"u"||(D=__VUE_SSR_CONTEXT__),b&&b.call(this,D),D&&D._registeredComponents&&D._registeredComponents.add(k)},F._ssrRegister=U):b&&(U=b),U){var M=F.functional,A=M?F.render:F.beforeCreate;M?(F._injectStyles=U,F.render=function(D,P){return U.call(P),A(D,P)}):F.beforeCreate=A?[].concat(A,U):[U]}return{esModule:_,exports:L,options:F}}},function(l,c,g){var p=function(){var y=this,k=y.$createElement,_=y._self._c||k;return _("div",{staticClass:"vue-codemirror",class:{merge:y.merge}},[y.merge?_("div",{ref:"mergeview"}):_("textarea",{ref:"textarea",attrs:{name:y.name,placeholder:y.placeholder}})])},w=[],b={render:p,staticRenderFns:w};c.a=b}])})})(uo);var Ff=uo.exports;function za(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Br=za();function fo(f){Br=f}const co=/[&<>"']/,Wf=new RegExp(co.source,"g"),ho=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Hf=new RegExp(ho.source,"g"),$f={"&":"&","<":"<",">":">",'"':""","'":"'"},po=f=>$f[f];function zt(f,i){if(i){if(co.test(f))return f.replace(Wf,po)}else if(ho.test(f))return f.replace(Hf,po);return f}const Bf=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Uf(f){return f.replace(Bf,(i,s)=>(s=s.toLowerCase(),s==="colon"?":":s.charAt(0)==="#"?s.charAt(1)==="x"?String.fromCharCode(parseInt(s.substring(2),16)):String.fromCharCode(+s.substring(1)):""))}const jf=/(^|[^\[])\^/g;function Pe(f,i){let s=typeof f=="string"?f:f.source;i=i||"";const l={replace:(c,g)=>{let p=typeof g=="string"?g:g.source;return p=p.replace(jf,"$1"),s=s.replace(c,p),l},getRegex:()=>new RegExp(s,i)};return l}function go(f){try{f=encodeURI(f).replace(/%25/g,"%")}catch{return null}return f}const Gn={exec:()=>null};function vo(f,i){const s=f.replace(/\|/g,(g,p,w)=>{let b=!1,y=p;for(;--y>=0&&w[y]==="\\";)b=!b;return b?"|":" |"}),l=s.split(/ \|/);let c=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),i)if(l.length>i)l.splice(i);else for(;l.length<i;)l.push("");for(;c<l.length;c++)l[c]=l[c].trim().replace(/\\\|/g,"|");return l}function Pi(f,i,s){const l=f.length;if(l===0)return"";let c=0;for(;c<l&&f.charAt(l-c-1)===i;)c++;return f.slice(0,l-c)}function qf(f,i){if(f.indexOf(i[1])===-1)return-1;let s=0;for(let l=0;l<f.length;l++)if(f[l]==="\\")l++;else if(f[l]===i[0])s++;else if(f[l]===i[1]&&(s--,s<0))return l;return-1}function mo(f,i,s,l){const c=i.href,g=i.title?zt(i.title):null,p=f[1].replace(/\\([\[\]])/g,"$1");if(f[0].charAt(0)!=="!"){l.state.inLink=!0;const w={type:"link",raw:s,href:c,title:g,text:p,tokens:l.inlineTokens(p)};return l.state.inLink=!1,w}return{type:"image",raw:s,href:c,title:g,text:zt(p)}}function Kf(f,i){const s=f.match(/^(\s+)(?:```)/);if(s===null)return i;const l=s[1];return i.split(`
|
|
26
|
-
`).map(
|
|
27
|
-
`)}class
|
|
28
|
-
`)}}}fences(
|
|
29
|
-
`),
|
|
30
|
-
`,1)[0].replace(/^\t+/,
|
|
31
|
-
`,1)[0],
|
|
32
|
-
`,
|
|
33
|
-
`,1)[0];if(
|
|
34
|
-
`+
|
|
35
|
-
`+
|
|
36
|
-
`,
|
|
37
|
-
`):[],p={type:"table",raw:
|
|
38
|
-
`?
|
|
39
|
-
]`).replace("lheading",
|
|
40
|
-
`),this.blockTokens(
|
|
41
|
-
`:
|
|
42
|
-
`+
|
|
43
|
-
`+
|
|
44
|
-
`+
|
|
45
|
-
`+
|
|
46
|
-
`+
|
|
47
|
-
`+
|
|
48
|
-
`+
|
|
49
|
-
`+
|
|
50
|
-
`,
|
|
51
|
-
`:"<pre><code>"+(
|
|
52
|
-
`}blockquote(
|
|
53
|
-
${
|
|
54
|
-
`}html(
|
|
3
|
+
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var s=e.indexOf(`
|
|
4
|
+
`,t);s==-1&&(s=e.length);var l=e.slice(t,e.charAt(s-1)=="\r"?s-1:s),c=l.indexOf("\r");c!=-1?(i.push(l.slice(0,c)),t+=c+1):(i.push(l),t=s+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Fn=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},ia=function(){var e=k("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),sn=null;function hs(e){if(sn!=null)return sn;var t=Q(e,k("span","x")),i=t.getBoundingClientRect(),r=G(t,0,1).getBoundingClientRect();return sn=Math.abs(i.left-r.left)>1}var Cr={},on={};function ln(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Cr[e]=t}function tr(e,t){on[e]=t}function Tr(e){if(typeof e=="string"&&on.hasOwnProperty(e))e=on[e];else if(e&&typeof e.name=="string"&&on.hasOwnProperty(e.name)){var t=on[e.name];typeof t=="string"&&(t={name:t}),e=Zn(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Tr("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Tr("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function _r(e,t){t=Tr(t);var i=Cr[t.name];if(!i)return _r(e,"text/plain");var r=i(e,t);if(Pn.hasOwnProperty(t.name)){var s=Pn[t.name];for(var l in s)s.hasOwnProperty(l)&&(r.hasOwnProperty(l)&&(r["_"+l]=r[l]),r[l]=s[l])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var c in t.modeProps)r[c]=t.modeProps[c];return r}var Pn={};function Lr(e,t){var i=Pn.hasOwnProperty(e)?Pn[e]:Pn[e]={};ke(t,i)}function gn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var s=t[r];s instanceof Array&&(s=s.concat([])),i[r]=s}return i}function fi(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Er(e,t,i){return e.startState?e.startState(t,i):!0}var nt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};nt.prototype.eol=function(){return this.pos>=this.string.length},nt.prototype.sol=function(){return this.pos==this.lineStart},nt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},nt.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},nt.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},nt.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},nt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},nt.prototype.skipToEnd=function(){this.pos=this.string.length},nt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},nt.prototype.backUp=function(e){this.pos-=e},nt.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=_e(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?_e(this.string,this.lineStart,this.tabSize):0)},nt.prototype.indentation=function(){return _e(this.string,null,this.tabSize)-(this.lineStart?_e(this.string,this.lineStart,this.tabSize):0)},nt.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(c){return i?c.toLowerCase():c},s=this.string.substr(this.pos,e.length);if(r(s)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var l=this.string.slice(this.pos).match(e);return l&&l.index>0?null:(l&&t!==!1&&(this.pos+=l[0].length),l)}},nt.prototype.current=function(){return this.string.slice(this.start,this.pos)},nt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},nt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},nt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function fe(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var s=i.children[r],l=s.chunkSize();if(t<l){i=s;break}t-=l}return i.lines[t]}function Sn(e,t,i){var r=[],s=t.line;return e.iter(t.line,i.line+1,function(l){var c=l.text;s==i.line&&(c=c.slice(0,i.ch)),s==t.line&&(c=c.slice(t.ch)),r.push(c),++s}),r}function ci(e,t,i){var r=[];return e.iter(t,i,function(s){r.push(s.text)}),r}function Kt(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function b(e){if(e.parent==null)return null;for(var t=e.parent,i=we(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var s=0;r.children[s]!=t;++s)i+=r.children[s].chunkSize();return i+t.first}function T(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var s=e.children[r],l=s.height;if(t<l){e=s;continue e}t-=l,i+=s.chunkSize()}return i}while(!e.lines);for(var c=0;c<e.lines.length;++c){var h=e.lines[c],g=h.height;if(t<g)break;t-=g}return i+c}function j(e,t){return t>=e.first&&t<e.first+e.size}function Y(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function P(e,t,i){if(i===void 0&&(i=null),!(this instanceof P))return new P(e,t,i);this.line=e,this.ch=t,this.sticky=i}function re(e,t){return e.line-t.line||e.ch-t.ch}function $e(e,t){return e.sticky==t.sticky&&re(e,t)==0}function mt(e){return P(e.line,e.ch)}function It(e,t){return re(e,t)<0?t:e}function Dr(e,t){return re(e,t)<0?e:t}function Ul(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function Se(e,t){if(t.line<e.first)return P(e.first,0);var i=e.first+e.size-1;return t.line>i?P(i,fe(e,i).text.length):Yp(t,fe(e,t.line).text.length)}function Yp(e,t){var i=e.ch;return i==null||i>t?P(e.line,t):i<0?P(e.line,0):e}function ql(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=Se(e,t[r]);return i}var aa=function(e,t){this.state=e,this.lookAhead=t},mn=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};mn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},mn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},mn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},mn.fromSaved=function(e,t,i){return t instanceof aa?new mn(e,gn(e.mode,t.state),i,t.lookAhead):new mn(e,gn(e.mode,t),i)},mn.prototype.save=function(e){var t=e!==!1?gn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new aa(t,this.maxLookAhead):t};function Gl(e,t,i,r){var s=[e.state.modeGen],l={};Ql(e,t.text,e.doc.mode,i,function(v,C){return s.push(v,C)},l,r);for(var c=i.state,h=function(v){i.baseTokens=s;var C=e.state.overlays[v],_=1,M=0;i.state=!0,Ql(e,t.text,C.mode,i,function(I,z){for(var U=_;M<I;){var V=s[_];V>I&&s.splice(_,1,I,s[_+1],V),_+=2,M=Math.min(I,V)}if(z)if(C.opaque)s.splice(U,_-U,I,"overlay "+z),_=U+2;else for(;U<_;U+=2){var ee=s[U+1];s[U+1]=(ee?ee+" ":"")+"overlay "+z}},l),i.state=c,i.baseTokens=null,i.baseTokenPos=1},g=0;g<e.state.overlays.length;++g)h(g);return{styles:s,classes:l.bgClass||l.textClass?l:null}}function Kl(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=hi(e,b(t)),s=t.text.length>e.options.maxHighlightLength&&gn(e.doc.mode,r.state),l=Gl(e,t,r);s&&(r.state=s),t.stateAfter=r.save(!s),t.styles=l.styles,l.classes?t.styleClasses=l.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function hi(e,t,i){var r=e.doc,s=e.display;if(!r.mode.startState)return new mn(r,!0,t);var l=Vp(e,t,i),c=l>r.first&&fe(r,l-1).stateAfter,h=c?mn.fromSaved(r,c,l):new mn(r,Er(r.mode),l);return r.iter(l,t,function(g){ds(e,g.text,h);var v=h.line;g.stateAfter=v==t-1||v%5==0||v>=s.viewFrom&&v<s.viewTo?h.save():null,h.nextLine()}),i&&(r.modeFrontier=h.line),h}function ds(e,t,i,r){var s=e.doc.mode,l=new nt(t,e.options.tabSize,i);for(l.start=l.pos=r||0,t==""&&Xl(s,i.state);!l.eol();)ps(s,l,i.state),l.start=l.pos}function Xl(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var i=fi(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}}function ps(e,t,i,r){for(var s=0;s<10;s++){r&&(r[0]=fi(e,i).mode);var l=e.token(t,i);if(t.pos>t.start)return l}throw new Error("Mode "+e.name+" failed to advance stream.")}var Yl=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Vl(e,t,i,r){var s=e.doc,l=s.mode,c;t=Se(s,t);var h=fe(s,t.line),g=hi(e,t.line,i),v=new nt(h.text,e.options.tabSize,g),C;for(r&&(C=[]);(r||v.pos<t.ch)&&!v.eol();)v.start=v.pos,c=ps(l,v,g.state),r&&C.push(new Yl(v,c,gn(s.mode,g.state)));return r?C:new Yl(v,c,g.state)}function Jl(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function Ql(e,t,i,r,s,l,c){var h=i.flattenSpans;h==null&&(h=e.options.flattenSpans);var g=0,v=null,C=new nt(t,e.options.tabSize,r),_,M=e.options.addModeClass&&[null];for(t==""&&Jl(Xl(i,r.state),l);!C.eol();){if(C.pos>e.options.maxHighlightLength?(h=!1,c&&ds(e,t,r,C.pos),C.pos=t.length,_=null):_=Jl(ps(i,C,r.state,M),l),M){var I=M[0].name;I&&(_="m-"+(_?I+" "+_:I))}if(!h||v!=_){for(;g<C.start;)g=Math.min(C.start,g+5e3),s(g,v);v=_}C.start=C.pos}for(;g<C.pos;){var z=Math.min(C.pos,g+5e3);s(z,v),g=z}}function Vp(e,t,i){for(var r,s,l=e.doc,c=i?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>c;--h){if(h<=l.first)return l.first;var g=fe(l,h-1),v=g.stateAfter;if(v&&(!i||h+(v instanceof aa?v.lookAhead:0)<=l.modeFrontier))return h;var C=_e(g.text,null,e.options.tabSize);(s==null||r>C)&&(s=h-1,r=C)}return s}function Jp(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;r>i;r--){var s=fe(e,r).stateAfter;if(s&&(!(s instanceof aa)||r+s.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}var Zl=!1,Cn=!1;function Qp(){Zl=!0}function Zp(){Cn=!0}function sa(e,t,i){this.marker=e,this.from=t,this.to=i}function di(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function eg(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function tg(e,t,i){var r=i&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function ng(e,t,i){var r;if(e)for(var s=0;s<e.length;++s){var l=e[s],c=l.marker,h=l.from==null||(c.inclusiveLeft?l.from<=t:l.from<t);if(h||l.from==t&&c.type=="bookmark"&&(!i||!l.marker.insertLeft)){var g=l.to==null||(c.inclusiveRight?l.to>=t:l.to>t);(r||(r=[])).push(new sa(c,l.from,g?null:l.to))}}return r}function rg(e,t,i){var r;if(e)for(var s=0;s<e.length;++s){var l=e[s],c=l.marker,h=l.to==null||(c.inclusiveRight?l.to>=t:l.to>t);if(h||l.from==t&&c.type=="bookmark"&&(!i||l.marker.insertLeft)){var g=l.from==null||(c.inclusiveLeft?l.from<=t:l.from<t);(r||(r=[])).push(new sa(c,g?null:l.from-t,l.to==null?null:l.to-t))}}return r}function gs(e,t){if(t.full)return null;var i=j(e,t.from.line)&&fe(e,t.from.line).markedSpans,r=j(e,t.to.line)&&fe(e,t.to.line).markedSpans;if(!i&&!r)return null;var s=t.from.ch,l=t.to.ch,c=re(t.from,t.to)==0,h=ng(i,s,c),g=rg(r,l,c),v=t.text.length==1,C=be(t.text).length+(v?s:0);if(h)for(var _=0;_<h.length;++_){var M=h[_];if(M.to==null){var I=di(g,M.marker);I?v&&(M.to=I.to==null?null:I.to+C):M.to=s}}if(g)for(var z=0;z<g.length;++z){var U=g[z];if(U.to!=null&&(U.to+=C),U.from==null){var V=di(h,U.marker);V||(U.from=C,v&&(h||(h=[])).push(U))}else U.from+=C,v&&(h||(h=[])).push(U)}h&&(h=eu(h)),g&&g!=h&&(g=eu(g));var ee=[h];if(!v){var ae=t.text.length-2,te;if(ae>0&&h)for(var le=0;le<h.length;++le)h[le].to==null&&(te||(te=[])).push(new sa(h[le].marker,null,null));for(var ve=0;ve<ae;++ve)ee.push(te);ee.push(g)}return ee}function eu(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function ig(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(I){if(I.markedSpans)for(var z=0;z<I.markedSpans.length;++z){var U=I.markedSpans[z].marker;U.readOnly&&(!r||we(r,U)==-1)&&(r||(r=[])).push(U)}}),!r)return null;for(var s=[{from:t,to:i}],l=0;l<r.length;++l)for(var c=r[l],h=c.find(0),g=0;g<s.length;++g){var v=s[g];if(!(re(v.to,h.from)<0||re(v.from,h.to)>0)){var C=[g,1],_=re(v.from,h.from),M=re(v.to,h.to);(_<0||!c.inclusiveLeft&&!_)&&C.push({from:v.from,to:h.from}),(M>0||!c.inclusiveRight&&!M)&&C.push({from:h.to,to:v.to}),s.splice.apply(s,C),g+=C.length-3}}return s}function tu(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function nu(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function oa(e){return e.inclusiveLeft?-1:0}function la(e){return e.inclusiveRight?1:0}function ms(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),s=t.find(),l=re(r.from,s.from)||oa(e)-oa(t);if(l)return-l;var c=re(r.to,s.to)||la(e)-la(t);return c||t.id-e.id}function ru(e,t){var i=Cn&&e.markedSpans,r;if(i)for(var s=void 0,l=0;l<i.length;++l)s=i[l],s.marker.collapsed&&(t?s.from:s.to)==null&&(!r||ms(r,s.marker)<0)&&(r=s.marker);return r}function iu(e){return ru(e,!0)}function ua(e){return ru(e,!1)}function ag(e,t){var i=Cn&&e.markedSpans,r;if(i)for(var s=0;s<i.length;++s){var l=i[s];l.marker.collapsed&&(l.from==null||l.from<t)&&(l.to==null||l.to>t)&&(!r||ms(r,l.marker)<0)&&(r=l.marker)}return r}function au(e,t,i,r,s){var l=fe(e,t),c=Cn&&l.markedSpans;if(c)for(var h=0;h<c.length;++h){var g=c[h];if(g.marker.collapsed){var v=g.marker.find(0),C=re(v.from,i)||oa(g.marker)-oa(s),_=re(v.to,r)||la(g.marker)-la(s);if(!(C>=0&&_<=0||C<=0&&_>=0)&&(C<=0&&(g.marker.inclusiveRight&&s.inclusiveLeft?re(v.to,i)>=0:re(v.to,i)>0)||C>=0&&(g.marker.inclusiveRight&&s.inclusiveLeft?re(v.from,r)<=0:re(v.from,r)<0)))return!0}}}function un(e){for(var t;t=iu(e);)e=t.find(-1,!0).line;return e}function sg(e){for(var t;t=ua(e);)e=t.find(1,!0).line;return e}function og(e){for(var t,i;t=ua(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function vs(e,t){var i=fe(e,t),r=un(i);return i==r?t:b(r)}function su(e,t){if(t>e.lastLine())return t;var i=fe(e,t),r;if(!zn(e,i))return t;for(;r=ua(i);)i=r.find(1,!0).line;return b(i)+1}function zn(e,t){var i=Cn&&t.markedSpans;if(i){for(var r=void 0,s=0;s<i.length;++s)if(r=i[s],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&ys(e,t,r))return!0}}}function ys(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return ys(e,r.line,di(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var s=void 0,l=0;l<t.markedSpans.length;++l)if(s=t.markedSpans[l],s.marker.collapsed&&!s.marker.widgetNode&&s.from==i.to&&(s.to==null||s.to!=i.from)&&(s.marker.inclusiveLeft||i.marker.inclusiveRight)&&ys(e,t,s))return!0}function Tn(e){e=un(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var s=i.lines[r];if(s==e)break;t+=s.height}for(var l=i.parent;l;i=l,l=i.parent)for(var c=0;c<l.children.length;++c){var h=l.children[c];if(h==i)break;t+=h.height}return t}function fa(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=iu(r);){var s=i.find(0,!0);r=s.from.line,t+=s.from.ch-s.to.ch}for(r=e;i=ua(r);){var l=i.find(0,!0);t-=r.text.length-l.from.ch,r=l.to.line,t+=r.text.length-l.to.ch}return t}function bs(e){var t=e.display,i=e.doc;t.maxLine=fe(i,i.first),t.maxLineLength=fa(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var s=fa(r);s>t.maxLineLength&&(t.maxLineLength=s,t.maxLine=r)})}var Ar=function(e,t,i){this.text=e,nu(this,t),this.height=i?i(this):1};Ar.prototype.lineNo=function(){return b(this)},rn(Ar);function lg(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),tu(e),nu(e,i);var s=r?r(e):1;s!=e.height&&Kt(e,s)}function ug(e){e.parent=null,tu(e)}var fg={},cg={};function ou(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?cg:fg;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function lu(e,t){var i=J("span",null,null,S?"padding-right: .1px":null),r={pre:J("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var s=0;s<=(t.rest?t.rest.length:0);s++){var l=s?t.rest[s-1]:t.line,c=void 0;r.pos=0,r.addToken=dg,Rn(e.display.measure)&&(c=Pe(l,e.doc.direction))&&(r.addToken=gg(r.addToken,c)),r.map=[];var h=t!=e.display.externalMeasured&&b(l);mg(l,r,Kl(e,l,h)),l.styleClasses&&(l.styleClasses.bgClass&&(r.bgClass=de(l.styleClasses.bgClass,r.bgClass||"")),l.styleClasses.textClass&&(r.textClass=de(l.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(ra(e.display.measure))),s==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(S){var g=r.content.lastChild;(/\bcm-tab\b/.test(g.className)||g.querySelector&&g.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return et(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=de(r.pre.className,r.textClass||"")),r}function hg(e){var t=k("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function dg(e,t,i,r,s,l,c){if(t){var h=e.splitSpaces?pg(t,e.trailingSpace):t,g=e.cm.state.specialChars,v=!1,C;if(!g.test(t))e.col+=t.length,C=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,C),m&&x<9&&(v=!0),e.pos+=t.length;else{C=document.createDocumentFragment();for(var _=0;;){g.lastIndex=_;var M=g.exec(t),I=M?M.index-_:t.length-_;if(I){var z=document.createTextNode(h.slice(_,_+I));m&&x<9?C.appendChild(k("span",[z])):C.appendChild(z),e.map.push(e.pos,e.pos+I,z),e.col+=I,e.pos+=I}if(!M)break;_+=I+1;var U=void 0;if(M[0]==" "){var V=e.cm.options.tabSize,ee=V-e.col%V;U=C.appendChild(k("span",qt(ee),"cm-tab")),U.setAttribute("role","presentation"),U.setAttribute("cm-text"," "),e.col+=ee}else M[0]=="\r"||M[0]==`
|
|
5
|
+
`?(U=C.appendChild(k("span",M[0]=="\r"?"␍":"","cm-invalidchar")),U.setAttribute("cm-text",M[0]),e.col+=1):(U=e.cm.options.specialCharPlaceholder(M[0]),U.setAttribute("cm-text",M[0]),m&&x<9?C.appendChild(k("span",[U])):C.appendChild(U),e.col+=1);e.map.push(e.pos,e.pos+1,U),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,i||r||s||v||l||c){var ae=i||"";r&&(ae+=r),s&&(ae+=s);var te=k("span",[C],ae,l);if(c)for(var le in c)c.hasOwnProperty(le)&&le!="style"&&le!="class"&&te.setAttribute(le,c[le]);return e.content.appendChild(te)}e.content.appendChild(C)}}function pg(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",s=0;s<e.length;s++){var l=e.charAt(s);l==" "&&i&&(s==e.length-1||e.charCodeAt(s+1)==32)&&(l=" "),r+=l,i=l==" "}return r}function gg(e,t){return function(i,r,s,l,c,h,g){s=s?s+" cm-force-border":"cm-force-border";for(var v=i.pos,C=v+r.length;;){for(var _=void 0,M=0;M<t.length&&(_=t[M],!(_.to>v&&_.from<=v));M++);if(_.to>=C)return e(i,r,s,l,c,h,g);e(i,r.slice(0,_.to-v),s,l,null,h,g),l=null,r=r.slice(_.to-v),v=_.to}}}function uu(e,t,i,r){var s=!r&&i.widgetNode;s&&e.map.push(e.pos,e.pos+t,s),!r&&e.cm.display.input.needsContentAttribute&&(s||(s=e.content.appendChild(document.createElement("span"))),s.setAttribute("cm-marker",i.id)),s&&(e.cm.display.input.setUneditable(s),e.content.appendChild(s)),e.pos+=t,e.trailingSpace=!1}function mg(e,t,i){var r=e.markedSpans,s=e.text,l=0;if(!r){for(var c=1;c<i.length;c+=2)t.addToken(t,s.slice(l,l=i[c]),ou(i[c+1],t.cm.options));return}for(var h=s.length,g=0,v=1,C="",_,M,I=0,z,U,V,ee,ae;;){if(I==g){z=U=V=M="",ae=null,ee=null,I=1/0;for(var te=[],le=void 0,ve=0;ve<r.length;++ve){var ge=r[ve],Ae=ge.marker;if(Ae.type=="bookmark"&&ge.from==g&&Ae.widgetNode)te.push(Ae);else if(ge.from<=g&&(ge.to==null||ge.to>g||Ae.collapsed&&ge.to==g&&ge.from==g)){if(ge.to!=null&&ge.to!=g&&I>ge.to&&(I=ge.to,U=""),Ae.className&&(z+=" "+Ae.className),Ae.css&&(M=(M?M+";":"")+Ae.css),Ae.startStyle&&ge.from==g&&(V+=" "+Ae.startStyle),Ae.endStyle&&ge.to==I&&(le||(le=[])).push(Ae.endStyle,ge.to),Ae.title&&((ae||(ae={})).title=Ae.title),Ae.attributes)for(var Ue in Ae.attributes)(ae||(ae={}))[Ue]=Ae.attributes[Ue];Ae.collapsed&&(!ee||ms(ee.marker,Ae)<0)&&(ee=ge)}else ge.from>g&&I>ge.from&&(I=ge.from)}if(le)for(var xt=0;xt<le.length;xt+=2)le[xt+1]==I&&(U+=" "+le[xt]);if(!ee||ee.from==g)for(var Qe=0;Qe<te.length;++Qe)uu(t,0,te[Qe]);if(ee&&(ee.from||0)==g){if(uu(t,(ee.to==null?h+1:ee.to)-g,ee.marker,ee.from==null),ee.to==null)return;ee.to==g&&(ee=!1)}}if(g>=h)break;for(var Ht=Math.min(h,I);;){if(C){var Mt=g+C.length;if(!ee){var lt=Mt>Ht?C.slice(0,Ht-g):C;t.addToken(t,lt,_?_+z:z,V,g+lt.length==I?U:"",M,ae)}if(Mt>=Ht){C=C.slice(Ht-g),g=Ht;break}g=Mt,V=""}C=s.slice(l,l=i[v++]),_=ou(i[v++],t.cm.options)}}}function fu(e,t,i){this.line=t,this.rest=og(t),this.size=this.rest?b(be(this.rest))-i+1:1,this.node=this.text=null,this.hidden=zn(e,t)}function ca(e,t,i){for(var r=[],s,l=t;l<i;l=s){var c=new fu(e.doc,fe(e.doc,l),l);s=l+c.size,r.push(c)}return r}var Ir=null;function vg(e){Ir?Ir.ops.push(e):e.ownsGroup=Ir={ops:[e],delayedCallbacks:[]}}function yg(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var s=e.ops[r];if(s.cursorActivityHandlers)for(;s.cursorActivityCalled<s.cursorActivityHandlers.length;)s.cursorActivityHandlers[s.cursorActivityCalled++].call(null,s.cm)}}while(i<t.length)}function bg(e,t){var i=e.ownsGroup;if(i)try{yg(i)}finally{Ir=null,t(i)}}var pi=null;function vt(e,t){var i=kn(e,t);if(i.length){var r=Array.prototype.slice.call(arguments,2),s;Ir?s=Ir.delayedCallbacks:pi?s=pi:(s=pi=[],setTimeout(xg,0));for(var l=function(h){s.push(function(){return i[h].apply(null,r)})},c=0;c<i.length;++c)l(c)}}function xg(){var e=pi;pi=null;for(var t=0;t<e.length;++t)e[t]()}function cu(e,t,i,r){for(var s=0;s<t.changes.length;s++){var l=t.changes[s];l=="text"?kg(e,t):l=="gutter"?du(e,t,i,r):l=="class"?xs(e,t):l=="widget"&&Sg(e,t,r)}t.changes=null}function gi(e){return e.node==e.text&&(e.node=k("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),m&&x<8&&(e.node.style.zIndex=2)),e.node}function wg(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=gi(t);t.background=r.insertBefore(k("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function hu(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):lu(e,t)}function kg(e,t){var i=t.text.className,r=hu(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,xs(e,t)):i&&(t.text.className=i)}function xs(e,t){wg(e,t),t.line.wrapClass?gi(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function du(e,t,i,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var s=gi(t);t.gutterBackground=k("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),s.insertBefore(t.gutterBackground,t.text)}var l=t.line.gutterMarkers;if(e.options.lineNumbers||l){var c=gi(t),h=t.gutter=k("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),c.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!l||!l["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(k("div",Y(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),l)for(var g=0;g<e.display.gutterSpecs.length;++g){var v=e.display.gutterSpecs[g].className,C=l.hasOwnProperty(v)&&l[v];C&&h.appendChild(k("div",[C],"CodeMirror-gutter-elt","left: "+r.gutterLeft[v]+"px; width: "+r.gutterWidth[v]+"px"))}}}function Sg(e,t,i){t.alignable&&(t.alignable=null);for(var r=ie("CodeMirror-linewidget"),s=t.node.firstChild,l=void 0;s;s=l)l=s.nextSibling,r.test(s.className)&&t.node.removeChild(s);pu(e,t,i)}function Cg(e,t,i,r){var s=hu(e,t);return t.text=t.node=s.pre,s.bgClass&&(t.bgClass=s.bgClass),s.textClass&&(t.textClass=s.textClass),xs(e,t),du(e,t,i,r),pu(e,t,r),t.node}function pu(e,t,i){if(gu(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)gu(e,t.rest[r],t,i,!1)}function gu(e,t,i,r,s){if(t.widgets)for(var l=gi(i),c=0,h=t.widgets;c<h.length;++c){var g=h[c],v=k("div",[g.node],"CodeMirror-linewidget"+(g.className?" "+g.className:""));g.handleMouseEvents||v.setAttribute("cm-ignore-events","true"),Tg(g,v,i,r),e.display.input.setUneditable(v),s&&g.above?l.insertBefore(v,i.gutter||i.text):l.appendChild(v),vt(g,"redraw")}}function Tg(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var s=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(s-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=s+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function mi(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!D(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),Q(t.display.measure,k("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function _n(e,t){for(var i=li(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function ha(e){return e.lineSpace.offsetTop}function ws(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function mu(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Q(e.measure,k("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function vn(e){return Me-e.display.nativeBarWidth}function nr(e){return e.display.scroller.clientWidth-vn(e)-e.display.barWidth}function ks(e){return e.display.scroller.clientHeight-vn(e)-e.display.barHeight}function _g(e,t,i){var r=e.options.lineWrapping,s=r&&nr(e);if(!t.measure.heights||r&&t.measure.width!=s){var l=t.measure.heights=[];if(r){t.measure.width=s;for(var c=t.text.firstChild.getClientRects(),h=0;h<c.length-1;h++){var g=c[h],v=c[h+1];Math.abs(g.bottom-v.bottom)>2&&l.push((g.bottom+v.top)/2-i.top)}}l.push(i.bottom-i.top)}}function vu(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var s=0;s<e.rest.length;s++)if(b(e.rest[s])>i)return{map:e.measure.maps[s],cache:e.measure.caches[s],before:!0}}}function Lg(e,t){t=un(t);var i=b(t),r=e.display.externalMeasured=new fu(e.doc,t,i);r.lineN=i;var s=r.built=lu(e,r);return r.text=s.pre,Q(e.display.lineMeasure,s.pre),r}function yu(e,t,i,r){return yn(e,Or(e,t),i,r)}function Ss(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ar(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Or(e,t){var i=b(t),r=Ss(e,i);r&&!r.text?r=null:r&&r.changes&&(cu(e,r,i,Es(e)),e.curOp.forceUpdate=!0),r||(r=Lg(e,t));var s=vu(r,t,i);return{line:t,view:r,rect:null,map:s.map,cache:s.cache,before:s.before,hasHeights:!1}}function yn(e,t,i,r,s){t.before&&(i=-1);var l=i+(r||""),c;return t.cache.hasOwnProperty(l)?c=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(_g(e,t.view,t.rect),t.hasHeights=!0),c=Dg(e,t,i,r),c.bogus||(t.cache[l]=c)),{left:c.left,right:c.right,top:s?c.rtop:c.top,bottom:s?c.rbottom:c.bottom}}var bu={left:0,right:0,top:0,bottom:0};function xu(e,t,i){for(var r,s,l,c,h,g,v=0;v<e.length;v+=3)if(h=e[v],g=e[v+1],t<h?(s=0,l=1,c="left"):t<g?(s=t-h,l=s+1):(v==e.length-3||t==g&&e[v+3]>t)&&(l=g-h,s=l-1,t>=g&&(c="right")),s!=null){if(r=e[v+2],h==g&&i==(r.insertLeft?"left":"right")&&(c=i),i=="left"&&s==0)for(;v&&e[v-2]==e[v-3]&&e[v-1].insertLeft;)r=e[(v-=3)+2],c="left";if(i=="right"&&s==g-h)for(;v<e.length-3&&e[v+3]==e[v+4]&&!e[v+5].insertLeft;)r=e[(v+=3)+2],c="right";break}return{node:r,start:s,end:l,collapse:c,coverStart:h,coverEnd:g}}function Eg(e,t){var i=bu;if(t=="left")for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var s=e.length-1;s>=0&&(i=e[s]).left==i.right;s--);return i}function Dg(e,t,i,r){var s=xu(t.map,i,r),l=s.node,c=s.start,h=s.end,g=s.collapse,v;if(l.nodeType==3){for(var C=0;C<4;C++){for(;c&&De(t.line.text.charAt(s.coverStart+c));)--c;for(;s.coverStart+h<s.coverEnd&&De(t.line.text.charAt(s.coverStart+h));)++h;if(m&&x<9&&c==0&&h==s.coverEnd-s.coverStart?v=l.parentNode.getBoundingClientRect():v=Eg(G(l,c,h).getClientRects(),r),v.left||v.right||c==0)break;h=c,c=c-1,g="right"}m&&x<11&&(v=Ag(e.display.measure,v))}else{c>0&&(g=r="right");var _;e.options.lineWrapping&&(_=l.getClientRects()).length>1?v=_[r=="right"?_.length-1:0]:v=l.getBoundingClientRect()}if(m&&x<9&&!c&&(!v||!v.left&&!v.right)){var M=l.parentNode.getClientRects()[0];M?v={left:M.left,right:M.left+Mr(e.display),top:M.top,bottom:M.bottom}:v=bu}for(var I=v.top-t.rect.top,z=v.bottom-t.rect.top,U=(I+z)/2,V=t.view.measure.heights,ee=0;ee<V.length-1&&!(U<V[ee]);ee++);var ae=ee?V[ee-1]:0,te=V[ee],le={left:(g=="right"?v.right:v.left)-t.rect.left,right:(g=="left"?v.left:v.right)-t.rect.left,top:ae,bottom:te};return!v.left&&!v.right&&(le.bogus=!0),e.options.singleCursorHeightPerLine||(le.rtop=I,le.rbottom=z),le}function Ag(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!hs(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function wu(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function ku(e){e.display.externalMeasure=null,H(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)wu(e.display.view[t])}function vi(e){ku(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Su(e){return E&&$?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Cu(e){return E&&$?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Cs(e){var t=un(e),i=t.widgets,r=0;if(i)for(var s=0;s<i.length;++s)i[s].above&&(r+=mi(i[s]));return r}function da(e,t,i,r,s){if(!s){var l=Cs(t);i.top+=l,i.bottom+=l}if(r=="line")return i;r||(r="local");var c=Tn(t);if(r=="local"?c+=ha(e.display):c-=e.display.viewOffset,r=="page"||r=="window"){var h=e.display.lineSpace.getBoundingClientRect();c+=h.top+(r=="window"?0:Cu(w(e)));var g=h.left+(r=="window"?0:Su(w(e)));i.left+=g,i.right+=g}return i.top+=c,i.bottom+=c,i}function Tu(e,t,i){if(i=="div")return t;var r=t.left,s=t.top;if(i=="page")r-=Su(w(e)),s-=Cu(w(e));else if(i=="local"||!i){var l=e.display.sizer.getBoundingClientRect();r+=l.left,s+=l.top}var c=e.display.lineSpace.getBoundingClientRect();return{left:r-c.left,top:s-c.top}}function pa(e,t,i,r,s){return r||(r=fe(e.doc,t.line)),da(e,r,yu(e,r,t.ch,s),i)}function fn(e,t,i,r,s,l){r=r||fe(e.doc,t.line),s||(s=Or(e,r));function c(z,U){var V=yn(e,s,z,U?"right":"left",l);return U?V.left=V.right:V.right=V.left,da(e,r,V,i)}var h=Pe(r,e.doc.direction),g=t.ch,v=t.sticky;if(g>=r.text.length?(g=r.text.length,v="before"):g<=0&&(g=0,v="after"),!h)return c(v=="before"?g-1:g,v=="before");function C(z,U,V){var ee=h[U],ae=ee.level==1;return c(V?z-1:z,ae!=V)}var _=Nn(h,g,v),M=er,I=C(g,_,v=="before");return M!=null&&(I.other=C(g,M,v!="before")),I}function _u(e,t){var i=0;t=Se(e.doc,t),e.options.lineWrapping||(i=Mr(e.display)*t.ch);var r=fe(e.doc,t.line),s=Tn(r)+ha(e.display);return{left:i,right:i,top:s,bottom:s+r.height}}function Ts(e,t,i,r,s){var l=P(e,t,i);return l.xRel=s,r&&(l.outside=r),l}function _s(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return Ts(r.first,0,null,-1,-1);var s=T(r,i),l=r.first+r.size-1;if(s>l)return Ts(r.first+r.size-1,fe(r,l).text.length,null,1,1);t<0&&(t=0);for(var c=fe(r,s);;){var h=Ig(e,c,s,t,i),g=ag(c,h.ch+(h.xRel>0||h.outside>0?1:0));if(!g)return h;var v=g.find(1);if(v.line==s)return v;c=fe(r,s=v.line)}}function Lu(e,t,i,r){r-=Cs(t);var s=t.text.length,l=Qt(function(c){return yn(e,i,c-1).bottom<=r},s,0);return s=Qt(function(c){return yn(e,i,c).top>r},l,s),{begin:l,end:s}}function Eu(e,t,i,r){i||(i=Or(e,t));var s=da(e,t,yn(e,i,r),"line").top;return Lu(e,t,i,s)}function Ls(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Ig(e,t,i,r,s){s-=Tn(t);var l=Or(e,t),c=Cs(t),h=0,g=t.text.length,v=!0,C=Pe(t,e.doc.direction);if(C){var _=(e.options.lineWrapping?Ng:Og)(e,t,i,l,C,r,s);v=_.level!=1,h=v?_.from:_.to-1,g=v?_.to:_.from-1}var M=null,I=null,z=Qt(function(ve){var ge=yn(e,l,ve);return ge.top+=c,ge.bottom+=c,Ls(ge,r,s,!1)?(ge.top<=s&&ge.left<=r&&(M=ve,I=ge),!0):!1},h,g),U,V,ee=!1;if(I){var ae=r-I.left<I.right-r,te=ae==v;z=M+(te?0:1),V=te?"after":"before",U=ae?I.left:I.right}else{!v&&(z==g||z==h)&&z++,V=z==0?"after":z==t.text.length?"before":yn(e,l,z-(v?1:0)).bottom+c<=s==v?"after":"before";var le=fn(e,P(i,z,V),"line",t,l);U=le.left,ee=s<le.top?-1:s>=le.bottom?1:0}return z=zt(t.text,z,1),Ts(i,z,V,ee,r-U)}function Og(e,t,i,r,s,l,c){var h=Qt(function(_){var M=s[_],I=M.level!=1;return Ls(fn(e,P(i,I?M.to:M.from,I?"before":"after"),"line",t,r),l,c,!0)},0,s.length-1),g=s[h];if(h>0){var v=g.level!=1,C=fn(e,P(i,v?g.from:g.to,v?"after":"before"),"line",t,r);Ls(C,l,c,!0)&&C.top>c&&(g=s[h-1])}return g}function Ng(e,t,i,r,s,l,c){var h=Lu(e,t,r,c),g=h.begin,v=h.end;/\s/.test(t.text.charAt(v-1))&&v--;for(var C=null,_=null,M=0;M<s.length;M++){var I=s[M];if(!(I.from>=v||I.to<=g)){var z=I.level!=1,U=yn(e,r,z?Math.min(v,I.to)-1:Math.max(g,I.from)).right,V=U<l?l-U+1e9:U-l;(!C||_>V)&&(C=I,_=V)}}return C||(C=s[s.length-1]),C.from<g&&(C={from:g,to:C.to,level:C.level}),C.to>v&&(C={from:C.from,to:v,level:C.level}),C}var rr;function Nr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(rr==null){rr=k("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)rr.appendChild(document.createTextNode("x")),rr.appendChild(k("br"));rr.appendChild(document.createTextNode("x"))}Q(e.measure,rr);var i=rr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),H(e.measure),i||1}function Mr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=k("span","xxxxxxxxxx"),i=k("pre",[t],"CodeMirror-line-like");Q(e.measure,i);var r=t.getBoundingClientRect(),s=(r.right-r.left)/10;return s>2&&(e.cachedCharWidth=s),s||10}function Es(e){for(var t=e.display,i={},r={},s=t.gutters.clientLeft,l=t.gutters.firstChild,c=0;l;l=l.nextSibling,++c){var h=e.display.gutterSpecs[c].className;i[h]=l.offsetLeft+l.clientLeft+s,r[h]=l.clientWidth}return{fixedPos:Ds(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Ds(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Du(e){var t=Nr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/Mr(e.display)-3);return function(s){if(zn(e.doc,s))return 0;var l=0;if(s.widgets)for(var c=0;c<s.widgets.length;c++)s.widgets[c].height&&(l+=s.widgets[c].height);return i?l+(Math.ceil(s.text.length/r)||1)*t:l+t}}function As(e){var t=e.doc,i=Du(e);t.iter(function(r){var s=i(r);s!=r.height&&Kt(r,s)})}function ir(e,t,i,r){var s=e.display;if(!i&&li(t).getAttribute("cm-not-content")=="true")return null;var l,c,h=s.lineSpace.getBoundingClientRect();try{l=t.clientX-h.left,c=t.clientY-h.top}catch{return null}var g=_s(e,l,c),v;if(r&&g.xRel>0&&(v=fe(e.doc,g.line).text).length==g.ch){var C=_e(v,v.length,e.options.tabSize)-v.length;g=P(g.line,Math.max(0,Math.round((l-mu(e.display).left)/Mr(e.display))-C))}return g}function ar(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function Ot(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var s=e.display;if(r&&i<s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>t)&&(s.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=s.viewTo)Cn&&vs(e.doc,t)<s.viewTo&&Bn(e);else if(i<=s.viewFrom)Cn&&su(e.doc,i+r)>s.viewFrom?Bn(e):(s.viewFrom+=r,s.viewTo+=r);else if(t<=s.viewFrom&&i>=s.viewTo)Bn(e);else if(t<=s.viewFrom){var l=ga(e,i,i+r,1);l?(s.view=s.view.slice(l.index),s.viewFrom=l.lineN,s.viewTo+=r):Bn(e)}else if(i>=s.viewTo){var c=ga(e,t,t,-1);c?(s.view=s.view.slice(0,c.index),s.viewTo=c.lineN):Bn(e)}else{var h=ga(e,t,t,-1),g=ga(e,i,i+r,1);h&&g?(s.view=s.view.slice(0,h.index).concat(ca(e,h.lineN,g.lineN)).concat(s.view.slice(g.index)),s.viewTo+=r):Bn(e)}var v=s.externalMeasured;v&&(i<v.lineN?v.lineN+=r:t<v.lineN+v.size&&(s.externalMeasured=null))}function $n(e,t,i){e.curOp.viewChanged=!0;var r=e.display,s=e.display.externalMeasured;if(s&&t>=s.lineN&&t<s.lineN+s.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var l=r.view[ar(e,t)];if(l.node!=null){var c=l.changes||(l.changes=[]);we(c,i)==-1&&c.push(i)}}}function Bn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ga(e,t,i,r){var s=ar(e,t),l,c=e.display.view;if(!Cn||i==e.doc.first+e.doc.size)return{index:s,lineN:i};for(var h=e.display.viewFrom,g=0;g<s;g++)h+=c[g].size;if(h!=t){if(r>0){if(s==c.length-1)return null;l=h+c[s].size-t,s++}else l=h-t;t+=l,i+=l}for(;vs(e.doc,i)!=i;){if(s==(r<0?0:c.length-1))return null;i+=r*c[s-(r<0?1:0)].size,s+=r}return{index:s,lineN:i}}function Mg(e,t,i){var r=e.display,s=r.view;s.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=ca(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=ca(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(ar(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(ca(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,ar(e,i)))),r.viewTo=i}function Au(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var s=t[r];!s.hidden&&(!s.node||s.changes)&&++i}return i}function yi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Iu(e,t){t===void 0&&(t=!0);var i=e.doc,r={},s=r.cursors=document.createDocumentFragment(),l=r.selection=document.createDocumentFragment(),c=e.options.$customCursor;c&&(t=!0);for(var h=0;h<i.sel.ranges.length;h++)if(!(!t&&h==i.sel.primIndex)){var g=i.sel.ranges[h];if(!(g.from().line>=e.display.viewTo||g.to().line<e.display.viewFrom)){var v=g.empty();if(c){var C=c(e,g);C&&Is(e,C,s)}else(v||e.options.showCursorWhenSelecting)&&Is(e,g.head,s);v||Rg(e,g,l)}}return r}function Is(e,t,i){var r=fn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),s=i.appendChild(k("div"," ","CodeMirror-cursor"));if(s.style.left=r.left+"px",s.style.top=r.top+"px",s.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var l=pa(e,t,"div",null,null),c=l.right-l.left;s.style.width=(c>0?c:e.defaultCharWidth())+"px"}if(r.other){var h=i.appendChild(k("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=r.other.left+"px",h.style.top=r.other.top+"px",h.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function ma(e,t){return e.top-t.top||e.left-t.left}function Rg(e,t,i){var r=e.display,s=e.doc,l=document.createDocumentFragment(),c=mu(e.display),h=c.left,g=Math.max(r.sizerWidth,nr(e)-r.sizer.offsetLeft)-c.right,v=s.direction=="ltr";function C(te,le,ve,ge){le<0&&(le=0),le=Math.round(le),ge=Math.round(ge),l.appendChild(k("div",null,"CodeMirror-selected","position: absolute; left: "+te+`px;
|
|
6
|
+
top: `+le+"px; width: "+(ve??g-te)+`px;
|
|
7
|
+
height: `+(ge-le)+"px"))}function _(te,le,ve){var ge=fe(s,te),Ae=ge.text.length,Ue,xt;function Qe(lt,Rt){return pa(e,P(te,lt),"div",ge,Rt)}function Ht(lt,Rt,St){var pt=Eu(e,ge,null,lt),ut=Rt=="ltr"==(St=="after")?"left":"right",rt=St=="after"?pt.begin:pt.end-(/\s/.test(ge.text.charAt(pt.end-1))?2:1);return Qe(rt,ut)[ut]}var Mt=Pe(ge,s.direction);return On(Mt,le||0,ve??Ae,function(lt,Rt,St,pt){var ut=St=="ltr",rt=Qe(lt,ut?"left":"right"),Ft=Qe(Rt-1,ut?"right":"left"),Kr=le==null&<==0,Gn=ve==null&&Rt==Ae,Lt=pt==0,bn=!Mt||pt==Mt.length-1;if(Ft.top-rt.top<=3){var wt=(v?Kr:Gn)&&Lt,io=(v?Gn:Kr)&&bn,Dn=wt?h:(ut?rt:Ft).left,fr=io?g:(ut?Ft:rt).right;C(Dn,rt.top,fr-Dn,rt.bottom)}else{var cr,Dt,Xr,ao;ut?(cr=v&&Kr&&Lt?h:rt.left,Dt=v?g:Ht(lt,St,"before"),Xr=v?h:Ht(Rt,St,"after"),ao=v&&Gn&&bn?g:Ft.right):(cr=v?Ht(lt,St,"before"):h,Dt=!v&&Kr&&Lt?g:rt.right,Xr=!v&&Gn&&bn?h:Ft.left,ao=v?Ht(Rt,St,"after"):g),C(cr,rt.top,Dt-cr,rt.bottom),rt.bottom<Ft.top&&C(h,rt.bottom,null,Ft.top),C(Xr,Ft.top,ao-Xr,Ft.bottom)}(!Ue||ma(rt,Ue)<0)&&(Ue=rt),ma(Ft,Ue)<0&&(Ue=Ft),(!xt||ma(rt,xt)<0)&&(xt=rt),ma(Ft,xt)<0&&(xt=Ft)}),{start:Ue,end:xt}}var M=t.from(),I=t.to();if(M.line==I.line)_(M.line,M.ch,I.ch);else{var z=fe(s,M.line),U=fe(s,I.line),V=un(z)==un(U),ee=_(M.line,M.ch,V?z.text.length+1:null).end,ae=_(I.line,V?0:null,I.ch).start;V&&(ee.top<ae.top-2?(C(ee.right,ee.top,null,ee.bottom),C(h,ae.top,ae.left,ae.bottom)):C(ee.right,ee.top,ae.left-ee.right,ee.bottom)),ee.bottom<ae.top&&C(h,ee.bottom,null,ae.top)}i.appendChild(l)}function Os(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Rr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ou(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ms(e))}function Ns(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Rr(e))},100)}function Ms(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(et(e,"focus",e,t),e.state.focused=!0,K(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),S&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Os(e))}function Rr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(et(e,"blur",e,t),e.state.focused=!1,ze(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function va(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),s=t.lineDiv.getBoundingClientRect().top,l=0,c=0;c<t.view.length;c++){var h=t.view[c],g=e.options.lineWrapping,v=void 0,C=0;if(!h.hidden){if(s+=h.line.height,m&&x<8){var _=h.node.offsetTop+h.node.offsetHeight;v=_-i,i=_}else{var M=h.node.getBoundingClientRect();v=M.bottom-M.top,!g&&h.text.firstChild&&(C=h.text.firstChild.getBoundingClientRect().right-M.left-1)}var I=h.line.height-v;if((I>.005||I<-.005)&&(s<r&&(l-=I),Kt(h.line,v),Nu(h.line),h.rest))for(var z=0;z<h.rest.length;z++)Nu(h.rest[z]);if(C>e.display.sizerWidth){var U=Math.ceil(C/Mr(e.display));U>e.display.maxLineLength&&(e.display.maxLineLength=U,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function Nu(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function ya(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-ha(e));var s=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,l=T(t,r),c=T(t,s);if(i&&i.ensure){var h=i.ensure.from.line,g=i.ensure.to.line;h<l?(l=h,c=T(t,Tn(fe(t,h))+e.wrapper.clientHeight)):Math.min(g,t.lastLine())>=c&&(l=T(t,Tn(fe(t,g))-e.wrapper.clientHeight),c=g)}return{from:l,to:Math.max(c,l+1)}}function Fg(e,t){if(!tt(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),s=null,l=i.wrapper.ownerDocument;if(t.top+r.top<0?s=!0:t.bottom+r.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(s=!1),s!=null&&!N){var c=k("div","",null,`position: absolute;
|
|
8
|
+
top: `+(t.top-i.viewOffset-ha(e.display))+`px;
|
|
9
|
+
height: `+(t.bottom-t.top+vn(e)+i.barHeight)+`px;
|
|
10
|
+
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(c),c.scrollIntoView(s),e.display.lineSpace.removeChild(c)}}}function Pg(e,t,i,r){r==null&&(r=0);var s;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?P(t.line,t.ch+1,"before"):t,t=t.ch?P(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var c=!1,h=fn(e,t),g=!i||i==t?h:fn(e,i);s={left:Math.min(h.left,g.left),top:Math.min(h.top,g.top)-r,right:Math.max(h.left,g.left),bottom:Math.max(h.bottom,g.bottom)+r};var v=Rs(e,s),C=e.doc.scrollTop,_=e.doc.scrollLeft;if(v.scrollTop!=null&&(xi(e,v.scrollTop),Math.abs(e.doc.scrollTop-C)>1&&(c=!0)),v.scrollLeft!=null&&(sr(e,v.scrollLeft),Math.abs(e.doc.scrollLeft-_)>1&&(c=!0)),!c)break}return s}function zg(e,t){var i=Rs(e,t);i.scrollTop!=null&&xi(e,i.scrollTop),i.scrollLeft!=null&&sr(e,i.scrollLeft)}function Rs(e,t){var i=e.display,r=Nr(e.display);t.top<0&&(t.top=0);var s=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,l=ks(e),c={};t.bottom-t.top>l&&(t.bottom=t.top+l);var h=e.doc.height+ws(i),g=t.top<r,v=t.bottom>h-r;if(t.top<s)c.scrollTop=g?0:t.top;else if(t.bottom>s+l){var C=Math.min(t.top,(v?h:t.bottom)-l);C!=s&&(c.scrollTop=C)}var _=e.options.fixedGutter?0:i.gutters.offsetWidth,M=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-_,I=nr(e)-i.gutters.offsetWidth,z=t.right-t.left>I;return z&&(t.right=t.left+I),t.left<10?c.scrollLeft=0:t.left<M?c.scrollLeft=Math.max(0,t.left+_-(z?0:10)):t.right>I+M-3&&(c.scrollLeft=t.right+(z?0:10)-I),c}function Fs(e,t){t!=null&&(ba(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Fr(e){ba(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function bi(e,t,i){(t!=null||i!=null)&&ba(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function $g(e,t){ba(e),e.curOp.scrollToPos=t}function ba(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=_u(e,t.from),r=_u(e,t.to);Mu(e,i,r,t.margin)}}function Mu(e,t,i,r){var s=Rs(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});bi(e,s.scrollLeft,s.scrollTop)}function xi(e,t){Math.abs(e.doc.scrollTop-t)<2||(f||zs(e,{top:t}),Ru(e,t,!0),f&&zs(e),Si(e,100))}function Ru(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function sr(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Bu(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function wi(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+ws(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?i:0,docHeight:r,scrollHeight:r+vn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var or=function(e,t,i){this.cm=i;var r=this.vert=k("div",[k("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),s=this.horiz=k("div",[k("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=s.tabIndex=-1,e(r),e(s),me(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),me(s,"scroll",function(){s.clientWidth&&t(s.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,m&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};or.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var s=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+s)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+l)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},or.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},or.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},or.prototype.zeroWidthHack=function(){var e=ne&&!F?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ft,this.disableVert=new ft},or.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var s=e.getBoundingClientRect(),l=i=="vert"?document.elementFromPoint(s.right-1,(s.top+s.bottom)/2):document.elementFromPoint((s.right+s.left)/2,s.bottom-1);l!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},or.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ki=function(){};ki.prototype.update=function(){return{bottom:0,right:0}},ki.prototype.setScrollLeft=function(){},ki.prototype.setScrollTop=function(){},ki.prototype.clear=function(){};function Pr(e,t){t||(t=wi(e));var i=e.display.barWidth,r=e.display.barHeight;Fu(e,t);for(var s=0;s<4&&i!=e.display.barWidth||r!=e.display.barHeight;s++)i!=e.display.barWidth&&e.options.lineWrapping&&va(e),Fu(e,wi(e)),i=e.display.barWidth,r=e.display.barHeight}function Fu(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Pu={native:or,null:ki};function zu(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ze(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Pu[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),me(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?sr(e,t):xi(e,t)},e),e.display.scrollbars.addClass&&K(e.display.wrapper,e.display.scrollbars.addClass)}var Bg=0;function lr(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Bg,markArrays:null},vg(e.curOp)}function ur(e){var t=e.curOp;t&&bg(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;Hg(i)})}function Hg(e){for(var t=e.ops,i=0;i<t.length;i++)Wg(t[i]);for(var r=0;r<t.length;r++)jg(t[r]);for(var s=0;s<t.length;s++)Ug(t[s]);for(var l=0;l<t.length;l++)qg(t[l]);for(var c=0;c<t.length;c++)Gg(t[c])}function Wg(e){var t=e.cm,i=t.display;Xg(t),e.updateMaxLine&&bs(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new xa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function jg(e){e.updatedDisplay=e.mustUpdate&&Ps(e.cm,e.update)}function Ug(e){var t=e.cm,i=t.display;e.updatedDisplay&&va(t),e.barMeasure=wi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=yu(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+vn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-nr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function qg(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&sr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==R(oe(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Pr(t,e.barMeasure),e.updatedDisplay&&Bs(t,e.barMeasure),e.selectionChanged&&Os(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&Ou(e.cm)}function Gg(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&$u(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&Ru(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&sr(t,e.scrollLeft,!0,!0),e.scrollToPos){var s=Pg(t,Se(r,e.scrollToPos.from),Se(r,e.scrollToPos.to),e.scrollToPos.margin);Fg(t,s)}var l=e.maybeHiddenMarkers,c=e.maybeUnhiddenMarkers;if(l)for(var h=0;h<l.length;++h)l[h].lines.length||et(l[h],"hide");if(c)for(var g=0;g<c.length;++g)c[g].lines.length&&et(c[g],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&et(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Bt(e,t){if(e.curOp)return t();lr(e);try{return t()}finally{ur(e)}}function yt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);lr(e);try{return t.apply(e,arguments)}finally{ur(e)}}}function Et(e){return function(){if(this.curOp)return e.apply(this,arguments);lr(this);try{return e.apply(this,arguments)}finally{ur(this)}}}function bt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);lr(t);try{return e.apply(this,arguments)}finally{ur(t)}}}function Si(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,ce(Kg,e))}function Kg(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=hi(e,t.highlightFrontier),s=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(l){if(r.line>=e.display.viewFrom){var c=l.styles,h=l.text.length>e.options.maxHighlightLength?gn(t.mode,r.state):null,g=Gl(e,l,r,!0);h&&(r.state=h),l.styles=g.styles;var v=l.styleClasses,C=g.classes;C?l.styleClasses=C:v&&(l.styleClasses=null);for(var _=!c||c.length!=l.styles.length||v!=C&&(!v||!C||v.bgClass!=C.bgClass||v.textClass!=C.textClass),M=0;!_&&M<c.length;++M)_=c[M]!=l.styles[M];_&&s.push(r.line),l.stateAfter=r.save(),r.nextLine()}else l.text.length<=e.options.maxHighlightLength&&ds(e,l.text,r),l.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return Si(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),s.length&&Bt(e,function(){for(var l=0;l<s.length;l++)$n(e,s[l],"text")})}}var xa=function(e,t,i){var r=e.display;this.viewport=t,this.visible=ya(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=nr(e),this.force=i,this.dims=Es(e),this.events=[]};xa.prototype.signal=function(e,t){$t(e,t)&&this.events.push(arguments)},xa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)et.apply(null,this.events[e])};function Xg(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=vn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=vn(e)+"px",t.scrollbarsClipped=!0)}function Yg(e){if(e.hasFocus())return null;var t=R(oe(e));if(!t||!D(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=Z(e).getSelection();r.anchorNode&&r.extend&&D(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function Vg(e){if(!(!e||!e.activeElt||e.activeElt==R(Te(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function Ps(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Bn(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Au(e)==0)return!1;Hu(e)&&(Bn(e),t.dims=Es(e));var s=r.first+r.size,l=Math.max(t.visible.from-e.options.viewportMargin,r.first),c=Math.min(s,t.visible.to+e.options.viewportMargin);i.viewFrom<l&&l-i.viewFrom<20&&(l=Math.max(r.first,i.viewFrom)),i.viewTo>c&&i.viewTo-c<20&&(c=Math.min(s,i.viewTo)),Cn&&(l=vs(e.doc,l),c=su(e.doc,c));var h=l!=i.viewFrom||c!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Mg(e,l,c),i.viewOffset=Tn(fe(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var g=Au(e);if(!h&&g==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var v=Yg(e);return g>4&&(i.lineDiv.style.display="none"),Jg(e,i.updateLineNumbers,t.dims),g>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,Vg(v),H(i.cursorDiv),H(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,h&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,Si(e,400)),i.updateLineNumbers=null,!0}function $u(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==nr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ws(e.display)-ks(e),i.top)}),t.visible=ya(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=ya(e.display,e.doc,i));if(!Ps(e,t))break;va(e);var s=wi(e);yi(e),Pr(e,s),Bs(e,s),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function zs(e,t){var i=new xa(e,t);if(Ps(e,i)){va(e),$u(e,i);var r=wi(e);yi(e),Pr(e,r),Bs(e,r),i.finish()}}function Jg(e,t,i){var r=e.display,s=e.options.lineNumbers,l=r.lineDiv,c=l.firstChild;function h(z){var U=z.nextSibling;return S&&ne&&e.display.currentWheelTarget==z?z.style.display="none":z.parentNode.removeChild(z),U}for(var g=r.view,v=r.viewFrom,C=0;C<g.length;C++){var _=g[C];if(!_.hidden)if(!_.node||_.node.parentNode!=l){var M=Cg(e,_,v,i);l.insertBefore(M,c)}else{for(;c!=_.node;)c=h(c);var I=s&&t!=null&&t<=v&&_.lineNumber;_.changes&&(we(_.changes,"gutter")>-1&&(I=!1),cu(e,_,v,i)),I&&(H(_.lineNumber),_.lineNumber.appendChild(document.createTextNode(Y(e.options,v)))),c=_.node.nextSibling}v+=_.size}for(;c;)c=h(c)}function $s(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",vt(e,"gutterChanged",e)}function Bs(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+vn(e)+"px"}function Bu(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Ds(t)-t.scroller.scrollLeft+e.doc.scrollLeft,s=t.gutters.offsetWidth,l=r+"px",c=0;c<i.length;c++)if(!i[c].hidden){e.options.fixedGutter&&(i[c].gutter&&(i[c].gutter.style.left=l),i[c].gutterBackground&&(i[c].gutterBackground.style.left=l));var h=i[c].alignable;if(h)for(var g=0;g<h.length;g++)h[g].style.left=l}e.options.fixedGutter&&(t.gutters.style.left=r+s+"px")}}function Hu(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Y(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var s=r.measure.appendChild(k("div",[k("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),l=s.firstChild.offsetWidth,c=s.offsetWidth-l;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(l,r.lineGutter.offsetWidth-c)+1,r.lineNumWidth=r.lineNumInnerWidth+c,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",$s(e.display),!0}return!1}function Hs(e,t){for(var i=[],r=!1,s=0;s<e.length;s++){var l=e[s],c=null;if(typeof l!="string"&&(c=l.style,l=l.className),l=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:l,style:c})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function Wu(e){var t=e.gutters,i=e.gutterSpecs;H(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var s=i[r],l=s.className,c=s.style,h=t.appendChild(k("div",null,"CodeMirror-gutter "+l));c&&(h.style.cssText=c),l=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",$s(e)}function Ci(e){Wu(e.display),Ot(e),Bu(e)}function Qg(e,t,i,r){var s=this;this.input=i,s.scrollbarFiller=k("div",null,"CodeMirror-scrollbar-filler"),s.scrollbarFiller.setAttribute("cm-not-content","true"),s.gutterFiller=k("div",null,"CodeMirror-gutter-filler"),s.gutterFiller.setAttribute("cm-not-content","true"),s.lineDiv=J("div",null,"CodeMirror-code"),s.selectionDiv=k("div",null,null,"position: relative; z-index: 1"),s.cursorDiv=k("div",null,"CodeMirror-cursors"),s.measure=k("div",null,"CodeMirror-measure"),s.lineMeasure=k("div",null,"CodeMirror-measure"),s.lineSpace=J("div",[s.measure,s.lineMeasure,s.selectionDiv,s.cursorDiv,s.lineDiv],null,"position: relative; outline: none");var l=J("div",[s.lineSpace],"CodeMirror-lines");s.mover=k("div",[l],null,"position: relative"),s.sizer=k("div",[s.mover],"CodeMirror-sizer"),s.sizerWidth=null,s.heightForcer=k("div",null,null,"position: absolute; height: "+Me+"px; width: 1px;"),s.gutters=k("div",null,"CodeMirror-gutters"),s.lineGutter=null,s.scroller=k("div",[s.sizer,s.heightForcer,s.gutters],"CodeMirror-scroll"),s.scroller.setAttribute("tabIndex","-1"),s.wrapper=k("div",[s.scrollbarFiller,s.gutterFiller,s.scroller],"CodeMirror"),E&&W===105&&(s.wrapper.style.clipPath="inset(0px)"),s.wrapper.setAttribute("translate","no"),m&&x<8&&(s.gutters.style.zIndex=-1,s.scroller.style.paddingRight=0),!S&&!(f&&X)&&(s.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(s.wrapper):e(s.wrapper)),s.viewFrom=s.viewTo=t.first,s.reportedViewFrom=s.reportedViewTo=t.first,s.view=[],s.renderedView=null,s.externalMeasured=null,s.viewOffset=0,s.lastWrapHeight=s.lastWrapWidth=0,s.updateLineNumbers=null,s.nativeBarWidth=s.barHeight=s.barWidth=0,s.scrollbarsClipped=!1,s.lineNumWidth=s.lineNumInnerWidth=s.lineNumChars=null,s.alignWidgets=!1,s.cachedCharWidth=s.cachedTextHeight=s.cachedPaddingH=null,s.maxLine=null,s.maxLineLength=0,s.maxLineChanged=!1,s.wheelDX=s.wheelDY=s.wheelStartX=s.wheelStartY=null,s.shift=!1,s.selForContextMenu=null,s.activeTouch=null,s.gutterSpecs=Hs(r.gutters,r.lineNumbers),Wu(s),i.init(s)}var wa=0,Ln=null;m?Ln=-.53:f?Ln=15:E?Ln=-.7:q&&(Ln=-1/3);function ju(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function Zg(e){var t=ju(e);return t.x*=Ln,t.y*=Ln,t}function Uu(e,t){E&&W==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var i=ju(t),r=i.x,s=i.y,l=Ln;t.deltaMode===0&&(r=t.deltaX,s=t.deltaY,l=1);var c=e.display,h=c.scroller,g=h.scrollWidth>h.clientWidth,v=h.scrollHeight>h.clientHeight;if(r&&g||s&&v){if(s&&ne&&S){e:for(var C=t.target,_=c.view;C!=h;C=C.parentNode)for(var M=0;M<_.length;M++)if(_[M].node==C){e.display.currentWheelTarget=C;break e}}if(r&&!f&&!B&&l!=null){s&&v&&xi(e,Math.max(0,h.scrollTop+s*l)),sr(e,Math.max(0,h.scrollLeft+r*l)),(!s||s&&v)&&Tt(t),c.wheelStartX=null;return}if(s&&l!=null){var I=s*l,z=e.doc.scrollTop,U=z+c.wrapper.clientHeight;I<0?z=Math.max(0,z+I-50):U=Math.min(e.doc.height,U+I+50),zs(e,{top:z,bottom:U})}wa<20&&t.deltaMode!==0&&(c.wheelStartX==null?(c.wheelStartX=h.scrollLeft,c.wheelStartY=h.scrollTop,c.wheelDX=r,c.wheelDY=s,setTimeout(function(){if(c.wheelStartX!=null){var V=h.scrollLeft-c.wheelStartX,ee=h.scrollTop-c.wheelStartY,ae=ee&&c.wheelDY&&ee/c.wheelDY||V&&c.wheelDX&&V/c.wheelDX;c.wheelStartX=c.wheelStartY=null,ae&&(Ln=(Ln*wa+ae)/(wa+1),++wa)}},200)):(c.wheelDX+=r,c.wheelDY+=s))}}var Xt=function(e,t){this.ranges=e,this.primIndex=t};Xt.prototype.primary=function(){return this.ranges[this.primIndex]},Xt.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],r=e.ranges[t];if(!$e(i.anchor,r.anchor)||!$e(i.head,r.head))return!1}return!0},Xt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Be(mt(this.ranges[t].anchor),mt(this.ranges[t].head));return new Xt(e,this.primIndex)},Xt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Xt.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(re(t,r.from())>=0&&re(e,r.to())<=0)return i}return-1};var Be=function(e,t){this.anchor=e,this.head=t};Be.prototype.from=function(){return Dr(this.anchor,this.head)},Be.prototype.to=function(){return It(this.anchor,this.head)},Be.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function cn(e,t,i){var r=e&&e.options.selectionsMayTouch,s=t[i];t.sort(function(M,I){return re(M.from(),I.from())}),i=we(t,s);for(var l=1;l<t.length;l++){var c=t[l],h=t[l-1],g=re(h.to(),c.from());if(r&&!c.empty()?g>0:g>=0){var v=Dr(h.from(),c.from()),C=It(h.to(),c.to()),_=h.empty()?c.from()==c.head:h.from()==h.head;l<=i&&--i,t.splice(--l,2,new Be(_?C:v,_?v:C))}}return new Xt(t,i)}function Hn(e,t){return new Xt([new Be(e,t||e)],0)}function Wn(e){return e.text?P(e.from.line+e.text.length-1,be(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function qu(e,t){if(re(e,t.from)<0)return e;if(re(e,t.to)<=0)return Wn(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Wn(t).ch-t.to.ch),P(i,r)}function Ws(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var s=e.sel.ranges[r];i.push(new Be(qu(s.anchor,t),qu(s.head,t)))}return cn(e.cm,i,e.sel.primIndex)}function Gu(e,t,i){return e.line==t.line?P(i.line,e.ch-t.ch+i.ch):P(i.line+(e.line-t.line),e.ch)}function em(e,t,i){for(var r=[],s=P(e.first,0),l=s,c=0;c<t.length;c++){var h=t[c],g=Gu(h.from,s,l),v=Gu(Wn(h),s,l);if(s=h.to,l=v,i=="around"){var C=e.sel.ranges[c],_=re(C.head,C.anchor)<0;r[c]=new Be(_?v:g,_?g:v)}else r[c]=new Be(g,g)}return new Xt(r,e.sel.primIndex)}function js(e){e.doc.mode=_r(e.options,e.doc.modeOption),Ti(e)}function Ti(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Si(e,100),e.state.modeGen++,e.curOp&&Ot(e)}function Ku(e,t){return t.from.ch==0&&t.to.ch==0&&be(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Us(e,t,i,r){function s(ae){return i?i[ae]:null}function l(ae,te,le){lg(ae,te,le,r),vt(ae,"change",ae,t)}function c(ae,te){for(var le=[],ve=ae;ve<te;++ve)le.push(new Ar(v[ve],s(ve),r));return le}var h=t.from,g=t.to,v=t.text,C=fe(e,h.line),_=fe(e,g.line),M=be(v),I=s(v.length-1),z=g.line-h.line;if(t.full)e.insert(0,c(0,v.length)),e.remove(v.length,e.size-v.length);else if(Ku(e,t)){var U=c(0,v.length-1);l(_,_.text,I),z&&e.remove(h.line,z),U.length&&e.insert(h.line,U)}else if(C==_)if(v.length==1)l(C,C.text.slice(0,h.ch)+M+C.text.slice(g.ch),I);else{var V=c(1,v.length-1);V.push(new Ar(M+C.text.slice(g.ch),I,r)),l(C,C.text.slice(0,h.ch)+v[0],s(0)),e.insert(h.line+1,V)}else if(v.length==1)l(C,C.text.slice(0,h.ch)+v[0]+_.text.slice(g.ch),s(0)),e.remove(h.line+1,z);else{l(C,C.text.slice(0,h.ch)+v[0],s(0)),l(_,M+_.text.slice(g.ch),I);var ee=c(1,v.length-1);z>1&&e.remove(h.line+1,z-1),e.insert(h.line+1,ee)}vt(e,"change",e,t)}function jn(e,t,i){function r(s,l,c){if(s.linked)for(var h=0;h<s.linked.length;++h){var g=s.linked[h];if(g.doc!=l){var v=c&&g.sharedHist;i&&!v||(t(g.doc,v),r(g.doc,s,v))}}}r(e,null,!0)}function Xu(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,As(e),js(e),Yu(e),e.options.direction=t.direction,e.options.lineWrapping||bs(e),e.options.mode=t.modeOption,Ot(e)}function Yu(e){(e.doc.direction=="rtl"?K:ze)(e.display.lineDiv,"CodeMirror-rtl")}function tm(e){Bt(e,function(){Yu(e),Ot(e)})}function ka(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function qs(e,t){var i={from:mt(t.from),to:Wn(t),text:Sn(e,t.from,t.to)};return Qu(e,i,t.from.line,t.to.line+1),jn(e,function(r){return Qu(r,i,t.from.line,t.to.line+1)},!0),i}function Vu(e){for(;e.length;){var t=be(e);if(t.ranges)e.pop();else break}}function nm(e,t){if(t)return Vu(e.done),be(e.done);if(e.done.length&&!be(e.done).ranges)return be(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),be(e.done)}function Ju(e,t,i,r){var s=e.history;s.undone.length=0;var l=+new Date,c,h;if((s.lastOp==r||s.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&s.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(c=nm(s,s.lastOp==r)))h=be(c.changes),re(t.from,t.to)==0&&re(t.from,h.to)==0?h.to=Wn(t):c.changes.push(qs(e,t));else{var g=be(s.done);for((!g||!g.ranges)&&Sa(e.sel,s.done),c={changes:[qs(e,t)],generation:s.generation},s.done.push(c);s.done.length>s.undoDepth;)s.done.shift(),s.done[0].ranges||s.done.shift()}s.done.push(i),s.generation=++s.maxGeneration,s.lastModTime=s.lastSelTime=l,s.lastOp=s.lastSelOp=r,s.lastOrigin=s.lastSelOrigin=t.origin,h||et(e,"historyAdded")}function rm(e,t,i,r){var s=t.charAt(0);return s=="*"||s=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function im(e,t,i,r){var s=e.history,l=r&&r.origin;i==s.lastSelOp||l&&s.lastSelOrigin==l&&(s.lastModTime==s.lastSelTime&&s.lastOrigin==l||rm(e,l,be(s.done),t))?s.done[s.done.length-1]=t:Sa(t,s.done),s.lastSelTime=+new Date,s.lastSelOrigin=l,s.lastSelOp=i,r&&r.clearRedo!==!1&&Vu(s.undone)}function Sa(e,t){var i=be(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Qu(e,t,i,r){var s=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(c){c.markedSpans&&((s||(s=t["spans_"+e.id]={}))[l]=c.markedSpans),++l})}function am(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function sm(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],s=0;s<t.text.length;++s)r.push(am(i[s]));return r}function Zu(e,t){var i=sm(e,t),r=gs(e,t);if(!i)return r;if(!r)return i;for(var s=0;s<i.length;++s){var l=i[s],c=r[s];if(l&&c)e:for(var h=0;h<c.length;++h){for(var g=c[h],v=0;v<l.length;++v)if(l[v].marker==g.marker)continue e;l.push(g)}else c&&(i[s]=c)}return i}function zr(e,t,i){for(var r=[],s=0;s<e.length;++s){var l=e[s];if(l.ranges){r.push(i?Xt.prototype.deepCopy.call(l):l);continue}var c=l.changes,h=[];r.push({changes:h});for(var g=0;g<c.length;++g){var v=c[g],C=void 0;if(h.push({from:v.from,to:v.to,text:v.text}),t)for(var _ in v)(C=_.match(/^spans_(\d+)$/))&&we(t,Number(C[1]))>-1&&(be(h)[_]=v[_],delete v[_])}}return r}function Gs(e,t,i,r){if(r){var s=e.anchor;if(i){var l=re(t,s)<0;l!=re(i,s)<0?(s=t,t=i):l!=re(t,i)<0&&(t=i)}return new Be(s,t)}else return new Be(i||t,t)}function Ca(e,t,i,r,s){s==null&&(s=e.cm&&(e.cm.display.shift||e.extend)),_t(e,new Xt([Gs(e.sel.primary(),t,i,s)],0),r)}function ef(e,t,i){for(var r=[],s=e.cm&&(e.cm.display.shift||e.extend),l=0;l<e.sel.ranges.length;l++)r[l]=Gs(e.sel.ranges[l],t[l],null,s);var c=cn(e.cm,r,e.sel.primIndex);_t(e,c,i)}function Ks(e,t,i,r){var s=e.sel.ranges.slice(0);s[t]=i,_t(e,cn(e.cm,s,e.sel.primIndex),r)}function tf(e,t,i,r){_t(e,Hn(t,i),r)}function om(e,t,i){var r={ranges:t.ranges,update:function(s){this.ranges=[];for(var l=0;l<s.length;l++)this.ranges[l]=new Be(Se(e,s[l].anchor),Se(e,s[l].head))},origin:i&&i.origin};return et(e,"beforeSelectionChange",e,r),e.cm&&et(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?cn(e.cm,r.ranges,r.ranges.length-1):t}function nf(e,t,i){var r=e.history.done,s=be(r);s&&s.ranges?(r[r.length-1]=t,Ta(e,t,i)):_t(e,t,i)}function _t(e,t,i){Ta(e,t,i),im(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Ta(e,t,i){($t(e,"beforeSelectionChange")||e.cm&&$t(e.cm,"beforeSelectionChange"))&&(t=om(e,t,i));var r=i&&i.bias||(re(t.primary().head,e.sel.primary().head)<0?-1:1);rf(e,sf(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Fr(e.cm)}function rf(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Zt(e.cm)),vt(e,"cursorActivity",e))}function af(e){rf(e,sf(e,e.sel,null,!1))}function sf(e,t,i,r){for(var s,l=0;l<t.ranges.length;l++){var c=t.ranges[l],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[l],g=_a(e,c.anchor,h&&h.anchor,i,r),v=c.head==c.anchor?g:_a(e,c.head,h&&h.head,i,r);(s||g!=c.anchor||v!=c.head)&&(s||(s=t.ranges.slice(0,l)),s[l]=new Be(g,v))}return s?cn(e.cm,s,t.primIndex):t}function $r(e,t,i,r,s){var l=fe(e,t.line);if(l.markedSpans)for(var c=0;c<l.markedSpans.length;++c){var h=l.markedSpans[c],g=h.marker,v="selectLeft"in g?!g.selectLeft:g.inclusiveLeft,C="selectRight"in g?!g.selectRight:g.inclusiveRight;if((h.from==null||(v?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(C?h.to>=t.ch:h.to>t.ch))){if(s&&(et(g,"beforeCursorEnter"),g.explicitlyCleared))if(l.markedSpans){--c;continue}else break;if(!g.atomic)continue;if(i){var _=g.find(r<0?1:-1),M=void 0;if((r<0?C:v)&&(_=of(e,_,-r,_&&_.line==t.line?l:null)),_&&_.line==t.line&&(M=re(_,i))&&(r<0?M<0:M>0))return $r(e,_,t,r,s)}var I=g.find(r<0?-1:1);return(r<0?v:C)&&(I=of(e,I,r,I.line==t.line?l:null)),I?$r(e,I,t,r,s):null}}return t}function _a(e,t,i,r,s){var l=r||1,c=$r(e,t,i,l,s)||!s&&$r(e,t,i,l,!0)||$r(e,t,i,-l,s)||!s&&$r(e,t,i,-l,!0);return c||(e.cantEdit=!0,P(e.first,0))}function of(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?Se(e,P(t.line-1)):null:i>0&&t.ch==(r||fe(e,t.line)).text.length?t.line<e.first+e.size-1?P(t.line+1,0):null:new P(t.line,t.ch+i)}function lf(e){e.setSelection(P(e.firstLine(),0),P(e.lastLine()),ct)}function uf(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(s,l,c,h){s&&(r.from=Se(e,s)),l&&(r.to=Se(e,l)),c&&(r.text=c),h!==void 0&&(r.origin=h)}),et(e,"beforeChange",e,r),e.cm&&et(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Br(e,t,i){if(e.cm){if(!e.cm.curOp)return yt(e.cm,Br)(e,t,i);if(e.cm.state.suppressEdits)return}if(!(($t(e,"beforeChange")||e.cm&&$t(e.cm,"beforeChange"))&&(t=uf(e,t,!0),!t))){var r=Zl&&!i&&ig(e,t.from,t.to);if(r)for(var s=r.length-1;s>=0;--s)ff(e,{from:r[s].from,to:r[s].to,text:s?[""]:t.text,origin:t.origin});else ff(e,t)}}function ff(e,t){if(!(t.text.length==1&&t.text[0]==""&&re(t.from,t.to)==0)){var i=Ws(e,t);Ju(e,t,i,e.cm?e.cm.curOp.id:NaN),_i(e,t,i,gs(e,t));var r=[];jn(e,function(s,l){!l&&we(r,s.history)==-1&&(pf(s.history,t),r.push(s.history)),_i(s,t,null,gs(s,t))})}}function La(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var s=e.history,l,c=e.sel,h=t=="undo"?s.done:s.undone,g=t=="undo"?s.undone:s.done,v=0;v<h.length&&(l=h[v],!(i?l.ranges&&!l.equals(e.sel):!l.ranges));v++);if(v!=h.length){for(s.lastOrigin=s.lastSelOrigin=null;;)if(l=h.pop(),l.ranges){if(Sa(l,g),i&&!l.equals(e.sel)){_t(e,l,{clearRedo:!1});return}c=l}else if(r){h.push(l);return}else break;var C=[];Sa(c,g),g.push({changes:C,generation:s.generation}),s.generation=l.generation||++s.maxGeneration;for(var _=$t(e,"beforeChange")||e.cm&&$t(e.cm,"beforeChange"),M=function(U){var V=l.changes[U];if(V.origin=t,_&&!uf(e,V,!1))return h.length=0,{};C.push(qs(e,V));var ee=U?Ws(e,V):be(h);_i(e,V,ee,Zu(e,V)),!U&&e.cm&&e.cm.scrollIntoView({from:V.from,to:Wn(V)});var ae=[];jn(e,function(te,le){!le&&we(ae,te.history)==-1&&(pf(te.history,V),ae.push(te.history)),_i(te,V,null,Zu(te,V))})},I=l.changes.length-1;I>=0;--I){var z=M(I);if(z)return z.v}}}}function cf(e,t){if(t!=0&&(e.first+=t,e.sel=new Xt(kt(e.sel.ranges,function(s){return new Be(P(s.anchor.line+t,s.anchor.ch),P(s.head.line+t,s.head.ch))}),e.sel.primIndex),e.cm)){Ot(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)$n(e.cm,r,"gutter")}}function _i(e,t,i,r){if(e.cm&&!e.cm.curOp)return yt(e.cm,_i)(e,t,i,r);if(t.to.line<e.first){cf(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var s=t.text.length-1-(e.first-t.from.line);cf(e,s),t={from:P(e.first,0),to:P(t.to.line+s,t.to.ch),text:[be(t.text)],origin:t.origin}}var l=e.lastLine();t.to.line>l&&(t={from:t.from,to:P(l,fe(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Sn(e,t.from,t.to),i||(i=Ws(e,t)),e.cm?lm(e.cm,t,r):Us(e,t,r),Ta(e,i,ct),e.cantEdit&&_a(e,P(e.firstLine(),0))&&(e.cantEdit=!1)}}function lm(e,t,i){var r=e.doc,s=e.display,l=t.from,c=t.to,h=!1,g=l.line;e.options.lineWrapping||(g=b(un(fe(r,l.line))),r.iter(g,c.line+1,function(I){if(I==s.maxLine)return h=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Zt(e),Us(r,t,i,Du(e)),e.options.lineWrapping||(r.iter(g,l.line+t.text.length,function(I){var z=fa(I);z>s.maxLineLength&&(s.maxLine=I,s.maxLineLength=z,s.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),Jp(r,l.line),Si(e,400);var v=t.text.length-(c.line-l.line)-1;t.full?Ot(e):l.line==c.line&&t.text.length==1&&!Ku(e.doc,t)?$n(e,l.line,"text"):Ot(e,l.line,c.line+1,v);var C=$t(e,"changes"),_=$t(e,"change");if(_||C){var M={from:l,to:c,text:t.text,removed:t.removed,origin:t.origin};_&&vt(e,"change",e,M),C&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(M)}e.display.selForContextMenu=null}function Hr(e,t,i,r,s){var l;r||(r=i),re(r,i)<0&&(l=[r,i],i=l[0],r=l[1]),typeof t=="string"&&(t=e.splitLines(t)),Br(e,{from:i,to:r,text:t,origin:s})}function hf(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function df(e,t,i,r){for(var s=0;s<e.length;++s){var l=e[s],c=!0;if(l.ranges){l.copied||(l=e[s]=l.deepCopy(),l.copied=!0);for(var h=0;h<l.ranges.length;h++)hf(l.ranges[h].anchor,t,i,r),hf(l.ranges[h].head,t,i,r);continue}for(var g=0;g<l.changes.length;++g){var v=l.changes[g];if(i<v.from.line)v.from=P(v.from.line+r,v.from.ch),v.to=P(v.to.line+r,v.to.ch);else if(t<=v.to.line){c=!1;break}}c||(e.splice(0,s+1),s=0)}}function pf(e,t){var i=t.from.line,r=t.to.line,s=t.text.length-(r-i)-1;df(e.done,i,r,s),df(e.undone,i,r,s)}function Li(e,t,i,r){var s=t,l=t;return typeof t=="number"?l=fe(e,Ul(e,t)):s=b(t),s==null?null:(r(l,s)&&e.cm&&$n(e.cm,s,i),l)}function Ei(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}Ei.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var s=this.lines[i];this.height-=s.height,ug(s),vt(s,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function Di(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var s=e[r];t+=s.chunkSize(),i+=s.height,s.parent=this}this.size=t,this.height=i,this.parent=null}Di.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],s=r.chunkSize();if(e<s){var l=Math.min(t,s-e),c=r.height;if(r.removeInner(e,l),this.height-=c-r.height,s==l&&(this.children.splice(i--,1),r.parent=null),(t-=l)==0)break;e=0}else e-=s}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ei))){var h=[];this.collapse(h),this.children=[new Ei(h)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var s=this.children[r],l=s.chunkSize();if(e<=l){if(s.insertInner(e,t,i),s.lines&&s.lines.length>50){for(var c=s.lines.length%25+25,h=c;h<s.lines.length;){var g=new Ei(s.lines.slice(h,h+=25));s.height-=g.height,this.children.splice(++r,0,g),g.parent=this}s.lines=s.lines.slice(0,c),this.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new Di(t);if(e.parent){e.size-=i.size,e.height-=i.height;var s=we(e.parent.children,e);e.parent.children.splice(s+1,0,i)}else{var r=new Di(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var s=this.children[r],l=s.chunkSize();if(e<l){var c=Math.min(t,l-e);if(s.iterN(e,c,i))return!0;if((t-=c)==0)break;e=0}else e-=l}}};var Ai=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};Ai.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=b(i);if(!(r==null||!t)){for(var s=0;s<t.length;++s)t[s]==this&&t.splice(s--,1);t.length||(i.widgets=null);var l=mi(this);Kt(i,Math.max(0,i.height-l)),e&&(Bt(e,function(){gf(e,i,-l),$n(e,r,"widget")}),vt(e,"lineWidgetCleared",e,this,r))}},Ai.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var s=mi(this)-t;s&&(zn(this.doc,r)||Kt(r,r.height+s),i&&Bt(i,function(){i.curOp.forceUpdate=!0,gf(i,r,s),vt(i,"lineWidgetChanged",i,e,b(r))}))},rn(Ai);function gf(e,t,i){Tn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Fs(e,i)}function um(e,t,i,r){var s=new Ai(e,i,r),l=e.cm;return l&&s.noHScroll&&(l.display.alignWidgets=!0),Li(e,t,"widget",function(c){var h=c.widgets||(c.widgets=[]);if(s.insertAt==null?h.push(s):h.splice(Math.min(h.length,Math.max(0,s.insertAt)),0,s),s.line=c,l&&!zn(e,c)){var g=Tn(c)<e.scrollTop;Kt(c,c.height+mi(s)),g&&Fs(l,s.height),l.curOp.forceUpdate=!0}return!0}),l&&vt(l,"lineWidgetAdded",l,s,typeof t=="number"?t:b(t)),s}var mf=0,Un=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++mf};Un.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&lr(e),$t(this,"clear")){var i=this.find();i&&vt(this,"clear",i.from,i.to)}for(var r=null,s=null,l=0;l<this.lines.length;++l){var c=this.lines[l],h=di(c.markedSpans,this);e&&!this.collapsed?$n(e,b(c),"text"):e&&(h.to!=null&&(s=b(c)),h.from!=null&&(r=b(c))),c.markedSpans=eg(c.markedSpans,h),h.from==null&&this.collapsed&&!zn(this.doc,c)&&e&&Kt(c,Nr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var g=0;g<this.lines.length;++g){var v=un(this.lines[g]),C=fa(v);C>e.display.maxLineLength&&(e.display.maxLine=v,e.display.maxLineLength=C,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&Ot(e,r,s+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&af(e.doc)),e&&vt(e,"markerCleared",e,this,r,s),t&&ur(e),this.parent&&this.parent.clear()}},Un.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,s=0;s<this.lines.length;++s){var l=this.lines[s],c=di(l.markedSpans,this);if(c.from!=null&&(i=P(t?l:b(l),c.from),e==-1))return i;if(c.to!=null&&(r=P(t?l:b(l),c.to),e==1))return r}return i&&{from:i,to:r}},Un.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||Bt(r,function(){var s=t.line,l=b(t.line),c=Ss(r,l);if(c&&(wu(c),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!zn(i.doc,s)&&i.height!=null){var h=i.height;i.height=null;var g=mi(i)-h;g&&Kt(s,s.height+g)}vt(r,"markerChanged",r,e)})},Un.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||we(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Un.prototype.detachLine=function(e){if(this.lines.splice(we(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},rn(Un);function Wr(e,t,i,r,s){if(r&&r.shared)return fm(e,t,i,r,s);if(e.cm&&!e.cm.curOp)return yt(e.cm,Wr)(e,t,i,r,s);var l=new Un(e,s),c=re(t,i);if(r&&ke(r,l,!1),c>0||c==0&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=J("span",[l.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(au(e,t.line,t,i,l)||t.line!=i.line&&au(e,i.line,t,i,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");Zp()}l.addToHistory&&Ju(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var h=t.line,g=e.cm,v;if(e.iter(h,i.line+1,function(_){g&&l.collapsed&&!g.options.lineWrapping&&un(_)==g.display.maxLine&&(v=!0),l.collapsed&&h!=t.line&&Kt(_,0),tg(_,new sa(l,h==t.line?t.ch:null,h==i.line?i.ch:null),e.cm&&e.cm.curOp),++h}),l.collapsed&&e.iter(t.line,i.line+1,function(_){zn(e,_)&&Kt(_,0)}),l.clearOnEnter&&me(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(Qp(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++mf,l.atomic=!0),g){if(v&&(g.curOp.updateMaxLine=!0),l.collapsed)Ot(g,t.line,i.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var C=t.line;C<=i.line;C++)$n(g,C,"text");l.atomic&&af(g.doc),vt(g,"markerAdded",g,l)}return l}var Ii=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};Ii.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();vt(this,"clear")}},Ii.prototype.find=function(e,t){return this.primary.find(e,t)},rn(Ii);function fm(e,t,i,r,s){r=ke(r),r.shared=!1;var l=[Wr(e,t,i,r,s)],c=l[0],h=r.widgetNode;return jn(e,function(g){h&&(r.widgetNode=h.cloneNode(!0)),l.push(Wr(g,Se(g,t),Se(g,i),r,s));for(var v=0;v<g.linked.length;++v)if(g.linked[v].isParent)return;c=be(l)}),new Ii(l,c)}function vf(e){return e.findMarks(P(e.first,0),e.clipPos(P(e.lastLine())),function(t){return t.parent})}function cm(e,t){for(var i=0;i<t.length;i++){var r=t[i],s=r.find(),l=e.clipPos(s.from),c=e.clipPos(s.to);if(re(l,c)){var h=Wr(e,l,c,r.primary,r.primary.type);r.markers.push(h),h.parent=r}}}function hm(e){for(var t=function(r){var s=e[r],l=[s.primary.doc];jn(s.primary.doc,function(g){return l.push(g)});for(var c=0;c<s.markers.length;c++){var h=s.markers[c];we(l,h.doc)==-1&&(h.parent=null,s.markers.splice(c--,1))}},i=0;i<e.length;i++)t(i)}var dm=0,Nt=function(e,t,i,r,s){if(!(this instanceof Nt))return new Nt(e,t,i,r,s);i==null&&(i=0),Di.call(this,[new Ei([new Ar("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var l=P(i,0);this.sel=Hn(l),this.history=new ka(null),this.id=++dm,this.modeOption=t,this.lineSep=r,this.direction=s=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Us(this,{from:l,to:l,text:e}),_t(this,Hn(l),ct)};Nt.prototype=Zn(Di.prototype,{constructor:Nt,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=ci(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:bt(function(e){var t=P(this.first,0),i=this.first+this.size-1;Br(this,{from:t,to:P(i,fe(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&bi(this.cm,0,0),_t(this,Hn(t),ct)}),replaceRange:function(e,t,i,r){t=Se(this,t),i=i?Se(this,i):t,Hr(this,e,t,i,r)},getRange:function(e,t,i){var r=Sn(this,Se(this,e),Se(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(j(this,e))return fe(this,e)},getLineNumber:function(e){return b(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=fe(this,e)),un(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Se(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:bt(function(e,t,i){tf(this,Se(this,typeof e=="number"?P(e,t||0):e),null,i)}),setSelection:bt(function(e,t,i){tf(this,Se(this,e),Se(this,t||e),i)}),extendSelection:bt(function(e,t,i){Ca(this,Se(this,e),t&&Se(this,t),i)}),extendSelections:bt(function(e,t){ef(this,ql(this,e),t)}),extendSelectionsBy:bt(function(e,t){var i=kt(this.sel.ranges,e);ef(this,ql(this,i),t)}),setSelections:bt(function(e,t,i){if(e.length){for(var r=[],s=0;s<e.length;s++)r[s]=new Be(Se(this,e[s].anchor),Se(this,e[s].head||e[s].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),_t(this,cn(this.cm,r,t),i)}}),addSelection:bt(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new Be(Se(this,e),Se(this,t||e))),_t(this,cn(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var s=Sn(this,t[r].from(),t[r].to());i=i?i.concat(s):s}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var s=Sn(this,i[r].from(),i[r].to());e!==!1&&(s=s.join(e||this.lineSeparator())),t[r]=s}return t},replaceSelection:function(e,t,i){for(var r=[],s=0;s<this.sel.ranges.length;s++)r[s]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:bt(function(e,t,i){for(var r=[],s=this.sel,l=0;l<s.ranges.length;l++){var c=s.ranges[l];r[l]={from:c.from(),to:c.to(),text:this.splitLines(e[l]),origin:i}}for(var h=t&&t!="end"&&em(this,r,t),g=r.length-1;g>=0;g--)Br(this,r[g]);h?nf(this,h):this.cm&&Fr(this.cm)}),undo:bt(function(){La(this,"undo")}),redo:bt(function(){La(this,"redo")}),undoSelection:bt(function(){La(this,"undo",!0)}),redoSelection:bt(function(){La(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var s=0;s<e.undone.length;s++)e.undone[s].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new ka(this.history),jn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:zr(this.history.done),undone:zr(this.history.undone)}},setHistory:function(e){var t=this.history=new ka(this.history);t.done=zr(e.done.slice(0),null,!0),t.undone=zr(e.undone.slice(0),null,!0)},setGutterMarker:bt(function(e,t,i){return Li(this,e,"gutter",function(r){var s=r.gutterMarkers||(r.gutterMarkers={});return s[t]=i,!i&&pe(s)&&(r.gutterMarkers=null),!0})}),clearGutter:bt(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&Li(t,i,"gutter",function(){return i.gutterMarkers[e]=null,pe(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!j(this,e)||(t=e,e=fe(this,e),!e))return null}else if(t=b(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:bt(function(e,t,i){return Li(this,e,t=="gutter"?"gutter":"class",function(r){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[s])r[s]=i;else{if(ie(i).test(r[s]))return!1;r[s]+=" "+i}return!0})}),removeLineClass:bt(function(e,t,i){return Li(this,e,t=="gutter"?"gutter":"class",function(r){var s=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",l=r[s];if(l)if(i==null)r[s]=null;else{var c=l.match(ie(i));if(!c)return!1;var h=c.index+c[0].length;r[s]=l.slice(0,c.index)+(!c.index||h==l.length?"":" ")+l.slice(h)||null}else return!1;return!0})}),addLineWidget:bt(function(e,t,i){return um(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Wr(this,Se(this,e),Se(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=Se(this,e),Wr(this,e,e,i,"bookmark")},findMarksAt:function(e){e=Se(this,e);var t=[],i=fe(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var s=i[r];(s.from==null||s.from<=e.ch)&&(s.to==null||s.to>=e.ch)&&t.push(s.marker.parent||s.marker)}return t},findMarks:function(e,t,i){e=Se(this,e),t=Se(this,t);var r=[],s=e.line;return this.iter(e.line,t.line+1,function(l){var c=l.markedSpans;if(c)for(var h=0;h<c.length;h++){var g=c[h];!(g.to!=null&&s==e.line&&e.ch>=g.to||g.from==null&&s!=e.line||g.from!=null&&s==t.line&&g.from>=t.ch)&&(!i||i(g.marker))&&r.push(g.marker.parent||g.marker)}++s}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(s){var l=s.text.length+r;if(l>e)return t=e,!0;e-=l,++i}),Se(this,P(i,t))},indexFromPos:function(e){e=Se(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new Nt(ci(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new Nt(ci(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],cm(r,vf(this)),r},unlinkDoc:function(e){if(e instanceof Ve&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),hm(vf(this));break}}if(e.history==this.history){var r=[e.id];jn(e,function(s){return r.push(s.id)},!0),e.history=new ka(null),e.history.done=zr(this.history.done,r),e.history.undone=zr(this.history.undone,r)}},iterLinkedDocs:function(e){jn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):en(e)},lineSeparator:function(){return this.lineSep||`
|
|
11
|
+
`},setDirection:bt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&tm(this.cm))})}),Nt.prototype.eachLine=Nt.prototype.iter;var yf=0;function pm(e){var t=this;if(bf(t),!(tt(t,e)||_n(t.display,e))){Tt(e),m&&(yf=+new Date);var i=ir(t,e,!0),r=e.dataTransfer.files;if(!(!i||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var s=r.length,l=Array(s),c=0,h=function(){++c==s&&yt(t,function(){i=Se(t.doc,i);var I={from:i,to:i,text:t.doc.splitLines(l.filter(function(z){return z!=null}).join(t.doc.lineSeparator())),origin:"paste"};Br(t.doc,I),nf(t.doc,Hn(Se(t.doc,i),Se(t.doc,Wn(I))))})()},g=function(I,z){if(t.options.allowDropFileTypes&&we(t.options.allowDropFileTypes,I.type)==-1){h();return}var U=new FileReader;U.onerror=function(){return h()},U.onload=function(){var V=U.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(V)){h();return}l[z]=V,h()},U.readAsText(I)},v=0;v<r.length;v++)g(r[v],v);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var C=e.dataTransfer.getData("Text");if(C){var _;if(t.state.draggingText&&!t.state.draggingText.copy&&(_=t.listSelections()),Ta(t.doc,Hn(i,i)),_)for(var M=0;M<_.length;++M)Hr(t.doc,"",_[M].anchor,_[M].head,"drag");t.replaceSelection(C,"around","paste"),t.display.input.focus()}}catch{}}}}function gm(e,t){if(m&&(!e.state.draggingText||+new Date-yf<100)){Mn(t);return}if(!(tt(e,t)||_n(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!q)){var i=k("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",B&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),B&&i.parentNode.removeChild(i)}}function mm(e,t){var i=ir(e,t);if(i){var r=document.createDocumentFragment();Is(e,i,r),e.display.dragCursor||(e.display.dragCursor=k("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Q(e.display.dragCursor,r)}}function bf(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function xf(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var s=t[r].CodeMirror;s&&i.push(s)}i.length&&i[0].operation(function(){for(var l=0;l<i.length;l++)e(i[l])})}}var wf=!1;function vm(){wf||(ym(),wf=!0)}function ym(){var e;me(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,xf(bm)},100))}),me(window,"blur",function(){return xf(Rr)})}function bm(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var qn={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"},Oi=0;Oi<10;Oi++)qn[Oi+48]=qn[Oi+96]=String(Oi);for(var Ea=65;Ea<=90;Ea++)qn[Ea]=String.fromCharCode(Ea);for(var Ni=1;Ni<=12;Ni++)qn[Ni+111]=qn[Ni+63235]="F"+Ni;var En={};En.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"},En.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},En.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},En.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},En.default=ne?En.macDefault:En.pcDefault;function xm(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,s,l,c=0;c<t.length-1;c++){var h=t[c];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))i=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))s=!0;else throw new Error("Unrecognized modifier name: "+h)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),l&&(e="Cmd-"+e),s&&(e="Shift-"+e),e}function wm(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var s=kt(i.split(" "),xm),l=0;l<s.length;l++){var c=void 0,h=void 0;l==s.length-1?(h=s.join(" "),c=r):(h=s.slice(0,l+1).join(" "),c="...");var g=t[h];if(!g)t[h]=c;else if(g!=c)throw new Error("Inconsistent bindings for "+h)}delete e[i]}for(var v in t)e[v]=t[v];return e}function jr(e,t,i,r){t=Da(t);var s=t.call?t.call(e,r):t[e];if(s===!1)return"nothing";if(s==="...")return"multi";if(s!=null&&i(s))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return jr(e,t.fallthrough,i,r);for(var l=0;l<t.fallthrough.length;l++){var c=jr(e,t.fallthrough[l],i,r);if(c)return c}}}function kf(e){var t=typeof e=="string"?e:qn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Sf(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(Oe?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(Oe?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Cf(e,t){if(B&&e.keyCode==34&&e.char)return!1;var i=qn[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Sf(i,e,t))}function Da(e){return typeof e=="string"?En[e]:e}function Ur(e,t){for(var i=e.doc.sel.ranges,r=[],s=0;s<i.length;s++){for(var l=t(i[s]);r.length&&re(l.from,be(r).to)<=0;){var c=r.pop();if(re(c.from,l.from)<0){l.from=c.from;break}}r.push(l)}Bt(e,function(){for(var h=r.length-1;h>=0;h--)Hr(e.doc,"",r[h].from,r[h].to,"+delete");Fr(e)})}function Xs(e,t,i){var r=zt(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ys(e,t,i){var r=Xs(e,t.ch,i);return r==null?null:new P(t.line,r,i<0?"after":"before")}function Vs(e,t,i,r,s){if(e){t.doc.direction=="rtl"&&(s=-s);var l=Pe(i,t.doc.direction);if(l){var c=s<0?be(l):l[0],h=s<0==(c.level==1),g=h?"after":"before",v;if(c.level>0||t.doc.direction=="rtl"){var C=Or(t,i);v=s<0?i.text.length-1:0;var _=yn(t,C,v).top;v=Qt(function(M){return yn(t,C,M).top==_},s<0==(c.level==1)?c.from:c.to-1,v),g=="before"&&(v=Xs(i,v,1))}else v=s<0?c.to:c.from;return new P(r,v,g)}}return new P(r,s<0?i.text.length:0,s<0?"before":"after")}function km(e,t,i,r){var s=Pe(t,e.doc.direction);if(!s)return Ys(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var l=Nn(s,i.ch,i.sticky),c=s[l];if(e.doc.direction=="ltr"&&c.level%2==0&&(r>0?c.to>i.ch:c.from<i.ch))return Ys(t,i,r);var h=function(ee,ae){return Xs(t,ee instanceof P?ee.ch:ee,ae)},g,v=function(ee){return e.options.lineWrapping?(g=g||Or(e,t),Eu(e,t,g,ee)):{begin:0,end:t.text.length}},C=v(i.sticky=="before"?h(i,-1):i.ch);if(e.doc.direction=="rtl"||c.level==1){var _=c.level==1==r<0,M=h(i,_?1:-1);if(M!=null&&(_?M<=c.to&&M<=C.end:M>=c.from&&M>=C.begin)){var I=_?"before":"after";return new P(i.line,M,I)}}var z=function(ee,ae,te){for(var le=function(Ue,xt){return xt?new P(i.line,h(Ue,1),"before"):new P(i.line,Ue,"after")};ee>=0&&ee<s.length;ee+=ae){var ve=s[ee],ge=ae>0==(ve.level!=1),Ae=ge?te.begin:h(te.end,-1);if(ve.from<=Ae&&Ae<ve.to||(Ae=ge?ve.from:h(ve.to,-1),te.begin<=Ae&&Ae<te.end))return le(Ae,ge)}},U=z(l+r,r,C);if(U)return U;var V=r>0?C.end:h(C.begin,-1);return V!=null&&!(r>0&&V==t.text.length)&&(U=z(r>0?0:s.length-1,r,v(V)),U)?U:null}var Mi={selectAll:lf,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ct)},killLine:function(e){return Ur(e,function(t){if(t.empty()){var i=fe(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:P(t.head.line+1,0)}:{from:t.head,to:P(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ur(e,function(t){return{from:P(t.from().line,0),to:Se(e.doc,P(t.to().line+1,0))}})},delLineLeft:function(e){return Ur(e,function(t){return{from:P(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ur(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Ur(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(P(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(P(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Tf(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return _f(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Sm(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},ht)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},ht)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?_f(e,t.head):r},ht)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],i=e.listSelections(),r=e.options.tabSize,s=0;s<i.length;s++){var l=i[s].from(),c=_e(e.getLine(l.line),l.ch,r);t.push(qt(r-c%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Bt(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(t[r].empty()){var s=t[r].head,l=fe(e.doc,s.line).text;if(l){if(s.ch==l.length&&(s=new P(s.line,s.ch-1)),s.ch>0)s=new P(s.line,s.ch+1),e.replaceRange(l.charAt(s.ch-1)+l.charAt(s.ch-2),P(s.line,s.ch-2),s,"+transpose");else if(s.line>e.doc.first){var c=fe(e.doc,s.line-1).text;c&&(s=new P(s.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+c.charAt(c.length-1),P(s.line-1,c.length-1),s,"+transpose"))}}i.push(new Be(s,s))}e.setSelections(i)})},newlineAndIndent:function(e){return Bt(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Fr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
12
|
+
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Tf(e,t){var i=fe(e.doc,t),r=un(i);return r!=i&&(t=b(r)),Vs(!0,e,r,t,1)}function Sm(e,t){var i=fe(e.doc,t),r=sg(i);return r!=i&&(t=b(r)),Vs(!0,e,i,t,-1)}function _f(e,t){var i=Tf(e,t.line),r=fe(e.doc,i.line),s=Pe(r,e.doc.direction);if(!s||s[0].level==0){var l=Math.max(i.ch,r.text.search(/\S/)),c=t.line==i.line&&t.ch<=l&&t.ch;return P(i.line,c?0:l,i.sticky)}return i}function Aa(e,t,i){if(typeof t=="string"&&(t=Mi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),s=t(e)!=Ke}finally{e.display.shift=r,e.state.suppressEdits=!1}return s}function Cm(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var s=jr(t,e.state.keyMaps[r],i,e);if(s)return s}return e.options.extraKeys&&jr(t,e.options.extraKeys,i,e)||jr(t,e.options.keyMap,i,e)}var Tm=new ft;function Ri(e,t,i,r){var s=e.state.keySeq;if(s){if(kf(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Tm.set(50,function(){e.state.keySeq==s&&(e.state.keySeq=null,e.display.input.reset())}),Lf(e,s+" "+t,i,r))return!0}return Lf(e,t,i,r)}function Lf(e,t,i,r){var s=Cm(e,t,r);return s=="multi"&&(e.state.keySeq=t),s=="handled"&&vt(e,"keyHandled",e,t,i),(s=="handled"||s=="multi")&&(Tt(i),Os(e)),!!s}function Ef(e,t){var i=Cf(t,!0);return i?t.shiftKey&&!e.state.keySeq?Ri(e,"Shift-"+i,t,function(r){return Aa(e,r,!0)})||Ri(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Aa(e,r)}):Ri(e,i,t,function(r){return Aa(e,r)}):!1}function _m(e,t,i){return Ri(e,"'"+i+"'",t,function(r){return Aa(e,r,!0)})}var Js=null;function Df(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=R(oe(t)),!tt(t,e))){m&&x<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=Ef(t,e);B&&(Js=r?i:null,!r&&i==88&&!ia&&(ne?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),f&&!ne&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Lm(t)}}function Lm(e){var t=e.display.lineDiv;K(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(ze(t,"CodeMirror-crosshair"),Ct(document,"keyup",i),Ct(document,"mouseover",i))}me(document,"keyup",i),me(document,"mouseover",i)}function Af(e){e.keyCode==16&&(this.doc.sel.shift=!1),tt(this,e)}function If(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(_n(t.display,e)||tt(t,e)||e.ctrlKey&&!e.altKey||ne&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(B&&i==Js){Js=null,Tt(e);return}if(!(B&&(!e.which||e.which<10)&&Ef(t,e))){var s=String.fromCharCode(r??i);s!="\b"&&(_m(t,e,s)||t.display.input.onKeyPress(e))}}}var Em=400,Qs=function(e,t,i){this.time=e,this.pos=t,this.button=i};Qs.prototype.compare=function(e,t,i){return this.time+Em>e&&re(t,this.pos)==0&&i==this.button};var Fi,Pi;function Dm(e,t){var i=+new Date;return Pi&&Pi.compare(i,e,t)?(Fi=Pi=null,"triple"):Fi&&Fi.compare(i,e,t)?(Pi=new Qs(i,e,t),Fi=null,"double"):(Fi=new Qs(i,e,t),Pi=null,"single")}function Of(e){var t=this,i=t.display;if(!(tt(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,_n(i,e)){S||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Zs(t,e)){var r=ir(t,e),s=an(e),l=r?Dm(r,s):"single";Z(t).focus(),s==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Am(t,s,r,l,e))&&(s==1?r?Om(t,r,l,e):li(e)==i.scroller&&Tt(e):s==2?(r&&Ca(t.doc,r),setTimeout(function(){return i.input.focus()},20)):s==3&&(Re?t.display.input.onContextMenu(e):Ns(t)))}}}function Am(e,t,i,r,s){var l="Click";return r=="double"?l="Double"+l:r=="triple"&&(l="Triple"+l),l=(t==1?"Left":t==2?"Middle":"Right")+l,Ri(e,Sf(l,s),s,function(c){if(typeof c=="string"&&(c=Mi[c]),!c)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=c(e,i)!=Ke}finally{e.state.suppressEdits=!1}return h})}function Im(e,t,i){var r=e.getOption("configureMouse"),s=r?r(e,t,i):{};if(s.unit==null){var l=ue?i.shiftKey&&i.metaKey:i.altKey;s.unit=l?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(s.extend==null||e.doc.extend)&&(s.extend=e.doc.extend||i.shiftKey),s.addNew==null&&(s.addNew=ne?i.metaKey:i.ctrlKey),s.moveOnDrag==null&&(s.moveOnDrag=!(ne?i.altKey:i.ctrlKey)),s}function Om(e,t,i,r){m?setTimeout(ce(Ou,e),0):e.curOp.focus=R(oe(e));var s=Im(e,i,r),l=e.doc.sel,c;e.options.dragDrop&&cs&&!e.isReadOnly()&&i=="single"&&(c=l.contains(t))>-1&&(re((c=l.ranges[c]).from(),t)<0||t.xRel>0)&&(re(c.to(),t)>0||t.xRel<0)?Nm(e,r,t,s):Mm(e,r,t,s)}function Nm(e,t,i,r){var s=e.display,l=!1,c=yt(e,function(v){S&&(s.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ns(e)),Ct(s.wrapper.ownerDocument,"mouseup",c),Ct(s.wrapper.ownerDocument,"mousemove",h),Ct(s.scroller,"dragstart",g),Ct(s.scroller,"drop",c),l||(Tt(v),r.addNew||Ca(e.doc,i,null,null,r.extend),S&&!q||m&&x==9?setTimeout(function(){s.wrapper.ownerDocument.body.focus({preventScroll:!0}),s.input.focus()},20):s.input.focus())}),h=function(v){l=l||Math.abs(t.clientX-v.clientX)+Math.abs(t.clientY-v.clientY)>=10},g=function(){return l=!0};S&&(s.scroller.draggable=!0),e.state.draggingText=c,c.copy=!r.moveOnDrag,me(s.wrapper.ownerDocument,"mouseup",c),me(s.wrapper.ownerDocument,"mousemove",h),me(s.scroller,"dragstart",g),me(s.scroller,"drop",c),e.state.delayingBlurEvent=!0,setTimeout(function(){return s.input.focus()},20),s.scroller.dragDrop&&s.scroller.dragDrop()}function Nf(e,t,i){if(i=="char")return new Be(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new Be(P(t.line,0),Se(e.doc,P(t.line+1,0)));var r=i(e,t);return new Be(r.from,r.to)}function Mm(e,t,i,r){m&&Ns(e);var s=e.display,l=e.doc;Tt(t);var c,h,g=l.sel,v=g.ranges;if(r.addNew&&!r.extend?(h=l.sel.contains(i),h>-1?c=v[h]:c=new Be(i,i)):(c=l.sel.primary(),h=l.sel.primIndex),r.unit=="rectangle")r.addNew||(c=new Be(i,i)),i=ir(e,t,!0,!0),h=-1;else{var C=Nf(e,i,r.unit);r.extend?c=Gs(c,C.anchor,C.head,r.extend):c=C}r.addNew?h==-1?(h=v.length,_t(l,cn(e,v.concat([c]),h),{scroll:!1,origin:"*mouse"})):v.length>1&&v[h].empty()&&r.unit=="char"&&!r.extend?(_t(l,cn(e,v.slice(0,h).concat(v.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),g=l.sel):Ks(l,h,c,Pt):(h=0,_t(l,new Xt([c],0),Pt),g=l.sel);var _=i;function M(te){if(re(_,te)!=0)if(_=te,r.unit=="rectangle"){for(var le=[],ve=e.options.tabSize,ge=_e(fe(l,i.line).text,i.ch,ve),Ae=_e(fe(l,te.line).text,te.ch,ve),Ue=Math.min(ge,Ae),xt=Math.max(ge,Ae),Qe=Math.min(i.line,te.line),Ht=Math.min(e.lastLine(),Math.max(i.line,te.line));Qe<=Ht;Qe++){var Mt=fe(l,Qe).text,lt=dt(Mt,Ue,ve);Ue==xt?le.push(new Be(P(Qe,lt),P(Qe,lt))):Mt.length>lt&&le.push(new Be(P(Qe,lt),P(Qe,dt(Mt,xt,ve))))}le.length||le.push(new Be(i,i)),_t(l,cn(e,g.ranges.slice(0,h).concat(le),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(te)}else{var Rt=c,St=Nf(e,te,r.unit),pt=Rt.anchor,ut;re(St.anchor,pt)>0?(ut=St.head,pt=Dr(Rt.from(),St.anchor)):(ut=St.anchor,pt=It(Rt.to(),St.head));var rt=g.ranges.slice(0);rt[h]=Rm(e,new Be(Se(l,pt),ut)),_t(l,cn(e,rt,h),Pt)}}var I=s.wrapper.getBoundingClientRect(),z=0;function U(te){var le=++z,ve=ir(e,te,!0,r.unit=="rectangle");if(ve)if(re(ve,_)!=0){e.curOp.focus=R(oe(e)),M(ve);var ge=ya(s,l);(ve.line>=ge.to||ve.line<ge.from)&&setTimeout(yt(e,function(){z==le&&U(te)}),150)}else{var Ae=te.clientY<I.top?-20:te.clientY>I.bottom?20:0;Ae&&setTimeout(yt(e,function(){z==le&&(s.scroller.scrollTop+=Ae,U(te))}),50)}}function V(te){e.state.selectingText=!1,z=1/0,te&&(Tt(te),s.input.focus()),Ct(s.wrapper.ownerDocument,"mousemove",ee),Ct(s.wrapper.ownerDocument,"mouseup",ae),l.history.lastSelOrigin=null}var ee=yt(e,function(te){te.buttons===0||!an(te)?V(te):U(te)}),ae=yt(e,V);e.state.selectingText=ae,me(s.wrapper.ownerDocument,"mousemove",ee),me(s.wrapper.ownerDocument,"mouseup",ae)}function Rm(e,t){var i=t.anchor,r=t.head,s=fe(e.doc,i.line);if(re(i,r)==0&&i.sticky==r.sticky)return t;var l=Pe(s);if(!l)return t;var c=Nn(l,i.ch,i.sticky),h=l[c];if(h.from!=i.ch&&h.to!=i.ch)return t;var g=c+(h.from==i.ch==(h.level!=1)?0:1);if(g==0||g==l.length)return t;var v;if(r.line!=i.line)v=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var C=Nn(l,r.ch,r.sticky),_=C-c||(r.ch-i.ch)*(h.level==1?-1:1);C==g-1||C==g?v=_<0:v=_>0}var M=l[g+(v?-1:0)],I=v==(M.level==1),z=I?M.from:M.to,U=I?"after":"before";return i.ch==z&&i.sticky==U?t:new Be(new P(i.line,z,U),r)}function Mf(e,t,i,r){var s,l;if(t.touches)s=t.touches[0].clientX,l=t.touches[0].clientY;else try{s=t.clientX,l=t.clientY}catch{return!1}if(s>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Tt(t);var c=e.display,h=c.lineDiv.getBoundingClientRect();if(l>h.bottom||!$t(e,i))return At(t);l-=h.top-c.viewOffset;for(var g=0;g<e.display.gutterSpecs.length;++g){var v=c.gutters.childNodes[g];if(v&&v.getBoundingClientRect().right>=s){var C=T(e.doc,l),_=e.display.gutterSpecs[g];return et(e,i,e,C,_.className,t),At(t)}}}function Zs(e,t){return Mf(e,t,"gutterClick",!0)}function Rf(e,t){_n(e.display,t)||Fm(e,t)||tt(e,t,"contextmenu")||Re||e.display.input.onContextMenu(t)}function Fm(e,t){return $t(e,"gutterContextMenu")?Mf(e,t,"gutterContextMenu",!1):!1}function Ff(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),vi(e)}var qr={toString:function(){return"CodeMirror.Init"}},Pf={},Ia={};function Pm(e){var t=e.optionHandlers;function i(r,s,l,c){e.defaults[r]=s,l&&(t[r]=c?function(h,g,v){v!=qr&&l(h,g,v)}:l)}e.defineOption=i,e.Init=qr,i("value","",function(r,s){return r.setValue(s)},!0),i("mode",null,function(r,s){r.doc.modeOption=s,js(r)},!0),i("indentUnit",2,js,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){Ti(r),vi(r),Ot(r)},!0),i("lineSeparator",null,function(r,s){if(r.doc.lineSep=s,!!s){var l=[],c=r.doc.first;r.doc.iter(function(g){for(var v=0;;){var C=g.text.indexOf(s,v);if(C==-1)break;v=C+s.length,l.push(P(c,C))}c++});for(var h=l.length-1;h>=0;h--)Hr(r.doc,s,l[h],P(l[h].line,l[h].ch+s.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,s,l){r.state.specialChars=new RegExp(s.source+(s.test(" ")?"":"| "),"g"),l!=qr&&r.refresh()}),i("specialCharPlaceholder",hg,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",X?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,s){return r.getInputField().spellcheck=s},!0),i("autocorrect",!1,function(r,s){return r.getInputField().autocorrect=s},!0),i("autocapitalize",!1,function(r,s){return r.getInputField().autocapitalize=s},!0),i("rtlMoveVisually",!se),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Ff(r),Ci(r)},!0),i("keyMap","default",function(r,s,l){var c=Da(s),h=l!=qr&&Da(l);h&&h.detach&&h.detach(r,c),c.attach&&c.attach(r,h||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,$m,!0),i("gutters",[],function(r,s){r.display.gutterSpecs=Hs(s,r.options.lineNumbers),Ci(r)},!0),i("fixedGutter",!0,function(r,s){r.display.gutters.style.left=s?Ds(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Pr(r)},!0),i("scrollbarStyle","native",function(r){zu(r),Pr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,s){r.display.gutterSpecs=Hs(r.options.gutters,s),Ci(r)},!0),i("firstLineNumber",1,Ci,!0),i("lineNumberFormatter",function(r){return r},Ci,!0),i("showCursorWhenSelecting",!1,yi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,s){s=="nocursor"&&(Rr(r),r.display.input.blur()),r.display.input.readOnlyChanged(s)}),i("screenReaderLabel",null,function(r,s){s=s===""?null:s,r.display.input.screenReaderLabelChanged(s)}),i("disableInput",!1,function(r,s){s||r.display.input.reset()},!0),i("dragDrop",!0,zm),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,yi,!0),i("singleCursorHeightPerLine",!0,yi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,Ti,!0),i("addModeClass",!1,Ti,!0),i("pollInterval",100),i("undoDepth",200,function(r,s){return r.doc.history.undoDepth=s}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,Ti,!0),i("moveInputWithCursor",!0,function(r,s){s||r.display.input.resetPosition()}),i("tabindex",null,function(r,s){return r.display.input.getField().tabIndex=s||""}),i("autofocus",null),i("direction","ltr",function(r,s){return r.doc.setDirection(s)},!0),i("phrases",null)}function zm(e,t,i){var r=i&&i!=qr;if(!t!=!r){var s=e.display.dragFunctions,l=t?me:Ct;l(e.display.scroller,"dragstart",s.start),l(e.display.scroller,"dragenter",s.enter),l(e.display.scroller,"dragover",s.over),l(e.display.scroller,"dragleave",s.leave),l(e.display.scroller,"drop",s.drop)}}function $m(e){e.options.lineWrapping?(K(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ze(e.display.wrapper,"CodeMirror-wrap"),bs(e)),As(e),Ot(e),vi(e),setTimeout(function(){return Pr(e)},100)}function Ve(e,t){var i=this;if(!(this instanceof Ve))return new Ve(e,t);this.options=t=t?ke(t):{},ke(Pf,t,!1);var r=t.value;typeof r=="string"?r=new Nt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var s=new Ve.inputStyles[t.inputStyle](this),l=this.display=new Qg(e,r,s,t);l.wrapper.CodeMirror=this,Ff(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zu(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new ft,keySeq:null,specialChars:null},t.autofocus&&!X&&l.input.focus(),m&&x<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Bm(this),vm(),lr(this),this.curOp.forceUpdate=!0,Xu(this,r),t.autofocus&&!X||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&Ms(i)},20):Rr(this);for(var c in Ia)Ia.hasOwnProperty(c)&&Ia[c](this,t[c],qr);Hu(this),t.finishInit&&t.finishInit(this);for(var h=0;h<eo.length;++h)eo[h](this);ur(this),S&&t.lineWrapping&&getComputedStyle(l.lineDiv).textRendering=="optimizelegibility"&&(l.lineDiv.style.textRendering="auto")}Ve.defaults=Pf,Ve.optionHandlers=Ia;function Bm(e){var t=e.display;me(t.scroller,"mousedown",yt(e,Of)),m&&x<11?me(t.scroller,"dblclick",yt(e,function(g){if(!tt(e,g)){var v=ir(e,g);if(!(!v||Zs(e,g)||_n(e.display,g))){Tt(g);var C=e.findWordAt(v);Ca(e.doc,C.anchor,C.head)}}})):me(t.scroller,"dblclick",function(g){return tt(e,g)||Tt(g)}),me(t.scroller,"contextmenu",function(g){return Rf(e,g)}),me(t.input.getField(),"contextmenu",function(g){t.scroller.contains(g.target)||Rf(e,g)});var i,r={end:0};function s(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function l(g){if(g.touches.length!=1)return!1;var v=g.touches[0];return v.radiusX<=1&&v.radiusY<=1}function c(g,v){if(v.left==null)return!0;var C=v.left-g.left,_=v.top-g.top;return C*C+_*_>20*20}me(t.scroller,"touchstart",function(g){if(!tt(e,g)&&!l(g)&&!Zs(e,g)){t.input.ensurePolled(),clearTimeout(i);var v=+new Date;t.activeTouch={start:v,moved:!1,prev:v-r.end<=300?r:null},g.touches.length==1&&(t.activeTouch.left=g.touches[0].pageX,t.activeTouch.top=g.touches[0].pageY)}}),me(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),me(t.scroller,"touchend",function(g){var v=t.activeTouch;if(v&&!_n(t,g)&&v.left!=null&&!v.moved&&new Date-v.start<300){var C=e.coordsChar(t.activeTouch,"page"),_;!v.prev||c(v,v.prev)?_=new Be(C,C):!v.prev.prev||c(v,v.prev.prev)?_=e.findWordAt(C):_=new Be(P(C.line,0),Se(e.doc,P(C.line+1,0))),e.setSelection(_.anchor,_.head),e.focus(),Tt(g)}s()}),me(t.scroller,"touchcancel",s),me(t.scroller,"scroll",function(){t.scroller.clientHeight&&(xi(e,t.scroller.scrollTop),sr(e,t.scroller.scrollLeft,!0),et(e,"scroll",e))}),me(t.scroller,"mousewheel",function(g){return Uu(e,g)}),me(t.scroller,"DOMMouseScroll",function(g){return Uu(e,g)}),me(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(g){tt(e,g)||Mn(g)},over:function(g){tt(e,g)||(mm(e,g),Mn(g))},start:function(g){return gm(e,g)},drop:yt(e,pm),leave:function(g){tt(e,g)||bf(e)}};var h=t.input.getField();me(h,"keyup",function(g){return Af.call(e,g)}),me(h,"keydown",yt(e,Df)),me(h,"keypress",yt(e,If)),me(h,"focus",function(g){return Ms(e,g)}),me(h,"blur",function(g){return Rr(e,g)})}var eo=[];Ve.defineInitHook=function(e){return eo.push(e)};function zi(e,t,i,r){var s=e.doc,l;i==null&&(i="add"),i=="smart"&&(s.mode.indent?l=hi(e,t).state:i="prev");var c=e.options.tabSize,h=fe(s,t),g=_e(h.text,null,c);h.stateAfter&&(h.stateAfter=null);var v=h.text.match(/^\s*/)[0],C;if(!r&&!/\S/.test(h.text))C=0,i="not";else if(i=="smart"&&(C=s.mode.indent(l,h.text.slice(v.length),h.text),C==Ke||C>150)){if(!r)return;i="prev"}i=="prev"?t>s.first?C=_e(fe(s,t-1).text,null,c):C=0:i=="add"?C=g+e.options.indentUnit:i=="subtract"?C=g-e.options.indentUnit:typeof i=="number"&&(C=g+i),C=Math.max(0,C);var _="",M=0;if(e.options.indentWithTabs)for(var I=Math.floor(C/c);I;--I)M+=c,_+=" ";if(M<C&&(_+=qt(C-M)),_!=v)return Hr(s,_,P(t,0),P(t,v.length),"+input"),h.stateAfter=null,!0;for(var z=0;z<s.sel.ranges.length;z++){var U=s.sel.ranges[z];if(U.head.line==t&&U.head.ch<v.length){var V=P(t,v.length);Ks(s,z,new Be(V,V));break}}}var hn=null;function Oa(e){hn=e}function to(e,t,i,r,s){var l=e.doc;e.display.shift=!1,r||(r=l.sel);var c=+new Date-200,h=s=="paste"||e.state.pasteIncoming>c,g=en(t),v=null;if(h&&r.ranges.length>1)if(hn&&hn.text.join(`
|
|
13
|
+
`)==t){if(r.ranges.length%hn.text.length==0){v=[];for(var C=0;C<hn.text.length;C++)v.push(l.splitLines(hn.text[C]))}}else g.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(v=kt(g,function(ee){return[ee]}));for(var _=e.curOp.updateInput,M=r.ranges.length-1;M>=0;M--){var I=r.ranges[M],z=I.from(),U=I.to();I.empty()&&(i&&i>0?z=P(z.line,z.ch-i):e.state.overwrite&&!h?U=P(U.line,Math.min(fe(l,U.line).text.length,U.ch+be(g).length)):h&&hn&&hn.lineWise&&hn.text.join(`
|
|
14
|
+
`)==g.join(`
|
|
15
|
+
`)&&(z=U=P(z.line,0)));var V={from:z,to:U,text:v?v[M%v.length]:g,origin:s||(h?"paste":e.state.cutIncoming>c?"cut":"+input")};Br(e.doc,V),vt(e,"inputRead",e,V)}t&&!h&&$f(e,t),Fr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=_),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function zf(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Bt(t,function(){return to(t,i,0,null,"paste")}),!0}function $f(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var s=i.ranges[r];if(!(s.head.ch>100||r&&i.ranges[r-1].head.line==s.head.line)){var l=e.getModeAt(s.head),c=!1;if(l.electricChars){for(var h=0;h<l.electricChars.length;h++)if(t.indexOf(l.electricChars.charAt(h))>-1){c=zi(e,s.head.line,"smart");break}}else l.electricInput&&l.electricInput.test(fe(e.doc,s.head.line).text.slice(0,s.head.ch))&&(c=zi(e,s.head.line,"smart"));c&&vt(e,"electricInput",e,s.head.line)}}}function Bf(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var s=e.doc.sel.ranges[r].head.line,l={anchor:P(s,0),head:P(s+1,0)};i.push(l),t.push(e.getRange(l.anchor,l.head))}return{text:t,ranges:i}}function no(e,t,i,r){e.setAttribute("autocorrect",i?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function Hf(){var e=k("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=k("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return S?e.style.width="1000px":e.setAttribute("wrap","off"),O&&(e.style.border="1px solid black"),t}function Hm(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){Z(this).focus(),this.display.input.focus()},setOption:function(r,s){var l=this.options,c=l[r];l[r]==s&&r!="mode"||(l[r]=s,t.hasOwnProperty(r)&&yt(this,t[r])(this,s,c),et(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,s){this.state.keyMaps[s?"push":"unshift"](Da(r))},removeKeyMap:function(r){for(var s=this.state.keyMaps,l=0;l<s.length;++l)if(s[l]==r||s[l].name==r)return s.splice(l,1),!0},addOverlay:Et(function(r,s){var l=r.token?r:e.getMode(this.options,r);if(l.startState)throw new Error("Overlays may not be stateful.");Gt(this.state.overlays,{mode:l,modeSpec:r,opaque:s&&s.opaque,priority:s&&s.priority||0},function(c){return c.priority}),this.state.modeGen++,Ot(this)}),removeOverlay:Et(function(r){for(var s=this.state.overlays,l=0;l<s.length;++l){var c=s[l].modeSpec;if(c==r||typeof r=="string"&&c.name==r){s.splice(l,1),this.state.modeGen++,Ot(this);return}}}),indentLine:Et(function(r,s,l){typeof s!="string"&&typeof s!="number"&&(s==null?s=this.options.smartIndent?"smart":"prev":s=s?"add":"subtract"),j(this.doc,r)&&zi(this,r,s,l)}),indentSelection:Et(function(r){for(var s=this.doc.sel.ranges,l=-1,c=0;c<s.length;c++){var h=s[c];if(h.empty())h.head.line>l&&(zi(this,h.head.line,r,!0),l=h.head.line,c==this.doc.sel.primIndex&&Fr(this));else{var g=h.from(),v=h.to(),C=Math.max(l,g.line);l=Math.min(this.lastLine(),v.line-(v.ch?0:1))+1;for(var _=C;_<l;++_)zi(this,_,r);var M=this.doc.sel.ranges;g.ch==0&&s.length==M.length&&M[c].from().ch>0&&Ks(this.doc,c,new Be(g,M[c].to()),ct)}}}),getTokenAt:function(r,s){return Vl(this,r,s)},getLineTokens:function(r,s){return Vl(this,P(r),s,!0)},getTokenTypeAt:function(r){r=Se(this.doc,r);var s=Kl(this,fe(this.doc,r.line)),l=0,c=(s.length-1)/2,h=r.ch,g;if(h==0)g=s[2];else for(;;){var v=l+c>>1;if((v?s[v*2-1]:0)>=h)c=v;else if(s[v*2+1]<h)l=v+1;else{g=s[v*2+2];break}}var C=g?g.indexOf("overlay "):-1;return C<0?g:C==0?null:g.slice(0,C-1)},getModeAt:function(r){var s=this.doc.mode;return s.innerMode?e.innerMode(s,this.getTokenAt(r).state).mode:s},getHelper:function(r,s){return this.getHelpers(r,s)[0]},getHelpers:function(r,s){var l=[];if(!i.hasOwnProperty(s))return l;var c=i[s],h=this.getModeAt(r);if(typeof h[s]=="string")c[h[s]]&&l.push(c[h[s]]);else if(h[s])for(var g=0;g<h[s].length;g++){var v=c[h[s][g]];v&&l.push(v)}else h.helperType&&c[h.helperType]?l.push(c[h.helperType]):c[h.name]&&l.push(c[h.name]);for(var C=0;C<c._global.length;C++){var _=c._global[C];_.pred(h,this)&&we(l,_.val)==-1&&l.push(_.val)}return l},getStateAfter:function(r,s){var l=this.doc;return r=Ul(l,r??l.first+l.size-1),hi(this,r+1,s).state},cursorCoords:function(r,s){var l,c=this.doc.sel.primary();return r==null?l=c.head:typeof r=="object"?l=Se(this.doc,r):l=r?c.from():c.to(),fn(this,l,s||"page")},charCoords:function(r,s){return pa(this,Se(this.doc,r),s||"page")},coordsChar:function(r,s){return r=Tu(this,r,s||"page"),_s(this,r.left,r.top)},lineAtHeight:function(r,s){return r=Tu(this,{top:r,left:0},s||"page").top,T(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,s,l){var c=!1,h;if(typeof r=="number"){var g=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>g&&(r=g,c=!0),h=fe(this.doc,r)}else h=r;return da(this,h,{top:0,left:0},s||"page",l||c).top+(c?this.doc.height-Tn(h):0)},defaultTextHeight:function(){return Nr(this.display)},defaultCharWidth:function(){return Mr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,s,l,c,h){var g=this.display;r=fn(this,Se(this.doc,r));var v=r.bottom,C=r.left;if(s.style.position="absolute",s.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(s),g.sizer.appendChild(s),c=="over")v=r.top;else if(c=="above"||c=="near"){var _=Math.max(g.wrapper.clientHeight,this.doc.height),M=Math.max(g.sizer.clientWidth,g.lineSpace.clientWidth);(c=="above"||r.bottom+s.offsetHeight>_)&&r.top>s.offsetHeight?v=r.top-s.offsetHeight:r.bottom+s.offsetHeight<=_&&(v=r.bottom),C+s.offsetWidth>M&&(C=M-s.offsetWidth)}s.style.top=v+"px",s.style.left=s.style.right="",h=="right"?(C=g.sizer.clientWidth-s.offsetWidth,s.style.right="0px"):(h=="left"?C=0:h=="middle"&&(C=(g.sizer.clientWidth-s.offsetWidth)/2),s.style.left=C+"px"),l&&zg(this,{left:C,top:v,right:C+s.offsetWidth,bottom:v+s.offsetHeight})},triggerOnKeyDown:Et(Df),triggerOnKeyPress:Et(If),triggerOnKeyUp:Af,triggerOnMouseDown:Et(Of),execCommand:function(r){if(Mi.hasOwnProperty(r))return Mi[r].call(null,this)},triggerElectric:Et(function(r){$f(this,r)}),findPosH:function(r,s,l,c){var h=1;s<0&&(h=-1,s=-s);for(var g=Se(this.doc,r),v=0;v<s&&(g=ro(this.doc,g,h,l,c),!g.hitSide);++v);return g},moveH:Et(function(r,s){var l=this;this.extendSelectionsBy(function(c){return l.display.shift||l.doc.extend||c.empty()?ro(l.doc,c.head,r,s,l.options.rtlMoveVisually):r<0?c.from():c.to()},ht)}),deleteH:Et(function(r,s){var l=this.doc.sel,c=this.doc;l.somethingSelected()?c.replaceSelection("",null,"+delete"):Ur(this,function(h){var g=ro(c,h.head,r,s,!1);return r<0?{from:g,to:h.head}:{from:h.head,to:g}})}),findPosV:function(r,s,l,c){var h=1,g=c;s<0&&(h=-1,s=-s);for(var v=Se(this.doc,r),C=0;C<s;++C){var _=fn(this,v,"div");if(g==null?g=_.left:_.left=g,v=Wf(this,_,h,l),v.hitSide)break}return v},moveV:Et(function(r,s){var l=this,c=this.doc,h=[],g=!this.display.shift&&!c.extend&&c.sel.somethingSelected();if(c.extendSelectionsBy(function(C){if(g)return r<0?C.from():C.to();var _=fn(l,C.head,"div");C.goalColumn!=null&&(_.left=C.goalColumn),h.push(_.left);var M=Wf(l,_,r,s);return s=="page"&&C==c.sel.primary()&&Fs(l,pa(l,M,"div").top-_.top),M},ht),h.length)for(var v=0;v<c.sel.ranges.length;v++)c.sel.ranges[v].goalColumn=h[v]}),findWordAt:function(r){var s=this.doc,l=fe(s,r.line).text,c=r.ch,h=r.ch;if(l){var g=this.getHelper(r,"wordChars");(r.sticky=="before"||h==l.length)&&c?--c:++h;for(var v=l.charAt(c),C=xe(v,g)?function(_){return xe(_,g)}:/\s/.test(v)?function(_){return/\s/.test(_)}:function(_){return!/\s/.test(_)&&!xe(_)};c>0&&C(l.charAt(c-1));)--c;for(;h<l.length&&C(l.charAt(h));)++h}return new Be(P(r.line,c),P(r.line,h))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?K(this.display.cursorDiv,"CodeMirror-overwrite"):ze(this.display.cursorDiv,"CodeMirror-overwrite"),et(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==R(oe(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Et(function(r,s){bi(this,r,s)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-vn(this)-this.display.barHeight,width:r.scrollWidth-vn(this)-this.display.barWidth,clientHeight:ks(this),clientWidth:nr(this)}},scrollIntoView:Et(function(r,s){r==null?(r={from:this.doc.sel.primary().head,to:null},s==null&&(s=this.options.cursorScrollMargin)):typeof r=="number"?r={from:P(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=s||0,r.from.line!=null?$g(this,r):Mu(this,r.from,r.to,r.margin)}),setSize:Et(function(r,s){var l=this,c=function(g){return typeof g=="number"||/^\d+$/.test(String(g))?g+"px":g};r!=null&&(this.display.wrapper.style.width=c(r)),s!=null&&(this.display.wrapper.style.height=c(s)),this.options.lineWrapping&&ku(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(g){if(g.widgets){for(var v=0;v<g.widgets.length;v++)if(g.widgets[v].noHScroll){$n(l,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,et(this,"refresh",this)}),operation:function(r){return Bt(this,r)},startOperation:function(){return lr(this)},endOperation:function(){return ur(this)},refresh:Et(function(){var r=this.display.cachedTextHeight;Ot(this),this.curOp.forceUpdate=!0,vi(this),bi(this,this.doc.scrollLeft,this.doc.scrollTop),$s(this.display),(r==null||Math.abs(r-Nr(this.display))>.5||this.options.lineWrapping)&&As(this),et(this,"refresh",this)}),swapDoc:Et(function(r){var s=this.doc;return s.cm=null,this.state.selectingText&&this.state.selectingText(),Xu(this,r),vi(this),this.display.input.reset(),bi(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,vt(this,"swapDoc",this,s),s}),phrase:function(r){var s=this.options.phrases;return s&&Object.prototype.hasOwnProperty.call(s,r)?s[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},rn(e),e.registerHelper=function(r,s,l){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][s]=l},e.registerGlobalHelper=function(r,s,l,c){e.registerHelper(r,s,c),i[r]._global.push({pred:l,val:c})}}function ro(e,t,i,r,s){var l=t,c=i,h=fe(e,t.line),g=s&&e.direction=="rtl"?-i:i;function v(){var ae=t.line+g;return ae<e.first||ae>=e.first+e.size?!1:(t=new P(ae,t.ch,t.sticky),h=fe(e,ae))}function C(ae){var te;if(r=="codepoint"){var le=h.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(le))te=null;else{var ve=i>0?le>=55296&&le<56320:le>=56320&&le<57343;te=new P(t.line,Math.max(0,Math.min(h.text.length,t.ch+i*(ve?2:1))),-i)}}else s?te=km(e.cm,h,t,i):te=Ys(h,t,i);if(te==null)if(!ae&&v())t=Vs(s,e.cm,h,t.line,g);else return!1;else t=te;return!0}if(r=="char"||r=="codepoint")C();else if(r=="column")C(!0);else if(r=="word"||r=="group")for(var _=null,M=r=="group",I=e.cm&&e.cm.getHelper(t,"wordChars"),z=!0;!(i<0&&!C(!z));z=!1){var U=h.text.charAt(t.ch)||`
|
|
16
|
+
`,V=xe(U,I)?"w":M&&U==`
|
|
17
|
+
`?"n":!M||/\s/.test(U)?null:"p";if(M&&!z&&!V&&(V="s"),_&&_!=V){i<0&&(i=1,C(),t.sticky="after");break}if(V&&(_=V),i>0&&!C(!z))break}var ee=_a(e,t,l,c,!0);return $e(l,ee)&&(ee.hitSide=!0),ee}function Wf(e,t,i,r){var s=e.doc,l=t.left,c;if(r=="page"){var h=Math.min(e.display.wrapper.clientHeight,Z(e).innerHeight||s(e).documentElement.clientHeight),g=Math.max(h-.5*Nr(e.display),3);c=(i>0?t.bottom:t.top)+i*g}else r=="line"&&(c=i>0?t.bottom+3:t.top-3);for(var v;v=_s(e,l,c),!!v.outside;){if(i<0?c<=0:c>=s.height){v.hitSide=!0;break}c+=i*5}return v}var We=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ft,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};We.prototype.init=function(e){var t=this,i=this,r=i.cm,s=i.div=e.lineDiv;s.contentEditable=!0,no(s,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function l(h){for(var g=h.target;g;g=g.parentNode){if(g==s)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(g.className))break}return!1}me(s,"paste",function(h){!l(h)||tt(r,h)||zf(h,r)||x<=11&&setTimeout(yt(r,function(){return t.updateFromDOM()}),20)}),me(s,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),me(s,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),me(s,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),me(s,"touchstart",function(){return i.forceCompositionEnd()}),me(s,"input",function(){t.composing||t.readFromDOMSoon()});function c(h){if(!(!l(h)||tt(r,h))){if(r.somethingSelected())Oa({lineWise:!1,text:r.getSelections()}),h.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var g=Bf(r);Oa({lineWise:!0,text:g.text}),h.type=="cut"&&r.operation(function(){r.setSelections(g.ranges,0,ct),r.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var v=hn.text.join(`
|
|
18
|
+
`);if(h.clipboardData.setData("Text",v),h.clipboardData.getData("Text")==v){h.preventDefault();return}}var C=Hf(),_=C.firstChild;no(_),r.display.lineSpace.insertBefore(C,r.display.lineSpace.firstChild),_.value=hn.text.join(`
|
|
19
|
+
`);var M=R(Te(s));L(_),setTimeout(function(){r.display.lineSpace.removeChild(C),M.focus(),M==s&&i.showPrimarySelection()},50)}}me(s,"copy",c),me(s,"cut",c)},We.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},We.prototype.prepareSelection=function(){var e=Iu(this.cm,!1);return e.focus=R(Te(this.div))==this.div,e},We.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},We.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},We.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),s=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||s.line<t.display.viewFrom){e.removeAllRanges();return}var l=Na(t,e.anchorNode,e.anchorOffset),c=Na(t,e.focusNode,e.focusOffset);if(!(l&&!l.bad&&c&&!c.bad&&re(Dr(l,c),r)==0&&re(It(l,c),s)==0)){var h=t.display.view,g=r.line>=t.display.viewFrom&&jf(t,r)||{node:h[0].measure.map[2],offset:0},v=s.line<t.display.viewTo&&jf(t,s);if(!v){var C=h[h.length-1].measure,_=C.maps?C.maps[C.maps.length-1]:C.map;v={node:_[_.length-1],offset:_[_.length-2]-_[_.length-3]}}if(!g||!v){e.removeAllRanges();return}var M=e.rangeCount&&e.getRangeAt(0),I;try{I=G(g.node,g.offset,v.offset,v.node)}catch{}I&&(!f&&t.state.focused?(e.collapse(g.node,g.offset),I.collapsed||(e.removeAllRanges(),e.addRange(I))):(e.removeAllRanges(),e.addRange(I)),M&&e.anchorNode==null?e.addRange(M):f&&this.startGracePeriod()),this.rememberSelection()}},We.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)},We.prototype.showMultipleSelections=function(e){Q(this.cm.display.cursorDiv,e.cursors),Q(this.cm.display.selectionDiv,e.selection)},We.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},We.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return D(this.div,t)},We.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||R(Te(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},We.prototype.blur=function(){this.div.blur()},We.prototype.getField=function(){return this.div},We.prototype.supportsTouch=function(){return!0},We.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):Bt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function i(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,i))}this.polling.set(this.cm.options.pollInterval,i)},We.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},We.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if($&&E&&this.cm.display.gutterSpecs.length&&Wm(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var i=Na(t,e.anchorNode,e.anchorOffset),r=Na(t,e.focusNode,e.focusOffset);i&&r&&Bt(t,function(){_t(t.doc,Hn(i,r),ct),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},We.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),s=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=P(r.line-1,fe(e.doc,r.line-1).length)),s.ch==fe(e.doc,s.line).text.length&&s.line<e.lastLine()&&(s=P(s.line+1,0)),r.line<t.viewFrom||s.line>t.viewTo-1)return!1;var l,c,h;r.line==t.viewFrom||(l=ar(e,r.line))==0?(c=b(t.view[0].line),h=t.view[0].node):(c=b(t.view[l].line),h=t.view[l-1].node.nextSibling);var g=ar(e,s.line),v,C;if(g==t.view.length-1?(v=t.viewTo-1,C=t.lineDiv.lastChild):(v=b(t.view[g+1].line)-1,C=t.view[g+1].node.previousSibling),!h)return!1;for(var _=e.doc.splitLines(jm(e,h,C,c,v)),M=Sn(e.doc,P(c,0),P(v,fe(e.doc,v).text.length));_.length>1&&M.length>1;)if(be(_)==be(M))_.pop(),M.pop(),v--;else if(_[0]==M[0])_.shift(),M.shift(),c++;else break;for(var I=0,z=0,U=_[0],V=M[0],ee=Math.min(U.length,V.length);I<ee&&U.charCodeAt(I)==V.charCodeAt(I);)++I;for(var ae=be(_),te=be(M),le=Math.min(ae.length-(_.length==1?I:0),te.length-(M.length==1?I:0));z<le&&ae.charCodeAt(ae.length-z-1)==te.charCodeAt(te.length-z-1);)++z;if(_.length==1&&M.length==1&&c==r.line)for(;I&&I>r.ch&&ae.charCodeAt(ae.length-z-1)==te.charCodeAt(te.length-z-1);)I--,z++;_[_.length-1]=ae.slice(0,ae.length-z).replace(/^\u200b+/,""),_[0]=_[0].slice(I).replace(/\u200b+$/,"");var ve=P(c,I),ge=P(v,M.length?be(M).length-z:0);if(_.length>1||_[0]||re(ve,ge))return Hr(e.doc,_,ve,ge,"+input"),!0},We.prototype.ensurePolled=function(){this.forceCompositionEnd()},We.prototype.reset=function(){this.forceCompositionEnd()},We.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},We.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},We.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Bt(this.cm,function(){return Ot(e.cm)})},We.prototype.setUneditable=function(e){e.contentEditable="false"},We.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||yt(this.cm,to)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},We.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},We.prototype.onContextMenu=function(){},We.prototype.resetPosition=function(){},We.prototype.needsContentAttribute=!0;function jf(e,t){var i=Ss(e,t.line);if(!i||i.hidden)return null;var r=fe(e.doc,t.line),s=vu(i,r,t.line),l=Pe(r,e.doc.direction),c="left";if(l){var h=Nn(l,t.ch);c=h%2?"right":"left"}var g=xu(s.map,t.ch,c);return g.offset=g.collapse=="right"?g.end:g.start,g}function Wm(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Gr(e,t){return t&&(e.bad=!0),e}function jm(e,t,i,r,s){var l="",c=!1,h=e.doc.lineSeparator(),g=!1;function v(I){return function(z){return z.id==I}}function C(){c&&(l+=h,g&&(l+=h),c=g=!1)}function _(I){I&&(C(),l+=I)}function M(I){if(I.nodeType==1){var z=I.getAttribute("cm-text");if(z){_(z);return}var U=I.getAttribute("cm-marker"),V;if(U){var ee=e.findMarks(P(r,0),P(s+1,0),v(+U));ee.length&&(V=ee[0].find(0))&&_(Sn(e.doc,V.from,V.to).join(h));return}if(I.getAttribute("contenteditable")=="false")return;var ae=/^(pre|div|p|li|table|br)$/i.test(I.nodeName);if(!/^br$/i.test(I.nodeName)&&I.textContent.length==0)return;ae&&C();for(var te=0;te<I.childNodes.length;te++)M(I.childNodes[te]);/^(pre|p)$/i.test(I.nodeName)&&(g=!0),ae&&(c=!0)}else I.nodeType==3&&_(I.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;M(t),t!=i;)t=t.nextSibling,g=!1;return l}function Na(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Gr(e.clipPos(P(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var s=0;s<e.display.view.length;s++){var l=e.display.view[s];if(l.node==r)return Um(l,t,i)}}function Um(e,t,i){var r=e.text.firstChild,s=!1;if(!t||!D(r,t))return Gr(P(b(e.line),0),!0);if(t==r&&(s=!0,t=r.childNodes[i],i=0,!t)){var l=e.rest?be(e.rest):e.line;return Gr(P(b(l),l.text.length),s)}var c=t.nodeType==3?t:null,h=t;for(!c&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(c=t.firstChild,i&&(i=c.nodeValue.length));h.parentNode!=r;)h=h.parentNode;var g=e.measure,v=g.maps;function C(V,ee,ae){for(var te=-1;te<(v?v.length:0);te++)for(var le=te<0?g.map:v[te],ve=0;ve<le.length;ve+=3){var ge=le[ve+2];if(ge==V||ge==ee){var Ae=b(te<0?e.line:e.rest[te]),Ue=le[ve]+ae;return(ae<0||ge!=V)&&(Ue=le[ve+(ae?1:0)]),P(Ae,Ue)}}}var _=C(c,h,i);if(_)return Gr(_,s);for(var M=h.nextSibling,I=c?c.nodeValue.length-i:0;M;M=M.nextSibling){if(_=C(M,M.firstChild,0),_)return Gr(P(_.line,_.ch-I),s);I+=M.textContent.length}for(var z=h.previousSibling,U=i;z;z=z.previousSibling){if(_=C(z,z.firstChild,-1),_)return Gr(P(_.line,_.ch+U),s);U+=z.textContent.length}}var st=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ft,this.hasSelection=!1,this.composing=null,this.resetting=!1};st.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var s=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),O&&(s.style.width="0px"),me(s,"input",function(){m&&x>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),me(s,"paste",function(c){tt(r,c)||zf(c,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function l(c){if(!tt(r,c)){if(r.somethingSelected())Oa({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var h=Bf(r);Oa({lineWise:!0,text:h.text}),c.type=="cut"?r.setSelections(h.ranges,null,ct):(i.prevInput="",s.value=h.text.join(`
|
|
20
|
+
`),L(s))}else return;c.type=="cut"&&(r.state.cutIncoming=+new Date)}}me(s,"cut",l),me(s,"copy",l),me(e.scroller,"paste",function(c){if(!(_n(e,c)||tt(r,c))){if(!s.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var h=new Event("paste");h.clipboardData=c.clipboardData,s.dispatchEvent(h)}}),me(e.lineSpace,"selectstart",function(c){_n(e,c)||Tt(c)}),me(s,"compositionstart",function(){var c=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:c,range:r.markText(c,r.getCursor("to"),{className:"CodeMirror-composing"})}}),me(s,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},st.prototype.createField=function(e){this.wrapper=Hf(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;no(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,i=e.doc,r=Iu(e);if(e.options.moveInputWithCursor){var s=fn(e,i.sel.primary().head,"div"),l=t.wrapper.getBoundingClientRect(),c=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,s.top+c.top-l.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,s.left+c.left-l.left))}return r},st.prototype.showSelection=function(e){var t=this.cm,i=t.display;Q(i.cursorDiv,e.cursors),Q(i.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 i=t.getSelection();this.textarea.value=i,t.state.focused&&L(this.textarea),m&&x>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",m&&x>=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"&&(!X||R(Te(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 i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},st.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Fn(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var s=i.value;if(s==r&&!t.somethingSelected())return!1;if(m&&x>=9&&this.hasSelection===s||ne&&/[\uf700-\uf7ff]/.test(s))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var l=s.charCodeAt(0);if(l==8203&&!r&&(r=""),l==8666)return this.reset(),this.cm.execCommand("undo")}for(var c=0,h=Math.min(r.length,s.length);c<h&&r.charCodeAt(c)==s.charCodeAt(c);)++c;return Bt(t,function(){to(t,s.slice(c),r.length-c,null,e.composing?"*compose":null),s.length>1e3||s.indexOf(`
|
|
21
|
+
`)>-1?i.value=e.prevInput="":e.prevInput=s,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(){m&&x>=9&&(this.hasSelection=null),this.fastPoll()},st.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,s=t.textarea;t.contextMenuPending&&t.contextMenuPending();var l=ir(i,e),c=r.scroller.scrollTop;if(!l||B)return;var h=i.options.resetSelectionOnContextMenu;h&&i.doc.sel.contains(l)==-1&&yt(i,_t)(i.doc,Hn(l),ct);var g=s.style.cssText,v=t.wrapper.style.cssText,C=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",s.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
22
|
+
top: `+(e.clientY-C.top-5)+"px; left: "+(e.clientX-C.left-5)+`px;
|
|
23
|
+
z-index: 1000; background: `+(m?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
24
|
+
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var _;S&&(_=s.ownerDocument.defaultView.scrollY),r.input.focus(),S&&s.ownerDocument.defaultView.scrollTo(null,_),r.input.reset(),i.somethingSelected()||(s.value=t.prevInput=" "),t.contextMenuPending=I,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function M(){if(s.selectionStart!=null){var U=i.somethingSelected(),V=""+(U?s.value:"");s.value="⇚",s.value=V,t.prevInput=U?"":"",s.selectionStart=1,s.selectionEnd=V.length,r.selForContextMenu=i.doc.sel}}function I(){if(t.contextMenuPending==I&&(t.contextMenuPending=!1,t.wrapper.style.cssText=v,s.style.cssText=g,m&&x<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=c),s.selectionStart!=null)){(!m||m&&x<9)&&M();var U=0,V=function(){r.selForContextMenu==i.doc.sel&&s.selectionStart==0&&s.selectionEnd>0&&t.prevInput==""?yt(i,lf)(i):U++<10?r.detectingSelectAll=setTimeout(V,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(V,200)}}if(m&&x>=9&&M(),Re){Mn(e);var z=function(){Ct(window,"mouseup",z),setTimeout(I,20)};me(window,"mouseup",z)}else setTimeout(I,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 qm(e,t){if(t=t?ke(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 i=R(Te(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=h.getValue()}var s;if(e.form&&(me(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var l=e.form;s=l.submit;try{var c=l.submit=function(){r(),l.submit=s,l.submit(),l.submit=c}}catch{}}t.finishInit=function(g){g.save=r,g.getTextArea=function(){return e},g.toTextArea=function(){g.toTextArea=isNaN,r(),e.parentNode.removeChild(g.getWrapperElement()),e.style.display="",e.form&&(Ct(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=s))}},e.style.display="none";var h=Ve(function(g){return e.parentNode.insertBefore(g,e.nextSibling)},t);return h}function Gm(e){e.off=Ct,e.on=me,e.wheelEventPixels=Zg,e.Doc=Nt,e.splitLines=en,e.countColumn=_e,e.findColumn=dt,e.isWordChar=ye,e.Pass=Ke,e.signal=et,e.Line=Ar,e.changeEnd=Wn,e.scrollbarModel=Pu,e.Pos=P,e.cmpPos=re,e.modes=Cr,e.mimeModes=on,e.resolveMode=Tr,e.getMode=_r,e.modeExtensions=Pn,e.extendMode=Lr,e.copyState=gn,e.startState=Er,e.innerMode=fi,e.commands=Mi,e.keyMap=En,e.keyName=Cf,e.isModifierKey=kf,e.lookupKey=jr,e.normalizeKeyMap=wm,e.StringStream=nt,e.SharedTextMarker=Ii,e.TextMarker=Un,e.LineWidget=Ai,e.e_preventDefault=Tt,e.e_stopPropagation=kr,e.e_stop=Mn,e.addClass=K,e.contains=D,e.rmClass=ze,e.keyNames=qn}Pm(Ve),Hm(Ve);var Km="iter insert remove copy getEditor constructor".split(" ");for(var Ma in Nt.prototype)Nt.prototype.hasOwnProperty(Ma)&&we(Km,Ma)<0&&(Ve.prototype[Ma]=function(e){return function(){return e.apply(this.doc,arguments)}}(Nt.prototype[Ma]));return rn(Nt),Ve.inputStyles={textarea:st,contenteditable:We},Ve.defineMode=function(e){!Ve.defaults.mode&&e!="null"&&(Ve.defaults.mode=e),ln.apply(this,arguments)},Ve.defineMIME=tr,Ve.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ve.defineMIME("text/plain","null"),Ve.defineExtension=function(e,t){Ve.prototype[e]=t},Ve.defineDocExtension=function(e,t){Nt.prototype[e]=t},Ve.fromTextArea=qm,Gm(Ve),Ve.version="5.65.20",Ve})}(Fa)),Fa.exports}(function(u,n){(function(a){a(Wt())})(function(a){a.defineMode("javascript",function(o,f){var d=o.indentUnit,p=f.statementIndent,y=f.jsonld,m=f.json||y,x=f.trackScope!==!1,S=f.typescript,A=f.wordCharacters||/[\w$\xa1-\uffff]/,E=function(){function b(mt){return{type:mt,style:"keyword"}}var T=b("keyword a"),j=b("keyword b"),Y=b("keyword c"),P=b("keyword d"),re=b("operator"),$e={type:"atom",style:"atom"};return{if:b("if"),while:T,with:T,else:j,do:j,try:j,finally:j,return:P,break:P,continue:P,new:b("new"),delete:Y,void:Y,throw:Y,debugger:b("debugger"),var:b("var"),const:b("var"),let:b("var"),function:b("function"),catch:b("catch"),for:b("for"),switch:b("switch"),case:b("case"),default:b("default"),in:re,typeof:re,instanceof:re,true:$e,false:$e,null:$e,undefined:$e,NaN:$e,Infinity:$e,this:b("this"),class:b("class"),super:b("atom"),yield:Y,export:b("export"),import:b("import"),extends:Y,await:Y}}(),W=/[+\-*&%=<>!?|~^@]/,B=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function q(b){for(var T=!1,j,Y=!1;(j=b.next())!=null;){if(!T){if(j=="/"&&!Y)return;j=="["?Y=!0:Y&&j=="]"&&(Y=!1)}T=!T&&j=="\\"}}var F,N;function O(b,T,j){return F=b,N=j,T}function $(b,T){var j=b.next();if(j=='"'||j=="'")return T.tokenize=X(j),T.tokenize(b,T);if(j=="."&&b.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return O("number","number");if(j=="."&&b.match(".."))return O("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(j))return O(j);if(j=="="&&b.eat(">"))return O("=>","operator");if(j=="0"&&b.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return O("number","number");if(/\d/.test(j))return b.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),O("number","number");if(j=="/")return b.eat("*")?(T.tokenize=ne,ne(b,T)):b.eat("/")?(b.skipToEnd(),O("comment","comment")):Kt(b,T,1)?(q(b),b.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),O("regexp","string-2")):(b.eat("="),O("operator","operator",b.current()));if(j=="`")return T.tokenize=ue,ue(b,T);if(j=="#"&&b.peek()=="!")return b.skipToEnd(),O("meta","meta");if(j=="#"&&b.eatWhile(A))return O("variable","property");if(j=="<"&&b.match("!--")||j=="-"&&b.match("->")&&!/\S/.test(b.string.slice(0,b.start)))return b.skipToEnd(),O("comment","comment");if(W.test(j))return(j!=">"||!T.lexical||T.lexical.type!=">")&&(b.eat("=")?(j=="!"||j=="=")&&b.eat("="):/[<>*+\-|&?]/.test(j)&&(b.eat(j),j==">"&&b.eat(j))),j=="?"&&b.eat(".")?O("."):O("operator","operator",b.current());if(A.test(j)){b.eatWhile(A);var Y=b.current();if(T.lastType!="."){if(E.propertyIsEnumerable(Y)){var P=E[Y];return O(P.type,P.style,Y)}if(Y=="async"&&b.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return O("async","keyword",Y)}return O("variable","variable",Y)}}function X(b){return function(T,j){var Y=!1,P;if(y&&T.peek()=="@"&&T.match(B))return j.tokenize=$,O("jsonld-keyword","meta");for(;(P=T.next())!=null&&!(P==b&&!Y);)Y=!Y&&P=="\\";return Y||(j.tokenize=$),O("string","string")}}function ne(b,T){for(var j=!1,Y;Y=b.next();){if(Y=="/"&&j){T.tokenize=$;break}j=Y=="*"}return O("comment","comment")}function ue(b,T){for(var j=!1,Y;(Y=b.next())!=null;){if(!j&&(Y=="`"||Y=="$"&&b.eat("{"))){T.tokenize=$;break}j=!j&&Y=="\\"}return O("quasi","string-2",b.current())}var se="([{}])";function he(b,T){T.fatArrowAt&&(T.fatArrowAt=null);var j=b.string.indexOf("=>",b.start);if(!(j<0)){if(S){var Y=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(b.string.slice(b.start,j));Y&&(j=Y.index)}for(var P=0,re=!1,$e=j-1;$e>=0;--$e){var mt=b.string.charAt($e),It=se.indexOf(mt);if(It>=0&&It<3){if(!P){++$e;break}if(--P==0){mt=="("&&(re=!0);break}}else if(It>=3&&It<6)++P;else if(A.test(mt))re=!0;else if(/["'\/`]/.test(mt))for(;;--$e){if($e==0)return;var Dr=b.string.charAt($e-1);if(Dr==mt&&b.string.charAt($e-2)!="\\"){$e--;break}}else if(re&&!P){++$e;break}}re&&!P&&(T.fatArrowAt=$e)}}var Oe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function Re(b,T,j,Y,P,re){this.indented=b,this.column=T,this.type=j,this.prev=P,this.info=re,Y!=null&&(this.align=Y)}function ie(b,T){if(!x)return!1;for(var j=b.localVars;j;j=j.next)if(j.name==T)return!0;for(var Y=b.context;Y;Y=Y.prev)for(var j=Y.vars;j;j=j.next)if(j.name==T)return!0}function ze(b,T,j,Y,P){var re=b.cc;for(H.state=b,H.stream=P,H.marked=null,H.cc=re,H.style=T,b.lexical.hasOwnProperty("align")||(b.lexical.align=!0);;){var $e=re.length?re.pop():m?we:_e;if($e(j,Y)){for(;re.length&&re[re.length-1].lex;)re.pop()();return H.marked?H.marked:j=="variable"&&ie(b,Y)?"variable-2":T}}}var H={state:null,marked:null,cc:null};function Q(){for(var b=arguments.length-1;b>=0;b--)H.cc.push(arguments[b])}function k(){return Q.apply(null,arguments),!0}function J(b,T){for(var j=T;j;j=j.next)if(j.name==b)return!0;return!1}function G(b){var T=H.state;if(H.marked="def",!!x){if(T.context){if(T.lexical.info=="var"&&T.context&&T.context.block){var j=D(b,T.context);if(j!=null){T.context=j;return}}else if(!J(b,T.localVars)){T.localVars=new de(b,T.localVars);return}}f.globalVars&&!J(b,T.globalVars)&&(T.globalVars=new de(b,T.globalVars))}}function D(b,T){if(T)if(T.block){var j=D(b,T.prev);return j?j==T.prev?T:new K(j,T.vars,!0):null}else return J(b,T.vars)?T:new K(T.prev,new de(b,T.vars),!1);else return null}function R(b){return b=="public"||b=="private"||b=="protected"||b=="abstract"||b=="readonly"}function K(b,T,j){this.prev=b,this.vars=T,this.block=j}function de(b,T){this.name=b,this.next=T}var L=new de("this",new de("arguments",null));function w(){H.state.context=new K(H.state.context,H.state.localVars,!1),H.state.localVars=L}function oe(){H.state.context=new K(H.state.context,H.state.localVars,!0),H.state.localVars=null}w.lex=oe.lex=!0;function Te(){H.state.localVars=H.state.context.vars,H.state.context=H.state.context.prev}Te.lex=!0;function Z(b,T){var j=function(){var Y=H.state,P=Y.indented;if(Y.lexical.type=="stat")P=Y.lexical.indented;else for(var re=Y.lexical;re&&re.type==")"&&re.align;re=re.prev)P=re.indented;Y.lexical=new Re(P,H.stream.column(),b,null,Y.lexical,T)};return j.lex=!0,j}function ce(){var b=H.state;b.lexical.prev&&(b.lexical.type==")"&&(b.indented=b.lexical.indented),b.lexical=b.lexical.prev)}ce.lex=!0;function ke(b){function T(j){return j==b?k():b==";"||j=="}"||j==")"||j=="]"?Q():k(T)}return T}function _e(b,T){return b=="var"?k(Z("vardef",T),kr,ke(";"),ce):b=="keyword a"?k(Z("form"),Ke,_e,ce):b=="keyword b"?k(Z("form"),_e,ce):b=="keyword d"?H.stream.match(/^\s*$/,!1)?k():k(Z("stat"),Pt,ke(";"),ce):b=="debugger"?k(ke(";")):b=="{"?k(Z("}"),oe,Qt,ce,Te):b==";"?k():b=="if"?(H.state.lexical.info=="else"&&H.state.cc[H.state.cc.length-1]==ce&&H.state.cc.pop()(),k(Z("form"),Ke,_e,ce,Sr)):b=="function"?k(en):b=="for"?k(Z("form"),oe,ra,_e,Te,ce):b=="class"||S&&T=="interface"?(H.marked="keyword",k(Z("form",b=="class"?b:T),Cr,ce)):b=="variable"?S&&T=="declare"?(H.marked="keyword",k(_e)):S&&(T=="module"||T=="enum"||T=="type")&&H.stream.match(/^\s*\w/,!1)?(H.marked="keyword",T=="enum"?k(fe):T=="type"?k(ia,ke("operator"),Pe,ke(";")):k(Z("form"),At,ke("{"),Z("}"),Qt,ce,ce)):S&&T=="namespace"?(H.marked="keyword",k(Z("form"),we,_e,ce)):S&&T=="abstract"?(H.marked="keyword",k(_e)):k(Z("stat"),wr):b=="switch"?k(Z("form"),Ke,ke("{"),Z("}","switch"),oe,Qt,ce,ce,Te):b=="case"?k(we,ke(":")):b=="default"?k(ke(":")):b=="catch"?k(Z("form"),w,ft,_e,ce,Te):b=="export"?k(Z("stat"),Tr,ce):b=="import"?k(Z("stat"),Pn,ce):b=="async"?k(_e):T=="@"?k(we,_e):Q(Z("stat"),we,ke(";"),ce)}function ft(b){if(b=="(")return k(sn,ke(")"))}function we(b,T){return ct(b,T,!1)}function Me(b,T){return ct(b,T,!0)}function Ke(b){return b!="("?Q():k(Z(")"),Pt,ke(")"),ce)}function ct(b,T,j){if(H.state.fatArrowAt==H.stream.start){var Y=j?kt:be;if(b=="(")return k(w,Z(")"),De(sn,")"),ce,ke("=>"),Y,Te);if(b=="variable")return Q(w,At,ke("=>"),Y,Te)}var P=j?dt:ht;return Oe.hasOwnProperty(b)?k(P):b=="function"?k(en,P):b=="class"||S&&T=="interface"?(H.marked="keyword",k(Z("form"),hs,ce)):b=="keyword c"||b=="async"?k(j?Me:we):b=="("?k(Z(")"),Pt,ke(")"),ce,P):b=="operator"||b=="spread"?k(j?Me:we):b=="["?k(Z("]"),nt,ce,P):b=="{"?zt(xe,"}",null,P):b=="quasi"?Q(gt,P):b=="new"?k(Gt(j)):k()}function Pt(b){return b.match(/[;\}\)\],]/)?Q():Q(we)}function ht(b,T){return b==","?k(Pt):dt(b,T,!1)}function dt(b,T,j){var Y=j==!1?ht:dt,P=j==!1?we:Me;if(b=="=>")return k(w,j?kt:be,Te);if(b=="operator")return/\+\+|--/.test(T)||S&&T=="!"?k(Y):S&&T=="<"&&H.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?k(Z(">"),De(Pe,">"),ce,Y):T=="?"?k(we,ke(":"),P):k(P);if(b=="quasi")return Q(gt,Y);if(b!=";"){if(b=="(")return zt(Me,")","call",Y);if(b==".")return k(ye,Y);if(b=="[")return k(Z("]"),Pt,ke("]"),ce,Y);if(S&&T=="as")return H.marked="keyword",k(Pe,Y);if(b=="regexp")return H.state.lastType=H.marked="operator",H.stream.backUp(H.stream.pos-H.stream.start-1),k(P)}}function gt(b,T){return b!="quasi"?Q():T.slice(T.length-2)!="${"?k(gt):k(Pt,qt)}function qt(b){if(b=="}")return H.marked="string-2",H.state.tokenize=ue,k(gt)}function be(b){return he(H.stream,H.state),Q(b=="{"?_e:we)}function kt(b){return he(H.stream,H.state),Q(b=="{"?_e:Me)}function Gt(b){return function(T){return T=="."?k(b?Zn:In):T=="variable"&&S?k($t,b?dt:ht):Q(b?Me:we)}}function In(b,T){if(T=="target")return H.marked="keyword",k(ht)}function Zn(b,T){if(T=="target")return H.marked="keyword",k(dt)}function wr(b){return b==":"?k(ce,_e):Q(ht,ke(";"),ce)}function ye(b){if(b=="variable")return H.marked="property",k()}function xe(b,T){if(b=="async")return H.marked="property",k(xe);if(b=="variable"||H.style=="keyword"){if(H.marked="property",T=="get"||T=="set")return k(pe);var j;return S&&H.state.fatArrowAt==H.stream.start&&(j=H.stream.match(/^\s*:\s*/,!1))&&(H.state.fatArrowAt=H.stream.pos+j[0].length),k(Fe)}else{if(b=="number"||b=="string")return H.marked=y?"property":H.style+" property",k(Fe);if(b=="jsonld-keyword")return k(Fe);if(S&&R(T))return H.marked="keyword",k(xe);if(b=="[")return k(we,On,ke("]"),Fe);if(b=="spread")return k(Me,Fe);if(T=="*")return H.marked="keyword",k(xe);if(b==":")return Q(Fe)}}function pe(b){return b!="variable"?Q(Fe):(H.marked="property",k(en))}function Fe(b){if(b==":")return k(Me);if(b=="(")return Q(en)}function De(b,T,j){function Y(P,re){if(j?j.indexOf(P)>-1:P==","){var $e=H.state.lexical;return $e.info=="call"&&($e.pos=($e.pos||0)+1),k(function(mt,It){return mt==T||It==T?Q():Q(b)},Y)}return P==T||re==T?k():j&&j.indexOf(";")>-1?Q(b):k(ke(T))}return function(P,re){return P==T||re==T?k():Q(b,Y)}}function zt(b,T,j){for(var Y=3;Y<arguments.length;Y++)H.cc.push(arguments[Y]);return k(Z(T,j),De(b,T),ce)}function Qt(b){return b=="}"?k():Q(_e,Qt)}function On(b,T){if(S){if(b==":")return k(Pe);if(T=="?")return k(On)}}function er(b,T){if(S&&(b==":"||T=="in"))return k(Pe)}function Nn(b){if(S&&b==":")return H.stream.match(/^\s*\w+\s+is\b/,!1)?k(we,fs,Pe):k(Pe)}function fs(b,T){if(T=="is")return H.marked="keyword",k()}function Pe(b,T){if(T=="keyof"||T=="typeof"||T=="infer"||T=="readonly")return H.marked="keyword",k(T=="typeof"?Me:Pe);if(b=="variable"||T=="void")return H.marked="type",k(Zt);if(T=="|"||T=="&")return k(Pe);if(b=="string"||b=="number"||b=="atom")return k(Zt);if(b=="[")return k(Z("]"),De(Pe,"]",","),ce,Zt);if(b=="{")return k(Z("}"),me,ce,Zt);if(b=="(")return k(De(tt,")"),na,Zt);if(b=="<")return k(De(Pe,">"),Pe);if(b=="quasi")return Q(Ct,Zt)}function na(b){if(b=="=>")return k(Pe)}function me(b){return b.match(/[\}\)\]]/)?k():b==","||b==";"?k(me):Q(kn,me)}function kn(b,T){if(b=="variable"||H.style=="keyword")return H.marked="property",k(kn);if(T=="?"||b=="number"||b=="string")return k(kn);if(b==":")return k(Pe);if(b=="[")return k(ke("variable"),er,ke("]"),kn);if(b=="(")return Q(Fn,kn);if(!b.match(/[;\}\)\],]/))return k()}function Ct(b,T){return b!="quasi"?Q():T.slice(T.length-2)!="${"?k(Ct):k(Pe,et)}function et(b){if(b=="}")return H.marked="string-2",H.state.tokenize=ue,k(Ct)}function tt(b,T){return b=="variable"&&H.stream.match(/^\s*[?:]/,!1)||T=="?"?k(tt):b==":"?k(Pe):b=="spread"?k(tt):Q(Pe)}function Zt(b,T){if(T=="<")return k(Z(">"),De(Pe,">"),ce,Zt);if(T=="|"||b=="."||T=="&")return k(Pe);if(b=="[")return k(Pe,ke("]"),Zt);if(T=="extends"||T=="implements")return H.marked="keyword",k(Pe);if(T=="?")return k(Pe,ke(":"),Pe)}function $t(b,T){if(T=="<")return k(Z(">"),De(Pe,">"),ce,Zt)}function rn(){return Q(Pe,Tt)}function Tt(b,T){if(T=="=")return k(Pe)}function kr(b,T){return T=="enum"?(H.marked="keyword",k(fe)):Q(At,On,an,cs)}function At(b,T){if(S&&R(T))return H.marked="keyword",k(At);if(b=="variable")return G(T),k();if(b=="spread")return k(At);if(b=="[")return zt(li,"]");if(b=="{")return zt(Mn,"}")}function Mn(b,T){return b=="variable"&&!H.stream.match(/^\s*:/,!1)?(G(T),k(an)):(b=="variable"&&(H.marked="property"),b=="spread"?k(At):b=="}"?Q():b=="["?k(we,ke("]"),ke(":"),Mn):k(ke(":"),At,an))}function li(){return Q(At,an)}function an(b,T){if(T=="=")return k(Me)}function cs(b){if(b==",")return k(kr)}function Sr(b,T){if(b=="keyword b"&&T=="else")return k(Z("form","else"),_e,ce)}function ra(b,T){if(T=="await")return k(ra);if(b=="(")return k(Z(")"),ui,ce)}function ui(b){return b=="var"?k(kr,Rn):b=="variable"?k(Rn):Q(Rn)}function Rn(b,T){return b==")"?k():b==";"?k(Rn):T=="in"||T=="of"?(H.marked="keyword",k(we,Rn)):Q(we,Rn)}function en(b,T){if(T=="*")return H.marked="keyword",k(en);if(b=="variable")return G(T),k(en);if(b=="(")return k(w,Z(")"),De(sn,")"),ce,Nn,_e,Te);if(S&&T=="<")return k(Z(">"),De(rn,">"),ce,en)}function Fn(b,T){if(T=="*")return H.marked="keyword",k(Fn);if(b=="variable")return G(T),k(Fn);if(b=="(")return k(w,Z(")"),De(sn,")"),ce,Nn,Te);if(S&&T=="<")return k(Z(">"),De(rn,">"),ce,Fn)}function ia(b,T){if(b=="keyword"||b=="variable")return H.marked="type",k(ia);if(T=="<")return k(Z(">"),De(rn,">"),ce)}function sn(b,T){return T=="@"&&k(we,sn),b=="spread"?k(sn):S&&R(T)?(H.marked="keyword",k(sn)):S&&b=="this"?k(On,an):Q(At,On,an)}function hs(b,T){return b=="variable"?Cr(b,T):on(b,T)}function Cr(b,T){if(b=="variable")return G(T),k(on)}function on(b,T){if(T=="<")return k(Z(">"),De(rn,">"),ce,on);if(T=="extends"||T=="implements"||S&&b==",")return T=="implements"&&(H.marked="keyword"),k(S?Pe:we,on);if(b=="{")return k(Z("}"),ln,ce)}function ln(b,T){if(b=="async"||b=="variable"&&(T=="static"||T=="get"||T=="set"||S&&R(T))&&H.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return H.marked="keyword",k(ln);if(b=="variable"||H.style=="keyword")return H.marked="property",k(tr,ln);if(b=="number"||b=="string")return k(tr,ln);if(b=="[")return k(we,On,ke("]"),tr,ln);if(T=="*")return H.marked="keyword",k(ln);if(S&&b=="(")return Q(Fn,ln);if(b==";"||b==",")return k(ln);if(b=="}")return k();if(T=="@")return k(we,ln)}function tr(b,T){if(T=="!"||T=="?")return k(tr);if(b==":")return k(Pe,an);if(T=="=")return k(Me);var j=H.state.lexical.prev,Y=j&&j.info=="interface";return Q(Y?Fn:en)}function Tr(b,T){return T=="*"?(H.marked="keyword",k(Er,ke(";"))):T=="default"?(H.marked="keyword",k(we,ke(";"))):b=="{"?k(De(_r,"}"),Er,ke(";")):Q(_e)}function _r(b,T){if(T=="as")return H.marked="keyword",k(ke("variable"));if(b=="variable")return Q(Me,_r)}function Pn(b){return b=="string"?k():b=="("?Q(we):b=="."?Q(ht):Q(Lr,gn,Er)}function Lr(b,T){return b=="{"?zt(Lr,"}"):(b=="variable"&&G(T),T=="*"&&(H.marked="keyword"),k(fi))}function gn(b){if(b==",")return k(Lr,gn)}function fi(b,T){if(T=="as")return H.marked="keyword",k(Lr)}function Er(b,T){if(T=="from")return H.marked="keyword",k(we)}function nt(b){return b=="]"?k():Q(De(Me,"]"))}function fe(){return Q(Z("form"),At,ke("{"),Z("}"),De(Sn,"}"),ce,ce)}function Sn(){return Q(At,an)}function ci(b,T){return b.lastType=="operator"||b.lastType==","||W.test(T.charAt(0))||/[,.]/.test(T.charAt(0))}function Kt(b,T,j){return T.tokenize==$&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(T.lastType)||T.lastType=="quasi"&&/\{\s*$/.test(b.string.slice(0,b.pos-(j||0)))}return{startState:function(b){var T={tokenize:$,lastType:"sof",cc:[],lexical:new Re((b||0)-d,0,"block",!1),localVars:f.localVars,context:f.localVars&&new K(null,null,!1),indented:b||0};return f.globalVars&&typeof f.globalVars=="object"&&(T.globalVars=f.globalVars),T},token:function(b,T){if(b.sol()&&(T.lexical.hasOwnProperty("align")||(T.lexical.align=!1),T.indented=b.indentation(),he(b,T)),T.tokenize!=ne&&b.eatSpace())return null;var j=T.tokenize(b,T);return F=="comment"?j:(T.lastType=F=="operator"&&(N=="++"||N=="--")?"incdec":F,ze(T,j,F,N,b))},indent:function(b,T){if(b.tokenize==ne||b.tokenize==ue)return a.Pass;if(b.tokenize!=$)return 0;var j=T&&T.charAt(0),Y=b.lexical,P;if(!/^\s*else\b/.test(T))for(var re=b.cc.length-1;re>=0;--re){var $e=b.cc[re];if($e==ce)Y=Y.prev;else if($e!=Sr&&$e!=Te)break}for(;(Y.type=="stat"||Y.type=="form")&&(j=="}"||(P=b.cc[b.cc.length-1])&&(P==ht||P==dt)&&!/^[,\.=+\-*:?[\(]/.test(T));)Y=Y.prev;p&&Y.type==")"&&Y.prev.type=="stat"&&(Y=Y.prev);var mt=Y.type,It=j==mt;return mt=="vardef"?Y.indented+(b.lastType=="operator"||b.lastType==","?Y.info.length+1:0):mt=="form"&&j=="{"?Y.indented:mt=="form"?Y.indented+d:mt=="stat"?Y.indented+(ci(b,T)?p||d:0):Y.info=="switch"&&!It&&f.doubleIndentSwitch!=!1?Y.indented+(/^(?:case|default)\b/.test(T)?d:2*d):Y.align?Y.column+(It?0:1):Y.indented+(It?0:d)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:m?null:"/*",blockCommentEnd:m?null:"*/",blockCommentContinue:m?null:" * ",lineComment:m?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:m?"json":"javascript",jsonldMode:y,jsonMode:m,expressionAllowed:Kt,skipExpression:function(b){ze(b,"atom","atom","true",new a.StringStream("",2,null))}}}),a.registerHelper("wordChars","javascript",/[\w$]/),a.defineMIME("text/javascript","javascript"),a.defineMIME("text/ecmascript","javascript"),a.defineMIME("application/javascript","javascript"),a.defineMIME("application/x-javascript","javascript"),a.defineMIME("application/ecmascript","javascript"),a.defineMIME("application/json",{name:"javascript",json:!0}),a.defineMIME("application/x-json",{name:"javascript",json:!0}),a.defineMIME("application/manifest+json",{name:"javascript",json:!0}),a.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),a.defineMIME("text/typescript",{name:"javascript",typescript:!0}),a.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})(),function(u,n){(function(a){a(Wt())})(function(a){var o={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},f=a.Pos;a.defineOption("autoCloseBrackets",!1,function(N,O,$){$&&$!=a.Init&&(N.removeKeyMap(p),N.state.closeBrackets=null),O&&(y(d(O,"pairs")),N.state.closeBrackets=O,N.addKeyMap(p))});function d(N,O){return O=="pairs"&&typeof N=="string"?N:typeof N=="object"&&N[O]!=null?N[O]:o[O]}var p={Backspace:S,Enter:A};function y(N){for(var O=0;O<N.length;O++){var $=N.charAt(O),X="'"+$+"'";p[X]||(p[X]=m($))}}y(o.pairs+"`");function m(N){return function(O){return B(O,N)}}function x(N){var O=N.state.closeBrackets;if(!O||O.override)return O;var $=N.getModeAt(N.getCursor());return $.closeBrackets||O}function S(N){var O=x(N);if(!O||N.getOption("disableInput"))return a.Pass;for(var $=d(O,"pairs"),X=N.listSelections(),ne=0;ne<X.length;ne++){if(!X[ne].empty())return a.Pass;var ue=q(N,X[ne].head);if(!ue||$.indexOf(ue)%2!=0)return a.Pass}for(var ne=X.length-1;ne>=0;ne--){var se=X[ne].head;N.replaceRange("",f(se.line,se.ch-1),f(se.line,se.ch+1),"+delete")}}function A(N){var O=x(N),$=O&&d(O,"explode");if(!$||N.getOption("disableInput"))return a.Pass;for(var X=N.listSelections(),ne=0;ne<X.length;ne++){if(!X[ne].empty())return a.Pass;var ue=q(N,X[ne].head);if(!ue||$.indexOf(ue)%2!=0)return a.Pass}N.operation(function(){var se=N.lineSeparator()||`
|
|
25
|
+
`;N.replaceSelection(se+se,null),E(N,-1),X=N.listSelections();for(var he=0;he<X.length;he++){var Oe=X[he].head.line;N.indentLine(Oe,null,!0),N.indentLine(Oe+1,null,!0)}})}function E(N,O){for(var $=[],X=N.listSelections(),ne=0,ue=0;ue<X.length;ue++){var se=X[ue];se.head==N.getCursor()&&(ne=ue);var he=se.head.ch||O>0?{line:se.head.line,ch:se.head.ch+O}:{line:se.head.line-1};$.push({anchor:he,head:he})}N.setSelections($,ne)}function W(N){var O=a.cmpPos(N.anchor,N.head)>0;return{anchor:new f(N.anchor.line,N.anchor.ch+(O?-1:1)),head:new f(N.head.line,N.head.ch+(O?1:-1))}}function B(N,O){var $=x(N);if(!$||N.getOption("disableInput"))return a.Pass;var X=d($,"pairs"),ne=X.indexOf(O);if(ne==-1)return a.Pass;for(var ue=d($,"closeBefore"),se=d($,"triples"),he=X.charAt(ne+1)==O,Oe=N.listSelections(),Re=ne%2==0,ie,ze=0;ze<Oe.length;ze++){var H=Oe[ze],Q=H.head,k,J=N.getRange(Q,f(Q.line,Q.ch+1));if(Re&&!H.empty())k="surround";else if((he||!Re)&&J==O)he&&F(N,Q)?k="both":se.indexOf(O)>=0&&N.getRange(Q,f(Q.line,Q.ch+3))==O+O+O?k="skipThree":k="skip";else if(he&&Q.ch>1&&se.indexOf(O)>=0&&N.getRange(f(Q.line,Q.ch-2),Q)==O+O){if(Q.ch>2&&/\bstring/.test(N.getTokenTypeAt(f(Q.line,Q.ch-2))))return a.Pass;k="addFour"}else if(he){var G=Q.ch==0?" ":N.getRange(f(Q.line,Q.ch-1),Q);if(!a.isWordChar(J)&&G!=O&&!a.isWordChar(G))k="both";else return a.Pass}else if(Re&&(J.length===0||/\s/.test(J)||ue.indexOf(J)>-1))k="both";else return a.Pass;if(!ie)ie=k;else if(ie!=k)return a.Pass}var D=ne%2?X.charAt(ne-1):O,R=ne%2?O:X.charAt(ne+1);N.operation(function(){if(ie=="skip")E(N,1);else if(ie=="skipThree")E(N,3);else if(ie=="surround"){for(var K=N.getSelections(),de=0;de<K.length;de++)K[de]=D+K[de]+R;N.replaceSelections(K,"around"),K=N.listSelections().slice();for(var de=0;de<K.length;de++)K[de]=W(K[de]);N.setSelections(K)}else ie=="both"?(N.replaceSelection(D+R,null),N.triggerElectric(D+R),E(N,-1)):ie=="addFour"&&(N.replaceSelection(D+D+D+D,"before"),E(N,1))})}function q(N,O){var $=N.getRange(f(O.line,O.ch-1),f(O.line,O.ch+1));return $.length==2?$:null}function F(N,O){var $=N.getTokenAt(f(O.line,O.ch+1));return/\bstring/.test($.type)&&$.start==O.ch&&(O.ch==0||!/\bstring/.test(N.getTokenTypeAt(O)))}})}(),function(u,n){(function(a){a(Wt())})(function(a){var o=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),f=a.Pos,d={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function p(E){return E&&E.bracketRegex||/[(){}[\]]/}function y(E,W,B){var q=E.getLineHandle(W.line),F=W.ch-1,N=B&&B.afterCursor;N==null&&(N=/(^| )cm-fat-cursor($| )/.test(E.getWrapperElement().className));var O=p(B),$=!N&&F>=0&&O.test(q.text.charAt(F))&&d[q.text.charAt(F)]||O.test(q.text.charAt(F+1))&&d[q.text.charAt(++F)];if(!$)return null;var X=$.charAt(1)==">"?1:-1;if(B&&B.strict&&X>0!=(F==W.ch))return null;var ne=E.getTokenTypeAt(f(W.line,F+1)),ue=m(E,f(W.line,F+(X>0?1:0)),X,ne,B);return ue==null?null:{from:f(W.line,F),to:ue&&ue.pos,match:ue&&ue.ch==$.charAt(0),forward:X>0}}function m(E,W,B,q,F){for(var N=F&&F.maxScanLineLength||1e4,O=F&&F.maxScanLines||1e3,$=[],X=p(F),ne=B>0?Math.min(W.line+O,E.lastLine()+1):Math.max(E.firstLine()-1,W.line-O),ue=W.line;ue!=ne;ue+=B){var se=E.getLine(ue);if(se){var he=B>0?0:se.length-1,Oe=B>0?se.length:-1;if(!(se.length>N))for(ue==W.line&&(he=W.ch-(B<0?1:0));he!=Oe;he+=B){var Re=se.charAt(he);if(X.test(Re)&&(q===void 0||(E.getTokenTypeAt(f(ue,he+1))||"")==(q||""))){var ie=d[Re];if(ie&&ie.charAt(1)==">"==B>0)$.push(Re);else if($.length)$.pop();else return{pos:f(ue,he),ch:Re}}}}}return ue-B==(B>0?E.lastLine():E.firstLine())?!1:null}function x(E,W,B){for(var q=E.state.matchBrackets.maxHighlightLineLength||1e3,F=B&&B.highlightNonMatching,N=[],O=E.listSelections(),$=0;$<O.length;$++){var X=O[$].empty()&&y(E,O[$].head,B);if(X&&(X.match||F!==!1)&&E.getLine(X.from.line).length<=q){var ne=X.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";N.push(E.markText(X.from,f(X.from.line,X.from.ch+1),{className:ne})),X.to&&E.getLine(X.to.line).length<=q&&N.push(E.markText(X.to,f(X.to.line,X.to.ch+1),{className:ne}))}}if(N.length){o&&E.state.focused&&E.focus();var ue=function(){E.operation(function(){for(var se=0;se<N.length;se++)N[se].clear()})};if(W)setTimeout(ue,800);else return ue}}function S(E){E.operation(function(){E.state.matchBrackets.currentlyHighlighted&&(E.state.matchBrackets.currentlyHighlighted(),E.state.matchBrackets.currentlyHighlighted=null),E.state.matchBrackets.currentlyHighlighted=x(E,!1,E.state.matchBrackets)})}function A(E){E.state.matchBrackets&&E.state.matchBrackets.currentlyHighlighted&&(E.state.matchBrackets.currentlyHighlighted(),E.state.matchBrackets.currentlyHighlighted=null)}a.defineOption("matchBrackets",!1,function(E,W,B){B&&B!=a.Init&&(E.off("cursorActivity",S),E.off("focus",S),E.off("blur",A),A(E)),W&&(E.state.matchBrackets=typeof W=="object"?W:{},E.on("cursorActivity",S),E.on("focus",S),E.on("blur",A))}),a.defineExtension("matchBrackets",function(){x(this,!0)}),a.defineExtension("findMatchingBracket",function(E,W,B){return(B||typeof W=="boolean")&&(B?(B.strict=W,W=B):W=W?{strict:!0}:null),y(this,E,W)}),a.defineExtension("scanForBracket",function(E,W,B,q){return m(this,E,W,B,q)})})}();var Xf={exports:{}};(function(u,n){(function(a){a(Wt())})(function(a){function o(y,m,x,S){if(x&&x.call){var A=x;x=null}else var A=p(y,x,"rangeFinder");typeof m=="number"&&(m=a.Pos(m,0));var E=p(y,x,"minFoldSize");function W(N){var O=A(y,m);if(!O||O.to.line-O.from.line<E)return null;if(S==="fold")return O;for(var $=y.findMarksAt(O.from),X=0;X<$.length;++X)if($[X].__isFold){if(!N)return null;O.cleared=!0,$[X].clear()}return O}var B=W(!0);if(p(y,x,"scanUp"))for(;!B&&m.line>y.firstLine();)m=a.Pos(m.line-1,0),B=W(!1);if(!(!B||B.cleared||S==="unfold")){var q=f(y,x,B);a.on(q,"mousedown",function(N){F.clear(),a.e_preventDefault(N)});var F=y.markText(B.from,B.to,{replacedWith:q,clearOnEnter:p(y,x,"clearOnEnter"),__isFold:!0});F.on("clear",function(N,O){a.signal(y,"unfold",y,N,O)}),a.signal(y,"fold",y,B.from,B.to)}}function f(y,m,x){var S=p(y,m,"widget");if(typeof S=="function"&&(S=S(x.from,x.to)),typeof S=="string"){var A=document.createTextNode(S);S=document.createElement("span"),S.appendChild(A),S.className="CodeMirror-foldmarker"}else S&&(S=S.cloneNode(!0));return S}a.newFoldFunction=function(y,m){return function(x,S){o(x,S,{rangeFinder:y,widget:m})}},a.defineExtension("foldCode",function(y,m,x){o(this,y,m,x)}),a.defineExtension("isFolded",function(y){for(var m=this.findMarksAt(y),x=0;x<m.length;++x)if(m[x].__isFold)return!0}),a.commands.toggleFold=function(y){y.foldCode(y.getCursor())},a.commands.fold=function(y){y.foldCode(y.getCursor(),null,"fold")},a.commands.unfold=function(y){y.foldCode(y.getCursor(),{scanUp:!1},"unfold")},a.commands.foldAll=function(y){y.operation(function(){for(var m=y.firstLine(),x=y.lastLine();m<=x;m++)y.foldCode(a.Pos(m,0),{scanUp:!1},"fold")})},a.commands.unfoldAll=function(y){y.operation(function(){for(var m=y.firstLine(),x=y.lastLine();m<=x;m++)y.foldCode(a.Pos(m,0),{scanUp:!1},"unfold")})},a.registerHelper("fold","combine",function(){var y=Array.prototype.slice.call(arguments,0);return function(m,x){for(var S=0;S<y.length;++S){var A=y[S](m,x);if(A)return A}}}),a.registerHelper("fold","auto",function(y,m){for(var x=y.getHelpers(m,"fold"),S=0;S<x.length;S++){var A=x[S](y,m);if(A)return A}});var d={rangeFinder:a.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};a.defineOption("foldOptions",null);function p(y,m,x){if(m&&m[x]!==void 0)return m[x];var S=y.options.foldOptions;return S&&S[x]!==void 0?S[x]:d[x]}a.defineExtension("foldOption",function(y,m){return p(this,y,m)})})})();var Yf=Xf.exports;(function(u,n){(function(a){a(Wt(),Yf)})(function(a){a.defineOption("foldGutter",!1,function(F,N,O){O&&O!=a.Init&&(F.clearGutter(F.state.foldGutter.options.gutter),F.state.foldGutter=null,F.off("gutterClick",A),F.off("changes",W),F.off("viewportChange",B),F.off("fold",q),F.off("unfold",q),F.off("swapDoc",W),F.off("optionChange",E)),N&&(F.state.foldGutter=new f(d(N)),S(F),F.on("gutterClick",A),F.on("changes",W),F.on("viewportChange",B),F.on("fold",q),F.on("unfold",q),F.on("swapDoc",W),F.on("optionChange",E))});var o=a.Pos;function f(F){this.options=F,this.from=this.to=0}function d(F){return F===!0&&(F={}),F.gutter==null&&(F.gutter="CodeMirror-foldgutter"),F.indicatorOpen==null&&(F.indicatorOpen="CodeMirror-foldgutter-open"),F.indicatorFolded==null&&(F.indicatorFolded="CodeMirror-foldgutter-folded"),F}function p(F,N){for(var O=F.findMarks(o(N,0),o(N+1,0)),$=0;$<O.length;++$)if(O[$].__isFold){var X=O[$].find(-1);if(X&&X.line===N)return O[$]}}function y(F){if(typeof F=="string"){var N=document.createElement("div");return N.className=F+" CodeMirror-guttermarker-subtle",N}else return F.cloneNode(!0)}function m(F,N,O){var $=F.state.foldGutter.options,X=N-1,ne=F.foldOption($,"minFoldSize"),ue=F.foldOption($,"rangeFinder"),se=typeof $.indicatorFolded=="string"&&x($.indicatorFolded),he=typeof $.indicatorOpen=="string"&&x($.indicatorOpen);F.eachLine(N,O,function(Oe){++X;var Re=null,ie=Oe.gutterMarkers;if(ie&&(ie=ie[$.gutter]),p(F,X)){if(se&&ie&&se.test(ie.className))return;Re=y($.indicatorFolded)}else{var ze=o(X,0),H=ue&&ue(F,ze);if(H&&H.to.line-H.from.line>=ne){if(he&&ie&&he.test(ie.className))return;Re=y($.indicatorOpen)}}!Re&&!ie||F.setGutterMarker(Oe,$.gutter,Re)})}function x(F){return new RegExp("(^|\\s)"+F+"(?:$|\\s)\\s*")}function S(F){var N=F.getViewport(),O=F.state.foldGutter;O&&(F.operation(function(){m(F,N.from,N.to)}),O.from=N.from,O.to=N.to)}function A(F,N,O){var $=F.state.foldGutter;if($){var X=$.options;if(O==X.gutter){var ne=p(F,N);ne?ne.clear():F.foldCode(o(N,0),X)}}}function E(F,N){N=="mode"&&W(F)}function W(F){var N=F.state.foldGutter;if(N){var O=N.options;N.from=N.to=0,clearTimeout(N.changeUpdate),N.changeUpdate=setTimeout(function(){S(F)},O.foldOnChangeTimeSpan||600)}}function B(F){var N=F.state.foldGutter;if(N){var O=N.options;clearTimeout(N.changeUpdate),N.changeUpdate=setTimeout(function(){var $=F.getViewport();N.from==N.to||$.from-N.to>20||N.from-$.to>20?S(F):F.operation(function(){$.from<N.from&&(m(F,$.from,N.from),N.from=$.from),$.to>N.to&&(m(F,N.to,$.to),N.to=$.to)})},O.updateViewportTimeSpan||400)}}function q(F,N){var O=F.state.foldGutter;if(O){var $=N.line;$>=O.from&&$<O.to&&m(F,$,$+1)}}})})(),function(u,n){(function(a){a(Wt())})(function(a){function o(f){return function(d,p){var y=p.line,m=d.getLine(y);function x(q){for(var F,N=p.ch,O=0;;){var $=N<=0?-1:m.lastIndexOf(q[0],N-1);if($==-1){if(O==1)break;O=1,N=m.length;continue}if(O==1&&$<p.ch)break;if(F=d.getTokenTypeAt(a.Pos(y,$+1)),!/^(comment|string)/.test(F))return{ch:$+1,tokenType:F,pair:q};N=$-1}}function S(q){var F=1,N=d.lastLine(),O,$=q.ch,X;e:for(var ne=y;ne<=N;++ne)for(var ue=d.getLine(ne),se=ne==y?$:0;;){var he=ue.indexOf(q.pair[0],se),Oe=ue.indexOf(q.pair[1],se);if(he<0&&(he=ue.length),Oe<0&&(Oe=ue.length),se=Math.min(he,Oe),se==ue.length)break;if(d.getTokenTypeAt(a.Pos(ne,se+1))==q.tokenType){if(se==he)++F;else if(!--F){O=ne,X=se;break e}}++se}return O==null||y==O?null:{from:a.Pos(y,$),to:a.Pos(O,X)}}for(var A=[],E=0;E<f.length;E++){var W=x(f[E]);W&&A.push(W)}A.sort(function(q,F){return q.ch-F.ch});for(var E=0;E<A.length;E++){var B=S(A[E]);if(B)return B}return null}}a.registerHelper("fold","brace",o([["{","}"],["[","]"]])),a.registerHelper("fold","brace-paren",o([["{","}"],["[","]"],["(",")"]])),a.registerHelper("fold","import",function(f,d){function p(E){if(E<f.firstLine()||E>f.lastLine())return null;var W=f.getTokenAt(a.Pos(E,1));if(/\S/.test(W.string)||(W=f.getTokenAt(a.Pos(E,W.end+1))),W.type!="keyword"||W.string!="import")return null;for(var B=E,q=Math.min(f.lastLine(),E+10);B<=q;++B){var F=f.getLine(B),N=F.indexOf(";");if(N!=-1)return{startCh:W.end,end:a.Pos(B,N)}}}var y=d.line,m=p(y),x;if(!m||p(y-1)||(x=p(y-2))&&x.end.line==y-1)return null;for(var S=m.end;;){var A=p(S.line+1);if(A==null)break;S=A.end}return{from:f.clipPos(a.Pos(y,m.startCh+1)),to:S}}),a.registerHelper("fold","include",function(f,d){function p(A){if(A<f.firstLine()||A>f.lastLine())return null;var E=f.getTokenAt(a.Pos(A,1));if(/\S/.test(E.string)||(E=f.getTokenAt(a.Pos(A,E.end+1))),E.type=="meta"&&E.string.slice(0,8)=="#include")return E.start+8}var y=d.line,m=p(y);if(m==null||p(y-1)!=null)return null;for(var x=y;;){var S=p(x+1);if(S==null)break;++x}return{from:a.Pos(y,m+1),to:f.clipPos(a.Pos(x))}})})}(),function(u,n){(function(a){a(Wt())})(function(a){function o(f,d){var p=f.getLine(d),y=p.search(/\S/);return y==-1||/\bcomment\b/.test(f.getTokenTypeAt(a.Pos(d,y+1)))?-1:a.countColumn(p,null,f.getOption("tabSize"))}a.registerHelper("fold","indent",function(f,d){var p=o(f,d.line);if(!(p<0)){for(var y=null,m=d.line+1,x=f.lastLine();m<=x;++m){var S=o(f,m);if(S!=-1)if(S>p)y=m;else break}if(y)return{from:a.Pos(d.line,f.getLine(d.line).length),to:a.Pos(y,f.getLine(y).length)}}})})}(),function(u,n){(function(a){a(Wt())})(function(a){a.defineOption("autoRefresh",!1,function(d,p){d.state.autoRefresh&&(f(d,d.state.autoRefresh),d.state.autoRefresh=null),p&&d.display.wrapper.offsetHeight==0&&o(d,d.state.autoRefresh={delay:p.delay||250})});function o(d,p){function y(){d.display.wrapper.offsetHeight?(f(d,p),d.display.lastWrapHeight!=d.display.wrapper.clientHeight&&d.refresh()):p.timeout=setTimeout(y,p.delay)}p.timeout=setTimeout(y,p.delay),p.hurry=function(){clearTimeout(p.timeout),p.timeout=setTimeout(y,50)},a.on(window,"mouseup",p.hurry),a.on(window,"keyup",p.hurry)}function f(d,p){clearTimeout(p.timeout),a.off(window,"mouseup",p.hurry),a.off(window,"keyup",p.hurry)}})}();const uo=it.defineStore("trace",{state:()=>({traces:[],currentTrace:null}),getters:{getTraces:u=>u.traces,getCurrentTrace:u=>u.currentTrace},actions:{setTraces(u){this.traces=u},setCurrentTrace(u){this.currentTrace=u}}}),Vf=()=>typeof __TRACE_API_BASE_URL__<"u"?__TRACE_API_BASE_URL__:typeof window<"u"&&window.__TRACE_API_BASE_URL__?window.__TRACE_API_BASE_URL__:typeof process<"u"&&process.env&&process.env.TRACE_API_BASE_URL?process.env.TRACE_API_BASE_URL:"/tracing",Kn=Yt.create({baseURL:Vf(),timeout:36e5}),xn={getExperiments(){return Kn.post("/experiments/search").then(u=>u.data)},getTraceList(u,n,a,o,f,d){const p={};return u&&(p.query=u),n&&(p.startTime=n),a&&(p.endTime=a),o&&(p.pageNo=o),f&&(p.pageSize=f),d&&(p.experimentId=d),Kn.get("/v1/trace",{params:p}).then(y=>y.data)},getTraceDetail(u){return Kn.get(`/v1/trace/${u}`).then(n=>n.data)},getTraceSpans(u){return Kn.get(`/v1/trace/${u}/spans`).then(n=>n.data)},getSpanContent(u,n){return Kn.get(`/v1/trace/${u}/span/${n}/content`).then(a=>a.data)},deleteTraces(u,n,a,o){const f={};return u&&(f.query=u),n&&(f.startTime=n),a&&(f.endTime=a),o&&(f.experimentId=o),Kn.delete("/v1/trace",{params:f}).then(d=>d.data)},debugTrace(u,n={}){return Kn.post("/debug",u,{headers:n}).then(a=>a.data)}};var fo={exports:{}};(function(u,n){(function(a,o){u.exports=o(Wt())})(oo,function(a){return function(o){function f(p){if(d[p])return d[p].exports;var y=d[p]={i:p,l:!1,exports:{}};return o[p].call(y.exports,y,y.exports,f),y.l=!0,y.exports}var d={};return f.m=o,f.c=d,f.i=function(p){return p},f.d=function(p,y,m){f.o(p,y)||Object.defineProperty(p,y,{configurable:!1,enumerable:!0,get:m})},f.n=function(p){var y=p&&p.__esModule?function(){return p.default}:function(){return p};return f.d(y,"a",y),y},f.o=function(p,y){return Object.prototype.hasOwnProperty.call(p,y)},f.p="/",f(f.s=3)}([function(o,f){o.exports=a},function(o,f,d){Object.defineProperty(f,"__esModule",{value:!0});var p=d(0),y=function(x){return x&&x.__esModule?x:{default:x}}(p),m=window.CodeMirror||y.default;typeof Object.assign!="function"&&Object.defineProperty(Object,"assign",{value:function(x,S){if(x==null)throw new TypeError("Cannot convert undefined or null to object");for(var A=Object(x),E=1;E<arguments.length;E++){var W=arguments[E];if(W!=null)for(var B in W)Object.prototype.hasOwnProperty.call(W,B)&&(A[B]=W[B])}return A},writable:!0,configurable:!0}),f.default={name:"codemirror",data:function(){return{content:"",codemirror:null,cminstance:null}},props:{code:String,value:String,marker:Function,unseenLines:Array,name:{type:String,default:"codemirror"},placeholder:{type:String,default:""},merge:{type:Boolean,default:!1},options:{type:Object,default:function(){return{}}},events:{type:Array,default:function(){return[]}},globalOptions:{type:Object,default:function(){return{}}},globalEvents:{type:Array,default:function(){return[]}}},watch:{options:{deep:!0,handler:function(x){for(var S in x)this.cminstance.setOption(S,x[S])}},merge:function(){this.$nextTick(this.switchMerge)},code:function(x){this.handerCodeChange(x)},value:function(x){this.handerCodeChange(x)}},methods:{initialize:function(){var x=this,S=Object.assign({},this.globalOptions,this.options);this.merge?(this.codemirror=m.MergeView(this.$refs.mergeview,S),this.cminstance=this.codemirror.edit):(this.codemirror=m.fromTextArea(this.$refs.textarea,S),this.cminstance=this.codemirror,this.cminstance.setValue(this.code||this.value||this.content)),this.cminstance.on("change",function(E){x.content=E.getValue(),x.$emit&&x.$emit("input",x.content)});var A={};["scroll","changes","beforeChange","cursorActivity","keyHandled","inputRead","electricInput","beforeSelectionChange","viewportChange","swapDoc","gutterClick","gutterContextMenu","focus","blur","refresh","optionChange","scrollCursorIntoView","update"].concat(this.events).concat(this.globalEvents).filter(function(E){return!A[E]&&(A[E]=!0)}).forEach(function(E){x.cminstance.on(E,function(){for(var W=arguments.length,B=Array(W),q=0;q<W;q++)B[q]=arguments[q];x.$emit.apply(x,[E].concat(B));var F=E.replace(/([A-Z])/g,"-$1").toLowerCase();F!==E&&x.$emit.apply(x,[F].concat(B))})}),this.$emit("ready",this.codemirror),this.unseenLineMarkers(),this.refresh()},refresh:function(){var x=this;this.$nextTick(function(){x.cminstance.refresh()})},destroy:function(){var x=this.cminstance.doc.cm.getWrapperElement();x&&x.remove&&x.remove()},handerCodeChange:function(x){if(x!==this.cminstance.getValue()){var S=this.cminstance.getScrollInfo();this.cminstance.setValue(x),this.content=x,this.cminstance.scrollTo(S.left,S.top)}this.unseenLineMarkers()},unseenLineMarkers:function(){var x=this;this.unseenLines!==void 0&&this.marker!==void 0&&this.unseenLines.forEach(function(S){var A=x.cminstance.lineInfo(S);x.cminstance.setGutterMarker(S,"breakpoints",A.gutterMarkers?null:x.marker())})},switchMerge:function(){var x=this.cminstance.doc.history,S=this.cminstance.doc.cleanGeneration;this.options.value=this.cminstance.getValue(),this.destroy(),this.initialize(),this.cminstance.doc.history=x,this.cminstance.doc.cleanGeneration=S}},mounted:function(){this.initialize()},beforeDestroy:function(){this.destroy()}}},function(o,f,d){Object.defineProperty(f,"__esModule",{value:!0});var p=d(1),y=d.n(p);for(var m in p)["default","default"].indexOf(m)<0&&function(E){d.d(f,E,function(){return p[E]})}(m);var x=d(5),S=d(4),A=S(y.a,x.a,!1,null,null,null);f.default=A.exports},function(o,f,d){function p(B){return B&&B.__esModule?B:{default:B}}Object.defineProperty(f,"__esModule",{value:!0}),f.install=f.codemirror=f.CodeMirror=void 0;var y=d(0),m=p(y),x=d(2),S=p(x),A=window.CodeMirror||m.default,E=function(B,q){q&&(q.options&&(S.default.props.globalOptions.default=function(){return q.options}),q.events&&(S.default.props.globalEvents.default=function(){return q.events})),B.component(S.default.name,S.default)},W={CodeMirror:A,codemirror:S.default,install:E};f.default=W,f.CodeMirror=A,f.codemirror=S.default,f.install=E},function(o,f){o.exports=function(d,p,y,m,x,S){var A,E=d=d||{},W=typeof d.default;W!=="object"&&W!=="function"||(A=d,E=d.default);var B=typeof E=="function"?E.options:E;p&&(B.render=p.render,B.staticRenderFns=p.staticRenderFns,B._compiled=!0),y&&(B.functional=!0),x&&(B._scopeId=x);var q;if(S?(q=function(O){O=O||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,O||typeof __VUE_SSR_CONTEXT__>"u"||(O=__VUE_SSR_CONTEXT__),m&&m.call(this,O),O&&O._registeredComponents&&O._registeredComponents.add(S)},B._ssrRegister=q):m&&(q=m),q){var F=B.functional,N=F?B.render:B.beforeCreate;F?(B._injectStyles=q,B.render=function(O,$){return q.call($),N(O,$)}):B.beforeCreate=N?[].concat(N,q):[q]}return{esModule:A,exports:E,options:B}}},function(o,f,d){var p=function(){var x=this,S=x.$createElement,A=x._self._c||S;return A("div",{staticClass:"vue-codemirror",class:{merge:x.merge}},[x.merge?A("div",{ref:"mergeview"}):A("textarea",{ref:"textarea",attrs:{name:x.name,placeholder:x.placeholder}})])},y=[],m={render:p,staticRenderFns:y};f.a=m}])})})(fo);var co=fo.exports;function Pa(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Xn=Pa();function ho(u){Xn=u}const po=/[&<>"']/,Jf=new RegExp(po.source,"g"),go=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Qf=new RegExp(go.source,"g"),Zf={"&":"&","<":"<",">":">",'"':""","'":"'"},mo=u=>Zf[u];function jt(u,n){if(n){if(po.test(u))return u.replace(Jf,mo)}else if(go.test(u))return u.replace(Qf,mo);return u}const ec=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function tc(u){return u.replace(ec,(n,a)=>(a=a.toLowerCase(),a==="colon"?":":a.charAt(0)==="#"?a.charAt(1)==="x"?String.fromCharCode(parseInt(a.substring(2),16)):String.fromCharCode(+a.substring(1)):""))}const nc=/(^|[^\[])\^/g;function je(u,n){let a=typeof u=="string"?u:u.source;n=n||"";const o={replace:(f,d)=>{let p=typeof d=="string"?d:d.source;return p=p.replace(nc,"$1"),a=a.replace(f,p),o},getRegex:()=>new RegExp(a,n)};return o}function vo(u){try{u=encodeURI(u).replace(/%25/g,"%")}catch{return null}return u}const Yr={exec:()=>null};function yo(u,n){const a=u.replace(/\|/g,(d,p,y)=>{let m=!1,x=p;for(;--x>=0&&y[x]==="\\";)m=!m;return m?"|":" |"}),o=a.split(/ \|/);let f=0;if(o[0].trim()||o.shift(),o.length>0&&!o[o.length-1].trim()&&o.pop(),n)if(o.length>n)o.splice(n);else for(;o.length<n;)o.push("");for(;f<o.length;f++)o[f]=o[f].trim().replace(/\\\|/g,"|");return o}function $i(u,n,a){const o=u.length;if(o===0)return"";let f=0;for(;f<o&&u.charAt(o-f-1)===n;)f++;return u.slice(0,o-f)}function rc(u,n){if(u.indexOf(n[1])===-1)return-1;let a=0;for(let o=0;o<u.length;o++)if(u[o]==="\\")o++;else if(u[o]===n[0])a++;else if(u[o]===n[1]&&(a--,a<0))return o;return-1}function bo(u,n,a,o){const f=n.href,d=n.title?jt(n.title):null,p=u[1].replace(/\\([\[\]])/g,"$1");if(u[0].charAt(0)!=="!"){o.state.inLink=!0;const y={type:"link",raw:a,href:f,title:d,text:p,tokens:o.inlineTokens(p)};return o.state.inLink=!1,y}return{type:"image",raw:a,href:f,title:d,text:jt(p)}}function ic(u,n){const a=u.match(/^(\s+)(?:```)/);if(a===null)return n;const o=a[1];return n.split(`
|
|
26
|
+
`).map(f=>{const d=f.match(/^\s+/);if(d===null)return f;const[p]=d;return p.length>=o.length?f.slice(o.length):f}).join(`
|
|
27
|
+
`)}class Bi{constructor(n){Je(this,"options");Je(this,"rules");Je(this,"lexer");this.options=n||Xn}space(n){const a=this.rules.block.newline.exec(n);if(a&&a[0].length>0)return{type:"space",raw:a[0]}}code(n){const a=this.rules.block.code.exec(n);if(a){const o=a[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:a[0],codeBlockStyle:"indented",text:this.options.pedantic?o:$i(o,`
|
|
28
|
+
`)}}}fences(n){const a=this.rules.block.fences.exec(n);if(a){const o=a[0],f=ic(o,a[3]||"");return{type:"code",raw:o,lang:a[2]?a[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):a[2],text:f}}}heading(n){const a=this.rules.block.heading.exec(n);if(a){let o=a[2].trim();if(/#$/.test(o)){const f=$i(o,"#");(this.options.pedantic||!f||/ $/.test(f))&&(o=f.trim())}return{type:"heading",raw:a[0],depth:a[1].length,text:o,tokens:this.lexer.inline(o)}}}hr(n){const a=this.rules.block.hr.exec(n);if(a)return{type:"hr",raw:a[0]}}blockquote(n){const a=this.rules.block.blockquote.exec(n);if(a){const o=$i(a[0].replace(/^ *>[ \t]?/gm,""),`
|
|
29
|
+
`),f=this.lexer.state.top;this.lexer.state.top=!0;const d=this.lexer.blockTokens(o);return this.lexer.state.top=f,{type:"blockquote",raw:a[0],tokens:d,text:o}}}list(n){let a=this.rules.block.list.exec(n);if(a){let o=a[1].trim();const f=o.length>1,d={type:"list",raw:"",ordered:f,start:f?+o.slice(0,-1):"",loose:!1,items:[]};o=f?`\\d{1,9}\\${o.slice(-1)}`:`\\${o}`,this.options.pedantic&&(o=f?o:"[*+-]");const p=new RegExp(`^( {0,3}${o})((?:[ ][^\\n]*)?(?:\\n|$))`);let y="",m="",x=!1;for(;n;){let S=!1;if(!(a=p.exec(n))||this.rules.block.hr.test(n))break;y=a[0],n=n.substring(y.length);let A=a[2].split(`
|
|
30
|
+
`,1)[0].replace(/^\t+/,N=>" ".repeat(3*N.length)),E=n.split(`
|
|
31
|
+
`,1)[0],W=0;this.options.pedantic?(W=2,m=A.trimStart()):(W=a[2].search(/[^ ]/),W=W>4?1:W,m=A.slice(W),W+=a[1].length);let B=!1;if(!A&&/^ *$/.test(E)&&(y+=E+`
|
|
32
|
+
`,n=n.substring(E.length+1),S=!0),!S){const N=new RegExp(`^ {0,${Math.min(3,W-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),O=new RegExp(`^ {0,${Math.min(3,W-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),$=new RegExp(`^ {0,${Math.min(3,W-1)}}(?:\`\`\`|~~~)`),X=new RegExp(`^ {0,${Math.min(3,W-1)}}#`);for(;n;){const ne=n.split(`
|
|
33
|
+
`,1)[0];if(E=ne,this.options.pedantic&&(E=E.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),$.test(E)||X.test(E)||N.test(E)||O.test(n))break;if(E.search(/[^ ]/)>=W||!E.trim())m+=`
|
|
34
|
+
`+E.slice(W);else{if(B||A.search(/[^ ]/)>=4||$.test(A)||X.test(A)||O.test(A))break;m+=`
|
|
35
|
+
`+E}!B&&!E.trim()&&(B=!0),y+=ne+`
|
|
36
|
+
`,n=n.substring(ne.length+1),A=E.slice(W)}}d.loose||(x?d.loose=!0:/\n *\n *$/.test(y)&&(x=!0));let q=null,F;this.options.gfm&&(q=/^\[[ xX]\] /.exec(m),q&&(F=q[0]!=="[ ] ",m=m.replace(/^\[[ xX]\] +/,""))),d.items.push({type:"list_item",raw:y,task:!!q,checked:F,loose:!1,text:m,tokens:[]}),d.raw+=y}d.items[d.items.length-1].raw=y.trimEnd(),d.items[d.items.length-1].text=m.trimEnd(),d.raw=d.raw.trimEnd();for(let S=0;S<d.items.length;S++)if(this.lexer.state.top=!1,d.items[S].tokens=this.lexer.blockTokens(d.items[S].text,[]),!d.loose){const A=d.items[S].tokens.filter(W=>W.type==="space"),E=A.length>0&&A.some(W=>/\n.*\n/.test(W.raw));d.loose=E}if(d.loose)for(let S=0;S<d.items.length;S++)d.items[S].loose=!0;return d}}html(n){const a=this.rules.block.html.exec(n);if(a)return{type:"html",block:!0,raw:a[0],pre:a[1]==="pre"||a[1]==="script"||a[1]==="style",text:a[0]}}def(n){const a=this.rules.block.def.exec(n);if(a){const o=a[1].toLowerCase().replace(/\s+/g," "),f=a[2]?a[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=a[3]?a[3].substring(1,a[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):a[3];return{type:"def",tag:o,raw:a[0],href:f,title:d}}}table(n){const a=this.rules.block.table.exec(n);if(!a||!/[:|]/.test(a[2]))return;const o=yo(a[1]),f=a[2].replace(/^\||\| *$/g,"").split("|"),d=a[3]&&a[3].trim()?a[3].replace(/\n[ \t]*$/,"").split(`
|
|
37
|
+
`):[],p={type:"table",raw:a[0],header:[],align:[],rows:[]};if(o.length===f.length){for(const y of f)/^ *-+: *$/.test(y)?p.align.push("right"):/^ *:-+: *$/.test(y)?p.align.push("center"):/^ *:-+ *$/.test(y)?p.align.push("left"):p.align.push(null);for(const y of o)p.header.push({text:y,tokens:this.lexer.inline(y)});for(const y of d)p.rows.push(yo(y,p.header.length).map(m=>({text:m,tokens:this.lexer.inline(m)})));return p}}lheading(n){const a=this.rules.block.lheading.exec(n);if(a)return{type:"heading",raw:a[0],depth:a[2].charAt(0)==="="?1:2,text:a[1],tokens:this.lexer.inline(a[1])}}paragraph(n){const a=this.rules.block.paragraph.exec(n);if(a){const o=a[1].charAt(a[1].length-1)===`
|
|
38
|
+
`?a[1].slice(0,-1):a[1];return{type:"paragraph",raw:a[0],text:o,tokens:this.lexer.inline(o)}}}text(n){const a=this.rules.block.text.exec(n);if(a)return{type:"text",raw:a[0],text:a[0],tokens:this.lexer.inline(a[0])}}escape(n){const a=this.rules.inline.escape.exec(n);if(a)return{type:"escape",raw:a[0],text:jt(a[1])}}tag(n){const a=this.rules.inline.tag.exec(n);if(a)return!this.lexer.state.inLink&&/^<a /i.test(a[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(a[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:a[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:a[0]}}link(n){const a=this.rules.inline.link.exec(n);if(a){const o=a[2].trim();if(!this.options.pedantic&&/^</.test(o)){if(!/>$/.test(o))return;const p=$i(o.slice(0,-1),"\\");if((o.length-p.length)%2===0)return}else{const p=rc(a[2],"()");if(p>-1){const m=(a[0].indexOf("!")===0?5:4)+a[1].length+p;a[2]=a[2].substring(0,p),a[0]=a[0].substring(0,m).trim(),a[3]=""}}let f=a[2],d="";if(this.options.pedantic){const p=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(f);p&&(f=p[1],d=p[3])}else d=a[3]?a[3].slice(1,-1):"";return f=f.trim(),/^</.test(f)&&(this.options.pedantic&&!/>$/.test(o)?f=f.slice(1):f=f.slice(1,-1)),bo(a,{href:f&&f.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},a[0],this.lexer)}}reflink(n,a){let o;if((o=this.rules.inline.reflink.exec(n))||(o=this.rules.inline.nolink.exec(n))){const f=(o[2]||o[1]).replace(/\s+/g," "),d=a[f.toLowerCase()];if(!d){const p=o[0].charAt(0);return{type:"text",raw:p,text:p}}return bo(o,d,o[0],this.lexer)}}emStrong(n,a,o=""){let f=this.rules.inline.emStrongLDelim.exec(n);if(!f||f[3]&&o.match(/[\p{L}\p{N}]/u))return;if(!(f[1]||f[2]||"")||!o||this.rules.inline.punctuation.exec(o)){const p=[...f[0]].length-1;let y,m,x=p,S=0;const A=f[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(A.lastIndex=0,a=a.slice(-1*n.length+p);(f=A.exec(a))!=null;){if(y=f[1]||f[2]||f[3]||f[4]||f[5]||f[6],!y)continue;if(m=[...y].length,f[3]||f[4]){x+=m;continue}else if((f[5]||f[6])&&p%3&&!((p+m)%3)){S+=m;continue}if(x-=m,x>0)continue;m=Math.min(m,m+x+S);const E=[...f[0]][0].length,W=n.slice(0,p+f.index+E+m);if(Math.min(p,m)%2){const q=W.slice(1,-1);return{type:"em",raw:W,text:q,tokens:this.lexer.inlineTokens(q)}}const B=W.slice(2,-2);return{type:"strong",raw:W,text:B,tokens:this.lexer.inlineTokens(B)}}}}codespan(n){const a=this.rules.inline.code.exec(n);if(a){let o=a[2].replace(/\n/g," ");const f=/[^ ]/.test(o),d=/^ /.test(o)&&/ $/.test(o);return f&&d&&(o=o.substring(1,o.length-1)),o=jt(o,!0),{type:"codespan",raw:a[0],text:o}}}br(n){const a=this.rules.inline.br.exec(n);if(a)return{type:"br",raw:a[0]}}del(n){const a=this.rules.inline.del.exec(n);if(a)return{type:"del",raw:a[0],text:a[2],tokens:this.lexer.inlineTokens(a[2])}}autolink(n){const a=this.rules.inline.autolink.exec(n);if(a){let o,f;return a[2]==="@"?(o=jt(a[1]),f="mailto:"+o):(o=jt(a[1]),f=o),{type:"link",raw:a[0],text:o,href:f,tokens:[{type:"text",raw:o,text:o}]}}}url(n){var o;let a;if(a=this.rules.inline.url.exec(n)){let f,d;if(a[2]==="@")f=jt(a[0]),d="mailto:"+f;else{let p;do p=a[0],a[0]=((o=this.rules.inline._backpedal.exec(a[0]))==null?void 0:o[0])??"";while(p!==a[0]);f=jt(a[0]),a[1]==="www."?d="http://"+a[0]:d=a[0]}return{type:"link",raw:a[0],text:f,href:d,tokens:[{type:"text",raw:f,text:f}]}}}inlineText(n){const a=this.rules.inline.text.exec(n);if(a){let o;return this.lexer.state.inRawBlock?o=a[0]:o=jt(a[0]),{type:"text",raw:a[0],text:o}}}}const ac=/^(?: *(?:\n|$))+/,sc=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,oc=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Vr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,lc=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,xo=/(?:[*+-]|\d{1,9}[.)])/,wo=je(/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,xo).getRegex(),za=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,uc=/^[^\n]+/,$a=/(?!\s*\])(?:\\.|[^\[\]\\])+/,fc=je(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",$a).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),cc=je(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,xo).getRegex(),Hi="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ba=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,hc=je("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))","i").replace("comment",Ba).replace("tag",Hi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ko=je(za).replace("hr",Vr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hi).getRegex(),Ha={blockquote:je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ko).getRegex(),code:sc,def:fc,fences:oc,heading:lc,hr:Vr,html:hc,lheading:wo,list:cc,newline:ac,paragraph:ko,table:Yr,text:uc},So=je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Vr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hi).getRegex(),dc={...Ha,table:So,paragraph:je(za).replace("hr",Vr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",So).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hi).getRegex()},pc={...Ha,html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ba).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Yr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:je(za).replace("hr",Vr).replace("heading",` *#{1,6} *[^
|
|
39
|
+
]`).replace("lheading",wo).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Co=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,gc=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,To=/^( {2,}|\\)\n(?!\s*$)/,mc=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jr="\\p{P}$+<=>`^|~",vc=je(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,Jr).getRegex(),yc=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,bc=je(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,Jr).getRegex(),xc=je("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,Jr).getRegex(),wc=je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,Jr).getRegex(),kc=je(/\\([punct])/,"gu").replace(/punct/g,Jr).getRegex(),Sc=je(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cc=je(Ba).replace("(?:-->|$)","-->").getRegex(),Tc=je("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cc).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Wi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,_c=je(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Wi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_o=je(/^!?\[(label)\]\[(ref)\]/).replace("label",Wi).replace("ref",$a).getRegex(),Lo=je(/^!?\[(ref)\](?:\[\])?/).replace("ref",$a).getRegex(),Lc=je("reflink|nolink(?!\\()","g").replace("reflink",_o).replace("nolink",Lo).getRegex(),Wa={_backpedal:Yr,anyPunctuation:kc,autolink:Sc,blockSkip:yc,br:To,code:gc,del:Yr,emStrongLDelim:bc,emStrongRDelimAst:xc,emStrongRDelimUnd:wc,escape:Co,link:_c,nolink:Lo,punctuation:vc,reflink:_o,reflinkSearch:Lc,tag:Tc,text:mc,url:Yr},Ec={...Wa,link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",Wi).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Wi).getRegex()},ja={...Wa,escape:je(Co).replace("])","~|])").getRegex(),url:je(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Dc={...ja,br:je(To).replace("{2,}","*").getRegex(),text:je(ja.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ji={normal:Ha,gfm:dc,pedantic:pc},Qr={normal:Wa,gfm:ja,breaks:Dc,pedantic:Ec};class dn{constructor(n){Je(this,"tokens");Je(this,"options");Je(this,"state");Je(this,"tokenizer");Je(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=n||Xn,this.options.tokenizer=this.options.tokenizer||new Bi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const a={block:ji.normal,inline:Qr.normal};this.options.pedantic?(a.block=ji.pedantic,a.inline=Qr.pedantic):this.options.gfm&&(a.block=ji.gfm,this.options.breaks?a.inline=Qr.breaks:a.inline=Qr.gfm),this.tokenizer.rules=a}static get rules(){return{block:ji,inline:Qr}}static lex(n,a){return new dn(a).lex(n)}static lexInline(n,a){return new dn(a).inlineTokens(n)}lex(n){n=n.replace(/\r\n|\r/g,`
|
|
40
|
+
`),this.blockTokens(n,this.tokens);for(let a=0;a<this.inlineQueue.length;a++){const o=this.inlineQueue[a];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,a=[]){this.options.pedantic?n=n.replace(/\t/g," ").replace(/^ +$/gm,""):n=n.replace(/^( *)(\t+)/gm,(y,m,x)=>m+" ".repeat(x.length));let o,f,d,p;for(;n;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(y=>(o=y.call({lexer:this},n,a))?(n=n.substring(o.raw.length),a.push(o),!0):!1))){if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length),o.raw.length===1&&a.length>0?a[a.length-1].raw+=`
|
|
41
|
+
`:a.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length),f=a[a.length-1],f&&(f.type==="paragraph"||f.type==="text")?(f.raw+=`
|
|
42
|
+
`+o.raw,f.text+=`
|
|
43
|
+
`+o.text,this.inlineQueue[this.inlineQueue.length-1].src=f.text):a.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length),f=a[a.length-1],f&&(f.type==="paragraph"||f.type==="text")?(f.raw+=`
|
|
44
|
+
`+o.raw,f.text+=`
|
|
45
|
+
`+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=f.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),a.push(o);continue}if(d=n,this.options.extensions&&this.options.extensions.startBlock){let y=1/0;const m=n.slice(1);let x;this.options.extensions.startBlock.forEach(S=>{x=S.call({lexer:this},m),typeof x=="number"&&x>=0&&(y=Math.min(y,x))}),y<1/0&&y>=0&&(d=n.substring(0,y+1))}if(this.state.top&&(o=this.tokenizer.paragraph(d))){f=a[a.length-1],p&&f.type==="paragraph"?(f.raw+=`
|
|
46
|
+
`+o.raw,f.text+=`
|
|
47
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=f.text):a.push(o),p=d.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length),f=a[a.length-1],f&&f.type==="text"?(f.raw+=`
|
|
48
|
+
`+o.raw,f.text+=`
|
|
49
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=f.text):a.push(o);continue}if(n){const y="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(y);break}else throw new Error(y)}}return this.state.top=!0,a}inline(n,a=[]){return this.inlineQueue.push({src:n,tokens:a}),a}inlineTokens(n,a=[]){let o,f,d,p=n,y,m,x;if(this.tokens.links){const S=Object.keys(this.tokens.links);if(S.length>0)for(;(y=this.tokenizer.rules.inline.reflinkSearch.exec(p))!=null;)S.includes(y[0].slice(y[0].lastIndexOf("[")+1,-1))&&(p=p.slice(0,y.index)+"["+"a".repeat(y[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(y=this.tokenizer.rules.inline.blockSkip.exec(p))!=null;)p=p.slice(0,y.index)+"["+"a".repeat(y[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(y=this.tokenizer.rules.inline.anyPunctuation.exec(p))!=null;)p=p.slice(0,y.index)+"++"+p.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;n;)if(m||(x=""),m=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(S=>(o=S.call({lexer:this},n,a))?(n=n.substring(o.raw.length),a.push(o),!0):!1))){if(o=this.tokenizer.escape(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.tag(n)){n=n.substring(o.raw.length),f=a[a.length-1],f&&o.type==="text"&&f.type==="text"?(f.raw+=o.raw,f.text+=o.text):a.push(o);continue}if(o=this.tokenizer.link(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(o.raw.length),f=a[a.length-1],f&&o.type==="text"&&f.type==="text"?(f.raw+=o.raw,f.text+=o.text):a.push(o);continue}if(o=this.tokenizer.emStrong(n,p,x)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.codespan(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.br(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.del(n)){n=n.substring(o.raw.length),a.push(o);continue}if(o=this.tokenizer.autolink(n)){n=n.substring(o.raw.length),a.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(n))){n=n.substring(o.raw.length),a.push(o);continue}if(d=n,this.options.extensions&&this.options.extensions.startInline){let S=1/0;const A=n.slice(1);let E;this.options.extensions.startInline.forEach(W=>{E=W.call({lexer:this},A),typeof E=="number"&&E>=0&&(S=Math.min(S,E))}),S<1/0&&S>=0&&(d=n.substring(0,S+1))}if(o=this.tokenizer.inlineText(d)){n=n.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(x=o.raw.slice(-1)),m=!0,f=a[a.length-1],f&&f.type==="text"?(f.raw+=o.raw,f.text+=o.text):a.push(o);continue}if(n){const S="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return a}}class Ui{constructor(n){Je(this,"options");this.options=n||Xn}code(n,a,o){var d;const f=(d=(a||"").match(/^\S*/))==null?void 0:d[0];return n=n.replace(/\n$/,"")+`
|
|
50
|
+
`,f?'<pre><code class="language-'+jt(f)+'">'+(o?n:jt(n,!0))+`</code></pre>
|
|
51
|
+
`:"<pre><code>"+(o?n:jt(n,!0))+`</code></pre>
|
|
52
|
+
`}blockquote(n){return`<blockquote>
|
|
53
|
+
${n}</blockquote>
|
|
54
|
+
`}html(n,a){return n}heading(n,a,o){return`<h${a}>${n}</h${a}>
|
|
55
55
|
`}hr(){return`<hr>
|
|
56
|
-
`}list(
|
|
57
|
-
`+
|
|
58
|
-
`}listitem(
|
|
59
|
-
`}checkbox(
|
|
60
|
-
`}table(
|
|
56
|
+
`}list(n,a,o){const f=a?"ol":"ul",d=a&&o!==1?' start="'+o+'"':"";return"<"+f+d+`>
|
|
57
|
+
`+n+"</"+f+`>
|
|
58
|
+
`}listitem(n,a,o){return`<li>${n}</li>
|
|
59
|
+
`}checkbox(n){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(n){return`<p>${n}</p>
|
|
60
|
+
`}table(n,a){return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
61
61
|
<thead>
|
|
62
|
-
`+
|
|
63
|
-
`+
|
|
64
|
-
`}tablerow(
|
|
65
|
-
${
|
|
66
|
-
`}tablecell(
|
|
67
|
-
`}strong(
|
|
68
|
-
`+(p.tokens?this.parseInline(p.tokens):p.text);
|
|
69
|
-
Please report this to https://github.com/markedjs/marked.`,i){const c="<p>An error occurred:</p><pre>"+zt(l.message+"",!0)+"</pre>";return s?Promise.resolve(c):c}if(s)return Promise.reject(l);throw l}};const Ur=new yc;function _e(f,i){return Ur.parse(f,i)}_e.options=_e.setOptions=function(f){return Ur.setOptions(f),_e.defaults=Ur.defaults,fo(_e.defaults),_e},_e.getDefaults=za,_e.defaults=Br,_e.use=function(...f){return Ur.use(...f),_e.defaults=Ur.defaults,fo(_e.defaults),_e},_e.walkTokens=function(f,i){return Ur.walkTokens(f,i)},_e.parseInline=Ur.parseInline,_e.Parser=fr,_e.parser=fr.parse,_e.Renderer=Bi,_e.TextRenderer=Ua,_e.Lexer=ur,_e.lexer=ur.lex,_e.Tokenizer=Fi,_e.Hooks=Zn,_e.parse=_e,_e.options,_e.setOptions,_e.use,_e.walkTokens,_e.parseInline,fr.parse,ur.lex;const bc=()=>typeof __TRACE_API_BASE_URL__<"u"?__TRACE_API_BASE_URL__:typeof window<"u"&&window.__TRACE_API_BASE_URL__?window.__TRACE_API_BASE_URL__:typeof process<"u"&&process.env&&process.env.TRACE_API_BASE_URL?process.env.TRACE_API_BASE_URL:"/tracing",Ui=$t.create({baseURL:bc(),timeout:36e5}),on={getTraceList(f,i,s,l,c){const g={};return f&&(g.query=f),i&&(g.startTime=i),s&&(g.endTime=s),l&&(g.pageNo=l),c&&(g.pageSize=c),Ui.get("/v1/trace",{params:g}).then(p=>p.data)},getTraceDetail(f){return Ui.get(`/v1/trace/${f}`).then(i=>i.data)},getTraceSpans(f){return Ui.get(`/v1/trace/${f}/spans`).then(i=>i.data)},deleteTraces(f,i,s){const l={};return f&&(l.query=f),i&&(l.startTime=i),s&&(l.endTime=s),Ui.delete("/v1/trace",{params:l}).then(c=>c.data)}};function Lo(f,i,s,l,c,g,p,w){var b=typeof f=="function"?f.options:f;return i&&(b.render=i,b.staticRenderFns=s,b._compiled=!0),g&&(b._scopeId="data-v-"+g),{exports:f,options:b}}const wc={name:"TraceSpanTree",props:{spans:{type:Array,default:()=>[]},selectedSpanId:{type:String,default:null},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0}},data(){return{expandedNodes:new Set,treeData:[]}},watch:{spans:{immediate:!0,handler(){this.buildTree()}}},methods:{getStatusDescription(f){var i;try{if(f.content){const s=typeof f.content=="string"?JSON.parse(f.content):f.content;return((i=s==null?void 0:s.status)==null?void 0:i.description)||""}return""}catch{return""}},buildTree(){if(!this.spans||this.spans.length===0){this.treeData=[];return}const f=new Map,i=[];this.spans.forEach(s=>{f.set(s.span_id,{...s,children:[]})}),this.spans.forEach(s=>{const l=f.get(s.span_id);if(s.parent_span_id){const c=f.get(s.parent_span_id);c?c.children.push(l):i.push(l)}else i.push(l)}),i.forEach(s=>{this.sortChildren(s)}),this.treeData=i,this.treeData.length>0&&this.expandedNodes.add(this.treeData[0].span_id)},sortChildren(f){f.children&&f.children.length>0&&(f.children.sort((i,s)=>i.start_time_unix_nano-s.start_time_unix_nano),f.children.forEach(i=>this.sortChildren(i)))},handleNodeClick(f){this.$emit("span-select",f)},hasChildren(f){return f.children&&f.children.length>0},isExpanded(f){return this.expandedNodes.has(f.span_id)},toggleExpand(f){this.expandedNodes.has(f.span_id)?this.expandedNodes.delete(f.span_id):this.expandedNodes.add(f.span_id),this.$forceUpdate()},getNodeDepth(f){let i=0,s=f;for(;s.parent_span_id;){i++;const l=this.findNodeById(s.parent_span_id);if(!l)break;s=l}return i},findNodeById(f){const i=s=>{for(const l of s){if(l.span_id===f)return l;if(l.children&&l.children.length>0){const c=i(l.children);if(c)return c}}return null};return i(this.treeData)},getTimelineBarStyle(f){if(!this.traceStartTime||!this.traceEndTime||this.traceStartTime===this.traceEndTime)return{width:"100%"};const i=this.traceEndTime-this.traceStartTime,s=f.start_time_unix_nano-this.traceStartTime,l=f.duration_ns,c=s/i*100,g=l/i*100;return{left:`${c}%`,width:`${g}%`}},getTypeColor(f){return{SERVER:"primary",CHAT_MODEL:"success",LLM:"success",CHAIN:"warning",AGENT:"danger",TOOL:"info",JOB:"warning",FUNCTION:"info"}[f]||"info"},formatNanoDuration(f){if(!f)return"-";const i=f/1e6;return i<1e3?`${i.toFixed(2)}ms`:i<6e4?`${(i/1e3).toFixed(2)}s`:`${(i/6e4).toFixed(2)}min`},formatTime(f){if(!f)return"-";const i=f/1e6,s=new Date(i),l=s.getFullYear(),c=String(s.getMonth()+1).padStart(2,"0"),g=String(s.getDate()).padStart(2,"0"),p=String(s.getHours()).padStart(2,"0"),w=String(s.getMinutes()).padStart(2,"0"),b=String(s.getSeconds()).padStart(2,"0");return`${l}-${c}-${g} ${p}:${w}:${b}`}}};var xc=function(){var i=this,s=i._self._c;return s("div",{staticClass:"span-tree-container"},[i.treeData.length===0?s("div",{staticClass:"empty-state"},[s("el-empty",{attrs:{description:"暂无 Span 数据"}})],1):s("div",{staticClass:"timeline-wrapper"},[s("div",{staticClass:"timeline-header"},[s("div",{staticClass:"time-scale"},[s("span",{staticClass:"time-start"},[i._v(i._s(i.formatTime(i.traceStartTime)))]),s("span",{staticClass:"time-end"},[i._v(i._s(i.formatTime(i.traceEndTime)))])])]),s("div",{ref:"timelineContent",staticClass:"timeline-content"},i._l(i.treeData,function(l,c){return s("div",{key:l.span_id},[s("div",{staticClass:"timeline-node",class:{selected:i.selectedSpanId===l.span_id,error:l.status==="ERROR"},on:{click:function(g){return i.handleNodeClick(l)}}},[s("div",{staticClass:"node-row"},[s("div",{staticClass:"node-info",style:{paddingLeft:`${i.getNodeDepth(l)*20}px`}},[i.hasChildren(l)?s("i",{staticClass:"expand-icon",class:i.isExpanded(l)?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:function(g){return g.stopPropagation(),i.toggleExpand(l)}}}):s("i",{staticClass:"expand-icon-placeholder"}),s("el-tag",{staticClass:"type-tag",attrs:{type:i.getTypeColor(l.type),size:"mini"}},[i._v(" "+i._s(l.type)+" ")]),s("el-tooltip",{attrs:{content:l.name,placement:"top","open-delay":300}},[s("span",{staticClass:"node-name"},[i._v(i._s(l.name))])])],1),s("div",{staticClass:"node-duration"},[i._v(" "+i._s(i.formatNanoDuration(l.duration_ns))+" ")])]),s("el-tooltip",{attrs:{content:i.getStatusDescription(l),disabled:!i.getStatusDescription(l),placement:"top","popper-class":"span-status-tooltip"}},[s("div",{staticClass:"timeline-bar-wrapper"},[s("div",{staticClass:"timeline-bar",class:{selected:i.selectedSpanId===l.span_id,error:l.status==="ERROR"},style:i.getTimelineBarStyle(l)})])])],1),i.isExpanded(l)&&i.hasChildren(l)?s("div",{staticClass:"children-nodes"},i._l(l.children,function(g){return s("div",{key:g.span_id},[s("div",{staticClass:"timeline-node child-node",class:{selected:i.selectedSpanId===g.span_id,error:g.status==="ERROR"},on:{click:function(p){return p.stopPropagation(),i.handleNodeClick(g)}}},[s("div",{staticClass:"node-row"},[s("div",{staticClass:"node-info",style:{paddingLeft:`${i.getNodeDepth(g)*20}px`}},[i.hasChildren(g)?s("i",{staticClass:"expand-icon",class:i.isExpanded(g)?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:function(p){return p.stopPropagation(),i.toggleExpand(g)}}}):s("i",{staticClass:"expand-icon-placeholder"}),s("el-tag",{staticClass:"type-tag",attrs:{type:i.getTypeColor(g.type),size:"mini"}},[i._v(" "+i._s(g.type)+" ")]),s("el-tooltip",{attrs:{content:g.name,placement:"top","open-delay":300}},[s("span",{staticClass:"node-name"},[i._v(i._s(g.name))])])],1),s("div",{staticClass:"node-duration"},[i._v(" "+i._s(i.formatNanoDuration(g.duration_ns))+" ")])]),s("el-tooltip",{attrs:{content:i.getStatusDescription(g),disabled:!i.getStatusDescription(g),placement:"top","popper-class":"span-status-tooltip"}},[s("div",{staticClass:"timeline-bar-wrapper"},[s("div",{staticClass:"timeline-bar",class:{selected:i.selectedSpanId===g.span_id,error:g.status==="ERROR"},style:i.getTimelineBarStyle(g)})])])],1),i.isExpanded(g)&&i.hasChildren(g)?s("div",{staticClass:"children-nodes"},i._l(g.children,function(p){return s("div",{key:p.span_id,staticClass:"timeline-node child-node",class:{selected:i.selectedSpanId===p.span_id,error:p.status==="ERROR"},on:{click:function(w){return w.stopPropagation(),i.handleNodeClick(p)}}},[s("div",{staticClass:"node-row"},[s("div",{staticClass:"node-info",style:{paddingLeft:`${i.getNodeDepth(p)*20}px`}},[s("i",{staticClass:"expand-icon-placeholder"}),s("el-tag",{staticClass:"type-tag",attrs:{type:i.getTypeColor(p.type),size:"mini"}},[i._v(" "+i._s(p.type)+" ")]),s("el-tooltip",{attrs:{content:p.name,placement:"top","open-delay":300}},[s("span",{staticClass:"node-name"},[i._v(i._s(p.name))])])],1),s("div",{staticClass:"node-duration"},[i._v(" "+i._s(i.formatNanoDuration(p.duration_ns))+" ")])]),s("el-tooltip",{attrs:{content:i.getStatusDescription(p),disabled:!i.getStatusDescription(p),placement:"top","popper-class":"span-status-tooltip"}},[s("div",{staticClass:"timeline-bar-wrapper"},[s("div",{staticClass:"timeline-bar",class:{selected:i.selectedSpanId===p.span_id,error:p.status==="ERROR"},style:i.getTimelineBarStyle(p)})])])],1)}),0):i._e()])}),0):i._e()])}),0)])])},kc=[],Sc=Lo(wc,xc,kc,!1,null,"326eec66");const ja=Sc.exports;/*!
|
|
62
|
+
`+n+`</thead>
|
|
63
|
+
`+a+`</table>
|
|
64
|
+
`}tablerow(n){return`<tr>
|
|
65
|
+
${n}</tr>
|
|
66
|
+
`}tablecell(n,a){const o=a.header?"th":"td";return(a.align?`<${o} align="${a.align}">`:`<${o}>`)+n+`</${o}>
|
|
67
|
+
`}strong(n){return`<strong>${n}</strong>`}em(n){return`<em>${n}</em>`}codespan(n){return`<code>${n}</code>`}br(){return"<br>"}del(n){return`<del>${n}</del>`}link(n,a,o){const f=vo(n);if(f===null)return o;n=f;let d='<a href="'+n+'"';return a&&(d+=' title="'+a+'"'),d+=">"+o+"</a>",d}image(n,a,o){const f=vo(n);if(f===null)return o;n=f;let d=`<img src="${n}" alt="${o}"`;return a&&(d+=` title="${a}"`),d+=">",d}text(n){return n}}class Ua{strong(n){return n}em(n){return n}codespan(n){return n}del(n){return n}html(n){return n}text(n){return n}link(n,a,o){return""+o}image(n,a,o){return""+o}br(){return""}}class pn{constructor(n){Je(this,"options");Je(this,"renderer");Je(this,"textRenderer");this.options=n||Xn,this.options.renderer=this.options.renderer||new Ui,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ua}static parse(n,a){return new pn(a).parse(n)}static parseInline(n,a){return new pn(a).parseInline(n)}parse(n,a=!0){let o="";for(let f=0;f<n.length;f++){const d=n[f];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]){const p=d,y=this.options.extensions.renderers[p.type].call({parser:this},p);if(y!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)){o+=y||"";continue}}switch(d.type){case"space":continue;case"hr":{o+=this.renderer.hr();continue}case"heading":{const p=d;o+=this.renderer.heading(this.parseInline(p.tokens),p.depth,tc(this.parseInline(p.tokens,this.textRenderer)));continue}case"code":{const p=d;o+=this.renderer.code(p.text,p.lang,!!p.escaped);continue}case"table":{const p=d;let y="",m="";for(let S=0;S<p.header.length;S++)m+=this.renderer.tablecell(this.parseInline(p.header[S].tokens),{header:!0,align:p.align[S]});y+=this.renderer.tablerow(m);let x="";for(let S=0;S<p.rows.length;S++){const A=p.rows[S];m="";for(let E=0;E<A.length;E++)m+=this.renderer.tablecell(this.parseInline(A[E].tokens),{header:!1,align:p.align[E]});x+=this.renderer.tablerow(m)}o+=this.renderer.table(y,x);continue}case"blockquote":{const p=d,y=this.parse(p.tokens);o+=this.renderer.blockquote(y);continue}case"list":{const p=d,y=p.ordered,m=p.start,x=p.loose;let S="";for(let A=0;A<p.items.length;A++){const E=p.items[A],W=E.checked,B=E.task;let q="";if(E.task){const F=this.renderer.checkbox(!!W);x?E.tokens.length>0&&E.tokens[0].type==="paragraph"?(E.tokens[0].text=F+" "+E.tokens[0].text,E.tokens[0].tokens&&E.tokens[0].tokens.length>0&&E.tokens[0].tokens[0].type==="text"&&(E.tokens[0].tokens[0].text=F+" "+E.tokens[0].tokens[0].text)):E.tokens.unshift({type:"text",text:F+" "}):q+=F+" "}q+=this.parse(E.tokens,x),S+=this.renderer.listitem(q,B,!!W)}o+=this.renderer.list(S,y,m);continue}case"html":{const p=d;o+=this.renderer.html(p.text,p.block);continue}case"paragraph":{const p=d;o+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{let p=d,y=p.tokens?this.parseInline(p.tokens):p.text;for(;f+1<n.length&&n[f+1].type==="text";)p=n[++f],y+=`
|
|
68
|
+
`+(p.tokens?this.parseInline(p.tokens):p.text);o+=a?this.renderer.paragraph(y):y;continue}default:{const p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return o}parseInline(n,a){a=a||this.renderer;let o="";for(let f=0;f<n.length;f++){const d=n[f];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[d.type]){const p=this.options.extensions.renderers[d.type].call({parser:this},d);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(d.type)){o+=p||"";continue}}switch(d.type){case"escape":{const p=d;o+=a.text(p.text);break}case"html":{const p=d;o+=a.html(p.text);break}case"link":{const p=d;o+=a.link(p.href,p.title,this.parseInline(p.tokens,a));break}case"image":{const p=d;o+=a.image(p.href,p.title,p.text);break}case"strong":{const p=d;o+=a.strong(this.parseInline(p.tokens,a));break}case"em":{const p=d;o+=a.em(this.parseInline(p.tokens,a));break}case"codespan":{const p=d;o+=a.codespan(p.text);break}case"br":{o+=a.br();break}case"del":{const p=d;o+=a.del(this.parseInline(p.tokens,a));break}case"text":{const p=d;o+=a.text(p.text);break}default:{const p='Token with "'+d.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return o}}class Zr{constructor(n){Je(this,"options");this.options=n||Xn}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}}Je(Zr,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Ac{constructor(...n){qf(this,Qn);Je(this,"defaults",Pa());Je(this,"options",this.setOptions);Je(this,"parse",Ra(this,Qn,so).call(this,dn.lex,pn.parse));Je(this,"parseInline",Ra(this,Qn,so).call(this,dn.lexInline,pn.parseInline));Je(this,"Parser",pn);Je(this,"Renderer",Ui);Je(this,"TextRenderer",Ua);Je(this,"Lexer",dn);Je(this,"Tokenizer",Bi);Je(this,"Hooks",Zr);this.use(...n)}walkTokens(n,a){var f,d;let o=[];for(const p of n)switch(o=o.concat(a.call(this,p)),p.type){case"table":{const y=p;for(const m of y.header)o=o.concat(this.walkTokens(m.tokens,a));for(const m of y.rows)for(const x of m)o=o.concat(this.walkTokens(x.tokens,a));break}case"list":{const y=p;o=o.concat(this.walkTokens(y.items,a));break}default:{const y=p;(d=(f=this.defaults.extensions)==null?void 0:f.childTokens)!=null&&d[y.type]?this.defaults.extensions.childTokens[y.type].forEach(m=>{const x=y[m].flat(1/0);o=o.concat(this.walkTokens(x,a))}):y.tokens&&(o=o.concat(this.walkTokens(y.tokens,a)))}}return o}use(...n){const a=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(o=>{const f={...o};if(f.async=this.defaults.async||f.async||!1,o.extensions&&(o.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){const p=a.renderers[d.name];p?a.renderers[d.name]=function(...y){let m=d.renderer.apply(this,y);return m===!1&&(m=p.apply(this,y)),m}:a.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const p=a[d.level];p?p.unshift(d.tokenizer):a[d.level]=[d.tokenizer],d.start&&(d.level==="block"?a.startBlock?a.startBlock.push(d.start):a.startBlock=[d.start]:d.level==="inline"&&(a.startInline?a.startInline.push(d.start):a.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(a.childTokens[d.name]=d.childTokens)}),f.extensions=a),o.renderer){const d=this.defaults.renderer||new Ui(this.defaults);for(const p in o.renderer){if(!(p in d))throw new Error(`renderer '${p}' does not exist`);if(p==="options")continue;const y=p,m=o.renderer[y],x=d[y];d[y]=(...S)=>{let A=m.apply(d,S);return A===!1&&(A=x.apply(d,S)),A||""}}f.renderer=d}if(o.tokenizer){const d=this.defaults.tokenizer||new Bi(this.defaults);for(const p in o.tokenizer){if(!(p in d))throw new Error(`tokenizer '${p}' does not exist`);if(["options","rules","lexer"].includes(p))continue;const y=p,m=o.tokenizer[y],x=d[y];d[y]=(...S)=>{let A=m.apply(d,S);return A===!1&&(A=x.apply(d,S)),A}}f.tokenizer=d}if(o.hooks){const d=this.defaults.hooks||new Zr;for(const p in o.hooks){if(!(p in d))throw new Error(`hook '${p}' does not exist`);if(p==="options")continue;const y=p,m=o.hooks[y],x=d[y];Zr.passThroughHooks.has(p)?d[y]=S=>{if(this.defaults.async)return Promise.resolve(m.call(d,S)).then(E=>x.call(d,E));const A=m.call(d,S);return x.call(d,A)}:d[y]=(...S)=>{let A=m.apply(d,S);return A===!1&&(A=x.apply(d,S)),A}}f.hooks=d}if(o.walkTokens){const d=this.defaults.walkTokens,p=o.walkTokens;f.walkTokens=function(y){let m=[];return m.push(p.call(this,y)),d&&(m=m.concat(d.call(this,y))),m}}this.defaults={...this.defaults,...f}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,a){return dn.lex(n,a??this.defaults)}parser(n,a){return pn.parse(n,a??this.defaults)}}Qn=new WeakSet,so=function(n,a){return(o,f)=>{const d={...f},p={...this.defaults,...d};this.defaults.async===!0&&d.async===!1&&(p.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),p.async=!0);const y=Ra(this,Qn,Gf).call(this,!!p.silent,!!p.async);if(typeof o>"u"||o===null)return y(new Error("marked(): input parameter is undefined or null"));if(typeof o!="string")return y(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(o)+", string expected"));if(p.hooks&&(p.hooks.options=p),p.async)return Promise.resolve(p.hooks?p.hooks.preprocess(o):o).then(m=>n(m,p)).then(m=>p.hooks?p.hooks.processAllTokens(m):m).then(m=>p.walkTokens?Promise.all(this.walkTokens(m,p.walkTokens)).then(()=>m):m).then(m=>a(m,p)).then(m=>p.hooks?p.hooks.postprocess(m):m).catch(y);try{p.hooks&&(o=p.hooks.preprocess(o));let m=n(o,p);p.hooks&&(m=p.hooks.processAllTokens(m)),p.walkTokens&&this.walkTokens(m,p.walkTokens);let x=a(m,p);return p.hooks&&(x=p.hooks.postprocess(x)),x}catch(m){return y(m)}}},Gf=function(n,a){return o=>{if(o.message+=`
|
|
69
|
+
Please report this to https://github.com/markedjs/marked.`,n){const f="<p>An error occurred:</p><pre>"+jt(o.message+"",!0)+"</pre>";return a?Promise.resolve(f):f}if(a)return Promise.reject(o);throw o}};const Yn=new Ac;function Le(u,n){return Yn.parse(u,n)}Le.options=Le.setOptions=function(u){return Yn.setOptions(u),Le.defaults=Yn.defaults,ho(Le.defaults),Le},Le.getDefaults=Pa,Le.defaults=Xn,Le.use=function(...u){return Yn.use(...u),Le.defaults=Yn.defaults,ho(Le.defaults),Le},Le.walkTokens=function(u,n){return Yn.walkTokens(u,n)},Le.parseInline=Yn.parseInline,Le.Parser=pn,Le.parser=pn.parse,Le.Renderer=Ui,Le.TextRenderer=Ua,Le.Lexer=dn,Le.lexer=dn.lex,Le.Tokenizer=Bi,Le.Hooks=Zr,Le.parse=Le,Le.options,Le.setOptions,Le.use,Le.walkTokens,Le.parseInline,pn.parse,dn.lex;function An(u,n,a,o,f,d,p,y){var m=typeof u=="function"?u.options:u;return n&&(m.render=n,m.staticRenderFns=a,m._compiled=!0),d&&(m._scopeId="data-v-"+d),{exports:u,options:m}}const Ic={name:"TimelineHeader",props:{timeRange:{type:String,default:"-"},allExpanded:{type:Boolean,default:!1},viewMode:{type:String,default:"list"}},methods:{handleToggleExpand(){this.$emit("toggle-expand")},handleToggleView(){this.$emit("toggle-view")}}};var Oc=function(){var n=this,a=n._self._c;return a("div",{staticClass:"timeline-header"},[a("div",{staticClass:"time-scale"},[a("span",{staticClass:"time-range"},[n._v(n._s(n.timeRange))])]),a("div",{staticClass:"header-actions"},[n.viewMode==="tree"?a("el-tooltip",{attrs:{content:n.allExpanded?"合上所有节点":"展开所有节点",placement:"top"}},[a("i",{staticClass:"action-icon",class:n.allExpanded?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:n.handleToggleExpand}})]):n._e(),a("el-tooltip",{attrs:{content:n.viewMode==="list"?"切换到树形视图":"切换到列表视图",placement:"top"}},[a("i",{staticClass:"action-icon",class:n.viewMode==="list"?"el-icon-menu":"el-icon-s-operation",on:{click:n.handleToggleView}})])],1)])},Nc=[],Mc=An(Ic,Oc,Nc,!1,null,"a6b357e5");const Rc=Mc.exports,Fc={name:"TimelineBar",props:{barStyle:{type:Object,required:!0},statusDescription:{type:String,default:""},selected:{type:Boolean,default:!1},error:{type:Boolean,default:!1},hasEvents:{type:Boolean,default:!1}}};var Pc=function(){var n=this,a=n._self._c;return a("el-tooltip",{attrs:{content:n.statusDescription,disabled:!n.statusDescription,placement:"top","popper-class":"span-status-tooltip"}},[a("div",{staticClass:"timeline-bar-wrapper"},[a("div",{staticClass:"timeline-bar",class:{selected:n.selected,error:n.error,"has-events":n.hasEvents},style:n.barStyle})])])},zc=[],$c=An(Fc,Pc,zc,!1,null,"52995efa");const Eo=$c.exports;function Do(u){if(!u)return"-";const n=u/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`}function Ao(u){if(!u)return"-";const n=u/1e6,a=new Date(n),o=a.getFullYear(),f=String(a.getMonth()+1).padStart(2,"0"),d=String(a.getDate()).padStart(2,"0"),p=String(a.getHours()).padStart(2,"0"),y=String(a.getMinutes()).padStart(2,"0"),m=String(a.getSeconds()).padStart(2,"0");return`${o}/${f}/${d} ${p}:${y}:${m}`}function Bc(u,n,a="-"){return!u||!n?"-":`${Ao(u)} ${a} ${Ao(n)}`}function Io(u){return{SERVER:"primary",CHAT_MODEL:"success",LLM:"success",CHAIN:"warning",AGENT:"danger",TOOL:"info",JOB:"warning",FUNCTION:"info"}[u]||"info"}function Oo(u){return u.status_description?u.status_description:""}function No(u,n,a){if(!n||!a||n===a)return{width:"100%"};const o=a-n,f=u.start_time_unix_nano-n,d=u.duration_ns,p=f/o*100,y=d/o*100;return{left:`${p}%`,width:`${y}%`}}const Hc={name:"SpanTreeNode",components:{TimelineBar:Eo},props:{node:{type:Object,required:!0},selected:{type:Boolean,default:!1},selectedSpanId:{type:String,default:null},expandedNodes:{type:Set,required:!0},depth:{type:Number,default:0},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},isRootNode(){return this.depth===0},isExpanded(){return this.isRootNode?!0:this.expandedNodes.has(this.node.span_id)},shouldShowChildren(){return this.isRootNode?!0:this.isExpanded},duration(){return Do(this.node.duration_ns)},typeColor(){return Io(this.node.type)},statusDescription(){return Oo(this.node)},barStyle(){return No(this.node,this.traceStartTime,this.traceEndTime)},error(){return this.node.status==="ERROR"},hasEvents(){return this.node.has_events===!0},isChild(){return this.depth>0}},methods:{handleClick(){this.$emit("node-click",this.node)},handleToggleExpand(){this.isRootNode||this.$emit("toggle-expand",this.node)}}};var Wc=function(){var n=this,a=n._self._c;return a("div",[a("div",{staticClass:"timeline-node",class:{selected:n.selected,error:n.error,"child-node":n.isChild},on:{click:n.handleClick}},[a("div",{staticClass:"node-row"},[a("div",{staticClass:"node-info"},[n.hasChildren&&!n.isRootNode?a("i",{staticClass:"expand-icon",class:n.isExpanded?"el-icon-arrow-down":"el-icon-arrow-right",on:{click:function(o){return o.stopPropagation(),n.handleToggleExpand.apply(null,arguments)}}}):n._e(),a("el-tag",{staticClass:"type-tag",attrs:{type:n.typeColor,size:"mini"}},[n._v(" "+n._s(n.node.type)+" ")]),a("el-tooltip",{attrs:{content:n.node.name,placement:"top","open-delay":300}},[a("span",{staticClass:"node-name"},[n._v(n._s(n.node.name))])])],1),a("div",{staticClass:"node-duration"},[n._v(" "+n._s(n.duration)+" ")])]),a("TimelineBar",{attrs:{"bar-style":n.barStyle,"status-description":n.statusDescription,selected:n.selected,error:n.error,"has-events":n.hasEvents}})],1),n.shouldShowChildren&&n.hasChildren?a("div",{staticClass:"children-nodes"},n._l(n.node.children,function(o){return a("SpanTreeNode",{key:o.span_id,attrs:{node:o,selected:o.span_id===n.selectedSpanId,"selected-span-id":n.selectedSpanId,"expanded-nodes":n.expandedNodes,depth:n.depth+1,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime},on:{"node-click":function(f){return n.$emit("node-click",f)},"toggle-expand":function(f){return n.$emit("toggle-expand",f)}}})}),1):n._e()])},jc=[],Uc=An(Hc,Wc,jc,!1,null,"f181c64c");const qc=Uc.exports,Gc={name:"SpanListNode",components:{TimelineBar:Eo},props:{node:{type:Object,required:!0},selected:{type:Boolean,default:!1},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0}},computed:{duration(){return Do(this.node.duration_ns)},typeColor(){return Io(this.node.type)},statusDescription(){return Oo(this.node)},barStyle(){return No(this.node,this.traceStartTime,this.traceEndTime)},error(){return this.node.status==="ERROR"},hasEvents(){return this.node.has_events===!0}},methods:{handleClick(){this.$emit("node-click",this.node)}}};var Kc=function(){var n=this,a=n._self._c;return a("div",{staticClass:"timeline-node",class:{selected:n.selected,error:n.error},on:{click:n.handleClick}},[a("div",{staticClass:"node-row"},[a("div",{staticClass:"node-info"},[a("el-tag",{staticClass:"type-tag",attrs:{type:n.typeColor,size:"mini"}},[n._v(" "+n._s(n.node.type)+" ")]),a("el-tooltip",{attrs:{content:n.node.name,placement:"top","open-delay":300}},[a("span",{staticClass:"node-name"},[n._v(n._s(n.node.name))])])],1),a("div",{staticClass:"node-duration"},[n._v(" "+n._s(n.duration)+" ")])]),a("TimelineBar",{attrs:{"bar-style":n.barStyle,"status-description":n.statusDescription,selected:n.selected,error:n.error,"has-events":n.hasEvents}})],1)},Xc=[],Yc=An(Gc,Kc,Xc,!1,null,"860ac868");const Vc=Yc.exports,Jc={name:"TraceSpanTree",components:{TimelineHeader:Rc,SpanTreeNode:qc,SpanListNode:Vc},props:{spans:{type:Array,default:()=>[]},selectedSpanId:{type:String,default:null},traceStartTime:{type:Number,default:0},traceEndTime:{type:Number,default:0}},data(){return{expandedNodes:new Set,treeData:[],allExpanded:!1,viewMode:"list"}},computed:{flatListData(){const u=[],n=a=>{a.forEach(o=>{u.push(o),o.children&&o.children.length>0&&n(o.children)})};return n(this.treeData),u},timeRange(){const u=this.$t?this.$t("trace.to"):"-";return Bc(this.traceStartTime,this.traceEndTime,u)}},watch:{spans:{immediate:!0,handler(){this.buildTree()}}},methods:{buildTree(){if(!this.spans||this.spans.length===0){this.treeData=[];return}const u=new Map,n=[];this.spans.forEach(a=>{u.set(a.span_id,{...a,children:[]})}),this.spans.forEach(a=>{const o=u.get(a.span_id);if(a.parent_span_id){const f=u.get(a.parent_span_id);f?f.children.push(o):n.push(o)}else n.push(o)}),n.forEach(a=>{this.sortChildren(a)}),this.treeData=n,this.expandAllNodes()},expandAllNodes(){const u=new Set,n=a=>{a.forEach(o=>{o.children&&o.children.length>0&&o.children.forEach(f=>{this.hasChildren(f)&&u.add(f.span_id),f.children&&f.children.length>0&&n([f])})})};n(this.treeData),this.expandedNodes=u,this.allExpanded=!0,this.$forceUpdate()},collapseAllNodes(){const u=new Set;this.expandedNodes=u,this.allExpanded=!1,this.$forceUpdate()},toggleAllExpand(){this.allExpanded?this.collapseAllNodes():this.expandAllNodes()},toggleViewMode(){this.viewMode=this.viewMode==="list"?"tree":"list"},sortChildren(u){u.children&&u.children.length>0&&(u.children.sort((n,a)=>n.start_time_unix_nano-a.start_time_unix_nano),u.children.forEach(n=>this.sortChildren(n)))},handleNodeClick(u){this.$emit("span-select",u)},hasChildren(u){return u.children&&u.children.length>0},toggleExpand(u){if(this.treeData.some(o=>o.span_id===u.span_id))return;const a=new Set(this.expandedNodes);a.has(u.span_id)?a.delete(u.span_id):a.add(u.span_id),this.expandedNodes=a,this.updateAllExpandedState(),this.$forceUpdate()},updateAllExpandedState(){const u=(a,o=!1)=>{for(const f of a)if(this.hasChildren(f)&&(!o&&!this.expandedNodes.has(f.span_id)||f.children&&f.children.length>0&&!u(f.children,!1)))return!1;return!0};if(!this.treeData.some(a=>a.children&&a.children.some(o=>this.hasChildren(o)))){this.allExpanded=!1;return}this.allExpanded=u(this.treeData,!0)}}};var Qc=function(){var n=this,a=n._self._c;return a("div",{staticClass:"span-tree-container"},[n.treeData.length===0?a("div",{staticClass:"empty-state"},[a("el-empty",{attrs:{description:"暂无 Span 数据"}})],1):a("div",{staticClass:"timeline-wrapper"},[a("TimelineHeader",{attrs:{"time-range":n.timeRange,"all-expanded":n.allExpanded,"view-mode":n.viewMode},on:{"toggle-expand":n.toggleAllExpand,"toggle-view":n.toggleViewMode}}),a("div",{ref:"timelineContent",staticClass:"timeline-content"},[n.viewMode==="tree"?n._l(n.treeData,function(o){return a("SpanTreeNode",{key:o.span_id,attrs:{node:o,selected:n.selectedSpanId===o.span_id,"selected-span-id":n.selectedSpanId,"expanded-nodes":n.expandedNodes,depth:0,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime},on:{"node-click":n.handleNodeClick,"toggle-expand":n.toggleExpand}})}):n._l(n.flatListData,function(o){return a("SpanListNode",{key:o.span_id,attrs:{node:o,selected:n.selectedSpanId===o.span_id,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime},on:{"node-click":n.handleNodeClick}})})],2)],1)])},Zc=[],eh=An(Jc,Qc,Zc,!1,null,"1eff9f3c");const qa=eh.exports;/*!
|
|
70
70
|
* Viewer.js v1.11.7
|
|
71
71
|
* https://fengyuanchen.github.io/viewerjs
|
|
72
72
|
*
|
|
@@ -74,15 +74,17 @@ Please report this to https://github.com/markedjs/marked.`,i){const c="<p>An err
|
|
|
74
74
|
* Released under the MIT license
|
|
75
75
|
*
|
|
76
76
|
* Date: 2024-11-24T04:32:19.116Z
|
|
77
|
-
*/function Cc(f,i){if(!(f instanceof i))throw new TypeError("Cannot call a class as a function")}function _o(f,i){for(var s=0;s<i.length;s++){var l=i[s];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(f,Oo(l.key),l)}}function Tc(f,i,s){return i&&_o(f.prototype,i),s&&_o(f,s),Object.defineProperty(f,"prototype",{writable:!1}),f}function Lc(f,i,s){return(i=Oo(i))in f?Object.defineProperty(f,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):f[i]=s,f}function Eo(f,i){var s=Object.keys(f);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(f);i&&(l=l.filter(function(c){return Object.getOwnPropertyDescriptor(f,c).enumerable})),s.push.apply(s,l)}return s}function qa(f){for(var i=1;i<arguments.length;i++){var s=arguments[i]!=null?arguments[i]:{};i%2?Eo(Object(s),!0).forEach(function(l){Lc(f,l,s[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(s)):Eo(Object(s)).forEach(function(l){Object.defineProperty(f,l,Object.getOwnPropertyDescriptor(s,l))})}return f}function _c(f,i){if(typeof f!="object"||!f)return f;var s=f[Symbol.toPrimitive];if(s!==void 0){var l=s.call(f,i);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(f)}function Oo(f){var i=_c(f,"string");return typeof i=="symbol"?i:i+""}function Ka(f){"@babel/helpers - typeof";return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Ka(f)}var Ao={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},Ec='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',ji=typeof window<"u"&&typeof window.document<"u",mr=ji?window:{},ln=ji&&mr.document.documentElement?"ontouchstart"in mr.document.documentElement:!1,Ga=ji?"PointerEvent"in mr:!1,Se="viewer",qi="move",Io="switch",Qn="zoom",Ki="".concat(Se,"-active"),Oc="".concat(Se,"-close"),Gi="".concat(Se,"-fade"),Xa="".concat(Se,"-fixed"),Ac="".concat(Se,"-fullscreen"),Do="".concat(Se,"-fullscreen-exit"),jr="".concat(Se,"-hide"),Ic="".concat(Se,"-hide-md-down"),Dc="".concat(Se,"-hide-sm-down"),Nc="".concat(Se,"-hide-xs-down"),Bt="".concat(Se,"-in"),Jn="".concat(Se,"-invisible"),un="".concat(Se,"-loading"),Mc="".concat(Se,"-move"),No="".concat(Se,"-open"),fn="".concat(Se,"-show"),Je="".concat(Se,"-transition"),cn="click",Ya="dblclick",Mo="dragstart",Ro="focusin",zo="keydown",Ut="load",qr="error",Rc=ln?"touchend touchcancel":"mouseup",zc=ln?"touchmove":"mousemove",Pc=ln?"touchstart":"mousedown",Po=Ga?"pointerdown":Pc,Fo=Ga?"pointermove":zc,Wo=Ga?"pointerup pointercancel":Rc,Ho="resize",Vt="transitionend",$o="wheel",Bo="ready",Uo="show",jo="shown",qo="hide",Ko="hidden",Go="view",ei="viewed",Xo="move",Yo="moved",Vo="rotate",Zo="rotated",Qo="scale",Jo="scaled",el="zoom",tl="zoomed",rl="play",nl="stop",Xi="".concat(Se,"Action"),Va=/\s\s*/,Yi=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ti(f){return typeof f=="string"}var Fc=Number.isNaN||mr.isNaN;function Ge(f){return typeof f=="number"&&!Fc(f)}function hn(f){return typeof f>"u"}function dn(f){return Ka(f)==="object"&&f!==null}var Wc=Object.prototype.hasOwnProperty;function pn(f){if(!dn(f))return!1;try{var i=f.constructor,s=i.prototype;return i&&s&&Wc.call(s,"isPrototypeOf")}catch{return!1}}function He(f){return typeof f=="function"}function Be(f,i){if(f&&He(i))if(Array.isArray(f)||Ge(f.length)){var s=f.length,l;for(l=0;l<s&&i.call(f,f[l],l,f)!==!1;l+=1);}else dn(f)&&Object.keys(f).forEach(function(c){i.call(f,f[c],c,f)});return f}var Pt=Object.assign||function(i){for(var s=arguments.length,l=new Array(s>1?s-1:0),c=1;c<s;c++)l[c-1]=arguments[c];return dn(i)&&l.length>0&&l.forEach(function(g){dn(g)&&Object.keys(g).forEach(function(p){i[p]=g[p]})}),i},Hc=/^(?:width|height|left|top|marginLeft|marginTop)$/;function Zt(f,i){var s=f.style;Be(i,function(l,c){Hc.test(c)&&Ge(l)&&(l+="px"),s[c]=l})}function $c(f){return ti(f)?f.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"):f}function gn(f,i){return!f||!i?!1:f.classList?f.classList.contains(i):f.className.indexOf(i)>-1}function ve(f,i){if(!(!f||!i)){if(Ge(f.length)){Be(f,function(l){ve(l,i)});return}if(f.classList){f.classList.add(i);return}var s=f.className.trim();s?s.indexOf(i)<0&&(f.className="".concat(s," ").concat(i)):f.className=i}}function De(f,i){if(!(!f||!i)){if(Ge(f.length)){Be(f,function(s){De(s,i)});return}if(f.classList){f.classList.remove(i);return}f.className.indexOf(i)>=0&&(f.className=f.className.replace(i,""))}}function ri(f,i,s){if(i){if(Ge(f.length)){Be(f,function(l){ri(l,i,s)});return}s?ve(f,i):De(f,i)}}var Bc=/([a-z\d])([A-Z])/g;function Za(f){return f.replace(Bc,"$1-$2").toLowerCase()}function vn(f,i){return dn(f[i])?f[i]:f.dataset?f.dataset[i]:f.getAttribute("data-".concat(Za(i)))}function Qa(f,i,s){dn(s)?f[i]=s:f.dataset?f.dataset[i]=s:f.setAttribute("data-".concat(Za(i)),s)}var il=function(){var f=!1;if(ji){var i=!1,s=function(){},l=Object.defineProperty({},"once",{get:function(){return f=!0,i},set:function(g){i=g}});mr.addEventListener("test",s,l),mr.removeEventListener("test",s,l)}return f}();function $e(f,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s;i.trim().split(Va).forEach(function(g){if(!il){var p=f.listeners;p&&p[g]&&p[g][s]&&(c=p[g][s],delete p[g][s],Object.keys(p[g]).length===0&&delete p[g],Object.keys(p).length===0&&delete f.listeners)}f.removeEventListener(g,c,l)})}function me(f,i,s){var l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},c=s;i.trim().split(Va).forEach(function(g){if(l.once&&!il){var p=f.listeners,w=p===void 0?{}:p;c=function(){delete w[g][s],f.removeEventListener(g,c,l);for(var y=arguments.length,k=new Array(y),_=0;_<y;_++)k[_]=arguments[_];s.apply(f,k)},w[g]||(w[g]={}),w[g][s]&&f.removeEventListener(g,w[g][s],l),w[g][s]=c,f.listeners=w}f.addEventListener(g,c,l)})}function tt(f,i,s,l){var c;return He(Event)&&He(CustomEvent)?c=new CustomEvent(i,qa({bubbles:!0,cancelable:!0,detail:s},l)):(c=document.createEvent("CustomEvent"),c.initCustomEvent(i,!0,!0,s)),f.dispatchEvent(c)}function Uc(f){var i=f.getBoundingClientRect();return{left:i.left+(window.pageXOffset-document.documentElement.clientLeft),top:i.top+(window.pageYOffset-document.documentElement.clientTop)}}function Vi(f){var i=f.rotate,s=f.scaleX,l=f.scaleY,c=f.translateX,g=f.translateY,p=[];Ge(c)&&c!==0&&p.push("translateX(".concat(c,"px)")),Ge(g)&&g!==0&&p.push("translateY(".concat(g,"px)")),Ge(i)&&i!==0&&p.push("rotate(".concat(i,"deg)")),Ge(s)&&s!==1&&p.push("scaleX(".concat(s,")")),Ge(l)&&l!==1&&p.push("scaleY(".concat(l,")"));var w=p.length?p.join(" "):"none";return{WebkitTransform:w,msTransform:w,transform:w}}function jc(f){return ti(f)?decodeURIComponent(f.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var Ja=mr.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(mr.navigator.userAgent);function al(f,i,s){var l=document.createElement("img");if(f.naturalWidth&&!Ja)return s(f.naturalWidth,f.naturalHeight),l;var c=document.body||document.documentElement;return l.onload=function(){s(l.width,l.height),Ja||c.removeChild(l)},Be(i.inheritedAttributes,function(g){var p=f.getAttribute(g);p!==null&&l.setAttribute(g,p)}),l.src=f.src,Ja||(l.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",c.appendChild(l)),l}function Zi(f){switch(f){case 2:return Nc;case 3:return Dc;case 4:return Ic;default:return""}}function qc(f){var i=qa({},f),s=[];return Be(f,function(l,c){delete i[c],Be(i,function(g){var p=Math.abs(l.startX-g.startX),w=Math.abs(l.startY-g.startY),b=Math.abs(l.endX-g.endX),y=Math.abs(l.endY-g.endY),k=Math.sqrt(p*p+w*w),_=Math.sqrt(b*b+y*y),L=(_-k)/k;s.push(L)})}),s.sort(function(l,c){return Math.abs(l)<Math.abs(c)}),s[0]}function Qi(f,i){var s=f.pageX,l=f.pageY,c={endX:s,endY:l};return i?c:qa({timeStamp:Date.now(),startX:s,startY:l},c)}function Kc(f){var i=0,s=0,l=0;return Be(f,function(c){var g=c.startX,p=c.startY;i+=g,s+=p,l+=1}),i/=l,s/=l,{pageX:i,pageY:s}}var Gc={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var i=this.element.ownerDocument,s=i.body||i.documentElement;this.body=s,this.scrollbarWidth=window.innerWidth-i.documentElement.clientWidth,this.initialBodyPaddingRight=s.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(s).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var i=this.options,s=this.parent,l;i.inline&&(l={width:Math.max(s.offsetWidth,i.minWidth),height:Math.max(s.offsetHeight,i.minHeight)},this.parentData=l),(this.fulled||!l)&&(l=this.containerData),this.viewerData=Pt({},l)},renderViewer:function(){this.options.inline&&!this.fulled&&Zt(this.viewer,this.viewerData)},initList:function(){var i=this,s=this.element,l=this.options,c=this.list,g=[];c.innerHTML="",Be(this.images,function(p,w){var b=p.src,y=p.alt||jc(b),k=i.getImageURL(p);if(b||k){var _=document.createElement("li"),L=document.createElement("img");Be(l.inheritedAttributes,function(H){var F=p.getAttribute(H);F!==null&&L.setAttribute(H,F)}),l.navbar&&(L.src=b||k),L.alt=y,L.setAttribute("data-original-url",k||b),_.setAttribute("data-index",w),_.setAttribute("data-viewer-action","view"),_.setAttribute("role","button"),l.keyboard&&_.setAttribute("tabindex",0),_.appendChild(L),c.appendChild(_),g.push(_)}}),this.items=g,Be(g,function(p){var w=p.firstElementChild,b,y;Qa(w,"filled",!0),l.loading&&ve(p,un),me(w,Ut,b=function(_){$e(w,qr,y),l.loading&&De(p,un),i.loadImage(_)},{once:!0}),me(w,qr,y=function(){$e(w,Ut,b),l.loading&&De(p,un)},{once:!0})}),l.transition&&me(s,ei,function(){ve(c,Je)},{once:!0})},renderList:function(){var i=this.index,s=this.items[i];if(s){var l=s.nextElementSibling,c=parseInt(window.getComputedStyle(l||s).marginLeft,10),g=s.offsetWidth,p=g+c;Zt(this.list,Pt({width:p*this.length-c},Vi({translateX:(this.viewerData.width-g)/2-p*i})))}},resetList:function(){var i=this.list;i.innerHTML="",De(i,Je),Zt(i,Vi({translateX:0}))},initImage:function(i){var s=this,l=this.options,c=this.image,g=this.viewerData,p=this.footer.offsetHeight,w=g.width,b=Math.max(g.height-p,p),y=this.imageData||{},k;this.imageInitializing={abort:function(){k.onload=null}},k=al(c,l,function(_,L){var H=_/L,F=Math.max(0,Math.min(1,l.initialCoverage)),U=w,M=b;s.imageInitializing=!1,b*H>w?M=w/H:U=b*H,F=Ge(F)?F:.9,U=Math.min(U*F,_),M=Math.min(M*F,L);var A=(w-U)/2,D=(b-M)/2,P={left:A,top:D,x:A,y:D,width:U,height:M,oldRatio:1,ratio:U/_,aspectRatio:H,naturalWidth:_,naturalHeight:L},G=Pt({},P);l.rotatable&&(P.rotate=y.rotate||0,G.rotate=0),l.scalable&&(P.scaleX=y.scaleX||1,P.scaleY=y.scaleY||1,G.scaleX=1,G.scaleY=1),s.imageData=P,s.initialImageData=G,i&&i()})},renderImage:function(i){var s=this,l=this.image,c=this.imageData;if(Zt(l,Pt({width:c.width,height:c.height,marginLeft:c.x,marginTop:c.y},Vi(c))),i)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&gn(l,Je)){var g=function(){s.imageRendering=!1,i()};this.imageRendering={abort:function(){$e(l,Vt,g)}},me(l,Vt,g,{once:!0})}else i()},resetImage:function(){var i=this.image;i&&(this.viewing&&this.viewing.abort(),i.parentNode.removeChild(i),this.image=null,this.title.innerHTML="")}},Xc={bind:function(){var i=this.options,s=this.viewer,l=this.canvas,c=this.element.ownerDocument;me(s,cn,this.onClick=this.click.bind(this)),me(s,Mo,this.onDragStart=this.dragstart.bind(this)),me(l,Po,this.onPointerDown=this.pointerdown.bind(this)),me(c,Fo,this.onPointerMove=this.pointermove.bind(this)),me(c,Wo,this.onPointerUp=this.pointerup.bind(this)),me(c,zo,this.onKeyDown=this.keydown.bind(this)),me(window,Ho,this.onResize=this.resize.bind(this)),i.zoomable&&i.zoomOnWheel&&me(s,$o,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleOnDblclick&&me(l,Ya,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var i=this.options,s=this.viewer,l=this.canvas,c=this.element.ownerDocument;$e(s,cn,this.onClick),$e(s,Mo,this.onDragStart),$e(l,Po,this.onPointerDown),$e(c,Fo,this.onPointerMove),$e(c,Wo,this.onPointerUp),$e(c,zo,this.onKeyDown),$e(window,Ho,this.onResize),i.zoomable&&i.zoomOnWheel&&$e(s,$o,this.onWheel,{passive:!1,capture:!0}),i.toggleOnDblclick&&$e(l,Ya,this.onDblclick)}},Yc={click:function(i){var s=this.options,l=this.imageData,c=i.target,g=vn(c,Xi);switch(!g&&c.localName==="img"&&c.parentElement.localName==="li"&&(c=c.parentElement,g=vn(c,Xi)),ln&&i.isTrusted&&c===this.canvas&&clearTimeout(this.clickCanvasTimeout),g){case"mix":this.played?this.stop():s.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(vn(c,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(s.loop);break;case"play":this.play(s.fullscreen);break;case"next":this.next(s.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-l.scaleX||-1);break;case"flip-vertical":this.scaleY(-l.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(i){i.preventDefault(),this.viewed&&i.target===this.image&&(ln&&i.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(i.isTrusted?i:i.detail&&i.detail.originalEvent))},load:function(){var i=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var s=this.element,l=this.options,c=this.image,g=this.index,p=this.viewerData;De(c,Jn),l.loading&&De(this.canvas,un),c.style.cssText="height:0;"+"margin-left:".concat(p.width/2,"px;")+"margin-top:".concat(p.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){ri(c,Mc,l.movable),ri(c,Je,l.transition),i.renderImage(function(){i.viewed=!0,i.viewing=!1,He(l.viewed)&&me(s,ei,l.viewed,{once:!0}),tt(s,ei,{originalImage:i.images[g],index:g,image:c},{cancelable:!1})})})},loadImage:function(i){var s=i.target,l=s.parentNode,c=l.offsetWidth||30,g=l.offsetHeight||50,p=!!vn(s,"filled");al(s,this.options,function(w,b){var y=w/b,k=c,_=g;g*y>c?p?k=g*y:_=c/y:p?_=c/y:k=g*y,Zt(s,Pt({width:k,height:_},Vi({translateX:(c-k)/2,translateY:(g-_)/2})))})},keydown:function(i){var s=this.options;if(s.keyboard){var l=i.keyCode||i.which||i.charCode;switch(l){case 13:this.viewer.contains(i.target)&&this.click(i);break}if(this.fulled)switch(l){case 27:this.played?this.stop():s.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(s.loop);break;case 38:i.preventDefault(),this.zoom(s.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(s.loop);break;case 40:i.preventDefault(),this.zoom(-s.zoomRatio,!0);break;case 48:case 49:i.ctrlKey&&(i.preventDefault(),this.toggle());break}}},dragstart:function(i){i.target.localName==="img"&&i.preventDefault()},pointerdown:function(i){var s=this.options,l=this.pointers,c=i.buttons,g=i.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||(i.type==="mousedown"||i.type==="pointerdown"&&i.pointerType==="mouse")&&(Ge(c)&&c!==1||Ge(g)&&g!==0||i.ctrlKey))){i.preventDefault(),i.changedTouches?Be(i.changedTouches,function(w){l[w.identifier]=Qi(w)}):l[i.pointerId||0]=Qi(i);var p=s.movable?qi:!1;s.zoomOnTouch&&s.zoomable&&Object.keys(l).length>1?p=Qn:s.slideOnTouch&&(i.pointerType==="touch"||i.type==="touchstart")&&this.isSwitchable()&&(p=Io),s.transition&&(p===qi||p===Qn)&&De(this.image,Je),this.action=p}},pointermove:function(i){var s=this.pointers,l=this.action;!this.viewed||!l||(i.preventDefault(),i.changedTouches?Be(i.changedTouches,function(c){Pt(s[c.identifier]||{},Qi(c,!0))}):Pt(s[i.pointerId||0]||{},Qi(i,!0)),this.change(i))},pointerup:function(i){var s=this,l=this.options,c=this.action,g=this.pointers,p;i.changedTouches?Be(i.changedTouches,function(w){p=g[w.identifier],delete g[w.identifier]}):(p=g[i.pointerId||0],delete g[i.pointerId||0]),c&&(i.preventDefault(),l.transition&&(c===qi||c===Qn)&&ve(this.image,Je),this.action=!1,ln&&c!==Qn&&p&&Date.now()-p.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),l.toggleOnDblclick&&this.viewed&&i.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){tt(s.image,Ya,{originalEvent:i})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){s.imageClicked=!1},500)):(this.imageClicked=!1,l.backdrop&&l.backdrop!=="static"&&i.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){tt(s.canvas,cn,{originalEvent:i})},50)))))},resize:function(){var i=this;if(!(!this.isShown||this.hiding)&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){i.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)){this.stop();return}Be(this.player.getElementsByTagName("img"),function(s){me(s,Ut,i.loadImage.bind(i),{once:!0}),tt(s,Ut)})}},wheel:function(i){var s=this;if(this.viewed&&(i.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){s.wheeling=!1},50);var l=Number(this.options.zoomRatio)||.1,c=1;i.deltaY?c=i.deltaY>0?1:-1:i.wheelDelta?c=-i.wheelDelta/120:i.detail&&(c=i.detail>0?1:-1),this.zoom(-c*l,!0,null,i)}}},Vc={show:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=this.element,l=this.options;if(l.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(i),this;if(He(l.show)&&me(s,Uo,l.show,{once:!0}),tt(s,Uo)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var c=this.viewer;if(De(c,jr),c.setAttribute("role","dialog"),c.setAttribute("aria-labelledby",this.title.id),c.setAttribute("aria-modal",!0),c.removeAttribute("aria-hidden"),l.transition&&!i){var g=this.shown.bind(this);this.transitioning={abort:function(){$e(c,Vt,g),De(c,Bt)}},ve(c,Je),c.initialOffsetWidth=c.offsetWidth,me(c,Vt,g,{once:!0}),ve(c,Bt)}else ve(c,Bt),this.shown();return this},hide:function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,l=this.element,c=this.options;if(c.inline||this.hiding||!(this.isShown||this.showing))return this;if(He(c.hide)&&me(l,qo,c.hide,{once:!0}),tt(l,qo)===!1)return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var g=this.viewer,p=this.image,w=function(){De(g,Bt),i.hidden()};if(c.transition&&!s){var b=function(_){_&&_.target===g&&($e(g,Vt,b),i.hidden())},y=function(){gn(g,Je)?(me(g,Vt,b),De(g,Bt)):w()};this.transitioning={abort:function(){i.viewed&&gn(p,Je)?$e(p,Vt,y):gn(g,Je)&&$e(g,Vt,b)}},this.viewed&&gn(p,Je)?(me(p,Vt,y,{once:!0}),this.zoomTo(0,!1,null,null,!0)):y()}else w();return this},view:function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(s=Number(s)||0,this.hiding||this.played||s<0||s>=this.length||this.viewed&&s===this.index)return this;if(!this.isShown)return this.index=s,this.show();this.viewing&&this.viewing.abort();var l=this.element,c=this.options,g=this.title,p=this.canvas,w=this.items[s],b=w.querySelector("img"),y=vn(b,"originalUrl"),k=b.getAttribute("alt"),_=document.createElement("img");if(Be(c.inheritedAttributes,function(M){var A=b.getAttribute(M);A!==null&&_.setAttribute(M,A)}),_.src=y,_.alt=k,He(c.view)&&me(l,Go,c.view,{once:!0}),tt(l,Go,{originalImage:this.images[s],index:s,image:_})===!1||!this.isShown||this.hiding||this.played)return this;var L=this.items[this.index];L&&(De(L,Ki),L.removeAttribute("aria-selected")),ve(w,Ki),w.setAttribute("aria-selected",!0),c.focus&&w.focus(),this.image=_,this.viewed=!1,this.index=s,this.imageData={},ve(_,Jn),c.loading&&ve(p,un),p.innerHTML="",p.appendChild(_),this.renderList(),g.innerHTML="";var H=function(){var A=i.imageData,D=Array.isArray(c.title)?c.title[1]:c.title;g.innerHTML=$c(He(D)?D.call(i,_,A):"".concat(k," (").concat(A.naturalWidth," × ").concat(A.naturalHeight,")"))},F,U;return me(l,ei,H,{once:!0}),this.viewing={abort:function(){$e(l,ei,H),_.complete?i.imageRendering?i.imageRendering.abort():i.imageInitializing&&i.imageInitializing.abort():(_.src="",$e(_,Ut,F),i.timeout&&clearTimeout(i.timeout))}},_.complete?this.load():(me(_,Ut,F=function(){$e(_,qr,U),i.load()},{once:!0}),me(_,qr,U=function(){$e(_,Ut,F),i.timeout&&(clearTimeout(i.timeout),i.timeout=!1),De(_,Jn),c.loading&&De(i.canvas,un)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){De(_,Jn),i.timeout=!1},1e3)),this},prev:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=this.index-1;return s<0&&(s=i?this.length-1:0),this.view(s),this},next:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=this.length-1,l=this.index+1;return l>s&&(l=i?0:s),this.view(l),this},move:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i,l=this.imageData;return this.moveTo(hn(i)?i:l.x+Number(i),hn(s)?s:l.y+Number(s)),this},moveTo:function(i){var s=this,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,g=this.element,p=this.options,w=this.imageData;if(i=Number(i),l=Number(l),this.viewed&&!this.played&&p.movable){var b=w.x,y=w.y,k=!1;if(Ge(i)?k=!0:i=b,Ge(l)?k=!0:l=y,k){if(He(p.move)&&me(g,Xo,p.move,{once:!0}),tt(g,Xo,{x:i,y:l,oldX:b,oldY:y,originalEvent:c})===!1)return this;w.x=i,w.y=l,w.left=i,w.top=l,this.moving=!0,this.renderImage(function(){s.moving=!1,He(p.moved)&&me(g,Yo,p.moved,{once:!0}),tt(g,Yo,{x:i,y:l,oldX:b,oldY:y,originalEvent:c},{cancelable:!1})})}}return this},rotate:function(i){return this.rotateTo((this.imageData.rotate||0)+Number(i)),this},rotateTo:function(i){var s=this,l=this.element,c=this.options,g=this.imageData;if(i=Number(i),Ge(i)&&this.viewed&&!this.played&&c.rotatable){var p=g.rotate;if(He(c.rotate)&&me(l,Vo,c.rotate,{once:!0}),tt(l,Vo,{degree:i,oldDegree:p})===!1)return this;g.rotate=i,this.rotating=!0,this.renderImage(function(){s.rotating=!1,He(c.rotated)&&me(l,Zo,c.rotated,{once:!0}),tt(l,Zo,{degree:i,oldDegree:p},{cancelable:!1})})}return this},scaleX:function(i){return this.scale(i,this.imageData.scaleY),this},scaleY:function(i){return this.scale(this.imageData.scaleX,i),this},scale:function(i){var s=this,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i,c=this.element,g=this.options,p=this.imageData;if(i=Number(i),l=Number(l),this.viewed&&!this.played&&g.scalable){var w=p.scaleX,b=p.scaleY,y=!1;if(Ge(i)?y=!0:i=w,Ge(l)?y=!0:l=b,y){if(He(g.scale)&&me(c,Qo,g.scale,{once:!0}),tt(c,Qo,{scaleX:i,scaleY:l,oldScaleX:w,oldScaleY:b})===!1)return this;p.scaleX=i,p.scaleY=l,this.scaling=!0,this.renderImage(function(){s.scaling=!1,He(g.scaled)&&me(c,Jo,g.scaled,{once:!0}),tt(c,Jo,{scaleX:i,scaleY:l,oldScaleX:w,oldScaleY:b},{cancelable:!1})})}}return this},zoom:function(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,g=this.imageData;return i=Number(i),i<0?i=1/(1-i):i=1+i,this.zoomTo(g.width*i/g.naturalWidth,s,l,c),this},zoomTo:function(i){var s=this,l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,g=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,w=this.element,b=this.options,y=this.pointers,k=this.imageData,_=k.x,L=k.y,H=k.width,F=k.height,U=k.naturalWidth,M=k.naturalHeight;if(i=Math.max(0,i),Ge(i)&&this.viewed&&!this.played&&(p||b.zoomable)){if(!p){var A=Math.max(.01,b.minZoomRatio),D=Math.min(100,b.maxZoomRatio);i=Math.min(Math.max(i,A),D)}if(g)switch(g.type){case"wheel":b.zoomRatio>=.055&&i>.95&&i<1.05&&(i=1);break;case"pointermove":case"touchmove":case"mousemove":i>.99&&i<1.01&&(i=1);break}var P=U*i,G=M*i,J=P-H,ne=G-F,te=k.ratio;if(He(b.zoom)&&me(w,el,b.zoom,{once:!0}),tt(w,el,{ratio:i,oldRatio:te,originalEvent:g})===!1)return this;if(this.zooming=!0,g){var fe=Uc(this.viewer),Me=y&&Object.keys(y).length>0?Kc(y):{pageX:g.pageX,pageY:g.pageY};k.x-=J*((Me.pageX-fe.left-_)/H),k.y-=ne*((Me.pageY-fe.top-L)/F)}else pn(c)&&Ge(c.x)&&Ge(c.y)?(k.x-=J*((c.x-_)/H),k.y-=ne*((c.y-L)/F)):(k.x-=J/2,k.y-=ne/2);k.left=k.x,k.top=k.y,k.width=P,k.height=G,k.oldRatio=te,k.ratio=i,this.renderImage(function(){s.zooming=!1,He(b.zoomed)&&me(w,tl,b.zoomed,{once:!0}),tt(w,tl,{ratio:i,oldRatio:te,originalEvent:g},{cancelable:!1})}),l&&this.tooltip()}return this},play:function(){var i=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var l=this.element,c=this.options;if(He(c.play)&&me(l,rl,c.play,{once:!0}),tt(l,rl)===!1)return this;var g=this.player,p=this.loadImage.bind(this),w=[],b=0,y=0;if(this.played=!0,this.onLoadWhenPlay=p,s&&this.requestFullscreen(s),ve(g,fn),Be(this.items,function(L,H){var F=L.querySelector("img"),U=document.createElement("img");U.src=vn(F,"originalUrl"),U.alt=F.getAttribute("alt"),U.referrerPolicy=F.referrerPolicy,b+=1,ve(U,Gi),ri(U,Je,c.transition),gn(L,Ki)&&(ve(U,Bt),y=H),w.push(U),me(U,Ut,p,{once:!0}),g.appendChild(U)}),Ge(c.interval)&&c.interval>0){var k=function(){clearTimeout(i.playing.timeout),De(w[y],Bt),y-=1,y=y>=0?y:b-1,ve(w[y],Bt),i.playing.timeout=setTimeout(k,c.interval)},_=function(){clearTimeout(i.playing.timeout),De(w[y],Bt),y+=1,y=y<b?y:0,ve(w[y],Bt),i.playing.timeout=setTimeout(_,c.interval)};b>1&&(this.playing={prev:k,next:_,timeout:setTimeout(_,c.interval)})}return this},stop:function(){var i=this;if(!this.played)return this;var s=this.element,l=this.options;if(He(l.stop)&&me(s,nl,l.stop,{once:!0}),tt(s,nl)===!1)return this;var c=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Be(c.getElementsByTagName("img"),function(g){$e(g,Ut,i.onLoadWhenPlay)}),De(c,fn),c.innerHTML="",this.exitFullscreen(),this},full:function(){var i=this,s=this.options,l=this.viewer,c=this.image,g=this.list;return!this.isShown||this.played||this.fulled||!s.inline?this:(this.fulled=!0,this.open(),ve(this.button,Do),s.transition&&(De(g,Je),this.viewed&&De(c,Je)),ve(l,Xa),l.setAttribute("role","dialog"),l.setAttribute("aria-labelledby",this.title.id),l.setAttribute("aria-modal",!0),l.removeAttribute("style"),Zt(l,{zIndex:s.zIndex}),s.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=Pt({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){i.renderImage(function(){s.transition&&setTimeout(function(){ve(c,Je),ve(g,Je)},0)})}),this)},exit:function(){var i=this,s=this.options,l=this.viewer,c=this.image,g=this.list;return!this.isShown||this.played||!this.fulled||!s.inline?this:(this.fulled=!1,this.close(),De(this.button,Do),s.transition&&(De(g,Je),this.viewed&&De(c,Je)),s.focus&&this.clearEnforceFocus(),l.removeAttribute("role"),l.removeAttribute("aria-labelledby"),l.removeAttribute("aria-modal"),De(l,Xa),Zt(l,{zIndex:s.zIndexInline}),this.viewerData=Pt({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){i.renderImage(function(){s.transition&&setTimeout(function(){ve(c,Je),ve(g,Je)},0)})}),this)},tooltip:function(){var i=this,s=this.options,l=this.tooltipBox,c=this.imageData;return!this.viewed||this.played||!s.tooltip?this:(l.textContent="".concat(Math.round(c.ratio*100),"%"),this.tooltipping?clearTimeout(this.tooltipping):s.transition?(this.fading&&tt(l,Vt),ve(l,fn),ve(l,Gi),ve(l,Je),l.removeAttribute("aria-hidden"),l.initialOffsetWidth=l.offsetWidth,ve(l,Bt)):(ve(l,fn),l.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){s.transition?(me(l,Vt,function(){De(l,fn),De(l,Gi),De(l,Je),l.setAttribute("aria-hidden",!0),i.fading=!1},{once:!0}),De(l,Bt),i.fading=!0):(De(l,fn),l.setAttribute("aria-hidden",!0)),i.tooltipping=!1},1e3),this)},toggle:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,null,i):this.zoomTo(1,!0,null,i),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=Pt({},this.initialImageData),this.renderImage()),this},update:function(){var i=this,s=this.element,l=this.options,c=this.isImg;if(c&&!s.parentNode)return this.destroy();var g=[];if(Be(c?[s]:s.querySelectorAll("img"),function(y){He(l.filter)?l.filter.call(i,y)&&g.push(y):i.getImageURL(y)&&g.push(y)}),!g.length)return this;if(this.images=g,this.length=g.length,this.ready){var p=[];if(Be(this.items,function(y,k){var _=y.querySelector("img"),L=g[k];L&&_?(L.src!==_.src||L.alt!==_.alt)&&p.push(k):p.push(k)}),Zt(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var w=p.indexOf(this.index);if(w>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-w,this.length-1),0));else{var b=this.items[this.index];ve(b,Ki),b.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var i=this.element,s=this.options;return i[Se]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),s.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):s.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),s.inline||$e(i,cn,this.onStart),i[Se]=void 0,this):this}},Zc={getImageURL:function(i){var s=this.options.url;return ti(s)?s=i.getAttribute(s):He(s)?s=s.call(this,i):s="",s},enforceFocus:function(){var i=this;this.clearEnforceFocus(),me(document,Ro,this.onFocusin=function(s){var l=i.viewer,c=s.target;if(!(c===document||c===l||l.contains(c))){for(;c;){if(c.getAttribute("tabindex")!==null||c.getAttribute("aria-modal")==="true")return;c=c.parentElement}l.focus()}})},clearEnforceFocus:function(){this.onFocusin&&($e(document,Ro,this.onFocusin),this.onFocusin=null)},open:function(){var i=this.body;ve(i,No),this.scrollbarWidth>0&&(i.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var i=this.body;De(i,No),this.scrollbarWidth>0&&(i.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var i=this.element,s=this.options,l=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,s.focus&&(l.focus(),this.enforceFocus()),He(s.shown)&&me(i,jo,s.shown,{once:!0}),tt(i,jo)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var i=this.element,s=this.options,l=this.viewer;s.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),ve(l,jr),l.removeAttribute("role"),l.removeAttribute("aria-labelledby"),l.removeAttribute("aria-modal"),l.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(He(s.hidden)&&me(i,Ko,s.hidden,{once:!0}),tt(i,Ko,null,{cancelable:!1}))},requestFullscreen:function(i){var s=this.element.ownerDocument;if(this.fulled&&!(s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement)){var l=s.documentElement;l.requestFullscreen?pn(i)?l.requestFullscreen(i):l.requestFullscreen():l.webkitRequestFullscreen?l.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):l.mozRequestFullScreen?l.mozRequestFullScreen():l.msRequestFullscreen&&l.msRequestFullscreen()}},exitFullscreen:function(){var i=this.element.ownerDocument;this.fulled&&(i.fullscreenElement||i.webkitFullscreenElement||i.mozFullScreenElement||i.msFullscreenElement)&&(i.exitFullscreen?i.exitFullscreen():i.webkitExitFullscreen?i.webkitExitFullscreen():i.mozCancelFullScreen?i.mozCancelFullScreen():i.msExitFullscreen&&i.msExitFullscreen())},change:function(i){var s=this.options,l=this.pointers,c=l[Object.keys(l)[0]];if(c){var g=c.endX-c.startX,p=c.endY-c.startY;switch(this.action){case qi:(g!==0||p!==0)&&(this.pointerMoved=!0,this.move(g,p,i));break;case Qn:this.zoom(qc(l),!1,null,i);break;case Io:{this.action="switched";var w=Math.abs(g);w>1&&w>Math.abs(p)&&(this.pointers={},g>1?this.prev(s.loop):g<-1&&this.next(s.loop));break}}Be(l,function(b){b.startX=b.endX,b.startY=b.endY})}},isSwitchable:function(){var i=this.imageData,s=this.viewerData;return this.length>1&&i.x>=0&&i.y>=0&&i.width<=s.width&&i.height<=s.height}},Qc=mr.Viewer,Jc=function(f){return function(){return f+=1,f}}(-1),sl=function(){function f(i){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Cc(this,f),!i||i.nodeType!==1)throw new Error("The first argument is required and must be an element.");this.element=i,this.options=Pt({},Ao,pn(s)&&s),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Jc(),this.init()}return Tc(f,[{key:"init",value:function(){var s=this,l=this.element,c=this.options;if(!l[Se]){l[Se]=this,c.focus&&!c.keyboard&&(c.focus=!1);var g=l.localName==="img",p=[];if(Be(g?[l]:l.querySelectorAll("img"),function(y){He(c.filter)?c.filter.call(s,y)&&p.push(y):s.getImageURL(y)&&p.push(y)}),this.isImg=g,this.length=p.length,this.images=p,this.initBody(),hn(document.createElement(Se).style.transition)&&(c.transition=!1),c.inline){var w=0,b=function(){if(w+=1,w===s.length){var k;s.initializing=!1,s.delaying={abort:function(){clearTimeout(k)}},k=setTimeout(function(){s.delaying=!1,s.build()},0)}};this.initializing={abort:function(){Be(p,function(k){k.complete||($e(k,Ut,b),$e(k,qr,b))})}},Be(p,function(y){if(y.complete)b();else{var k,_;me(y,Ut,k=function(){$e(y,qr,_),b()},{once:!0}),me(y,qr,_=function(){$e(y,Ut,k),b()},{once:!0})}})}else me(l,cn,this.onStart=function(y){var k=y.target;k.localName==="img"&&(!He(c.filter)||c.filter.call(s,k))&&s.view(s.images.indexOf(k))})}}},{key:"build",value:function(){if(!this.ready){var s=this.element,l=this.options,c=s.parentNode,g=document.createElement("div");g.innerHTML=Ec;var p=g.querySelector(".".concat(Se,"-container")),w=p.querySelector(".".concat(Se,"-title")),b=p.querySelector(".".concat(Se,"-toolbar")),y=p.querySelector(".".concat(Se,"-navbar")),k=p.querySelector(".".concat(Se,"-button")),_=p.querySelector(".".concat(Se,"-canvas"));if(this.parent=c,this.viewer=p,this.title=w,this.toolbar=b,this.navbar=y,this.button=k,this.canvas=_,this.footer=p.querySelector(".".concat(Se,"-footer")),this.tooltipBox=p.querySelector(".".concat(Se,"-tooltip")),this.player=p.querySelector(".".concat(Se,"-player")),this.list=p.querySelector(".".concat(Se,"-list")),p.id="".concat(Se).concat(this.id),w.id="".concat(Se,"Title").concat(this.id),ve(w,l.title?Zi(Array.isArray(l.title)?l.title[0]:l.title):jr),ve(y,l.navbar?Zi(l.navbar):jr),ri(k,jr,!l.button),l.keyboard&&k.setAttribute("tabindex",0),l.backdrop&&(ve(p,"".concat(Se,"-backdrop")),!l.inline&&l.backdrop!=="static"&&Qa(_,Xi,"hide")),ti(l.className)&&l.className&&l.className.split(Va).forEach(function(P){ve(p,P)}),l.toolbar){var L=document.createElement("ul"),H=pn(l.toolbar),F=Yi.slice(0,3),U=Yi.slice(7,9),M=Yi.slice(9);H||ve(b,Zi(l.toolbar)),Be(H?l.toolbar:Yi,function(P,G){var J=H&&pn(P),ne=H?Za(G):P,te=J&&!hn(P.show)?P.show:P;if(!(!te||!l.zoomable&&F.indexOf(ne)!==-1||!l.rotatable&&U.indexOf(ne)!==-1||!l.scalable&&M.indexOf(ne)!==-1)){var fe=J&&!hn(P.size)?P.size:P,Me=J&&!hn(P.click)?P.click:P,Ee=document.createElement("li");l.keyboard&&Ee.setAttribute("tabindex",0),Ee.setAttribute("role","button"),ve(Ee,"".concat(Se,"-").concat(ne)),He(Me)||Qa(Ee,Xi,ne),Ge(te)&&ve(Ee,Zi(te)),["small","large"].indexOf(fe)!==-1?ve(Ee,"".concat(Se,"-").concat(fe)):ne==="play"&&ve(Ee,"".concat(Se,"-large")),He(Me)&&me(Ee,cn,Me),L.appendChild(Ee)}}),b.appendChild(L)}else ve(b,jr);if(!l.rotatable){var A=b.querySelectorAll('li[class*="rotate"]');ve(A,Jn),Be(A,function(P){b.appendChild(P)})}if(l.inline)ve(k,Ac),Zt(p,{zIndex:l.zIndexInline}),window.getComputedStyle(c).position==="static"&&Zt(c,{position:"relative"}),c.insertBefore(p,s.nextSibling);else{ve(k,Oc),ve(p,Xa),ve(p,Gi),ve(p,jr),Zt(p,{zIndex:l.zIndex});var D=l.container;ti(D)&&(D=s.ownerDocument.querySelector(D)),D||(D=this.body),D.appendChild(p)}if(l.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,He(l.ready)&&me(s,Bo,l.ready,{once:!0}),tt(s,Bo)===!1){this.ready=!1;return}this.ready&&l.inline&&this.view(this.index)}}}],[{key:"noConflict",value:function(){return window.Viewer=Qc,f}},{key:"setDefaults",value:function(s){Pt(Ao,pn(s)&&s)}}])}();Pt(sl.prototype,Gc,Xc,Yc,Vc,Zc);var eh=typeof global=="object"&&global&&global.Object===Object&&global,ol=eh,th=typeof self=="object"&&self&&self.Object===Object&&self,rh=ol||th||Function("return this")(),es=rh,nh=es.Symbol,Ji=nh,ll=Object.prototype,ih=ll.hasOwnProperty,ah=ll.toString,ni=Ji?Ji.toStringTag:void 0;function sh(f){var i=ih.call(f,ni),s=f[ni];try{f[ni]=void 0;var l=!0}catch{}var c=ah.call(f);return l&&(i?f[ni]=s:delete f[ni]),c}var oh=Object.prototype,lh=oh.toString;function uh(f){return lh.call(f)}var fh="[object Null]",ch="[object Undefined]",ul=Ji?Ji.toStringTag:void 0;function ts(f){return f==null?f===void 0?ch:fh:ul&&ul in Object(f)?sh(f):uh(f)}function rs(f){return f!=null&&typeof f=="object"}var hh=Array.isArray,dh=hh;function ns(f){var i=typeof f;return f!=null&&(i=="object"||i=="function")}function fl(f){return f}var ph="[object AsyncFunction]",gh="[object Function]",vh="[object GeneratorFunction]",mh="[object Proxy]";function cl(f){if(!ns(f))return!1;var i=ts(f);return i==gh||i==vh||i==ph||i==mh}var yh=es["__core-js_shared__"],is=yh,hl=function(){var f=/[^.]+$/.exec(is&&is.keys&&is.keys.IE_PROTO||"");return f?"Symbol(src)_1."+f:""}();function bh(f){return!!hl&&hl in f}var wh=Function.prototype,xh=wh.toString;function kh(f){if(f!=null){try{return xh.call(f)}catch{}try{return f+""}catch{}}return""}var Sh=/[\\^$.*+?()[\]{}|]/g,Ch=/^\[object .+?Constructor\]$/,Th=Function.prototype,Lh=Object.prototype,_h=Th.toString,Eh=Lh.hasOwnProperty,Oh=RegExp("^"+_h.call(Eh).replace(Sh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ah(f){if(!ns(f)||bh(f))return!1;var i=cl(f)?Oh:Ch;return i.test(kh(f))}function Ih(f,i){return f==null?void 0:f[i]}function Dh(f,i){var s=Ih(f,i);return Ah(s)?s:void 0}function Nh(f,i,s){switch(s.length){case 0:return f.call(i);case 1:return f.call(i,s[0]);case 2:return f.call(i,s[0],s[1]);case 3:return f.call(i,s[0],s[1],s[2])}return f.apply(i,s)}var Mh=800,Rh=16,zh=Date.now;function Ph(f){var i=0,s=0;return function(){var l=zh(),c=Rh-(l-s);if(s=l,c>0){if(++i>=Mh)return arguments[0]}else i=0;return f.apply(void 0,arguments)}}function Fh(f){return function(){return f}}var Wh=function(){try{var f=Dh(Object,"defineProperty");return f({},"",{}),f}catch{}}(),ea=Wh,Hh=ea?function(f,i){return ea(f,"toString",{configurable:!0,enumerable:!1,value:Fh(i),writable:!0})}:fl,$h=Hh,Bh=Ph($h),Uh=Bh,jh=9007199254740991,qh=/^(?:0|[1-9]\d*)$/;function dl(f,i){var s=typeof f;return i=i??jh,!!i&&(s=="number"||s!="symbol"&&qh.test(f))&&f>-1&&f%1==0&&f<i}function pl(f,i,s){i=="__proto__"&&ea?ea(f,i,{configurable:!0,enumerable:!0,value:s,writable:!0}):f[i]=s}function gl(f,i){return f===i||f!==f&&i!==i}var Kh=Object.prototype,Gh=Kh.hasOwnProperty;function vl(f,i,s){var l=f[i];(!(Gh.call(f,i)&&gl(l,s))||s===void 0&&!(i in f))&&pl(f,i,s)}function Xh(f,i,s,l){var c=!s;s||(s={});for(var g=-1,p=i.length;++g<p;){var w=i[g],b=void 0;b===void 0&&(b=f[w]),c?pl(s,w,b):vl(s,w,b)}return s}var ml=Math.max;function Yh(f,i,s){return i=ml(i===void 0?f.length-1:i,0),function(){for(var l=arguments,c=-1,g=ml(l.length-i,0),p=Array(g);++c<g;)p[c]=l[i+c];c=-1;for(var w=Array(i+1);++c<i;)w[c]=l[c];return w[i]=s(p),Nh(f,this,w)}}function Vh(f,i){return Uh(Yh(f,i,fl),f+"")}var Zh=9007199254740991;function yl(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=Zh}function as(f){return f!=null&&yl(f.length)&&!cl(f)}function Qh(f,i,s){if(!ns(s))return!1;var l=typeof i;return(l=="number"?as(s)&&dl(i,s.length):l=="string"&&i in s)?gl(s[i],f):!1}function Jh(f){return Vh(function(i,s){var l=-1,c=s.length,g=c>1?s[c-1]:void 0,p=c>2?s[2]:void 0;for(g=f.length>3&&typeof g=="function"?(c--,g):void 0,p&&Qh(s[0],s[1],p)&&(g=c<3?void 0:g,c=1),i=Object(i);++l<c;){var w=s[l];w&&f(i,w,l,g)}return i})}var ed=Object.prototype;function bl(f){var i=f&&f.constructor,s=typeof i=="function"&&i.prototype||ed;return f===s}function td(f,i){for(var s=-1,l=Array(f);++s<f;)l[s]=i(s);return l}var rd="[object Arguments]";function wl(f){return rs(f)&&ts(f)==rd}var xl=Object.prototype,nd=xl.hasOwnProperty,id=xl.propertyIsEnumerable,ad=wl(function(){return arguments}())?wl:function(f){return rs(f)&&nd.call(f,"callee")&&!id.call(f,"callee")},sd=ad;function od(){return!1}var kl=typeof ke=="object"&&ke&&!ke.nodeType&&ke,Sl=kl&&typeof module=="object"&&module&&!module.nodeType&&module,ld=Sl&&Sl.exports===kl,Cl=ld?es.Buffer:void 0,ud=Cl?Cl.isBuffer:void 0,fd=ud||od,cd=fd,hd="[object Arguments]",dd="[object Array]",pd="[object Boolean]",gd="[object Date]",vd="[object Error]",md="[object Function]",yd="[object Map]",bd="[object Number]",wd="[object Object]",xd="[object RegExp]",kd="[object Set]",Sd="[object String]",Cd="[object WeakMap]",Td="[object ArrayBuffer]",Ld="[object DataView]",_d="[object Float32Array]",Ed="[object Float64Array]",Od="[object Int8Array]",Ad="[object Int16Array]",Id="[object Int32Array]",Dd="[object Uint8Array]",Nd="[object Uint8ClampedArray]",Md="[object Uint16Array]",Rd="[object Uint32Array]",Ue={};Ue[_d]=Ue[Ed]=Ue[Od]=Ue[Ad]=Ue[Id]=Ue[Dd]=Ue[Nd]=Ue[Md]=Ue[Rd]=!0,Ue[hd]=Ue[dd]=Ue[Td]=Ue[pd]=Ue[Ld]=Ue[gd]=Ue[vd]=Ue[md]=Ue[yd]=Ue[bd]=Ue[wd]=Ue[xd]=Ue[kd]=Ue[Sd]=Ue[Cd]=!1;function zd(f){return rs(f)&&yl(f.length)&&!!Ue[ts(f)]}function Pd(f){return function(i){return f(i)}}var Tl=typeof ke=="object"&&ke&&!ke.nodeType&&ke,ii=Tl&&typeof module=="object"&&module&&!module.nodeType&&module,Fd=ii&&ii.exports===Tl,ss=Fd&&ol.process,Wd=function(){try{var f=ii&&ii.require&&ii.require("util").types;return f||ss&&ss.binding&&ss.binding("util")}catch{}}(),Ll=Wd,_l=Ll&&Ll.isTypedArray,Hd=_l?Pd(_l):zd,$d=Hd,Bd=Object.prototype,Ud=Bd.hasOwnProperty;function jd(f,i){var s=dh(f),l=!s&&sd(f),c=!s&&!l&&cd(f),g=!s&&!l&&!c&&$d(f),p=s||l||c||g,w=p?td(f.length,String):[],b=w.length;for(var y in f)Ud.call(f,y)&&!(p&&(y=="length"||c&&(y=="offset"||y=="parent")||g&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||dl(y,b)))&&w.push(y);return w}function qd(f,i){return function(s){return f(i(s))}}var Kd=qd(Object.keys,Object),Gd=Kd,Xd=Object.prototype,Yd=Xd.hasOwnProperty;function Vd(f){if(!bl(f))return Gd(f);var i=[];for(var s in Object(f))Yd.call(f,s)&&s!="constructor"&&i.push(s);return i}function Zd(f){return as(f)?jd(f):Vd(f)}var Qd=Object.prototype,Jd=Qd.hasOwnProperty,ep=Jh(function(f,i){if(bl(i)||as(i)){Xh(i,Zd(i),f);return}for(var s in i)Jd.call(i,s)&&vl(f,s,i[s])}),tp=ep;const rp=({images:f=[],options:i={}}={})=>{i=tp(i,{inline:!1});const s=Rf.extend({render(p){return p("div",{style:{display:"none"},class:["__viewer-token"]},f.map(w=>p("img",{attrs:typeof w=="string"?{src:w}:w})))}}),l=new s;l.$mount(),document.body.appendChild(l.$el);const c=new sl(l.$el,i),g=c.destroy.bind(c);return c.destroy=function(){return g(),l.$destroy(),document.body.removeChild(l.$el),c},c.show(),l.$el.addEventListener("hidden",function(){this.viewer===c&&c.destroy()}),c};(function(f,i){(function(s){s(vr())})(function(s){function l(I,N,K,se,Fe,ze){this.indented=I,this.column=N,this.type=K,this.info=se,this.align=Fe,this.prev=ze}function c(I,N,K,se){var Fe=I.indented;return I.context&&I.context.type=="statement"&&K!="statement"&&(Fe=I.context.indented),I.context=new l(Fe,N,K,se,null,I.context)}function g(I){var N=I.context.type;return(N==")"||N=="]"||N=="}")&&(I.indented=I.context.indented),I.context=I.context.prev}function p(I,N,K){if(N.prevToken=="variable"||N.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(I.string.slice(0,K))||N.typeAtEndOfLine&&I.column()==I.indentation())return!0}function w(I){for(;;){if(!I||I.type=="top")return!0;if(I.type=="}"&&I.prev.info!="namespace")return!1;I=I.prev}}s.defineMode("clike",function(I,N){var K=I.indentUnit,se=N.statementIndentUnit||K,Fe=N.dontAlignCalls,ze=N.keywords||{},wt=N.types||{},nt=N.builtin||{},pe=N.blockKeywords||{},he=N.defKeywords||{},be=N.atoms||{},Ce=N.hooks||{},jt=N.multiLineStrings,ye=N.indentStatements!==!1,pt=N.indentSwitch!==!1,Qt=N.namespaceSeparator,St=N.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,qt=N.numberStart||/[\d\.]/,Ct=N.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,Ft=N.isOperatorChar||/[+\-*&%=<>!?|\/]/,Kt=N.isIdentifierChar||/[\w\$_\xa1-\uffff]/,Lr=N.isReservedIdentifier||!1,de,Jt;function mn(ue,ce){var ie=ue.next();if(Ce[ie]){var Te=Ce[ie](ue,ce);if(Te!==!1)return Te}if(ie=='"'||ie=="'")return ce.tokenize=yn(ie),ce.tokenize(ue,ce);if(qt.test(ie)){if(ue.backUp(1),ue.match(Ct))return"number";ue.next()}if(St.test(ie))return de=ie,null;if(ie=="/"){if(ue.eat("*"))return ce.tokenize=Gr,Gr(ue,ce);if(ue.eat("/"))return ue.skipToEnd(),"comment"}if(Ft.test(ie)){for(;!ue.match(/^\/[\/*]/,!1)&&ue.eat(Ft););return"operator"}if(ue.eatWhile(Kt),Qt)for(;ue.match(Qt);)ue.eatWhile(Kt);var we=ue.current();return y(ze,we)?(y(pe,we)&&(de="newstatement"),y(he,we)&&(Jt=!0),"keyword"):y(wt,we)?"type":y(nt,we)||Lr&&Lr(we)?(y(pe,we)&&(de="newstatement"),"builtin"):y(be,we)?"atom":"variable"}function yn(ue){return function(ce,ie){for(var Te=!1,we,Dt=!1;(we=ce.next())!=null;){if(we==ue&&!Te){Dt=!0;break}Te=!Te&&we=="\\"}return(Dt||!(Te||jt))&&(ie.tokenize=null),"string"}}function Gr(ue,ce){for(var ie=!1,Te;Te=ue.next();){if(Te=="/"&&ie){ce.tokenize=null;break}ie=Te=="*"}return"comment"}function bn(ue,ce){N.typeFirstDefinitions&&ue.eol()&&w(ce.context)&&(ce.typeAtEndOfLine=p(ue,ce,ue.pos))}return{startState:function(ue){return{tokenize:null,context:new l((ue||0)-K,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(ue,ce){var ie=ce.context;if(ue.sol()&&(ie.align==null&&(ie.align=!1),ce.indented=ue.indentation(),ce.startOfLine=!0),ue.eatSpace())return bn(ue,ce),null;de=Jt=null;var Te=(ce.tokenize||mn)(ue,ce);if(Te=="comment"||Te=="meta")return Te;if(ie.align==null&&(ie.align=!0),de==";"||de==":"||de==","&&ue.match(/^\s*(?:\/\/.*)?$/,!1))for(;ce.context.type=="statement";)g(ce);else if(de=="{")c(ce,ue.column(),"}");else if(de=="[")c(ce,ue.column(),"]");else if(de=="(")c(ce,ue.column(),")");else if(de=="}"){for(;ie.type=="statement";)ie=g(ce);for(ie.type=="}"&&(ie=g(ce));ie.type=="statement";)ie=g(ce)}else de==ie.type?g(ce):ye&&((ie.type=="}"||ie.type=="top")&&de!=";"||ie.type=="statement"&&de=="newstatement")&&c(ce,ue.column(),"statement",ue.current());if(Te=="variable"&&(ce.prevToken=="def"||N.typeFirstDefinitions&&p(ue,ce,ue.start)&&w(ce.context)&&ue.match(/^\s*\(/,!1))&&(Te="def"),Ce.token){var we=Ce.token(ue,ce,Te);we!==void 0&&(Te=we)}return Te=="def"&&N.styleDefs===!1&&(Te="variable"),ce.startOfLine=!1,ce.prevToken=Jt?"def":Te||de,bn(ue,ce),Te},indent:function(ue,ce){if(ue.tokenize!=mn&&ue.tokenize!=null||ue.typeAtEndOfLine&&w(ue.context))return s.Pass;var ie=ue.context,Te=ce&&ce.charAt(0),we=Te==ie.type;if(ie.type=="statement"&&Te=="}"&&(ie=ie.prev),N.dontIndentStatements)for(;ie.type=="statement"&&N.dontIndentStatements.test(ie.info);)ie=ie.prev;if(Ce.indent){var Dt=Ce.indent(ue,ie,ce,K);if(typeof Dt=="number")return Dt}var Gt=ie.prev&&ie.prev.info=="switch";if(N.allmanIndentation&&/[{(]/.test(Te)){for(;ie.type!="top"&&ie.type!="}";)ie=ie.prev;return ie.indented}return ie.type=="statement"?ie.indented+(Te=="{"?0:se):ie.align&&(!Fe||ie.type!=")")?ie.column+(we?0:1):ie.type==")"&&!we?ie.indented+se:ie.indented+(we?0:K)+(!we&&Gt&&!/^(?:case|default)\b/.test(ce)?K:0)},electricInput:pt?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function b(I){for(var N={},K=I.split(" "),se=0;se<K.length;++se)N[K[se]]=!0;return N}function y(I,N){return typeof I=="function"?I(N):I.propertyIsEnumerable(N)}var k="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",_="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",L="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",H="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",F=b("int long char short double float unsigned signed void bool"),U=b("SEL instancetype id Class Protocol BOOL");function M(I){return y(F,I)||/.+_t$/.test(I)}function A(I){return M(I)||y(U,I)}var D="case do else for if switch while struct enum union",P="struct enum union";function G(I,N){if(!N.startOfLine)return!1;for(var K,se=null;K=I.peek();){if(K=="\\"&&I.match(/^.$/)){se=G;break}else if(K=="/"&&I.match(/^\/[\/\*]/,!1))break;I.next()}return N.tokenize=se,"meta"}function J(I,N){return N.prevToken=="type"?"type":!1}function ne(I){return!I||I.length<2||I[0]!="_"?!1:I[1]=="_"||I[1]!==I[1].toLowerCase()}function te(I){return I.eatWhile(/[\w\.']/),"number"}function fe(I,N){if(I.backUp(1),I.match(/^(?:R|u8R|uR|UR|LR)/)){var K=I.match(/^"([^\s\\()]{0,16})\(/);return K?(N.cpp11RawStringDelim=K[1],N.tokenize=Oe,Oe(I,N)):!1}return I.match(/^(?:u8|u|U|L)/)?I.match(/^["']/,!1)?"string":!1:(I.next(),!1)}function Me(I){var N=/(\w+)::~?(\w+)$/.exec(I);return N&&N[1]==N[2]}function Ee(I,N){for(var K;(K=I.next())!=null;)if(K=='"'&&!I.eat('"')){N.tokenize=null;break}return"string"}function Oe(I,N){var K=N.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),se=I.match(new RegExp(".*?\\)"+K+'"'));return se?N.tokenize=null:I.skipToEnd(),"string"}function Re(I,N){typeof I=="string"&&(I=[I]);var K=[];function se(ze){if(ze)for(var wt in ze)ze.hasOwnProperty(wt)&&K.push(wt)}se(N.keywords),se(N.types),se(N.builtin),se(N.atoms),K.length&&(N.helperType=I[0],s.registerHelper("hintWords",I[0],K));for(var Fe=0;Fe<I.length;++Fe)s.defineMIME(I[Fe],N)}Re(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:b(k),types:M,blockKeywords:b(D),defKeywords:b(P),typeFirstDefinitions:!0,atoms:b("NULL true false"),isReservedIdentifier:ne,hooks:{"#":G,"*":J},modeProps:{fold:["brace","include"]}}),Re(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:b(k+" "+_),types:M,blockKeywords:b(D+" class try catch"),defKeywords:b(P+" class namespace"),typeFirstDefinitions:!0,atoms:b("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:ne,hooks:{"#":G,"*":J,u:fe,U:fe,L:fe,R:fe,0:te,1:te,2:te,3:te,4:te,5:te,6:te,7:te,8:te,9:te,token:function(I,N,K){if(K=="variable"&&I.peek()=="("&&(N.prevToken==";"||N.prevToken==null||N.prevToken=="}")&&Me(I.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Re("text/x-java",{name:"clike",keywords:b("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:b("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:b("catch class do else finally for if switch try while"),defKeywords:b("class interface enum @interface"),typeFirstDefinitions:!0,atoms:b("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(I){return I.match("interface",!1)?!1:(I.eatWhile(/[\w\$_]/),"meta")},'"':function(I,N){return I.match(/""$/)?(N.tokenize=$,N.tokenize(I,N)):!1}},modeProps:{fold:["brace","import"]}}),Re("text/x-csharp",{name:"clike",keywords:b("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:b("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:b("catch class do else finally for foreach if struct switch try while"),defKeywords:b("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"@":function(I,N){return I.eat('"')?(N.tokenize=Ee,Ee(I,N)):(I.eatWhile(/[\w\$_]/),"meta")}}});function $(I,N){for(var K=!1;!I.eol();){if(!K&&I.match('"""')){N.tokenize=null;break}K=I.next()=="\\"&&!K}return"string"}function V(I){return function(N,K){for(var se;se=N.next();)if(se=="*"&&N.eat("/"))if(I==1){K.tokenize=null;break}else return K.tokenize=V(I-1),K.tokenize(N,K);else if(se=="/"&&N.eat("*"))return K.tokenize=V(I+1),K.tokenize(N,K);return"comment"}}Re("text/x-scala",{name:"clike",keywords:b("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:b("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:b("catch class enum do else finally for forSome if match switch try while"),defKeywords:b("class enum def object package trait type val var"),atoms:b("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(I){return I.eatWhile(/[\w\$_]/),"meta"},'"':function(I,N){return I.match('""')?(N.tokenize=$,N.tokenize(I,N)):!1},"'":function(I){return I.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(I.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(I,N){var K=N.context;return K.type=="}"&&K.align&&I.eat(">")?(N.context=new l(K.indented,K.column,K.type,K.info,null,K.prev),"operator"):!1},"/":function(I,N){return I.eat("*")?(N.tokenize=V(1),N.tokenize(I,N)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function T(I){return function(N,K){for(var se=!1,Fe,ze=!1;!N.eol();){if(!I&&!se&&N.match('"')){ze=!0;break}if(I&&N.match('"""')){ze=!0;break}Fe=N.next(),!se&&Fe=="$"&&N.match("{")&&N.skipTo("}"),se=!se&&Fe=="\\"&&!I}return(ze||!I)&&(K.tokenize=null),"string"}}Re("text/x-kotlin",{name:"clike",keywords:b("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:b("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:b("catch class do else finally for if where try while enum"),defKeywords:b("class val var object interface fun"),atoms:b("true false null this"),hooks:{"@":function(I){return I.eatWhile(/[\w\$_]/),"meta"},"*":function(I,N){return N.prevToken=="."?"variable":"operator"},'"':function(I,N){return N.tokenize=T(I.match('""')),N.tokenize(I,N)},"/":function(I,N){return I.eat("*")?(N.tokenize=V(1),N.tokenize(I,N)):!1},indent:function(I,N,K,se){var Fe=K&&K.charAt(0);if((I.prevToken=="}"||I.prevToken==")")&&K=="")return I.indented;if(I.prevToken=="operator"&&K!="}"&&I.context.type!="}"||I.prevToken=="variable"&&Fe=="."||(I.prevToken=="}"||I.prevToken==")")&&Fe==".")return se*2+N.indented;if(N.align&&N.type=="}")return N.indented+(I.context.type==(K||"").charAt(0)?0:se)}},modeProps:{closeBrackets:{triples:'"'}}}),Re(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:b("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:b("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:b("for while do if else struct"),builtin:b("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:b("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":G},modeProps:{fold:["brace","include"]}}),Re("text/x-nesc",{name:"clike",keywords:b(k+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:M,blockKeywords:b(D),atoms:b("null true false"),hooks:{"#":G},modeProps:{fold:["brace","include"]}}),Re("text/x-objectivec",{name:"clike",keywords:b(k+" "+L),types:A,builtin:b(H),blockKeywords:b(D+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:b(P+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ne,hooks:{"#":G,"*":J},modeProps:{fold:["brace","include"]}}),Re("text/x-objectivec++",{name:"clike",keywords:b(k+" "+L+" "+_),types:A,builtin:b(H),blockKeywords:b(D+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:b(P+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:b("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ne,hooks:{"#":G,"*":J,u:fe,U:fe,L:fe,R:fe,0:te,1:te,2:te,3:te,4:te,5:te,6:te,7:te,8:te,9:te,token:function(I,N,K){if(K=="variable"&&I.peek()=="("&&(N.prevToken==";"||N.prevToken==null||N.prevToken=="}")&&Me(I.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),Re("text/x-squirrel",{name:"clike",keywords:b("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:M,blockKeywords:b("case catch class else for foreach if switch try while"),defKeywords:b("function local class"),typeFirstDefinitions:!0,atoms:b("true false null"),hooks:{"#":G},modeProps:{fold:["brace","include"]}});var rt=null;function st(I){return function(N,K){for(var se=!1,Fe,ze=!1;!N.eol();){if(!se&&N.match('"')&&(I=="single"||N.match('""'))){ze=!0;break}if(!se&&N.match("``")){rt=st(I),ze=!0;break}Fe=N.next(),se=I=="single"&&!se&&Fe=="\\"}return ze&&(K.tokenize=null),"string"}}Re("text/x-ceylon",{name:"clike",keywords:b("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(I){var N=I.charAt(0);return N===N.toUpperCase()&&N!==N.toLowerCase()},blockKeywords:b("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:b("class dynamic function interface module object package value"),builtin:b("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:b("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(I){return I.eatWhile(/[\w\$_]/),"meta"},'"':function(I,N){return N.tokenize=st(I.match('""')?"triple":"single"),N.tokenize(I,N)},"`":function(I,N){return!rt||!I.match("`")?!1:(N.tokenize=rt,rt=null,N.tokenize(I,N))},"'":function(I){return I.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(I,N,K){if((K=="variable"||K=="type")&&N.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})();const np={name:"Trace",components:{TraceSpanTree:ja,codemirror:Ff.codemirror},data(){return{traceList:[],filteredTraceList:[],searchQuery:"",dateRange:null,loading:!1,deleteLoading:!1,showColumnDialog:!1,selectedColumns:["trace_id","timestamp_ms","status","execution_time_ms","trace_type","trace_name"],visibleColumns:{trace_id:!0,timestamp_ms:!0,status:!0,execution_time_ms:!0,trace_type:!0,trace_name:!0},drawerVisible:!1,currentTraceId:null,traceInfo:{},spans:[],filteredSpans:[],spanSearchQuery:"",selectedSpanId:null,selectedSpan:null,activeTab:"io",activeCollapse:["inputs","outputs"],messageCollapse:[],rawIoCollapse:["rawInputs","rawOutputs"],rawInputsKey:0,rawOutputsKey:0,eventsCollapse:[],eventsKey:0,pageNo:1,pageSize:10,total:0,pickerOptions:{shortcuts:[{text:"近7天",onClick(f){const i=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24*7),f.$emit("pick",[s,i])}},{text:"近30天",onClick(f){const i=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24*30),f.$emit("pick",[s,i])}},{text:"7天前",onClick(f){const i=new Date;i.setTime(i.getTime()-3600*1e3*24*7),i.setHours(23,59,59,999);const s=i.getTime();f.$emit("pick",[null,s])}},{text:"30天前",onClick(f){const i=new Date;i.setTime(i.getTime()-3600*1e3*24*30),i.setHours(23,59,59,999);const s=i.getTime();f.$emit("pick",[null,s])}}]},cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0},cmOptionsJava:{tabSize:4,mode:"text/x-java",theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,indentUnit:4,styleActiveLine:!0},viewerOptions:{toolbar:{zoomIn:1,zoomOut:1,oneToOne:1,reset:1,prev:0,play:0,next:0,rotateLeft:1,rotateRight:1,flipHorizontal:1,flipVertical:1},title:!1,navbar:!1,scalable:!0,rotatable:!0,zoomable:!0,movable:!0,keyboard:!0,transition:!0,fullscreen:!0,zIndex:9999}}},computed:{drawerTitle(){let f=this.traceInfo.trace_name;return f||(f=this.traceInfo.trace_id),f?this.$t("trace.traceDetail")+": "+f:this.$t("trace.traceDetail")},traceStartTime(){return this.spans.length===0?0:Math.min(...this.spans.map(f=>f.start_time_unix_nano))},traceEndTime(){return this.spans.length===0?0:Math.max(...this.spans.map(f=>f.end_time_unix_nano))},hasInputs(){var f,i;return((i=(f=this.selectedSpan)==null?void 0:f.parsedContent)==null?void 0:i.inputs)!==void 0},hasOutputs(){var f,i;return((i=(f=this.selectedSpan)==null?void 0:f.parsedContent)==null?void 0:i.outputs)!==void 0},attributesData(){var f,i;return(i=(f=this.selectedSpan)==null?void 0:f.parsedContent)!=null&&i.attributes?Object.entries(this.selectedSpan.parsedContent.attributes).filter(([s])=>!s.startsWith("langsword.span")).map(([s,l])=>({key:s,value:typeof l=="string"?l:JSON.stringify(l,null,2)})):[]},rawInputs(){var f,i,s;return(s=(i=(f=this.selectedSpan)==null?void 0:f.parsedContent)==null?void 0:i.attributes)==null?void 0:s["langsword.spanInputs"]},rawOutputs(){var f,i,s;return(s=(i=(f=this.selectedSpan)==null?void 0:f.parsedContent)==null?void 0:i.attributes)==null?void 0:s["langsword.spanOutputs"]},hasEvents(){var i,s;const f=(s=(i=this.selectedSpan)==null?void 0:i.parsedContent)==null?void 0:s.events;return f&&Array.isArray(f)&&f.length>0},spanEvents(){var i,s;const f=(s=(i=this.selectedSpan)==null?void 0:i.parsedContent)==null?void 0:s.events;return!f||!Array.isArray(f)?[]:f}},watch:{activeTab(f){f==="raw"&&this.$nextTick(()=>{this.rawInputsKey++,this.rawOutputsKey++}),f==="events"&&this.$nextTick(()=>{this.eventsKey++})},selectedSpan(){var c;if(!this.selectedSpan)return;const f=this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="CHAT_MODEL",i=(c=this.selectedSpan.parsedContent)==null?void 0:c.events,s=i&&Array.isArray(i)&&i.length>0,l=[];f&&l.push("io","raw"),l.push("attributes"),s&&l.push("events"),l.includes(this.activeTab)||(this.activeTab="attributes"),this.activeTab==="raw"&&this.$nextTick(()=>{this.rawInputsKey++,this.rawOutputsKey++}),this.activeTab==="events"&&this.$nextTick(()=>{this.eventsKey++,this.spanEvents.length>0&&(this.eventsCollapse=this.spanEvents.map((g,p)=>`event-${p}`))})}},mounted(){_e.setOptions({breaks:!0,gfm:!0,headerIds:!1,mangle:!1}),this.loadTraceList()},methods:{async loadTraceList(){this.loading=!0;try{let f=null,i=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(f=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(i=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(i=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)));const s=await on.getTraceList(this.searchQuery,f,i,this.pageNo,this.pageSize),l=Array.isArray(s==null?void 0:s.list)?s.list:[];this.traceList=l,this.filteredTraceList=l,this.total=parseInt((s==null?void 0:s.total)||0,10)}catch(f){console.error("Failed to load trace list:",f),this.$message.error("加载 trace 列表失败"),this.traceList=[],this.filteredTraceList=[],this.total=0}finally{this.loading=!1}},refresh(){this.loadTraceList()},handleRowClick(f){this.viewDetail(f.trace_id)},viewDetail(f){this.currentTraceId=f,this.loadTraceDetail(f),this.drawerVisible=!0},async loadTraceDetail(f){var i,s,l;try{const[c,g]=await Promise.all([on.getTraceDetail(f),on.getTraceSpans(f)]);if(this.traceInfo=c||{},this.spans=g.map(p=>{let w={};try{if(w=JSON.parse(p.content),w.attributes){const b=w.attributes["langsword.spanInputs"],y=w.attributes["langsword.spanOutputs"];if(b)try{w.inputs=JSON.parse(b)}catch{try{const _=b.replace(/\\"/g,'"').replace(/^"|"$/g,"");w.inputs=JSON.parse(_)}catch{w.inputs=b}}if(y)try{w.outputs=JSON.parse(y)}catch{try{const _=y.replace(/\\"/g,'"').replace(/^"|"$/g,"");w.outputs=JSON.parse(_)}catch{w.outputs=y}}}}catch(b){console.error("Parse content error:",b)}return{...p,parsedContent:w}}),this.filteredSpans=this.spans,this.spans.length>0){this.selectedSpanId=this.spans[0].span_id,this.selectedSpan=this.spans[0];const p=this.spans[0].type==="CLIENT"||this.spans[0].type==="CHAT_MODEL",w=(i=this.selectedSpan.parsedContent)==null?void 0:i.events,b=w&&Array.isArray(w)&&w.length>0,y=[];p&&y.push("io","raw"),y.push("attributes"),b&&y.push("events");let k="attributes";p&&(k="io"),y.includes(k)?this.activeTab=k:this.activeTab="attributes",(l=(s=this.selectedSpan.parsedContent)==null?void 0:s.inputs)!=null&&l.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((_,L)=>`message-${L}`):this.messageCollapse=[],b?this.eventsCollapse=w.map((_,L)=>`event-${L}`):this.eventsCollapse=[]}}catch(c){console.error("Failed to load trace detail:",c),this.$message.error("加载 trace 详情失败"),this.traceInfo={},this.spans=[],this.filteredSpans=[]}},handleSpanSearch(){if(!this.spanSearchQuery){this.filteredSpans=this.spans;return}const f=this.spanSearchQuery.toLowerCase();this.filteredSpans=this.spans.filter(i=>i.name.toLowerCase().includes(f)||i.type.toLowerCase().includes(f))},handleSpanSelect(f){var p,w,b;this.selectedSpanId=f.span_id,this.selectedSpan=f;const i=f.type==="CLIENT"||f.type==="CHAT_MODEL",s=(p=f.parsedContent)==null?void 0:p.events,l=s&&Array.isArray(s)&&s.length>0,c=[];i&&c.push("io","raw"),c.push("attributes"),l&&c.push("events");let g="attributes";i&&(g="io"),this.$nextTick(()=>{c.includes(g)?this.activeTab=g:this.activeTab="attributes"}),(b=(w=this.selectedSpan.parsedContent)==null?void 0:w.inputs)!=null&&b.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((y,k)=>`message-${k}`):this.messageCollapse=[],l?this.eventsCollapse=s.map((y,k)=>`event-${k}`):this.eventsCollapse=[]},handleDrawerClose(f){this.currentTraceId=null,this.traceInfo={},this.spans=[],this.filteredSpans=[],this.selectedSpanId=null,this.selectedSpan=null,this.spanSearchQuery="",this.eventsCollapse=[],f()},handleSearch(){this.pageNo=1,this.loadTraceList()},handleSearchClear(){this.searchQuery="",this.pageNo=1,this.loadTraceList()},handleDateRangeChange(f){this.pageNo=1,f&&Array.isArray(f)?f.length===2&&(f[0]===null||f[0]===void 0)?this.dateRange=[null,f[1]]:this.dateRange=f:this.dateRange=f,this.loadTraceList()},handleSizeChange(f){this.pageSize=f,this.pageNo=1,this.loadTraceList()},handleCurrentChange(f){this.pageNo=f,this.loadTraceList()},async handleBatchDelete(){var c,g;const f=this.searchQuery&&this.searchQuery.trim(),i=this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2&&this.dateRange[1]!==null||this.dateRange.length===1&&this.dateRange[0]!==null);let s="",l="warning";if(!f&&!i)s=this.$t("trace.deleteAllWarning"),l="error";else{if(s=this.$t("trace.deleteConfirmMessage")+`
|
|
78
|
-
`,f&&(s+=`${this.$t("trace.searchCondition")}: ${this.searchQuery}
|
|
79
|
-
|
|
80
|
-
`}
|
|
81
|
-
|
|
82
|
-
`}s+=this.$t("trace.deleteConfirmFooter")}try{await this.$confirm(s,this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:l,dangerouslyUseHTMLString:!1}),this.deleteLoading=!0;let p=null,w=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(p=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(w=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(w=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10))),await on.deleteTraces(f?this.searchQuery:null,p,w),this.$message.success(this.$t("trace.deleteSuccess")),await this.loadTraceList()}catch(p){if(p!=="cancel"){console.error("Failed to delete traces:",p);const w=((g=(c=p.response)==null?void 0:c.data)==null?void 0:g.message)||p.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${w}`)}}finally{this.deleteLoading=!1}},getStatusType(f){return{OK:"success",ERROR:"danger",IN_PROGRESS:"warning",UNSET:"info"}[f]||"info"},formatDateTime(f){if(!f)return"-";const i=typeof f=="string"?parseInt(f,10):f;if(isNaN(i))return"-";const s=new Date(i);if(isNaN(s.getTime()))return"-";const l=s.getFullYear(),c=String(s.getMonth()+1).padStart(2,"0"),g=String(s.getDate()).padStart(2,"0"),p=String(s.getHours()).padStart(2,"0"),w=String(s.getMinutes()).padStart(2,"0"),b=String(s.getSeconds()).padStart(2,"0");return`${l}-${c}-${g} ${p}:${w}:${b}`},formatTimeAgo(f){if(!f)return"-";const i=typeof f=="string"?parseInt(f,10):f;if(isNaN(i))return"-";const l=Date.now()-i,c=this.$i18n.locale==="zh-CN",g=Math.floor(l/(1e3*60*60*24));if(g>0)return c?`${g} 天前`:`${g} days ago`;const p=Math.floor(l/(1e3*60*60));if(p>0)return c?`${p} 小时前`:`${p} hours ago`;const w=Math.floor(l/(1e3*60));return w>0?c?`${w} 分钟前`:`${w} minutes ago`:c?"刚刚":"Just now"},formatTimestamp(f){if(!f)return"-";const i=typeof f=="string"?parseInt(f,10):f;if(isNaN(i))return"-";const s=new Date(i);return isNaN(s.getTime())?"-":s.toLocaleString("zh-CN")},formatEventTimestamp(f){if(!f)return"-";const i=f/1e6,s=new Date(i);return isNaN(s.getTime())?"-":s.toLocaleString("zh-CN")},getEventAttributesData(f){return!f||!f.attributes?[]:Object.entries(f.attributes).map(([i,s])=>({key:i,value:typeof s=="string"?s:JSON.stringify(s,null,2)}))},getOtherEventAttributes(f){if(!f||!f.attributes)return[];const i=["exception.type","exception.message","exception.stacktrace"];return Object.entries(f.attributes).filter(([s])=>!i.includes(s)).map(([s,l])=>({key:s,value:typeof l=="string"?l:JSON.stringify(l,null,2)}))},formatNanoDuration(f){if(!f)return"-";const i=f/1e6;return i<1e3?`${i.toFixed(2)}ms`:i<6e4?`${(i/1e3).toFixed(2)}s`:`${(i/6e4).toFixed(2)}min`},formatJson(f){return f?JSON.stringify(f,null,2):""},formatRawJson(f){if(!f)return"";if(typeof f=="string")try{const i=JSON.parse(f);return JSON.stringify(i,null,2)}catch{try{const s=f.replace(/\\"/g,'"').replace(/^"|"$/g,""),l=JSON.parse(s);return JSON.stringify(l,null,2)}catch{return f}}return JSON.stringify(f,null,2)},handleCodeMirrorReady(f){this.$nextTick(()=>{f&&f.refresh()})},formatMessageContent(f){return typeof f=="string"?f:JSON.stringify(f,null,2)},formatEventTime(f){if(f.time_unix_nano){const i=f.time_unix_nano/1e6;return new Date(i).toLocaleString("zh-CN")}return f.timestamp?new Date(f.timestamp).toLocaleString("zh-CN"):"-"},getMessageIcon(f){return{user:"el-icon-user",assistant:"el-icon-service",system:"el-icon-setting"}[f]||"el-icon-document"},tableRowClassName({row:f,rowIndex:i}){return"trace-row"},getIndex(f){return(this.pageNo-1)*this.pageSize+f+1},applyColumns(){const f={};this.selectedColumns.forEach(i=>{f[i]=!0}),Object.keys(this.visibleColumns).forEach(i=>{this.selectedColumns.includes(i)||(f[i]=!1)}),this.visibleColumns=f,this.showColumnDialog=!1},extractImagesFromObject(f,i=[],s=""){if(!(!f||typeof f!="object")){for(const[l,c]of Object.entries(f)){const g=s?`${s}.${l}`:l;typeof c=="string"&&c.trim()!==""?(c.startsWith("data:image/")||c.startsWith("/9j/")||c.startsWith("iVBOR")||c.startsWith("R0lGOD"))&&(i.push({path:g,value:c,label:l==="content"&&s?`${s.split(".").pop()}: ${l}`:l}),f[l]="[IMAGE_DATA]"):c&&typeof c=="object"&&!Array.isArray(c)?this.extractImagesFromObject(c,i,g):Array.isArray(c)&&c.forEach((p,w)=>{p&&typeof p=="object"&&this.extractImagesFromObject(p,i,`${g}[${w}]`)})}return i}},renderStructuredContent(f){const i=[];if(!f)return i;try{if(Array.isArray(f))f.forEach((s,l)=>{var c;s&&typeof s=="object"?s.type==="text"&&s.text?i.push({type:"markdown",content:_e(s.text),key:`text-${l}`}):s.type==="image_url"&&((c=s.image_url)!=null&&c.url)?i.push({type:"image",url:s.image_url.url,key:`image-${l}`}):s.image_base64&&s.image_base64.trim()!==""?i.push({type:"image",url:this.formatBase64Image(s.image_base64),key:`base64-image-${l}`}):i.push({type:"markdown",content:_e("```json\n"+JSON.stringify(s,null,2)+"\n```"),key:`json-${l}`}):i.push({type:"markdown",content:_e(String(s)),key:`text-${l}`})});else if(typeof f=="string")i.push({type:"markdown",content:_e(f),key:"text-0"});else if(typeof f=="object")if(f.data&&Array.isArray(f.data.result)){const s=JSON.parse(JSON.stringify(f)),l=[];s.data&&s.data.result&&s.data.result.forEach((c,g)=>{c.image_base64&&c.image_base64.trim()!==""&&(l.push({type:"page",image_base64:c.image_base64,page_num:c.page_num,label:c.page_num!==void 0?`Page ${c.page_num}`:`Result ${g}`}),c.image_base64="[BASE64_IMAGE_DATA]"),c.seals&&Array.isArray(c.seals)&&c.seals.forEach((p,w)=>{p.image_base64&&p.image_base64.trim()!==""&&(l.push({type:"seal",image_base64:p.image_base64,page_num:c.page_num,seal_index:w,seal_value:p.value,label:`Seal: ${p.value||w}`}),p.image_base64="[BASE64_IMAGE_DATA]")})}),i.push({type:"markdown",content:_e("```json\n"+JSON.stringify(s,null,2)+"\n```"),key:"json-0"}),l.forEach((c,g)=>{i.push({type:"image",url:this.formatBase64Image(c.image_base64),key:`result-image-${g}`,label:c.label})})}else{const s=JSON.parse(JSON.stringify(f)),l=[];this.extractImagesFromObject(s,l),i.push({type:"markdown",content:_e("```json\n"+JSON.stringify(s,null,2)+"\n```"),key:"json-0"}),l.forEach((c,g)=>{i.push({type:"image",url:this.formatBase64Image(c.value),key:`extracted-image-${g}`,label:c.label})})}else i.push({type:"markdown",content:_e(String(f)),key:"text-0"})}catch(s){console.error("Error rendering content:",s),i.push({type:"markdown",content:_e("Error rendering content"),key:"error-0"})}return i},formatBase64Image(f){return f?f.startsWith("data:image")?f:f.startsWith("/9j/")?`data:image/jpeg;base64,${f}`:f.startsWith("iVBOR")?`data:image/png;base64,${f}`:f.startsWith("R0lGOD")?`data:image/gif;base64,${f}`:`data:image/jpeg;base64,${f}`:""},handleImageClick(f){rp({options:this.viewerOptions,images:[f]})}}};var ip=function(){var l,c,g,p,w,b;var i=this,s=i._self._c;return s("div",{staticClass:"trace-list-container"},[s("el-card",[s("div",{staticClass:"trace-content-wrapper"},[s("div",{staticClass:"trace-toolbar"},[s("el-input",{staticClass:"toolbar-input",attrs:{placeholder:i.$t("trace.searchPlaceholder"),"prefix-icon":"el-icon-search",clearable:"",size:"mini"},on:{clear:i.handleSearchClear,input:i.handleSearch},model:{value:i.searchQuery,callback:function(y){i.searchQuery=y},expression:"searchQuery"}}),s("el-date-picker",{staticClass:"toolbar-date-picker",attrs:{type:"datetimerange","range-separator":i.$t("trace.to"),"start-placeholder":i.$t("trace.startTime"),"end-placeholder":i.$t("trace.endTime"),"value-format":"timestamp",format:"yyyy-MM-dd HH:mm:ss",size:"mini","picker-options":i.pickerOptions,clearable:""},on:{change:i.handleDateRangeChange},model:{value:i.dateRange,callback:function(y){i.dateRange=y},expression:"dateRange"}}),s("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"mini",disabled:i.deleteLoading},on:{click:i.handleBatchDelete}},[i._v(" "+i._s(i.$t("trace.batchDelete"))+" ")]),s("el-button",{attrs:{icon:"el-icon-refresh",size:"mini",circle:"",title:i.$t("common.refresh")},on:{click:i.refresh}}),s("el-button",{attrs:{icon:"el-icon-setting",size:"mini"},on:{click:function(y){i.showColumnDialog=!0}}},[i._v(" "+i._s(i.$t("common.columns"))+" ")])],1),s("div",{staticClass:"trace-table-wrapper"},[s("el-table",{directives:[{name:"loading",rawName:"v-loading",value:i.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:i.filteredTraceList,size:"mini",stripe:"","row-class-name":i.tableRowClassName},on:{"row-click":i.handleRowClick}},[s("el-table-column",{attrs:{type:"index",label:"#",width:"60",index:i.getIndex}}),i.visibleColumns.trace_id?s("el-table-column",{attrs:{prop:"trace_id",label:i.$t("trace.requestId"),width:"280","show-overflow-tooltip":""},scopedSlots:i._u([{key:"default",fn:function(y){return[s("el-link",{attrs:{type:"primary"},on:{click:function(k){return k.stopPropagation(),i.viewDetail(y.row.trace_id)}}},[i._v(" "+i._s(y.row.trace_id)+" ")])]}}],null,!1,1400187371)}):i._e(),i.visibleColumns.trace_name?s("el-table-column",{attrs:{prop:"trace_name",label:i.$t("trace.traceName"),"min-width":"300","show-overflow-tooltip":""},scopedSlots:i._u([{key:"default",fn:function(y){return[s("span",[i._v(i._s(y.row.trace_name||"-"))])]}}],null,!1,3633653970)}):i._e(),i.visibleColumns.trace_type?s("el-table-column",{attrs:{prop:"trace_type",label:i.$t("trace.traceType"),width:"120"},scopedSlots:i._u([{key:"default",fn:function(y){return[s("el-tag",{attrs:{size:"mini",type:"info"}},[i._v(i._s(y.row.trace_type||"-"))])]}}],null,!1,1175446173)}):i._e(),i.visibleColumns.execution_time_ms?s("el-table-column",{attrs:{prop:"execution_time_ms",label:i.$t("trace.executionTime"),width:"120"},scopedSlots:i._u([{key:"default",fn:function(y){return[i._v(" "+i._s(i.formatNanoDuration(y.row.execution_time_ms))+" ")]}}],null,!1,1733254102)}):i._e(),i.visibleColumns.status?s("el-table-column",{attrs:{prop:"status",label:i.$t("trace.status"),width:"100"},scopedSlots:i._u([{key:"default",fn:function(y){return[s("el-tag",{attrs:{type:i.getStatusType(y.row.status),size:"mini"}},[y.row.status==="OK"?s("i",{staticClass:"el-icon-success"}):i._e(),i._v(" "+i._s(y.row.status)+" ")])]}}],null,!1,3672547022)}):i._e(),i.visibleColumns.timestamp_ms?s("el-table-column",{attrs:{prop:"timestamp_ms",label:i.$t("trace.timeCreated"),width:"180"},scopedSlots:i._u([{key:"default",fn:function(y){return[i._v(" "+i._s(i.formatDateTime(y.row.timestamp_ms))+" ")]}}],null,!1,1082702673)}):i._e(),s("el-table-column",{attrs:{label:i.$t("common.operation"),width:"100",fixed:"right"},scopedSlots:i._u([{key:"default",fn:function(y){return[s("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(k){return k.stopPropagation(),i.viewDetail(y.row.trace_id)}}},[i._v(" "+i._s(i.$t("common.viewDetail"))+" ")])]}}])})],1)],1),s("div",{staticClass:"trace-pagination-wrapper"},[i.total>0?s("el-pagination",{staticClass:"trace-pagination",attrs:{"current-page":i.pageNo,"page-sizes":[10,20,50,100],"page-size":i.pageSize,size:"mini",layout:"total, prev, pager, next, sizes, jumper",total:i.total,background:""},on:{"size-change":i.handleSizeChange,"current-change":i.handleCurrentChange}}):i._e()],1)])]),s("el-dialog",{attrs:{title:i.$t("trace.selectColumns"),visible:i.showColumnDialog,width:"400px"},on:{"update:visible":function(y){i.showColumnDialog=y}}},[s("el-checkbox-group",{model:{value:i.selectedColumns,callback:function(y){i.selectedColumns=y},expression:"selectedColumns"}},[s("el-checkbox",{attrs:{label:"trace_id"}},[i._v(i._s(i.$t("trace.requestId")))]),s("el-checkbox",{attrs:{label:"timestamp_ms"}},[i._v(i._s(i.$t("trace.timeCreated")))]),s("el-checkbox",{attrs:{label:"status"}},[i._v(i._s(i.$t("trace.status")))]),s("el-checkbox",{attrs:{label:"execution_time_ms"}},[i._v(i._s(i.$t("trace.executionTime")))]),s("el-checkbox",{attrs:{label:"trace_type"}},[i._v(i._s(i.$t("trace.traceType")))]),s("el-checkbox",{attrs:{label:"trace_name"}},[i._v(i._s(i.$t("trace.traceName")))])],1),s("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[s("el-button",{attrs:{size:"mini"},on:{click:function(y){i.showColumnDialog=!1}}},[i._v(i._s(i.$t("common.cancel")))]),s("el-button",{attrs:{size:"mini",type:"primary"},on:{click:i.applyColumns}},[i._v(i._s(i.$t("common.confirm")))])],1)],1),s("el-drawer",{attrs:{visible:i.drawerVisible,"with-header":!0,title:i.drawerTitle,size:"90%",direction:"rtl","before-close":i.handleDrawerClose},on:{"update:visible":function(y){i.drawerVisible=y}}},[i.currentTraceId?s("div",{staticClass:"trace-detail-content"},[s("div",{staticClass:"trace-info-section"},[s("el-descriptions",{attrs:{column:3,border:""}},[s("el-descriptions-item",{attrs:{label:i.$t("trace.traceId")}},[i._v(i._s(i.traceInfo.trace_id))]),s("el-descriptions-item",{attrs:{label:i.$t("trace.status")}},[s("el-tag",{attrs:{type:i.getStatusType(i.traceInfo.status),size:"mini"}},[i._v(" "+i._s(i.traceInfo.status)+" ")])],1),s("el-descriptions-item",{attrs:{label:i.$t("trace.executionTime")}},[i._v(" "+i._s(i.formatNanoDuration(i.traceInfo.execution_time_ms))+" ")]),s("el-descriptions-item",{attrs:{label:i.$t("trace.timeCreated")}},[i._v(" "+i._s(i.formatTimestamp(i.traceInfo.timestamp_ms))+" ")]),s("el-descriptions-item",{attrs:{label:i.$t("trace.experimentId")}},[i._v(i._s(i.traceInfo.experiment_id))]),s("el-descriptions-item",{attrs:{label:i.$t("trace.traceType")}},[s("el-tag",{attrs:{size:"mini",type:"info"}},[i._v(i._s(i.traceInfo.trace_type||"-"))])],1),s("el-descriptions-item",{attrs:{label:i.$t("trace.traceName"),span:2}},[i._v(" "+i._s(i.traceInfo.trace_name||"-")+" ")])],1)],1),s("el-divider"),s("el-row",{attrs:{gutter:20}},[s("el-col",{staticClass:"span-tree-col",attrs:{span:8}},[s("el-card",[s("div",{attrs:{slot:"header"},slot:"header"},[s("el-input",{attrs:{placeholder:i.$t("span.searchTree"),"prefix-icon":"el-icon-search",size:"small",clearable:""},on:{input:i.handleSpanSearch},model:{value:i.spanSearchQuery,callback:function(y){i.spanSearchQuery=y},expression:"spanSearchQuery"}})],1),s("TraceSpanTree",{attrs:{spans:i.filteredSpans,"selected-span-id":i.selectedSpanId,"trace-start-time":i.traceStartTime,"trace-end-time":i.traceEndTime},on:{"span-select":i.handleSpanSelect}})],1)],1),s("el-col",{staticClass:"span-detail-col",attrs:{span:16}},[s("el-card",[i.selectedSpan?s("div",{staticClass:"span-detail-content"},[s("el-tabs",{key:`tabs-${i.selectedSpanId}`,model:{value:i.activeTab,callback:function(y){i.activeTab=y},expression:"activeTab"}},[i.selectedSpan.type==="CLIENT"||i.selectedSpan.type==="CHAT_MODEL"?s("el-tab-pane",{attrs:{label:`${i.$t("trace.inputs")} / ${i.$t("trace.outputs")}`,name:"io"}},[s("div",{staticClass:"io-content"},[i.hasInputs?s("div",{staticClass:"io-section"},[s("el-collapse",{model:{value:i.activeCollapse,callback:function(y){i.activeCollapse=y},expression:"activeCollapse"}},[s("el-collapse-item",{attrs:{title:i.$t("trace.inputs"),name:"inputs"}},[(c=(l=i.selectedSpan.parsedContent)==null?void 0:l.inputs)!=null&&c.messages?s("div",{staticClass:"messages-section"},i._l(i.selectedSpan.parsedContent.inputs.messages,function(y,k){return s("div",{key:k,staticClass:"message-item"},[s("el-collapse",{model:{value:i.messageCollapse,callback:function(_){i.messageCollapse=_},expression:"messageCollapse"}},[s("el-collapse-item",{attrs:{name:`message-${k}`}},[s("template",{slot:"title"},[s("i",{staticClass:"message-icon",class:i.getMessageIcon(y.role)}),s("span",{staticClass:"message-role"},[i._v(i._s(y.role))])]),s("div",{staticClass:"message-content"},[s("div",{staticClass:"structured-content"},i._l(i.renderStructuredContent(y.content),function(_){return s("div",{key:_.key,staticClass:"content-element"},[_.type==="markdown"?s("div",{staticClass:"markdown-content",domProps:{innerHTML:i._s(_.content)}}):_.type==="image"?s("div",{staticClass:"image-content"},[_.label?s("div",{staticClass:"image-label"},[i._v(i._s(_.label))]):i._e(),s("img",{staticClass:"content-image",attrs:{src:_.url,alt:"content image"},on:{click:function(L){return i.handleImageClick(_.url)}}})]):i._e()])}),0)])],2)],1)],1)}),0):(g=i.selectedSpan.parsedContent)!=null&&g.inputs?s("div",{staticClass:"structured-content"},i._l(i.renderStructuredContent(i.selectedSpan.parsedContent.inputs),function(y){return s("div",{key:y.key,staticClass:"content-element"},[y.type==="markdown"?s("div",{staticClass:"markdown-content",domProps:{innerHTML:i._s(y.content)}}):y.type==="image"?s("div",{staticClass:"image-content"},[y.label?s("div",{staticClass:"image-label"},[i._v(i._s(y.label))]):i._e(),s("img",{staticClass:"content-image",attrs:{src:y.url,alt:"content image"},on:{click:function(k){return i.handleImageClick(y.url)}}})]):i._e()])}),0):s("div",{staticClass:"empty-content"},[s("el-empty",{attrs:{description:i.$t("trace.noInputs"),"image-size":80}})],1)])],1)],1):i._e(),i.hasOutputs?s("div",{staticClass:"io-section"},[s("el-collapse",{model:{value:i.activeCollapse,callback:function(y){i.activeCollapse=y},expression:"activeCollapse"}},[s("el-collapse-item",{attrs:{title:i.$t("trace.outputs"),name:"outputs"}},[(w=(p=i.selectedSpan.parsedContent)==null?void 0:p.outputs)!=null&&w.choices?s("div",{staticClass:"outputs-section"},i._l(i.selectedSpan.parsedContent.outputs.choices,function(y,k){return s("div",{key:k,staticClass:"choice-item"},[s("div",{staticClass:"choice-header"},[s("span",[i._v("Choice "+i._s(k))])]),s("div",{staticClass:"choice-content"},[y.message?s("div",[s("div",{staticClass:"message-header"},[s("i",{staticClass:"el-icon-user message-icon"}),s("span",[i._v(i._s(y.message.role))])]),s("div",{staticClass:"structured-content"},i._l(i.renderStructuredContent(y.message.content),function(_){return s("div",{key:_.key,staticClass:"content-element"},[_.type==="markdown"?s("div",{staticClass:"markdown-content",domProps:{innerHTML:i._s(_.content)}}):_.type==="image"?s("div",{staticClass:"image-content"},[_.label?s("div",{staticClass:"image-label"},[i._v(i._s(_.label))]):i._e(),s("img",{staticClass:"content-image",attrs:{src:_.url,alt:"content image"},on:{click:function(L){return i.handleImageClick(_.url)}}})]):i._e()])}),0)]):s("div",{staticClass:"structured-content"},i._l(i.renderStructuredContent(y),function(_){return s("div",{key:_.key,staticClass:"content-element"},[_.type==="markdown"?s("div",{staticClass:"markdown-content",domProps:{innerHTML:i._s(_.content)}}):_.type==="image"?s("div",{staticClass:"image-content"},[_.label?s("div",{staticClass:"image-label"},[i._v(i._s(_.label))]):i._e(),s("img",{staticClass:"content-image",attrs:{src:_.url,alt:"content image"},on:{click:function(L){return i.handleImageClick(_.url)}}})]):i._e()])}),0)])])}),0):(b=i.selectedSpan.parsedContent)!=null&&b.outputs?s("div",{staticClass:"structured-content"},i._l(i.renderStructuredContent(i.selectedSpan.parsedContent.outputs),function(y){return s("div",{key:y.key,staticClass:"content-element"},[y.type==="markdown"?s("div",{staticClass:"markdown-content",domProps:{innerHTML:i._s(y.content)}}):y.type==="image"?s("div",{staticClass:"image-content"},[y.label?s("div",{staticClass:"image-label"},[i._v(i._s(y.label))]):i._e(),s("img",{staticClass:"content-image",attrs:{src:y.url,alt:"content image"},on:{click:function(k){return i.handleImageClick(y.url)}}})]):i._e()])}),0):s("div",{staticClass:"empty-content"},[s("el-empty",{attrs:{description:i.$t("trace.noOutputs"),"image-size":80}})],1)])],1)],1):i._e(),!i.hasInputs&&!i.hasOutputs?s("div",{staticClass:"empty-io"},[s("el-empty",{attrs:{description:i.$t("trace.noIoData")}})],1):i._e()])]):i._e(),s("el-tab-pane",{attrs:{label:i.$t("trace.attributes"),name:"attributes"}},[s("el-table",{staticClass:"attributes-table",attrs:{data:i.attributesData,border:"",stripe:""}},[s("el-table-column",{attrs:{prop:"key",label:i.$t("trace.key"),width:"250"},scopedSlots:i._u([{key:"default",fn:function(y){return[s("el-tooltip",{attrs:{content:y.row.key,placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[s("span",{staticClass:"attribute-key"},[i._v(i._s(y.row.key))])])]}}],null,!1,688878823)}),s("el-table-column",{attrs:{prop:"value",label:i.$t("trace.value")},scopedSlots:i._u([{key:"default",fn:function(y){return[s("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[s("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[i._v(i._s(y.row.value))]),s("div",{staticClass:"attribute-value"},[i._v(i._s(y.row.value))])])]}}],null,!1,4281519148)})],1)],1),i.selectedSpan.type==="CLIENT"||i.selectedSpan.type==="CHAT_MODEL"?s("el-tab-pane",{attrs:{label:i.$t("trace.rawInputsOutputs"),name:"raw"}},[i.activeTab==="raw"?s("div",{staticClass:"raw-io-content"},[i.rawInputs?s("div",{staticClass:"raw-io-section"},[s("el-collapse",{model:{value:i.rawIoCollapse,callback:function(y){i.rawIoCollapse=y},expression:"rawIoCollapse"}},[s("el-collapse-item",{attrs:{title:i.$t("trace.rawInputs"),name:"rawInputs"}},[s("codemirror",{key:`raw-inputs-${i.selectedSpanId}-${i.rawInputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:i.formatRawJson(i.rawInputs),options:i.cmOptions}})],1)],1)],1):i._e(),i.rawOutputs?s("div",{staticClass:"raw-io-section"},[s("el-collapse",{model:{value:i.rawIoCollapse,callback:function(y){i.rawIoCollapse=y},expression:"rawIoCollapse"}},[s("el-collapse-item",{attrs:{title:i.$t("trace.rawOutputs"),name:"rawOutputs"}},[s("codemirror",{key:`raw-outputs-${i.selectedSpanId}-${i.rawOutputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:i.formatRawJson(i.rawOutputs),options:i.cmOptions}})],1)],1)],1):i._e(),!i.rawInputs&&!i.rawOutputs?s("div",{staticClass:"empty-raw-io"},[s("el-empty",{attrs:{description:i.$t("trace.noIoData")}})],1):i._e()]):i._e()]):i._e(),i.hasEvents?s("el-tab-pane",{attrs:{label:i.$t("trace.events"),name:"events"}},[i.activeTab==="events"?s("div",{staticClass:"events-content"},[s("el-collapse",{model:{value:i.eventsCollapse,callback:function(y){i.eventsCollapse=y},expression:"eventsCollapse"}},i._l(i.spanEvents,function(y,k){return s("el-collapse-item",{key:`event-${k}`,attrs:{name:`event-${k}`}},[s("template",{slot:"title"},[s("div",{staticClass:"event-header"},[s("el-tag",{staticClass:"event-name-tag",attrs:{type:y.name==="exception"?"danger":"info",size:"mini"}},[i._v(" "+i._s(y.name)+" ")]),s("span",{staticClass:"event-time"},[i._v(i._s(i.formatEventTimestamp(y.timestamp)))])],1)]),s("div",{staticClass:"event-detail"},[y.name==="exception"?s("div",{staticClass:"exception-content"},[y.attributes["exception.type"]?s("div",{staticClass:"exception-field"},[s("div",{staticClass:"field-label"},[i._v(i._s(i.$t("trace.exceptionType")))]),s("div",{staticClass:"field-value exception-type"},[i._v(i._s(y.attributes["exception.type"]))])]):i._e(),y.attributes["exception.message"]?s("div",{staticClass:"exception-field"},[s("div",{staticClass:"field-label"},[i._v(i._s(i.$t("trace.exceptionMessage")))]),s("div",{staticClass:"field-value exception-message"},[i._v(i._s(y.attributes["exception.message"]))])]):i._e(),y.attributes["exception.stacktrace"]?s("div",{staticClass:"exception-field"},[s("div",{staticClass:"field-label"},[i._v(i._s(i.$t("trace.exceptionStacktrace")))]),s("codemirror",{key:`stacktrace-${i.selectedSpanId}-${k}-${i.eventsKey}`,staticClass:"code-editor-wrapper stacktrace-editor",attrs:{value:y.attributes["exception.stacktrace"],options:i.cmOptionsJava}})],1):i._e(),i.getOtherEventAttributes(y).length>0?s("div",{staticClass:"exception-field"},[s("div",{staticClass:"field-label"},[i._v(i._s(i.$t("trace.otherAttributes")))]),s("el-table",{attrs:{data:i.getOtherEventAttributes(y),border:"",stripe:"",size:"mini"}},[s("el-table-column",{attrs:{prop:"key",label:i.$t("trace.key"),width:"200"}}),s("el-table-column",{attrs:{prop:"value",label:i.$t("trace.value")}})],1)],1):i._e()]):s("div",{staticClass:"general-event-content"},[s("el-table",{attrs:{data:i.getEventAttributesData(y),border:"",stripe:"",size:"mini"}},[s("el-table-column",{attrs:{prop:"key",label:i.$t("trace.key"),width:"200"},scopedSlots:i._u([{key:"default",fn:function(_){return[s("el-tooltip",{attrs:{content:_.row.key,placement:"top","open-delay":500}},[s("span",{staticClass:"attribute-key"},[i._v(i._s(_.row.key))])])]}}],null,!0)}),s("el-table-column",{attrs:{prop:"value",label:i.$t("trace.value")},scopedSlots:i._u([{key:"default",fn:function(_){return[s("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[s("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[i._v(i._s(_.row.value))]),s("div",{staticClass:"attribute-value"},[i._v(i._s(_.row.value))])])]}}],null,!0)})],1)],1)])],2)}),1),i.spanEvents.length===0?s("div",{staticClass:"empty-events"},[s("el-empty",{attrs:{description:i.$t("trace.noEvents")}})],1):i._e()],1):i._e()]):i._e()],1)],1):s("el-empty",{attrs:{description:i.$t("trace.selectSpan")}})],1)],1)],1)],1):i._e()])],1)},ap=[],sp=Lo(np,ip,ap,!1,null,"8e982809");const os=sp.exports,El={routes:[{path:"/trace",name:"trace",component:os}],beforeEach:(f,i,s)=>{s()}},Ol={common:{home:"首页",todos:"待办事项",trace:"追踪",login:"登录",logout:"退出",user:"用户",search:"搜索",refresh:"刷新",columns:"列设置",confirm:"确定",cancel:"取消",operation:"操作",viewDetail:"查看详情",language:"语言"},span:{searchTree:"Span名称/Span类型"},trace:{title:"追踪列表",searchPlaceholder:"追踪ID/追踪名称/追踪类型",requestId:"追踪ID",timeCreated:"创建时间",status:"状态",executionTime:"执行时长",traceType:"追踪类型",traceName:"追踪名称",traceDetail:"追踪详情",traceId:"追踪ID",clientRequestId:"客户端请求ID",experimentId:"应用ID",spanDetail:"Span 详情",inputs:"输入",outputs:"输出",attributes:"属性",rawInputsOutputs:"原始输入输出",rawInputs:"原始输入",rawOutputs:"原始输出",events:"事件",selectSpan:"请选择一个 Span 查看详情",noInputs:"暂无输入数据",noOutputs:"暂无输出数据",noIoData:"暂无输入输出数据",noEvents:"暂无事件数据",exceptionType:"异常类型",exceptionMessage:"异常消息",exceptionStacktrace:"异常堆栈",otherAttributes:"其他属性",key:"键",value:"值",selectColumns:"选择列",batchDelete:"批量删除",startTime:"开始时间",endTime:"结束时间",to:"至",confirmDelete:"确认删除",confirmDeleteButton:"确定删除",deleteAllWarning:`警告:您没有设置任何查询条件,这将删除所有 trace 数据!
|
|
77
|
+
*/function th(u,n){if(!(u instanceof n))throw new TypeError("Cannot call a class as a function")}function Mo(u,n){for(var a=0;a<n.length;a++){var o=n[a];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(u,Fo(o.key),o)}}function nh(u,n,a){return n&&Mo(u.prototype,n),a&&Mo(u,a),Object.defineProperty(u,"prototype",{writable:!1}),u}function rh(u,n,a){return(n=Fo(n))in u?Object.defineProperty(u,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):u[n]=a,u}function Ro(u,n){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(u);n&&(o=o.filter(function(f){return Object.getOwnPropertyDescriptor(u,f).enumerable})),a.push.apply(a,o)}return a}function Ga(u){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Ro(Object(a),!0).forEach(function(o){rh(u,o,a[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(a)):Ro(Object(a)).forEach(function(o){Object.defineProperty(u,o,Object.getOwnPropertyDescriptor(a,o))})}return u}function ih(u,n){if(typeof u!="object"||!u)return u;var a=u[Symbol.toPrimitive];if(a!==void 0){var o=a.call(u,n);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(u)}function Fo(u){var n=ih(u,"string");return typeof n=="symbol"?n:n+""}function Ka(u){"@babel/helpers - typeof";return Ka=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Ka(u)}var Po={backdrop:!0,button:!0,navbar:!0,title:!0,toolbar:!0,className:"",container:"body",filter:null,fullscreen:!0,inheritedAttributes:["crossOrigin","decoding","isMap","loading","referrerPolicy","sizes","srcset","useMap"],initialCoverage:.9,initialViewIndex:0,inline:!1,interval:5e3,keyboard:!0,focus:!0,loading:!0,loop:!0,minWidth:200,minHeight:100,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,slideOnTouch:!0,toggleOnDblclick:!0,tooltip:!0,transition:!0,zIndex:2015,zIndexInline:0,zoomRatio:.1,minZoomRatio:.01,maxZoomRatio:100,url:"src",ready:null,show:null,shown:null,hide:null,hidden:null,view:null,viewed:null,move:null,moved:null,rotate:null,rotated:null,scale:null,scaled:null,zoom:null,zoomed:null,play:null,stop:null},ah='<div class="viewer-container" tabindex="-1" touch-action="none"><div class="viewer-canvas"></div><div class="viewer-footer"><div class="viewer-title"></div><div class="viewer-toolbar"></div><div class="viewer-navbar"><ul class="viewer-list" role="navigation"></ul></div></div><div class="viewer-tooltip" role="alert" aria-hidden="true"></div><div class="viewer-button" data-viewer-action="mix" role="button"></div><div class="viewer-player"></div></div>',qi=typeof window<"u"&&typeof window.document<"u",wn=qi?window:{},hr=qi&&wn.document.documentElement?"ontouchstart"in wn.document.documentElement:!1,Xa=qi?"PointerEvent"in wn:!1,Ne="viewer",Gi="move",zo="switch",ei="zoom",Ki="".concat(Ne,"-active"),sh="".concat(Ne,"-close"),Xi="".concat(Ne,"-fade"),Ya="".concat(Ne,"-fixed"),oh="".concat(Ne,"-fullscreen"),$o="".concat(Ne,"-fullscreen-exit"),Vn="".concat(Ne,"-hide"),lh="".concat(Ne,"-hide-md-down"),uh="".concat(Ne,"-hide-sm-down"),fh="".concat(Ne,"-hide-xs-down"),Vt="".concat(Ne,"-in"),ti="".concat(Ne,"-invisible"),dr="".concat(Ne,"-loading"),ch="".concat(Ne,"-move"),Bo="".concat(Ne,"-open"),pr="".concat(Ne,"-show"),at="".concat(Ne,"-transition"),gr="click",Va="dblclick",Ho="dragstart",Wo="focusin",jo="keydown",Jt="load",Jn="error",hh=hr?"touchend touchcancel":"mouseup",dh=hr?"touchmove":"mousemove",ph=hr?"touchstart":"mousedown",Uo=Xa?"pointerdown":ph,qo=Xa?"pointermove":dh,Go=Xa?"pointerup pointercancel":hh,Ko="resize",tn="transitionend",Xo="wheel",Yo="ready",Vo="show",Jo="shown",Qo="hide",Zo="hidden",el="view",ni="viewed",tl="move",nl="moved",rl="rotate",il="rotated",al="scale",sl="scaled",ol="zoom",ll="zoomed",ul="play",fl="stop",Yi="".concat(Ne,"Action"),Ja=/\s\s*/,Vi=["zoom-in","zoom-out","one-to-one","reset","prev","play","next","rotate-left","rotate-right","flip-horizontal","flip-vertical"];function ri(u){return typeof u=="string"}var gh=Number.isNaN||wn.isNaN;function Ze(u){return typeof u=="number"&&!gh(u)}function mr(u){return typeof u>"u"}function vr(u){return Ka(u)==="object"&&u!==null}var mh=Object.prototype.hasOwnProperty;function yr(u){if(!vr(u))return!1;try{var n=u.constructor,a=n.prototype;return n&&a&&mh.call(a,"isPrototypeOf")}catch{return!1}}function qe(u){return typeof u=="function"}function Xe(u,n){if(u&&qe(n))if(Array.isArray(u)||Ze(u.length)){var a=u.length,o;for(o=0;o<a&&n.call(u,u[o],o,u)!==!1;o+=1);}else vr(u)&&Object.keys(u).forEach(function(f){n.call(u,u[f],f,u)});return u}var Ut=Object.assign||function(n){for(var a=arguments.length,o=new Array(a>1?a-1:0),f=1;f<a;f++)o[f-1]=arguments[f];return vr(n)&&o.length>0&&o.forEach(function(d){vr(d)&&Object.keys(d).forEach(function(p){n[p]=d[p]})}),n},vh=/^(?:width|height|left|top|marginLeft|marginTop)$/;function nn(u,n){var a=u.style;Xe(n,function(o,f){vh.test(f)&&Ze(o)&&(o+="px"),a[f]=o})}function yh(u){return ri(u)?u.replace(/&(?!amp;|quot;|#39;|lt;|gt;)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">"):u}function br(u,n){return!u||!n?!1:u.classList?u.classList.contains(n):u.className.indexOf(n)>-1}function Ce(u,n){if(!(!u||!n)){if(Ze(u.length)){Xe(u,function(o){Ce(o,n)});return}if(u.classList){u.classList.add(n);return}var a=u.className.trim();a?a.indexOf(n)<0&&(u.className="".concat(a," ").concat(n)):u.className=n}}function He(u,n){if(!(!u||!n)){if(Ze(u.length)){Xe(u,function(a){He(a,n)});return}if(u.classList){u.classList.remove(n);return}u.className.indexOf(n)>=0&&(u.className=u.className.replace(n,""))}}function ii(u,n,a){if(n){if(Ze(u.length)){Xe(u,function(o){ii(o,n,a)});return}a?Ce(u,n):He(u,n)}}var bh=/([a-z\d])([A-Z])/g;function Qa(u){return u.replace(bh,"$1-$2").toLowerCase()}function xr(u,n){return vr(u[n])?u[n]:u.dataset?u.dataset[n]:u.getAttribute("data-".concat(Qa(n)))}function Za(u,n,a){vr(a)?u[n]=a:u.dataset?u.dataset[n]=a:u.setAttribute("data-".concat(Qa(n)),a)}var cl=function(){var u=!1;if(qi){var n=!1,a=function(){},o=Object.defineProperty({},"once",{get:function(){return u=!0,n},set:function(d){n=d}});wn.addEventListener("test",a,o),wn.removeEventListener("test",a,o)}return u}();function Ge(u,n,a){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},f=a;n.trim().split(Ja).forEach(function(d){if(!cl){var p=u.listeners;p&&p[d]&&p[d][a]&&(f=p[d][a],delete p[d][a],Object.keys(p[d]).length===0&&delete p[d],Object.keys(p).length===0&&delete u.listeners)}u.removeEventListener(d,f,o)})}function Ee(u,n,a){var o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},f=a;n.trim().split(Ja).forEach(function(d){if(o.once&&!cl){var p=u.listeners,y=p===void 0?{}:p;f=function(){delete y[d][a],u.removeEventListener(d,f,o);for(var x=arguments.length,S=new Array(x),A=0;A<x;A++)S[A]=arguments[A];a.apply(u,S)},y[d]||(y[d]={}),y[d][a]&&u.removeEventListener(d,y[d][a],o),y[d][a]=f,u.listeners=y}u.addEventListener(d,f,o)})}function ot(u,n,a,o){var f;return qe(Event)&&qe(CustomEvent)?f=new CustomEvent(n,Ga({bubbles:!0,cancelable:!0,detail:a},o)):(f=document.createEvent("CustomEvent"),f.initCustomEvent(n,!0,!0,a)),u.dispatchEvent(f)}function xh(u){var n=u.getBoundingClientRect();return{left:n.left+(window.pageXOffset-document.documentElement.clientLeft),top:n.top+(window.pageYOffset-document.documentElement.clientTop)}}function Ji(u){var n=u.rotate,a=u.scaleX,o=u.scaleY,f=u.translateX,d=u.translateY,p=[];Ze(f)&&f!==0&&p.push("translateX(".concat(f,"px)")),Ze(d)&&d!==0&&p.push("translateY(".concat(d,"px)")),Ze(n)&&n!==0&&p.push("rotate(".concat(n,"deg)")),Ze(a)&&a!==1&&p.push("scaleX(".concat(a,")")),Ze(o)&&o!==1&&p.push("scaleY(".concat(o,")"));var y=p.length?p.join(" "):"none";return{WebkitTransform:y,msTransform:y,transform:y}}function wh(u){return ri(u)?decodeURIComponent(u.replace(/^.*\//,"").replace(/[?&#].*$/,"")):""}var es=wn.navigator&&/Version\/\d+(\.\d+)+?\s+Safari/i.test(wn.navigator.userAgent);function hl(u,n,a){var o=document.createElement("img");if(u.naturalWidth&&!es)return a(u.naturalWidth,u.naturalHeight),o;var f=document.body||document.documentElement;return o.onload=function(){a(o.width,o.height),es||f.removeChild(o)},Xe(n.inheritedAttributes,function(d){var p=u.getAttribute(d);p!==null&&o.setAttribute(d,p)}),o.src=u.src,es||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",f.appendChild(o)),o}function Qi(u){switch(u){case 2:return fh;case 3:return uh;case 4:return lh;default:return""}}function kh(u){var n=Ga({},u),a=[];return Xe(u,function(o,f){delete n[f],Xe(n,function(d){var p=Math.abs(o.startX-d.startX),y=Math.abs(o.startY-d.startY),m=Math.abs(o.endX-d.endX),x=Math.abs(o.endY-d.endY),S=Math.sqrt(p*p+y*y),A=Math.sqrt(m*m+x*x),E=(A-S)/S;a.push(E)})}),a.sort(function(o,f){return Math.abs(o)<Math.abs(f)}),a[0]}function Zi(u,n){var a=u.pageX,o=u.pageY,f={endX:a,endY:o};return n?f:Ga({timeStamp:Date.now(),startX:a,startY:o},f)}function Sh(u){var n=0,a=0,o=0;return Xe(u,function(f){var d=f.startX,p=f.startY;n+=d,a+=p,o+=1}),n/=o,a/=o,{pageX:n,pageY:a}}var Ch={render:function(){this.initContainer(),this.initViewer(),this.initList(),this.renderViewer()},initBody:function(){var n=this.element.ownerDocument,a=n.body||n.documentElement;this.body=a,this.scrollbarWidth=window.innerWidth-n.documentElement.clientWidth,this.initialBodyPaddingRight=a.style.paddingRight,this.initialBodyComputedPaddingRight=window.getComputedStyle(a).paddingRight},initContainer:function(){this.containerData={width:window.innerWidth,height:window.innerHeight}},initViewer:function(){var n=this.options,a=this.parent,o;n.inline&&(o={width:Math.max(a.offsetWidth,n.minWidth),height:Math.max(a.offsetHeight,n.minHeight)},this.parentData=o),(this.fulled||!o)&&(o=this.containerData),this.viewerData=Ut({},o)},renderViewer:function(){this.options.inline&&!this.fulled&&nn(this.viewer,this.viewerData)},initList:function(){var n=this,a=this.element,o=this.options,f=this.list,d=[];f.innerHTML="",Xe(this.images,function(p,y){var m=p.src,x=p.alt||wh(m),S=n.getImageURL(p);if(m||S){var A=document.createElement("li"),E=document.createElement("img");Xe(o.inheritedAttributes,function(W){var B=p.getAttribute(W);B!==null&&E.setAttribute(W,B)}),o.navbar&&(E.src=m||S),E.alt=x,E.setAttribute("data-original-url",S||m),A.setAttribute("data-index",y),A.setAttribute("data-viewer-action","view"),A.setAttribute("role","button"),o.keyboard&&A.setAttribute("tabindex",0),A.appendChild(E),f.appendChild(A),d.push(A)}}),this.items=d,Xe(d,function(p){var y=p.firstElementChild,m,x;Za(y,"filled",!0),o.loading&&Ce(p,dr),Ee(y,Jt,m=function(A){Ge(y,Jn,x),o.loading&&He(p,dr),n.loadImage(A)},{once:!0}),Ee(y,Jn,x=function(){Ge(y,Jt,m),o.loading&&He(p,dr)},{once:!0})}),o.transition&&Ee(a,ni,function(){Ce(f,at)},{once:!0})},renderList:function(){var n=this.index,a=this.items[n];if(a){var o=a.nextElementSibling,f=parseInt(window.getComputedStyle(o||a).marginLeft,10),d=a.offsetWidth,p=d+f;nn(this.list,Ut({width:p*this.length-f},Ji({translateX:(this.viewerData.width-d)/2-p*n})))}},resetList:function(){var n=this.list;n.innerHTML="",He(n,at),nn(n,Ji({translateX:0}))},initImage:function(n){var a=this,o=this.options,f=this.image,d=this.viewerData,p=this.footer.offsetHeight,y=d.width,m=Math.max(d.height-p,p),x=this.imageData||{},S;this.imageInitializing={abort:function(){S.onload=null}},S=hl(f,o,function(A,E){var W=A/E,B=Math.max(0,Math.min(1,o.initialCoverage)),q=y,F=m;a.imageInitializing=!1,m*W>y?F=y/W:q=m*W,B=Ze(B)?B:.9,q=Math.min(q*B,A),F=Math.min(F*B,E);var N=(y-q)/2,O=(m-F)/2,$={left:N,top:O,x:N,y:O,width:q,height:F,oldRatio:1,ratio:q/A,aspectRatio:W,naturalWidth:A,naturalHeight:E},X=Ut({},$);o.rotatable&&($.rotate=x.rotate||0,X.rotate=0),o.scalable&&($.scaleX=x.scaleX||1,$.scaleY=x.scaleY||1,X.scaleX=1,X.scaleY=1),a.imageData=$,a.initialImageData=X,n&&n()})},renderImage:function(n){var a=this,o=this.image,f=this.imageData;if(nn(o,Ut({width:f.width,height:f.height,marginLeft:f.x,marginTop:f.y},Ji(f))),n)if((this.viewing||this.moving||this.rotating||this.scaling||this.zooming)&&this.options.transition&&br(o,at)){var d=function(){a.imageRendering=!1,n()};this.imageRendering={abort:function(){Ge(o,tn,d)}},Ee(o,tn,d,{once:!0})}else n()},resetImage:function(){var n=this.image;n&&(this.viewing&&this.viewing.abort(),n.parentNode.removeChild(n),this.image=null,this.title.innerHTML="")}},Th={bind:function(){var n=this.options,a=this.viewer,o=this.canvas,f=this.element.ownerDocument;Ee(a,gr,this.onClick=this.click.bind(this)),Ee(a,Ho,this.onDragStart=this.dragstart.bind(this)),Ee(o,Uo,this.onPointerDown=this.pointerdown.bind(this)),Ee(f,qo,this.onPointerMove=this.pointermove.bind(this)),Ee(f,Go,this.onPointerUp=this.pointerup.bind(this)),Ee(f,jo,this.onKeyDown=this.keydown.bind(this)),Ee(window,Ko,this.onResize=this.resize.bind(this)),n.zoomable&&n.zoomOnWheel&&Ee(a,Xo,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),n.toggleOnDblclick&&Ee(o,Va,this.onDblclick=this.dblclick.bind(this))},unbind:function(){var n=this.options,a=this.viewer,o=this.canvas,f=this.element.ownerDocument;Ge(a,gr,this.onClick),Ge(a,Ho,this.onDragStart),Ge(o,Uo,this.onPointerDown),Ge(f,qo,this.onPointerMove),Ge(f,Go,this.onPointerUp),Ge(f,jo,this.onKeyDown),Ge(window,Ko,this.onResize),n.zoomable&&n.zoomOnWheel&&Ge(a,Xo,this.onWheel,{passive:!1,capture:!0}),n.toggleOnDblclick&&Ge(o,Va,this.onDblclick)}},_h={click:function(n){var a=this.options,o=this.imageData,f=n.target,d=xr(f,Yi);switch(!d&&f.localName==="img"&&f.parentElement.localName==="li"&&(f=f.parentElement,d=xr(f,Yi)),hr&&n.isTrusted&&f===this.canvas&&clearTimeout(this.clickCanvasTimeout),d){case"mix":this.played?this.stop():a.inline?this.fulled?this.exit():this.full():this.hide();break;case"hide":this.pointerMoved||this.hide();break;case"view":this.view(xr(f,"index"));break;case"zoom-in":this.zoom(.1,!0);break;case"zoom-out":this.zoom(-.1,!0);break;case"one-to-one":this.toggle();break;case"reset":this.reset();break;case"prev":this.prev(a.loop);break;case"play":this.play(a.fullscreen);break;case"next":this.next(a.loop);break;case"rotate-left":this.rotate(-90);break;case"rotate-right":this.rotate(90);break;case"flip-horizontal":this.scaleX(-o.scaleX||-1);break;case"flip-vertical":this.scaleY(-o.scaleY||-1);break;default:this.played&&this.stop()}},dblclick:function(n){n.preventDefault(),this.viewed&&n.target===this.image&&(hr&&n.isTrusted&&clearTimeout(this.doubleClickImageTimeout),this.toggle(n.isTrusted?n:n.detail&&n.detail.originalEvent))},load:function(){var n=this;this.timeout&&(clearTimeout(this.timeout),this.timeout=!1);var a=this.element,o=this.options,f=this.image,d=this.index,p=this.viewerData;He(f,ti),o.loading&&He(this.canvas,dr),f.style.cssText="height:0;"+"margin-left:".concat(p.width/2,"px;")+"margin-top:".concat(p.height/2,"px;")+"max-width:none!important;position:relative;width:0;",this.initImage(function(){ii(f,ch,o.movable),ii(f,at,o.transition),n.renderImage(function(){n.viewed=!0,n.viewing=!1,qe(o.viewed)&&Ee(a,ni,o.viewed,{once:!0}),ot(a,ni,{originalImage:n.images[d],index:d,image:f},{cancelable:!1})})})},loadImage:function(n){var a=n.target,o=a.parentNode,f=o.offsetWidth||30,d=o.offsetHeight||50,p=!!xr(a,"filled");hl(a,this.options,function(y,m){var x=y/m,S=f,A=d;d*x>f?p?S=d*x:A=f/x:p?A=f/x:S=d*x,nn(a,Ut({width:S,height:A},Ji({translateX:(f-S)/2,translateY:(d-A)/2})))})},keydown:function(n){var a=this.options;if(a.keyboard){var o=n.keyCode||n.which||n.charCode;switch(o){case 13:this.viewer.contains(n.target)&&this.click(n);break}if(this.fulled)switch(o){case 27:this.played?this.stop():a.inline?this.fulled&&this.exit():this.hide();break;case 32:this.played&&this.stop();break;case 37:this.played&&this.playing?this.playing.prev():this.prev(a.loop);break;case 38:n.preventDefault(),this.zoom(a.zoomRatio,!0);break;case 39:this.played&&this.playing?this.playing.next():this.next(a.loop);break;case 40:n.preventDefault(),this.zoom(-a.zoomRatio,!0);break;case 48:case 49:n.ctrlKey&&(n.preventDefault(),this.toggle());break}}},dragstart:function(n){n.target.localName==="img"&&n.preventDefault()},pointerdown:function(n){var a=this.options,o=this.pointers,f=n.buttons,d=n.button;if(this.pointerMoved=!1,!(!this.viewed||this.showing||this.viewing||this.hiding||(n.type==="mousedown"||n.type==="pointerdown"&&n.pointerType==="mouse")&&(Ze(f)&&f!==1||Ze(d)&&d!==0||n.ctrlKey))){n.preventDefault(),n.changedTouches?Xe(n.changedTouches,function(y){o[y.identifier]=Zi(y)}):o[n.pointerId||0]=Zi(n);var p=a.movable?Gi:!1;a.zoomOnTouch&&a.zoomable&&Object.keys(o).length>1?p=ei:a.slideOnTouch&&(n.pointerType==="touch"||n.type==="touchstart")&&this.isSwitchable()&&(p=zo),a.transition&&(p===Gi||p===ei)&&He(this.image,at),this.action=p}},pointermove:function(n){var a=this.pointers,o=this.action;!this.viewed||!o||(n.preventDefault(),n.changedTouches?Xe(n.changedTouches,function(f){Ut(a[f.identifier]||{},Zi(f,!0))}):Ut(a[n.pointerId||0]||{},Zi(n,!0)),this.change(n))},pointerup:function(n){var a=this,o=this.options,f=this.action,d=this.pointers,p;n.changedTouches?Xe(n.changedTouches,function(y){p=d[y.identifier],delete d[y.identifier]}):(p=d[n.pointerId||0],delete d[n.pointerId||0]),f&&(n.preventDefault(),o.transition&&(f===Gi||f===ei)&&Ce(this.image,at),this.action=!1,hr&&f!==ei&&p&&Date.now()-p.timeStamp<500&&(clearTimeout(this.clickCanvasTimeout),clearTimeout(this.doubleClickImageTimeout),o.toggleOnDblclick&&this.viewed&&n.target===this.image?this.imageClicked?(this.imageClicked=!1,this.doubleClickImageTimeout=setTimeout(function(){ot(a.image,Va,{originalEvent:n})},50)):(this.imageClicked=!0,this.doubleClickImageTimeout=setTimeout(function(){a.imageClicked=!1},500)):(this.imageClicked=!1,o.backdrop&&o.backdrop!=="static"&&n.target===this.canvas&&(this.clickCanvasTimeout=setTimeout(function(){ot(a.canvas,gr,{originalEvent:n})},50)))))},resize:function(){var n=this;if(!(!this.isShown||this.hiding)&&(this.fulled&&(this.close(),this.initBody(),this.open()),this.initContainer(),this.initViewer(),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage()}),this.played)){if(this.options.fullscreen&&this.fulled&&!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)){this.stop();return}Xe(this.player.getElementsByTagName("img"),function(a){Ee(a,Jt,n.loadImage.bind(n),{once:!0}),ot(a,Jt)})}},wheel:function(n){var a=this;if(this.viewed&&(n.preventDefault(),!this.wheeling)){this.wheeling=!0,setTimeout(function(){a.wheeling=!1},50);var o=Number(this.options.zoomRatio)||.1,f=1;n.deltaY?f=n.deltaY>0?1:-1:n.wheelDelta?f=-n.wheelDelta/120:n.detail&&(f=n.detail>0?1:-1),this.zoom(-f*o,!0,null,n)}}},Lh={show:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=this.element,o=this.options;if(o.inline||this.showing||this.isShown||this.showing)return this;if(!this.ready)return this.build(),this.ready&&this.show(n),this;if(qe(o.show)&&Ee(a,Vo,o.show,{once:!0}),ot(a,Vo)===!1||!this.ready)return this;this.hiding&&this.transitioning.abort(),this.showing=!0,this.open();var f=this.viewer;if(He(f,Vn),f.setAttribute("role","dialog"),f.setAttribute("aria-labelledby",this.title.id),f.setAttribute("aria-modal",!0),f.removeAttribute("aria-hidden"),o.transition&&!n){var d=this.shown.bind(this);this.transitioning={abort:function(){Ge(f,tn,d),He(f,Vt)}},Ce(f,at),f.initialOffsetWidth=f.offsetWidth,Ee(f,tn,d,{once:!0}),Ce(f,Vt)}else Ce(f,Vt),this.shown();return this},hide:function(){var n=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,o=this.element,f=this.options;if(f.inline||this.hiding||!(this.isShown||this.showing))return this;if(qe(f.hide)&&Ee(o,Qo,f.hide,{once:!0}),ot(o,Qo)===!1)return this;this.showing&&this.transitioning.abort(),this.hiding=!0,this.played?this.stop():this.viewing&&this.viewing.abort();var d=this.viewer,p=this.image,y=function(){He(d,Vt),n.hidden()};if(f.transition&&!a){var m=function(A){A&&A.target===d&&(Ge(d,tn,m),n.hidden())},x=function(){br(d,at)?(Ee(d,tn,m),He(d,Vt)):y()};this.transitioning={abort:function(){n.viewed&&br(p,at)?Ge(p,tn,x):br(d,at)&&Ge(d,tn,m)}},this.viewed&&br(p,at)?(Ee(p,tn,x,{once:!0}),this.zoomTo(0,!1,null,null,!0)):x()}else y();return this},view:function(){var n=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.initialViewIndex;if(a=Number(a)||0,this.hiding||this.played||a<0||a>=this.length||this.viewed&&a===this.index)return this;if(!this.isShown)return this.index=a,this.show();this.viewing&&this.viewing.abort();var o=this.element,f=this.options,d=this.title,p=this.canvas,y=this.items[a],m=y.querySelector("img"),x=xr(m,"originalUrl"),S=m.getAttribute("alt"),A=document.createElement("img");if(Xe(f.inheritedAttributes,function(F){var N=m.getAttribute(F);N!==null&&A.setAttribute(F,N)}),A.src=x,A.alt=S,qe(f.view)&&Ee(o,el,f.view,{once:!0}),ot(o,el,{originalImage:this.images[a],index:a,image:A})===!1||!this.isShown||this.hiding||this.played)return this;var E=this.items[this.index];E&&(He(E,Ki),E.removeAttribute("aria-selected")),Ce(y,Ki),y.setAttribute("aria-selected",!0),f.focus&&y.focus(),this.image=A,this.viewed=!1,this.index=a,this.imageData={},Ce(A,ti),f.loading&&Ce(p,dr),p.innerHTML="",p.appendChild(A),this.renderList(),d.innerHTML="";var W=function(){var N=n.imageData,O=Array.isArray(f.title)?f.title[1]:f.title;d.innerHTML=yh(qe(O)?O.call(n,A,N):"".concat(S," (").concat(N.naturalWidth," × ").concat(N.naturalHeight,")"))},B,q;return Ee(o,ni,W,{once:!0}),this.viewing={abort:function(){Ge(o,ni,W),A.complete?n.imageRendering?n.imageRendering.abort():n.imageInitializing&&n.imageInitializing.abort():(A.src="",Ge(A,Jt,B),n.timeout&&clearTimeout(n.timeout))}},A.complete?this.load():(Ee(A,Jt,B=function(){Ge(A,Jn,q),n.load()},{once:!0}),Ee(A,Jn,q=function(){Ge(A,Jt,B),n.timeout&&(clearTimeout(n.timeout),n.timeout=!1),He(A,ti),f.loading&&He(n.canvas,dr)},{once:!0}),this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(function(){He(A,ti),n.timeout=!1},1e3)),this},prev:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=this.index-1;return a<0&&(a=n?this.length-1:0),this.view(a),this},next:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=this.length-1,o=this.index+1;return o>a&&(o=n?0:a),this.view(o),this},move:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,o=this.imageData;return this.moveTo(mr(n)?n:o.x+Number(n),mr(a)?a:o.y+Number(a)),this},moveTo:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,d=this.element,p=this.options,y=this.imageData;if(n=Number(n),o=Number(o),this.viewed&&!this.played&&p.movable){var m=y.x,x=y.y,S=!1;if(Ze(n)?S=!0:n=m,Ze(o)?S=!0:o=x,S){if(qe(p.move)&&Ee(d,tl,p.move,{once:!0}),ot(d,tl,{x:n,y:o,oldX:m,oldY:x,originalEvent:f})===!1)return this;y.x=n,y.y=o,y.left=n,y.top=o,this.moving=!0,this.renderImage(function(){a.moving=!1,qe(p.moved)&&Ee(d,nl,p.moved,{once:!0}),ot(d,nl,{x:n,y:o,oldX:m,oldY:x,originalEvent:f},{cancelable:!1})})}}return this},rotate:function(n){return this.rotateTo((this.imageData.rotate||0)+Number(n)),this},rotateTo:function(n){var a=this,o=this.element,f=this.options,d=this.imageData;if(n=Number(n),Ze(n)&&this.viewed&&!this.played&&f.rotatable){var p=d.rotate;if(qe(f.rotate)&&Ee(o,rl,f.rotate,{once:!0}),ot(o,rl,{degree:n,oldDegree:p})===!1)return this;d.rotate=n,this.rotating=!0,this.renderImage(function(){a.rotating=!1,qe(f.rotated)&&Ee(o,il,f.rotated,{once:!0}),ot(o,il,{degree:n,oldDegree:p},{cancelable:!1})})}return this},scaleX:function(n){return this.scale(n,this.imageData.scaleY),this},scaleY:function(n){return this.scale(this.imageData.scaleX,n),this},scale:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:n,f=this.element,d=this.options,p=this.imageData;if(n=Number(n),o=Number(o),this.viewed&&!this.played&&d.scalable){var y=p.scaleX,m=p.scaleY,x=!1;if(Ze(n)?x=!0:n=y,Ze(o)?x=!0:o=m,x){if(qe(d.scale)&&Ee(f,al,d.scale,{once:!0}),ot(f,al,{scaleX:n,scaleY:o,oldScaleX:y,oldScaleY:m})===!1)return this;p.scaleX=n,p.scaleY=o,this.scaling=!0,this.renderImage(function(){a.scaling=!1,qe(d.scaled)&&Ee(f,sl,d.scaled,{once:!0}),ot(f,sl,{scaleX:n,scaleY:o,oldScaleX:y,oldScaleY:m},{cancelable:!1})})}}return this},zoom:function(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,f=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,d=this.imageData;return n=Number(n),n<0?n=1/(1-n):n=1+n,this.zoomTo(d.width*n/d.naturalWidth,a,o,f),this},zoomTo:function(n){var a=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,d=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null,p=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1,y=this.element,m=this.options,x=this.pointers,S=this.imageData,A=S.x,E=S.y,W=S.width,B=S.height,q=S.naturalWidth,F=S.naturalHeight;if(n=Math.max(0,n),Ze(n)&&this.viewed&&!this.played&&(p||m.zoomable)){if(!p){var N=Math.max(.01,m.minZoomRatio),O=Math.min(100,m.maxZoomRatio);n=Math.min(Math.max(n,N),O)}if(d)switch(d.type){case"wheel":m.zoomRatio>=.055&&n>.95&&n<1.05&&(n=1);break;case"pointermove":case"touchmove":case"mousemove":n>.99&&n<1.01&&(n=1);break}var $=q*n,X=F*n,ne=$-W,ue=X-B,se=S.ratio;if(qe(m.zoom)&&Ee(y,ol,m.zoom,{once:!0}),ot(y,ol,{ratio:n,oldRatio:se,originalEvent:d})===!1)return this;if(this.zooming=!0,d){var he=xh(this.viewer),Oe=x&&Object.keys(x).length>0?Sh(x):{pageX:d.pageX,pageY:d.pageY};S.x-=ne*((Oe.pageX-he.left-A)/W),S.y-=ue*((Oe.pageY-he.top-E)/B)}else yr(f)&&Ze(f.x)&&Ze(f.y)?(S.x-=ne*((f.x-A)/W),S.y-=ue*((f.y-E)/B)):(S.x-=ne/2,S.y-=ue/2);S.left=S.x,S.top=S.y,S.width=$,S.height=X,S.oldRatio=se,S.ratio=n,this.renderImage(function(){a.zooming=!1,qe(m.zoomed)&&Ee(y,ll,m.zoomed,{once:!0}),ot(y,ll,{ratio:n,oldRatio:se,originalEvent:d},{cancelable:!1})}),o&&this.tooltip()}return this},play:function(){var n=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(!this.isShown||this.played)return this;var o=this.element,f=this.options;if(qe(f.play)&&Ee(o,ul,f.play,{once:!0}),ot(o,ul)===!1)return this;var d=this.player,p=this.loadImage.bind(this),y=[],m=0,x=0;if(this.played=!0,this.onLoadWhenPlay=p,a&&this.requestFullscreen(a),Ce(d,pr),Xe(this.items,function(E,W){var B=E.querySelector("img"),q=document.createElement("img");q.src=xr(B,"originalUrl"),q.alt=B.getAttribute("alt"),q.referrerPolicy=B.referrerPolicy,m+=1,Ce(q,Xi),ii(q,at,f.transition),br(E,Ki)&&(Ce(q,Vt),x=W),y.push(q),Ee(q,Jt,p,{once:!0}),d.appendChild(q)}),Ze(f.interval)&&f.interval>0){var S=function(){clearTimeout(n.playing.timeout),He(y[x],Vt),x-=1,x=x>=0?x:m-1,Ce(y[x],Vt),n.playing.timeout=setTimeout(S,f.interval)},A=function(){clearTimeout(n.playing.timeout),He(y[x],Vt),x+=1,x=x<m?x:0,Ce(y[x],Vt),n.playing.timeout=setTimeout(A,f.interval)};m>1&&(this.playing={prev:S,next:A,timeout:setTimeout(A,f.interval)})}return this},stop:function(){var n=this;if(!this.played)return this;var a=this.element,o=this.options;if(qe(o.stop)&&Ee(a,fl,o.stop,{once:!0}),ot(a,fl)===!1)return this;var f=this.player;return clearTimeout(this.playing.timeout),this.playing=!1,this.played=!1,Xe(f.getElementsByTagName("img"),function(d){Ge(d,Jt,n.onLoadWhenPlay)}),He(f,pr),f.innerHTML="",this.exitFullscreen(),this},full:function(){var n=this,a=this.options,o=this.viewer,f=this.image,d=this.list;return!this.isShown||this.played||this.fulled||!a.inline?this:(this.fulled=!0,this.open(),Ce(this.button,$o),a.transition&&(He(d,at),this.viewed&&He(f,at)),Ce(o,Ya),o.setAttribute("role","dialog"),o.setAttribute("aria-labelledby",this.title.id),o.setAttribute("aria-modal",!0),o.removeAttribute("style"),nn(o,{zIndex:a.zIndex}),a.focus&&this.enforceFocus(),this.initContainer(),this.viewerData=Ut({},this.containerData),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage(function(){a.transition&&setTimeout(function(){Ce(f,at),Ce(d,at)},0)})}),this)},exit:function(){var n=this,a=this.options,o=this.viewer,f=this.image,d=this.list;return!this.isShown||this.played||!this.fulled||!a.inline?this:(this.fulled=!1,this.close(),He(this.button,$o),a.transition&&(He(d,at),this.viewed&&He(f,at)),a.focus&&this.clearEnforceFocus(),o.removeAttribute("role"),o.removeAttribute("aria-labelledby"),o.removeAttribute("aria-modal"),He(o,Ya),nn(o,{zIndex:a.zIndexInline}),this.viewerData=Ut({},this.parentData),this.renderViewer(),this.renderList(),this.viewed&&this.initImage(function(){n.renderImage(function(){a.transition&&setTimeout(function(){Ce(f,at),Ce(d,at)},0)})}),this)},tooltip:function(){var n=this,a=this.options,o=this.tooltipBox,f=this.imageData;return!this.viewed||this.played||!a.tooltip?this:(o.textContent="".concat(Math.round(f.ratio*100),"%"),this.tooltipping?clearTimeout(this.tooltipping):a.transition?(this.fading&&ot(o,tn),Ce(o,pr),Ce(o,Xi),Ce(o,at),o.removeAttribute("aria-hidden"),o.initialOffsetWidth=o.offsetWidth,Ce(o,Vt)):(Ce(o,pr),o.removeAttribute("aria-hidden")),this.tooltipping=setTimeout(function(){a.transition?(Ee(o,tn,function(){He(o,pr),He(o,Xi),He(o,at),o.setAttribute("aria-hidden",!0),n.fading=!1},{once:!0}),He(o,Vt),n.fading=!0):(He(o,pr),o.setAttribute("aria-hidden",!0)),n.tooltipping=!1},1e3),this)},toggle:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return this.imageData.ratio===1?this.zoomTo(this.imageData.oldRatio,!0,null,n):this.zoomTo(1,!0,null,n),this},reset:function(){return this.viewed&&!this.played&&(this.imageData=Ut({},this.initialImageData),this.renderImage()),this},update:function(){var n=this,a=this.element,o=this.options,f=this.isImg;if(f&&!a.parentNode)return this.destroy();var d=[];if(Xe(f?[a]:a.querySelectorAll("img"),function(x){qe(o.filter)?o.filter.call(n,x)&&d.push(x):n.getImageURL(x)&&d.push(x)}),!d.length)return this;if(this.images=d,this.length=d.length,this.ready){var p=[];if(Xe(this.items,function(x,S){var A=x.querySelector("img"),E=d[S];E&&A?(E.src!==A.src||E.alt!==A.alt)&&p.push(S):p.push(S)}),nn(this.list,{width:"auto"}),this.initList(),this.isShown)if(this.length){if(this.viewed){var y=p.indexOf(this.index);if(y>=0)this.viewed=!1,this.view(Math.max(Math.min(this.index-y,this.length-1),0));else{var m=this.items[this.index];Ce(m,Ki),m.setAttribute("aria-selected",!0)}}}else this.image=null,this.viewed=!1,this.index=0,this.imageData={},this.canvas.innerHTML="",this.title.innerHTML=""}else this.build();return this},destroy:function(){var n=this.element,a=this.options;return n[Ne]?(this.destroyed=!0,this.ready?(this.played&&this.stop(),a.inline?(this.fulled&&this.exit(),this.unbind()):this.isShown?(this.viewing&&(this.imageRendering?this.imageRendering.abort():this.imageInitializing&&this.imageInitializing.abort()),this.hiding&&this.transitioning.abort(),this.hidden()):this.showing&&(this.transitioning.abort(),this.hidden()),this.ready=!1,this.viewer.parentNode.removeChild(this.viewer)):a.inline&&(this.delaying?this.delaying.abort():this.initializing&&this.initializing.abort()),a.inline||Ge(n,gr,this.onStart),n[Ne]=void 0,this):this}},Eh={getImageURL:function(n){var a=this.options.url;return ri(a)?a=n.getAttribute(a):qe(a)?a=a.call(this,n):a="",a},enforceFocus:function(){var n=this;this.clearEnforceFocus(),Ee(document,Wo,this.onFocusin=function(a){var o=n.viewer,f=a.target;if(!(f===document||f===o||o.contains(f))){for(;f;){if(f.getAttribute("tabindex")!==null||f.getAttribute("aria-modal")==="true")return;f=f.parentElement}o.focus()}})},clearEnforceFocus:function(){this.onFocusin&&(Ge(document,Wo,this.onFocusin),this.onFocusin=null)},open:function(){var n=this.body;Ce(n,Bo),this.scrollbarWidth>0&&(n.style.paddingRight="".concat(this.scrollbarWidth+(parseFloat(this.initialBodyComputedPaddingRight)||0),"px"))},close:function(){var n=this.body;He(n,Bo),this.scrollbarWidth>0&&(n.style.paddingRight=this.initialBodyPaddingRight)},shown:function(){var n=this.element,a=this.options,o=this.viewer;this.fulled=!0,this.isShown=!0,this.render(),this.bind(),this.showing=!1,a.focus&&(o.focus(),this.enforceFocus()),qe(a.shown)&&Ee(n,Jo,a.shown,{once:!0}),ot(n,Jo)!==!1&&this.ready&&this.isShown&&!this.hiding&&this.view(this.index)},hidden:function(){var n=this.element,a=this.options,o=this.viewer;a.fucus&&this.clearEnforceFocus(),this.close(),this.unbind(),Ce(o,Vn),o.removeAttribute("role"),o.removeAttribute("aria-labelledby"),o.removeAttribute("aria-modal"),o.setAttribute("aria-hidden",!0),this.resetList(),this.resetImage(),this.fulled=!1,this.viewed=!1,this.isShown=!1,this.hiding=!1,this.destroyed||(qe(a.hidden)&&Ee(n,Zo,a.hidden,{once:!0}),ot(n,Zo,null,{cancelable:!1}))},requestFullscreen:function(n){var a=this.element.ownerDocument;if(this.fulled&&!(a.fullscreenElement||a.webkitFullscreenElement||a.mozFullScreenElement||a.msFullscreenElement)){var o=a.documentElement;o.requestFullscreen?yr(n)?o.requestFullscreen(n):o.requestFullscreen():o.webkitRequestFullscreen?o.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):o.mozRequestFullScreen?o.mozRequestFullScreen():o.msRequestFullscreen&&o.msRequestFullscreen()}},exitFullscreen:function(){var n=this.element.ownerDocument;this.fulled&&(n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement)&&(n.exitFullscreen?n.exitFullscreen():n.webkitExitFullscreen?n.webkitExitFullscreen():n.mozCancelFullScreen?n.mozCancelFullScreen():n.msExitFullscreen&&n.msExitFullscreen())},change:function(n){var a=this.options,o=this.pointers,f=o[Object.keys(o)[0]];if(f){var d=f.endX-f.startX,p=f.endY-f.startY;switch(this.action){case Gi:(d!==0||p!==0)&&(this.pointerMoved=!0,this.move(d,p,n));break;case ei:this.zoom(kh(o),!1,null,n);break;case zo:{this.action="switched";var y=Math.abs(d);y>1&&y>Math.abs(p)&&(this.pointers={},d>1?this.prev(a.loop):d<-1&&this.next(a.loop));break}}Xe(o,function(m){m.startX=m.endX,m.startY=m.endY})}},isSwitchable:function(){var n=this.imageData,a=this.viewerData;return this.length>1&&n.x>=0&&n.y>=0&&n.width<=a.width&&n.height<=a.height}},Dh=wn.Viewer,Ah=function(u){return function(){return u+=1,u}}(-1),dl=function(){function u(n){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(th(this,u),!n||n.nodeType!==1)throw new Error("The first argument is required and must be an element.");this.element=n,this.options=Ut({},Po,yr(a)&&a),this.action=!1,this.fading=!1,this.fulled=!1,this.hiding=!1,this.imageClicked=!1,this.imageData={},this.index=this.options.initialViewIndex,this.isImg=!1,this.isShown=!1,this.length=0,this.moving=!1,this.played=!1,this.playing=!1,this.pointers={},this.ready=!1,this.rotating=!1,this.scaling=!1,this.showing=!1,this.timeout=!1,this.tooltipping=!1,this.viewed=!1,this.viewing=!1,this.wheeling=!1,this.zooming=!1,this.pointerMoved=!1,this.id=Ah(),this.init()}return nh(u,[{key:"init",value:function(){var a=this,o=this.element,f=this.options;if(!o[Ne]){o[Ne]=this,f.focus&&!f.keyboard&&(f.focus=!1);var d=o.localName==="img",p=[];if(Xe(d?[o]:o.querySelectorAll("img"),function(x){qe(f.filter)?f.filter.call(a,x)&&p.push(x):a.getImageURL(x)&&p.push(x)}),this.isImg=d,this.length=p.length,this.images=p,this.initBody(),mr(document.createElement(Ne).style.transition)&&(f.transition=!1),f.inline){var y=0,m=function(){if(y+=1,y===a.length){var S;a.initializing=!1,a.delaying={abort:function(){clearTimeout(S)}},S=setTimeout(function(){a.delaying=!1,a.build()},0)}};this.initializing={abort:function(){Xe(p,function(S){S.complete||(Ge(S,Jt,m),Ge(S,Jn,m))})}},Xe(p,function(x){if(x.complete)m();else{var S,A;Ee(x,Jt,S=function(){Ge(x,Jn,A),m()},{once:!0}),Ee(x,Jn,A=function(){Ge(x,Jt,S),m()},{once:!0})}})}else Ee(o,gr,this.onStart=function(x){var S=x.target;S.localName==="img"&&(!qe(f.filter)||f.filter.call(a,S))&&a.view(a.images.indexOf(S))})}}},{key:"build",value:function(){if(!this.ready){var a=this.element,o=this.options,f=a.parentNode,d=document.createElement("div");d.innerHTML=ah;var p=d.querySelector(".".concat(Ne,"-container")),y=p.querySelector(".".concat(Ne,"-title")),m=p.querySelector(".".concat(Ne,"-toolbar")),x=p.querySelector(".".concat(Ne,"-navbar")),S=p.querySelector(".".concat(Ne,"-button")),A=p.querySelector(".".concat(Ne,"-canvas"));if(this.parent=f,this.viewer=p,this.title=y,this.toolbar=m,this.navbar=x,this.button=S,this.canvas=A,this.footer=p.querySelector(".".concat(Ne,"-footer")),this.tooltipBox=p.querySelector(".".concat(Ne,"-tooltip")),this.player=p.querySelector(".".concat(Ne,"-player")),this.list=p.querySelector(".".concat(Ne,"-list")),p.id="".concat(Ne).concat(this.id),y.id="".concat(Ne,"Title").concat(this.id),Ce(y,o.title?Qi(Array.isArray(o.title)?o.title[0]:o.title):Vn),Ce(x,o.navbar?Qi(o.navbar):Vn),ii(S,Vn,!o.button),o.keyboard&&S.setAttribute("tabindex",0),o.backdrop&&(Ce(p,"".concat(Ne,"-backdrop")),!o.inline&&o.backdrop!=="static"&&Za(A,Yi,"hide")),ri(o.className)&&o.className&&o.className.split(Ja).forEach(function($){Ce(p,$)}),o.toolbar){var E=document.createElement("ul"),W=yr(o.toolbar),B=Vi.slice(0,3),q=Vi.slice(7,9),F=Vi.slice(9);W||Ce(m,Qi(o.toolbar)),Xe(W?o.toolbar:Vi,function($,X){var ne=W&&yr($),ue=W?Qa(X):$,se=ne&&!mr($.show)?$.show:$;if(!(!se||!o.zoomable&&B.indexOf(ue)!==-1||!o.rotatable&&q.indexOf(ue)!==-1||!o.scalable&&F.indexOf(ue)!==-1)){var he=ne&&!mr($.size)?$.size:$,Oe=ne&&!mr($.click)?$.click:$,Re=document.createElement("li");o.keyboard&&Re.setAttribute("tabindex",0),Re.setAttribute("role","button"),Ce(Re,"".concat(Ne,"-").concat(ue)),qe(Oe)||Za(Re,Yi,ue),Ze(se)&&Ce(Re,Qi(se)),["small","large"].indexOf(he)!==-1?Ce(Re,"".concat(Ne,"-").concat(he)):ue==="play"&&Ce(Re,"".concat(Ne,"-large")),qe(Oe)&&Ee(Re,gr,Oe),E.appendChild(Re)}}),m.appendChild(E)}else Ce(m,Vn);if(!o.rotatable){var N=m.querySelectorAll('li[class*="rotate"]');Ce(N,ti),Xe(N,function($){m.appendChild($)})}if(o.inline)Ce(S,oh),nn(p,{zIndex:o.zIndexInline}),window.getComputedStyle(f).position==="static"&&nn(f,{position:"relative"}),f.insertBefore(p,a.nextSibling);else{Ce(S,sh),Ce(p,Ya),Ce(p,Xi),Ce(p,Vn),nn(p,{zIndex:o.zIndex});var O=o.container;ri(O)&&(O=a.ownerDocument.querySelector(O)),O||(O=this.body),O.appendChild(p)}if(o.inline&&(this.render(),this.bind(),this.isShown=!0),this.ready=!0,qe(o.ready)&&Ee(a,Yo,o.ready,{once:!0}),ot(a,Yo)===!1){this.ready=!1;return}this.ready&&o.inline&&this.view(this.index)}}}],[{key:"noConflict",value:function(){return window.Viewer=Dh,u}},{key:"setDefaults",value:function(a){Ut(Po,yr(a)&&a)}}])}();Ut(dl.prototype,Ch,Th,_h,Lh,Eh);var Ih=typeof global=="object"&&global&&global.Object===Object&&global,pl=Ih,Oh=typeof self=="object"&&self&&self.Object===Object&&self,Nh=pl||Oh||Function("return this")(),ts=Nh,Mh=ts.Symbol,ea=Mh,gl=Object.prototype,Rh=gl.hasOwnProperty,Fh=gl.toString,ai=ea?ea.toStringTag:void 0;function Ph(u){var n=Rh.call(u,ai),a=u[ai];try{u[ai]=void 0;var o=!0}catch{}var f=Fh.call(u);return o&&(n?u[ai]=a:delete u[ai]),f}var zh=Object.prototype,$h=zh.toString;function Bh(u){return $h.call(u)}var Hh="[object Null]",Wh="[object Undefined]",ml=ea?ea.toStringTag:void 0;function ns(u){return u==null?u===void 0?Wh:Hh:ml&&ml in Object(u)?Ph(u):Bh(u)}function rs(u){return u!=null&&typeof u=="object"}var jh=Array.isArray,Uh=jh;function is(u){var n=typeof u;return u!=null&&(n=="object"||n=="function")}function vl(u){return u}var qh="[object AsyncFunction]",Gh="[object Function]",Kh="[object GeneratorFunction]",Xh="[object Proxy]";function yl(u){if(!is(u))return!1;var n=ns(u);return n==Gh||n==Kh||n==qh||n==Xh}var Yh=ts["__core-js_shared__"],as=Yh,bl=function(){var u=/[^.]+$/.exec(as&&as.keys&&as.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}();function Vh(u){return!!bl&&bl in u}var Jh=Function.prototype,Qh=Jh.toString;function Zh(u){if(u!=null){try{return Qh.call(u)}catch{}try{return u+""}catch{}}return""}var ed=/[\\^$.*+?()[\]{}|]/g,td=/^\[object .+?Constructor\]$/,nd=Function.prototype,rd=Object.prototype,id=nd.toString,ad=rd.hasOwnProperty,sd=RegExp("^"+id.call(ad).replace(ed,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function od(u){if(!is(u)||Vh(u))return!1;var n=yl(u)?sd:td;return n.test(Zh(u))}function ld(u,n){return u==null?void 0:u[n]}function ud(u,n){var a=ld(u,n);return od(a)?a:void 0}function fd(u,n,a){switch(a.length){case 0:return u.call(n);case 1:return u.call(n,a[0]);case 2:return u.call(n,a[0],a[1]);case 3:return u.call(n,a[0],a[1],a[2])}return u.apply(n,a)}var cd=800,hd=16,dd=Date.now;function pd(u){var n=0,a=0;return function(){var o=dd(),f=hd-(o-a);if(a=o,f>0){if(++n>=cd)return arguments[0]}else n=0;return u.apply(void 0,arguments)}}function gd(u){return function(){return u}}var md=function(){try{var u=ud(Object,"defineProperty");return u({},"",{}),u}catch{}}(),ta=md,vd=ta?function(u,n){return ta(u,"toString",{configurable:!0,enumerable:!1,value:gd(n),writable:!0})}:vl,yd=vd,bd=pd(yd),xd=bd,wd=9007199254740991,kd=/^(?:0|[1-9]\d*)$/;function xl(u,n){var a=typeof u;return n=n??wd,!!n&&(a=="number"||a!="symbol"&&kd.test(u))&&u>-1&&u%1==0&&u<n}function wl(u,n,a){n=="__proto__"&&ta?ta(u,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):u[n]=a}function kl(u,n){return u===n||u!==u&&n!==n}var Sd=Object.prototype,Cd=Sd.hasOwnProperty;function Sl(u,n,a){var o=u[n];(!(Cd.call(u,n)&&kl(o,a))||a===void 0&&!(n in u))&&wl(u,n,a)}function Td(u,n,a,o){var f=!a;a||(a={});for(var d=-1,p=n.length;++d<p;){var y=n[d],m=void 0;m===void 0&&(m=u[y]),f?wl(a,y,m):Sl(a,y,m)}return a}var Cl=Math.max;function _d(u,n,a){return n=Cl(n===void 0?u.length-1:n,0),function(){for(var o=arguments,f=-1,d=Cl(o.length-n,0),p=Array(d);++f<d;)p[f]=o[n+f];f=-1;for(var y=Array(n+1);++f<n;)y[f]=o[f];return y[n]=a(p),fd(u,this,y)}}function Ld(u,n){return xd(_d(u,n,vl),u+"")}var Ed=9007199254740991;function Tl(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=Ed}function ss(u){return u!=null&&Tl(u.length)&&!yl(u)}function Dd(u,n,a){if(!is(a))return!1;var o=typeof n;return(o=="number"?ss(a)&&xl(n,a.length):o=="string"&&n in a)?kl(a[n],u):!1}function Ad(u){return Ld(function(n,a){var o=-1,f=a.length,d=f>1?a[f-1]:void 0,p=f>2?a[2]:void 0;for(d=u.length>3&&typeof d=="function"?(f--,d):void 0,p&&Dd(a[0],a[1],p)&&(d=f<3?void 0:d,f=1),n=Object(n);++o<f;){var y=a[o];y&&u(n,y,o,d)}return n})}var Id=Object.prototype;function _l(u){var n=u&&u.constructor,a=typeof n=="function"&&n.prototype||Id;return u===a}function Od(u,n){for(var a=-1,o=Array(u);++a<u;)o[a]=n(a);return o}var Nd="[object Arguments]";function Ll(u){return rs(u)&&ns(u)==Nd}var El=Object.prototype,Md=El.hasOwnProperty,Rd=El.propertyIsEnumerable,Fd=Ll(function(){return arguments}())?Ll:function(u){return rs(u)&&Md.call(u,"callee")&&!Rd.call(u,"callee")},Pd=Fd;function zd(){return!1}var Dl=typeof Ie=="object"&&Ie&&!Ie.nodeType&&Ie,Al=Dl&&typeof module=="object"&&module&&!module.nodeType&&module,$d=Al&&Al.exports===Dl,Il=$d?ts.Buffer:void 0,Bd=Il?Il.isBuffer:void 0,Hd=Bd||zd,Wd=Hd,jd="[object Arguments]",Ud="[object Array]",qd="[object Boolean]",Gd="[object Date]",Kd="[object Error]",Xd="[object Function]",Yd="[object Map]",Vd="[object Number]",Jd="[object Object]",Qd="[object RegExp]",Zd="[object Set]",ep="[object String]",tp="[object WeakMap]",np="[object ArrayBuffer]",rp="[object DataView]",ip="[object Float32Array]",ap="[object Float64Array]",sp="[object Int8Array]",op="[object Int16Array]",lp="[object Int32Array]",up="[object Uint8Array]",fp="[object Uint8ClampedArray]",cp="[object Uint16Array]",hp="[object Uint32Array]",Ye={};Ye[ip]=Ye[ap]=Ye[sp]=Ye[op]=Ye[lp]=Ye[up]=Ye[fp]=Ye[cp]=Ye[hp]=!0,Ye[jd]=Ye[Ud]=Ye[np]=Ye[qd]=Ye[rp]=Ye[Gd]=Ye[Kd]=Ye[Xd]=Ye[Yd]=Ye[Vd]=Ye[Jd]=Ye[Qd]=Ye[Zd]=Ye[ep]=Ye[tp]=!1;function dp(u){return rs(u)&&Tl(u.length)&&!!Ye[ns(u)]}function pp(u){return function(n){return u(n)}}var Ol=typeof Ie=="object"&&Ie&&!Ie.nodeType&&Ie,si=Ol&&typeof module=="object"&&module&&!module.nodeType&&module,gp=si&&si.exports===Ol,os=gp&&pl.process,mp=function(){try{var u=si&&si.require&&si.require("util").types;return u||os&&os.binding&&os.binding("util")}catch{}}(),Nl=mp,Ml=Nl&&Nl.isTypedArray,vp=Ml?pp(Ml):dp,yp=vp,bp=Object.prototype,xp=bp.hasOwnProperty;function wp(u,n){var a=Uh(u),o=!a&&Pd(u),f=!a&&!o&&Wd(u),d=!a&&!o&&!f&&yp(u),p=a||o||f||d,y=p?Od(u.length,String):[],m=y.length;for(var x in u)xp.call(u,x)&&!(p&&(x=="length"||f&&(x=="offset"||x=="parent")||d&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||xl(x,m)))&&y.push(x);return y}function kp(u,n){return function(a){return u(n(a))}}var Sp=kp(Object.keys,Object),Cp=Sp,Tp=Object.prototype,_p=Tp.hasOwnProperty;function Lp(u){if(!_l(u))return Cp(u);var n=[];for(var a in Object(u))_p.call(u,a)&&a!="constructor"&&n.push(a);return n}function Ep(u){return ss(u)?wp(u):Lp(u)}var Dp=Object.prototype,Ap=Dp.hasOwnProperty,Ip=Ad(function(u,n){if(_l(n)||ss(n)){Td(n,Ep(n),u);return}for(var a in n)Ap.call(n,a)&&Sl(u,a,n[a])}),Op=Ip;const Rl=({images:u=[],options:n={}}={})=>{n=Op(n,{inline:!1});const a=Kf.extend({render(p){return p("div",{style:{display:"none"},class:["__viewer-token"]},u.map(y=>p("img",{attrs:typeof y=="string"?{src:y}:y})))}}),o=new a;o.$mount(),document.body.appendChild(o.$el);const f=new dl(o.$el,n),d=f.destroy.bind(f);return f.destroy=function(){return d(),o.$destroy(),document.body.removeChild(o.$el),f},f.show(),o.$el.addEventListener("hidden",function(){this.viewer===f&&f.destroy()}),f};var Fl={exports:{}},Pl;function Np(){return Pl||(Pl=1,function(u,n){(function(a){a(Wt())})(function(a){var o={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},f={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};a.defineMode("xml",function(d,p){var y=d.indentUnit,m={},x=p.htmlMode?o:f;for(var S in x)m[S]=x[S];for(var S in p)m[S]=p[S];var A,E;function W(k,J){function G(K){return J.tokenize=K,K(k,J)}var D=k.next();if(D=="<")return k.eat("!")?k.eat("[")?k.match("CDATA[")?G(F("atom","]]>")):null:k.match("--")?G(F("comment","-->")):k.match("DOCTYPE",!0,!0)?(k.eatWhile(/[\w\._\-]/),G(N(1))):null:k.eat("?")?(k.eatWhile(/[\w\._\-]/),J.tokenize=F("meta","?>"),"meta"):(A=k.eat("/")?"closeTag":"openTag",J.tokenize=B,"tag bracket");if(D=="&"){var R;return k.eat("#")?k.eat("x")?R=k.eatWhile(/[a-fA-F\d]/)&&k.eat(";"):R=k.eatWhile(/[\d]/)&&k.eat(";"):R=k.eatWhile(/[\w\.\-:]/)&&k.eat(";"),R?"atom":"error"}else return k.eatWhile(/[^&<]/),null}W.isInText=!0;function B(k,J){var G=k.next();if(G==">"||G=="/"&&k.eat(">"))return J.tokenize=W,A=G==">"?"endTag":"selfcloseTag","tag bracket";if(G=="=")return A="equals",null;if(G=="<"){J.tokenize=W,J.state=ue,J.tagName=J.tagStart=null;var D=J.tokenize(k,J);return D?D+" tag error":"tag error"}else return/[\'\"]/.test(G)?(J.tokenize=q(G),J.stringStartCol=k.column(),J.tokenize(k,J)):(k.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function q(k){var J=function(G,D){for(;!G.eol();)if(G.next()==k){D.tokenize=B;break}return"string"};return J.isInAttribute=!0,J}function F(k,J){return function(G,D){for(;!G.eol();){if(G.match(J)){D.tokenize=W;break}G.next()}return k}}function N(k){return function(J,G){for(var D;(D=J.next())!=null;){if(D=="<")return G.tokenize=N(k+1),G.tokenize(J,G);if(D==">")if(k==1){G.tokenize=W;break}else return G.tokenize=N(k-1),G.tokenize(J,G)}return"meta"}}function O(k){return k&&k.toLowerCase()}function $(k,J,G){this.prev=k.context,this.tagName=J||"",this.indent=k.indented,this.startOfLine=G,(m.doNotIndent.hasOwnProperty(J)||k.context&&k.context.noIndent)&&(this.noIndent=!0)}function X(k){k.context&&(k.context=k.context.prev)}function ne(k,J){for(var G;;){if(!k.context||(G=k.context.tagName,!m.contextGrabbers.hasOwnProperty(O(G))||!m.contextGrabbers[O(G)].hasOwnProperty(O(J))))return;X(k)}}function ue(k,J,G){return k=="openTag"?(G.tagStart=J.column(),se):k=="closeTag"?he:ue}function se(k,J,G){return k=="word"?(G.tagName=J.current(),E="tag",ie):m.allowMissingTagName&&k=="endTag"?(E="tag bracket",ie(k,J,G)):(E="error",se)}function he(k,J,G){if(k=="word"){var D=J.current();return G.context&&G.context.tagName!=D&&m.implicitlyClosed.hasOwnProperty(O(G.context.tagName))&&X(G),G.context&&G.context.tagName==D||m.matchClosing===!1?(E="tag",Oe):(E="tag error",Re)}else return m.allowMissingTagName&&k=="endTag"?(E="tag bracket",Oe(k,J,G)):(E="error",Re)}function Oe(k,J,G){return k!="endTag"?(E="error",Oe):(X(G),ue)}function Re(k,J,G){return E="error",Oe(k,J,G)}function ie(k,J,G){if(k=="word")return E="attribute",ze;if(k=="endTag"||k=="selfcloseTag"){var D=G.tagName,R=G.tagStart;return G.tagName=G.tagStart=null,k=="selfcloseTag"||m.autoSelfClosers.hasOwnProperty(O(D))?ne(G,D):(ne(G,D),G.context=new $(G,D,R==G.indented)),ue}return E="error",ie}function ze(k,J,G){return k=="equals"?H:(m.allowMissing||(E="error"),ie(k,J,G))}function H(k,J,G){return k=="string"?Q:k=="word"&&m.allowUnquoted?(E="string",ie):(E="error",ie(k,J,G))}function Q(k,J,G){return k=="string"?Q:ie(k,J,G)}return{startState:function(k){var J={tokenize:W,state:ue,indented:k||0,tagName:null,tagStart:null,context:null};return k!=null&&(J.baseIndent=k),J},token:function(k,J){if(!J.tagName&&k.sol()&&(J.indented=k.indentation()),k.eatSpace())return null;A=null;var G=J.tokenize(k,J);return(G||A)&&G!="comment"&&(E=null,J.state=J.state(A||G,k,J),E&&(G=E=="error"?G+" error":E)),G},indent:function(k,J,G){var D=k.context;if(k.tokenize.isInAttribute)return k.tagStart==k.indented?k.stringStartCol+1:k.indented+y;if(D&&D.noIndent)return a.Pass;if(k.tokenize!=B&&k.tokenize!=W)return G?G.match(/^(\s*)/)[0].length:0;if(k.tagName)return m.multilineTagIndentPastTag!==!1?k.tagStart+k.tagName.length+2:k.tagStart+y*(m.multilineTagIndentFactor||1);if(m.alignCDATA&&/<!\[CDATA\[/.test(J))return 0;var R=J&&/^<(\/)?([\w_:\.-]*)/.exec(J);if(R&&R[1])for(;D;)if(D.tagName==R[2]){D=D.prev;break}else if(m.implicitlyClosed.hasOwnProperty(O(D.tagName)))D=D.prev;else break;else if(R)for(;D;){var K=m.contextGrabbers[O(D.tagName)];if(K&&K.hasOwnProperty(O(R[2])))D=D.prev;else break}for(;D&&D.prev&&!D.startOfLine;)D=D.prev;return D?D.indent+y:k.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:m.htmlMode?"html":"xml",helperType:m.htmlMode?"html":"xml",skipAttribute:function(k){k.state==H&&(k.state=ie)},xmlCurrentTag:function(k){return k.tagName?{name:k.tagName,close:k.type=="closeTag"}:null},xmlCurrentContext:function(k){for(var J=[],G=k.context;G;G=G.prev)J.push(G.tagName);return J.reverse()}}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),Fl.exports}var zl={exports:{}},$l;function Mp(){return $l||($l=1,function(u,n){(function(a){a(Wt())})(function(a){a.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy","cbl"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var o=0;o<a.modeInfo.length;o++){var f=a.modeInfo[o];f.mimes&&(f.mime=f.mimes[0])}a.findModeByMIME=function(d){d=d.toLowerCase();for(var p=0;p<a.modeInfo.length;p++){var y=a.modeInfo[p];if(y.mime==d)return y;if(y.mimes){for(var m=0;m<y.mimes.length;m++)if(y.mimes[m]==d)return y}}if(/\+xml$/.test(d))return a.findModeByMIME("application/xml");if(/\+json$/.test(d))return a.findModeByMIME("application/json")},a.findModeByExtension=function(d){d=d.toLowerCase();for(var p=0;p<a.modeInfo.length;p++){var y=a.modeInfo[p];if(y.ext){for(var m=0;m<y.ext.length;m++)if(y.ext[m]==d)return y}}},a.findModeByFileName=function(d){for(var p=0;p<a.modeInfo.length;p++){var y=a.modeInfo[p];if(y.file&&y.file.test(d))return y}var m=d.lastIndexOf("."),x=m>-1&&d.substring(m+1,d.length);if(x)return a.findModeByExtension(x)},a.findModeByName=function(d){d=d.toLowerCase();for(var p=0;p<a.modeInfo.length;p++){var y=a.modeInfo[p];if(y.name.toLowerCase()==d)return y;if(y.alias){for(var m=0;m<y.alias.length;m++)if(y.alias[m].toLowerCase()==d)return y}}}})}()),zl.exports}(function(u,n){(function(a){a(Wt(),Np(),Mp())})(function(a){a.defineMode("markdown",function(o,f){var d=a.getMode(o,"text/html"),p=d.name=="null";function y(L){if(a.findModeByName){var w=a.findModeByName(L);w&&(L=w.mime||w.mimes[0])}var oe=a.getMode(o,L);return oe.name=="null"?null:oe}f.highlightFormatting===void 0&&(f.highlightFormatting=!1),f.maxBlockquoteDepth===void 0&&(f.maxBlockquoteDepth=0),f.taskLists===void 0&&(f.taskLists=!1),f.strikethrough===void 0&&(f.strikethrough=!1),f.emoji===void 0&&(f.emoji=!1),f.fencedCodeBlockHighlighting===void 0&&(f.fencedCodeBlockHighlighting=!0),f.fencedCodeBlockDefaultMode===void 0&&(f.fencedCodeBlockDefaultMode="text/plain"),f.xml===void 0&&(f.xml=!0),f.tokenTypeOverrides===void 0&&(f.tokenTypeOverrides={});var m={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var x in m)m.hasOwnProperty(x)&&f.tokenTypeOverrides[x]&&(m[x]=f.tokenTypeOverrides[x]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,A=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,E=/^\[(x| )\](?=\s)/i,W=f.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,B=/^ {0,3}(?:\={1,}|-{2,})\s*$/,q=/^[^#!\[\]*_\\<>` "'(~:]+/,F=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,N=/^\s*\[[^\]]+?\]:.*$/,O=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,$=" ";function X(L,w,oe){return w.f=w.inline=oe,oe(L,w)}function ne(L,w,oe){return w.f=w.block=oe,oe(L,w)}function ue(L){return!L||!/\S/.test(L.string)}function se(L){if(L.linkTitle=!1,L.linkHref=!1,L.linkText=!1,L.em=!1,L.strong=!1,L.strikethrough=!1,L.quote=0,L.indentedCode=!1,L.f==Oe){var w=p;if(!w){var oe=a.innerMode(d,L.htmlState);w=oe.mode.name=="xml"&&oe.state.tagStart===null&&!oe.state.context&&oe.state.tokenize.isInText}w&&(L.f=H,L.block=he,L.htmlState=null)}return L.trailingSpace=0,L.trailingSpaceNewLine=!1,L.prevLine=L.thisLine,L.thisLine={stream:null},null}function he(L,w){var oe=L.column()===w.indentation,Te=ue(w.prevLine.stream),Z=w.indentedCode,ce=w.prevLine.hr,ke=w.list!==!1,_e=(w.listStack[w.listStack.length-1]||0)+3;w.indentedCode=!1;var ft=w.indentation;if(w.indentationDiff===null&&(w.indentationDiff=w.indentation,ke)){for(w.list=null;ft<w.listStack[w.listStack.length-1];)w.listStack.pop(),w.listStack.length?w.indentation=w.listStack[w.listStack.length-1]:w.list=!1;w.list!==!1&&(w.indentationDiff=ft-w.listStack[w.listStack.length-1])}var we=!Te&&!ce&&!w.prevLine.header&&(!ke||!Z)&&!w.prevLine.fencedCodeEnd,Me=(w.list===!1||ce||Te)&&w.indentation<=_e&&L.match(S),Ke=null;if(w.indentationDiff>=4&&(Z||w.prevLine.fencedCodeEnd||w.prevLine.header||Te))return L.skipToEnd(),w.indentedCode=!0,m.code;if(L.eatSpace())return null;if(oe&&w.indentation<=_e&&(Ke=L.match(W))&&Ke[1].length<=6)return w.quote=0,w.header=Ke[1].length,w.thisLine.header=!0,f.highlightFormatting&&(w.formatting="header"),w.f=w.inline,ie(w);if(w.indentation<=_e&&L.eat(">"))return w.quote=oe?1:w.quote+1,f.highlightFormatting&&(w.formatting="quote"),L.eatSpace(),ie(w);if(!Me&&!w.setext&&oe&&w.indentation<=_e&&(Ke=L.match(A))){var ct=Ke[1]?"ol":"ul";return w.indentation=ft+L.current().length,w.list=!0,w.quote=0,w.listStack.push(w.indentation),w.em=!1,w.strong=!1,w.code=!1,w.strikethrough=!1,f.taskLists&&L.match(E,!1)&&(w.taskList=!0),w.f=w.inline,f.highlightFormatting&&(w.formatting=["list","list-"+ct]),ie(w)}else{if(oe&&w.indentation<=_e&&(Ke=L.match(F,!0)))return w.quote=0,w.fencedEndRE=new RegExp(Ke[1]+"+ *$"),w.localMode=f.fencedCodeBlockHighlighting&&y(Ke[2]||f.fencedCodeBlockDefaultMode),w.localMode&&(w.localState=a.startState(w.localMode)),w.f=w.block=Re,f.highlightFormatting&&(w.formatting="code-block"),w.code=-1,ie(w);if(w.setext||(!we||!ke)&&!w.quote&&w.list===!1&&!w.code&&!Me&&!N.test(L.string)&&(Ke=L.lookAhead(1))&&(Ke=Ke.match(B)))return w.setext?(w.header=w.setext,w.setext=0,L.skipToEnd(),f.highlightFormatting&&(w.formatting="header")):(w.header=Ke[0].charAt(0)=="="?1:2,w.setext=w.header),w.thisLine.header=!0,w.f=w.inline,ie(w);if(Me)return L.skipToEnd(),w.hr=!0,w.thisLine.hr=!0,m.hr;if(L.peek()==="[")return X(L,w,D)}return X(L,w,w.inline)}function Oe(L,w){var oe=d.token(L,w.htmlState);if(!p){var Te=a.innerMode(d,w.htmlState);(Te.mode.name=="xml"&&Te.state.tagStart===null&&!Te.state.context&&Te.state.tokenize.isInText||w.md_inside&&L.current().indexOf(">")>-1)&&(w.f=H,w.block=he,w.htmlState=null)}return oe}function Re(L,w){var oe=w.listStack[w.listStack.length-1]||0,Te=w.indentation<oe,Z=oe+3;if(w.fencedEndRE&&w.indentation<=Z&&(Te||L.match(w.fencedEndRE))){f.highlightFormatting&&(w.formatting="code-block");var ce;return Te||(ce=ie(w)),w.localMode=w.localState=null,w.block=he,w.f=H,w.fencedEndRE=null,w.code=0,w.thisLine.fencedCodeEnd=!0,Te?ne(L,w,w.block):ce}else return w.localMode?w.localMode.token(L,w.localState):(L.skipToEnd(),m.code)}function ie(L){var w=[];if(L.formatting){w.push(m.formatting),typeof L.formatting=="string"&&(L.formatting=[L.formatting]);for(var oe=0;oe<L.formatting.length;oe++)w.push(m.formatting+"-"+L.formatting[oe]),L.formatting[oe]==="header"&&w.push(m.formatting+"-"+L.formatting[oe]+"-"+L.header),L.formatting[oe]==="quote"&&(!f.maxBlockquoteDepth||f.maxBlockquoteDepth>=L.quote?w.push(m.formatting+"-"+L.formatting[oe]+"-"+L.quote):w.push("error"))}if(L.taskOpen)return w.push("meta"),w.length?w.join(" "):null;if(L.taskClosed)return w.push("property"),w.length?w.join(" "):null;if(L.linkHref?w.push(m.linkHref,"url"):(L.strong&&w.push(m.strong),L.em&&w.push(m.em),L.strikethrough&&w.push(m.strikethrough),L.emoji&&w.push(m.emoji),L.linkText&&w.push(m.linkText),L.code&&w.push(m.code),L.image&&w.push(m.image),L.imageAltText&&w.push(m.imageAltText,"link"),L.imageMarker&&w.push(m.imageMarker)),L.header&&w.push(m.header,m.header+"-"+L.header),L.quote&&(w.push(m.quote),!f.maxBlockquoteDepth||f.maxBlockquoteDepth>=L.quote?w.push(m.quote+"-"+L.quote):w.push(m.quote+"-"+f.maxBlockquoteDepth)),L.list!==!1){var Te=(L.listStack.length-1)%3;Te?Te===1?w.push(m.list2):w.push(m.list3):w.push(m.list1)}return L.trailingSpaceNewLine?w.push("trailing-space-new-line"):L.trailingSpace&&w.push("trailing-space-"+(L.trailingSpace%2?"a":"b")),w.length?w.join(" "):null}function ze(L,w){if(L.match(q,!0))return ie(w)}function H(L,w){var oe=w.text(L,w);if(typeof oe<"u")return oe;if(w.list)return w.list=null,ie(w);if(w.taskList){var Te=L.match(E,!0)[1]===" ";return Te?w.taskOpen=!0:w.taskClosed=!0,f.highlightFormatting&&(w.formatting="task"),w.taskList=!1,ie(w)}if(w.taskOpen=!1,w.taskClosed=!1,w.header&&L.match(/^#+$/,!0))return f.highlightFormatting&&(w.formatting="header"),ie(w);var Z=L.next();if(w.linkTitle){w.linkTitle=!1;var ce=Z;Z==="("&&(ce=")"),ce=(ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var ke="^\\s*(?:[^"+ce+"\\\\]+|\\\\\\\\|\\\\.)"+ce;if(L.match(new RegExp(ke),!0))return m.linkHref}if(Z==="`"){var _e=w.formatting;f.highlightFormatting&&(w.formatting="code"),L.eatWhile("`");var ft=L.current().length;if(w.code==0&&(!w.quote||ft==1))return w.code=ft,ie(w);if(ft==w.code){var we=ie(w);return w.code=0,we}else return w.formatting=_e,ie(w)}else if(w.code)return ie(w);if(Z==="\\"&&(L.next(),f.highlightFormatting)){var Me=ie(w),Ke=m.formatting+"-escape";return Me?Me+" "+Ke:Ke}if(Z==="!"&&L.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return w.imageMarker=!0,w.image=!0,f.highlightFormatting&&(w.formatting="image"),ie(w);if(Z==="["&&w.imageMarker&&L.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return w.imageMarker=!1,w.imageAltText=!0,f.highlightFormatting&&(w.formatting="image"),ie(w);if(Z==="]"&&w.imageAltText){f.highlightFormatting&&(w.formatting="image");var Me=ie(w);return w.imageAltText=!1,w.image=!1,w.inline=w.f=k,Me}if(Z==="["&&!w.image)return w.linkText&&L.match(/^.*?\]/)||(w.linkText=!0,f.highlightFormatting&&(w.formatting="link")),ie(w);if(Z==="]"&&w.linkText){f.highlightFormatting&&(w.formatting="link");var Me=ie(w);return w.linkText=!1,w.inline=w.f=L.match(/\(.*?\)| ?\[.*?\]/,!1)?k:H,Me}if(Z==="<"&&L.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=Q,f.highlightFormatting&&(w.formatting="link");var Me=ie(w);return Me?Me+=" ":Me="",Me+m.linkInline}if(Z==="<"&&L.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){w.f=w.inline=Q,f.highlightFormatting&&(w.formatting="link");var Me=ie(w);return Me?Me+=" ":Me="",Me+m.linkEmail}if(f.xml&&Z==="<"&&L.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ct=L.string.indexOf(">",L.pos);if(ct!=-1){var Pt=L.string.substring(L.start,ct);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Pt)&&(w.md_inside=!0)}return L.backUp(1),w.htmlState=a.startState(d),ne(L,w,Oe)}if(f.xml&&Z==="<"&&L.match(/^\/\w*?>/))return w.md_inside=!1,"tag";if(Z==="*"||Z==="_"){for(var ht=1,dt=L.pos==1?" ":L.string.charAt(L.pos-2);ht<3&&L.eat(Z);)ht++;var gt=L.peek()||" ",qt=!/\s/.test(gt)&&(!O.test(gt)||/\s/.test(dt)||O.test(dt)),be=!/\s/.test(dt)&&(!O.test(dt)||/\s/.test(gt)||O.test(gt)),kt=null,Gt=null;if(ht%2&&(!w.em&&qt&&(Z==="*"||!be||O.test(dt))?kt=!0:w.em==Z&&be&&(Z==="*"||!qt||O.test(gt))&&(kt=!1)),ht>1&&(!w.strong&&qt&&(Z==="*"||!be||O.test(dt))?Gt=!0:w.strong==Z&&be&&(Z==="*"||!qt||O.test(gt))&&(Gt=!1)),Gt!=null||kt!=null){f.highlightFormatting&&(w.formatting=kt==null?"strong":Gt==null?"em":"strong em"),kt===!0&&(w.em=Z),Gt===!0&&(w.strong=Z);var we=ie(w);return kt===!1&&(w.em=!1),Gt===!1&&(w.strong=!1),we}}else if(Z===" "&&(L.eat("*")||L.eat("_"))){if(L.peek()===" ")return ie(w);L.backUp(1)}if(f.strikethrough){if(Z==="~"&&L.eatWhile(Z)){if(w.strikethrough){f.highlightFormatting&&(w.formatting="strikethrough");var we=ie(w);return w.strikethrough=!1,we}else if(L.match(/^[^\s]/,!1))return w.strikethrough=!0,f.highlightFormatting&&(w.formatting="strikethrough"),ie(w)}else if(Z===" "&&L.match("~~",!0)){if(L.peek()===" ")return ie(w);L.backUp(2)}}if(f.emoji&&Z===":"&&L.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){w.emoji=!0,f.highlightFormatting&&(w.formatting="emoji");var In=ie(w);return w.emoji=!1,In}return Z===" "&&(L.match(/^ +$/,!1)?w.trailingSpace++:w.trailingSpace&&(w.trailingSpaceNewLine=!0)),ie(w)}function Q(L,w){var oe=L.next();if(oe===">"){w.f=w.inline=H,f.highlightFormatting&&(w.formatting="link");var Te=ie(w);return Te?Te+=" ":Te="",Te+m.linkInline}return L.match(/^[^>]+/,!0),m.linkInline}function k(L,w){if(L.eatSpace())return null;var oe=L.next();return oe==="("||oe==="["?(w.f=w.inline=G(oe==="("?")":"]"),f.highlightFormatting&&(w.formatting="link-string"),w.linkHref=!0,ie(w)):"error"}var J={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function G(L){return function(w,oe){var Te=w.next();if(Te===L){oe.f=oe.inline=H,f.highlightFormatting&&(oe.formatting="link-string");var Z=ie(oe);return oe.linkHref=!1,Z}return w.match(J[L]),oe.linkHref=!0,ie(oe)}}function D(L,w){return L.match(/^([^\]\\]|\\.)*\]:/,!1)?(w.f=R,L.next(),f.highlightFormatting&&(w.formatting="link"),w.linkText=!0,ie(w)):X(L,w,H)}function R(L,w){if(L.match("]:",!0)){w.f=w.inline=K,f.highlightFormatting&&(w.formatting="link");var oe=ie(w);return w.linkText=!1,oe}return L.match(/^([^\]\\]|\\.)+/,!0),m.linkText}function K(L,w){return L.eatSpace()?null:(L.match(/^[^\s]+/,!0),L.peek()===void 0?w.linkTitle=!0:L.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),w.f=w.inline=H,m.linkHref+" url")}var de={startState:function(){return{f:he,prevLine:{stream:null},thisLine:{stream:null},block:he,htmlState:null,indentation:0,inline:H,text:ze,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(L){return{f:L.f,prevLine:L.prevLine,thisLine:L.thisLine,block:L.block,htmlState:L.htmlState&&a.copyState(d,L.htmlState),indentation:L.indentation,localMode:L.localMode,localState:L.localMode?a.copyState(L.localMode,L.localState):null,inline:L.inline,text:L.text,formatting:!1,linkText:L.linkText,linkTitle:L.linkTitle,linkHref:L.linkHref,code:L.code,em:L.em,strong:L.strong,strikethrough:L.strikethrough,emoji:L.emoji,header:L.header,setext:L.setext,hr:L.hr,taskList:L.taskList,list:L.list,listStack:L.listStack.slice(0),quote:L.quote,indentedCode:L.indentedCode,trailingSpace:L.trailingSpace,trailingSpaceNewLine:L.trailingSpaceNewLine,md_inside:L.md_inside,fencedEndRE:L.fencedEndRE}},token:function(L,w){if(w.formatting=!1,L!=w.thisLine.stream){if(w.header=0,w.hr=!1,L.match(/^\s*$/,!0))return se(w),null;if(w.prevLine=w.thisLine,w.thisLine={stream:L},w.taskList=!1,w.trailingSpace=0,w.trailingSpaceNewLine=!1,!w.localState&&(w.f=w.block,w.f!=Oe)){var oe=L.match(/^\s*/,!0)[0].replace(/\t/g,$).length;if(w.indentation=oe,w.indentationDiff=null,oe>0)return null}}return w.f(L,w)},innerMode:function(L){return L.block==Oe?{state:L.htmlState,mode:d}:L.localState?{state:L.localState,mode:L.localMode}:{state:L,mode:de}},indent:function(L,w,oe){return L.block==Oe&&d.indent?d.indent(L.htmlState,w,oe):L.localState&&L.localMode.indent?L.localMode.indent(L.localState,w,oe):a.Pass},blankLine:se,getType:ie,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return de},"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})})();const Rp={name:"DebugTab",components:{codemirror:co.codemirror},props:{selectedSpan:{type:Object,required:!0},selectedSpanId:{type:String,required:!0}},data(){return{debugForm:{params:[],systemContent:"",userContent:""},debugSubmitting:!1,debugResponse:null,showDebugRawResponse:!1,debugResponseKey:0,debugMarkdownKey:0,originalInputs:null,hasImageUrl:!1,submitImage:!0,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},cmOptionsMarkdown:{tabSize:2,mode:"markdown",theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!1,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0,autoRefresh:!0},viewerOptions:{inline:!1,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,zIndex:9999}}},computed:{rawInputs(){var u,n,a;return(a=(n=(u=this.selectedSpan)==null?void 0:u.parsedContent)==null?void 0:n.attributes)==null?void 0:a["langsword.spanInputs"]},targetUrl(){var n,a;const u=(a=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:a.attributes;return u&&u["url.full"]?u["url.full"]:null}},watch:{selectedSpanId:{immediate:!0,handler(u,n){u&&u!==n&&this.$nextTick(()=>{this.initDebugForm()})}},"selectedSpan.parsedContent":{deep:!0,handler(){this.selectedSpan&&this.selectedSpanId&&this.$nextTick(()=>{this.initDebugForm()})}}},mounted(){this.selectedSpan&&this.selectedSpanId&&this.$nextTick(()=>{this.initDebugForm()})},methods:{initDebugForm(){var n,a;if(!this.selectedSpan)return;let u=(a=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:a.inputs;if(!u&&this.rawInputs)try{u=typeof this.rawInputs=="string"?JSON.parse(this.rawInputs):this.rawInputs}catch(o){console.error("Failed to parse rawInputs:",o);return}if(!u){console.warn("No inputs found for span:",this.selectedSpanId);return}if(this.originalInputs=JSON.parse(JSON.stringify(u)),this.selectedSpan.type==="CLIENT")this.debugForm.params=[],this.debugForm.systemContent="",this.debugForm.userContent="",Object.keys(u).forEach(o=>{if(o!=="file"){const f=u[o];let d="";typeof f=="string"?d=f:typeof f=="boolean"||typeof f=="number"?d=String(f):d=JSON.stringify(f),this.debugForm.params.push({key:o,value:d})}});else if(this.selectedSpan.type==="CHAT_MODEL")if(this.debugForm.params=[],this.hasImageUrl=!1,this.submitImage=!0,Object.keys(u).forEach(o=>{if(o!=="messages"){const f=u[o];let d="";typeof f=="string"?d=f:typeof f=="boolean"||typeof f=="number"?d=String(f):d=JSON.stringify(f),this.debugForm.params.push({key:o,value:d})}}),u.messages&&Array.isArray(u.messages)){const o=u.messages.find(d=>d.role==="system"),f=u.messages.find(d=>d.role==="user");if(o&&o.content?this.debugForm.systemContent=typeof o.content=="string"?o.content:"":this.debugForm.systemContent="",f&&f.content)if(Array.isArray(f.content)){const d=f.content.filter(y=>y.type==="text"&&y.text).map(y=>y.text);this.debugForm.userContent=d.join(`
|
|
78
|
+
`);const p=f.content.some(y=>y.type==="image_url");this.hasImageUrl=p}else typeof f.content=="string"?this.debugForm.userContent=f.content:this.debugForm.userContent="";else this.debugForm.userContent=""}else this.debugForm.systemContent="",this.debugForm.userContent="";this.debugResponse=null,this.showDebugRawResponse=!1,this.$nextTick(()=>{this.$refs.systemContentEditor&&this.$refs.systemContentEditor.codemirror&&this.$refs.systemContentEditor.codemirror.setValue(this.debugForm.systemContent||""),this.$refs.userContentEditor&&this.$refs.userContentEditor.codemirror&&this.$refs.userContentEditor.codemirror.setValue(this.debugForm.userContent||"")})},addDebugParam(){this.debugForm.params.push({key:"",value:""})},removeDebugParam(u){this.debugForm.params.splice(u,1)},handleDebugParamChange(){},resetDebugForm(){this.initDebugForm()},parseParamValue(u){if(u==="true"||u==="false")return u==="true";if(u==="")return"";{const n=Number(u);if(!isNaN(n)&&isFinite(n)&&u!=="")return n;try{return JSON.parse(u)}catch{return u}}},buildRequestHeaders(u){const n={};let a=null;const o=Object.keys(u).find(f=>f.toLowerCase()==="x-target-url");return o?(a=u[o],delete u[o]):this.targetUrl&&(a=this.targetUrl),a&&(n["X-Target-Url"]=a),n},handleDebugResponse(u){this.debugResponse=u,this.showDebugRawResponse=!1,this.$nextTick(()=>{this.debugResponseKey++})},handleDebugError(u){console.error("Debug request failed:",u);let n="未知错误";if(u.response&&u.response.data){const a=u.response.data;typeof a=="object"&&a!==null&&a.message?n=a.message:u.message&&(n=u.message)}else u.message&&(n=u.message);this.$message.error("调试请求失败: "+n)},async submitDebugRequest(u){const n=this.buildRequestHeaders(u),a=await xn.debugTrace(u,n);this.handleDebugResponse(a)},async submitDebugClient(){if(!(!this.selectedSpan||!this.originalInputs)){this.debugSubmitting=!0;try{const u={};this.originalInputs.file&&(u.file=this.originalInputs.file),this.debugForm.params.forEach(n=>{if(n.key&&n.key.trim()){const a=n.value?n.value.trim():"";u[n.key]=this.parseParamValue(a)}}),await this.submitDebugRequest(u)}catch(u){this.handleDebugError(u)}finally{this.debugSubmitting=!1}}},async submitDebugChatModel(){if(!(!this.selectedSpan||!this.originalInputs)){this.debugSubmitting=!0;try{const u=JSON.parse(JSON.stringify(this.originalInputs));if(this.debugForm.params.forEach(n=>{if(n.key&&n.key.trim()){const a=n.value?n.value.trim():"";u[n.key]=this.parseParamValue(a)}}),u.messages&&Array.isArray(u.messages)){const n=u.messages.find(o=>o.role==="system");n&&(n.content=this.debugForm.systemContent||"");const a=u.messages.find(o=>o.role==="user");if(a){const o=this.originalInputs.messages.find(d=>d.role==="user");if(o&&Array.isArray(o.content)){const d=[];this.submitImage&&Array.isArray(a.content)&&a.content.forEach(p=>{p.type==="image_url"&&d.push(p)}),this.debugForm.userContent&&this.debugForm.userContent.trim()&&d.push({type:"text",text:this.debugForm.userContent}),a.content=d.length>0?d:this.debugForm.userContent||""}else a.content=this.debugForm.userContent||""}}await this.submitDebugRequest(u)}catch(u){this.handleDebugError(u)}finally{this.debugSubmitting=!1}}},toggleDebugResponseView(){this.showDebugRawResponse=!this.showDebugRawResponse,this.$nextTick(()=>{this.debugResponseKey++})},formatRawJson(u){if(!u)return"";if(typeof u=="string")try{const n=JSON.parse(u);return JSON.stringify(n,null,2)}catch{return u}return JSON.stringify(u,null,2)},extractImagesFromObject(u,n=[],a=""){if(!(!u||typeof u!="object")){for(const[o,f]of Object.entries(u)){const d=a?`${a}.${o}`:o;typeof f=="string"&&f.trim()!==""?(f.startsWith("data:image/")||f.startsWith("/9j/")||f.startsWith("iVBOR")||f.startsWith("R0lGOD"))&&(n.push({path:d,value:f,label:o==="content"&&a?`${a.split(".").pop()}: ${o}`:o}),u[o]="[IMAGE_DATA]"):f&&typeof f=="object"&&!Array.isArray(f)?this.extractImagesFromObject(f,n,d):Array.isArray(f)&&f.forEach((p,y)=>{p&&typeof p=="object"&&this.extractImagesFromObject(p,n,`${d}[${y}]`)})}return n}},renderStructuredContent(u){const n=[];if(!u)return n;try{if(Array.isArray(u))u.forEach((a,o)=>{var f;a&&typeof a=="object"?a.type==="text"&&a.text?n.push({type:"markdown",content:Le(a.text),key:`text-${o}`}):a.type==="image_url"&&((f=a.image_url)!=null&&f.url)?n.push({type:"image",url:a.image_url.url,key:`image-${o}`}):a.image_base64&&a.image_base64.trim()!==""?n.push({type:"image",url:this.formatBase64Image(a.image_base64),key:`base64-image-${o}`}):n.push({type:"markdown",content:Le("```json\n"+JSON.stringify(a,null,2)+"\n```"),key:`json-${o}`}):n.push({type:"markdown",content:Le(String(a)),key:`text-${o}`})});else if(typeof u=="string")n.push({type:"markdown",content:Le(u),key:"text-0"});else if(typeof u=="object")if(u.data&&Array.isArray(u.data.result)){const a=JSON.parse(JSON.stringify(u)),o=[];a.data&&a.data.result&&a.data.result.forEach((f,d)=>{f.image_base64&&f.image_base64.trim()!==""&&(o.push({type:"page",image_base64:f.image_base64,page_num:f.page_num,label:f.page_num!==void 0?`Page ${f.page_num}`:`Result ${d}`}),f.image_base64="[BASE64_IMAGE_DATA]"),f.seals&&Array.isArray(f.seals)&&f.seals.forEach((p,y)=>{p.image_base64&&p.image_base64.trim()!==""&&(o.push({type:"seal",image_base64:p.image_base64,page_num:f.page_num,seal_index:y,seal_value:p.value,label:`Seal: ${p.value||y}`}),p.image_base64="[BASE64_IMAGE_DATA]")})}),n.push({type:"markdown",content:Le("```json\n"+JSON.stringify(a,null,2)+"\n```"),key:"json-0"}),o.forEach((f,d)=>{n.push({type:"image",url:this.formatBase64Image(f.image_base64),key:`result-image-${d}`,label:f.label})})}else{const a=JSON.parse(JSON.stringify(u)),o=[];this.extractImagesFromObject(a,o),n.push({type:"markdown",content:Le("```json\n"+JSON.stringify(a,null,2)+"\n```"),key:"json-0"}),o.forEach((f,d)=>{n.push({type:"image",url:this.formatBase64Image(f.value),key:`extracted-image-${d}`,label:f.label})})}else n.push({type:"markdown",content:Le(String(u)),key:"text-0"})}catch(a){console.error("Error rendering content:",a),n.push({type:"markdown",content:Le("Error rendering content"),key:"error-0"})}return n},formatBase64Image(u){return u?u.startsWith("data:image")?u:u.startsWith("/9j/")?`data:image/jpeg;base64,${u}`:u.startsWith("iVBOR")?`data:image/png;base64,${u}`:u.startsWith("R0lGOD")?`data:image/gif;base64,${u}`:`data:image/jpeg;base64,${u}`:""},handleImageClick(u){Rl({options:this.viewerOptions,images:[u]})}}};var Fp=function(){var o;var n=this,a=n._self._c;return a("div",{staticClass:"debug-content"},[n.selectedSpan.type==="CLIENT"?a("div",{staticClass:"debug-client-form"},[a("el-form",{attrs:{model:n.debugForm,"label-width":"60px",size:"small"}},[n._l(n.debugForm.params,function(f,d){return a("div",{key:d,staticClass:"debug-form-row"},[a("el-form-item",{attrs:{label:`${n.$t("debug.paramLabel")} ${d+1}`}},[a("el-row",{attrs:{gutter:10,type:"flex",align:"middle"}},[a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{placeholder:n.$t("debug.paramName")},on:{input:n.handleDebugParamChange},model:{value:f.key,callback:function(p){n.$set(f,"key",p)},expression:"item.key"}})],1),a("el-col",{attrs:{span:14}},[a("el-input",{attrs:{placeholder:n.$t("debug.paramValue")},on:{input:n.handleDebugParamChange},model:{value:f.value,callback:function(p){n.$set(f,"value",p)},expression:"item.value"}})],1),a("el-col",{attrs:{span:2}},[a("el-button",{staticClass:"delete-param-btn",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(p){return n.removeDebugParam(d)}}})],1)],1)],1)],1)}),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:n.addDebugParam}},[n._v(n._s(n.$t("debug.addParam")))]),a("el-button",{attrs:{type:"warning",icon:"el-icon-refresh",size:"small"},on:{click:n.resetDebugForm}},[n._v(n._s(n.$t("debug.reset")))]),a("el-button",{attrs:{type:"success",icon:"el-icon-check",size:"small",loading:n.debugSubmitting},on:{click:n.submitDebugClient}},[n._v(n._s(n.$t("debug.submit")))])],1)],2),n.debugResponse!==null?a("div",{staticClass:"debug-response"},[a("div",{staticClass:"debug-response-header"},[a("span",[n._v(n._s(n.$t("debug.responseResult")))]),a("el-button",{attrs:{type:"text",size:"small"},on:{click:n.toggleDebugResponseView}},[n._v(n._s(n.showDebugRawResponse?n.$t("debug.switchToMarkdown"):n.$t("debug.switchToRaw")))])],1),n.showDebugRawResponse?a("div",{staticClass:"debug-response-raw"},[a("codemirror",{key:`debug-response-${n.selectedSpanId}-${n.debugResponseKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.debugResponse),options:n.cmOptions}})],1):a("div",{staticClass:"debug-response-markdown"},n._l(n.renderStructuredContent(n.debugResponse),function(f){return a("div",{key:f.key,staticClass:"content-element"},[f.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(f.content)}}):f.type==="image"?a("div",{staticClass:"image-content"},[f.label?a("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:f.url,alt:"content image"},on:{click:function(d){return n.handleImageClick(f.url)}}})]):n._e()])}),0)]):n._e()],1):n._e(),n.selectedSpan.type==="CHAT_MODEL"?a("div",{staticClass:"debug-chat-model-form"},[a("el-form",{attrs:{model:n.debugForm,"label-width":"60px",size:"small"}},[a("el-form-item",{attrs:{label:n.$t("debug.systemPrompt")}},[a("codemirror",{key:`debug-system-${n.selectedSpanId}-${n.debugMarkdownKey}`,ref:"systemContentEditor",staticClass:"code-editor-wrapper markdown-editor",attrs:{options:n.cmOptionsMarkdown},model:{value:n.debugForm.systemContent,callback:function(f){n.$set(n.debugForm,"systemContent",f)},expression:"debugForm.systemContent"}})],1),a("el-form-item",{attrs:{label:n.$t("debug.userPrompt")}},[a("codemirror",{key:`debug-user-${n.selectedSpanId}-${n.debugMarkdownKey}`,ref:"userContentEditor",staticClass:"code-editor-wrapper markdown-editor",attrs:{options:n.cmOptionsMarkdown},model:{value:n.debugForm.userContent,callback:function(f){n.$set(n.debugForm,"userContent",f)},expression:"debugForm.userContent"}})],1),n.selectedSpan.type==="CHAT_MODEL"&&n.hasImageUrl?a("el-form-item",{attrs:{label:n.$t("debug.submitImage")}},[a("el-switch",{attrs:{"active-text":n.$t("debug.yes"),"inactive-text":n.$t("debug.no")},model:{value:n.submitImage,callback:function(f){n.submitImage=f},expression:"submitImage"}})],1):n._e(),n._l(n.debugForm.params,function(f,d){return a("div",{key:d,staticClass:"debug-form-row"},[a("el-form-item",{attrs:{label:`${n.$t("debug.paramLabel")} ${d+1}`}},[a("el-row",{attrs:{gutter:10,type:"flex",align:"middle"}},[a("el-col",{attrs:{span:8}},[a("el-input",{attrs:{placeholder:n.$t("debug.paramName")},on:{input:n.handleDebugParamChange},model:{value:f.key,callback:function(p){n.$set(f,"key",p)},expression:"item.key"}})],1),a("el-col",{attrs:{span:14}},[a("el-input",{attrs:{placeholder:n.$t("debug.paramValue")},on:{input:n.handleDebugParamChange},model:{value:f.value,callback:function(p){n.$set(f,"value",p)},expression:"item.value"}})],1),a("el-col",{attrs:{span:2}},[a("el-button",{staticClass:"delete-param-btn",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(p){return n.removeDebugParam(d)}}})],1)],1)],1)],1)}),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:n.addDebugParam}},[n._v(n._s(n.$t("debug.addParam")))]),a("el-button",{attrs:{type:"warning",icon:"el-icon-refresh",size:"small"},on:{click:n.resetDebugForm}},[n._v(n._s(n.$t("debug.reset")))]),a("el-button",{attrs:{type:"success",icon:"el-icon-check",size:"small",loading:n.debugSubmitting},on:{click:n.submitDebugChatModel}},[n._v(n._s(n.$t("debug.submit")))])],1)],2),n.debugResponse!==null?a("div",{staticClass:"debug-response"},[a("div",{staticClass:"debug-response-header"},[a("span",[n._v(n._s(n.$t("debug.responseResult")))]),a("el-button",{attrs:{type:"text",size:"small"},on:{click:n.toggleDebugResponseView}},[n._v(n._s(n.showDebugRawResponse?n.$t("debug.switchToMarkdown"):n.$t("debug.switchToRaw")))])],1),n.showDebugRawResponse?a("div",{staticClass:"debug-response-raw"},[a("codemirror",{key:`debug-response-${n.selectedSpanId}-${n.debugResponseKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.debugResponse),options:n.cmOptions}})],1):a("div",{staticClass:"debug-response-markdown"},[n.selectedSpan.type==="CHAT_MODEL"&&((o=n.debugResponse)!=null&&o.choices)?a("div",{staticClass:"outputs-section"},n._l(n.debugResponse.choices,function(f,d){return a("div",{key:d,staticClass:"choice-item"},[a("div",{staticClass:"choice-header"},[a("span",[n._v("Choice "+n._s(d))])]),a("div",{staticClass:"choice-content"},[f.message?a("div",[a("div",{staticClass:"message-header"},[a("i",{staticClass:"el-icon-user message-icon"}),a("span",[n._v(n._s(f.message.role))])]),a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(f.message.content),function(p){return a("div",{key:p.key,staticClass:"content-element"},[p.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(p.content)}}):p.type==="image"?a("div",{staticClass:"image-content"},[p.label?a("div",{staticClass:"image-label"},[n._v(n._s(p.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:p.url,alt:"content image"},on:{click:function(y){return n.handleImageClick(p.url)}}})]):n._e()])}),0)]):a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(f),function(p){return a("div",{key:p.key,staticClass:"content-element"},[p.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(p.content)}}):p.type==="image"?a("div",{staticClass:"image-content"},[p.label?a("div",{staticClass:"image-label"},[n._v(n._s(p.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:p.url,alt:"content image"},on:{click:function(y){return n.handleImageClick(p.url)}}})]):n._e()])}),0)])])}),0):a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.debugResponse),function(f){return a("div",{key:f.key,staticClass:"content-element"},[f.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(f.content)}}):f.type==="image"?a("div",{staticClass:"image-content"},[f.label?a("div",{staticClass:"image-label"},[n._v(n._s(f.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:f.url,alt:"content image"},on:{click:function(d){return n.handleImageClick(f.url)}}})]):n._e()])}),0)])]):n._e()],1):n._e()])},Pp=[],zp=An(Rp,Fp,Pp,!1,null,"5a07e1ef");const $p=zp.exports;(function(u,n){(function(a){a(Wt())})(function(a){function o(D,R,K,de,L,w){this.indented=D,this.column=R,this.type=K,this.info=de,this.align=L,this.prev=w}function f(D,R,K,de){var L=D.indented;return D.context&&D.context.type=="statement"&&K!="statement"&&(L=D.context.indented),D.context=new o(L,R,K,de,null,D.context)}function d(D){var R=D.context.type;return(R==")"||R=="]"||R=="}")&&(D.indented=D.context.indented),D.context=D.context.prev}function p(D,R,K){if(R.prevToken=="variable"||R.prevToken=="type"||/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(D.string.slice(0,K))||R.typeAtEndOfLine&&D.column()==D.indentation())return!0}function y(D){for(;;){if(!D||D.type=="top")return!0;if(D.type=="}"&&D.prev.info!="namespace")return!1;D=D.prev}}a.defineMode("clike",function(D,R){var K=D.indentUnit,de=R.statementIndentUnit||K,L=R.dontAlignCalls,w=R.keywords||{},oe=R.types||{},Te=R.builtin||{},Z=R.blockKeywords||{},ce=R.defKeywords||{},ke=R.atoms||{},_e=R.hooks||{},ft=R.multiLineStrings,we=R.indentStatements!==!1,Me=R.indentSwitch!==!1,Ke=R.namespaceSeparator,ct=R.isPunctuationChar||/[\[\]{}\(\),;\:\.]/,Pt=R.numberStart||/[\d\.]/,ht=R.number||/^(?:0x[a-f\d]+|0b[01]+|(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?)(u|ll?|l|f)?/i,dt=R.isOperatorChar||/[+\-*&%=<>!?|\/]/,gt=R.isIdentifierChar||/[\w\$_\xa1-\uffff]/,qt=R.isReservedIdentifier||!1,be,kt;function Gt(ye,xe){var pe=ye.next();if(_e[pe]){var Fe=_e[pe](ye,xe);if(Fe!==!1)return Fe}if(pe=='"'||pe=="'")return xe.tokenize=In(pe),xe.tokenize(ye,xe);if(Pt.test(pe)){if(ye.backUp(1),ye.match(ht))return"number";ye.next()}if(ct.test(pe))return be=pe,null;if(pe=="/"){if(ye.eat("*"))return xe.tokenize=Zn,Zn(ye,xe);if(ye.eat("/"))return ye.skipToEnd(),"comment"}if(dt.test(pe)){for(;!ye.match(/^\/[\/*]/,!1)&&ye.eat(dt););return"operator"}if(ye.eatWhile(gt),Ke)for(;ye.match(Ke);)ye.eatWhile(gt);var De=ye.current();return x(w,De)?(x(Z,De)&&(be="newstatement"),x(ce,De)&&(kt=!0),"keyword"):x(oe,De)?"type":x(Te,De)||qt&&qt(De)?(x(Z,De)&&(be="newstatement"),"builtin"):x(ke,De)?"atom":"variable"}function In(ye){return function(xe,pe){for(var Fe=!1,De,zt=!1;(De=xe.next())!=null;){if(De==ye&&!Fe){zt=!0;break}Fe=!Fe&&De=="\\"}return(zt||!(Fe||ft))&&(pe.tokenize=null),"string"}}function Zn(ye,xe){for(var pe=!1,Fe;Fe=ye.next();){if(Fe=="/"&&pe){xe.tokenize=null;break}pe=Fe=="*"}return"comment"}function wr(ye,xe){R.typeFirstDefinitions&&ye.eol()&&y(xe.context)&&(xe.typeAtEndOfLine=p(ye,xe,ye.pos))}return{startState:function(ye){return{tokenize:null,context:new o((ye||0)-K,0,"top",null,!1),indented:0,startOfLine:!0,prevToken:null}},token:function(ye,xe){var pe=xe.context;if(ye.sol()&&(pe.align==null&&(pe.align=!1),xe.indented=ye.indentation(),xe.startOfLine=!0),ye.eatSpace())return wr(ye,xe),null;be=kt=null;var Fe=(xe.tokenize||Gt)(ye,xe);if(Fe=="comment"||Fe=="meta")return Fe;if(pe.align==null&&(pe.align=!0),be==";"||be==":"||be==","&&ye.match(/^\s*(?:\/\/.*)?$/,!1))for(;xe.context.type=="statement";)d(xe);else if(be=="{")f(xe,ye.column(),"}");else if(be=="[")f(xe,ye.column(),"]");else if(be=="(")f(xe,ye.column(),")");else if(be=="}"){for(;pe.type=="statement";)pe=d(xe);for(pe.type=="}"&&(pe=d(xe));pe.type=="statement";)pe=d(xe)}else be==pe.type?d(xe):we&&((pe.type=="}"||pe.type=="top")&&be!=";"||pe.type=="statement"&&be=="newstatement")&&f(xe,ye.column(),"statement",ye.current());if(Fe=="variable"&&(xe.prevToken=="def"||R.typeFirstDefinitions&&p(ye,xe,ye.start)&&y(xe.context)&&ye.match(/^\s*\(/,!1))&&(Fe="def"),_e.token){var De=_e.token(ye,xe,Fe);De!==void 0&&(Fe=De)}return Fe=="def"&&R.styleDefs===!1&&(Fe="variable"),xe.startOfLine=!1,xe.prevToken=kt?"def":Fe||be,wr(ye,xe),Fe},indent:function(ye,xe){if(ye.tokenize!=Gt&&ye.tokenize!=null||ye.typeAtEndOfLine&&y(ye.context))return a.Pass;var pe=ye.context,Fe=xe&&xe.charAt(0),De=Fe==pe.type;if(pe.type=="statement"&&Fe=="}"&&(pe=pe.prev),R.dontIndentStatements)for(;pe.type=="statement"&&R.dontIndentStatements.test(pe.info);)pe=pe.prev;if(_e.indent){var zt=_e.indent(ye,pe,xe,K);if(typeof zt=="number")return zt}var Qt=pe.prev&&pe.prev.info=="switch";if(R.allmanIndentation&&/[{(]/.test(Fe)){for(;pe.type!="top"&&pe.type!="}";)pe=pe.prev;return pe.indented}return pe.type=="statement"?pe.indented+(Fe=="{"?0:de):pe.align&&(!L||pe.type!=")")?pe.column+(De?0:1):pe.type==")"&&!De?pe.indented+de:pe.indented+(De?0:K)+(!De&&Qt&&!/^(?:case|default)\b/.test(xe)?K:0)},electricInput:Me?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:"//",fold:"brace"}});function m(D){for(var R={},K=D.split(" "),de=0;de<K.length;++de)R[K[de]]=!0;return R}function x(D,R){return typeof D=="function"?D(R):D.propertyIsEnumerable(R)}var S="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile inline restrict asm fortran",A="alignas alignof and and_eq audit axiom bitand bitor catch class compl concept constexpr const_cast decltype delete dynamic_cast explicit export final friend import module mutable namespace new noexcept not not_eq operator or or_eq override private protected public reinterpret_cast requires static_assert static_cast template this thread_local throw try typeid typename using virtual xor xor_eq",E="bycopy byref in inout oneway out self super atomic nonatomic retain copy readwrite readonly strong weak assign typeof nullable nonnull null_resettable _cmd @interface @implementation @end @protocol @encode @property @synthesize @dynamic @class @public @package @private @protected @required @optional @try @catch @finally @import @selector @encode @defs @synchronized @autoreleasepool @compatibility_alias @available",W="FOUNDATION_EXPORT FOUNDATION_EXTERN NS_INLINE NS_FORMAT_FUNCTION NS_RETURNS_RETAINEDNS_ERROR_ENUM NS_RETURNS_NOT_RETAINED NS_RETURNS_INNER_POINTER NS_DESIGNATED_INITIALIZER NS_ENUM NS_OPTIONS NS_REQUIRES_NIL_TERMINATION NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_SWIFT_NAME NS_REFINED_FOR_SWIFT",B=m("int long char short double float unsigned signed void bool"),q=m("SEL instancetype id Class Protocol BOOL");function F(D){return x(B,D)||/.+_t$/.test(D)}function N(D){return F(D)||x(q,D)}var O="case do else for if switch while struct enum union",$="struct enum union";function X(D,R){if(!R.startOfLine)return!1;for(var K,de=null;K=D.peek();){if(K=="\\"&&D.match(/^.$/)){de=X;break}else if(K=="/"&&D.match(/^\/[\/\*]/,!1))break;D.next()}return R.tokenize=de,"meta"}function ne(D,R){return R.prevToken=="type"?"type":!1}function ue(D){return!D||D.length<2||D[0]!="_"?!1:D[1]=="_"||D[1]!==D[1].toLowerCase()}function se(D){return D.eatWhile(/[\w\.']/),"number"}function he(D,R){if(D.backUp(1),D.match(/^(?:R|u8R|uR|UR|LR)/)){var K=D.match(/^"([^\s\\()]{0,16})\(/);return K?(R.cpp11RawStringDelim=K[1],R.tokenize=ie,ie(D,R)):!1}return D.match(/^(?:u8|u|U|L)/)?D.match(/^["']/,!1)?"string":!1:(D.next(),!1)}function Oe(D){var R=/(\w+)::~?(\w+)$/.exec(D);return R&&R[1]==R[2]}function Re(D,R){for(var K;(K=D.next())!=null;)if(K=='"'&&!D.eat('"')){R.tokenize=null;break}return"string"}function ie(D,R){var K=R.cpp11RawStringDelim.replace(/[^\w\s]/g,"\\$&"),de=D.match(new RegExp(".*?\\)"+K+'"'));return de?R.tokenize=null:D.skipToEnd(),"string"}function ze(D,R){typeof D=="string"&&(D=[D]);var K=[];function de(w){if(w)for(var oe in w)w.hasOwnProperty(oe)&&K.push(oe)}de(R.keywords),de(R.types),de(R.builtin),de(R.atoms),K.length&&(R.helperType=D[0],a.registerHelper("hintWords",D[0],K));for(var L=0;L<D.length;++L)a.defineMIME(D[L],R)}ze(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:m(S),types:F,blockKeywords:m(O),defKeywords:m($),typeFirstDefinitions:!0,atoms:m("NULL true false"),isReservedIdentifier:ue,hooks:{"#":X,"*":ne},modeProps:{fold:["brace","include"]}}),ze(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:m(S+" "+A),types:F,blockKeywords:m(O+" class try catch"),defKeywords:m($+" class namespace"),typeFirstDefinitions:!0,atoms:m("true false NULL nullptr"),dontIndentStatements:/^template$/,isIdentifierChar:/[\w\$_~\xa1-\uffff]/,isReservedIdentifier:ue,hooks:{"#":X,"*":ne,u:he,U:he,L:he,R:he,0:se,1:se,2:se,3:se,4:se,5:se,6:se,7:se,8:se,9:se,token:function(D,R,K){if(K=="variable"&&D.peek()=="("&&(R.prevToken==";"||R.prevToken==null||R.prevToken=="}")&&Oe(D.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),ze("text/x-java",{name:"clike",keywords:m("abstract assert break case catch class const continue default do else enum extends final finally for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while @interface"),types:m("var byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:m("catch class do else finally for if switch try while"),defKeywords:m("class interface enum @interface"),typeFirstDefinitions:!0,atoms:m("true false null"),number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(D){return D.match("interface",!1)?!1:(D.eatWhile(/[\w\$_]/),"meta")},'"':function(D,R){return D.match(/""$/)?(R.tokenize=H,R.tokenize(D,R)):!1}},modeProps:{fold:["brace","import"]}}),ze("text/x-csharp",{name:"clike",keywords:m("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in init interface internal is lock namespace new operator out override params private protected public readonly record ref required return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:m("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:m("catch class do else finally for foreach if struct switch try while"),defKeywords:m("class interface namespace record struct var"),typeFirstDefinitions:!0,atoms:m("true false null"),hooks:{"@":function(D,R){return D.eat('"')?(R.tokenize=Re,Re(D,R)):(D.eatWhile(/[\w\$_]/),"meta")}}});function H(D,R){for(var K=!1;!D.eol();){if(!K&&D.match('"""')){R.tokenize=null;break}K=D.next()=="\\"&&!K}return"string"}function Q(D){return function(R,K){for(var de;de=R.next();)if(de=="*"&&R.eat("/"))if(D==1){K.tokenize=null;break}else return K.tokenize=Q(D-1),K.tokenize(R,K);else if(de=="/"&&R.eat("*"))return K.tokenize=Q(D+1),K.tokenize(R,K);return"comment"}}ze("text/x-scala",{name:"clike",keywords:m("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble"),types:m("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:m("catch class enum do else finally for forSome if match switch try while"),defKeywords:m("class enum def object package trait type val var"),atoms:m("true false null"),indentStatements:!1,indentSwitch:!1,isOperatorChar:/[+\-*&%=<>!?|\/#:@]/,hooks:{"@":function(D){return D.eatWhile(/[\w\$_]/),"meta"},'"':function(D,R){return D.match('""')?(R.tokenize=H,R.tokenize(D,R)):!1},"'":function(D){return D.match(/^(\\[^'\s]+|[^\\'])'/)?"string-2":(D.eatWhile(/[\w\$_\xa1-\uffff]/),"atom")},"=":function(D,R){var K=R.context;return K.type=="}"&&K.align&&D.eat(">")?(R.context=new o(K.indented,K.column,K.type,K.info,null,K.prev),"operator"):!1},"/":function(D,R){return D.eat("*")?(R.tokenize=Q(1),R.tokenize(D,R)):!1}},modeProps:{closeBrackets:{pairs:'()[]{}""',triples:'"'}}});function k(D){return function(R,K){for(var de=!1,L,w=!1;!R.eol();){if(!D&&!de&&R.match('"')){w=!0;break}if(D&&R.match('"""')){w=!0;break}L=R.next(),!de&&L=="$"&&R.match("{")&&R.skipTo("}"),de=!de&&L=="\\"&&!D}return(w||!D)&&(K.tokenize=null),"string"}}ze("text/x-kotlin",{name:"clike",keywords:m("package as typealias class interface this super val operator var fun for is in This throw return annotation break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix suspend actual expect setparam value"),types:m("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void Annotation Any BooleanArray ByteArray Char CharArray DeprecationLevel DoubleArray Enum FloatArray Function Int IntArray Lazy LazyThreadSafetyMode LongArray Nothing ShortArray Unit"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+(\.\d+)?|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,blockKeywords:m("catch class do else finally for if where try while enum"),defKeywords:m("class val var object interface fun"),atoms:m("true false null this"),hooks:{"@":function(D){return D.eatWhile(/[\w\$_]/),"meta"},"*":function(D,R){return R.prevToken=="."?"variable":"operator"},'"':function(D,R){return R.tokenize=k(D.match('""')),R.tokenize(D,R)},"/":function(D,R){return D.eat("*")?(R.tokenize=Q(1),R.tokenize(D,R)):!1},indent:function(D,R,K,de){var L=K&&K.charAt(0);if((D.prevToken=="}"||D.prevToken==")")&&K=="")return D.indented;if(D.prevToken=="operator"&&K!="}"&&D.context.type!="}"||D.prevToken=="variable"&&L=="."||(D.prevToken=="}"||D.prevToken==")")&&L==".")return de*2+R.indented;if(R.align&&R.type=="}")return R.indented+(D.context.type==(K||"").charAt(0)?0:de)}},modeProps:{closeBrackets:{triples:'"'}}}),ze(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:m("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:m("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:m("for while do if else struct"),builtin:m("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:m("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TextureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":X},modeProps:{fold:["brace","include"]}}),ze("text/x-nesc",{name:"clike",keywords:m(S+" as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:F,blockKeywords:m(O),atoms:m("null true false"),hooks:{"#":X},modeProps:{fold:["brace","include"]}}),ze("text/x-objectivec",{name:"clike",keywords:m(S+" "+E),types:N,builtin:m(W),blockKeywords:m(O+" @synthesize @try @catch @finally @autoreleasepool @synchronized"),defKeywords:m($+" @interface @implementation @protocol @class"),dontIndentStatements:/^@.*$/,typeFirstDefinitions:!0,atoms:m("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ue,hooks:{"#":X,"*":ne},modeProps:{fold:["brace","include"]}}),ze("text/x-objectivec++",{name:"clike",keywords:m(S+" "+E+" "+A),types:N,builtin:m(W),blockKeywords:m(O+" @synthesize @try @catch @finally @autoreleasepool @synchronized class try catch"),defKeywords:m($+" @interface @implementation @protocol @class class namespace"),dontIndentStatements:/^@.*$|^template$/,typeFirstDefinitions:!0,atoms:m("YES NO NULL Nil nil true false nullptr"),isReservedIdentifier:ue,hooks:{"#":X,"*":ne,u:he,U:he,L:he,R:he,0:se,1:se,2:se,3:se,4:se,5:se,6:se,7:se,8:se,9:se,token:function(D,R,K){if(K=="variable"&&D.peek()=="("&&(R.prevToken==";"||R.prevToken==null||R.prevToken=="}")&&Oe(D.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),ze("text/x-squirrel",{name:"clike",keywords:m("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:F,blockKeywords:m("case catch class else for foreach if switch try while"),defKeywords:m("function local class"),typeFirstDefinitions:!0,atoms:m("true false null"),hooks:{"#":X},modeProps:{fold:["brace","include"]}});var J=null;function G(D){return function(R,K){for(var de=!1,L,w=!1;!R.eol();){if(!de&&R.match('"')&&(D=="single"||R.match('""'))){w=!0;break}if(!de&&R.match("``")){J=G(D),w=!0;break}L=R.next(),de=D=="single"&&!de&&L=="\\"}return w&&(K.tokenize=null),"string"}}ze("text/x-ceylon",{name:"clike",keywords:m("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(D){var R=D.charAt(0);return R===R.toUpperCase()&&R!==R.toLowerCase()},blockKeywords:m("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:m("class dynamic function interface module object package value"),builtin:m("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:m("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(D){return D.eatWhile(/[\w\$_]/),"meta"},'"':function(D,R){return R.tokenize=G(D.match('""')?"triple":"single"),R.tokenize(D,R)},"`":function(D,R){return!J||!D.match("`")?!1:(R.tokenize=J,J=null,R.tokenize(D,R))},"'":function(D){return D.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(D,R,K){if((K=="variable"||K=="type")&&R.prevToken==".")return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})})})();const Bp={name:"TraceDetailDrawer",components:{TraceSpanTree:qa,DebugTab:$p,codemirror:co.codemirror},props:{visible:{type:Boolean,default:!1},currentTraceId:{type:String,default:null},traceInfo:{type:Object,default:()=>({})},spans:{type:Array,default:()=>[]},filteredSpans:{type:Array,default:()=>[]},selectedSpanId:{type:String,default:null},selectedSpan:{type:Object,default:null},loading:{type:Boolean,default:!1}},data(){return{localVisible:this.visible,spanSearchQuery:"",activeTab:"io",activeCollapse:["inputs","outputs"],messageCollapse:[],rawIoCollapse:["rawInputs","rawOutputs"],rawInputsKey:0,rawOutputsKey:0,eventsCollapse:[],eventsKey:0,cmOptions:{tabSize:2,mode:{name:"javascript",json:!0},theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:2,styleActiveLine:!0},cmOptionsJava:{tabSize:4,mode:"text/x-java",theme:"monokai",lineNumbers:!0,lineWrapping:!0,readOnly:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],matchBrackets:!0,autoCloseBrackets:!0,indentUnit:4,styleActiveLine:!0},viewerOptions:{inline:!1,button:!0,navbar:!0,title:!0,toolbar:!0,tooltip:!0,movable:!0,zoomable:!0,rotatable:!0,scalable:!0,transition:!0,fullscreen:!0,keyboard:!0,zIndex:9999}}},computed:{drawerTitle(){let u=this.traceInfo.trace_name;return u||(u=this.traceInfo.trace_id),u?this.$t("trace.traceDetail")+": "+u:this.$t("trace.traceDetail")},traceStartTime(){return this.spans.length===0?0:Math.min(...this.spans.map(u=>u.start_time_unix_nano))},traceEndTime(){return this.spans.length===0?0:Math.max(...this.spans.map(u=>u.end_time_unix_nano))},hasInputs(){var u,n;return((n=(u=this.selectedSpan)==null?void 0:u.parsedContent)==null?void 0:n.inputs)!==void 0},hasOutputs(){var u,n;return((n=(u=this.selectedSpan)==null?void 0:u.parsedContent)==null?void 0:n.outputs)!==void 0},attributesData(){var u,n;return(n=(u=this.selectedSpan)==null?void 0:u.parsedContent)!=null&&n.attributes?Object.entries(this.selectedSpan.parsedContent.attributes).filter(([a])=>!a.startsWith("langsword.span")).map(([a,o])=>({key:a,value:typeof o=="string"?o:JSON.stringify(o,null,2)})):[]},rawInputs(){var u,n,a;return(a=(n=(u=this.selectedSpan)==null?void 0:u.parsedContent)==null?void 0:n.attributes)==null?void 0:a["langsword.spanInputs"]},rawOutputs(){var u,n,a;return(a=(n=(u=this.selectedSpan)==null?void 0:u.parsedContent)==null?void 0:n.attributes)==null?void 0:a["langsword.spanOutputs"]},hasEvents(){var n,a,o;if(((n=this.selectedSpan)==null?void 0:n.has_events)!==void 0)return this.selectedSpan.has_events===!0;const u=(o=(a=this.selectedSpan)==null?void 0:a.parsedContent)==null?void 0:o.events;return u&&Array.isArray(u)&&u.length>0},spanEvents(){var n,a;const u=(a=(n=this.selectedSpan)==null?void 0:n.parsedContent)==null?void 0:a.events;return!u||!Array.isArray(u)?[]:u},showDebugTab(){var u,n;if(!this.selectedSpan)return!1;if(this.selectedSpan.type==="CLIENT"){const a=(n=(u=this.selectedSpan)==null?void 0:u.parsedContent)==null?void 0:n.inputs;if(!a){const o=this.rawInputs;if(o)try{const f=typeof o=="string"?JSON.parse(o):o;return f&&f.file&&(f.file.filename||f.file.content)}catch{return!1}return!1}return a&&a.file&&(a.file.filename||a.file.content)}return this.selectedSpan.type==="CHAT_MODEL"}},watch:{visible(u){this.localVisible=u,u||(this.spanSearchQuery="")},localVisible(u){this.$emit("update:visible",u)},activeTab(u){u==="raw"&&this.$nextTick(()=>{this.rawInputsKey++,this.rawOutputsKey++}),u==="events"&&this.$nextTick(()=>{this.eventsKey++})},selectedSpan(){var f;if(!this.selectedSpan)return;const u=this.selectedSpan.type==="CLIENT"||this.selectedSpan.type==="CHAT_MODEL",n=this.selectedSpan.has_events===!0||((f=this.selectedSpan.parsedContent)==null?void 0:f.events)&&Array.isArray(this.selectedSpan.parsedContent.events)&&this.selectedSpan.parsedContent.events.length>0,a=[];u&&a.push("io","raw"),this.showDebugTab&&a.push("debug"),a.push("attributes"),n&&a.push("events");let o="attributes";u&&(o="io"),a.includes(o)?this.activeTab=o:this.activeTab="attributes",this.$nextTick(()=>{this.updateCollapseStates(),this.activeTab==="raw"&&(this.rawInputsKey++,this.rawOutputsKey++),this.activeTab==="events"&&this.eventsKey++})}},methods:{handleClose(u){this.$emit("close"),u&&typeof u=="function"&&u()},handleSpanSearch(){this.$emit("span-search",this.spanSearchQuery)},handleSpanSelect(u){this.$emit("span-select",u),this.$nextTick(()=>{this.updateCollapseStates()})},updateCollapseStates(){var a,o,f,d,p;this.activeCollapse=["inputs","outputs"],(f=(o=(a=this.selectedSpan)==null?void 0:a.parsedContent)==null?void 0:o.inputs)!=null&&f.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((y,m)=>`message-${m}`):this.messageCollapse=[],this.rawIoCollapse=["rawInputs","rawOutputs"];const u=(p=(d=this.selectedSpan)==null?void 0:d.parsedContent)==null?void 0:p.events;u&&Array.isArray(u)&&u.length>0?this.eventsCollapse=u.map((y,m)=>`event-${m}`):this.eventsCollapse=[]},parseContentData(u){const n={attributes:u.attributes||{},events:u.events||[],status:u.status||{}};if(u.inputs&&(n.inputs=u.inputs),u.outputs&&(n.outputs=u.outputs),n.attributes){const a=n.attributes["langsword.spanInputs"],o=n.attributes["langsword.spanOutputs"];if(a)try{n.inputs=typeof a=="string"?JSON.parse(a):a}catch{try{const d=a.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.inputs=JSON.parse(d)}catch{n.inputs=a}}if(o)try{n.outputs=typeof o=="string"?JSON.parse(o):o}catch{try{const d=o.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.outputs=JSON.parse(d)}catch{n.outputs=o}}}return n},getStatusType(u){if(!u)return"info";const n=u.toUpperCase();return n==="OK"||n==="SUCCESS"?"success":n==="ERROR"||n==="FAILED"?"danger":n==="WARNING"||n==="WARN"?"warning":"info"},formatNanoDuration(u){if(!u)return"-";const n=u/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`},formatTimestamp(u){if(!u)return"-";const n=typeof u=="string"?parseInt(u,10):u,a=new Date(n);return isNaN(a.getTime())?"-":a.toLocaleString("zh-CN")},formatEventTimestamp(u){if(!u)return"-";const n=u/1e6,a=new Date(n);return isNaN(a.getTime())?"-":a.toLocaleString("zh-CN")},getEventAttributesData(u){return!u||!u.attributes?[]:Object.entries(u.attributes).map(([n,a])=>({key:n,value:typeof a=="string"?a:JSON.stringify(a,null,2)}))},getOtherEventAttributes(u){if(!u||!u.attributes)return[];const n=["exception.type","exception.message","exception.stacktrace"];return Object.entries(u.attributes).filter(([a])=>!n.includes(a)).map(([a,o])=>({key:a,value:typeof o=="string"?o:JSON.stringify(o,null,2)}))},formatRawJson(u){if(!u)return"";if(typeof u=="string")try{const n=JSON.parse(u);return JSON.stringify(n,null,2)}catch{return u}return JSON.stringify(u,null,2)},getMessageIcon(u){return{user:"el-icon-user",assistant:"el-icon-service",system:"el-icon-setting"}[u]||"el-icon-document"},extractImagesFromObject(u,n=[],a=""){if(!(!u||typeof u!="object")){for(const[o,f]of Object.entries(u)){const d=a?`${a}.${o}`:o;typeof f=="string"&&f.trim()!==""?(f.startsWith("data:image/")||f.startsWith("/9j/")||f.startsWith("iVBOR")||f.startsWith("R0lGOD"))&&(n.push({path:d,value:f,label:o==="content"&&a?`${a.split(".").pop()}: ${o}`:o}),u[o]="[IMAGE_DATA]"):f&&typeof f=="object"&&!Array.isArray(f)?this.extractImagesFromObject(f,n,d):Array.isArray(f)&&f.forEach((p,y)=>{p&&typeof p=="object"&&this.extractImagesFromObject(p,n,`${d}[${y}]`)})}return n}},renderStructuredContent(u){const n=[];if(!u)return n;try{if(Array.isArray(u))u.forEach((a,o)=>{var f;a&&typeof a=="object"?a.type==="text"&&a.text?n.push({type:"markdown",content:Le(a.text),key:`text-${o}`}):a.type==="image_url"&&((f=a.image_url)!=null&&f.url)?n.push({type:"image",url:a.image_url.url,key:`image-${o}`}):a.image_base64&&a.image_base64.trim()!==""?n.push({type:"image",url:this.formatBase64Image(a.image_base64),key:`base64-image-${o}`}):n.push({type:"markdown",content:Le("```json\n"+JSON.stringify(a,null,2)+"\n```"),key:`json-${o}`}):n.push({type:"markdown",content:Le(String(a)),key:`text-${o}`})});else if(typeof u=="string")n.push({type:"markdown",content:Le(u),key:"text-0"});else if(typeof u=="object")if(u.data&&Array.isArray(u.data.result)){const a=JSON.parse(JSON.stringify(u)),o=[];a.data&&a.data.result&&a.data.result.forEach((f,d)=>{f.image_base64&&f.image_base64.trim()!==""&&(o.push({type:"page",image_base64:f.image_base64,page_num:f.page_num,label:f.page_num!==void 0?`Page ${f.page_num}`:`Result ${d}`}),f.image_base64="[BASE64_IMAGE_DATA]"),f.seals&&Array.isArray(f.seals)&&f.seals.forEach((p,y)=>{p.image_base64&&p.image_base64.trim()!==""&&(o.push({type:"seal",image_base64:p.image_base64,page_num:f.page_num,seal_index:y,seal_value:p.value,label:`Seal: ${p.value||y}`}),p.image_base64="[BASE64_IMAGE_DATA]")})}),n.push({type:"markdown",content:Le("```json\n"+JSON.stringify(a,null,2)+"\n```"),key:"json-0"}),o.forEach((f,d)=>{n.push({type:"image",url:this.formatBase64Image(f.image_base64),key:`result-image-${d}`,label:f.label})})}else{const a=JSON.parse(JSON.stringify(u)),o=[];this.extractImagesFromObject(a,o),n.push({type:"markdown",content:Le("```json\n"+JSON.stringify(a,null,2)+"\n```"),key:"json-0"}),o.forEach((f,d)=>{n.push({type:"image",url:this.formatBase64Image(f.value),key:`extracted-image-${d}`,label:f.label})})}else n.push({type:"markdown",content:Le(String(u)),key:"text-0"})}catch(a){console.error("Error rendering content:",a),n.push({type:"markdown",content:Le("Error rendering content"),key:"error-0"})}return n},formatBase64Image(u){return u?u.startsWith("data:image")?u:u.startsWith("/9j/")?`data:image/jpeg;base64,${u}`:u.startsWith("iVBOR")?`data:image/png;base64,${u}`:u.startsWith("R0lGOD")?`data:image/gif;base64,${u}`:`data:image/jpeg;base64,${u}`:""},handleImageClick(u){Rl({options:this.viewerOptions,images:[u]})}}};var Hp=function(){var o,f,d,p,y,m;var n=this,a=n._self._c;return a("el-drawer",{attrs:{visible:n.localVisible,"with-header":!0,title:n.drawerTitle,size:"90%",direction:"rtl","before-close":n.handleClose},on:{"update:visible":function(x){n.localVisible=x}}},[n.currentTraceId?a("div",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}],staticClass:"trace-detail-content",attrs:{"element-loading-text":"加载中..."}},[a("div",{staticClass:"trace-info-section"},[a("el-descriptions",{attrs:{column:3,border:""}},[a("el-descriptions-item",{attrs:{label:n.$t("trace.traceId")}},[n._v(n._s(n.traceInfo.trace_id))]),a("el-descriptions-item",{attrs:{label:n.$t("trace.status")}},[a("el-tag",{attrs:{type:n.getStatusType(n.traceInfo.status),size:"mini"}},[n._v(" "+n._s(n.traceInfo.status)+" ")])],1),a("el-descriptions-item",{attrs:{label:n.$t("trace.executionTime")}},[n._v(" "+n._s(n.formatNanoDuration(n.traceInfo.execution_time_ms))+" ")]),a("el-descriptions-item",{attrs:{label:n.$t("trace.timeCreated")}},[n._v(" "+n._s(n.formatTimestamp(n.traceInfo.timestamp_ms))+" ")]),a("el-descriptions-item",{attrs:{label:n.$t("trace.experimentId")}},[n._v(n._s(n.traceInfo.experiment_id))]),a("el-descriptions-item",{attrs:{label:n.$t("trace.traceType")}},[a("el-tag",{attrs:{size:"mini",type:"info"}},[n._v(n._s(n.traceInfo.trace_type||"-"))])],1),a("el-descriptions-item",{attrs:{label:n.$t("trace.traceName"),span:2}},[n._v(" "+n._s(n.traceInfo.trace_name||"-")+" ")])],1)],1),a("el-divider"),a("el-row",{attrs:{gutter:20}},[a("el-col",{staticClass:"span-tree-col",attrs:{span:8}},[a("el-card",[a("div",{attrs:{slot:"header"},slot:"header"},[a("el-input",{attrs:{placeholder:n.$t("span.searchTree"),"prefix-icon":"el-icon-search",size:"small",clearable:""},on:{input:n.handleSpanSearch},model:{value:n.spanSearchQuery,callback:function(x){n.spanSearchQuery=x},expression:"spanSearchQuery"}})],1),a("TraceSpanTree",{attrs:{spans:n.filteredSpans,"selected-span-id":n.selectedSpanId,"trace-start-time":n.traceStartTime,"trace-end-time":n.traceEndTime},on:{"span-select":n.handleSpanSelect}})],1)],1),a("el-col",{staticClass:"span-detail-col",attrs:{span:16}},[a("el-card",[n.selectedSpan?a("div",{staticClass:"span-detail-content"},[a("el-tabs",{key:`tabs-${n.selectedSpanId}`,model:{value:n.activeTab,callback:function(x){n.activeTab=x},expression:"activeTab"}},[n.selectedSpan.type==="CLIENT"||n.selectedSpan.type==="CHAT_MODEL"?a("el-tab-pane",{attrs:{label:`${n.$t("trace.inputs")} / ${n.$t("trace.outputs")}`,name:"io"}},[a("div",{staticClass:"io-content"},[n.hasInputs?a("div",{staticClass:"io-section"},[a("el-collapse",{model:{value:n.activeCollapse,callback:function(x){n.activeCollapse=x},expression:"activeCollapse"}},[a("el-collapse-item",{attrs:{title:n.$t("trace.inputs"),name:"inputs"}},[(f=(o=n.selectedSpan.parsedContent)==null?void 0:o.inputs)!=null&&f.messages?a("div",{staticClass:"messages-section"},n._l(n.selectedSpan.parsedContent.inputs.messages,function(x,S){return a("div",{key:S,staticClass:"message-item"},[a("el-collapse",{model:{value:n.messageCollapse,callback:function(A){n.messageCollapse=A},expression:"messageCollapse"}},[a("el-collapse-item",{attrs:{name:`message-${S}`}},[a("template",{slot:"title"},[a("i",{staticClass:"message-icon",class:n.getMessageIcon(x.role)}),a("span",{staticClass:"message-role"},[n._v(n._s(x.role))])]),a("div",{staticClass:"message-content"},[a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(x.content),function(A){return a("div",{key:A.key,staticClass:"content-element"},[A.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(A.content)}}):A.type==="image"?a("div",{staticClass:"image-content"},[A.label?a("div",{staticClass:"image-label"},[n._v(n._s(A.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:A.url,alt:"content image"},on:{click:function(E){return n.handleImageClick(A.url)}}})]):n._e()])}),0)])],2)],1)],1)}),0):(d=n.selectedSpan.parsedContent)!=null&&d.inputs?a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.selectedSpan.parsedContent.inputs),function(x){return a("div",{key:x.key,staticClass:"content-element"},[x.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(x.content)}}):x.type==="image"?a("div",{staticClass:"image-content"},[x.label?a("div",{staticClass:"image-label"},[n._v(n._s(x.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:x.url,alt:"content image"},on:{click:function(S){return n.handleImageClick(x.url)}}})]):n._e()])}),0):a("div",{staticClass:"empty-content"},[a("el-empty",{attrs:{description:n.$t("trace.noInputs"),"image-size":80}})],1)])],1)],1):n._e(),n.hasOutputs?a("div",{staticClass:"io-section"},[a("el-collapse",{model:{value:n.activeCollapse,callback:function(x){n.activeCollapse=x},expression:"activeCollapse"}},[a("el-collapse-item",{attrs:{title:n.$t("trace.outputs"),name:"outputs"}},[(y=(p=n.selectedSpan.parsedContent)==null?void 0:p.outputs)!=null&&y.choices?a("div",{staticClass:"outputs-section"},n._l(n.selectedSpan.parsedContent.outputs.choices,function(x,S){return a("div",{key:S,staticClass:"choice-item"},[a("div",{staticClass:"choice-header"},[a("span",[n._v("Choice "+n._s(S))])]),a("div",{staticClass:"choice-content"},[x.message?a("div",[a("div",{staticClass:"message-header"},[a("i",{staticClass:"el-icon-user message-icon"}),a("span",[n._v(n._s(x.message.role))])]),a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(x.message.content),function(A){return a("div",{key:A.key,staticClass:"content-element"},[A.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(A.content)}}):A.type==="image"?a("div",{staticClass:"image-content"},[A.label?a("div",{staticClass:"image-label"},[n._v(n._s(A.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:A.url,alt:"content image"},on:{click:function(E){return n.handleImageClick(A.url)}}})]):n._e()])}),0)]):a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(x),function(A){return a("div",{key:A.key,staticClass:"content-element"},[A.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(A.content)}}):A.type==="image"?a("div",{staticClass:"image-content"},[A.label?a("div",{staticClass:"image-label"},[n._v(n._s(A.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:A.url,alt:"content image"},on:{click:function(E){return n.handleImageClick(A.url)}}})]):n._e()])}),0)])])}),0):(m=n.selectedSpan.parsedContent)!=null&&m.outputs?a("div",{staticClass:"structured-content"},n._l(n.renderStructuredContent(n.selectedSpan.parsedContent.outputs),function(x){return a("div",{key:x.key,staticClass:"content-element"},[x.type==="markdown"?a("div",{staticClass:"markdown-content",domProps:{innerHTML:n._s(x.content)}}):x.type==="image"?a("div",{staticClass:"image-content"},[x.label?a("div",{staticClass:"image-label"},[n._v(n._s(x.label))]):n._e(),a("img",{staticClass:"content-image",attrs:{src:x.url,alt:"content image"},on:{click:function(S){return n.handleImageClick(x.url)}}})]):n._e()])}),0):a("div",{staticClass:"empty-content"},[a("el-empty",{attrs:{description:n.$t("trace.noOutputs"),"image-size":80}})],1)])],1)],1):n._e(),!n.hasInputs&&!n.hasOutputs?a("div",{staticClass:"empty-io"},[a("el-empty",{attrs:{description:n.$t("trace.noIoData")}})],1):n._e()])]):n._e(),a("el-tab-pane",{attrs:{label:n.$t("trace.attributes"),name:"attributes"}},[a("el-table",{staticClass:"attributes-table",attrs:{data:n.attributesData,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"250"},scopedSlots:n._u([{key:"default",fn:function(x){return[a("el-tooltip",{attrs:{content:x.row.key,placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[a("span",{staticClass:"attribute-key"},[n._v(n._s(x.row.key))])])]}}],null,!1,688878823)}),a("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")},scopedSlots:n._u([{key:"default",fn:function(x){return[a("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[a("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[n._v(n._s(x.row.value))]),a("div",{staticClass:"attribute-value"},[n._v(n._s(x.row.value))])])]}}],null,!1,4281519148)})],1)],1),n.selectedSpan.type==="CLIENT"||n.selectedSpan.type==="CHAT_MODEL"?a("el-tab-pane",{attrs:{label:n.$t("trace.rawInputsOutputs"),name:"raw"}},[n.activeTab==="raw"?a("div",{staticClass:"raw-io-content"},[n.rawInputs?a("div",{staticClass:"raw-io-section"},[a("el-collapse",{model:{value:n.rawIoCollapse,callback:function(x){n.rawIoCollapse=x},expression:"rawIoCollapse"}},[a("el-collapse-item",{attrs:{title:n.$t("trace.rawInputs"),name:"rawInputs"}},[a("codemirror",{key:`raw-inputs-${n.selectedSpanId}-${n.rawInputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.rawInputs),options:n.cmOptions}})],1)],1)],1):n._e(),n.rawOutputs?a("div",{staticClass:"raw-io-section"},[a("el-collapse",{model:{value:n.rawIoCollapse,callback:function(x){n.rawIoCollapse=x},expression:"rawIoCollapse"}},[a("el-collapse-item",{attrs:{title:n.$t("trace.rawOutputs"),name:"rawOutputs"}},[a("codemirror",{key:`raw-outputs-${n.selectedSpanId}-${n.rawOutputsKey}`,staticClass:"code-editor-wrapper",attrs:{value:n.formatRawJson(n.rawOutputs),options:n.cmOptions}})],1)],1)],1):n._e(),!n.rawInputs&&!n.rawOutputs?a("div",{staticClass:"empty-raw-io"},[a("el-empty",{attrs:{description:n.$t("trace.noIoData")}})],1):n._e()]):n._e()]):n._e(),n.showDebugTab?a("el-tab-pane",{attrs:{label:"快速调试",name:"debug"}},[a("DebugTab",{directives:[{name:"show",rawName:"v-show",value:n.activeTab==="debug",expression:"activeTab === 'debug'"}],attrs:{"selected-span":n.selectedSpan,"selected-span-id":n.selectedSpanId}})],1):n._e(),n.hasEvents?a("el-tab-pane",{attrs:{label:n.$t("trace.events"),name:"events"}},[n.activeTab==="events"?a("div",{staticClass:"events-content"},[a("el-collapse",{model:{value:n.eventsCollapse,callback:function(x){n.eventsCollapse=x},expression:"eventsCollapse"}},n._l(n.spanEvents,function(x,S){return a("el-collapse-item",{key:`event-${S}`,attrs:{name:`event-${S}`}},[a("template",{slot:"title"},[a("div",{staticClass:"event-header"},[a("el-tag",{staticClass:"event-name-tag",attrs:{type:x.name==="exception"?"danger":"info",size:"mini"}},[n._v(" "+n._s(x.name)+" ")]),a("span",{staticClass:"event-time"},[n._v(n._s(n.formatEventTimestamp(x.timestamp)))])],1)]),a("div",{staticClass:"event-detail"},[x.name==="exception"?a("div",{staticClass:"exception-content"},[x.attributes["exception.type"]?a("div",{staticClass:"exception-field"},[a("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionType")))]),a("div",{staticClass:"field-value exception-type"},[n._v(n._s(x.attributes["exception.type"]))])]):n._e(),x.attributes["exception.message"]?a("div",{staticClass:"exception-field"},[a("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionMessage")))]),a("div",{staticClass:"field-value exception-message"},[n._v(n._s(x.attributes["exception.message"]))])]):n._e(),x.attributes["exception.stacktrace"]?a("div",{staticClass:"exception-field"},[a("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.exceptionStacktrace")))]),a("codemirror",{key:`stacktrace-${n.selectedSpanId}-${S}-${n.eventsKey}`,staticClass:"code-editor-wrapper stacktrace-editor",attrs:{value:x.attributes["exception.stacktrace"],options:n.cmOptionsJava}})],1):n._e(),n.getOtherEventAttributes(x).length>0?a("div",{staticClass:"exception-field"},[a("div",{staticClass:"field-label"},[n._v(n._s(n.$t("trace.otherAttributes")))]),a("el-table",{attrs:{data:n.getOtherEventAttributes(x),border:"",stripe:"",size:"mini"}},[a("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"200"}}),a("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")}})],1)],1):n._e()]):a("div",{staticClass:"general-event-content"},[a("el-table",{attrs:{data:n.getEventAttributesData(x),border:"",stripe:"",size:"mini"}},[a("el-table-column",{attrs:{prop:"key",label:n.$t("trace.key"),width:"200"},scopedSlots:n._u([{key:"default",fn:function(A){return[a("el-tooltip",{attrs:{content:A.row.key,placement:"top","open-delay":500}},[a("span",{staticClass:"attribute-key"},[n._v(n._s(A.row.key))])])]}}],null,!0)}),a("el-table-column",{attrs:{prop:"value",label:n.$t("trace.value")},scopedSlots:n._u([{key:"default",fn:function(A){return[a("el-tooltip",{attrs:{placement:"top","open-delay":500,"popper-class":"attribute-tooltip"}},[a("div",{staticClass:"attribute-tooltip-content",attrs:{slot:"content"},slot:"content"},[n._v(n._s(A.row.value))]),a("div",{staticClass:"attribute-value"},[n._v(n._s(A.row.value))])])]}}],null,!0)})],1)],1)])],2)}),1),n.spanEvents.length===0?a("div",{staticClass:"empty-events"},[a("el-empty",{attrs:{description:n.$t("trace.noEvents")}})],1):n._e()],1):n._e()]):n._e()],1)],1):a("el-empty",{attrs:{description:n.$t("trace.selectSpan")}})],1)],1)],1)],1):n._e()])},Wp=[],jp=An(Bp,Hp,Wp,!1,null,"af1e0db8");const Up={name:"Trace",components:{TraceDetailDrawer:jp.exports},data(){return{traceList:[],filteredTraceList:[],searchQuery:"",dateRange:null,experimentList:[],selectedExperimentId:null,loading:!1,deleteLoading:!1,showColumnDialog:!1,selectedColumns:["trace_id","timestamp_ms","status","execution_time_ms","trace_type","trace_name"],visibleColumns:{trace_id:!0,timestamp_ms:!0,status:!0,execution_time_ms:!0,trace_type:!0,trace_name:!0},drawerVisible:!1,currentTraceId:null,traceInfo:{},spans:[],filteredSpans:[],spanSearchQuery:"",selectedSpanId:null,selectedSpan:null,activeTab:"io",drawerLoading:!1,messageCollapse:[],eventsCollapse:[],pageNo:1,pageSize:10,total:0,pickerOptions:{shortcuts:[{text:"近7天",onClick(u){const n=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24*7),u.$emit("pick",[a,n])}},{text:"近30天",onClick(u){const n=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24*30),u.$emit("pick",[a,n])}},{text:"7天前",onClick(u){const n=new Date;n.setTime(n.getTime()-3600*1e3*24*7),n.setHours(23,59,59,999);const a=n.getTime();u.$emit("pick",[null,a])}},{text:"30天前",onClick(u){const n=new Date;n.setTime(n.getTime()-3600*1e3*24*30),n.setHours(23,59,59,999);const a=n.getTime();u.$emit("pick",[null,a])}}]}}},computed:{},watch:{},mounted(){this.loadExperiments(),this.loadTraceList()},methods:{async loadTraceList(){this.loading=!0;try{let u=null,n=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(u=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(n=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(n=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)));const a=await xn.getTraceList(this.searchQuery,u,n,this.pageNo,this.pageSize,this.selectedExperimentId),o=Array.isArray(a==null?void 0:a.list)?a.list:[];this.traceList=o,this.filteredTraceList=o,this.total=parseInt((a==null?void 0:a.total)||0,10)}catch(u){console.error("Failed to load trace list:",u),this.$message.error("加载 trace 列表失败"),this.traceList=[],this.filteredTraceList=[],this.total=0}finally{this.loading=!1}},refresh(){this.loadTraceList()},handleRowClick(u){this.viewDetail(u.trace_id)},viewDetail(u){this.currentTraceId=u,this.loadTraceDetail(u),this.drawerVisible=!0},async loadTraceDetail(u){var n,a,o;this.drawerLoading=!0;try{const[f,d]=await Promise.all([xn.getTraceDetail(u),xn.getTraceSpans(u)]);if(this.traceInfo=f||{},this.spans=d||[],this.filteredSpans=this.spans,this.spans.length>0){this.selectedSpanId=this.spans[0].span_id,this.selectedSpan=this.spans[0],await this.loadSpanContent(this.spans[0]);const p=this.spans[0].type==="CLIENT"||this.spans[0].type==="CHAT_MODEL",y=this.selectedSpan.has_events===!0,m=[];p&&m.push("io","raw"),m.push("attributes"),y&&m.push("events");let x="attributes";p&&(x="io"),m.includes(x)?this.activeTab=x:this.activeTab="attributes",(a=(n=this.selectedSpan.parsedContent)==null?void 0:n.inputs)!=null&&a.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((A,E)=>`message-${E}`):this.messageCollapse=[];const S=(o=this.selectedSpan.parsedContent)==null?void 0:o.events;S&&Array.isArray(S)&&S.length>0?this.eventsCollapse=S.map((A,E)=>`event-${E}`):this.eventsCollapse=[]}}catch(f){console.error("Failed to load trace detail:",f),this.$message.error("加载 trace 详情失败"),this.traceInfo={},this.spans=[],this.filteredSpans=[]}finally{this.drawerLoading=!1}},handleSpanSearch(u){if(this.spanSearchQuery=u,!u){this.filteredSpans=this.spans;return}const n=u.toLowerCase();this.filteredSpans=this.spans.filter(a=>a.name.toLowerCase().includes(n)||a.type.toLowerCase().includes(n))},async handleSpanSelect(u){var p,y,m;this.selectedSpanId=u.span_id,this.selectedSpan=u,await this.loadSpanContent(u);const n=u.type==="CLIENT"||u.type==="CHAT_MODEL",a=u.has_events===!0,o=[];n&&o.push("io","raw"),o.push("attributes"),a&&o.push("events");let f="attributes";n&&(f="io"),this.$nextTick(()=>{o.includes(f)?this.activeTab=f:this.activeTab="attributes"}),(y=(p=this.selectedSpan.parsedContent)==null?void 0:p.inputs)!=null&&y.messages?this.messageCollapse=this.selectedSpan.parsedContent.inputs.messages.map((x,S)=>`message-${S}`):this.messageCollapse=[];const d=(m=this.selectedSpan.parsedContent)==null?void 0:m.events;d&&Array.isArray(d)&&d.length>0?this.eventsCollapse=d.map((x,S)=>`event-${S}`):this.eventsCollapse=[]},async loadSpanContent(u){if(!(!this.currentTraceId||!u.span_id||u.parsedContent))try{const n=await xn.getSpanContent(this.currentTraceId,u.span_id);if(n){const a=this.parseContentData(n);this.$set(u,"parsedContent",a)}}catch(n){console.error("Failed to load span content:",n)}},parseContentData(u){const n={attributes:u.attributes||{},events:u.events||[],status:u.status||{}};if(u.inputs&&(n.inputs=u.inputs),u.outputs&&(n.outputs=u.outputs),n.attributes){const a=n.attributes["langsword.spanInputs"],o=n.attributes["langsword.spanOutputs"];if(a)try{n.inputs=typeof a=="string"?JSON.parse(a):a}catch{try{const d=a.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.inputs=JSON.parse(d)}catch{n.inputs=a}}if(o)try{n.outputs=typeof o=="string"?JSON.parse(o):o}catch{try{const d=o.replace(/\\"/g,'"').replace(/^"|"$/g,"");n.outputs=JSON.parse(d)}catch{n.outputs=o}}}return n},handleDrawerClose(){this.currentTraceId=null,this.traceInfo={},this.spans=[],this.filteredSpans=[],this.selectedSpanId=null,this.selectedSpan=null,this.spanSearchQuery="",this.eventsCollapse=[],this.drawerLoading=!1},async loadExperiments(){try{const u=await xn.getExperiments();this.experimentList=Array.isArray(u)?u:[]}catch(u){console.error("Failed to load experiments:",u),this.experimentList=[]}},handleExperimentChange(){this.pageNo=1,this.loadTraceList()},handleSearch(){this.pageNo=1,this.loadTraceList()},handleSearchClear(){this.searchQuery="",this.pageNo=1,this.loadTraceList()},handleDateRangeChange(u){this.pageNo=1,u&&Array.isArray(u)?u.length===2&&(u[0]===null||u[0]===void 0)?this.dateRange=[null,u[1]]:this.dateRange=u:this.dateRange=u,this.loadTraceList()},handleSizeChange(u){this.pageSize=u,this.pageNo=1,this.loadTraceList()},handleCurrentChange(u){this.pageNo=u,this.loadTraceList()},async handleBatchDelete(){var d,p;const u=this.searchQuery&&this.searchQuery.trim(),n=this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2&&this.dateRange[1]!==null||this.dateRange.length===1&&this.dateRange[0]!==null),a=this.selectedExperimentId;let o="",f="warning";if(!u&&!n&&!a)o=this.$t("trace.deleteAllWarning"),f="error";else{if(o=this.$t("trace.deleteConfirmMessage")+`
|
|
79
|
+
`,a){const y=this.experimentList.find(x=>x.experiment_id===this.selectedExperimentId),m=y?y.name:this.selectedExperimentId;o+=`${this.$t("trace.application")}: ${m}
|
|
80
|
+
`}if(u&&(o+=`${this.$t("trace.searchCondition")}: ${this.searchQuery}
|
|
81
|
+
`),n){const y=this.$i18n.locale==="zh-CN"?"zh-CN":"en-US";let m="";if(this.dateRange.length===2&&this.dateRange[1]!==null?m=new Date(this.dateRange[1]).toLocaleString(y):this.dateRange.length===1&&this.dateRange[0]!==null&&(m=new Date(this.dateRange[0]).toLocaleString(y)),this.dateRange.length===2&&this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""){const x=new Date(this.dateRange[0]).toLocaleString(y);o+=`${this.$t("trace.timeRange")}: ${x} ${this.$t("trace.to")} ${m}
|
|
82
|
+
`}else this.$i18n.locale==="zh-CN"?o+=`${this.$t("trace.timeRange")}: ${this.$t("trace.before")} ${m} 之前
|
|
83
|
+
`:o+=`${this.$t("trace.timeRange")}: ${this.$t("trace.before")} ${m}
|
|
84
|
+
`}o+=this.$t("trace.deleteConfirmFooter")}try{await this.$confirm(o,this.$t("trace.confirmDelete"),{confirmButtonText:this.$t("trace.confirmDeleteButton"),cancelButtonText:this.$t("common.cancel"),type:f,dangerouslyUseHTMLString:!1}),this.deleteLoading=!0;let y=null,m=null;this.dateRange&&Array.isArray(this.dateRange)&&(this.dateRange.length===2?(this.dateRange[0]!==null&&this.dateRange[0]!==void 0&&this.dateRange[0]!==""&&(y=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10)),this.dateRange[1]!==null&&this.dateRange[1]!==void 0&&this.dateRange[1]!==""&&(m=typeof this.dateRange[1]=="number"?this.dateRange[1]:parseInt(this.dateRange[1],10))):this.dateRange.length===1&&this.dateRange[0]!==null&&(m=typeof this.dateRange[0]=="number"?this.dateRange[0]:parseInt(this.dateRange[0],10))),await xn.deleteTraces(u?this.searchQuery:null,y,m,this.selectedExperimentId),this.$message.success(this.$t("trace.deleteSuccess")),await this.loadTraceList()}catch(y){if(y!=="cancel"){console.error("Failed to delete traces:",y);const m=((p=(d=y.response)==null?void 0:d.data)==null?void 0:p.message)||y.message||this.$t("trace.unknownError");this.$message.error(`${this.$t("trace.deleteFailed")}: ${m}`)}}finally{this.deleteLoading=!1}},getStatusType(u){return{OK:"success",ERROR:"danger",IN_PROGRESS:"warning",UNSET:"info"}[u]||"info"},formatDateTime(u){if(!u)return"-";const n=typeof u=="string"?parseInt(u,10):u;if(isNaN(n))return"-";const a=new Date(n);if(isNaN(a.getTime()))return"-";const o=a.getFullYear(),f=String(a.getMonth()+1).padStart(2,"0"),d=String(a.getDate()).padStart(2,"0"),p=String(a.getHours()).padStart(2,"0"),y=String(a.getMinutes()).padStart(2,"0"),m=String(a.getSeconds()).padStart(2,"0");return`${o}-${f}-${d} ${p}:${y}:${m}`},formatTimeAgo(u){if(!u)return"-";const n=typeof u=="string"?parseInt(u,10):u;if(isNaN(n))return"-";const o=Date.now()-n,f=this.$i18n.locale==="zh-CN",d=Math.floor(o/(1e3*60*60*24));if(d>0)return f?`${d} 天前`:`${d} days ago`;const p=Math.floor(o/(1e3*60*60));if(p>0)return f?`${p} 小时前`:`${p} hours ago`;const y=Math.floor(o/(1e3*60));return y>0?f?`${y} 分钟前`:`${y} minutes ago`:f?"刚刚":"Just now"},formatNanoDuration(u){if(!u)return"-";const n=u/1e6;return n<1e3?`${n.toFixed(2)}ms`:n<6e4?`${(n/1e3).toFixed(2)}s`:`${(n/6e4).toFixed(2)}min`},formatJson(u){return u?JSON.stringify(u,null,2):""},formatRawJson(u){if(!u)return"";if(typeof u=="string")try{const n=JSON.parse(u);return JSON.stringify(n,null,2)}catch{try{const a=u.replace(/\\"/g,'"').replace(/^"|"$/g,""),o=JSON.parse(a);return JSON.stringify(o,null,2)}catch{return u}}return JSON.stringify(u,null,2)},handleCodeMirrorReady(u){this.$nextTick(()=>{u&&u.refresh()})},formatMessageContent(u){return typeof u=="string"?u:JSON.stringify(u,null,2)},formatEventTime(u){if(u.time_unix_nano){const n=u.time_unix_nano/1e6;return new Date(n).toLocaleString("zh-CN")}return u.timestamp?new Date(u.timestamp).toLocaleString("zh-CN"):"-"},tableRowClassName({row:u,rowIndex:n}){return"trace-row"},getIndex(u){return(this.pageNo-1)*this.pageSize+u+1},applyColumns(){const u={};this.selectedColumns.forEach(n=>{u[n]=!0}),Object.keys(this.visibleColumns).forEach(n=>{this.selectedColumns.includes(n)||(u[n]=!1)}),this.visibleColumns=u,this.showColumnDialog=!1}}};var qp=function(){var n=this,a=n._self._c;return a("div",{staticClass:"trace-list-container"},[a("el-card",[a("div",{staticClass:"trace-content-wrapper"},[a("div",{staticClass:"trace-toolbar"},[a("el-select",{staticClass:"toolbar-select",attrs:{placeholder:n.$t("trace.selectApplication"),clearable:"",size:"mini"},on:{change:n.handleExperimentChange},model:{value:n.selectedExperimentId,callback:function(o){n.selectedExperimentId=o},expression:"selectedExperimentId"}},n._l(n.experimentList,function(o){return a("el-option",{key:o.experiment_id,attrs:{label:o.name,value:o.experiment_id}})}),1),a("el-input",{staticClass:"toolbar-input",attrs:{placeholder:n.$t("trace.searchPlaceholder"),"prefix-icon":"el-icon-search",clearable:"",size:"mini"},on:{clear:n.handleSearchClear,input:n.handleSearch},model:{value:n.searchQuery,callback:function(o){n.searchQuery=o},expression:"searchQuery"}}),a("el-date-picker",{staticClass:"toolbar-date-picker",attrs:{type:"datetimerange","range-separator":n.$t("trace.to"),"start-placeholder":n.$t("trace.startTime"),"end-placeholder":n.$t("trace.endTime"),"value-format":"timestamp",format:"yyyy-MM-dd HH:mm:ss",size:"mini","picker-options":n.pickerOptions,clearable:""},on:{change:n.handleDateRangeChange},model:{value:n.dateRange,callback:function(o){n.dateRange=o},expression:"dateRange"}}),a("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"mini",disabled:n.deleteLoading},on:{click:n.handleBatchDelete}},[n._v(" "+n._s(n.$t("trace.batchDelete"))+" ")]),a("el-tooltip",{attrs:{content:n.$t("common.refresh"),placement:"top"}},[a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini",circle:""},on:{click:n.refresh}})],1),a("el-button",{attrs:{icon:"el-icon-setting",size:"mini"},on:{click:function(o){n.showColumnDialog=!0}}},[n._v(" "+n._s(n.$t("common.columns"))+" ")])],1),a("div",{staticClass:"trace-table-wrapper"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:n.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:n.filteredTraceList,size:"mini",stripe:"","row-class-name":n.tableRowClassName},on:{"row-click":n.handleRowClick}},[a("el-table-column",{attrs:{type:"index",label:"#",width:"60",index:n.getIndex}}),n.visibleColumns.trace_id?a("el-table-column",{attrs:{prop:"trace_id",label:n.$t("trace.requestId"),width:"280","show-overflow-tooltip":""},scopedSlots:n._u([{key:"default",fn:function(o){return[a("el-link",{attrs:{type:"primary"},on:{click:function(f){return f.stopPropagation(),n.viewDetail(o.row.trace_id)}}},[n._v(" "+n._s(o.row.trace_id)+" ")])]}}],null,!1,1400187371)}):n._e(),n.visibleColumns.trace_name?a("el-table-column",{attrs:{prop:"trace_name",label:n.$t("trace.traceName"),"min-width":"300","show-overflow-tooltip":""},scopedSlots:n._u([{key:"default",fn:function(o){return[a("span",[n._v(n._s(o.row.trace_name||"-"))])]}}],null,!1,3633653970)}):n._e(),n.visibleColumns.trace_type?a("el-table-column",{attrs:{prop:"trace_type",label:n.$t("trace.traceType"),width:"120"},scopedSlots:n._u([{key:"default",fn:function(o){return[a("el-tag",{attrs:{size:"mini",type:"info"}},[n._v(n._s(o.row.trace_type||"-"))])]}}],null,!1,1175446173)}):n._e(),n.visibleColumns.execution_time_ms?a("el-table-column",{attrs:{prop:"execution_time_ms",label:n.$t("trace.executionTime"),width:"120"},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatNanoDuration(o.row.execution_time_ms))+" ")]}}],null,!1,1733254102)}):n._e(),n.visibleColumns.status?a("el-table-column",{attrs:{prop:"status",label:n.$t("trace.status"),width:"100"},scopedSlots:n._u([{key:"default",fn:function(o){return[a("el-tag",{attrs:{type:n.getStatusType(o.row.status),size:"mini"}},[o.row.status==="OK"?a("i",{staticClass:"el-icon-success"}):n._e(),n._v(" "+n._s(o.row.status)+" ")])]}}],null,!1,3672547022)}):n._e(),n.visibleColumns.timestamp_ms?a("el-table-column",{attrs:{prop:"timestamp_ms",label:n.$t("trace.timeCreated"),width:"180"},scopedSlots:n._u([{key:"default",fn:function(o){return[n._v(" "+n._s(n.formatDateTime(o.row.timestamp_ms))+" ")]}}],null,!1,1082702673)}):n._e(),a("el-table-column",{attrs:{label:n.$t("common.operation"),width:"100",fixed:"right"},scopedSlots:n._u([{key:"default",fn:function(o){return[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(f){return f.stopPropagation(),n.viewDetail(o.row.trace_id)}}},[n._v(" "+n._s(n.$t("common.viewDetail"))+" ")])]}}])})],1)],1),a("div",{staticClass:"trace-pagination-wrapper"},[n.total>0?a("el-pagination",{staticClass:"trace-pagination",attrs:{"current-page":n.pageNo,"page-sizes":[10,20,50,100],"page-size":n.pageSize,size:"mini",layout:"total, prev, pager, next, sizes, jumper",total:n.total,background:""},on:{"size-change":n.handleSizeChange,"current-change":n.handleCurrentChange}}):n._e()],1)])]),a("el-dialog",{attrs:{title:n.$t("trace.selectColumns"),visible:n.showColumnDialog,width:"400px"},on:{"update:visible":function(o){n.showColumnDialog=o}}},[a("el-checkbox-group",{model:{value:n.selectedColumns,callback:function(o){n.selectedColumns=o},expression:"selectedColumns"}},[a("el-checkbox",{attrs:{label:"trace_id"}},[n._v(n._s(n.$t("trace.requestId")))]),a("el-checkbox",{attrs:{label:"timestamp_ms"}},[n._v(n._s(n.$t("trace.timeCreated")))]),a("el-checkbox",{attrs:{label:"status"}},[n._v(n._s(n.$t("trace.status")))]),a("el-checkbox",{attrs:{label:"execution_time_ms"}},[n._v(n._s(n.$t("trace.executionTime")))]),a("el-checkbox",{attrs:{label:"trace_type"}},[n._v(n._s(n.$t("trace.traceType")))]),a("el-checkbox",{attrs:{label:"trace_name"}},[n._v(n._s(n.$t("trace.traceName")))])],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"mini"},on:{click:function(o){n.showColumnDialog=!1}}},[n._v(n._s(n.$t("common.cancel")))]),a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:n.applyColumns}},[n._v(n._s(n.$t("common.confirm")))])],1)],1),a("TraceDetailDrawer",{attrs:{visible:n.drawerVisible,"current-trace-id":n.currentTraceId,"trace-info":n.traceInfo,spans:n.spans,"filtered-spans":n.filteredSpans,"selected-span-id":n.selectedSpanId,"selected-span":n.selectedSpan,loading:n.drawerLoading},on:{"update:visible":[function(o){n.drawerVisible=o},function(o){n.drawerVisible=o}],close:n.handleDrawerClose,"span-search":n.handleSpanSearch,"span-select":n.handleSpanSelect}})],1)},Gp=[],Kp=An(Up,qp,Gp,!1,null,"ca175755");const ls=Kp.exports,Bl={routes:[{path:"/trace",name:"trace",component:ls}],beforeEach:(u,n,a)=>{a()}},Hl={common:{home:"首页",todos:"待办事项",trace:"追踪",login:"登录",logout:"退出",user:"用户",search:"搜索",refresh:"刷新",columns:"列设置",confirm:"确定",cancel:"取消",operation:"操作",viewDetail:"查看详情",language:"语言"},span:{searchTree:"Span名称/Span类型"},trace:{title:"追踪列表",searchPlaceholder:"追踪ID/追踪名称/追踪类型",requestId:"追踪ID",timeCreated:"创建时间",status:"状态",executionTime:"执行时长",traceType:"追踪类型",traceName:"追踪名称",traceDetail:"追踪详情",traceId:"追踪ID",clientRequestId:"客户端请求ID",experimentId:"应用ID",application:"应用",selectApplication:"请选择应用",spanDetail:"Span 详情",inputs:"输入",outputs:"输出",attributes:"属性",rawInputsOutputs:"原始输入输出",rawInputs:"原始输入",rawOutputs:"原始输出",events:"事件",selectSpan:"请选择一个 Span 查看详情",noInputs:"暂无输入数据",noOutputs:"暂无输出数据",noIoData:"暂无输入输出数据",noEvents:"暂无事件数据",exceptionType:"异常类型",exceptionMessage:"异常消息",exceptionStacktrace:"异常堆栈",otherAttributes:"其他属性",key:"键",value:"值",selectColumns:"选择列",batchDelete:"批量删除",startTime:"开始时间",endTime:"结束时间",to:"至",confirmDelete:"确认删除",confirmDeleteButton:"确定删除",deleteAllWarning:`警告:您没有设置任何查询条件,这将删除所有 trace 数据!
|
|
83
85
|
|
|
84
86
|
此操作不可恢复,请确认是否继续?`,deleteConfirmMessage:"确定要删除符合以下条件的 trace 吗?",searchCondition:"搜索条件",timeRange:"时间范围",before:"在",deleteConfirmFooter:`
|
|
85
|
-
此操作不可恢复,请确认是否继续?`,deleteSuccess:"删除成功",deleteFailed:"删除失败",unknownError:"未知错误"}},
|
|
87
|
+
此操作不可恢复,请确认是否继续?`,deleteSuccess:"删除成功",deleteFailed:"删除失败",unknownError:"未知错误"},debug:{paramLabel:"参数",systemPrompt:"系统提示词",userPrompt:"用户提示词",submitImage:"是否提交图片",addParam:"新增参数",reset:"重置",submit:"提交",responseResult:"返回结果",switchToMarkdown:"切换为Markdown",switchToRaw:"切换为原始输出",paramName:"参数名",paramValue:"参数值",yes:"是",no:"否"}},Wl={common:{home:"Home",todos:"Todos",trace:"Trace",login:"Login",logout:"Logout",user:"User",search:"Search",refresh:"Refresh",columns:"Columns",confirm:"Confirm",cancel:"Cancel",operation:"Operation",viewDetail:"View Detail",language:"Language"},span:{searchTree:"Span Name/Span Type"},trace:{title:"Traces",searchPlaceholder:"Trace ID/Trace Name/Trace Type",requestId:"Trace ID",timeCreated:"Time created",status:"Status",executionTime:"Execution time",traceType:"Trace Type",traceName:"Trace Name",traceDetail:"Trace Detail",traceId:"Trace ID",clientRequestId:"Client Request ID",experimentId:"Application ID",application:"Application",selectApplication:"Please select application",spanDetail:"Span Detail",inputs:"Inputs",outputs:"Outputs",attributes:"Attributes",rawInputsOutputs:"Raw Inputs/Outputs",rawInputs:"Raw Inputs",rawOutputs:"Raw Outputs",events:"Events",selectSpan:"Please select a Span to view details",noInputs:"No input data",noOutputs:"No output data",noIoData:"No input/output data",noEvents:"No event data",exceptionType:"Exception Type",exceptionMessage:"Exception Message",exceptionStacktrace:"Exception Stacktrace",otherAttributes:"Other Attributes",key:"Key",value:"Value",selectColumns:"Select Columns",batchDelete:"Batch Delete",startTime:"Start Time",endTime:"End Time",to:" to ",confirmDelete:"Confirm Delete",confirmDeleteButton:"Confirm Delete",deleteAllWarning:`Warning: You have not set any query conditions. This will delete all trace data!
|
|
86
88
|
|
|
87
89
|
This operation cannot be undone. Are you sure you want to continue?`,deleteConfirmMessage:"Are you sure you want to delete traces matching the following conditions?",searchCondition:"Search Condition",timeRange:"Time Range",before:"before",deleteConfirmFooter:`
|
|
88
|
-
This operation cannot be undone. Are you sure you want to continue?`,deleteSuccess:"Delete successful",deleteFailed:"Delete failed",unknownError:"Unknown error"}},
|
|
90
|
+
This operation cannot be undone. Are you sure you want to continue?`,deleteSuccess:"Delete successful",deleteFailed:"Delete failed",unknownError:"Unknown error"},debug:{paramLabel:"Parameter",systemPrompt:"System Prompt",userPrompt:"User Prompt",submitImage:"Submit Image",addParam:"Add Parameter",reset:"Reset",submit:"Submit",responseResult:"Response Result",switchToMarkdown:"Switch to Markdown",switchToRaw:"Switch to Raw Output",paramName:"Parameter Name",paramValue:"Parameter Value",yes:"Yes",no:"No"}},oi={"zh-CN":Hl,"en-US":Wl};let us=!1;const jl=u=>{!u||us||(u.mergeLocaleMessage?(Object.keys(oi).forEach(n=>{u.mergeLocaleMessage(n,oi[n])}),us=!0):u.messages&&(Object.keys(oi).forEach(n=>{u.messages[n]||(u.messages[n]={}),Object.assign(u.messages[n],oi[n])}),us=!0))},Xp={store:uo,router:Bl,components:{Trace:ls,TraceSpanTree:qa},api:xn,locales:oi,setI18n(u){jl(u)},registerLocales:jl};Ie.Trace=ls,Ie.TraceSpanTree=qa,Ie.default=Xp,Ie.enUS=Wl,Ie.traceApi=xn,Ie.traceRouter=Bl,Ie.traceStore=uo,Ie.zhCN=Hl,Object.defineProperties(Ie,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|