diff --git a/panel/assets/icons/svg/bars.svg b/panel/assets/icons/svg/bars.svg new file mode 100644 index 00000000..c9a331bb --- /dev/null +++ b/panel/assets/icons/svg/bars.svg @@ -0,0 +1 @@ + diff --git a/panel/assets/js/app.min.js b/panel/assets/js/app.min.js index 739e551c..bc38563c 100644 --- a/panel/assets/js/app.min.js +++ b/panel/assets/js/app.min.js @@ -1,36 +1,36 @@ -var Formwork=(()=>{var wh=Object.create;var fi=Object.defineProperty,Sh=Object.defineProperties,kh=Object.getOwnPropertyDescriptor,Ch=Object.getOwnPropertyDescriptors,Eh=Object.getOwnPropertyNames,so=Object.getOwnPropertySymbols,Lh=Object.getPrototypeOf,yl=Object.prototype.hasOwnProperty,af=Object.prototype.propertyIsEnumerable;var vl=(u,o,a)=>o in u?fi(u,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[o]=a,ot=(u,o)=>{for(var a in o||(o={}))yl.call(o,a)&&vl(u,a,o[a]);if(so)for(var a of so(o))af.call(o,a)&&vl(u,a,o[a]);return u},xl=(u,o)=>Sh(u,Ch(o));var lf=(u,o)=>{var a={};for(var s in u)yl.call(u,s)&&o.indexOf(s)<0&&(a[s]=u[s]);if(u!=null&&so)for(var s of so(u))o.indexOf(s)<0&&af.call(u,s)&&(a[s]=u[s]);return a};var yr=(u,o)=>()=>(o||u((o={exports:{}}).exports,o),o.exports),Dh=(u,o)=>{for(var a in o)fi(u,a,{get:o[a],enumerable:!0})},sf=(u,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of Eh(o))!yl.call(u,c)&&c!==a&&fi(u,c,{get:()=>o[c],enumerable:!(s=kh(o,c))||s.enumerable});return u};var uo=(u,o,a)=>(a=u!=null?wh(Lh(u)):{},sf(o||!u||!u.__esModule?fi(a,"default",{value:u,enumerable:!0}):a,u)),Th=u=>sf(fi({},"__esModule",{value:!0}),u);var fo=(u,o,a)=>(vl(u,typeof o!="symbol"?o+"":o,a),a);var Xn=yr((Bl,Wl)=>{(function(u,o){typeof Bl=="object"&&typeof Wl!="undefined"?Wl.exports=o():typeof define=="function"&&define.amd?define(o):(u=u||self,u.CodeMirror=o())})(Bl,function(){"use strict";var u=navigator.userAgent,o=navigator.platform,a=/gecko\/\d/i.test(u),s=/MSIE \d/.test(u),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),p=/Edge\/(\d+)/.exec(u),g=s||c||p,v=g&&(s?document.documentMode||6:+(p||c)[1]),b=!p&&/WebKit\//.test(u),w=b&&/Qt\/\d+\.\d+/.test(u),L=!p&&/Chrome\/(\d+)/.exec(u),N=L&&+L[1],A=/Opera\//.test(u),I=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(u),z=/PhantomJS/.test(u),Y=I&&(/Mobile\/\w+/.test(u)||navigator.maxTouchPoints>2),V=/Android/.test(u),J=Y||V||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(u),O=Y||/Mac/.test(o),q=/\bCrOS\b/.test(u),re=/win/i.test(o),P=A&&u.match(/Version\/(\d*\.\d*)/);P&&(P=Number(P[1])),P&&P>=15&&(A=!1,b=!0);var H=O&&(w||A&&(P==null||P<12.11)),$=a||g&&v>=9;function B(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var oe=function(e,t){var r=e.className,n=B(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function de(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return de(e).appendChild(t)}function S(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var l=0;l=t)return f+(t-l);f+=d-l,f+=r-f%r,l=d+1}}var Ve=function(){this.id=null,this.f=null,this.time=0,this.handler=Je(this.onTimeout,this)};Ve.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ve.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r=t)return n+Math.min(f,t-i);if(i+=l-n,i+=r-i%r,n=l+1,i>=t)return n}}var Lt=[""];function _t(e){for(;Lt.length<=e;)Lt.push(ye(Lt)+" ");return Lt[e]}function ye(e){return e[e.length-1]}function Dt(e,t){for(var r=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||la.test(e))}function $n(e,t){return t?t.source.indexOf("\\w")>-1&&Ir(e)?!0:t.test(e):Ir(e)}function Ti(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var sa=/[\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 An(e){return e.charCodeAt(0)>=768&&sa.test(e)}function Fr(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var i=(t+r)/2,l=n<0?Math.ceil(i):Math.floor(i);if(l==t)return e(l)?t:r;e(l)?r=l:t=l+n}}function ua(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,l=0;lt||t==r&&f.to==t)&&(n(Math.max(f.from,t),Math.min(f.to,r),f.level==1?"rtl":"ltr",l),i=!0)}i||n(t,r,"ltr")}var xe=null;function Se(e,t,r){var n;xe=null;for(var i=0;it)return i;l.to==t&&(l.from!=l.to&&r=="before"?n=i:xe=i),l.from==t&&(l.from!=l.to&&r!="before"?n=i:xe=i)}return n!=null?n:xe}var fa=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,l=/[LRr]/,f=/[Lb1n]/,d=/[1n]/;function h(m,x,k){this.level=m,this.from=x,this.to=k}return function(m,x){var k=x=="ltr"?"L":"R";if(m.length==0||x=="ltr"&&!n.test(m))return!1;for(var T=m.length,D=[],F=0;F-1&&(n[t]=i.slice(0,l).concat(i.slice(l+1)))}}}function Me(e,t){var r=nn(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function Qn(e){e.prototype.on=function(t,r){ue(this,t,r)},e.prototype.off=function(t,r){ke(this,t,r)}}function yt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function rs(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ca(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Hr(e){yt(e),rs(e)}function da(e){return e.target||e.srcElement}function is(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),O&&e.ctrlKey&&t==1&&(t=3),t}var hc=function(){if(g&&v<9)return!1;var e=S("div");return"draggable"in e||"dragDrop"in e}(),ha;function pc(e){if(ha==null){var t=S("span","\u200B");j(e,S("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ha=t.offsetWidth<=1&&t.offsetHeight>2&&!(g&&v<8))}var r=ha?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var pa;function gc(e){if(pa!=null)return pa;var t=j(e,document.createTextNode("A\u062EA")),r=_(t,0,1).getBoundingClientRect(),n=_(t,1,2).getBoundingClientRect();return de(e),!r||r.left==r.right?!1:pa=n.right-r.right<3}var ga=` +var Formwork=(()=>{var wh=Object.create;var fi=Object.defineProperty,Sh=Object.defineProperties,kh=Object.getOwnPropertyDescriptor,Ch=Object.getOwnPropertyDescriptors,Eh=Object.getOwnPropertyNames,so=Object.getOwnPropertySymbols,Lh=Object.getPrototypeOf,yl=Object.prototype.hasOwnProperty,af=Object.prototype.propertyIsEnumerable;var vl=(u,o,a)=>o in u?fi(u,o,{enumerable:!0,configurable:!0,writable:!0,value:a}):u[o]=a,ot=(u,o)=>{for(var a in o||(o={}))yl.call(o,a)&&vl(u,a,o[a]);if(so)for(var a of so(o))af.call(o,a)&&vl(u,a,o[a]);return u},xl=(u,o)=>Sh(u,Ch(o));var lf=(u,o)=>{var a={};for(var s in u)yl.call(u,s)&&o.indexOf(s)<0&&(a[s]=u[s]);if(u!=null&&so)for(var s of so(u))o.indexOf(s)<0&&af.call(u,s)&&(a[s]=u[s]);return a};var yr=(u,o)=>()=>(o||u((o={exports:{}}).exports,o),o.exports),Dh=(u,o)=>{for(var a in o)fi(u,a,{get:o[a],enumerable:!0})},sf=(u,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of Eh(o))!yl.call(u,c)&&c!==a&&fi(u,c,{get:()=>o[c],enumerable:!(s=kh(o,c))||s.enumerable});return u};var uo=(u,o,a)=>(a=u!=null?wh(Lh(u)):{},sf(o||!u||!u.__esModule?fi(a,"default",{value:u,enumerable:!0}):a,u)),Th=u=>sf(fi({},"__esModule",{value:!0}),u);var fo=(u,o,a)=>(vl(u,typeof o!="symbol"?o+"":o,a),a);var Xn=yr((Bl,Wl)=>{(function(u,o){typeof Bl=="object"&&typeof Wl!="undefined"?Wl.exports=o():typeof define=="function"&&define.amd?define(o):(u=u||self,u.CodeMirror=o())})(Bl,function(){"use strict";var u=navigator.userAgent,o=navigator.platform,a=/gecko\/\d/i.test(u),s=/MSIE \d/.test(u),c=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(u),p=/Edge\/(\d+)/.exec(u),g=s||c||p,v=g&&(s?document.documentMode||6:+(p||c)[1]),b=!p&&/WebKit\//.test(u),w=b&&/Qt\/\d+\.\d+/.test(u),L=!p&&/Chrome\/(\d+)/.exec(u),N=L&&+L[1],A=/Opera\//.test(u),I=/Apple Computer/.test(navigator.vendor),E=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(u),z=/PhantomJS/.test(u),Y=I&&(/Mobile\/\w+/.test(u)||navigator.maxTouchPoints>2),J=/Android/.test(u),Z=Y||J||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(u),O=Y||/Mac/.test(o),q=/\bCrOS\b/.test(u),re=/win/i.test(o),B=A&&u.match(/Version\/(\d*\.\d*)/);B&&(B=Number(B[1])),B&&B>=15&&(A=!1,b=!0);var H=O&&(w||A&&(B==null||B<12.11)),V=a||g&&v>=9;function P(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var oe=function(e,t){var r=e.className,n=P(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function ce(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function j(e,t){return ce(e).appendChild(t)}function S(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var l=0;l=t)return f+(t-l);f+=d-l,f+=r-f%r,l=d+1}}var Ve=function(){this.id=null,this.f=null,this.time=0,this.handler=Je(this.onTimeout,this)};Ve.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Ve.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r=t)return n+Math.min(f,t-i);if(i+=l-n,i+=r-i%r,n=l+1,i>=t)return n}}var Lt=[""];function _t(e){for(;Lt.length<=e;)Lt.push(ye(Lt)+" ");return Lt[e]}function ye(e){return e[e.length-1]}function Dt(e,t){for(var r=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||la.test(e))}function $n(e,t){return t?t.source.indexOf("\\w")>-1&&Ir(e)?!0:t.test(e):Ir(e)}function Ti(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var sa=/[\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 An(e){return e.charCodeAt(0)>=768&&sa.test(e)}function Fr(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var i=(t+r)/2,l=n<0?Math.ceil(i):Math.floor(i);if(l==t)return e(l)?t:r;e(l)?r=l:t=l+n}}function ua(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,l=0;lt||t==r&&f.to==t)&&(n(Math.max(f.from,t),Math.min(f.to,r),f.level==1?"rtl":"ltr",l),i=!0)}i||n(t,r,"ltr")}var xe=null;function Se(e,t,r){var n;xe=null;for(var i=0;it)return i;l.to==t&&(l.from!=l.to&&r=="before"?n=i:xe=i),l.from==t&&(l.from!=l.to&&r!="before"?n=i:xe=i)}return n!=null?n:xe}var fa=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,l=/[LRr]/,f=/[Lb1n]/,d=/[1n]/;function h(m,x,k){this.level=m,this.from=x,this.to=k}return function(m,x){var k=x=="ltr"?"L":"R";if(m.length==0||x=="ltr"&&!n.test(m))return!1;for(var T=m.length,D=[],F=0;F-1&&(n[t]=i.slice(0,l).concat(i.slice(l+1)))}}}function Me(e,t){var r=nn(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function Qn(e){e.prototype.on=function(t,r){ue(this,t,r)},e.prototype.off=function(t,r){ke(this,t,r)}}function yt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function rs(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ca(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Hr(e){yt(e),rs(e)}function da(e){return e.target||e.srcElement}function is(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),O&&e.ctrlKey&&t==1&&(t=3),t}var hc=function(){if(g&&v<9)return!1;var e=S("div");return"draggable"in e||"dragDrop"in e}(),ha;function pc(e){if(ha==null){var t=S("span","\u200B");j(e,S("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ha=t.offsetWidth<=1&&t.offsetHeight>2&&!(g&&v<8))}var r=ha?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var pa;function gc(e){if(pa!=null)return pa;var t=j(e,document.createTextNode("A\u062EA")),r=_(t,0,1).getBoundingClientRect(),n=_(t,1,2).getBoundingClientRect();return ce(e),!r||r.left==r.right?!1:pa=n.right-r.right<3}var ga=` b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(` -`,t);i==-1&&(i=e.length);var l=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),f=l.indexOf("\r");f!=-1?(r.push(l.slice(0,f)),t+=f+1):(r.push(l),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},mc=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},vc=function(){var e=S("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ma=null;function yc(e){if(ma!=null)return ma;var t=j(e,S("span","x")),r=t.getBoundingClientRect(),n=_(t,0,1).getBoundingClientRect();return ma=Math.abs(r.left-n.left)>1}var va={},Zn={};function xc(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),va[e]=t}function bc(e,t){Zn[e]=t}function Mi(e){if(typeof e=="string"&&Zn.hasOwnProperty(e))e=Zn[e];else if(e&&typeof e.name=="string"&&Zn.hasOwnProperty(e.name)){var t=Zn[e.name];typeof t=="string"&&(t={name:t}),e=Or(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mi("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mi("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ya(e,t){t=Mi(t);var r=va[t.name];if(!r)return ya(e,"text/plain");var n=r(e,t);if(Jn.hasOwnProperty(t.name)){var i=Jn[t.name];for(var l in i)i.hasOwnProperty(l)&&(n.hasOwnProperty(l)&&(n["_"+l]=n[l]),n[l]=i[l])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var f in t.modeProps)n[f]=t.modeProps[f];return n}var Jn={};function wc(e,t){var r=Jn.hasOwnProperty(e)?Jn[e]:Jn[e]={};st(t,r)}function Nn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function xa(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),!(!r||r.mode==e));)t=r.state,e=r.mode;return r||{mode:e,state:t}}function os(e,t,r){return e.startState?e.startState(t,r):!0}var je=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};je.prototype.eol=function(){return this.pos>=this.string.length},je.prototype.sol=function(){return this.pos==this.lineStart},je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},je.prototype.next=function(){if(this.post},je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},je.prototype.skipToEnd=function(){this.pos=this.string.length},je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},je.prototype.backUp=function(e){this.pos-=e},je.prototype.column=function(){return this.lastColumnPos0?null:(l&&t!==!1&&(this.pos+=l[0].length),l)}},je.prototype.current=function(){return this.string.slice(this.start,this.pos)},je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ae(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 r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],l=i.chunkSize();if(t=e.first&&tr?G(r,ae(e,r).text.length):Sc(t,ae(e,t.line).text.length)}function Sc(e,t){var r=e.ch;return r==null||r>t?G(e.line,t):r<0?G(e.line,0):e}function ls(e,t){for(var r=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},$t.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}},$t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$t.fromSaved=function(e,t,r){return t instanceof Oi?new $t(e,Nn(e.mode,t.state),r,t.lookAhead):new $t(e,Nn(e.mode,t),r)},$t.prototype.save=function(e){var t=e!==!1?Nn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Oi(t,this.maxLookAhead):t};function ss(e,t,r,n){var i=[e.state.modeGen],l={};ps(e,t.text,e.doc.mode,r,function(m,x){return i.push(m,x)},l,n);for(var f=r.state,d=function(m){r.baseTokens=i;var x=e.state.overlays[m],k=1,T=0;r.state=!0,ps(e,t.text,x.mode,r,function(D,F){for(var W=k;TD&&i.splice(k,1,D,i[k+1],U),k+=2,T=Math.min(D,U)}if(F)if(x.opaque)i.splice(W,k-W,D,"overlay "+F),k=W+2;else for(;We.options.maxHighlightLength&&Nn(e.doc.mode,n.state),l=ss(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=l.styles,l.classes?t.styleClasses=l.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Br(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new $t(n,!0,t);var l=kc(e,t,r),f=l>n.first&&ae(n,l-1).stateAfter,d=f?$t.fromSaved(n,f,l):new $t(n,os(n.mode),l);return n.iter(l,t,function(h){Ca(e,h.text,d);var m=d.line;h.stateAfter=m==t-1||m%5==0||m>=i.viewFrom&&mt.start)return l}throw new Error("Mode "+e.name+" failed to advance stream.")}var cs=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function ds(e,t,r,n){var i=e.doc,l=i.mode,f;t=pe(i,t);var d=ae(i,t.line),h=Br(e,t.line,r),m=new je(d.text,e.options.tabSize,h),x;for(n&&(x=[]);(n||m.pose.options.maxHighlightLength?(d=!1,f&&Ca(e,t,n,x.pos),x.pos=t.length,k=null):k=hs(Ea(r,x,n.state,T),l),T){var D=T[0].name;D&&(k="m-"+(k?D+" "+k:D))}if(!d||m!=k){for(;hf;--d){if(d<=l.first)return l.first;var h=ae(l,d-1),m=h.stateAfter;if(m&&(!r||d+(m instanceof Oi?m.lookAhead:0)<=l.modeFrontier))return d;var x=Ue(h.text,null,e.options.tabSize);(i==null||n>x)&&(i=d-1,n=x)}return i}function Cc(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var i=ae(e,n).stateAfter;if(i&&(!(i instanceof Oi)||n+i.lookAhead=t:l.to>t);(n||(n=[])).push(new Ii(f,l.from,h?null:l.to))}}return n}function Ac(e,t,r){var n;if(e)for(var i=0;i=t:l.to>t);if(d||l.from==t&&f.type=="bookmark"&&(!r||l.marker.insertLeft)){var h=l.from==null||(f.inclusiveLeft?l.from<=t:l.from0&&d)for(var ee=0;ee0)){var x=[h,1],k=he(m.from,d.from),T=he(m.to,d.to);(k<0||!f.inclusiveLeft&&!k)&&x.push({from:m.from,to:d.from}),(T>0||!f.inclusiveRight&&!T)&&x.push({from:d.to,to:m.to}),i.splice.apply(i,x),h+=x.length-3}}return i}function vs(e){var t=e.markedSpans;if(t){for(var r=0;rt)&&(!n||Da(n,l.marker)<0)&&(n=l.marker)}return n}function ws(e,t,r,n,i){var l=ae(e,t),f=rn&&l.markedSpans;if(f)for(var d=0;d=0&&k<=0||x<=0&&k>=0)&&(x<=0&&(h.marker.inclusiveRight&&i.inclusiveLeft?he(m.to,r)>=0:he(m.to,r)>0)||x>=0&&(h.marker.inclusiveRight&&i.inclusiveLeft?he(m.from,n)<=0:he(m.from,n)<0)))return!0}}}function Ut(e){for(var t;t=bs(e);)e=t.find(-1,!0).line;return e}function Ic(e){for(var t;t=Pi(e);)e=t.find(1,!0).line;return e}function Fc(e){for(var t,r;t=Pi(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Ta(e,t){var r=ae(e,t),n=Ut(r);return r==n?t:De(n)}function Ss(e,t){if(t>e.lastLine())return t;var r=ae(e,t),n;if(!gn(e,r))return t;for(;n=Pi(r);)r=n.find(1,!0).line;return De(r)+1}function gn(e,t){var r=rn&&t.markedSpans;if(r){for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var Vn=function(e,t,r){this.text=e,ys(this,t),this.height=r?r(this):1};Vn.prototype.lineNo=function(){return De(this)},Qn(Vn);function Hc(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vs(e),ys(e,r);var i=n?n(e):1;i!=e.height&&Kt(e,i)}function Pc(e){e.parent=null,vs(e)}var Bc={},Wc={};function ks(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Wc:Bc;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Cs(e,t){var r=R("span",null,null,b?"padding-right: .1px":null),n={pre:R("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var l=i?t.rest[i-1]:t.line,f=void 0;n.pos=0,n.addToken=zc,gc(e.display.measure)&&(f=vt(l,e.doc.direction))&&(n.addToken=Gc(n.addToken,f)),n.map=[];var d=t!=e.display.externalMeasured&&De(l);Uc(l,n,us(e,l,d)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=mt(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=mt(l.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(pc(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var h=n.content.lastChild;(/\bcm-tab\b/.test(h.className)||h.querySelector&&h.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Me(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=mt(n.pre.className,n.textClass||"")),n}function Rc(e){var t=S("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function zc(e,t,r,n,i,l,f){if(t){var d=e.splitSpaces?_c(t,e.trailingSpace):t,h=e.cm.state.specialChars,m=!1,x;if(!h.test(t))e.col+=t.length,x=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,x),g&&v<9&&(m=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var k=0;;){h.lastIndex=k;var T=h.exec(t),D=T?T.index-k:t.length-k;if(D){var F=document.createTextNode(d.slice(k,k+D));g&&v<9?x.appendChild(S("span",[F])):x.appendChild(F),e.map.push(e.pos,e.pos+D,F),e.col+=D,e.pos+=D}if(!T)break;k+=D+1;var W=void 0;if(T[0]==" "){var U=e.cm.options.tabSize,X=U-e.col%U;W=x.appendChild(S("span",_t(X),"cm-tab")),W.setAttribute("role","presentation"),W.setAttribute("cm-text"," "),e.col+=X}else T[0]=="\r"||T[0]==` -`?(W=x.appendChild(S("span",T[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),W.setAttribute("cm-text",T[0]),e.col+=1):(W=e.cm.options.specialCharPlaceholder(T[0]),W.setAttribute("cm-text",T[0]),g&&v<9?x.appendChild(S("span",[W])):x.appendChild(W),e.col+=1);e.map.push(e.pos,e.pos+1,W),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,r||n||i||m||l||f){var Z=r||"";n&&(Z+=n),i&&(Z+=i);var K=S("span",[x],Z,l);if(f)for(var ee in f)f.hasOwnProperty(ee)&&ee!="style"&&ee!="class"&&K.setAttribute(ee,f[ee]);return e.content.appendChild(K)}e.content.appendChild(x)}}function _c(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;im&&k.from<=m));T++);if(k.to>=x)return e(r,n,i,l,f,d,h);e(r,n.slice(0,k.to-m),i,l,null,d,h),l=null,n=n.slice(k.to-m),m=k.to}}}function Es(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Uc(e,t,r){var n=e.markedSpans,i=e.text,l=0;if(!n){for(var f=1;fh||me.collapsed&&le.to==h&&le.from==h)){if(le.to!=null&&le.to!=h&&D>le.to&&(D=le.to,W=""),me.className&&(F+=" "+me.className),me.css&&(T=(T?T+";":"")+me.css),me.startStyle&&le.from==h&&(U+=" "+me.startStyle),me.endStyle&&le.to==D&&(ee||(ee=[])).push(me.endStyle,le.to),me.title&&((Z||(Z={})).title=me.title),me.attributes)for(var Ae in me.attributes)(Z||(Z={}))[Ae]=me.attributes[Ae];me.collapsed&&(!X||Da(X.marker,me)<0)&&(X=le)}else le.from>h&&D>le.from&&(D=le.from)}if(ee)for(var rt=0;rt=d)break;for(var Mt=Math.min(d,D);;){if(x){var wt=h+x.length;if(!X){var Xe=wt>Mt?x.slice(0,Mt-h):x;t.addToken(t,Xe,k?k+F:F,U,h+Xe.length==D?W:"",T,Z)}if(wt>=Mt){x=x.slice(Mt-h),h=Mt;break}h=wt,U=""}x=i.slice(l,l=r[m++]),k=ks(r[m++],t.cm.options)}}}function Ls(e,t,r){this.line=t,this.rest=Fc(t),this.size=this.rest?De(ye(this.rest))-r+1:1,this.node=this.text=null,this.hidden=gn(e,t)}function Wi(e,t,r){for(var n=[],i,l=t;l2&&l.push((h.bottom+m.top)/2-r.top)}}l.push(r.bottom-r.top)}}function Is(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ed(e,t){t=Ut(t);var r=De(t),n=e.display.externalMeasured=new Ls(e.doc,t,r);n.lineN=r;var i=n.built=Cs(e,n);return n.text=i.pre,j(e.display.lineMeasure,i.pre),n}function Fs(e,t,r,n){return Zt(e,tr(e,t),r,n)}function Fa(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(l=h-d,i=l-1,t>=h&&(f="right")),i!=null){if(n=e[m+2],d==h&&r==(n.insertLeft?"left":"right")&&(f=r),r=="left"&&i==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)n=e[(m-=3)+2],f="left";if(r=="right"&&i==h-d)for(;m=0&&(r=e[i]).left==r.right;i--);return r}function nd(e,t,r,n){var i=Ps(t.map,r,n),l=i.node,f=i.start,d=i.end,h=i.collapse,m;if(l.nodeType==3){for(var x=0;x<4;x++){for(;f&&An(t.line.text.charAt(i.coverStart+f));)--f;for(;i.coverStart+d0&&(h=n="right");var k;e.options.lineWrapping&&(k=l.getClientRects()).length>1?m=k[n=="right"?k.length-1:0]:m=l.getBoundingClientRect()}if(g&&v<9&&!f&&(!m||!m.left&&!m.right)){var T=l.parentNode.getClientRects()[0];T?m={left:T.left,right:T.left+rr(e.display),top:T.top,bottom:T.bottom}:m=Hs}for(var D=m.top-t.rect.top,F=m.bottom-t.rect.top,W=(D+F)/2,U=t.view.measure.heights,X=0;X=n.text.length?(h=n.text.length,m="before"):h<=0&&(h=0,m="after"),!d)return f(m=="before"?h-1:h,m=="before");function x(F,W,U){var X=d[W],Z=X.level==1;return f(U?F-1:F,Z!=U)}var k=Se(d,h,m),T=xe,D=x(h,k,m=="before");return T!=null&&(D.other=x(h,T,m!="before")),D}function Gs(e,t){var r=0;t=pe(e.doc,t),e.options.lineWrapping||(r=rr(e.display)*t.ch);var n=ae(e.doc,t.line),i=on(n)+Ri(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Pa(e,t,r,n,i){var l=G(e,t,r);return l.xRel=i,n&&(l.outside=n),l}function Ba(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return Pa(n.first,0,null,-1,-1);var i=In(n,r),l=n.first+n.size-1;if(i>l)return Pa(n.first+n.size-1,ae(n,l).text.length,null,1,1);t<0&&(t=0);for(var f=ae(n,i);;){var d=id(e,f,i,t,r),h=Oc(f,d.ch+(d.xRel>0||d.outside>0?1:0));if(!h)return d;var m=h.find(1);if(m.line==i)return m;f=ae(n,i=m.line)}}function Us(e,t,r,n){n-=Ha(t);var i=t.text.length,l=Pe(function(f){return Zt(e,r,f-1).bottom<=n},i,0);return i=Pe(function(f){return Zt(e,r,f).top>n},l,i),{begin:l,end:i}}function qs(e,t,r,n){r||(r=tr(e,t));var i=zi(e,t,Zt(e,r,n),"line").top;return Us(e,t,r,i)}function Wa(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function id(e,t,r,n,i){i-=on(t);var l=tr(e,t),f=Ha(t),d=0,h=t.text.length,m=!0,x=vt(t,e.doc.direction);if(x){var k=(e.options.lineWrapping?ad:od)(e,t,r,l,x,n,i);m=k.level!=1,d=m?k.from:k.to-1,h=m?k.to:k.from-1}var T=null,D=null,F=Pe(function(se){var le=Zt(e,l,se);return le.top+=f,le.bottom+=f,Wa(le,n,i,!1)?(le.top<=i&&le.left<=n&&(T=se,D=le),!0):!1},d,h),W,U,X=!1;if(D){var Z=n-D.left=ee.bottom?1:0}return F=Fr(t.text,F,1),Pa(r,F,U,X,n-W)}function od(e,t,r,n,i,l,f){var d=Pe(function(k){var T=i[k],D=T.level!=1;return Wa(qt(e,G(r,D?T.to:T.from,D?"before":"after"),"line",t,n),l,f,!0)},0,i.length-1),h=i[d];if(d>0){var m=h.level!=1,x=qt(e,G(r,m?h.from:h.to,m?"after":"before"),"line",t,n);Wa(x,l,f,!0)&&x.top>f&&(h=i[d-1])}return h}function ad(e,t,r,n,i,l,f){var d=Us(e,t,n,f),h=d.begin,m=d.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var x=null,k=null,T=0;T=m||D.to<=h)){var F=D.level!=1,W=Zt(e,n,F?Math.min(m,D.to)-1:Math.max(h,D.from)).right,U=WU)&&(x=D,k=U)}}return x||(x=i[i.length-1]),x.fromm&&(x={from:x.from,to:m,level:x.level}),x}var Hn;function nr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Hn==null){Hn=S("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Hn.appendChild(document.createTextNode("x")),Hn.appendChild(S("br"));Hn.appendChild(document.createTextNode("x"))}j(e.measure,Hn);var r=Hn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),de(e.measure),r||1}function rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=S("span","xxxxxxxxxx"),r=S("pre",[t],"CodeMirror-line-like");j(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ra(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,l=t.gutters.firstChild,f=0;l;l=l.nextSibling,++f){var d=e.display.gutterSpecs[f].className;r[d]=l.offsetLeft+l.clientLeft+i,n[d]=l.clientWidth}return{fixedPos:za(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function za(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ys(e){var t=nr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/rr(e.display)-3);return function(i){if(gn(e.doc,i))return 0;var l=0;if(i.widgets)for(var f=0;f0&&(m=ae(e.doc,h.line).text).length==h.ch){var x=Ue(m,m.length,e.options.tabSize)-m.length;h=G(h.line,Math.max(0,Math.round((l-Os(e.display).left)/rr(e.display))-x))}return h}function Bn(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var r=e.display.view,n=0;nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)rn&&Ta(e.doc,t)i.viewFrom?vn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)vn(e);else if(t<=i.viewFrom){var l=Gi(e,r,r+n,1);l?(i.view=i.view.slice(l.index),i.viewFrom=l.lineN,i.viewTo+=n):vn(e)}else if(r>=i.viewTo){var f=Gi(e,t,t,-1);f?(i.view=i.view.slice(0,f.index),i.viewTo=f.lineN):vn(e)}else{var d=Gi(e,t,t,-1),h=Gi(e,r,r+n,1);d&&h?(i.view=i.view.slice(0,d.index).concat(Wi(e,d.lineN,h.lineN)).concat(i.view.slice(h.index)),i.viewTo+=n):vn(e)}var m=i.externalMeasured;m&&(r=i.lineN&&t=n.viewTo)){var l=n.view[Bn(e,t)];if(l.node!=null){var f=l.changes||(l.changes=[]);Oe(f,r)==-1&&f.push(r)}}}function vn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gi(e,t,r,n){var i=Bn(e,t),l,f=e.display.view;if(!rn||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var d=e.display.viewFrom,h=0;h0){if(i==f.length-1)return null;l=d+f[i].size-t,i++}else l=d-t;t+=l,r+=l}for(;Ta(e.doc,r)!=r;){if(i==(n<0?0:f.length-1))return null;r+=n*f[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function ld(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Wi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Wi(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Bn(e,r)))),n.viewTo=r}function js(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||h.to().line0?f:e.defaultCharWidth())+"px"}if(n.other){var d=r.appendChild(S("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));d.style.display="",d.style.left=n.other.left+"px",d.style.top=n.other.top+"px",d.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Ui(e,t){return e.top-t.top||e.left-t.left}function sd(e,t,r){var n=e.display,i=e.doc,l=document.createDocumentFragment(),f=Os(e.display),d=f.left,h=Math.max(n.sizerWidth,Fn(e)-n.sizer.offsetLeft)-f.right,m=i.direction=="ltr";function x(K,ee,se,le){ee<0&&(ee=0),ee=Math.round(ee),le=Math.round(le),l.appendChild(S("div",null,"CodeMirror-selected","position: absolute; left: "+K+`px; +`,t);i==-1&&(i=e.length);var l=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),f=l.indexOf("\r");f!=-1?(r.push(l.slice(0,f)),t+=f+1):(r.push(l),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},mc=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},vc=function(){var e=S("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ma=null;function yc(e){if(ma!=null)return ma;var t=j(e,S("span","x")),r=t.getBoundingClientRect(),n=_(t,0,1).getBoundingClientRect();return ma=Math.abs(r.left-n.left)>1}var va={},Zn={};function xc(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),va[e]=t}function bc(e,t){Zn[e]=t}function Mi(e){if(typeof e=="string"&&Zn.hasOwnProperty(e))e=Zn[e];else if(e&&typeof e.name=="string"&&Zn.hasOwnProperty(e.name)){var t=Zn[e.name];typeof t=="string"&&(t={name:t}),e=Or(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Mi("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Mi("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ya(e,t){t=Mi(t);var r=va[t.name];if(!r)return ya(e,"text/plain");var n=r(e,t);if(Jn.hasOwnProperty(t.name)){var i=Jn[t.name];for(var l in i)i.hasOwnProperty(l)&&(n.hasOwnProperty(l)&&(n["_"+l]=n[l]),n[l]=i[l])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var f in t.modeProps)n[f]=t.modeProps[f];return n}var Jn={};function wc(e,t){var r=Jn.hasOwnProperty(e)?Jn[e]:Jn[e]={};st(t,r)}function Nn(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function xa(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),!(!r||r.mode==e));)t=r.state,e=r.mode;return r||{mode:e,state:t}}function os(e,t,r){return e.startState?e.startState(t,r):!0}var je=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};je.prototype.eol=function(){return this.pos>=this.string.length},je.prototype.sol=function(){return this.pos==this.lineStart},je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},je.prototype.next=function(){if(this.post},je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},je.prototype.skipToEnd=function(){this.pos=this.string.length},je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},je.prototype.backUp=function(e){this.pos-=e},je.prototype.column=function(){return this.lastColumnPos0?null:(l&&t!==!1&&(this.pos+=l[0].length),l)}},je.prototype.current=function(){return this.string.slice(this.start,this.pos)},je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ae(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 r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],l=i.chunkSize();if(t=e.first&&tr?G(r,ae(e,r).text.length):Sc(t,ae(e,t.line).text.length)}function Sc(e,t){var r=e.ch;return r==null||r>t?G(e.line,t):r<0?G(e.line,0):e}function ls(e,t){for(var r=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},$t.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}},$t.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},$t.fromSaved=function(e,t,r){return t instanceof Oi?new $t(e,Nn(e.mode,t.state),r,t.lookAhead):new $t(e,Nn(e.mode,t),r)},$t.prototype.save=function(e){var t=e!==!1?Nn(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Oi(t,this.maxLookAhead):t};function ss(e,t,r,n){var i=[e.state.modeGen],l={};ps(e,t.text,e.doc.mode,r,function(m,x){return i.push(m,x)},l,n);for(var f=r.state,d=function(m){r.baseTokens=i;var x=e.state.overlays[m],k=1,T=0;r.state=!0,ps(e,t.text,x.mode,r,function(D,F){for(var W=k;TD&&i.splice(k,1,D,i[k+1],U),k+=2,T=Math.min(D,U)}if(F)if(x.opaque)i.splice(W,k-W,D,"overlay "+F),k=W+2;else for(;We.options.maxHighlightLength&&Nn(e.doc.mode,n.state),l=ss(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=l.styles,l.classes?t.styleClasses=l.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Br(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new $t(n,!0,t);var l=kc(e,t,r),f=l>n.first&&ae(n,l-1).stateAfter,d=f?$t.fromSaved(n,f,l):new $t(n,os(n.mode),l);return n.iter(l,t,function(h){Ca(e,h.text,d);var m=d.line;h.stateAfter=m==t-1||m%5==0||m>=i.viewFrom&&mt.start)return l}throw new Error("Mode "+e.name+" failed to advance stream.")}var cs=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function ds(e,t,r,n){var i=e.doc,l=i.mode,f;t=pe(i,t);var d=ae(i,t.line),h=Br(e,t.line,r),m=new je(d.text,e.options.tabSize,h),x;for(n&&(x=[]);(n||m.pose.options.maxHighlightLength?(d=!1,f&&Ca(e,t,n,x.pos),x.pos=t.length,k=null):k=hs(Ea(r,x,n.state,T),l),T){var D=T[0].name;D&&(k="m-"+(k?D+" "+k:D))}if(!d||m!=k){for(;hf;--d){if(d<=l.first)return l.first;var h=ae(l,d-1),m=h.stateAfter;if(m&&(!r||d+(m instanceof Oi?m.lookAhead:0)<=l.modeFrontier))return d;var x=Ue(h.text,null,e.options.tabSize);(i==null||n>x)&&(i=d-1,n=x)}return i}function Cc(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontierr;n--){var i=ae(e,n).stateAfter;if(i&&(!(i instanceof Oi)||n+i.lookAhead=t:l.to>t);(n||(n=[])).push(new Ii(f,l.from,h?null:l.to))}}return n}function Ac(e,t,r){var n;if(e)for(var i=0;i=t:l.to>t);if(d||l.from==t&&f.type=="bookmark"&&(!r||l.marker.insertLeft)){var h=l.from==null||(f.inclusiveLeft?l.from<=t:l.from0&&d)for(var ee=0;ee0)){var x=[h,1],k=he(m.from,d.from),T=he(m.to,d.to);(k<0||!f.inclusiveLeft&&!k)&&x.push({from:m.from,to:d.from}),(T>0||!f.inclusiveRight&&!T)&&x.push({from:d.to,to:m.to}),i.splice.apply(i,x),h+=x.length-3}}return i}function vs(e){var t=e.markedSpans;if(t){for(var r=0;rt)&&(!n||Da(n,l.marker)<0)&&(n=l.marker)}return n}function ws(e,t,r,n,i){var l=ae(e,t),f=rn&&l.markedSpans;if(f)for(var d=0;d=0&&k<=0||x<=0&&k>=0)&&(x<=0&&(h.marker.inclusiveRight&&i.inclusiveLeft?he(m.to,r)>=0:he(m.to,r)>0)||x>=0&&(h.marker.inclusiveRight&&i.inclusiveLeft?he(m.from,n)<=0:he(m.from,n)<0)))return!0}}}function Ut(e){for(var t;t=bs(e);)e=t.find(-1,!0).line;return e}function Ic(e){for(var t;t=Pi(e);)e=t.find(1,!0).line;return e}function Fc(e){for(var t,r;t=Pi(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Ta(e,t){var r=ae(e,t),n=Ut(r);return r==n?t:De(n)}function Ss(e,t){if(t>e.lastLine())return t;var r=ae(e,t),n;if(!gn(e,r))return t;for(;n=Pi(r);)r=n.find(1,!0).line;return De(r)+1}function gn(e,t){var r=rn&&t.markedSpans;if(r){for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var Vn=function(e,t,r){this.text=e,ys(this,t),this.height=r?r(this):1};Vn.prototype.lineNo=function(){return De(this)},Qn(Vn);function Hc(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),vs(e),ys(e,r);var i=n?n(e):1;i!=e.height&&Kt(e,i)}function Pc(e){e.parent=null,vs(e)}var Bc={},Wc={};function ks(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Wc:Bc;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Cs(e,t){var r=R("span",null,null,b?"padding-right: .1px":null),n={pre:R("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var l=i?t.rest[i-1]:t.line,f=void 0;n.pos=0,n.addToken=zc,gc(e.display.measure)&&(f=vt(l,e.doc.direction))&&(n.addToken=Gc(n.addToken,f)),n.map=[];var d=t!=e.display.externalMeasured&&De(l);Uc(l,n,us(e,l,d)),l.styleClasses&&(l.styleClasses.bgClass&&(n.bgClass=mt(l.styleClasses.bgClass,n.bgClass||"")),l.styleClasses.textClass&&(n.textClass=mt(l.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(pc(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var h=n.content.lastChild;(/\bcm-tab\b/.test(h.className)||h.querySelector&&h.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return Me(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=mt(n.pre.className,n.textClass||"")),n}function Rc(e){var t=S("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function zc(e,t,r,n,i,l,f){if(t){var d=e.splitSpaces?_c(t,e.trailingSpace):t,h=e.cm.state.specialChars,m=!1,x;if(!h.test(t))e.col+=t.length,x=document.createTextNode(d),e.map.push(e.pos,e.pos+t.length,x),g&&v<9&&(m=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var k=0;;){h.lastIndex=k;var T=h.exec(t),D=T?T.index-k:t.length-k;if(D){var F=document.createTextNode(d.slice(k,k+D));g&&v<9?x.appendChild(S("span",[F])):x.appendChild(F),e.map.push(e.pos,e.pos+D,F),e.col+=D,e.pos+=D}if(!T)break;k+=D+1;var W=void 0;if(T[0]==" "){var U=e.cm.options.tabSize,X=U-e.col%U;W=x.appendChild(S("span",_t(X),"cm-tab")),W.setAttribute("role","presentation"),W.setAttribute("cm-text"," "),e.col+=X}else T[0]=="\r"||T[0]==` +`?(W=x.appendChild(S("span",T[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),W.setAttribute("cm-text",T[0]),e.col+=1):(W=e.cm.options.specialCharPlaceholder(T[0]),W.setAttribute("cm-text",T[0]),g&&v<9?x.appendChild(S("span",[W])):x.appendChild(W),e.col+=1);e.map.push(e.pos,e.pos+1,W),e.pos++}}if(e.trailingSpace=d.charCodeAt(t.length-1)==32,r||n||i||m||l||f){var Q=r||"";n&&(Q+=n),i&&(Q+=i);var K=S("span",[x],Q,l);if(f)for(var ee in f)f.hasOwnProperty(ee)&&ee!="style"&&ee!="class"&&K.setAttribute(ee,f[ee]);return e.content.appendChild(K)}e.content.appendChild(x)}}function _c(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;im&&k.from<=m));T++);if(k.to>=x)return e(r,n,i,l,f,d,h);e(r,n.slice(0,k.to-m),i,l,null,d,h),l=null,n=n.slice(k.to-m),m=k.to}}}function Es(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Uc(e,t,r){var n=e.markedSpans,i=e.text,l=0;if(!n){for(var f=1;fh||me.collapsed&&le.to==h&&le.from==h)){if(le.to!=null&&le.to!=h&&D>le.to&&(D=le.to,W=""),me.className&&(F+=" "+me.className),me.css&&(T=(T?T+";":"")+me.css),me.startStyle&&le.from==h&&(U+=" "+me.startStyle),me.endStyle&&le.to==D&&(ee||(ee=[])).push(me.endStyle,le.to),me.title&&((Q||(Q={})).title=me.title),me.attributes)for(var Ae in me.attributes)(Q||(Q={}))[Ae]=me.attributes[Ae];me.collapsed&&(!X||Da(X.marker,me)<0)&&(X=le)}else le.from>h&&D>le.from&&(D=le.from)}if(ee)for(var rt=0;rt=d)break;for(var Mt=Math.min(d,D);;){if(x){var wt=h+x.length;if(!X){var Xe=wt>Mt?x.slice(0,Mt-h):x;t.addToken(t,Xe,k?k+F:F,U,h+Xe.length==D?W:"",T,Q)}if(wt>=Mt){x=x.slice(Mt-h),h=Mt;break}h=wt,U=""}x=i.slice(l,l=r[m++]),k=ks(r[m++],t.cm.options)}}}function Ls(e,t,r){this.line=t,this.rest=Fc(t),this.size=this.rest?De(ye(this.rest))-r+1:1,this.node=this.text=null,this.hidden=gn(e,t)}function Wi(e,t,r){for(var n=[],i,l=t;l2&&l.push((h.bottom+m.top)/2-r.top)}}l.push(r.bottom-r.top)}}function Is(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function ed(e,t){t=Ut(t);var r=De(t),n=e.display.externalMeasured=new Ls(e.doc,t,r);n.lineN=r;var i=n.built=Cs(e,n);return n.text=i.pre,j(e.display.lineMeasure,i.pre),n}function Fs(e,t,r,n){return Zt(e,tr(e,t),r,n)}function Fa(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(l=h-d,i=l-1,t>=h&&(f="right")),i!=null){if(n=e[m+2],d==h&&r==(n.insertLeft?"left":"right")&&(f=r),r=="left"&&i==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)n=e[(m-=3)+2],f="left";if(r=="right"&&i==h-d)for(;m=0&&(r=e[i]).left==r.right;i--);return r}function nd(e,t,r,n){var i=Ps(t.map,r,n),l=i.node,f=i.start,d=i.end,h=i.collapse,m;if(l.nodeType==3){for(var x=0;x<4;x++){for(;f&&An(t.line.text.charAt(i.coverStart+f));)--f;for(;i.coverStart+d0&&(h=n="right");var k;e.options.lineWrapping&&(k=l.getClientRects()).length>1?m=k[n=="right"?k.length-1:0]:m=l.getBoundingClientRect()}if(g&&v<9&&!f&&(!m||!m.left&&!m.right)){var T=l.parentNode.getClientRects()[0];T?m={left:T.left,right:T.left+rr(e.display),top:T.top,bottom:T.bottom}:m=Hs}for(var D=m.top-t.rect.top,F=m.bottom-t.rect.top,W=(D+F)/2,U=t.view.measure.heights,X=0;X=n.text.length?(h=n.text.length,m="before"):h<=0&&(h=0,m="after"),!d)return f(m=="before"?h-1:h,m=="before");function x(F,W,U){var X=d[W],Q=X.level==1;return f(U?F-1:F,Q!=U)}var k=Se(d,h,m),T=xe,D=x(h,k,m=="before");return T!=null&&(D.other=x(h,T,m!="before")),D}function Gs(e,t){var r=0;t=pe(e.doc,t),e.options.lineWrapping||(r=rr(e.display)*t.ch);var n=ae(e.doc,t.line),i=on(n)+Ri(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Pa(e,t,r,n,i){var l=G(e,t,r);return l.xRel=i,n&&(l.outside=n),l}function Ba(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return Pa(n.first,0,null,-1,-1);var i=In(n,r),l=n.first+n.size-1;if(i>l)return Pa(n.first+n.size-1,ae(n,l).text.length,null,1,1);t<0&&(t=0);for(var f=ae(n,i);;){var d=id(e,f,i,t,r),h=Oc(f,d.ch+(d.xRel>0||d.outside>0?1:0));if(!h)return d;var m=h.find(1);if(m.line==i)return m;f=ae(n,i=m.line)}}function Us(e,t,r,n){n-=Ha(t);var i=t.text.length,l=Pe(function(f){return Zt(e,r,f-1).bottom<=n},i,0);return i=Pe(function(f){return Zt(e,r,f).top>n},l,i),{begin:l,end:i}}function qs(e,t,r,n){r||(r=tr(e,t));var i=zi(e,t,Zt(e,r,n),"line").top;return Us(e,t,r,i)}function Wa(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function id(e,t,r,n,i){i-=on(t);var l=tr(e,t),f=Ha(t),d=0,h=t.text.length,m=!0,x=vt(t,e.doc.direction);if(x){var k=(e.options.lineWrapping?ad:od)(e,t,r,l,x,n,i);m=k.level!=1,d=m?k.from:k.to-1,h=m?k.to:k.from-1}var T=null,D=null,F=Pe(function(se){var le=Zt(e,l,se);return le.top+=f,le.bottom+=f,Wa(le,n,i,!1)?(le.top<=i&&le.left<=n&&(T=se,D=le),!0):!1},d,h),W,U,X=!1;if(D){var Q=n-D.left=ee.bottom?1:0}return F=Fr(t.text,F,1),Pa(r,F,U,X,n-W)}function od(e,t,r,n,i,l,f){var d=Pe(function(k){var T=i[k],D=T.level!=1;return Wa(qt(e,G(r,D?T.to:T.from,D?"before":"after"),"line",t,n),l,f,!0)},0,i.length-1),h=i[d];if(d>0){var m=h.level!=1,x=qt(e,G(r,m?h.from:h.to,m?"after":"before"),"line",t,n);Wa(x,l,f,!0)&&x.top>f&&(h=i[d-1])}return h}function ad(e,t,r,n,i,l,f){var d=Us(e,t,n,f),h=d.begin,m=d.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var x=null,k=null,T=0;T=m||D.to<=h)){var F=D.level!=1,W=Zt(e,n,F?Math.min(m,D.to)-1:Math.max(h,D.from)).right,U=WU)&&(x=D,k=U)}}return x||(x=i[i.length-1]),x.fromm&&(x={from:x.from,to:m,level:x.level}),x}var Hn;function nr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Hn==null){Hn=S("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Hn.appendChild(document.createTextNode("x")),Hn.appendChild(S("br"));Hn.appendChild(document.createTextNode("x"))}j(e.measure,Hn);var r=Hn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),ce(e.measure),r||1}function rr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=S("span","xxxxxxxxxx"),r=S("pre",[t],"CodeMirror-line-like");j(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ra(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,l=t.gutters.firstChild,f=0;l;l=l.nextSibling,++f){var d=e.display.gutterSpecs[f].className;r[d]=l.offsetLeft+l.clientLeft+i,n[d]=l.clientWidth}return{fixedPos:za(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function za(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Ys(e){var t=nr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/rr(e.display)-3);return function(i){if(gn(e.doc,i))return 0;var l=0;if(i.widgets)for(var f=0;f0&&(m=ae(e.doc,h.line).text).length==h.ch){var x=Ue(m,m.length,e.options.tabSize)-m.length;h=G(h.line,Math.max(0,Math.round((l-Os(e.display).left)/rr(e.display))-x))}return h}function Bn(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var r=e.display.view,n=0;nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)rn&&Ta(e.doc,t)i.viewFrom?vn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)vn(e);else if(t<=i.viewFrom){var l=Gi(e,r,r+n,1);l?(i.view=i.view.slice(l.index),i.viewFrom=l.lineN,i.viewTo+=n):vn(e)}else if(r>=i.viewTo){var f=Gi(e,t,t,-1);f?(i.view=i.view.slice(0,f.index),i.viewTo=f.lineN):vn(e)}else{var d=Gi(e,t,t,-1),h=Gi(e,r,r+n,1);d&&h?(i.view=i.view.slice(0,d.index).concat(Wi(e,d.lineN,h.lineN)).concat(i.view.slice(h.index)),i.viewTo+=n):vn(e)}var m=i.externalMeasured;m&&(r=i.lineN&&t=n.viewTo)){var l=n.view[Bn(e,t)];if(l.node!=null){var f=l.changes||(l.changes=[]);Oe(f,r)==-1&&f.push(r)}}}function vn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gi(e,t,r,n){var i=Bn(e,t),l,f=e.display.view;if(!rn||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var d=e.display.viewFrom,h=0;h0){if(i==f.length-1)return null;l=d+f[i].size-t,i++}else l=d-t;t+=l,r+=l}for(;Ta(e.doc,r)!=r;){if(i==(n<0?0:f.length-1))return null;r+=n*f[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function ld(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Wi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Wi(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Bn(e,r)))),n.viewTo=r}function js(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||h.to().line0?f:e.defaultCharWidth())+"px"}if(n.other){var d=r.appendChild(S("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));d.style.display="",d.style.left=n.other.left+"px",d.style.top=n.other.top+"px",d.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Ui(e,t){return e.top-t.top||e.left-t.left}function sd(e,t,r){var n=e.display,i=e.doc,l=document.createDocumentFragment(),f=Os(e.display),d=f.left,h=Math.max(n.sizerWidth,Fn(e)-n.sizer.offsetLeft)-f.right,m=i.direction=="ltr";function x(K,ee,se,le){ee<0&&(ee=0),ee=Math.round(ee),le=Math.round(le),l.appendChild(S("div",null,"CodeMirror-selected","position: absolute; left: "+K+`px; top: `+ee+"px; width: "+(se==null?h-K:se)+`px; - height: `+(le-ee)+"px"))}function k(K,ee,se){var le=ae(i,K),me=le.text.length,Ae,rt;function We(Xe,St){return _i(e,G(K,Xe),"div",le,St)}function Mt(Xe,St,lt){var $e=qs(e,le,null,Xe),Ke=St=="ltr"==(lt=="after")?"left":"right",_e=lt=="after"?$e.begin:$e.end-(/\s/.test(le.text.charAt($e.end-1))?2:1);return We(_e,Ke)[Ke]}var wt=vt(le,i.direction);return ua(wt,ee||0,se==null?me:se,function(Xe,St,lt,$e){var Ke=lt=="ltr",_e=We(Xe,Ke?"left":"right"),kt=We(St-1,Ke?"right":"left"),mr=ee==null&&Xe==0,kn=se==null&&St==me,ft=$e==0,Jt=!wt||$e==wt.length-1;if(kt.top-_e.top<=3){var it=(m?mr:kn)&&ft,gl=(m?kn:mr)&&Jt,un=it?d:(Ke?_e:kt).left,Gn=gl?h:(Ke?kt:_e).right;x(un,_e.top,Gn-un,_e.bottom)}else{var Un,pt,vr,ml;Ke?(Un=m&&mr&&ft?d:_e.left,pt=m?h:Mt(Xe,lt,"before"),vr=m?d:Mt(St,lt,"after"),ml=m&&kn&&Jt?h:kt.right):(Un=m?Mt(Xe,lt,"before"):d,pt=!m&&mr&&ft?h:_e.right,vr=!m&&kn&&Jt?d:kt.left,ml=m?Mt(St,lt,"after"):h),x(Un,_e.top,pt-Un,_e.bottom),_e.bottom0?t.blinker=setInterval(function(){e.hasFocus()||ir(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ks(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ya(e))}function qa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ir(e))},100)}function Ya(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Me(e,"focus",e,t),e.state.focused=!0,Ie(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ua(e))}function ir(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Me(e,"blur",e,t),e.state.focused=!1,oe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function qi(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,l=0,f=0;f.005||D<-.005)&&(ie.display.sizerWidth){var W=Math.ceil(x/rr(e.display));W>e.display.maxLineLength&&(e.display.maxLineLength=W,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function $s(e){if(e.widgets)for(var t=0;t=f&&(l=In(t,on(ae(t,h))-e.wrapper.clientHeight),f=h)}return{from:l,to:Math.max(f,l+1)}}function ud(e,t){if(!Be(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null,l=r.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(i=!1),i!=null&&!z){var f=S("div","\u200B",null,`position: absolute; + height: `+(le-ee)+"px"))}function k(K,ee,se){var le=ae(i,K),me=le.text.length,Ae,rt;function We(Xe,St){return _i(e,G(K,Xe),"div",le,St)}function Mt(Xe,St,lt){var $e=qs(e,le,null,Xe),Ke=St=="ltr"==(lt=="after")?"left":"right",_e=lt=="after"?$e.begin:$e.end-(/\s/.test(le.text.charAt($e.end-1))?2:1);return We(_e,Ke)[Ke]}var wt=vt(le,i.direction);return ua(wt,ee||0,se==null?me:se,function(Xe,St,lt,$e){var Ke=lt=="ltr",_e=We(Xe,Ke?"left":"right"),kt=We(St-1,Ke?"right":"left"),mr=ee==null&&Xe==0,kn=se==null&&St==me,ft=$e==0,Jt=!wt||$e==wt.length-1;if(kt.top-_e.top<=3){var it=(m?mr:kn)&&ft,gl=(m?kn:mr)&&Jt,un=it?d:(Ke?_e:kt).left,Gn=gl?h:(Ke?kt:_e).right;x(un,_e.top,Gn-un,_e.bottom)}else{var Un,pt,vr,ml;Ke?(Un=m&&mr&&ft?d:_e.left,pt=m?h:Mt(Xe,lt,"before"),vr=m?d:Mt(St,lt,"after"),ml=m&&kn&&Jt?h:kt.right):(Un=m?Mt(Xe,lt,"before"):d,pt=!m&&mr&&ft?h:_e.right,vr=!m&&kn&&Jt?d:kt.left,ml=m?Mt(St,lt,"after"):h),x(Un,_e.top,pt-Un,_e.bottom),_e.bottom0?t.blinker=setInterval(function(){e.hasFocus()||ir(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ks(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ya(e))}function qa(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&ir(e))},100)}function Ya(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Me(e,"focus",e,t),e.state.focused=!0,Ie(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ua(e))}function ir(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Me(e,"blur",e,t),e.state.focused=!1,oe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function qi(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,l=0,f=0;f.005||D<-.005)&&(ie.display.sizerWidth){var W=Math.ceil(x/rr(e.display));W>e.display.maxLineLength&&(e.display.maxLineLength=W,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}Math.abs(l)>2&&(t.scroller.scrollTop+=l)}function $s(e){if(e.widgets)for(var t=0;t=f&&(l=In(t,on(ae(t,h))-e.wrapper.clientHeight),f=h)}return{from:l,to:Math.max(f,l+1)}}function ud(e,t){if(!Be(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null,l=r.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(l.defaultView.innerHeight||l.documentElement.clientHeight)&&(i=!1),i!=null&&!z){var f=S("div","\u200B",null,`position: absolute; top: `+(t.top-r.viewOffset-Ri(e.display))+`px; height: `+(t.bottom-t.top+Qt(e)+r.barHeight)+`px; - left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(f),f.scrollIntoView(i),e.display.lineSpace.removeChild(f)}}}function fd(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(r=t.sticky=="before"?G(t.line,t.ch+1,"before"):t,t=t.ch?G(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var f=!1,d=qt(e,t),h=!r||r==t?d:qt(e,r);i={left:Math.min(d.left,h.left),top:Math.min(d.top,h.top)-n,right:Math.max(d.left,h.left),bottom:Math.max(d.bottom,h.bottom)+n};var m=ja(e,i),x=e.doc.scrollTop,k=e.doc.scrollLeft;if(m.scrollTop!=null&&(Yr(e,m.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(f=!0)),m.scrollLeft!=null&&(Wn(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return i}function cd(e,t){var r=ja(e,t);r.scrollTop!=null&&Yr(e,r.scrollTop),r.scrollLeft!=null&&Wn(e,r.scrollLeft)}function ja(e,t){var r=e.display,n=nr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,l=Ia(e),f={};t.bottom-t.top>l&&(t.bottom=t.top+l);var d=e.doc.height+Oa(r),h=t.topd-n;if(t.topi+l){var x=Math.min(t.top,(m?d:t.bottom)-l);x!=i&&(f.scrollTop=x)}var k=e.options.fixedGutter?0:r.gutters.offsetWidth,T=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-k,D=Fn(e)-r.gutters.offsetWidth,F=t.right-t.left>D;return F&&(t.right=t.left+D),t.left<10?f.scrollLeft=0:t.leftD+T-3&&(f.scrollLeft=t.right+(F?0:10)-D),f}function Xa(e,t){t!=null&&(ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function or(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function qr(e,t,r){(t!=null||r!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function dd(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Gs(e,t.from),n=Gs(e,t.to);Qs(e,r,n,t.margin)}}function Qs(e,t,r,n){var i=ja(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});qr(e,i.scrollLeft,i.scrollTop)}function Yr(e,t){Math.abs(e.doc.scrollTop-t)<2||(a||$a(e,{top:t}),Zs(e,t,!0),a&&$a(e),Kr(e,100))}function Zs(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Wn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)&&(e.doc.scrollLeft=t,nu(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Oa(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Qt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Rn=function(e,t,r){this.cm=r;var n=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),ue(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ue(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&v<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(r?n: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&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Rn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rn.prototype.zeroWidthHack=function(){var e=O&&!E?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ve,this.disableVert=new Ve},Rn.prototype.enableZeroWidthBar=function(e,t,r){e.style.visibility="";function n(){var i=e.getBoundingClientRect(),l=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);l!=e?e.style.visibility="hidden":t.set(1e3,n)}t.set(1e3,n)},Rn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Xr=function(){};Xr.prototype.update=function(){return{bottom:0,right:0}},Xr.prototype.setScrollLeft=function(){},Xr.prototype.setScrollTop=function(){},Xr.prototype.clear=function(){};function ar(e,t){t||(t=jr(e));var r=e.display.barWidth,n=e.display.barHeight;Js(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&qi(e),Js(e,jr(e)),r=e.display.barWidth,n=e.display.barHeight}function Js(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var Vs={native:Rn,null:Xr};function eu(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&oe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ue(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Wn(e,t):Yr(e,t)},e),e.display.scrollbars.addClass&&Ie(e.display.wrapper,e.display.scrollbars.addClass)}var hd=0;function zn(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:++hd,markArrays:null},qc(e.curOp)}function _n(e){var t=e.curOp;t&&jc(t,function(r){for(var n=0;n=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function md(e){e.updatedDisplay=e.mustUpdate&&Ka(e.cm,e.update)}function vd(e){var t=e.cm,r=t.display;e.updatedDisplay&&qi(t),e.barMeasure=jr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Fs(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Qt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Fn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function yd(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Br(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(l){if(n.line>=e.display.viewFrom){var f=l.styles,d=l.text.length>e.options.maxHighlightLength?Nn(t.mode,n.state):null,h=ss(e,l,n,!0);d&&(n.state=d),l.styles=h.styles;var m=l.styleClasses,x=h.classes;x?l.styleClasses=x:m&&(l.styleClasses=null);for(var k=!f||f.length!=l.styles.length||m!=x&&(!m||!x||m.bgClass!=x.bgClass||m.textClass!=x.textClass),T=0;!k&&Tr)return Kr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Tt(e,function(){for(var l=0;l=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&js(e)==0)return!1;ru(e)&&(vn(e),t.dims=Ra(e));var i=n.first+n.size,l=Math.max(t.visible.from-e.options.viewportMargin,n.first),f=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFromf&&r.viewTo-f<20&&(f=Math.min(i,r.viewTo)),rn&&(l=Ta(e.doc,l),f=Ss(e.doc,f));var d=l!=r.viewFrom||f!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;ld(e,l,f),r.viewOffset=on(ae(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var h=js(e);if(!d&&h==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var m=Sd(e);return h>4&&(r.lineDiv.style.display="none"),Cd(e,r.updateLineNumbers,t.dims),h>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,kd(m),de(r.cursorDiv),de(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,d&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Kr(e,400)),r.updateLineNumbers=null,!0}function tu(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Fn(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+Oa(e.display)-Ia(e),r.top)}),t.visible=Yi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Yi(e.display,e.doc,r));if(!Ka(e,t))break;qi(e);var i=jr(e);Ur(e),ar(e,i),Za(e,i),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 $a(e,t){var r=new Xi(e,t);if(Ka(e,r)){qi(e),tu(e,r);var n=jr(e);Ur(e),ar(e,n),Za(e,n),r.finish()}}function Cd(e,t,r){var n=e.display,i=e.options.lineNumbers,l=n.lineDiv,f=l.firstChild;function d(F){var W=F.nextSibling;return b&&O&&e.display.currentWheelTarget==F?F.style.display="none":F.parentNode.removeChild(F),W}for(var h=n.view,m=n.viewFrom,x=0;x-1&&(D=!1),Ds(e,k,m,r)),D&&(de(k.lineNumber),k.lineNumber.appendChild(document.createTextNode(wa(e.options,m)))),f=k.node.nextSibling}m+=k.size}for(;f;)f=d(f)}function Qa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",et(e,"gutterChanged",e)}function Za(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+Qt(e)+"px"}function nu(e){var t=e.display,r=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var n=za(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,l=n+"px",f=0;f=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),g&&v<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!b&&!(a&&J)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Ja(n.gutters,n.lineNumbers),iu(i),r.init(i)}var Ki=0,ln=null;g?ln=-.53:a?ln=15:L?ln=-.7:I&&(ln=-1/3);function ou(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function Ld(e){var t=ou(e);return t.x*=ln,t.y*=ln,t}function au(e,t){L&&N==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 r=ou(t),n=r.x,i=r.y,l=ln;t.deltaMode===0&&(n=t.deltaX,i=t.deltaY,l=1);var f=e.display,d=f.scroller,h=d.scrollWidth>d.clientWidth,m=d.scrollHeight>d.clientHeight;if(n&&h||i&&m){if(i&&O&&b){e:for(var x=t.target,k=f.view;x!=d;x=x.parentNode)for(var T=0;T=0&&he(e,n.to())<=0)return r}return-1};var Ee=function(e,t){this.anchor=e,this.head=t};Ee.prototype.from=function(){return Ni(this.anchor,this.head)},Ee.prototype.to=function(){return Ai(this.anchor,this.head)},Ee.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yt(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(T,D){return he(T.from(),D.from())}),r=Oe(t,i);for(var l=1;l0:h>=0){var m=Ni(d.from(),f.from()),x=Ai(d.to(),f.to()),k=d.empty()?f.from()==f.head:d.from()==d.head;l<=r&&--r,t.splice(--l,2,new Ee(k?x:m,k?m:x))}}return new It(t,r)}function yn(e,t){return new It([new Ee(e,t||e)],0)}function xn(e){return e.text?G(e.from.line+e.text.length-1,ye(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function lu(e,t){if(he(e,t.from)<0)return e;if(he(e,t.to)<=0)return xn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=xn(t).ch-t.to.ch),G(r,n)}function Va(e,t){for(var r=[],n=0;n1&&e.remove(d.line+1,F-1),e.insert(d.line+1,X)}et(e,"change",e,t)}function bn(e,t,r){function n(i,l,f){if(i.linked)for(var d=0;d1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ye(e.done)}function hu(e,t,r,n){var i=e.history;i.undone.length=0;var l=+new Date,f,d;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(f=Md(i,i.lastOp==n)))d=ye(f.changes),he(t.from,t.to)==0&&he(t.from,d.to)==0?d.to=xn(t):f.changes.push(nl(e,t));else{var h=ye(i.done);for((!h||!h.ranges)&&Qi(e.sel,i.done),f={changes:[nl(e,t)],generation:i.generation},i.done.push(f);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,d||Me(e,"historyAdded")}function Ad(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Nd(e,t,r,n){var i=e.history,l=n&&n.origin;r==i.lastSelOp||l&&i.lastSelOrigin==l&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==l||Ad(e,l,ye(i.done),t))?i.done[i.done.length-1]=t:Qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=l,i.lastSelOp=r,n&&n.clearRedo!==!1&&du(i.undone)}function Qi(e,t){var r=ye(t);r&&r.ranges&&r.equals(e)||t.push(e)}function pu(e,t,r,n){var i=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(f){f.markedSpans&&((i||(i=t["spans_"+e.id]={}))[l]=f.markedSpans),++l})}function Od(e){if(!e)return null;for(var t,r=0;r-1&&(ye(d)[k]=m[k],delete m[k])}}return n}function rl(e,t,r,n){if(n){var i=e.anchor;if(r){var l=he(t,i)<0;l!=he(r,i)<0?(i=t,t=r):l!=he(t,r)<0&&(t=r)}return new Ee(i,t)}else return new Ee(r||t,t)}function Zi(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),ut(e,new It([rl(e.sel.primary(),t,r,i)],0),n)}function mu(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),l=0;l=t.ch:d.to>t.ch))){if(i&&(Me(h,"beforeCursorEnter"),h.explicitlyCleared))if(l.markedSpans){--f;continue}else break;if(!h.atomic)continue;if(r){var k=h.find(n<0?1:-1),T=void 0;if((n<0?x:m)&&(k=Su(e,k,-n,k&&k.line==t.line?l:null)),k&&k.line==t.line&&(T=he(k,r))&&(n<0?T<0:T>0))return sr(e,k,t,n,i)}var D=h.find(n<0?-1:1);return(n<0?m:x)&&(D=Su(e,D,n,D.line==t.line?l:null)),D?sr(e,D,t,n,i):null}}return t}function Vi(e,t,r,n,i){var l=n||1,f=sr(e,t,r,l,i)||!i&&sr(e,t,r,l,!0)||sr(e,t,r,-l,i)||!i&&sr(e,t,r,-l,!0);return f||(e.cantEdit=!0,G(e.first,0))}function Su(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?pe(e,G(t.line-1)):null:r>0&&t.ch==(n||ae(e,t.line)).text.length?t.line=0;--i)Eu(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Eu(e,t)}}function Eu(e,t){if(!(t.text.length==1&&t.text[0]==""&&he(t.from,t.to)==0)){var r=Va(e,t);hu(e,t,r,e.cm?e.cm.curOp.id:NaN),Zr(e,t,r,La(e,t));var n=[];bn(e,function(i,l){!l&&Oe(n,i.history)==-1&&(Mu(i.history,t),n.push(i.history)),Zr(i,t,null,La(i,t))})}}function eo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!(n&&!r)){for(var i=e.history,l,f=e.sel,d=t=="undo"?i.done:i.undone,h=t=="undo"?i.undone:i.done,m=0;m=0;--D){var F=T(D);if(F)return F.v}}}}function Lu(e,t){if(t!=0&&(e.first+=t,e.sel=new It(Dt(e.sel.ranges,function(i){return new Ee(G(i.anchor.line+t,i.anchor.ch),G(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){xt(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.linel&&(t={from:t.from,to:G(l,ae(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=On(e,t.from,t.to),r||(r=Va(e,t)),e.cm?Hd(e.cm,t,n):tl(e,t,n),Ji(e,r,at),e.cantEdit&&Vi(e,G(e.firstLine(),0))&&(e.cantEdit=!1)}}function Hd(e,t,r){var n=e.doc,i=e.display,l=t.from,f=t.to,d=!1,h=l.line;e.options.lineWrapping||(h=De(Ut(ae(n,l.line))),n.iter(h,f.line+1,function(D){if(D==i.maxLine)return d=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ns(e),tl(n,t,r,Ys(e)),e.options.lineWrapping||(n.iter(h,l.line+t.text.length,function(D){var F=Bi(D);F>i.maxLineLength&&(i.maxLine=D,i.maxLineLength=F,i.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),Cc(n,l.line),Kr(e,400);var m=t.text.length-(f.line-l.line)-1;t.full?xt(e):l.line==f.line&&t.text.length==1&&!uu(e.doc,t)?mn(e,l.line,"text"):xt(e,l.line,f.line+1,m);var x=Wt(e,"changes"),k=Wt(e,"change");if(k||x){var T={from:l,to:f,text:t.text,removed:t.removed,origin:t.origin};k&&et(e,"change",e,T),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(T)}e.display.selForContextMenu=null}function fr(e,t,r,n,i){var l;n||(n=r),he(n,r)<0&&(l=[n,r],r=l[0],n=l[1]),typeof t=="string"&&(t=e.splitLines(t)),ur(e,{from:r,to:n,text:t,origin:i})}function Du(e,t,r,n){r1||!(this.children[0]instanceof Vr))){var d=[];this.collapse(d),this.children=[new Vr(d)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var f=i.lines.length%25+25,d=f;d10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&xt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&bu(e.doc)),e&&et(e,"markerCleared",e,this,n,i),t&&_n(e),this.parent&&this.parent.clear()}},wn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i0||f==0&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=R("span",[l.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ws(e,t.line,t,r,l)||t.line!=r.line&&ws(e,r.line,t,r,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lc()}l.addToHistory&&hu(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var d=t.line,h=e.cm,m;if(e.iter(d,r.line+1,function(k){h&&l.collapsed&&!h.options.lineWrapping&&Ut(k)==h.display.maxLine&&(m=!0),l.collapsed&&d!=t.line&&Kt(k,0),Tc(k,new Ii(l,d==t.line?t.ch:null,d==r.line?r.ch:null),e.cm&&e.cm.curOp),++d}),l.collapsed&&e.iter(t.line,r.line+1,function(k){gn(e,k)&&Kt(k,0)}),l.clearOnEnter&&ue(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(Ec(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++Nu,l.atomic=!0),h){if(m&&(h.curOp.updateMaxLine=!0),l.collapsed)xt(h,t.line,r.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var x=t.line;x<=r.line;x++)mn(h,x,"text");l.atomic&&bu(h.doc),et(h,"markerAdded",h,l)}return l}var ni=function(e,t){this.markers=e,this.primary=t;for(var r=0;r=0;h--)ur(this,n[h]);d?yu(this,d):this.cm&&or(this.cm)}),undo:nt(function(){eo(this,"undo")}),redo:nt(function(){eo(this,"redo")}),undoSelection:nt(function(){eo(this,"undo",!0)}),redoSelection:nt(function(){eo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=pe(this,e),t=pe(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(l){var f=l.markedSpans;if(f)for(var d=0;d=h.to||h.from==null&&i!=e.line||h.from!=null&&i==t.line&&h.from>=t.ch)&&(!r||r(h.marker))&&n.push(h.marker.parent||h.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=l,++r}),pe(this,G(r,t))},indexFromPos:function(e){e=pe(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var x=e.dataTransfer.getData("Text");if(x){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),Ji(t.doc,yn(r,r)),k)for(var T=0;T=0;d--)fr(e.doc,"",n[d].from,n[d].to,"+delete");or(e)})}function ol(e,t,r){var n=Fr(e.text,t+r,r);return n<0||n>e.text.length?null:n}function al(e,t,r){var n=ol(e,t.ch,r);return n==null?null:new G(t.line,n,r<0?"after":"before")}function ll(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var l=vt(r,t.doc.direction);if(l){var f=i<0?ye(l):l[0],d=i<0==(f.level==1),h=d?"after":"before",m;if(f.level>0||t.doc.direction=="rtl"){var x=tr(t,r);m=i<0?r.text.length-1:0;var k=Zt(t,x,m).top;m=Pe(function(T){return Zt(t,x,T).top==k},i<0==(f.level==1)?f.from:f.to-1,m),h=="before"&&(m=ol(r,m,1))}else m=i<0?f.to:f.from;return new G(n,m,h)}}return new G(n,i<0?r.text.length:0,i<0?"before":"after")}function $d(e,t,r,n){var i=vt(t,e.doc.direction);if(!i)return al(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var l=Se(i,r.ch,r.sticky),f=i[l];if(e.doc.direction=="ltr"&&f.level%2==0&&(n>0?f.to>r.ch:f.from=f.from&&T>=x.begin)){var D=k?"before":"after";return new G(r.line,T,D)}}var F=function(X,Z,K){for(var ee=function(Ae,rt){return rt?new G(r.line,d(Ae,1),"before"):new G(r.line,Ae,"after")};X>=0&&X0==(se.level!=1),me=le?K.begin:d(K.end,-1);if(se.from<=me&&me0?x.end:d(x.begin,-1);return U!=null&&!(n>0&&U==t.text.length)&&(W=F(n>0?0:i.length-1,n,m(U)),W)?W:null}var oi={selectAll:ku,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),at)},killLine:function(e){return hr(e,function(t){if(t.empty()){var r=ae(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new G(i.line,i.ch+1),e.replaceRange(l.charAt(i.ch-1)+l.charAt(i.ch-2),G(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var f=ae(e.doc,i.line-1).text;f&&(i=new G(i.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+f.charAt(f.length-1),G(i.line-1,f.length-1),i,"+transpose"))}}r.push(new Ee(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return Tt(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne&&he(t,this.pos)==0&&r==this.button};var li,si;function nh(e,t){var r=+new Date;return si&&si.compare(r,e,t)?(li=si=null,"triple"):li&&li.compare(r,e,t)?(si=new ul(r,e,t),li=null,"double"):(li=new ul(r,e,t),si=null,"single")}function Xu(e){var t=this,r=t.display;if(!(Be(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,an(r,e)){b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(!fl(t,e)){var n=Pn(t,e),i=is(e),l=n?nh(n,i):"single";ge(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(n&&rh(t,i,n,l,e))&&(i==1?n?oh(t,n,l,e):da(e)==r.scroller&&yt(e):i==2?(n&&Zi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&($?t.display.input.onContextMenu(e):qa(t)))}}}function rh(e,t,r,n,i){var l="Click";return n=="double"?l="Double"+l:n=="triple"&&(l="Triple"+l),l=(t==1?"Left":t==2?"Middle":"Right")+l,ai(e,Wu(l,i),i,function(f){if(typeof f=="string"&&(f=oi[f]),!f)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=f(e,r)!=ze}finally{e.state.suppressEdits=!1}return d})}function ih(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var l=q?r.shiftKey&&r.metaKey:r.altKey;i.unit=l?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=O?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(O?r.altKey:r.ctrlKey)),i}function oh(e,t,r,n){g?setTimeout(Je(Ks,e),0):e.curOp.focus=be(ie(e));var i=ih(e,r,n),l=e.doc.sel,f;e.options.dragDrop&&hc&&!e.isReadOnly()&&r=="single"&&(f=l.contains(t))>-1&&(he((f=l.ranges[f]).from(),t)<0||t.xRel>0)&&(he(f.to(),t)>0||t.xRel<0)?ah(e,n,t,i):lh(e,n,t,i)}function ah(e,t,r,n){var i=e.display,l=!1,f=tt(e,function(m){b&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:qa(e)),ke(i.wrapper.ownerDocument,"mouseup",f),ke(i.wrapper.ownerDocument,"mousemove",d),ke(i.scroller,"dragstart",h),ke(i.scroller,"drop",f),l||(yt(m),n.addNew||Zi(e.doc,r,null,null,n.extend),b&&!I||g&&v==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),d=function(m){l=l||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},h=function(){return l=!0};b&&(i.scroller.draggable=!0),e.state.draggingText=f,f.copy=!n.moveOnDrag,ue(i.wrapper.ownerDocument,"mouseup",f),ue(i.wrapper.ownerDocument,"mousemove",d),ue(i.scroller,"dragstart",h),ue(i.scroller,"drop",f),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ku(e,t,r){if(r=="char")return new Ee(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Ee(G(t.line,0),pe(e.doc,G(t.line+1,0)));var n=r(e,t);return new Ee(n.from,n.to)}function lh(e,t,r,n){g&&qa(e);var i=e.display,l=e.doc;yt(t);var f,d,h=l.sel,m=h.ranges;if(n.addNew&&!n.extend?(d=l.sel.contains(r),d>-1?f=m[d]:f=new Ee(r,r)):(f=l.sel.primary(),d=l.sel.primIndex),n.unit=="rectangle")n.addNew||(f=new Ee(r,r)),r=Pn(e,t,!0,!0),d=-1;else{var x=Ku(e,r,n.unit);n.extend?f=rl(f,x.anchor,x.head,n.extend):f=x}n.addNew?d==-1?(d=m.length,ut(l,Yt(e,m.concat([f]),d),{scroll:!1,origin:"*mouse"})):m.length>1&&m[d].empty()&&n.unit=="char"&&!n.extend?(ut(l,Yt(e,m.slice(0,d).concat(m.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),h=l.sel):il(l,d,f,hn):(d=0,ut(l,new It([f],0),hn),h=l.sel);var k=r;function T(K){if(he(k,K)!=0)if(k=K,n.unit=="rectangle"){for(var ee=[],se=e.options.tabSize,le=Ue(ae(l,r.line).text,r.ch,se),me=Ue(ae(l,K.line).text,K.ch,se),Ae=Math.min(le,me),rt=Math.max(le,me),We=Math.min(r.line,K.line),Mt=Math.min(e.lastLine(),Math.max(r.line,K.line));We<=Mt;We++){var wt=ae(l,We).text,Xe=Ot(wt,Ae,se);Ae==rt?ee.push(new Ee(G(We,Xe),G(We,Xe))):wt.length>Xe&&ee.push(new Ee(G(We,Xe),G(We,Ot(wt,rt,se))))}ee.length||ee.push(new Ee(r,r)),ut(l,Yt(e,h.ranges.slice(0,d).concat(ee),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(K)}else{var St=f,lt=Ku(e,K,n.unit),$e=St.anchor,Ke;he(lt.anchor,$e)>0?(Ke=lt.head,$e=Ni(St.from(),lt.anchor)):(Ke=lt.anchor,$e=Ai(St.to(),lt.head));var _e=h.ranges.slice(0);_e[d]=sh(e,new Ee(pe(l,$e),Ke)),ut(l,Yt(e,_e,d),hn)}}var D=i.wrapper.getBoundingClientRect(),F=0;function W(K){var ee=++F,se=Pn(e,K,!0,n.unit=="rectangle");if(se)if(he(se,k)!=0){e.curOp.focus=be(ie(e)),T(se);var le=Yi(i,l);(se.line>=le.to||se.lineD.bottom?20:0;me&&setTimeout(tt(e,function(){F==ee&&(i.scroller.scrollTop+=me,W(K))}),50)}}function U(K){e.state.selectingText=!1,F=1/0,K&&(yt(K),i.input.focus()),ke(i.wrapper.ownerDocument,"mousemove",X),ke(i.wrapper.ownerDocument,"mouseup",Z),l.history.lastSelOrigin=null}var X=tt(e,function(K){K.buttons===0||!is(K)?U(K):W(K)}),Z=tt(e,U);e.state.selectingText=Z,ue(i.wrapper.ownerDocument,"mousemove",X),ue(i.wrapper.ownerDocument,"mouseup",Z)}function sh(e,t){var r=t.anchor,n=t.head,i=ae(e.doc,r.line);if(he(r,n)==0&&r.sticky==n.sticky)return t;var l=vt(i);if(!l)return t;var f=Se(l,r.ch,r.sticky),d=l[f];if(d.from!=r.ch&&d.to!=r.ch)return t;var h=f+(d.from==r.ch==(d.level!=1)?0:1);if(h==0||h==l.length)return t;var m;if(n.line!=r.line)m=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Se(l,n.ch,n.sticky),k=x-f||(n.ch-r.ch)*(d.level==1?-1:1);x==h-1||x==h?m=k<0:m=k>0}var T=l[h+(m?-1:0)],D=m==(T.level==1),F=D?T.from:T.to,W=D?"after":"before";return r.ch==F&&r.sticky==W?t:new Ee(new G(r.line,F,W),n)}function $u(e,t,r,n){var i,l;if(t.touches)i=t.touches[0].clientX,l=t.touches[0].clientY;else try{i=t.clientX,l=t.clientY}catch(T){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&yt(t);var f=e.display,d=f.lineDiv.getBoundingClientRect();if(l>d.bottom||!Wt(e,r))return ca(t);l-=d.top-f.viewOffset;for(var h=0;h=i){var x=In(e.doc,l),k=e.display.gutterSpecs[h];return Me(e,r,e,x,k.className,t),ca(t)}}}function fl(e,t){return $u(e,t,"gutterClick",!0)}function Qu(e,t){an(e.display,t)||uh(e,t)||Be(e,t,"contextmenu")||$||e.display.input.onContextMenu(t)}function uh(e,t){return Wt(e,"gutterContextMenu")?$u(e,t,"gutterContextMenu",!1):!1}function Zu(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gr(e)}var pr={toString:function(){return"CodeMirror.Init"}},Ju={},io={};function fh(e){var t=e.optionHandlers;function r(n,i,l,f){e.defaults[n]=i,l&&(t[n]=f?function(d,h,m){m!=pr&&l(d,h,m)}:l)}e.defineOption=r,e.Init=pr,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,el(n)},!0),r("indentUnit",2,el,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Qr(n),Gr(n),xt(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!!i){var l=[],f=n.doc.first;n.doc.iter(function(h){for(var m=0;;){var x=h.text.indexOf(i,m);if(x==-1)break;m=x+i.length,l.push(G(f,x))}f++});for(var d=l.length-1;d>=0;d--)fr(n.doc,i,l[d],G(l[d].line,l[d].ch+i.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(n,i,l){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),l!=pr&&n.refresh()}),r("specialCharPlaceholder",Rc,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",J?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!re),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Zu(n),$r(n)},!0),r("keyMap","default",function(n,i,l){var f=no(i),d=l!=pr&&no(l);d&&d.detach&&d.detach(n,f),f.attach&&f.attach(n,d||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,dh,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=Ja(i,n.options.lineNumbers),$r(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?za(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return ar(n)},!0),r("scrollbarStyle","native",function(n){eu(n),ar(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=Ja(n.options.gutters,i),$r(n)},!0),r("firstLineNumber",1,$r,!0),r("lineNumberFormatter",function(n){return n},$r,!0),r("showCursorWhenSelecting",!1,Ur,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(ir(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,ch),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Ur,!0),r("singleCursorHeightPerLine",!0,Ur,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Qr,!0),r("addModeClass",!1,Qr,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Qr,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function ch(e,t,r){var n=r&&r!=pr;if(!t!=!n){var i=e.display.dragFunctions,l=t?ue:ke;l(e.display.scroller,"dragstart",i.start),l(e.display.scroller,"dragenter",i.enter),l(e.display.scroller,"dragover",i.over),l(e.display.scroller,"dragleave",i.leave),l(e.display.scroller,"drop",i.drop)}}function dh(e){e.options.lineWrapping?(Ie(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(oe(e.display.wrapper,"CodeMirror-wrap"),Aa(e)),_a(e),xt(e),Gr(e),setTimeout(function(){return ar(e)},100)}function He(e,t){var r=this;if(!(this instanceof He))return new He(e,t);this.options=t=t?st(t):{},st(Ju,t,!1);var n=t.value;typeof n=="string"?n=new bt(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new He.inputStyles[t.inputStyle](this),l=this.display=new Ed(e,n,i,t);l.wrapper.CodeMirror=this,Zu(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),eu(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 Ve,keySeq:null,specialChars:null},t.autofocus&&!J&&l.input.focus(),g&&v<11&&setTimeout(function(){return r.display.input.reset(!0)},20),hh(this),qd(),zn(this),this.curOp.forceUpdate=!0,fu(this,n),t.autofocus&&!J||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ya(r)},20):ir(this);for(var f in io)io.hasOwnProperty(f)&&io[f](this,t[f],pr);ru(this),t.finishInit&&t.finishInit(this);for(var d=0;d20*20}ue(t.scroller,"touchstart",function(h){if(!Be(e,h)&&!l(h)&&!fl(e,h)){t.input.ensurePolled(),clearTimeout(r);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-n.end<=300?n:null},h.touches.length==1&&(t.activeTouch.left=h.touches[0].pageX,t.activeTouch.top=h.touches[0].pageY)}}),ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ue(t.scroller,"touchend",function(h){var m=t.activeTouch;if(m&&!an(t,h)&&m.left!=null&&!m.moved&&new Date-m.start<300){var x=e.coordsChar(t.activeTouch,"page"),k;!m.prev||f(m,m.prev)?k=new Ee(x,x):!m.prev.prev||f(m,m.prev.prev)?k=e.findWordAt(x):k=new Ee(G(x.line,0),pe(e.doc,G(x.line+1,0))),e.setSelection(k.anchor,k.head),e.focus(),yt(h)}i()}),ue(t.scroller,"touchcancel",i),ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Yr(e,t.scroller.scrollTop),Wn(e,t.scroller.scrollLeft,!0),Me(e,"scroll",e))}),ue(t.scroller,"mousewheel",function(h){return au(e,h)}),ue(t.scroller,"DOMMouseScroll",function(h){return au(e,h)}),ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(h){Be(e,h)||Hr(h)},over:function(h){Be(e,h)||(Ud(e,h),Hr(h))},start:function(h){return Gd(e,h)},drop:tt(e,_d),leave:function(h){Be(e,h)||Fu(e)}};var d=t.input.getField();ue(d,"keyup",function(h){return Yu.call(e,h)}),ue(d,"keydown",tt(e,qu)),ue(d,"keypress",tt(e,ju)),ue(d,"focus",function(h){return Ya(e,h)}),ue(d,"blur",function(h){return ir(e,h)})}var cl=[];He.defineInitHook=function(e){return cl.push(e)};function ui(e,t,r,n){var i=e.doc,l;r==null&&(r="add"),r=="smart"&&(i.mode.indent?l=Br(e,t).state:r="prev");var f=e.options.tabSize,d=ae(i,t),h=Ue(d.text,null,f);d.stateAfter&&(d.stateAfter=null);var m=d.text.match(/^\s*/)[0],x;if(!n&&!/\S/.test(d.text))x=0,r="not";else if(r=="smart"&&(x=i.mode.indent(l,d.text.slice(m.length),d.text),x==ze||x>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?x=Ue(ae(i,t-1).text,null,f):x=0:r=="add"?x=h+e.options.indentUnit:r=="subtract"?x=h-e.options.indentUnit:typeof r=="number"&&(x=h+r),x=Math.max(0,x);var k="",T=0;if(e.options.indentWithTabs)for(var D=Math.floor(x/f);D;--D)T+=f,k+=" ";if(Tf,h=ga(t),m=null;if(d&&n.ranges.length>1)if(jt&&jt.text.join(` + left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(f),f.scrollIntoView(i),e.display.lineSpace.removeChild(f)}}}function fd(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(r=t.sticky=="before"?G(t.line,t.ch+1,"before"):t,t=t.ch?G(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var l=0;l<5;l++){var f=!1,d=qt(e,t),h=!r||r==t?d:qt(e,r);i={left:Math.min(d.left,h.left),top:Math.min(d.top,h.top)-n,right:Math.max(d.left,h.left),bottom:Math.max(d.bottom,h.bottom)+n};var m=ja(e,i),x=e.doc.scrollTop,k=e.doc.scrollLeft;if(m.scrollTop!=null&&(Yr(e,m.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(f=!0)),m.scrollLeft!=null&&(Wn(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(f=!0)),!f)break}return i}function cd(e,t){var r=ja(e,t);r.scrollTop!=null&&Yr(e,r.scrollTop),r.scrollLeft!=null&&Wn(e,r.scrollLeft)}function ja(e,t){var r=e.display,n=nr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,l=Ia(e),f={};t.bottom-t.top>l&&(t.bottom=t.top+l);var d=e.doc.height+Oa(r),h=t.topd-n;if(t.topi+l){var x=Math.min(t.top,(m?d:t.bottom)-l);x!=i&&(f.scrollTop=x)}var k=e.options.fixedGutter?0:r.gutters.offsetWidth,T=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-k,D=Fn(e)-r.gutters.offsetWidth,F=t.right-t.left>D;return F&&(t.right=t.left+D),t.left<10?f.scrollLeft=0:t.leftD+T-3&&(f.scrollLeft=t.right+(F?0:10)-D),f}function Xa(e,t){t!=null&&(ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function or(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function qr(e,t,r){(t!=null||r!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function dd(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=Gs(e,t.from),n=Gs(e,t.to);Qs(e,r,n,t.margin)}}function Qs(e,t,r,n){var i=ja(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});qr(e,i.scrollLeft,i.scrollTop)}function Yr(e,t){Math.abs(e.doc.scrollTop-t)<2||(a||$a(e,{top:t}),Zs(e,t,!0),a&&$a(e),Kr(e,100))}function Zs(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Wn(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)&&(e.doc.scrollLeft=t,nu(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Oa(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Qt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Rn=function(e,t,r){this.cm=r;var n=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),ue(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),ue(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,g&&v<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Rn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var l=e.viewWidth-e.barLeft-(r?n: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&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},Rn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Rn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Rn.prototype.zeroWidthHack=function(){var e=O&&!E?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Ve,this.disableVert=new Ve},Rn.prototype.enableZeroWidthBar=function(e,t,r){e.style.visibility="";function n(){var i=e.getBoundingClientRect(),l=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);l!=e?e.style.visibility="hidden":t.set(1e3,n)}t.set(1e3,n)},Rn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Xr=function(){};Xr.prototype.update=function(){return{bottom:0,right:0}},Xr.prototype.setScrollLeft=function(){},Xr.prototype.setScrollTop=function(){},Xr.prototype.clear=function(){};function ar(e,t){t||(t=jr(e));var r=e.display.barWidth,n=e.display.barHeight;Js(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&qi(e),Js(e,jr(e)),r=e.display.barWidth,n=e.display.barHeight}function Js(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var Vs={native:Rn,null:Xr};function eu(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&oe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Vs[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),ue(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Wn(e,t):Yr(e,t)},e),e.display.scrollbars.addClass&&Ie(e.display.wrapper,e.display.scrollbars.addClass)}var hd=0;function zn(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:++hd,markArrays:null},qc(e.curOp)}function _n(e){var t=e.curOp;t&&jc(t,function(r){for(var n=0;n=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Xi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function md(e){e.updatedDisplay=e.mustUpdate&&Ka(e.cm,e.update)}function vd(e){var t=e.cm,r=t.display;e.updatedDisplay&&qi(t),e.barMeasure=jr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Fs(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Qt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Fn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function yd(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Br(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(l){if(n.line>=e.display.viewFrom){var f=l.styles,d=l.text.length>e.options.maxHighlightLength?Nn(t.mode,n.state):null,h=ss(e,l,n,!0);d&&(n.state=d),l.styles=h.styles;var m=l.styleClasses,x=h.classes;x?l.styleClasses=x:m&&(l.styleClasses=null);for(var k=!f||f.length!=l.styles.length||m!=x&&(!m||!x||m.bgClass!=x.bgClass||m.textClass!=x.textClass),T=0;!k&&Tr)return Kr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Tt(e,function(){for(var l=0;l=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&js(e)==0)return!1;ru(e)&&(vn(e),t.dims=Ra(e));var i=n.first+n.size,l=Math.max(t.visible.from-e.options.viewportMargin,n.first),f=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFromf&&r.viewTo-f<20&&(f=Math.min(i,r.viewTo)),rn&&(l=Ta(e.doc,l),f=Ss(e.doc,f));var d=l!=r.viewFrom||f!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;ld(e,l,f),r.viewOffset=on(ae(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var h=js(e);if(!d&&h==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var m=Sd(e);return h>4&&(r.lineDiv.style.display="none"),Cd(e,r.updateLineNumbers,t.dims),h>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,kd(m),ce(r.cursorDiv),ce(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,d&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Kr(e,400)),r.updateLineNumbers=null,!0}function tu(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Fn(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+Oa(e.display)-Ia(e),r.top)}),t.visible=Yi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Yi(e.display,e.doc,r));if(!Ka(e,t))break;qi(e);var i=jr(e);Ur(e),ar(e,i),Za(e,i),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 $a(e,t){var r=new Xi(e,t);if(Ka(e,r)){qi(e),tu(e,r);var n=jr(e);Ur(e),ar(e,n),Za(e,n),r.finish()}}function Cd(e,t,r){var n=e.display,i=e.options.lineNumbers,l=n.lineDiv,f=l.firstChild;function d(F){var W=F.nextSibling;return b&&O&&e.display.currentWheelTarget==F?F.style.display="none":F.parentNode.removeChild(F),W}for(var h=n.view,m=n.viewFrom,x=0;x-1&&(D=!1),Ds(e,k,m,r)),D&&(ce(k.lineNumber),k.lineNumber.appendChild(document.createTextNode(wa(e.options,m)))),f=k.node.nextSibling}m+=k.size}for(;f;)f=d(f)}function Qa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",et(e,"gutterChanged",e)}function Za(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+Qt(e)+"px"}function nu(e){var t=e.display,r=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var n=za(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,l=n+"px",f=0;f=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),g&&v<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!b&&!(a&&Z)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Ja(n.gutters,n.lineNumbers),iu(i),r.init(i)}var Ki=0,ln=null;g?ln=-.53:a?ln=15:L?ln=-.7:I&&(ln=-1/3);function ou(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function Ld(e){var t=ou(e);return t.x*=ln,t.y*=ln,t}function au(e,t){L&&N==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 r=ou(t),n=r.x,i=r.y,l=ln;t.deltaMode===0&&(n=t.deltaX,i=t.deltaY,l=1);var f=e.display,d=f.scroller,h=d.scrollWidth>d.clientWidth,m=d.scrollHeight>d.clientHeight;if(n&&h||i&&m){if(i&&O&&b){e:for(var x=t.target,k=f.view;x!=d;x=x.parentNode)for(var T=0;T=0&&he(e,n.to())<=0)return r}return-1};var Ee=function(e,t){this.anchor=e,this.head=t};Ee.prototype.from=function(){return Ni(this.anchor,this.head)},Ee.prototype.to=function(){return Ai(this.anchor,this.head)},Ee.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Yt(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(T,D){return he(T.from(),D.from())}),r=Oe(t,i);for(var l=1;l0:h>=0){var m=Ni(d.from(),f.from()),x=Ai(d.to(),f.to()),k=d.empty()?f.from()==f.head:d.from()==d.head;l<=r&&--r,t.splice(--l,2,new Ee(k?x:m,k?m:x))}}return new It(t,r)}function yn(e,t){return new It([new Ee(e,t||e)],0)}function xn(e){return e.text?G(e.from.line+e.text.length-1,ye(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function lu(e,t){if(he(e,t.from)<0)return e;if(he(e,t.to)<=0)return xn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=xn(t).ch-t.to.ch),G(r,n)}function Va(e,t){for(var r=[],n=0;n1&&e.remove(d.line+1,F-1),e.insert(d.line+1,X)}et(e,"change",e,t)}function bn(e,t,r){function n(i,l,f){if(i.linked)for(var d=0;d1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ye(e.done)}function hu(e,t,r,n){var i=e.history;i.undone.length=0;var l=+new Date,f,d;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(f=Md(i,i.lastOp==n)))d=ye(f.changes),he(t.from,t.to)==0&&he(t.from,d.to)==0?d.to=xn(t):f.changes.push(nl(e,t));else{var h=ye(i.done);for((!h||!h.ranges)&&Qi(e.sel,i.done),f={changes:[nl(e,t)],generation:i.generation},i.done.push(f);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=l,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,d||Me(e,"historyAdded")}function Ad(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Nd(e,t,r,n){var i=e.history,l=n&&n.origin;r==i.lastSelOp||l&&i.lastSelOrigin==l&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==l||Ad(e,l,ye(i.done),t))?i.done[i.done.length-1]=t:Qi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=l,i.lastSelOp=r,n&&n.clearRedo!==!1&&du(i.undone)}function Qi(e,t){var r=ye(t);r&&r.ranges&&r.equals(e)||t.push(e)}function pu(e,t,r,n){var i=t["spans_"+e.id],l=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(f){f.markedSpans&&((i||(i=t["spans_"+e.id]={}))[l]=f.markedSpans),++l})}function Od(e){if(!e)return null;for(var t,r=0;r-1&&(ye(d)[k]=m[k],delete m[k])}}return n}function rl(e,t,r,n){if(n){var i=e.anchor;if(r){var l=he(t,i)<0;l!=he(r,i)<0?(i=t,t=r):l!=he(t,r)<0&&(t=r)}return new Ee(i,t)}else return new Ee(r||t,t)}function Zi(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),ut(e,new It([rl(e.sel.primary(),t,r,i)],0),n)}function mu(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),l=0;l=t.ch:d.to>t.ch))){if(i&&(Me(h,"beforeCursorEnter"),h.explicitlyCleared))if(l.markedSpans){--f;continue}else break;if(!h.atomic)continue;if(r){var k=h.find(n<0?1:-1),T=void 0;if((n<0?x:m)&&(k=Su(e,k,-n,k&&k.line==t.line?l:null)),k&&k.line==t.line&&(T=he(k,r))&&(n<0?T<0:T>0))return sr(e,k,t,n,i)}var D=h.find(n<0?-1:1);return(n<0?m:x)&&(D=Su(e,D,n,D.line==t.line?l:null)),D?sr(e,D,t,n,i):null}}return t}function Vi(e,t,r,n,i){var l=n||1,f=sr(e,t,r,l,i)||!i&&sr(e,t,r,l,!0)||sr(e,t,r,-l,i)||!i&&sr(e,t,r,-l,!0);return f||(e.cantEdit=!0,G(e.first,0))}function Su(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?pe(e,G(t.line-1)):null:r>0&&t.ch==(n||ae(e,t.line)).text.length?t.line=0;--i)Eu(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Eu(e,t)}}function Eu(e,t){if(!(t.text.length==1&&t.text[0]==""&&he(t.from,t.to)==0)){var r=Va(e,t);hu(e,t,r,e.cm?e.cm.curOp.id:NaN),Zr(e,t,r,La(e,t));var n=[];bn(e,function(i,l){!l&&Oe(n,i.history)==-1&&(Mu(i.history,t),n.push(i.history)),Zr(i,t,null,La(i,t))})}}function eo(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!(n&&!r)){for(var i=e.history,l,f=e.sel,d=t=="undo"?i.done:i.undone,h=t=="undo"?i.undone:i.done,m=0;m=0;--D){var F=T(D);if(F)return F.v}}}}function Lu(e,t){if(t!=0&&(e.first+=t,e.sel=new It(Dt(e.sel.ranges,function(i){return new Ee(G(i.anchor.line+t,i.anchor.ch),G(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){xt(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.linel&&(t={from:t.from,to:G(l,ae(e,l).text.length),text:[t.text[0]],origin:t.origin}),t.removed=On(e,t.from,t.to),r||(r=Va(e,t)),e.cm?Hd(e.cm,t,n):tl(e,t,n),Ji(e,r,at),e.cantEdit&&Vi(e,G(e.firstLine(),0))&&(e.cantEdit=!1)}}function Hd(e,t,r){var n=e.doc,i=e.display,l=t.from,f=t.to,d=!1,h=l.line;e.options.lineWrapping||(h=De(Ut(ae(n,l.line))),n.iter(h,f.line+1,function(D){if(D==i.maxLine)return d=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ns(e),tl(n,t,r,Ys(e)),e.options.lineWrapping||(n.iter(h,l.line+t.text.length,function(D){var F=Bi(D);F>i.maxLineLength&&(i.maxLine=D,i.maxLineLength=F,i.maxLineChanged=!0,d=!1)}),d&&(e.curOp.updateMaxLine=!0)),Cc(n,l.line),Kr(e,400);var m=t.text.length-(f.line-l.line)-1;t.full?xt(e):l.line==f.line&&t.text.length==1&&!uu(e.doc,t)?mn(e,l.line,"text"):xt(e,l.line,f.line+1,m);var x=Wt(e,"changes"),k=Wt(e,"change");if(k||x){var T={from:l,to:f,text:t.text,removed:t.removed,origin:t.origin};k&&et(e,"change",e,T),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(T)}e.display.selForContextMenu=null}function fr(e,t,r,n,i){var l;n||(n=r),he(n,r)<0&&(l=[n,r],r=l[0],n=l[1]),typeof t=="string"&&(t=e.splitLines(t)),ur(e,{from:r,to:n,text:t,origin:i})}function Du(e,t,r,n){r1||!(this.children[0]instanceof Vr))){var d=[];this.collapse(d),this.children=[new Vr(d)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var f=i.lines.length%25+25,d=f;d10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&xt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&bu(e.doc)),e&&et(e,"markerCleared",e,this,n,i),t&&_n(e),this.parent&&this.parent.clear()}},wn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i0||f==0&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=R("span",[l.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ws(e,t.line,t,r,l)||t.line!=r.line&&ws(e,r.line,t,r,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");Lc()}l.addToHistory&&hu(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var d=t.line,h=e.cm,m;if(e.iter(d,r.line+1,function(k){h&&l.collapsed&&!h.options.lineWrapping&&Ut(k)==h.display.maxLine&&(m=!0),l.collapsed&&d!=t.line&&Kt(k,0),Tc(k,new Ii(l,d==t.line?t.ch:null,d==r.line?r.ch:null),e.cm&&e.cm.curOp),++d}),l.collapsed&&e.iter(t.line,r.line+1,function(k){gn(e,k)&&Kt(k,0)}),l.clearOnEnter&&ue(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(Ec(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++Nu,l.atomic=!0),h){if(m&&(h.curOp.updateMaxLine=!0),l.collapsed)xt(h,t.line,r.line+1);else if(l.className||l.startStyle||l.endStyle||l.css||l.attributes||l.title)for(var x=t.line;x<=r.line;x++)mn(h,x,"text");l.atomic&&bu(h.doc),et(h,"markerAdded",h,l)}return l}var ni=function(e,t){this.markers=e,this.primary=t;for(var r=0;r=0;h--)ur(this,n[h]);d?yu(this,d):this.cm&&or(this.cm)}),undo:nt(function(){eo(this,"undo")}),redo:nt(function(){eo(this,"redo")}),undoSelection:nt(function(){eo(this,"undo",!0)}),redoSelection:nt(function(){eo(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=pe(this,e),t=pe(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(l){var f=l.markedSpans;if(f)for(var d=0;d=h.to||h.from==null&&i!=e.line||h.from!=null&&i==t.line&&h.from>=t.ch)&&(!r||r(h.marker))&&n.push(h.marker.parent||h.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=l,++r}),pe(this,G(r,t))},indexFromPos:function(e){e=pe(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var x=e.dataTransfer.getData("Text");if(x){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),Ji(t.doc,yn(r,r)),k)for(var T=0;T=0;d--)fr(e.doc,"",n[d].from,n[d].to,"+delete");or(e)})}function ol(e,t,r){var n=Fr(e.text,t+r,r);return n<0||n>e.text.length?null:n}function al(e,t,r){var n=ol(e,t.ch,r);return n==null?null:new G(t.line,n,r<0?"after":"before")}function ll(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var l=vt(r,t.doc.direction);if(l){var f=i<0?ye(l):l[0],d=i<0==(f.level==1),h=d?"after":"before",m;if(f.level>0||t.doc.direction=="rtl"){var x=tr(t,r);m=i<0?r.text.length-1:0;var k=Zt(t,x,m).top;m=Pe(function(T){return Zt(t,x,T).top==k},i<0==(f.level==1)?f.from:f.to-1,m),h=="before"&&(m=ol(r,m,1))}else m=i<0?f.to:f.from;return new G(n,m,h)}}return new G(n,i<0?r.text.length:0,i<0?"before":"after")}function $d(e,t,r,n){var i=vt(t,e.doc.direction);if(!i)return al(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var l=Se(i,r.ch,r.sticky),f=i[l];if(e.doc.direction=="ltr"&&f.level%2==0&&(n>0?f.to>r.ch:f.from=f.from&&T>=x.begin)){var D=k?"before":"after";return new G(r.line,T,D)}}var F=function(X,Q,K){for(var ee=function(Ae,rt){return rt?new G(r.line,d(Ae,1),"before"):new G(r.line,Ae,"after")};X>=0&&X0==(se.level!=1),me=le?K.begin:d(K.end,-1);if(se.from<=me&&me0?x.end:d(x.begin,-1);return U!=null&&!(n>0&&U==t.text.length)&&(W=F(n>0?0:i.length-1,n,m(U)),W)?W:null}var oi={selectAll:ku,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),at)},killLine:function(e){return hr(e,function(t){if(t.empty()){var r=ae(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)i=new G(i.line,i.ch+1),e.replaceRange(l.charAt(i.ch-1)+l.charAt(i.ch-2),G(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var f=ae(e.doc,i.line-1).text;f&&(i=new G(i.line,1),e.replaceRange(l.charAt(0)+e.doc.lineSeparator()+f.charAt(f.length-1),G(i.line-1,f.length-1),i,"+transpose"))}}r.push(new Ee(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return Tt(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne&&he(t,this.pos)==0&&r==this.button};var li,si;function nh(e,t){var r=+new Date;return si&&si.compare(r,e,t)?(li=si=null,"triple"):li&&li.compare(r,e,t)?(si=new ul(r,e,t),li=null,"double"):(li=new ul(r,e,t),si=null,"single")}function Xu(e){var t=this,r=t.display;if(!(Be(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,an(r,e)){b||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(!fl(t,e)){var n=Pn(t,e),i=is(e),l=n?nh(n,i):"single";ge(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(n&&rh(t,i,n,l,e))&&(i==1?n?oh(t,n,l,e):da(e)==r.scroller&&yt(e):i==2?(n&&Zi(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(V?t.display.input.onContextMenu(e):qa(t)))}}}function rh(e,t,r,n,i){var l="Click";return n=="double"?l="Double"+l:n=="triple"&&(l="Triple"+l),l=(t==1?"Left":t==2?"Middle":"Right")+l,ai(e,Wu(l,i),i,function(f){if(typeof f=="string"&&(f=oi[f]),!f)return!1;var d=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d=f(e,r)!=ze}finally{e.state.suppressEdits=!1}return d})}function ih(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var l=q?r.shiftKey&&r.metaKey:r.altKey;i.unit=l?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=O?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(O?r.altKey:r.ctrlKey)),i}function oh(e,t,r,n){g?setTimeout(Je(Ks,e),0):e.curOp.focus=be(ie(e));var i=ih(e,r,n),l=e.doc.sel,f;e.options.dragDrop&&hc&&!e.isReadOnly()&&r=="single"&&(f=l.contains(t))>-1&&(he((f=l.ranges[f]).from(),t)<0||t.xRel>0)&&(he(f.to(),t)>0||t.xRel<0)?ah(e,n,t,i):lh(e,n,t,i)}function ah(e,t,r,n){var i=e.display,l=!1,f=tt(e,function(m){b&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:qa(e)),ke(i.wrapper.ownerDocument,"mouseup",f),ke(i.wrapper.ownerDocument,"mousemove",d),ke(i.scroller,"dragstart",h),ke(i.scroller,"drop",f),l||(yt(m),n.addNew||Zi(e.doc,r,null,null,n.extend),b&&!I||g&&v==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),d=function(m){l=l||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},h=function(){return l=!0};b&&(i.scroller.draggable=!0),e.state.draggingText=f,f.copy=!n.moveOnDrag,ue(i.wrapper.ownerDocument,"mouseup",f),ue(i.wrapper.ownerDocument,"mousemove",d),ue(i.scroller,"dragstart",h),ue(i.scroller,"drop",f),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Ku(e,t,r){if(r=="char")return new Ee(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Ee(G(t.line,0),pe(e.doc,G(t.line+1,0)));var n=r(e,t);return new Ee(n.from,n.to)}function lh(e,t,r,n){g&&qa(e);var i=e.display,l=e.doc;yt(t);var f,d,h=l.sel,m=h.ranges;if(n.addNew&&!n.extend?(d=l.sel.contains(r),d>-1?f=m[d]:f=new Ee(r,r)):(f=l.sel.primary(),d=l.sel.primIndex),n.unit=="rectangle")n.addNew||(f=new Ee(r,r)),r=Pn(e,t,!0,!0),d=-1;else{var x=Ku(e,r,n.unit);n.extend?f=rl(f,x.anchor,x.head,n.extend):f=x}n.addNew?d==-1?(d=m.length,ut(l,Yt(e,m.concat([f]),d),{scroll:!1,origin:"*mouse"})):m.length>1&&m[d].empty()&&n.unit=="char"&&!n.extend?(ut(l,Yt(e,m.slice(0,d).concat(m.slice(d+1)),0),{scroll:!1,origin:"*mouse"}),h=l.sel):il(l,d,f,hn):(d=0,ut(l,new It([f],0),hn),h=l.sel);var k=r;function T(K){if(he(k,K)!=0)if(k=K,n.unit=="rectangle"){for(var ee=[],se=e.options.tabSize,le=Ue(ae(l,r.line).text,r.ch,se),me=Ue(ae(l,K.line).text,K.ch,se),Ae=Math.min(le,me),rt=Math.max(le,me),We=Math.min(r.line,K.line),Mt=Math.min(e.lastLine(),Math.max(r.line,K.line));We<=Mt;We++){var wt=ae(l,We).text,Xe=Ot(wt,Ae,se);Ae==rt?ee.push(new Ee(G(We,Xe),G(We,Xe))):wt.length>Xe&&ee.push(new Ee(G(We,Xe),G(We,Ot(wt,rt,se))))}ee.length||ee.push(new Ee(r,r)),ut(l,Yt(e,h.ranges.slice(0,d).concat(ee),d),{origin:"*mouse",scroll:!1}),e.scrollIntoView(K)}else{var St=f,lt=Ku(e,K,n.unit),$e=St.anchor,Ke;he(lt.anchor,$e)>0?(Ke=lt.head,$e=Ni(St.from(),lt.anchor)):(Ke=lt.anchor,$e=Ai(St.to(),lt.head));var _e=h.ranges.slice(0);_e[d]=sh(e,new Ee(pe(l,$e),Ke)),ut(l,Yt(e,_e,d),hn)}}var D=i.wrapper.getBoundingClientRect(),F=0;function W(K){var ee=++F,se=Pn(e,K,!0,n.unit=="rectangle");if(se)if(he(se,k)!=0){e.curOp.focus=be(ie(e)),T(se);var le=Yi(i,l);(se.line>=le.to||se.lineD.bottom?20:0;me&&setTimeout(tt(e,function(){F==ee&&(i.scroller.scrollTop+=me,W(K))}),50)}}function U(K){e.state.selectingText=!1,F=1/0,K&&(yt(K),i.input.focus()),ke(i.wrapper.ownerDocument,"mousemove",X),ke(i.wrapper.ownerDocument,"mouseup",Q),l.history.lastSelOrigin=null}var X=tt(e,function(K){K.buttons===0||!is(K)?U(K):W(K)}),Q=tt(e,U);e.state.selectingText=Q,ue(i.wrapper.ownerDocument,"mousemove",X),ue(i.wrapper.ownerDocument,"mouseup",Q)}function sh(e,t){var r=t.anchor,n=t.head,i=ae(e.doc,r.line);if(he(r,n)==0&&r.sticky==n.sticky)return t;var l=vt(i);if(!l)return t;var f=Se(l,r.ch,r.sticky),d=l[f];if(d.from!=r.ch&&d.to!=r.ch)return t;var h=f+(d.from==r.ch==(d.level!=1)?0:1);if(h==0||h==l.length)return t;var m;if(n.line!=r.line)m=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Se(l,n.ch,n.sticky),k=x-f||(n.ch-r.ch)*(d.level==1?-1:1);x==h-1||x==h?m=k<0:m=k>0}var T=l[h+(m?-1:0)],D=m==(T.level==1),F=D?T.from:T.to,W=D?"after":"before";return r.ch==F&&r.sticky==W?t:new Ee(new G(r.line,F,W),n)}function $u(e,t,r,n){var i,l;if(t.touches)i=t.touches[0].clientX,l=t.touches[0].clientY;else try{i=t.clientX,l=t.clientY}catch(T){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&yt(t);var f=e.display,d=f.lineDiv.getBoundingClientRect();if(l>d.bottom||!Wt(e,r))return ca(t);l-=d.top-f.viewOffset;for(var h=0;h=i){var x=In(e.doc,l),k=e.display.gutterSpecs[h];return Me(e,r,e,x,k.className,t),ca(t)}}}function fl(e,t){return $u(e,t,"gutterClick",!0)}function Qu(e,t){an(e.display,t)||uh(e,t)||Be(e,t,"contextmenu")||V||e.display.input.onContextMenu(t)}function uh(e,t){return Wt(e,"gutterContextMenu")?$u(e,t,"gutterContextMenu",!1):!1}function Zu(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gr(e)}var pr={toString:function(){return"CodeMirror.Init"}},Ju={},io={};function fh(e){var t=e.optionHandlers;function r(n,i,l,f){e.defaults[n]=i,l&&(t[n]=f?function(d,h,m){m!=pr&&l(d,h,m)}:l)}e.defineOption=r,e.Init=pr,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,el(n)},!0),r("indentUnit",2,el,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Qr(n),Gr(n),xt(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!!i){var l=[],f=n.doc.first;n.doc.iter(function(h){for(var m=0;;){var x=h.text.indexOf(i,m);if(x==-1)break;m=x+i.length,l.push(G(f,x))}f++});for(var d=l.length-1;d>=0;d--)fr(n.doc,i,l[d],G(l[d].line,l[d].ch+i.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(n,i,l){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),l!=pr&&n.refresh()}),r("specialCharPlaceholder",Rc,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",Z?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!re),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Zu(n),$r(n)},!0),r("keyMap","default",function(n,i,l){var f=no(i),d=l!=pr&&no(l);d&&d.detach&&d.detach(n,f),f.attach&&f.attach(n,d||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,dh,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=Ja(i,n.options.lineNumbers),$r(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?za(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return ar(n)},!0),r("scrollbarStyle","native",function(n){eu(n),ar(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=Ja(n.options.gutters,i),$r(n)},!0),r("firstLineNumber",1,$r,!0),r("lineNumberFormatter",function(n){return n},$r,!0),r("showCursorWhenSelecting",!1,Ur,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(ir(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,ch),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Ur,!0),r("singleCursorHeightPerLine",!0,Ur,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Qr,!0),r("addModeClass",!1,Qr,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Qr,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function ch(e,t,r){var n=r&&r!=pr;if(!t!=!n){var i=e.display.dragFunctions,l=t?ue:ke;l(e.display.scroller,"dragstart",i.start),l(e.display.scroller,"dragenter",i.enter),l(e.display.scroller,"dragover",i.over),l(e.display.scroller,"dragleave",i.leave),l(e.display.scroller,"drop",i.drop)}}function dh(e){e.options.lineWrapping?(Ie(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(oe(e.display.wrapper,"CodeMirror-wrap"),Aa(e)),_a(e),xt(e),Gr(e),setTimeout(function(){return ar(e)},100)}function He(e,t){var r=this;if(!(this instanceof He))return new He(e,t);this.options=t=t?st(t):{},st(Ju,t,!1);var n=t.value;typeof n=="string"?n=new bt(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new He.inputStyles[t.inputStyle](this),l=this.display=new Ed(e,n,i,t);l.wrapper.CodeMirror=this,Zu(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),eu(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 Ve,keySeq:null,specialChars:null},t.autofocus&&!Z&&l.input.focus(),g&&v<11&&setTimeout(function(){return r.display.input.reset(!0)},20),hh(this),qd(),zn(this),this.curOp.forceUpdate=!0,fu(this,n),t.autofocus&&!Z||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ya(r)},20):ir(this);for(var f in io)io.hasOwnProperty(f)&&io[f](this,t[f],pr);ru(this),t.finishInit&&t.finishInit(this);for(var d=0;d20*20}ue(t.scroller,"touchstart",function(h){if(!Be(e,h)&&!l(h)&&!fl(e,h)){t.input.ensurePolled(),clearTimeout(r);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-n.end<=300?n:null},h.touches.length==1&&(t.activeTouch.left=h.touches[0].pageX,t.activeTouch.top=h.touches[0].pageY)}}),ue(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),ue(t.scroller,"touchend",function(h){var m=t.activeTouch;if(m&&!an(t,h)&&m.left!=null&&!m.moved&&new Date-m.start<300){var x=e.coordsChar(t.activeTouch,"page"),k;!m.prev||f(m,m.prev)?k=new Ee(x,x):!m.prev.prev||f(m,m.prev.prev)?k=e.findWordAt(x):k=new Ee(G(x.line,0),pe(e.doc,G(x.line+1,0))),e.setSelection(k.anchor,k.head),e.focus(),yt(h)}i()}),ue(t.scroller,"touchcancel",i),ue(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Yr(e,t.scroller.scrollTop),Wn(e,t.scroller.scrollLeft,!0),Me(e,"scroll",e))}),ue(t.scroller,"mousewheel",function(h){return au(e,h)}),ue(t.scroller,"DOMMouseScroll",function(h){return au(e,h)}),ue(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(h){Be(e,h)||Hr(h)},over:function(h){Be(e,h)||(Ud(e,h),Hr(h))},start:function(h){return Gd(e,h)},drop:tt(e,_d),leave:function(h){Be(e,h)||Fu(e)}};var d=t.input.getField();ue(d,"keyup",function(h){return Yu.call(e,h)}),ue(d,"keydown",tt(e,qu)),ue(d,"keypress",tt(e,ju)),ue(d,"focus",function(h){return Ya(e,h)}),ue(d,"blur",function(h){return ir(e,h)})}var cl=[];He.defineInitHook=function(e){return cl.push(e)};function ui(e,t,r,n){var i=e.doc,l;r==null&&(r="add"),r=="smart"&&(i.mode.indent?l=Br(e,t).state:r="prev");var f=e.options.tabSize,d=ae(i,t),h=Ue(d.text,null,f);d.stateAfter&&(d.stateAfter=null);var m=d.text.match(/^\s*/)[0],x;if(!n&&!/\S/.test(d.text))x=0,r="not";else if(r=="smart"&&(x=i.mode.indent(l,d.text.slice(m.length),d.text),x==ze||x>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?x=Ue(ae(i,t-1).text,null,f):x=0:r=="add"?x=h+e.options.indentUnit:r=="subtract"?x=h-e.options.indentUnit:typeof r=="number"&&(x=h+r),x=Math.max(0,x);var k="",T=0;if(e.options.indentWithTabs)for(var D=Math.floor(x/f);D;--D)T+=f,k+=" ";if(Tf,h=ga(t),m=null;if(d&&n.ranges.length>1)if(jt&&jt.text.join(` `)==t){if(n.ranges.length%jt.text.length==0){m=[];for(var x=0;x=0;T--){var D=n.ranges[T],F=D.from(),W=D.to();D.empty()&&(r&&r>0?F=G(F.line,F.ch-r):e.state.overwrite&&!d?W=G(W.line,Math.min(ae(l,W.line).text.length,W.ch+ye(h).length)):d&&jt&&jt.lineWise&&jt.text.join(` `)==h.join(` -`)&&(F=W=G(F.line,0)));var U={from:F,to:W,text:m?m[T%m.length]:h,origin:i||(d?"paste":e.state.cutIncoming>f?"cut":"+input")};ur(e.doc,U),et(e,"inputRead",e,U)}t&&!d&&ef(e,t),or(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Vu(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Tt(t,function(){return dl(t,r,0,null,"paste")}),!0}function ef(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var l=e.getModeAt(i.head),f=!1;if(l.electricChars){for(var d=0;d-1){f=ui(e,i.head.line,"smart");break}}else l.electricInput&&l.electricInput.test(ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(f=ui(e,i.head.line,"smart"));f&&et(e,"electricInput",e,i.head.line)}}}function tf(e){for(var t=[],r=[],n=0;nl&&(ui(this,d.head.line,n,!0),l=d.head.line,f==this.doc.sel.primIndex&&or(this));else{var h=d.from(),m=d.to(),x=Math.max(l,h.line);l=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var k=x;k0&&il(this.doc,f,new Ee(h,T[f].to()),at)}}}),getTokenAt:function(n,i){return ds(this,n,i)},getLineTokens:function(n,i){return ds(this,G(n),i,!0)},getTokenTypeAt:function(n){n=pe(this.doc,n);var i=us(this,ae(this.doc,n.line)),l=0,f=(i.length-1)/2,d=n.ch,h;if(d==0)h=i[2];else for(;;){var m=l+f>>1;if((m?i[m*2-1]:0)>=d)f=m;else if(i[m*2+1]h&&(n=h,f=!0),d=ae(this.doc,n)}else d=n;return zi(this,d,{top:0,left:0},i||"page",l||f).top+(f?this.doc.height-on(d):0)},defaultTextHeight:function(){return nr(this.display)},defaultCharWidth:function(){return rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,l,f,d){var h=this.display;n=qt(this,pe(this.doc,n));var m=n.bottom,x=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),h.sizer.appendChild(i),f=="over")m=n.top;else if(f=="above"||f=="near"){var k=Math.max(h.wrapper.clientHeight,this.doc.height),T=Math.max(h.sizer.clientWidth,h.lineSpace.clientWidth);(f=="above"||n.bottom+i.offsetHeight>k)&&n.top>i.offsetHeight?m=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=k&&(m=n.bottom),x+i.offsetWidth>T&&(x=T-i.offsetWidth)}i.style.top=m+"px",i.style.left=i.style.right="",d=="right"?(x=h.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(d=="left"?x=0:d=="middle"&&(x=(h.sizer.clientWidth-i.offsetWidth)/2),i.style.left=x+"px"),l&&cd(this,{left:x,top:m,right:x+i.offsetWidth,bottom:m+i.offsetHeight})},triggerOnKeyDown:ht(qu),triggerOnKeyPress:ht(ju),triggerOnKeyUp:Yu,triggerOnMouseDown:ht(Xu),execCommand:function(n){if(oi.hasOwnProperty(n))return oi[n].call(null,this)},triggerElectric:ht(function(n){ef(this,n)}),findPosH:function(n,i,l,f){var d=1;i<0&&(d=-1,i=-i);for(var h=pe(this.doc,n),m=0;m0&&x(l.charAt(f-1));)--f;for(;d.5||this.options.lineWrapping)&&_a(this),Me(this,"refresh",this)}),swapDoc:ht(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),fu(this,n),Gr(this),this.display.input.reset(),qr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,et(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},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}},Qn(e),e.registerHelper=function(n,i,l){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=l},e.registerGlobalHelper=function(n,i,l,f){e.registerHelper(n,i,f),r[n]._global.push({pred:l,val:f})}}function pl(e,t,r,n,i){var l=t,f=r,d=ae(e,t.line),h=i&&e.direction=="rtl"?-r:r;function m(){var Z=t.line+h;return Z=e.first+e.size?!1:(t=new G(Z,t.ch,t.sticky),d=ae(e,Z))}function x(Z){var K;if(n=="codepoint"){var ee=d.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(ee))K=null;else{var se=r>0?ee>=55296&&ee<56320:ee>=56320&&ee<57343;K=new G(t.line,Math.max(0,Math.min(d.text.length,t.ch+r*(se?2:1))),-r)}}else i?K=$d(e.cm,d,t,r):K=al(d,t,r);if(K==null)if(!Z&&m())t=ll(i,e.cm,d,t.line,h);else return!1;else t=K;return!0}if(n=="char"||n=="codepoint")x();else if(n=="column")x(!0);else if(n=="word"||n=="group")for(var k=null,T=n=="group",D=e.cm&&e.cm.getHelper(t,"wordChars"),F=!0;!(r<0&&!x(!F));F=!1){var W=d.text.charAt(t.ch)||` +`)&&(F=W=G(F.line,0)));var U={from:F,to:W,text:m?m[T%m.length]:h,origin:i||(d?"paste":e.state.cutIncoming>f?"cut":"+input")};ur(e.doc,U),et(e,"inputRead",e,U)}t&&!d&&ef(e,t),or(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Vu(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&Tt(t,function(){return dl(t,r,0,null,"paste")}),!0}function ef(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var l=e.getModeAt(i.head),f=!1;if(l.electricChars){for(var d=0;d-1){f=ui(e,i.head.line,"smart");break}}else l.electricInput&&l.electricInput.test(ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(f=ui(e,i.head.line,"smart"));f&&et(e,"electricInput",e,i.head.line)}}}function tf(e){for(var t=[],r=[],n=0;nl&&(ui(this,d.head.line,n,!0),l=d.head.line,f==this.doc.sel.primIndex&&or(this));else{var h=d.from(),m=d.to(),x=Math.max(l,h.line);l=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var k=x;k0&&il(this.doc,f,new Ee(h,T[f].to()),at)}}}),getTokenAt:function(n,i){return ds(this,n,i)},getLineTokens:function(n,i){return ds(this,G(n),i,!0)},getTokenTypeAt:function(n){n=pe(this.doc,n);var i=us(this,ae(this.doc,n.line)),l=0,f=(i.length-1)/2,d=n.ch,h;if(d==0)h=i[2];else for(;;){var m=l+f>>1;if((m?i[m*2-1]:0)>=d)f=m;else if(i[m*2+1]h&&(n=h,f=!0),d=ae(this.doc,n)}else d=n;return zi(this,d,{top:0,left:0},i||"page",l||f).top+(f?this.doc.height-on(d):0)},defaultTextHeight:function(){return nr(this.display)},defaultCharWidth:function(){return rr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,l,f,d){var h=this.display;n=qt(this,pe(this.doc,n));var m=n.bottom,x=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),h.sizer.appendChild(i),f=="over")m=n.top;else if(f=="above"||f=="near"){var k=Math.max(h.wrapper.clientHeight,this.doc.height),T=Math.max(h.sizer.clientWidth,h.lineSpace.clientWidth);(f=="above"||n.bottom+i.offsetHeight>k)&&n.top>i.offsetHeight?m=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=k&&(m=n.bottom),x+i.offsetWidth>T&&(x=T-i.offsetWidth)}i.style.top=m+"px",i.style.left=i.style.right="",d=="right"?(x=h.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(d=="left"?x=0:d=="middle"&&(x=(h.sizer.clientWidth-i.offsetWidth)/2),i.style.left=x+"px"),l&&cd(this,{left:x,top:m,right:x+i.offsetWidth,bottom:m+i.offsetHeight})},triggerOnKeyDown:ht(qu),triggerOnKeyPress:ht(ju),triggerOnKeyUp:Yu,triggerOnMouseDown:ht(Xu),execCommand:function(n){if(oi.hasOwnProperty(n))return oi[n].call(null,this)},triggerElectric:ht(function(n){ef(this,n)}),findPosH:function(n,i,l,f){var d=1;i<0&&(d=-1,i=-i);for(var h=pe(this.doc,n),m=0;m0&&x(l.charAt(f-1));)--f;for(;d.5||this.options.lineWrapping)&&_a(this),Me(this,"refresh",this)}),swapDoc:ht(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),fu(this,n),Gr(this),this.display.input.reset(),qr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,et(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},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}},Qn(e),e.registerHelper=function(n,i,l){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=l},e.registerGlobalHelper=function(n,i,l,f){e.registerHelper(n,i,f),r[n]._global.push({pred:l,val:f})}}function pl(e,t,r,n,i){var l=t,f=r,d=ae(e,t.line),h=i&&e.direction=="rtl"?-r:r;function m(){var Q=t.line+h;return Q=e.first+e.size?!1:(t=new G(Q,t.ch,t.sticky),d=ae(e,Q))}function x(Q){var K;if(n=="codepoint"){var ee=d.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(ee))K=null;else{var se=r>0?ee>=55296&&ee<56320:ee>=56320&&ee<57343;K=new G(t.line,Math.max(0,Math.min(d.text.length,t.ch+r*(se?2:1))),-r)}}else i?K=$d(e.cm,d,t,r):K=al(d,t,r);if(K==null)if(!Q&&m())t=ll(i,e.cm,d,t.line,h);else return!1;else t=K;return!0}if(n=="char"||n=="codepoint")x();else if(n=="column")x(!0);else if(n=="word"||n=="group")for(var k=null,T=n=="group",D=e.cm&&e.cm.getHelper(t,"wordChars"),F=!0;!(r<0&&!x(!F));F=!1){var W=d.text.charAt(t.ch)||` `,U=$n(W,D)?"w":T&&W==` `?"n":!T||/\s/.test(W)?null:"p";if(T&&!F&&!U&&(U="s"),k&&k!=U){r<0&&(r=1,x(),t.sticky="after");break}if(U&&(k=U),r>0&&!x(!F))break}var X=Vi(e,t,l,f,!0);return Sa(l,X)&&(X.hitSide=!0),X}function rf(e,t,r,n){var i=e.doc,l=t.left,f;if(n=="page"){var d=Math.min(e.display.wrapper.clientHeight,ge(e).innerHeight||i(e).documentElement.clientHeight),h=Math.max(d-.5*nr(e.display),3);f=(r>0?t.bottom:t.top)+r*h}else n=="line"&&(f=r>0?t.bottom+3:t.top-3);for(var m;m=Ba(e,l,f),!!m.outside;){if(r<0?f<=0:f>=i.height){m.hitSide=!0;break}f+=r*5}return m}var Te=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Ve,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Te.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;i.contentEditable=!0,hl(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function l(d){for(var h=d.target;h;h=h.parentNode){if(h==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(h.className))break}return!1}ue(i,"paste",function(d){!l(d)||Be(n,d)||Vu(d,n)||v<=11&&setTimeout(tt(n,function(){return t.updateFromDOM()}),20)}),ue(i,"compositionstart",function(d){t.composing={data:d.data,done:!1}}),ue(i,"compositionupdate",function(d){t.composing||(t.composing={data:d.data,done:!1})}),ue(i,"compositionend",function(d){t.composing&&(d.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),ue(i,"touchstart",function(){return r.forceCompositionEnd()}),ue(i,"input",function(){t.composing||t.readFromDOMSoon()});function f(d){if(!(!l(d)||Be(n,d))){if(n.somethingSelected())oo({lineWise:!1,text:n.getSelections()}),d.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var h=tf(n);oo({lineWise:!0,text:h.text}),d.type=="cut"&&n.operation(function(){n.setSelections(h.ranges,0,at),n.replaceSelection("",null,"cut")})}else return;if(d.clipboardData){d.clipboardData.clearData();var m=jt.text.join(` `);if(d.clipboardData.setData("Text",m),d.clipboardData.getData("Text")==m){d.preventDefault();return}}var x=nf(),k=x.firstChild;hl(k),n.display.lineSpace.insertBefore(x,n.display.lineSpace.firstChild),k.value=jt.text.join(` -`);var T=be(we(i));C(k),setTimeout(function(){n.display.lineSpace.removeChild(x),T.focus(),T==i&&r.showPrimarySelection()},50)}}ue(i,"copy",f),ue(i,"cut",f)},Te.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Te.prototype.prepareSelection=function(){var e=Xs(this.cm,!1);return e.focus=be(we(this.div))==this.div,e},Te.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Te.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Te.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line=t.display.viewFrom&&of(t,n)||{node:d[0].measure.map[2],offset:0},m=i.linee.firstLine()&&(n=G(n.line-1,ae(e.doc,n.line-1).length)),i.ch==ae(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var l,f,d;n.line==t.viewFrom||(l=Bn(e,n.line))==0?(f=De(t.view[0].line),d=t.view[0].node):(f=De(t.view[l].line),d=t.view[l-1].node.nextSibling);var h=Bn(e,i.line),m,x;if(h==t.view.length-1?(m=t.viewTo-1,x=t.lineDiv.lastChild):(m=De(t.view[h+1].line)-1,x=t.view[h+1].node.previousSibling),!d)return!1;for(var k=e.doc.splitLines(mh(e,d,x,f,m)),T=On(e.doc,G(f,0),G(m,ae(e.doc,m).text.length));k.length>1&&T.length>1;)if(ye(k)==ye(T))k.pop(),T.pop(),m--;else if(k[0]==T[0])k.shift(),T.shift(),f++;else break;for(var D=0,F=0,W=k[0],U=T[0],X=Math.min(W.length,U.length);Dn.ch&&Z.charCodeAt(Z.length-F-1)==K.charCodeAt(K.length-F-1);)D--,F++;k[k.length-1]=Z.slice(0,Z.length-F).replace(/^\u200b+/,""),k[0]=k[0].slice(D).replace(/\u200b+$/,"");var se=G(f,D),le=G(m,T.length?ye(T).length-F:0);if(k.length>1||k[0]||he(se,le))return fr(e.doc,k,se,le,"+input"),!0},Te.prototype.ensurePolled=function(){this.forceCompositionEnd()},Te.prototype.reset=function(){this.forceCompositionEnd()},Te.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Te.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))},Te.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Tt(this.cm,function(){return xt(e.cm)})},Te.prototype.setUneditable=function(e){e.contentEditable="false"},Te.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||tt(this.cm,dl)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Te.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Te.prototype.onContextMenu=function(){},Te.prototype.resetPosition=function(){},Te.prototype.needsContentAttribute=!0;function of(e,t){var r=Fa(e,t.line);if(!r||r.hidden)return null;var n=ae(e.doc,t.line),i=Is(r,n,t.line),l=vt(n,e.doc.direction),f="left";if(l){var d=Se(l,t.ch);f=d%2?"right":"left"}var h=Ps(i.map,t.ch,f);return h.offset=h.collapse=="right"?h.end:h.start,h}function gh(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 mh(e,t,r,n,i){var l="",f=!1,d=e.doc.lineSeparator(),h=!1;function m(D){return function(F){return F.id==D}}function x(){f&&(l+=d,h&&(l+=d),f=h=!1)}function k(D){D&&(x(),l+=D)}function T(D){if(D.nodeType==1){var F=D.getAttribute("cm-text");if(F){k(F);return}var W=D.getAttribute("cm-marker"),U;if(W){var X=e.findMarks(G(n,0),G(i+1,0),m(+W));X.length&&(U=X[0].find(0))&&k(On(e.doc,U.from,U.to).join(d));return}if(D.getAttribute("contenteditable")=="false")return;var Z=/^(pre|div|p|li|table|br)$/i.test(D.nodeName);if(!/^br$/i.test(D.nodeName)&&D.textContent.length==0)return;Z&&x();for(var K=0;K=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),ue(i,"paste",function(f){Be(n,f)||Vu(f,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())});function l(f){if(!Be(n,f)){if(n.somethingSelected())oo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var d=tf(n);oo({lineWise:!0,text:d.text}),f.type=="cut"?n.setSelections(d.ranges,null,at):(r.prevInput="",i.value=d.text.join(` -`),C(i))}else return;f.type=="cut"&&(n.state.cutIncoming=+new Date)}}ue(i,"cut",l),ue(i,"copy",l),ue(e.scroller,"paste",function(f){if(!(an(e,f)||Be(n,f))){if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var d=new Event("paste");d.clipboardData=f.clipboardData,i.dispatchEvent(d)}}),ue(e.lineSpace,"selectstart",function(f){an(e,f)||yt(f)}),ue(i,"compositionstart",function(){var f=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:f,range:n.markText(f,n.getCursor("to"),{className:"CodeMirror-composing"})}}),ue(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},qe.prototype.createField=function(e){this.wrapper=nf(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;hl(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},qe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Xs(e);if(e.options.moveInputWithCursor){var i=qt(e,r.sel.primary().head,"div"),l=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+f.top-l.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+f.left-l.left))}return n},qe.prototype.showSelection=function(e){var t=this.cm,r=t.display;j(r.cursorDiv,e.cursors),j(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qe.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&C(this.textarea),g&&v>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",g&&v>=9&&(this.hasSelection=null));this.resetting=!1}},qe.prototype.getField=function(){return this.textarea},qe.prototype.supportsTouch=function(){return!1},qe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!J||be(we(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},qe.prototype.blur=function(){this.textarea.blur()},qe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qe.prototype.receivedFocus=function(){this.slowPoll()},qe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},qe.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||mc(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(g&&v>=9&&this.hasSelection===i||O&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var l=i.charCodeAt(0);if(l==8203&&!n&&(n="\u200B"),l==8666)return this.reset(),this.cm.execCommand("undo")}for(var f=0,d=Math.min(n.length,i.length);f1e3||i.indexOf(` +`);var T=be(we(i));C(k),setTimeout(function(){n.display.lineSpace.removeChild(x),T.focus(),T==i&&r.showPrimarySelection()},50)}}ue(i,"copy",f),ue(i,"cut",f)},Te.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Te.prototype.prepareSelection=function(){var e=Xs(this.cm,!1);return e.focus=be(we(this.div))==this.div,e},Te.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Te.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Te.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line=t.display.viewFrom&&of(t,n)||{node:d[0].measure.map[2],offset:0},m=i.linee.firstLine()&&(n=G(n.line-1,ae(e.doc,n.line-1).length)),i.ch==ae(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var l,f,d;n.line==t.viewFrom||(l=Bn(e,n.line))==0?(f=De(t.view[0].line),d=t.view[0].node):(f=De(t.view[l].line),d=t.view[l-1].node.nextSibling);var h=Bn(e,i.line),m,x;if(h==t.view.length-1?(m=t.viewTo-1,x=t.lineDiv.lastChild):(m=De(t.view[h+1].line)-1,x=t.view[h+1].node.previousSibling),!d)return!1;for(var k=e.doc.splitLines(mh(e,d,x,f,m)),T=On(e.doc,G(f,0),G(m,ae(e.doc,m).text.length));k.length>1&&T.length>1;)if(ye(k)==ye(T))k.pop(),T.pop(),m--;else if(k[0]==T[0])k.shift(),T.shift(),f++;else break;for(var D=0,F=0,W=k[0],U=T[0],X=Math.min(W.length,U.length);Dn.ch&&Q.charCodeAt(Q.length-F-1)==K.charCodeAt(K.length-F-1);)D--,F++;k[k.length-1]=Q.slice(0,Q.length-F).replace(/^\u200b+/,""),k[0]=k[0].slice(D).replace(/\u200b+$/,"");var se=G(f,D),le=G(m,T.length?ye(T).length-F:0);if(k.length>1||k[0]||he(se,le))return fr(e.doc,k,se,le,"+input"),!0},Te.prototype.ensurePolled=function(){this.forceCompositionEnd()},Te.prototype.reset=function(){this.forceCompositionEnd()},Te.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Te.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))},Te.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Tt(this.cm,function(){return xt(e.cm)})},Te.prototype.setUneditable=function(e){e.contentEditable="false"},Te.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||tt(this.cm,dl)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Te.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Te.prototype.onContextMenu=function(){},Te.prototype.resetPosition=function(){},Te.prototype.needsContentAttribute=!0;function of(e,t){var r=Fa(e,t.line);if(!r||r.hidden)return null;var n=ae(e.doc,t.line),i=Is(r,n,t.line),l=vt(n,e.doc.direction),f="left";if(l){var d=Se(l,t.ch);f=d%2?"right":"left"}var h=Ps(i.map,t.ch,f);return h.offset=h.collapse=="right"?h.end:h.start,h}function gh(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 mh(e,t,r,n,i){var l="",f=!1,d=e.doc.lineSeparator(),h=!1;function m(D){return function(F){return F.id==D}}function x(){f&&(l+=d,h&&(l+=d),f=h=!1)}function k(D){D&&(x(),l+=D)}function T(D){if(D.nodeType==1){var F=D.getAttribute("cm-text");if(F){k(F);return}var W=D.getAttribute("cm-marker"),U;if(W){var X=e.findMarks(G(n,0),G(i+1,0),m(+W));X.length&&(U=X[0].find(0))&&k(On(e.doc,U.from,U.to).join(d));return}if(D.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(D.nodeName);if(!/^br$/i.test(D.nodeName)&&D.textContent.length==0)return;Q&&x();for(var K=0;K=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),ue(i,"paste",function(f){Be(n,f)||Vu(f,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())});function l(f){if(!Be(n,f)){if(n.somethingSelected())oo({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var d=tf(n);oo({lineWise:!0,text:d.text}),f.type=="cut"?n.setSelections(d.ranges,null,at):(r.prevInput="",i.value=d.text.join(` +`),C(i))}else return;f.type=="cut"&&(n.state.cutIncoming=+new Date)}}ue(i,"cut",l),ue(i,"copy",l),ue(e.scroller,"paste",function(f){if(!(an(e,f)||Be(n,f))){if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var d=new Event("paste");d.clipboardData=f.clipboardData,i.dispatchEvent(d)}}),ue(e.lineSpace,"selectstart",function(f){an(e,f)||yt(f)}),ue(i,"compositionstart",function(){var f=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:f,range:n.markText(f,n.getCursor("to"),{className:"CodeMirror-composing"})}}),ue(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},qe.prototype.createField=function(e){this.wrapper=nf(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;hl(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},qe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Xs(e);if(e.options.moveInputWithCursor){var i=qt(e,r.sel.primary().head,"div"),l=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+f.top-l.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+f.left-l.left))}return n},qe.prototype.showSelection=function(e){var t=this.cm,r=t.display;j(r.cursorDiv,e.cursors),j(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qe.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&C(this.textarea),g&&v>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",g&&v>=9&&(this.hasSelection=null));this.resetting=!1}},qe.prototype.getField=function(){return this.textarea},qe.prototype.supportsTouch=function(){return!1},qe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!Z||be(we(this.textarea))!=this.textarea))try{this.textarea.focus()}catch(e){}},qe.prototype.blur=function(){this.textarea.blur()},qe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qe.prototype.receivedFocus=function(){this.slowPoll()},qe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},qe.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||mc(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(g&&v>=9&&this.hasSelection===i||O&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var l=i.charCodeAt(0);if(l==8203&&!n&&(n="\u200B"),l==8666)return this.reset(),this.cm.execCommand("undo")}for(var f=0,d=Math.min(n.length,i.length);f1e3||i.indexOf(` `)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qe.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qe.prototype.onKeyPress=function(){g&&v>=9&&(this.hasSelection=null),this.fastPoll()},qe.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var l=Pn(r,e),f=n.scroller.scrollTop;if(!l||A)return;var d=r.options.resetSelectionOnContextMenu;d&&r.doc.sel.contains(l)==-1&&tt(r,ut)(r.doc,yn(l),at);var h=i.style.cssText,m=t.wrapper.style.cssText,x=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-x.top-5)+"px; left: "+(e.clientX-x.left-5)+`px; z-index: 1000; background: `+(g?"rgba(255, 255, 255, .05)":"transparent")+`; - outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;b&&(k=i.ownerDocument.defaultView.scrollY),n.input.focus(),b&&i.ownerDocument.defaultView.scrollTo(null,k),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=D,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function T(){if(i.selectionStart!=null){var W=r.somethingSelected(),U="\u200B"+(W?i.value:"");i.value="\u21DA",i.value=U,t.prevInput=W?"":"\u200B",i.selectionStart=1,i.selectionEnd=U.length,n.selForContextMenu=r.doc.sel}}function D(){if(t.contextMenuPending==D&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=h,g&&v<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=f),i.selectionStart!=null)){(!g||g&&v<9)&&T();var W=0,U=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?tt(r,ku)(r):W++<10?n.detectingSelectAll=setTimeout(U,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(U,200)}}if(g&&v>=9&&T(),$){Hr(e);var F=function(){ke(window,"mouseup",F),setTimeout(D,20)};ue(window,"mouseup",F)}else setTimeout(D,50)},qe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qe.prototype.setUneditable=function(){},qe.prototype.needsContentAttribute=!1;function yh(e,t){if(t=t?st(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=be(we(e));t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=d.getValue()}var i;if(e.form&&(ue(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var l=e.form;i=l.submit;try{var f=l.submit=function(){n(),l.submit=i,l.submit(),l.submit=f}}catch(h){}}t.finishInit=function(h){h.save=n,h.getTextArea=function(){return e},h.toTextArea=function(){h.toTextArea=isNaN,n(),e.parentNode.removeChild(h.getWrapperElement()),e.style.display="",e.form&&(ke(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var d=He(function(h){return e.parentNode.insertBefore(h,e.nextSibling)},t);return d}function xh(e){e.off=ke,e.on=ue,e.wheelEventPixels=Ld,e.Doc=bt,e.splitLines=ga,e.countColumn=Ue,e.findColumn=Ot,e.isWordChar=Ir,e.Pass=ze,e.signal=Me,e.Line=Vn,e.changeEnd=xn,e.scrollbarModel=Vs,e.Pos=G,e.cmpPos=he,e.modes=va,e.mimeModes=Zn,e.resolveMode=Mi,e.getMode=ya,e.modeExtensions=Jn,e.extendMode=wc,e.copyState=Nn,e.startState=os,e.innerMode=xa,e.commands=oi,e.keyMap=sn,e.keyName=Ru,e.isModifierKey=Bu,e.lookupKey=dr,e.normalizeKeyMap=Kd,e.StringStream=je,e.SharedTextMarker=ni,e.TextMarker=wn,e.LineWidget=ti,e.e_preventDefault=yt,e.e_stopPropagation=rs,e.e_stop=Hr,e.addClass=Ie,e.contains=ne,e.rmClass=oe,e.keyNames=Sn}fh(He),ph(He);var bh="iter insert remove copy getEditor constructor".split(" ");for(var lo in bt.prototype)bt.prototype.hasOwnProperty(lo)&&Oe(bh,lo)<0&&(He.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(bt.prototype[lo]));return Qn(bt),He.inputStyles={textarea:qe,contenteditable:Te},He.defineMode=function(e){!He.defaults.mode&&e!="null"&&(He.defaults.mode=e),xc.apply(this,arguments)},He.defineMIME=bc,He.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),He.defineMIME("text/plain","null"),He.defineExtension=function(e,t){He.prototype[e]=t},He.defineDocExtension=function(e,t){bt.prototype[e]=t},He.fromTextArea=yh,xh(He),He.version="5.65.16",He})});var zf=yr((Wf,Rf)=>{(function(u){typeof Wf=="object"&&typeof Rf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";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},a={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};u.defineMode("xml",function(s,c){var p=s.indentUnit,g={},v=c.htmlMode?o:a;for(var b in v)g[b]=v[b];for(var b in c)g[b]=c[b];var w,L;function N(S,R){function _(Ie){return R.tokenize=Ie,Ie(S,R)}var ne=S.next();if(ne=="<")return S.eat("!")?S.eat("[")?S.match("CDATA[")?_(E("atom","]]>")):null:S.match("--")?_(E("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),_(z(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),R.tokenize=E("meta","?>"),"meta"):(w=S.eat("/")?"closeTag":"openTag",R.tokenize=A,"tag bracket");if(ne=="&"){var be;return S.eat("#")?S.eat("x")?be=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):be=S.eatWhile(/[\d]/)&&S.eat(";"):be=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),be?"atom":"error"}else return S.eatWhile(/[^&<]/),null}N.isInText=!0;function A(S,R){var _=S.next();if(_==">"||_=="/"&&S.eat(">"))return R.tokenize=N,w=_==">"?"endTag":"selfcloseTag","tag bracket";if(_=="=")return w="equals",null;if(_=="<"){R.tokenize=N,R.state=q,R.tagName=R.tagStart=null;var ne=R.tokenize(S,R);return ne?ne+" tag error":"tag error"}else return/[\'\"]/.test(_)?(R.tokenize=I(_),R.stringStartCol=S.column(),R.tokenize(S,R)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function I(S){var R=function(_,ne){for(;!_.eol();)if(_.next()==S){ne.tokenize=A;break}return"string"};return R.isInAttribute=!0,R}function E(S,R){return function(_,ne){for(;!_.eol();){if(_.match(R)){ne.tokenize=N;break}_.next()}return S}}function z(S){return function(R,_){for(var ne;(ne=R.next())!=null;){if(ne=="<")return _.tokenize=z(S+1),_.tokenize(R,_);if(ne==">")if(S==1){_.tokenize=N;break}else return _.tokenize=z(S-1),_.tokenize(R,_)}return"meta"}}function Y(S){return S&&S.toLowerCase()}function V(S,R,_){this.prev=S.context,this.tagName=R||"",this.indent=S.indented,this.startOfLine=_,(g.doNotIndent.hasOwnProperty(R)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function J(S){S.context&&(S.context=S.context.prev)}function O(S,R){for(var _;;){if(!S.context||(_=S.context.tagName,!g.contextGrabbers.hasOwnProperty(Y(_))||!g.contextGrabbers[Y(_)].hasOwnProperty(Y(R))))return;J(S)}}function q(S,R,_){return S=="openTag"?(_.tagStart=R.column(),re):S=="closeTag"?P:q}function re(S,R,_){return S=="word"?(_.tagName=R.current(),L="tag",B):g.allowMissingTagName&&S=="endTag"?(L="tag bracket",B(S,R,_)):(L="error",re)}function P(S,R,_){if(S=="word"){var ne=R.current();return _.context&&_.context.tagName!=ne&&g.implicitlyClosed.hasOwnProperty(Y(_.context.tagName))&&J(_),_.context&&_.context.tagName==ne||g.matchClosing===!1?(L="tag",H):(L="tag error",$)}else return g.allowMissingTagName&&S=="endTag"?(L="tag bracket",H(S,R,_)):(L="error",$)}function H(S,R,_){return S!="endTag"?(L="error",H):(J(_),q)}function $(S,R,_){return L="error",H(S,R,_)}function B(S,R,_){if(S=="word")return L="attribute",oe;if(S=="endTag"||S=="selfcloseTag"){var ne=_.tagName,be=_.tagStart;return _.tagName=_.tagStart=null,S=="selfcloseTag"||g.autoSelfClosers.hasOwnProperty(Y(ne))?O(_,ne):(O(_,ne),_.context=new V(_,ne,be==_.indented)),q}return L="error",B}function oe(S,R,_){return S=="equals"?de:(g.allowMissing||(L="error"),B(S,R,_))}function de(S,R,_){return S=="string"?j:S=="word"&&g.allowUnquoted?(L="string",B):(L="error",B(S,R,_))}function j(S,R,_){return S=="string"?j:B(S,R,_)}return{startState:function(S){var R={tokenize:N,state:q,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(R.baseIndent=S),R},token:function(S,R){if(!R.tagName&&S.sol()&&(R.indented=S.indentation()),S.eatSpace())return null;w=null;var _=R.tokenize(S,R);return(_||w)&&_!="comment"&&(L=null,R.state=R.state(w||_,S,R),L&&(_=L=="error"?_+" error":L)),_},indent:function(S,R,_){var ne=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+p;if(ne&&ne.noIndent)return u.Pass;if(S.tokenize!=A&&S.tokenize!=N)return _?_.match(/^(\s*)/)[0].length:0;if(S.tagName)return g.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+p*(g.multilineTagIndentFactor||1);if(g.alignCDATA&&/$/,blockCommentStart:"",configuration:g.htmlMode?"html":"xml",helperType:g.htmlMode?"html":"xml",skipAttribute:function(S){S.state==de&&(S.state=B)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var R=[],_=S.context;_;_=_.prev)R.push(_.tagName);return R.reverse()}}}),u.defineMIME("text/xml","xml"),u.defineMIME("application/xml","xml"),u.mimeModes.hasOwnProperty("text/html")||u.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Uf=yr((_f,Gf)=>{(function(u){typeof _f=="object"&&typeof Gf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";u.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-1&&s.substring(g+1,s.length);if(v)return u.findModeByExtension(v)},u.findModeByName=function(s){s=s.toLowerCase();for(var c=0;c{(function(u){typeof qf=="object"&&typeof Yf=="object"?u(Xn(),zf(),Uf()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],u):u(CodeMirror)})(function(u){"use strict";u.defineMode("markdown",function(o,a){var s=u.getMode(o,"text/html"),c=s.name=="null";function p(C){if(u.findModeByName){var y=u.findModeByName(C);y&&(C=y.mime||y.mimes[0])}var ie=u.getMode(o,C);return ie.name=="null"?null:ie}a.highlightFormatting===void 0&&(a.highlightFormatting=!1),a.maxBlockquoteDepth===void 0&&(a.maxBlockquoteDepth=0),a.taskLists===void 0&&(a.taskLists=!1),a.strikethrough===void 0&&(a.strikethrough=!1),a.emoji===void 0&&(a.emoji=!1),a.fencedCodeBlockHighlighting===void 0&&(a.fencedCodeBlockHighlighting=!0),a.fencedCodeBlockDefaultMode===void 0&&(a.fencedCodeBlockDefaultMode="text/plain"),a.xml===void 0&&(a.xml=!0),a.tokenTypeOverrides===void 0&&(a.tokenTypeOverrides={});var g={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 v in g)g.hasOwnProperty(v)&&a.tokenTypeOverrides[v]&&(g[v]=a.tokenTypeOverrides[v]);var b=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,L=/^\[(x| )\](?=\s)/i,N=a.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,A=/^ {0,3}(?:\={1,}|-{2,})\s*$/,I=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,z=/^\s*\[[^\]]+?\]:.*$/,Y=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,V=" ";function J(C,y,ie){return y.f=y.inline=ie,ie(C,y)}function O(C,y,ie){return y.f=y.block=ie,ie(C,y)}function q(C){return!C||!/\S/.test(C.string)}function re(C){if(C.linkTitle=!1,C.linkHref=!1,C.linkText=!1,C.em=!1,C.strong=!1,C.strikethrough=!1,C.quote=0,C.indentedCode=!1,C.f==H){var y=c;if(!y){var ie=u.innerMode(s,C.htmlState);y=ie.mode.name=="xml"&&ie.state.tagStart===null&&!ie.state.context&&ie.state.tokenize.isInText}y&&(C.f=de,C.block=P,C.htmlState=null)}return C.trailingSpace=0,C.trailingSpaceNewLine=!1,C.prevLine=C.thisLine,C.thisLine={stream:null},null}function P(C,y){var ie=C.column()===y.indentation,we=q(y.prevLine.stream),ge=y.indentedCode,Je=y.prevLine.hr,st=y.list!==!1,Ue=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var Ve=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,st)){for(y.list=null;Ve=4&&(ge||y.prevLine.fencedCodeEnd||y.prevLine.header||we))return C.skipToEnd(),y.indentedCode=!0,g.code;if(C.eatSpace())return null;if(ie&&y.indentation<=Ue&&(ze=C.match(N))&&ze[1].length<=6)return y.quote=0,y.header=ze[1].length,y.thisLine.header=!0,a.highlightFormatting&&(y.formatting="header"),y.f=y.inline,B(y);if(y.indentation<=Ue&&C.eat(">"))return y.quote=ie?1:y.quote+1,a.highlightFormatting&&(y.formatting="quote"),C.eatSpace(),B(y);if(!Fe&&!y.setext&&ie&&y.indentation<=Ue&&(ze=C.match(w))){var at=ze[1]?"ol":"ul";return y.indentation=Ve+C.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,a.taskLists&&C.match(L,!1)&&(y.taskList=!0),y.f=y.inline,a.highlightFormatting&&(y.formatting=["list","list-"+at]),B(y)}else{if(ie&&y.indentation<=Ue&&(ze=C.match(E,!0)))return y.quote=0,y.fencedEndRE=new RegExp(ze[1]+"+ *$"),y.localMode=a.fencedCodeBlockHighlighting&&p(ze[2]||a.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=u.startState(y.localMode)),y.f=y.block=$,a.highlightFormatting&&(y.formatting="code-block"),y.code=-1,B(y);if(y.setext||(!Oe||!st)&&!y.quote&&y.list===!1&&!y.code&&!Fe&&!z.test(C.string)&&(ze=C.lookAhead(1))&&(ze=ze.match(A)))return y.setext?(y.header=y.setext,y.setext=0,C.skipToEnd(),a.highlightFormatting&&(y.formatting="header")):(y.header=ze[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,B(y);if(Fe)return C.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,g.hr;if(C.peek()==="[")return J(C,y,ne)}return J(C,y,y.inline)}function H(C,y){var ie=s.token(C,y.htmlState);if(!c){var we=u.innerMode(s,y.htmlState);(we.mode.name=="xml"&&we.state.tagStart===null&&!we.state.context&&we.state.tokenize.isInText||y.md_inside&&C.current().indexOf(">")>-1)&&(y.f=de,y.block=P,y.htmlState=null)}return ie}function $(C,y){var ie=y.listStack[y.listStack.length-1]||0,we=y.indentation=C.quote?y.push(g.formatting+"-"+C.formatting[ie]+"-"+C.quote):y.push("error"))}if(C.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(C.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(C.linkHref?y.push(g.linkHref,"url"):(C.strong&&y.push(g.strong),C.em&&y.push(g.em),C.strikethrough&&y.push(g.strikethrough),C.emoji&&y.push(g.emoji),C.linkText&&y.push(g.linkText),C.code&&y.push(g.code),C.image&&y.push(g.image),C.imageAltText&&y.push(g.imageAltText,"link"),C.imageMarker&&y.push(g.imageMarker)),C.header&&y.push(g.header,g.header+"-"+C.header),C.quote&&(y.push(g.quote),!a.maxBlockquoteDepth||a.maxBlockquoteDepth>=C.quote?y.push(g.quote+"-"+C.quote):y.push(g.quote+"-"+a.maxBlockquoteDepth)),C.list!==!1){var we=(C.listStack.length-1)%3;we?we===1?y.push(g.list2):y.push(g.list3):y.push(g.list1)}return C.trailingSpaceNewLine?y.push("trailing-space-new-line"):C.trailingSpace&&y.push("trailing-space-"+(C.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function oe(C,y){if(C.match(I,!0))return B(y)}function de(C,y){var ie=y.text(C,y);if(typeof ie!="undefined")return ie;if(y.list)return y.list=null,B(y);if(y.taskList){var we=C.match(L,!0)[1]===" ";return we?y.taskOpen=!0:y.taskClosed=!0,a.highlightFormatting&&(y.formatting="task"),y.taskList=!1,B(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&C.match(/^#+$/,!0))return a.highlightFormatting&&(y.formatting="header"),B(y);var ge=C.next();if(y.linkTitle){y.linkTitle=!1;var Je=ge;ge==="("&&(Je=")"),Je=(Je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var st="^\\s*(?:[^"+Je+"\\\\]+|\\\\\\\\|\\\\.)"+Je;if(C.match(new RegExp(st),!0))return g.linkHref}if(ge==="`"){var Ue=y.formatting;a.highlightFormatting&&(y.formatting="code"),C.eatWhile("`");var Ve=C.current().length;if(y.code==0&&(!y.quote||Ve==1))return y.code=Ve,B(y);if(Ve==y.code){var Oe=B(y);return y.code=0,Oe}else return y.formatting=Ue,B(y)}else if(y.code)return B(y);if(ge==="\\"&&(C.next(),a.highlightFormatting)){var Fe=B(y),ze=g.formatting+"-escape";return Fe?Fe+" "+ze:ze}if(ge==="!"&&C.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,a.highlightFormatting&&(y.formatting="image"),B(y);if(ge==="["&&y.imageMarker&&C.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,a.highlightFormatting&&(y.formatting="image"),B(y);if(ge==="]"&&y.imageAltText){a.highlightFormatting&&(y.formatting="image");var Fe=B(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=S,Fe}if(ge==="["&&!y.image)return y.linkText&&C.match(/^.*?\]/)||(y.linkText=!0,a.highlightFormatting&&(y.formatting="link")),B(y);if(ge==="]"&&y.linkText){a.highlightFormatting&&(y.formatting="link");var Fe=B(y);return y.linkText=!1,y.inline=y.f=C.match(/\(.*?\)| ?\[.*?\]/,!1)?S:de,Fe}if(ge==="<"&&C.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=j,a.highlightFormatting&&(y.formatting="link");var Fe=B(y);return Fe?Fe+=" ":Fe="",Fe+g.linkInline}if(ge==="<"&&C.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=j,a.highlightFormatting&&(y.formatting="link");var Fe=B(y);return Fe?Fe+=" ":Fe="",Fe+g.linkEmail}if(a.xml&&ge==="<"&&C.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var at=C.string.indexOf(">",C.pos);if(at!=-1){var hn=C.string.substring(C.start,at);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(hn)&&(y.md_inside=!0)}return C.backUp(1),y.htmlState=u.startState(s),O(C,y,H)}if(a.xml&&ge==="<"&&C.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(ge==="*"||ge==="_"){for(var Nt=1,Ot=C.pos==1?" ":C.string.charAt(C.pos-2);Nt<3&&C.eat(ge);)Nt++;var Lt=C.peek()||" ",_t=!/\s/.test(Lt)&&(!Y.test(Lt)||/\s/.test(Ot)||Y.test(Ot)),ye=!/\s/.test(Ot)&&(!Y.test(Ot)||/\s/.test(Lt)||Y.test(Lt)),Dt=null,Gt=null;if(Nt%2&&(!y.em&&_t&&(ge==="*"||!ye||Y.test(Ot))?Dt=!0:y.em==ge&&ye&&(ge==="*"||!_t||Y.test(Lt))&&(Dt=!1)),Nt>1&&(!y.strong&&_t&&(ge==="*"||!ye||Y.test(Ot))?Gt=!0:y.strong==ge&&ye&&(ge==="*"||!_t||Y.test(Lt))&&(Gt=!1)),Gt!=null||Dt!=null){a.highlightFormatting&&(y.formatting=Dt==null?"strong":Gt==null?"em":"strong em"),Dt===!0&&(y.em=ge),Gt===!0&&(y.strong=ge);var Oe=B(y);return Dt===!1&&(y.em=!1),Gt===!1&&(y.strong=!1),Oe}}else if(ge===" "&&(C.eat("*")||C.eat("_"))){if(C.peek()===" ")return B(y);C.backUp(1)}if(a.strikethrough){if(ge==="~"&&C.eatWhile(ge)){if(y.strikethrough){a.highlightFormatting&&(y.formatting="strikethrough");var Oe=B(y);return y.strikethrough=!1,Oe}else if(C.match(/^[^\s]/,!1))return y.strikethrough=!0,a.highlightFormatting&&(y.formatting="strikethrough"),B(y)}else if(ge===" "&&C.match("~~",!0)){if(C.peek()===" ")return B(y);C.backUp(2)}}if(a.emoji&&ge===":"&&C.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,a.highlightFormatting&&(y.formatting="emoji");var Mn=B(y);return y.emoji=!1,Mn}return ge===" "&&(C.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),B(y)}function j(C,y){var ie=C.next();if(ie===">"){y.f=y.inline=de,a.highlightFormatting&&(y.formatting="link");var we=B(y);return we?we+=" ":we="",we+g.linkInline}return C.match(/^[^>]+/,!0),g.linkInline}function S(C,y){if(C.eatSpace())return null;var ie=C.next();return ie==="("||ie==="["?(y.f=y.inline=_(ie==="("?")":"]"),a.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,B(y)):"error"}var R={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(C){return function(y,ie){var we=y.next();if(we===C){ie.f=ie.inline=de,a.highlightFormatting&&(ie.formatting="link-string");var ge=B(ie);return ie.linkHref=!1,ge}return y.match(R[C]),ie.linkHref=!0,B(ie)}}function ne(C,y){return C.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=be,C.next(),a.highlightFormatting&&(y.formatting="link"),y.linkText=!0,B(y)):J(C,y,de)}function be(C,y){if(C.match("]:",!0)){y.f=y.inline=Ie,a.highlightFormatting&&(y.formatting="link");var ie=B(y);return y.linkText=!1,ie}return C.match(/^([^\]\\]|\\.)+/,!0),g.linkText}function Ie(C,y){return C.eatSpace()?null:(C.match(/^[^\s]+/,!0),C.peek()===void 0?y.linkTitle=!0:C.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),y.f=y.inline=de,g.linkHref+" url")}var mt={startState:function(){return{f:P,prevLine:{stream:null},thisLine:{stream:null},block:P,htmlState:null,indentation:0,inline:de,text:oe,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(C){return{f:C.f,prevLine:C.prevLine,thisLine:C.thisLine,block:C.block,htmlState:C.htmlState&&u.copyState(s,C.htmlState),indentation:C.indentation,localMode:C.localMode,localState:C.localMode?u.copyState(C.localMode,C.localState):null,inline:C.inline,text:C.text,formatting:!1,linkText:C.linkText,linkTitle:C.linkTitle,linkHref:C.linkHref,code:C.code,em:C.em,strong:C.strong,strikethrough:C.strikethrough,emoji:C.emoji,header:C.header,setext:C.setext,hr:C.hr,taskList:C.taskList,list:C.list,listStack:C.listStack.slice(0),quote:C.quote,indentedCode:C.indentedCode,trailingSpace:C.trailingSpace,trailingSpaceNewLine:C.trailingSpaceNewLine,md_inside:C.md_inside,fencedEndRE:C.fencedEndRE}},token:function(C,y){if(y.formatting=!1,C!=y.thisLine.stream){if(y.header=0,y.hr=!1,C.match(/^\s*$/,!0))return re(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:C},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=H)){var ie=C.match(/^\s*/,!0)[0].replace(/\t/g,V).length;if(y.indentation=ie,y.indentationDiff=null,ie>0)return null}}return y.f(C,y)},innerMode:function(C){return C.block==H?{state:C.htmlState,mode:s}:C.localState?{state:C.localState,mode:C.localMode}:{state:C,mode:mt}},indent:function(C,y,ie){return C.block==H&&s.indent?s.indent(C.htmlState,y,ie):C.localState&&C.localMode.indent?C.localMode.indent(C.localState,y,ie):u.Pass},blankLine:re,getType:B,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return mt},"xml"),u.defineMIME("text/markdown","markdown"),u.defineMIME("text/x-markdown","markdown")})});var $f=yr((Xf,Kf)=>{(function(u){typeof Xf=="object"&&typeof Kf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){u.defineOption("placeholder","",function(v,b,w){var L=w&&w!=u.Init;if(b&&!L)v.on("blur",c),v.on("change",p),v.on("swapDoc",p),u.on(v.getInputField(),"compositionupdate",v.state.placeholderCompose=function(){s(v)}),p(v);else if(!b&&L){v.off("blur",c),v.off("change",p),v.off("swapDoc",p),u.off(v.getInputField(),"compositionupdate",v.state.placeholderCompose),o(v);var N=v.getWrapperElement();N.className=N.className.replace(" CodeMirror-empty","")}b&&!v.hasFocus()&&c(v)});function o(v){v.state.placeholder&&(v.state.placeholder.parentNode.removeChild(v.state.placeholder),v.state.placeholder=null)}function a(v){o(v);var b=v.state.placeholder=document.createElement("pre");b.style.cssText="height: 0; overflow: visible",b.style.direction=v.getOption("direction"),b.className="CodeMirror-placeholder CodeMirror-line-like";var w=v.getOption("placeholder");typeof w=="string"&&(w=document.createTextNode(w)),b.appendChild(w),v.display.lineSpace.insertBefore(b,v.display.lineSpace.firstChild)}function s(v){setTimeout(function(){var b=!1;if(v.lineCount()==1){var w=v.getInputField();b=w.nodeName=="TEXTAREA"?!v.getLine(0).length:!/[^\u200b]/.test(w.querySelector(".CodeMirror-line").textContent)}b?a(v):o(v)},20)}function c(v){g(v)&&a(v)}function p(v){var b=v.getWrapperElement(),w=g(v);b.className=b.className.replace(" CodeMirror-empty","")+(w?" CodeMirror-empty":""),w?a(v):o(v)}function g(v){return v.lineCount()===1&&v.getLine(0)===""}})});var Jf=yr((Qf,Zf)=>{(function(u){typeof Qf=="object"&&typeof Zf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";var o=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,a=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,s=/[*+-]\s/;u.commands.newlineAndIndentContinueMarkdownList=function(p){if(p.getOption("disableInput"))return u.Pass;for(var g=p.listSelections(),v=[],b=0;b\s*$/.test(E),J=!/>\s*$/.test(E);(V||J)&&p.replaceRange("",{line:w.line,ch:0},{line:w.line,ch:w.ch+1}),v[b]=` -`}else{var O=z[1],q=z[5],re=!(s.test(z[2])||z[2].indexOf(">")>=0),P=re?parseInt(z[3],10)+1+z[4]:z[2].replace("x"," ");v[b]=` -`+O+P+q,re&&c(p,w)}}p.replaceSelections(v)};function c(p,g){var v=g.line,b=0,w=0,L=o.exec(p.getLine(v)),N=L[1];do{b+=1;var A=v+b,I=p.getLine(A),E=o.exec(I);if(E){var z=E[1],Y=parseInt(L[3],10)+b-w,V=parseInt(E[3],10),J=V;if(N===z&&!isNaN(V))Y===V&&(J=V+1),Y>V&&(J=Y+1),p.replaceRange(I.replace(o,z+J+E[4]+E[5]),{line:A,ch:0},{line:A,ch:I.length});else{if(N.length>z.length||N.lengthNe});function uf(){let u=[],o=document.cookie.split(";");for(let a of o){let s=a.split("=",2);s.length===2&&(u[s[0].trim()]=decodeURIComponent(s[1].trim()))}return u}function ff(u,o,a){let s=`${u}=${o}`;for(let c in a)s+=`;${c}=${a[c]}`;document.cookie=s}var co=class{constructor(){let o=()=>{let a=uf(),s="formwork_preferred_color_scheme",c=s in a?a[s]:null,p=null;window.matchMedia("(prefers-color-scheme: light)").matches?p="light":window.matchMedia("(prefers-color-scheme: dark)").matches&&(p="dark"),p!==c&&ff(s,p,{"max-age":2592e3,path:Ne.config.baseUri,samesite:"strict"})};window.addEventListener("beforeunload",o),window.addEventListener("pagehide",o)}};function M(u,o=document){return o.querySelector(u)}function te(u,o=document){return o.querySelectorAll(u)}function ho(u){let o=getComputedStyle(u);return u.offsetWidth+parseInt(o.marginLeft)+parseInt(o.marginRight)}function po(u){let o=getComputedStyle(u);return u.offsetHeight+parseInt(o.marginTop)+parseInt(o.marginBottom)}function Cn(u,o,a){let s,c=null;function p(){let g=this,v=arguments;return c&&clearTimeout(c),a&&!c&&(s=u.apply(g,v)),c=setTimeout(()=>{a||(s=u.apply(g,v)),c=null},o),s}return p}function go(u,o){let a,s=0,c=null;function p(){let g=Date.now();s===0&&(s=g);let v=s+o-g,b=this,w=arguments;return v<=0||v>o?(c&&(clearTimeout(c),c=null),s=g,a=u.apply(b,w)):c||(c=setTimeout(()=>{s=Date.now(),a=u.apply(b,w),c=null},v)),a}return p}var mo=class{constructor(){M(".dropdown")&&document.addEventListener("click",o=>{te(".dropdown-menu").forEach(s=>s.style.display="");let a=o.target.closest(".dropdown-button");if(a){let s=document.getElementById(a.dataset.dropdown),c=getComputedStyle(s).display!=="none";o.preventDefault();let p=go(()=>cf(s),100);s&&!c?(s.style.display="block",cf(s),window.addEventListener("resize",p)):window.removeEventListener("resize",p)}})}};function cf(u){u.style.left=0,u.style.right="";let o=u.getBoundingClientRect(),a=o.top+window.scrollY,s=o.left+window.scrollX,c=ho(u),p=po(u),g=document.documentElement.clientWidth,v=document.documentElement.clientHeight;s+c>g&&(u.style.left="auto",u.style.right=0),(a{let a=M(".input-togglegroup",o),s=window.localStorage.getItem("formwork.filesListViewAs");s&&(te("input",a).forEach(c=>c.checked=!1),M(`input[value=${s}]`,o).checked=!0,o.classList.toggle("is-thumbnails",s==="thumbnails")),te("input",a).forEach(c=>{c.addEventListener("input",()=>{o.classList.toggle("is-thumbnails",c.value==="thumbnails"),window.localStorage.setItem("formwork.filesListViewAs",c.value)})})})}};"requestSubmit"in window.HTMLFormElement.prototype||(window.HTMLFormElement.prototype.requestSubmit=function(u){u?(u instanceof HTMLElement||o(TypeError,"parameter 1 is not of type 'HTMLElement'"),u.type!=="submit"&&o(TypeError,"The specified element is not a submit button"),u.form!==this&&o(DOMException,"The specified element is not owned by this form element","NotFoundError"),u.click()):(u=document.createElement("input"),u.type="submit",u.hidden=!0,this.appendChild(u),u.click(),this.removeChild(u));function o(a,s,c){throw new a(`Failed to execute 'requestSubmit' on 'HTMLFormElement': ${s}.`,c)}});function df(u,o){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(u);o&&(s=s.filter(function(c){return Object.getOwnPropertyDescriptor(u,c).enumerable})),a.push.apply(a,s)}return a}function tn(u){for(var o=1;o=0)&&(a[c]=u[c]);return a}function Nh(u,o){if(u==null)return{};var a=Ah(u,o),s,c;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(u);for(c=0;c=0)&&Object.prototype.propertyIsEnumerable.call(u,s)&&(a[s]=u[s])}return a}var Oh="1.15.1";function fn(u){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(u)}var dn=fn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),xi=fn(/Edge/i),hf=fn(/firefox/i),pi=fn(/safari/i)&&!fn(/chrome/i)&&!fn(/android/i),wf=fn(/iP(ad|od|hone)/i),Sf=fn(/chrome/i)&&fn(/android/i),kf={capture:!1,passive:!1};function Le(u,o,a){u.addEventListener(o,a,!dn&&kf)}function Ce(u,o,a){u.removeEventListener(o,a,!dn&&kf)}function Do(u,o){if(o){if(o[0]===">"&&(o=o.substring(1)),u)try{if(u.matches)return u.matches(o);if(u.msMatchesSelector)return u.msMatchesSelector(o);if(u.webkitMatchesSelector)return u.webkitMatchesSelector(o)}catch(a){return!1}return!1}}function Ih(u){return u.host&&u!==document&&u.host.nodeType?u.host:u.parentNode}function Vt(u,o,a,s){if(u){a=a||document;do{if(o!=null&&(o[0]===">"?u.parentNode===a&&Do(u,o):Do(u,o))||s&&u===a)return u;if(u===a)break}while(u=Ih(u))}return null}var pf=/\s+/g;function Ft(u,o,a){if(u&&o)if(u.classList)u.classList[a?"add":"remove"](o);else{var s=(" "+u.className+" ").replace(pf," ").replace(" "+o+" "," ");u.className=(s+(a?" "+o:"")).replace(pf," ")}}function fe(u,o,a){var s=u&&u.style;if(s){if(a===void 0)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(u,""):u.currentStyle&&(a=u.currentStyle),o===void 0?a:a[o];!(o in s)&&o.indexOf("webkit")===-1&&(o="-webkit-"+o),s[o]=a+(typeof a=="string"?"":"px")}}function kr(u,o){var a="";if(typeof u=="string")a=u;else do{var s=fe(u,"transform");s&&s!=="none"&&(a=s+" "+a)}while(!o&&(u=u.parentNode));var c=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return c&&new c(a)}function Cf(u,o,a){if(u){var s=u.getElementsByTagName(o),c=0,p=s.length;if(a)for(;c=p:g=c<=p,!g)return s;if(s===en())break;s=Dn(s,!1)}return!1}function Cr(u,o,a,s){for(var c=0,p=0,g=u.children;p2&&arguments[2]!==void 0?arguments[2]:{},c=s.evt,p=Nh(s,_h);bi.pluginEvent.bind(ce)(o,a,tn({dragEl:Q,parentEl:Ye,ghostEl:ve,rootEl:Re,nextEl:jn,lastDownEl:ko,cloneEl:Ge,cloneHidden:Ln,dragStarted:ci,putSortable:ct,activeSortable:ce.active,originalEvent:c,oldIndex:Sr,oldDraggableIndex:mi,newIndex:Ht,newDraggableIndex:En,hideGhostForTarget:Of,unhideGhostForTarget:If,cloneNowHidden:function(){Ln=!0},cloneNowShown:function(){Ln=!1},dispatchSortableEvent:function(v){Ct({sortable:a,name:v,originalEvent:c})}},p))};function Ct(u){zh(tn({putSortable:ct,cloneEl:Ge,targetEl:Q,rootEl:Re,oldIndex:Sr,oldDraggableIndex:mi,newIndex:Ht,newDraggableIndex:En},u))}var Q,Ye,ve,Re,jn,ko,Ge,Ln,Sr,Ht,mi,En,yo,ct,wr=!1,To=!1,Mo=[],qn,Xt,Sl,kl,vf,yf,ci,br,vi,yi=!1,xo=!1,Co,gt,Cl=[],Ml=!1,Ao=[],Oo=typeof document!="undefined",bo=wf,xf=xi||dn?"cssFloat":"float",Gh=Oo&&!Sf&&!wf&&"draggable"in document.createElement("div"),Mf=function(){if(Oo){if(dn)return!1;var u=document.createElement("x");return u.style.cssText="pointer-events:auto",u.style.pointerEvents==="auto"}}(),Af=function(o,a){var s=fe(o),c=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),p=Cr(o,0,a),g=Cr(o,1,a),v=p&&fe(p),b=g&&fe(g),w=v&&parseInt(v.marginLeft)+parseInt(v.marginRight)+Ze(p).width,L=b&&parseInt(b.marginLeft)+parseInt(b.marginRight)+Ze(g).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(p&&v.float&&v.float!=="none"){var N=v.float==="left"?"left":"right";return g&&(b.clear==="both"||b.clear===N)?"vertical":"horizontal"}return p&&(v.display==="block"||v.display==="flex"||v.display==="table"||v.display==="grid"||w>=c&&s[xf]==="none"||g&&s[xf]==="none"&&w+L>c)?"vertical":"horizontal"},Uh=function(o,a,s){var c=s?o.left:o.top,p=s?o.right:o.bottom,g=s?o.width:o.height,v=s?a.left:a.top,b=s?a.right:a.bottom,w=s?a.width:a.height;return c===v||p===b||c+g/2===v+w/2},qh=function(o,a){var s;return Mo.some(function(c){var p=c[Pt].options.emptyInsertThreshold;if(!(!p||Il(c))){var g=Ze(c),v=o>=g.left-p&&o<=g.right+p,b=a>=g.top-p&&a<=g.bottom+p;if(v&&b)return s=c}}),s},Nf=function(o){function a(p,g){return function(v,b,w,L){var N=v.options.group.name&&b.options.group.name&&v.options.group.name===b.options.group.name;if(p==null&&(g||N))return!0;if(p==null||p===!1)return!1;if(g&&p==="clone")return p;if(typeof p=="function")return a(p(v,b,w,L),g)(v,b,w,L);var A=(g?v:b).options.group.name;return p===!0||typeof p=="string"&&p===A||p.join&&p.indexOf(A)>-1}}var s={},c=o.group;(!c||So(c)!="object")&&(c={name:c}),s.name=c.name,s.checkPull=a(c.pull,!0),s.checkPut=a(c.put),s.revertClone=c.revertClone,o.group=s},Of=function(){!Mf&&ve&&fe(ve,"display","none")},If=function(){!Mf&&ve&&fe(ve,"display","")};Oo&&!Sf&&document.addEventListener("click",function(u){if(To)return u.preventDefault(),u.stopPropagation&&u.stopPropagation(),u.stopImmediatePropagation&&u.stopImmediatePropagation(),To=!1,!1},!0);var Yn=function(o){if(Q){o=o.touches?o.touches[0]:o;var a=qh(o.clientX,o.clientY);if(a){var s={};for(var c in o)o.hasOwnProperty(c)&&(s[c]=o[c]);s.target=s.rootEl=a,s.preventDefault=void 0,s.stopPropagation=void 0,a[Pt]._onDragOver(s)}}},Yh=function(o){Q&&Q.parentNode[Pt]._isOutsideThisEl(o.target)};function ce(u,o){if(!(u&&u.nodeType&&u.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(u));this.el=u,this.options=o=cn({},o),u[Pt]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(u.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Af(u,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(g,v){g.setData("Text",v.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ce.supportPointer!==!1&&"PointerEvent"in window&&!pi,emptyInsertThreshold:5};bi.initializePlugins(this,u,a);for(var s in a)!(s in o)&&(o[s]=a[s]);Nf(o);for(var c in this)c.charAt(0)==="_"&&typeof this[c]=="function"&&(this[c]=this[c].bind(this));this.nativeDraggable=o.forceFallback?!1:Gh,this.nativeDraggable&&(this.options.touchStartThreshold=1),o.supportPointer?Le(u,"pointerdown",this._onTapStart):(Le(u,"mousedown",this._onTapStart),Le(u,"touchstart",this._onTapStart)),this.nativeDraggable&&(Le(u,"dragover",this),Le(u,"dragenter",this)),Mo.push(this.el),o.store&&o.store.get&&this.sort(o.store.get(this)||[]),cn(this,Bh())}ce.prototype={constructor:ce,_isOutsideThisEl:function(o){!this.el.contains(o)&&o!==this.el&&(br=null)},_getDirection:function(o,a){return typeof this.options.direction=="function"?this.options.direction.call(this,o,a,Q):this.options.direction},_onTapStart:function(o){if(o.cancelable){var a=this,s=this.el,c=this.options,p=c.preventOnFilter,g=o.type,v=o.touches&&o.touches[0]||o.pointerType&&o.pointerType==="touch"&&o,b=(v||o).target,w=o.target.shadowRoot&&(o.path&&o.path[0]||o.composedPath&&o.composedPath()[0])||b,L=c.filter;if(Vh(s),!Q&&!(/mousedown|pointerdown/.test(g)&&o.button!==0||c.disabled)&&!w.isContentEditable&&!(!this.nativeDraggable&&pi&&b&&b.tagName.toUpperCase()==="SELECT")&&(b=Vt(b,c.draggable,s,!1),!(b&&b.animated)&&ko!==b)){if(Sr=Rt(b),mi=Rt(b,c.draggable),typeof L=="function"){if(L.call(this,o,b,this)){Ct({sortable:a,rootEl:w,name:"filter",targetEl:b,toEl:s,fromEl:s}),At("filter",a,{evt:o}),p&&o.cancelable&&o.preventDefault();return}}else if(L&&(L=L.split(",").some(function(N){if(N=Vt(w,N.trim(),s,!1),N)return Ct({sortable:a,rootEl:N,name:"filter",targetEl:b,fromEl:s,toEl:s}),At("filter",a,{evt:o}),!0}),L)){p&&o.cancelable&&o.preventDefault();return}c.handle&&!Vt(w,c.handle,s,!1)||this._prepareDragStart(o,v,b)}}},_prepareDragStart:function(o,a,s){var c=this,p=c.el,g=c.options,v=p.ownerDocument,b;if(s&&!Q&&s.parentNode===p){var w=Ze(s);if(Re=p,Q=s,Ye=Q.parentNode,jn=Q.nextSibling,ko=s,yo=g.group,ce.dragged=Q,qn={target:Q,clientX:(a||o).clientX,clientY:(a||o).clientY},vf=qn.clientX-w.left,yf=qn.clientY-w.top,this._lastX=(a||o).clientX,this._lastY=(a||o).clientY,Q.style["will-change"]="all",b=function(){if(At("delayEnded",c,{evt:o}),ce.eventCanceled){c._onDrop();return}c._disableDelayedDragEvents(),!hf&&c.nativeDraggable&&(Q.draggable=!0),c._triggerDragStart(o,a),Ct({sortable:c,name:"choose",originalEvent:o}),Ft(Q,g.chosenClass,!0)},g.ignore.split(",").forEach(function(L){Cf(Q,L.trim(),El)}),Le(v,"dragover",Yn),Le(v,"mousemove",Yn),Le(v,"touchmove",Yn),Le(v,"mouseup",c._onDrop),Le(v,"touchend",c._onDrop),Le(v,"touchcancel",c._onDrop),hf&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Q.draggable=!0),At("delayStart",this,{evt:o}),g.delay&&(!g.delayOnTouchOnly||a)&&(!this.nativeDraggable||!(xi||dn))){if(ce.eventCanceled){this._onDrop();return}Le(v,"mouseup",c._disableDelayedDrag),Le(v,"touchend",c._disableDelayedDrag),Le(v,"touchcancel",c._disableDelayedDrag),Le(v,"mousemove",c._delayedDragTouchMoveHandler),Le(v,"touchmove",c._delayedDragTouchMoveHandler),g.supportPointer&&Le(v,"pointermove",c._delayedDragTouchMoveHandler),c._dragStartTimer=setTimeout(b,g.delay)}else b()}},_delayedDragTouchMoveHandler:function(o){var a=o.touches?o.touches[0]:o;Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Q&&El(Q),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var o=this.el.ownerDocument;Ce(o,"mouseup",this._disableDelayedDrag),Ce(o,"touchend",this._disableDelayedDrag),Ce(o,"touchcancel",this._disableDelayedDrag),Ce(o,"mousemove",this._delayedDragTouchMoveHandler),Ce(o,"touchmove",this._delayedDragTouchMoveHandler),Ce(o,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(o,a){a=a||o.pointerType=="touch"&&o,!this.nativeDraggable||a?this.options.supportPointer?Le(document,"pointermove",this._onTouchMove):a?Le(document,"touchmove",this._onTouchMove):Le(document,"mousemove",this._onTouchMove):(Le(Q,"dragend",this),Le(Re,"dragstart",this._onDragStart));try{document.selection?Eo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(s){}},_dragStarted:function(o,a){if(wr=!1,Re&&Q){At("dragStarted",this,{evt:a}),this.nativeDraggable&&Le(document,"dragover",Yh);var s=this.options;!o&&Ft(Q,s.dragClass,!1),Ft(Q,s.ghostClass,!0),ce.active=this,o&&this._appendGhost(),Ct({sortable:this,name:"start",originalEvent:a})}else this._nulling()},_emulateDragOver:function(){if(Xt){this._lastX=Xt.clientX,this._lastY=Xt.clientY,Of();for(var o=document.elementFromPoint(Xt.clientX,Xt.clientY),a=o;o&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(Xt.clientX,Xt.clientY),o!==a);)a=o;if(Q.parentNode[Pt]._isOutsideThisEl(o),a)do{if(a[Pt]){var s=void 0;if(s=a[Pt]._onDragOver({clientX:Xt.clientX,clientY:Xt.clientY,target:o,rootEl:a}),s&&!this.options.dragoverBubble)break}o=a}while(a=a.parentNode);If()}},_onTouchMove:function(o){if(qn){var a=this.options,s=a.fallbackTolerance,c=a.fallbackOffset,p=o.touches?o.touches[0]:o,g=ve&&kr(ve,!0),v=ve&&g&&g.a,b=ve&&g&&g.d,w=bo&>&&mf(gt),L=(p.clientX-qn.clientX+c.x)/(v||1)+(w?w[0]-Cl[0]:0)/(v||1),N=(p.clientY-qn.clientY+c.y)/(b||1)+(w?w[1]-Cl[1]:0)/(b||1);if(!ce.active&&!wr){if(s&&Math.max(Math.abs(p.clientX-this._lastX),Math.abs(p.clientY-this._lastY))=0&&(Ct({rootEl:Ye,name:"add",toEl:Ye,fromEl:Re,originalEvent:o}),Ct({sortable:this,name:"remove",toEl:Ye,originalEvent:o}),Ct({rootEl:Ye,name:"sort",toEl:Ye,fromEl:Re,originalEvent:o}),Ct({sortable:this,name:"sort",toEl:Ye,originalEvent:o})),ct&&ct.save()):Ht!==Sr&&Ht>=0&&(Ct({sortable:this,name:"update",toEl:Ye,originalEvent:o}),Ct({sortable:this,name:"sort",toEl:Ye,originalEvent:o})),ce.active&&((Ht==null||Ht===-1)&&(Ht=Sr,En=mi),Ct({sortable:this,name:"end",toEl:Ye,originalEvent:o}),this.save()))),this._nulling()},_nulling:function(){At("nulling",this),Re=Q=Ye=ve=jn=Ge=ko=Ln=qn=Xt=ci=Ht=En=Sr=mi=br=vi=ct=yo=ce.dragged=ce.ghost=ce.clone=ce.active=null,Ao.forEach(function(o){o.checked=!0}),Ao.length=Sl=kl=0},handleEvent:function(o){switch(o.type){case"drop":case"dragend":this._onDrop(o);break;case"dragenter":case"dragover":Q&&(this._onDragOver(o),jh(o));break;case"selectstart":o.preventDefault();break}},toArray:function(){for(var o=[],a,s=this.el.children,c=0,p=s.length,g=this.options;cc.right+p||u.clientY>s.bottom&&u.clientX>s.left:u.clientY>c.bottom+p||u.clientX>s.right&&u.clientY>s.top}function Qh(u,o,a,s,c,p,g,v){var b=s?u.clientY:u.clientX,w=s?a.height:a.width,L=s?a.top:a.left,N=s?a.bottom:a.right,A=!1;if(!g){if(v&&CoL+w*p/2:bN-Co)return-vi}else if(b>L+w*(1-c)/2&&bN-w*p/2)?b>L+w/2?1:-1:0}function Zh(u){return Rt(Q)b(w)),Hf.create(o,{handle:".sort-handle",forceFallback:!0});function c(w){let L=w.cloneNode(!0);g(L),b(L),w.nextSibling?w.parentNode.insertBefore(L,w.nextSibling):w.parentNode.appendChild(L)}function p(w){te(".input-array-row",w.parentNode).length>1?w.parentNode.removeChild(w):g(w)}function g(w){if(a){let N=M(".input-array-key",w);N.value="",N.removeAttribute("value")}let L=M(".input-array-value",w);L.value="",L.removeAttribute("value"),L.name=`${s}[]`}function v(w){let L=M(".input-array-key",w),N=M(".input-array-value",w);N.name=`${s}[${L.value.trim()}]`}function b(w){let L=M(".input-array-add",w),N=M(".input-array-remove",w);if(L.addEventListener("click",c.bind(L,w)),N.addEventListener("click",p.bind(N,w)),a){let A=M(".input-array-key",w),I=M(".input-array-value",w);A.addEventListener("keyup",v.bind(A,w)),I.addEventListener("keyup",v.bind(I,w))}}}};var Pl=new Map;function wi(u,o){if(Pl.has(u)){o(Pl.get(u));return}let a=new XMLHttpRequest;a.onload=function(){let s=this.status===200?this.response:"";s!==""&&Pl.set(u,s),o(s)},a.open("GET",`${Ne.config.baseUri}assets/icons/svg/${u}.svg`),a.send()}function dt(u,o,a="afterBegin"){wi(u,s=>o.insertAdjacentHTML(a,s))}var Er={};function Lr(u,o,a,s){let c;function p(){clearTimeout(c)}u.addEventListener("mousedown",function(g){let v=this;g.button!==0?p():(o.call(v,g),c=setTimeout(()=>c=setInterval(o.bind(v,g),s),a))}),u.addEventListener("mouseout",p),window.addEventListener("mouseup",p)}var Fo=class{constructor(o,a){a=Object.assign({},{weekStarts:0,format:"YYYY-MM-DD",time:!1,labels:{today:"Today",weekdays:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},months:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}},a),Er[o.id]=new Date;let c=new v(M(".calendar"),Er[o.id]);a.onChange=O=>{let q=g();q!==null&&(Er[q.id]=O,q.value=J(O))},p();function p(){let O=o.value;o.readOnly=!0,o.size=a.format.length,N(O)&&(Er[o.id]=new Date(O),o.value=J(Er[o.id])),o.addEventListener("focus",()=>{c.gotoDate(Er[o.id]),c.show()}),o.addEventListener("blur",()=>{c.hide()}),o.addEventListener("keydown",q=>{switch(q.key){case"Backspace":o.value="",o.blur();break;case"Escape":o.blur();break;case"Tab":o.blur();return}q.preventDefault()})}function g(){let O=document.activeElement;return O.matches(".input-date")?O:null}function v(O,q){let re,P,H,$,B,oe;O=O||ua(),de(q);function de(xe){re=xe.getFullYear(),P=xe.getMonth(),H=xe.getDate(),$=xe.getHours(),B=xe.getMinutes(),oe=xe.getSeconds()}function j(xe){de(xe),Pe()}function S(){return new Date(re,P,H,$,B,oe)}function R(){return O}function _(){de(new Date)}function ne(){_(),Pe()}function be(){re--}function Ie(){be(),Pe()}function mt(){re++}function C(){mt(),Pe()}function y(){H=I(P,re)}function ie(){y(),Pe()}function we(){P=w(P-1,12),P===11&&be(),H>I(P,re)&&y()}function ge(){we(),Pe()}function Je(){P=w(P+1,12),P===0&&mt(),H>I(P,re)&&y()}function st(){Je(),Pe()}function Ue(){H-=7,H<1&&(we(),H+=I(P,re))}function Ve(){Ue(),Pe()}function Oe(){H+=7,H>I(P,re)&&(H-=I(P,re),Je())}function Fe(){Oe(),Pe()}function ze(){H--,H<1&&(we(),y())}function at(){ze(),Pe()}function hn(){H++,H>I(P,re)&&(Je(),H=1)}function Nt(){hn(),Pe()}function Ot(){$=w($+1,24),$===0&&hn()}function Lt(){Ot(),Pe()}function _t(){$=w($-1,24),$===23&&ze()}function ye(){_t(),Pe()}function Dt(){B=w(B+1,60),B===0&&Ot()}function Gt(){Dt(),Pe()}function Mn(){B=w(B-1,60),B===59&&_t()}function Or(){Mn(),Pe()}function la(){oe=w(oe+1,60),oe===0&&Dt()}function Ir(){la(),Pe()}function $n(){oe=w(oe-1,60),oe===59&&Mn()}function Ti(){$n(),Pe()}function sa(){O.style.display="block",b()}function An(){O.style.display="none"}function Fr(){return getComputedStyle(O).display!=="none"}function Pe(){M(".calendar-table",O).innerHTML=xe(),Se(),a.time&&fa();function xe(){let vt=new Date(re,P,1).getDay(),pn=w(vt-a.weekStarts,7),ue=I(P,re),nn=1,ke="";ke+='',ke+=`${a.labels.months.long[P]} ${re}`,ke+="",ke+="";for(let Me=0;Me<7;Me++)ke+='',ke+=a.labels.weekdays.short[w(Me+a.weekStarts,7)],ke+="";ke+="";for(let Me=0;Me<6;Me++){for(let Be=0;Be<7;Be++)nn<=ue&&(Me>0||Be>=pn)?(nn===H?ke+='':ke+='',ke+=nn++):nn===1?(ke+='',ke+=I(w(P-1,12),re)-pn+Be+1):(ke+='',ke+=nn++-ue),ke+="";ke+=""}return ke+="",ke}function Se(){te(".calendar-day",O).forEach(vt=>{vt.addEventListener("mousedown",pn=>{pn.stopPropagation(),pn.preventDefault()}),vt.addEventListener("click",()=>{H=parseInt(vt.textContent),Pe(),a.onChange(S())})})}function fa(){M(".calendar-hours",O).innerHTML=L(V(a.format)?w($,12)||12:$,2),M(".calendar-minutes",O).innerHTML=L(B,2),M(".calendar-meridiem",O).innerHTML=V(a.format)?$<12?"AM":"PM":""}}function ua(){let xe=document.createElement("div");return xe.className="calendar",xe.innerHTML=`
`,a.time&&(xe.innerHTML+='
:
',dt("chevron-down",M(".prevHour",xe)),dt("chevron-up",M(".nextHour",xe)),dt("chevron-down",M(".prevMinute",xe)),dt("chevron-up",M(".nextMinute",xe))),dt("calendar-clock",M(".currentMonth",xe)),dt("chevron-left",M(".prevMonth",xe)),dt("chevron-right",M(".nextMonth",xe)),M(".currentMonth",xe).addEventListener("mousedown",Se=>{ne(),a.onChange(S()),Se.preventDefault()}),Lr(M(".prevMonth",xe),Se=>{ge(),a.onChange(S()),Se.preventDefault()},750,500),Lr(M(".nextMonth",xe),Se=>{st(),a.onChange(S()),Se.preventDefault()},750,500),a.time&&(Lr(M(".nextHour",xe),Se=>{Lt(),a.onChange(S()),Se.preventDefault()},750,250),Lr(M(".prevHour",xe),Se=>{ye(),a.onChange(S()),Se.preventDefault()},750,250),Lr(M(".nextMinute",xe),Se=>{Gt(),a.onChange(S()),Se.preventDefault()},750,250),Lr(M(".prevMinute",xe),Se=>{Or(),a.onChange(S()),Se.preventDefault()},750,250)),window.addEventListener("resize",go(b,100)),window.addEventListener("mousedown",Se=>{xe.style.display!=="none"&&Se.target.closest(".calendar")&&Se.preventDefault()}),window.addEventListener("keydown",Se=>{if(Fr()){switch(Se.key){case"Enter":M(".calendar-day.selected",xe).click(),An();break;case"Backspace":case"Escape":case"Tab":An();break;case"ArrowLeft":Se.ctrlKey||Se.metaKey?Se.shiftKey?Ie():ge():at(),a.onChange(S());break;case"ArrowUp":Ve(),a.onChange(S());break;case"ArrowRight":Se.ctrlKey||Se.metaKey?Se.shiftKey?C():st():Nt(),a.onChange(S());break;case"ArrowDown":Fe(),a.onChange(S());break;case"0":(Se.ctrlKey||Se.metaKey)&&ne(),a.onChange(S());break;default:return}Se.preventDefault()}}),document.body.appendChild(xe),xe}return{setDate:de,gotoDate:j,getDate:S,getElement:R,now:ne,prevYear:Ie,nextYear:C,lastDayOfMonth:ie,prevMonth:ge,nextMonth:st,prevWeek:Ve,nextWeek:Fe,prevDay:at,nextDay:Nt,nextHour:Lt,prevHour:ye,nextMinute:Gt,prevMinute:Or,nextSecond:Ir,prevSecond:Ti,show:sa,hide:An,isVisible:Fr}}function b(){let O=g();if(!O||!c.isVisible())return;let q=O.getBoundingClientRect(),re=q.top+window.scrollY,P=q.left+window.scrollX,H=c.getElement();H.style.top=`${re+O.offsetHeight}px`,H.style.left=`${P+O.offsetLeft}px`;let $=H.getBoundingClientRect(),B=$.top+window.scrollY,oe=$.left+window.scrollX,de=ho(H),j=po(H),S=document.documentElement.clientWidth,R=document.documentElement.clientHeight;oe+de>S&&(H.style.left=`${S-de}px`),(B=P.getTime()?q+1:O.getTime()>=re.getTime()?q:q-1}function Y(O){let q=q(O),re=P(new Date(q,0,4),1),P=P(O,1);return Math.round((P.getTime()-re.getTime())/6048e5)+1}function V(O){let q=O.match(/\[([^\]]*)\]|H{1,2}/);return q!==null&&q[0][0]==="H"}function J(O,q=a.format){let re=/\[([^\]]*)\]|[YR]{4}|uuu|[YR]{2}|[MD]{1,4}|[WHhms]{1,2}|[AaZz]/g;function P(H){let $=H>0?"-":"+",B=Math.floor(Math.abs(H)/60),oe=Math.abs(H)%60;return[$+L(B,2),L(oe,2)]}return q.replace(re,(H,$)=>{switch(H){case"YY":return O.getFullYear().toString().substr(-2);case"YYYY":return O.getFullYear();case"M":return O.getMonth()+1;case"MM":return L(O.getMonth()+1,2);case"MMM":return a.labels.months.short[O.getMonth()];case"MMMM":return a.labels.months.long[O.getMonth()];case"D":return O.getDate();case"DD":return L(O.getDate(),2);case"DDD":return a.labels.weekdays.short[w(O.getDay()+a.weekStarts,7)];case"DDDD":return a.labels.weekdays.long[w(O.getDay()+a.weekStarts,7)];case"W":return Y(O);case"WW":return L(Y(O),2);case"RR":return z(O).toString().substr(-2);case"RRRR":return z(O);case"H":return w(O.getHours(),12)||12;case"HH":return L(w(O.getHours(),12)||12,2);case"h":return O.getHours();case"hh":return L(O.getHours(),2);case"m":return O.getMinutes();case"mm":return L(O.getMinutes(),2);case"s":return O.getSeconds();case"ss":return L(O.getSeconds(),2);case"uuu":return L(O.getMilliseconds(),3);case"A":return O.getHours()<12?"AM":"PM";case"a":return O.getHours()<12?"am":"pm";case"Z":return P(O.getTimezoneOffset()).join(":");case"z":return P(O.getTimezoneOffset()).join("");default:return $||H}})}}};function Pf(u){let o=Number.MAX_SAFE_INTEGER,a=-o;return u>o?o:u1&&(O.step=J[q]),o.disabled&&(O.disabled=!0),v[q]=O,O.addEventListener("input",function(){for(;this.value.charAt(0)==="0"&&this.value.length>1&&!this.value.charAt(1).match(/[.,]/);)this.value=this.value.slice(1);for(;this.value>Number.MAX_SAFE_INTEGER;)this.value=this.value.slice(0,-1);I(),N(),E()}),O.addEventListener("blur",()=>{N(),A(),I(),E()}),O.addEventListener("focus",()=>p.classList.add("focused")),O.addEventListener("blur",()=>p.classList.remove("focused")),re.addEventListener("mousedown",function(H){let $=M("input",this);$&&H.target!==$&&($.focus(),H.preventDefault())});let P=document.createElement("label");P.innerHTML=a.labels[q][parseInt(O.value)===1?0:1],b[q]=P,re.appendChild(O),re.appendChild(P),p.appendChild(re)}return p.addEventListener("mousedown",function(q){q.target===this&&(O.focus(),q.preventDefault())}),p}function Y(){g=document.createElement("input"),g.className="input-duration-hidden",g.name=o.name,g.id=o.id,g.type="text",g.value=o.value,g.readOnly=!0,g.hidden=!0,o.min&&(g.min=o.min),o.max&&(g.max=o.max),o.step&&(g.step=o.step),o.required&&(g.required=!0),o.disabled&&(g.disabled=!0),"intervals"in o.dataset&&(a.intervals=o.dataset.intervals.split(", ")),"unit"in o.dataset&&(a.unit=o.dataset.unit);let V=o.value*c[a.unit],J=o.step*c[a.unit],O=z(w(V||0),w(J||1));o.parentNode.replaceChild(O,o),O.appendChild(g)}}};var Vf=uo(Xn(),1);function Bf(u,o){if(u.length!==o.length)return!1;for(let a=0;a({extend:!1,addNew:!1})}),c=M(`.editor-toolbar[data-for=${o.id}]`),p=o.parentNode.classList.contains("editor-wrap")?o.parentNode:null,g=[];s.getWrapperElement().style.height=`${a}px`,M("[data-command=bold]",c).addEventListener("click",()=>{L("**")}),M("[data-command=italic]",c).addEventListener("click",()=>{L("_")}),M("[data-command=ul]",c).addEventListener("click",()=>{L(`${w()}- `,"")}),M("[data-command=ol]",c).addEventListener("click",()=>{let E=/^\d+\./.exec(v(s.getValue()));L(E?` -${parseInt(E)+1}. `:`${w()}1. `,"")}),M("[data-command=quote]",c).addEventListener("click",()=>{L(`${w()}> `,"")}),M("[data-command=link]",c).addEventListener("click",()=>{let E=s.getSelection();/^(https?:\/\/|mailto:)/i.test(E)?L("[",`](${E})`,!0):E!==""?L(`[${E}](http://`,")",!0):L("[","](http://)")}),M("[data-command=image]",c).addEventListener("click",()=>{Ne.modals.imagesModal.show(null,E=>{let z=M(".image-picker-thumbnail.selected",E.element);z&&z.classList.remove("selected");function Y(){if(z){let V=z.dataset.filename;L(`${w()}![`,`](${V})`)}E.hide(),this.removeEventListener("click",Y)}M(".image-picker-confirm",E.element).addEventListener("click",Y)})}),M("[data-command=undo]",c).addEventListener("click",()=>{s.undo(),s.focus()}),M("[data-command=redo]",c).addEventListener("click",()=>{s.redo(),s.focus()}),s.on("changes",Cn(()=>{o.value=s.getValue(),s.historySize().undo<1?M("[data-command=undo]").disabled=!0:M("[data-command=undo]").disabled=!1,s.historySize().redo<1?M("[data-command=redo]").disabled=!0:M("[data-command=redo]").disabled=!1},500)),s.on("beforeSelectionChange",(E,z)=>{let Y=N(z.ranges);E.operation(()=>{Bf(Y,g)||(A(E,g),I(E,Y),g=Y)}),E.refresh()}),s.on("focus",()=>{p!==null&&p.classList.add("focused")}),s.on("blur",E=>{p!==null&&p.classList.remove("focused"),A(E,g),g=[]}),document.addEventListener("keydown",E=>{if(!E.altKey&&(E.ctrlKey||E.metaKey))switch(E.key){case"b":M("[data-command=bold]",c).click(),E.preventDefault();break;case"i":M("[data-command=italic]",c).click(),E.preventDefault();break;case"k":M("[data-command=link]",c).click(),E.preventDefault();break}});function v(E){let z=E.lastIndexOf(` + outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;b&&(k=i.ownerDocument.defaultView.scrollY),n.input.focus(),b&&i.ownerDocument.defaultView.scrollTo(null,k),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=D,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function T(){if(i.selectionStart!=null){var W=r.somethingSelected(),U="\u200B"+(W?i.value:"");i.value="\u21DA",i.value=U,t.prevInput=W?"":"\u200B",i.selectionStart=1,i.selectionEnd=U.length,n.selForContextMenu=r.doc.sel}}function D(){if(t.contextMenuPending==D&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=h,g&&v<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=f),i.selectionStart!=null)){(!g||g&&v<9)&&T();var W=0,U=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?tt(r,ku)(r):W++<10?n.detectingSelectAll=setTimeout(U,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(U,200)}}if(g&&v>=9&&T(),V){Hr(e);var F=function(){ke(window,"mouseup",F),setTimeout(D,20)};ue(window,"mouseup",F)}else setTimeout(D,50)},qe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qe.prototype.setUneditable=function(){},qe.prototype.needsContentAttribute=!1;function yh(e,t){if(t=t?st(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=be(we(e));t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=d.getValue()}var i;if(e.form&&(ue(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var l=e.form;i=l.submit;try{var f=l.submit=function(){n(),l.submit=i,l.submit(),l.submit=f}}catch(h){}}t.finishInit=function(h){h.save=n,h.getTextArea=function(){return e},h.toTextArea=function(){h.toTextArea=isNaN,n(),e.parentNode.removeChild(h.getWrapperElement()),e.style.display="",e.form&&(ke(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var d=He(function(h){return e.parentNode.insertBefore(h,e.nextSibling)},t);return d}function xh(e){e.off=ke,e.on=ue,e.wheelEventPixels=Ld,e.Doc=bt,e.splitLines=ga,e.countColumn=Ue,e.findColumn=Ot,e.isWordChar=Ir,e.Pass=ze,e.signal=Me,e.Line=Vn,e.changeEnd=xn,e.scrollbarModel=Vs,e.Pos=G,e.cmpPos=he,e.modes=va,e.mimeModes=Zn,e.resolveMode=Mi,e.getMode=ya,e.modeExtensions=Jn,e.extendMode=wc,e.copyState=Nn,e.startState=os,e.innerMode=xa,e.commands=oi,e.keyMap=sn,e.keyName=Ru,e.isModifierKey=Bu,e.lookupKey=dr,e.normalizeKeyMap=Kd,e.StringStream=je,e.SharedTextMarker=ni,e.TextMarker=wn,e.LineWidget=ti,e.e_preventDefault=yt,e.e_stopPropagation=rs,e.e_stop=Hr,e.addClass=Ie,e.contains=ne,e.rmClass=oe,e.keyNames=Sn}fh(He),ph(He);var bh="iter insert remove copy getEditor constructor".split(" ");for(var lo in bt.prototype)bt.prototype.hasOwnProperty(lo)&&Oe(bh,lo)<0&&(He.prototype[lo]=function(e){return function(){return e.apply(this.doc,arguments)}}(bt.prototype[lo]));return Qn(bt),He.inputStyles={textarea:qe,contenteditable:Te},He.defineMode=function(e){!He.defaults.mode&&e!="null"&&(He.defaults.mode=e),xc.apply(this,arguments)},He.defineMIME=bc,He.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),He.defineMIME("text/plain","null"),He.defineExtension=function(e,t){He.prototype[e]=t},He.defineDocExtension=function(e,t){bt.prototype[e]=t},He.fromTextArea=yh,xh(He),He.version="5.65.16",He})});var zf=yr((Wf,Rf)=>{(function(u){typeof Wf=="object"&&typeof Rf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";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},a={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};u.defineMode("xml",function(s,c){var p=s.indentUnit,g={},v=c.htmlMode?o:a;for(var b in v)g[b]=v[b];for(var b in c)g[b]=c[b];var w,L;function N(S,R){function _(Ie){return R.tokenize=Ie,Ie(S,R)}var ne=S.next();if(ne=="<")return S.eat("!")?S.eat("[")?S.match("CDATA[")?_(E("atom","]]>")):null:S.match("--")?_(E("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),_(z(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),R.tokenize=E("meta","?>"),"meta"):(w=S.eat("/")?"closeTag":"openTag",R.tokenize=A,"tag bracket");if(ne=="&"){var be;return S.eat("#")?S.eat("x")?be=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):be=S.eatWhile(/[\d]/)&&S.eat(";"):be=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),be?"atom":"error"}else return S.eatWhile(/[^&<]/),null}N.isInText=!0;function A(S,R){var _=S.next();if(_==">"||_=="/"&&S.eat(">"))return R.tokenize=N,w=_==">"?"endTag":"selfcloseTag","tag bracket";if(_=="=")return w="equals",null;if(_=="<"){R.tokenize=N,R.state=q,R.tagName=R.tagStart=null;var ne=R.tokenize(S,R);return ne?ne+" tag error":"tag error"}else return/[\'\"]/.test(_)?(R.tokenize=I(_),R.stringStartCol=S.column(),R.tokenize(S,R)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function I(S){var R=function(_,ne){for(;!_.eol();)if(_.next()==S){ne.tokenize=A;break}return"string"};return R.isInAttribute=!0,R}function E(S,R){return function(_,ne){for(;!_.eol();){if(_.match(R)){ne.tokenize=N;break}_.next()}return S}}function z(S){return function(R,_){for(var ne;(ne=R.next())!=null;){if(ne=="<")return _.tokenize=z(S+1),_.tokenize(R,_);if(ne==">")if(S==1){_.tokenize=N;break}else return _.tokenize=z(S-1),_.tokenize(R,_)}return"meta"}}function Y(S){return S&&S.toLowerCase()}function J(S,R,_){this.prev=S.context,this.tagName=R||"",this.indent=S.indented,this.startOfLine=_,(g.doNotIndent.hasOwnProperty(R)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function Z(S){S.context&&(S.context=S.context.prev)}function O(S,R){for(var _;;){if(!S.context||(_=S.context.tagName,!g.contextGrabbers.hasOwnProperty(Y(_))||!g.contextGrabbers[Y(_)].hasOwnProperty(Y(R))))return;Z(S)}}function q(S,R,_){return S=="openTag"?(_.tagStart=R.column(),re):S=="closeTag"?B:q}function re(S,R,_){return S=="word"?(_.tagName=R.current(),L="tag",P):g.allowMissingTagName&&S=="endTag"?(L="tag bracket",P(S,R,_)):(L="error",re)}function B(S,R,_){if(S=="word"){var ne=R.current();return _.context&&_.context.tagName!=ne&&g.implicitlyClosed.hasOwnProperty(Y(_.context.tagName))&&Z(_),_.context&&_.context.tagName==ne||g.matchClosing===!1?(L="tag",H):(L="tag error",V)}else return g.allowMissingTagName&&S=="endTag"?(L="tag bracket",H(S,R,_)):(L="error",V)}function H(S,R,_){return S!="endTag"?(L="error",H):(Z(_),q)}function V(S,R,_){return L="error",H(S,R,_)}function P(S,R,_){if(S=="word")return L="attribute",oe;if(S=="endTag"||S=="selfcloseTag"){var ne=_.tagName,be=_.tagStart;return _.tagName=_.tagStart=null,S=="selfcloseTag"||g.autoSelfClosers.hasOwnProperty(Y(ne))?O(_,ne):(O(_,ne),_.context=new J(_,ne,be==_.indented)),q}return L="error",P}function oe(S,R,_){return S=="equals"?ce:(g.allowMissing||(L="error"),P(S,R,_))}function ce(S,R,_){return S=="string"?j:S=="word"&&g.allowUnquoted?(L="string",P):(L="error",P(S,R,_))}function j(S,R,_){return S=="string"?j:P(S,R,_)}return{startState:function(S){var R={tokenize:N,state:q,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(R.baseIndent=S),R},token:function(S,R){if(!R.tagName&&S.sol()&&(R.indented=S.indentation()),S.eatSpace())return null;w=null;var _=R.tokenize(S,R);return(_||w)&&_!="comment"&&(L=null,R.state=R.state(w||_,S,R),L&&(_=L=="error"?_+" error":L)),_},indent:function(S,R,_){var ne=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+p;if(ne&&ne.noIndent)return u.Pass;if(S.tokenize!=A&&S.tokenize!=N)return _?_.match(/^(\s*)/)[0].length:0;if(S.tagName)return g.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+p*(g.multilineTagIndentFactor||1);if(g.alignCDATA&&/$/,blockCommentStart:"",configuration:g.htmlMode?"html":"xml",helperType:g.htmlMode?"html":"xml",skipAttribute:function(S){S.state==ce&&(S.state=P)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var R=[],_=S.context;_;_=_.prev)R.push(_.tagName);return R.reverse()}}}),u.defineMIME("text/xml","xml"),u.defineMIME("application/xml","xml"),u.mimeModes.hasOwnProperty("text/html")||u.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Uf=yr((_f,Gf)=>{(function(u){typeof _f=="object"&&typeof Gf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";u.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-1&&s.substring(g+1,s.length);if(v)return u.findModeByExtension(v)},u.findModeByName=function(s){s=s.toLowerCase();for(var c=0;c{(function(u){typeof qf=="object"&&typeof Yf=="object"?u(Xn(),zf(),Uf()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],u):u(CodeMirror)})(function(u){"use strict";u.defineMode("markdown",function(o,a){var s=u.getMode(o,"text/html"),c=s.name=="null";function p(C){if(u.findModeByName){var y=u.findModeByName(C);y&&(C=y.mime||y.mimes[0])}var ie=u.getMode(o,C);return ie.name=="null"?null:ie}a.highlightFormatting===void 0&&(a.highlightFormatting=!1),a.maxBlockquoteDepth===void 0&&(a.maxBlockquoteDepth=0),a.taskLists===void 0&&(a.taskLists=!1),a.strikethrough===void 0&&(a.strikethrough=!1),a.emoji===void 0&&(a.emoji=!1),a.fencedCodeBlockHighlighting===void 0&&(a.fencedCodeBlockHighlighting=!0),a.fencedCodeBlockDefaultMode===void 0&&(a.fencedCodeBlockDefaultMode="text/plain"),a.xml===void 0&&(a.xml=!0),a.tokenTypeOverrides===void 0&&(a.tokenTypeOverrides={});var g={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 v in g)g.hasOwnProperty(v)&&a.tokenTypeOverrides[v]&&(g[v]=a.tokenTypeOverrides[v]);var b=/^([*\-_])(?:\s*\1){2,}\s*$/,w=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,L=/^\[(x| )\](?=\s)/i,N=a.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,A=/^ {0,3}(?:\={1,}|-{2,})\s*$/,I=/^[^#!\[\]*_\\<>` "'(~:]+/,E=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,z=/^\s*\[[^\]]+?\]:.*$/,Y=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,J=" ";function Z(C,y,ie){return y.f=y.inline=ie,ie(C,y)}function O(C,y,ie){return y.f=y.block=ie,ie(C,y)}function q(C){return!C||!/\S/.test(C.string)}function re(C){if(C.linkTitle=!1,C.linkHref=!1,C.linkText=!1,C.em=!1,C.strong=!1,C.strikethrough=!1,C.quote=0,C.indentedCode=!1,C.f==H){var y=c;if(!y){var ie=u.innerMode(s,C.htmlState);y=ie.mode.name=="xml"&&ie.state.tagStart===null&&!ie.state.context&&ie.state.tokenize.isInText}y&&(C.f=ce,C.block=B,C.htmlState=null)}return C.trailingSpace=0,C.trailingSpaceNewLine=!1,C.prevLine=C.thisLine,C.thisLine={stream:null},null}function B(C,y){var ie=C.column()===y.indentation,we=q(y.prevLine.stream),ge=y.indentedCode,Je=y.prevLine.hr,st=y.list!==!1,Ue=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var Ve=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,st)){for(y.list=null;Ve=4&&(ge||y.prevLine.fencedCodeEnd||y.prevLine.header||we))return C.skipToEnd(),y.indentedCode=!0,g.code;if(C.eatSpace())return null;if(ie&&y.indentation<=Ue&&(ze=C.match(N))&&ze[1].length<=6)return y.quote=0,y.header=ze[1].length,y.thisLine.header=!0,a.highlightFormatting&&(y.formatting="header"),y.f=y.inline,P(y);if(y.indentation<=Ue&&C.eat(">"))return y.quote=ie?1:y.quote+1,a.highlightFormatting&&(y.formatting="quote"),C.eatSpace(),P(y);if(!Fe&&!y.setext&&ie&&y.indentation<=Ue&&(ze=C.match(w))){var at=ze[1]?"ol":"ul";return y.indentation=Ve+C.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,a.taskLists&&C.match(L,!1)&&(y.taskList=!0),y.f=y.inline,a.highlightFormatting&&(y.formatting=["list","list-"+at]),P(y)}else{if(ie&&y.indentation<=Ue&&(ze=C.match(E,!0)))return y.quote=0,y.fencedEndRE=new RegExp(ze[1]+"+ *$"),y.localMode=a.fencedCodeBlockHighlighting&&p(ze[2]||a.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=u.startState(y.localMode)),y.f=y.block=V,a.highlightFormatting&&(y.formatting="code-block"),y.code=-1,P(y);if(y.setext||(!Oe||!st)&&!y.quote&&y.list===!1&&!y.code&&!Fe&&!z.test(C.string)&&(ze=C.lookAhead(1))&&(ze=ze.match(A)))return y.setext?(y.header=y.setext,y.setext=0,C.skipToEnd(),a.highlightFormatting&&(y.formatting="header")):(y.header=ze[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,P(y);if(Fe)return C.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,g.hr;if(C.peek()==="[")return Z(C,y,ne)}return Z(C,y,y.inline)}function H(C,y){var ie=s.token(C,y.htmlState);if(!c){var we=u.innerMode(s,y.htmlState);(we.mode.name=="xml"&&we.state.tagStart===null&&!we.state.context&&we.state.tokenize.isInText||y.md_inside&&C.current().indexOf(">")>-1)&&(y.f=ce,y.block=B,y.htmlState=null)}return ie}function V(C,y){var ie=y.listStack[y.listStack.length-1]||0,we=y.indentation=C.quote?y.push(g.formatting+"-"+C.formatting[ie]+"-"+C.quote):y.push("error"))}if(C.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(C.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(C.linkHref?y.push(g.linkHref,"url"):(C.strong&&y.push(g.strong),C.em&&y.push(g.em),C.strikethrough&&y.push(g.strikethrough),C.emoji&&y.push(g.emoji),C.linkText&&y.push(g.linkText),C.code&&y.push(g.code),C.image&&y.push(g.image),C.imageAltText&&y.push(g.imageAltText,"link"),C.imageMarker&&y.push(g.imageMarker)),C.header&&y.push(g.header,g.header+"-"+C.header),C.quote&&(y.push(g.quote),!a.maxBlockquoteDepth||a.maxBlockquoteDepth>=C.quote?y.push(g.quote+"-"+C.quote):y.push(g.quote+"-"+a.maxBlockquoteDepth)),C.list!==!1){var we=(C.listStack.length-1)%3;we?we===1?y.push(g.list2):y.push(g.list3):y.push(g.list1)}return C.trailingSpaceNewLine?y.push("trailing-space-new-line"):C.trailingSpace&&y.push("trailing-space-"+(C.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function oe(C,y){if(C.match(I,!0))return P(y)}function ce(C,y){var ie=y.text(C,y);if(typeof ie!="undefined")return ie;if(y.list)return y.list=null,P(y);if(y.taskList){var we=C.match(L,!0)[1]===" ";return we?y.taskOpen=!0:y.taskClosed=!0,a.highlightFormatting&&(y.formatting="task"),y.taskList=!1,P(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&C.match(/^#+$/,!0))return a.highlightFormatting&&(y.formatting="header"),P(y);var ge=C.next();if(y.linkTitle){y.linkTitle=!1;var Je=ge;ge==="("&&(Je=")"),Je=(Je+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var st="^\\s*(?:[^"+Je+"\\\\]+|\\\\\\\\|\\\\.)"+Je;if(C.match(new RegExp(st),!0))return g.linkHref}if(ge==="`"){var Ue=y.formatting;a.highlightFormatting&&(y.formatting="code"),C.eatWhile("`");var Ve=C.current().length;if(y.code==0&&(!y.quote||Ve==1))return y.code=Ve,P(y);if(Ve==y.code){var Oe=P(y);return y.code=0,Oe}else return y.formatting=Ue,P(y)}else if(y.code)return P(y);if(ge==="\\"&&(C.next(),a.highlightFormatting)){var Fe=P(y),ze=g.formatting+"-escape";return Fe?Fe+" "+ze:ze}if(ge==="!"&&C.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,a.highlightFormatting&&(y.formatting="image"),P(y);if(ge==="["&&y.imageMarker&&C.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,a.highlightFormatting&&(y.formatting="image"),P(y);if(ge==="]"&&y.imageAltText){a.highlightFormatting&&(y.formatting="image");var Fe=P(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=S,Fe}if(ge==="["&&!y.image)return y.linkText&&C.match(/^.*?\]/)||(y.linkText=!0,a.highlightFormatting&&(y.formatting="link")),P(y);if(ge==="]"&&y.linkText){a.highlightFormatting&&(y.formatting="link");var Fe=P(y);return y.linkText=!1,y.inline=y.f=C.match(/\(.*?\)| ?\[.*?\]/,!1)?S:ce,Fe}if(ge==="<"&&C.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=j,a.highlightFormatting&&(y.formatting="link");var Fe=P(y);return Fe?Fe+=" ":Fe="",Fe+g.linkInline}if(ge==="<"&&C.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=j,a.highlightFormatting&&(y.formatting="link");var Fe=P(y);return Fe?Fe+=" ":Fe="",Fe+g.linkEmail}if(a.xml&&ge==="<"&&C.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var at=C.string.indexOf(">",C.pos);if(at!=-1){var hn=C.string.substring(C.start,at);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(hn)&&(y.md_inside=!0)}return C.backUp(1),y.htmlState=u.startState(s),O(C,y,H)}if(a.xml&&ge==="<"&&C.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(ge==="*"||ge==="_"){for(var Nt=1,Ot=C.pos==1?" ":C.string.charAt(C.pos-2);Nt<3&&C.eat(ge);)Nt++;var Lt=C.peek()||" ",_t=!/\s/.test(Lt)&&(!Y.test(Lt)||/\s/.test(Ot)||Y.test(Ot)),ye=!/\s/.test(Ot)&&(!Y.test(Ot)||/\s/.test(Lt)||Y.test(Lt)),Dt=null,Gt=null;if(Nt%2&&(!y.em&&_t&&(ge==="*"||!ye||Y.test(Ot))?Dt=!0:y.em==ge&&ye&&(ge==="*"||!_t||Y.test(Lt))&&(Dt=!1)),Nt>1&&(!y.strong&&_t&&(ge==="*"||!ye||Y.test(Ot))?Gt=!0:y.strong==ge&&ye&&(ge==="*"||!_t||Y.test(Lt))&&(Gt=!1)),Gt!=null||Dt!=null){a.highlightFormatting&&(y.formatting=Dt==null?"strong":Gt==null?"em":"strong em"),Dt===!0&&(y.em=ge),Gt===!0&&(y.strong=ge);var Oe=P(y);return Dt===!1&&(y.em=!1),Gt===!1&&(y.strong=!1),Oe}}else if(ge===" "&&(C.eat("*")||C.eat("_"))){if(C.peek()===" ")return P(y);C.backUp(1)}if(a.strikethrough){if(ge==="~"&&C.eatWhile(ge)){if(y.strikethrough){a.highlightFormatting&&(y.formatting="strikethrough");var Oe=P(y);return y.strikethrough=!1,Oe}else if(C.match(/^[^\s]/,!1))return y.strikethrough=!0,a.highlightFormatting&&(y.formatting="strikethrough"),P(y)}else if(ge===" "&&C.match("~~",!0)){if(C.peek()===" ")return P(y);C.backUp(2)}}if(a.emoji&&ge===":"&&C.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,a.highlightFormatting&&(y.formatting="emoji");var Mn=P(y);return y.emoji=!1,Mn}return ge===" "&&(C.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),P(y)}function j(C,y){var ie=C.next();if(ie===">"){y.f=y.inline=ce,a.highlightFormatting&&(y.formatting="link");var we=P(y);return we?we+=" ":we="",we+g.linkInline}return C.match(/^[^>]+/,!0),g.linkInline}function S(C,y){if(C.eatSpace())return null;var ie=C.next();return ie==="("||ie==="["?(y.f=y.inline=_(ie==="("?")":"]"),a.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,P(y)):"error"}var R={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(C){return function(y,ie){var we=y.next();if(we===C){ie.f=ie.inline=ce,a.highlightFormatting&&(ie.formatting="link-string");var ge=P(ie);return ie.linkHref=!1,ge}return y.match(R[C]),ie.linkHref=!0,P(ie)}}function ne(C,y){return C.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=be,C.next(),a.highlightFormatting&&(y.formatting="link"),y.linkText=!0,P(y)):Z(C,y,ce)}function be(C,y){if(C.match("]:",!0)){y.f=y.inline=Ie,a.highlightFormatting&&(y.formatting="link");var ie=P(y);return y.linkText=!1,ie}return C.match(/^([^\]\\]|\\.)+/,!0),g.linkText}function Ie(C,y){return C.eatSpace()?null:(C.match(/^[^\s]+/,!0),C.peek()===void 0?y.linkTitle=!0:C.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),y.f=y.inline=ce,g.linkHref+" url")}var mt={startState:function(){return{f:B,prevLine:{stream:null},thisLine:{stream:null},block:B,htmlState:null,indentation:0,inline:ce,text:oe,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(C){return{f:C.f,prevLine:C.prevLine,thisLine:C.thisLine,block:C.block,htmlState:C.htmlState&&u.copyState(s,C.htmlState),indentation:C.indentation,localMode:C.localMode,localState:C.localMode?u.copyState(C.localMode,C.localState):null,inline:C.inline,text:C.text,formatting:!1,linkText:C.linkText,linkTitle:C.linkTitle,linkHref:C.linkHref,code:C.code,em:C.em,strong:C.strong,strikethrough:C.strikethrough,emoji:C.emoji,header:C.header,setext:C.setext,hr:C.hr,taskList:C.taskList,list:C.list,listStack:C.listStack.slice(0),quote:C.quote,indentedCode:C.indentedCode,trailingSpace:C.trailingSpace,trailingSpaceNewLine:C.trailingSpaceNewLine,md_inside:C.md_inside,fencedEndRE:C.fencedEndRE}},token:function(C,y){if(y.formatting=!1,C!=y.thisLine.stream){if(y.header=0,y.hr=!1,C.match(/^\s*$/,!0))return re(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:C},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=H)){var ie=C.match(/^\s*/,!0)[0].replace(/\t/g,J).length;if(y.indentation=ie,y.indentationDiff=null,ie>0)return null}}return y.f(C,y)},innerMode:function(C){return C.block==H?{state:C.htmlState,mode:s}:C.localState?{state:C.localState,mode:C.localMode}:{state:C,mode:mt}},indent:function(C,y,ie){return C.block==H&&s.indent?s.indent(C.htmlState,y,ie):C.localState&&C.localMode.indent?C.localMode.indent(C.localState,y,ie):u.Pass},blankLine:re,getType:P,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return mt},"xml"),u.defineMIME("text/markdown","markdown"),u.defineMIME("text/x-markdown","markdown")})});var $f=yr((Xf,Kf)=>{(function(u){typeof Xf=="object"&&typeof Kf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){u.defineOption("placeholder","",function(v,b,w){var L=w&&w!=u.Init;if(b&&!L)v.on("blur",c),v.on("change",p),v.on("swapDoc",p),u.on(v.getInputField(),"compositionupdate",v.state.placeholderCompose=function(){s(v)}),p(v);else if(!b&&L){v.off("blur",c),v.off("change",p),v.off("swapDoc",p),u.off(v.getInputField(),"compositionupdate",v.state.placeholderCompose),o(v);var N=v.getWrapperElement();N.className=N.className.replace(" CodeMirror-empty","")}b&&!v.hasFocus()&&c(v)});function o(v){v.state.placeholder&&(v.state.placeholder.parentNode.removeChild(v.state.placeholder),v.state.placeholder=null)}function a(v){o(v);var b=v.state.placeholder=document.createElement("pre");b.style.cssText="height: 0; overflow: visible",b.style.direction=v.getOption("direction"),b.className="CodeMirror-placeholder CodeMirror-line-like";var w=v.getOption("placeholder");typeof w=="string"&&(w=document.createTextNode(w)),b.appendChild(w),v.display.lineSpace.insertBefore(b,v.display.lineSpace.firstChild)}function s(v){setTimeout(function(){var b=!1;if(v.lineCount()==1){var w=v.getInputField();b=w.nodeName=="TEXTAREA"?!v.getLine(0).length:!/[^\u200b]/.test(w.querySelector(".CodeMirror-line").textContent)}b?a(v):o(v)},20)}function c(v){g(v)&&a(v)}function p(v){var b=v.getWrapperElement(),w=g(v);b.className=b.className.replace(" CodeMirror-empty","")+(w?" CodeMirror-empty":""),w?a(v):o(v)}function g(v){return v.lineCount()===1&&v.getLine(0)===""}})});var Jf=yr((Qf,Zf)=>{(function(u){typeof Qf=="object"&&typeof Zf=="object"?u(Xn()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],u):u(CodeMirror)})(function(u){"use strict";var o=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,a=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,s=/[*+-]\s/;u.commands.newlineAndIndentContinueMarkdownList=function(p){if(p.getOption("disableInput"))return u.Pass;for(var g=p.listSelections(),v=[],b=0;b\s*$/.test(E),Z=!/>\s*$/.test(E);(J||Z)&&p.replaceRange("",{line:w.line,ch:0},{line:w.line,ch:w.ch+1}),v[b]=` +`}else{var O=z[1],q=z[5],re=!(s.test(z[2])||z[2].indexOf(">")>=0),B=re?parseInt(z[3],10)+1+z[4]:z[2].replace("x"," ");v[b]=` +`+O+B+q,re&&c(p,w)}}p.replaceSelections(v)};function c(p,g){var v=g.line,b=0,w=0,L=o.exec(p.getLine(v)),N=L[1];do{b+=1;var A=v+b,I=p.getLine(A),E=o.exec(I);if(E){var z=E[1],Y=parseInt(L[3],10)+b-w,J=parseInt(E[3],10),Z=J;if(N===z&&!isNaN(J))Y===J&&(Z=J+1),Y>J&&(Z=Y+1),p.replaceRange(I.replace(o,z+Z+E[4]+E[5]),{line:A,ch:0},{line:A,ch:I.length});else{if(N.length>z.length||N.lengthNe});function uf(){let u=[],o=document.cookie.split(";");for(let a of o){let s=a.split("=",2);s.length===2&&(u[s[0].trim()]=decodeURIComponent(s[1].trim()))}return u}function ff(u,o,a){let s=`${u}=${o}`;for(let c in a)s+=`;${c}=${a[c]}`;document.cookie=s}var co=class{constructor(){let o=()=>{let a=uf(),s="formwork_preferred_color_scheme",c=s in a?a[s]:null,p=null;window.matchMedia("(prefers-color-scheme: light)").matches?p="light":window.matchMedia("(prefers-color-scheme: dark)").matches&&(p="dark"),p!==c&&ff(s,p,{"max-age":2592e3,path:Ne.config.baseUri,samesite:"strict"})};window.addEventListener("beforeunload",o),window.addEventListener("pagehide",o)}};function M(u,o=document){return o.querySelector(u)}function te(u,o=document){return o.querySelectorAll(u)}function ho(u){let o=getComputedStyle(u);return u.offsetWidth+parseInt(o.marginLeft)+parseInt(o.marginRight)}function po(u){let o=getComputedStyle(u);return u.offsetHeight+parseInt(o.marginTop)+parseInt(o.marginBottom)}function Cn(u,o,a){let s,c=null;function p(){let g=this,v=arguments;return c&&clearTimeout(c),a&&!c&&(s=u.apply(g,v)),c=setTimeout(()=>{a||(s=u.apply(g,v)),c=null},o),s}return p}function go(u,o){let a,s=0,c=null;function p(){let g=Date.now();s===0&&(s=g);let v=s+o-g,b=this,w=arguments;return v<=0||v>o?(c&&(clearTimeout(c),c=null),s=g,a=u.apply(b,w)):c||(c=setTimeout(()=>{s=Date.now(),a=u.apply(b,w),c=null},v)),a}return p}var mo=class{constructor(){M(".dropdown")&&document.addEventListener("click",o=>{te(".dropdown-menu").forEach(s=>s.style.display="");let a=o.target.closest(".dropdown-button");if(a){let s=document.getElementById(a.dataset.dropdown),c=getComputedStyle(s).display!=="none";o.preventDefault();let p=go(()=>cf(s),100);s&&!c?(s.style.display="block",cf(s),window.addEventListener("resize",p)):window.removeEventListener("resize",p)}})}};function cf(u){u.style.left=0,u.style.right="";let o=u.getBoundingClientRect(),a=o.top+window.scrollY,s=o.left+window.scrollX,c=ho(u),p=po(u),g=document.documentElement.clientWidth,v=document.documentElement.clientHeight;s+c>g&&(u.style.left="auto",u.style.right=0),(a{let a=M(".input-togglegroup",o),s=window.localStorage.getItem("formwork.filesListViewAs");s&&(te("input",a).forEach(c=>c.checked=!1),M(`input[value=${s}]`,o).checked=!0,o.classList.toggle("is-thumbnails",s==="thumbnails")),te("input",a).forEach(c=>{c.addEventListener("input",()=>{o.classList.toggle("is-thumbnails",c.value==="thumbnails"),window.localStorage.setItem("formwork.filesListViewAs",c.value)})})})}};"requestSubmit"in window.HTMLFormElement.prototype||(window.HTMLFormElement.prototype.requestSubmit=function(u){u?(u instanceof HTMLElement||o(TypeError,"parameter 1 is not of type 'HTMLElement'"),u.type!=="submit"&&o(TypeError,"The specified element is not a submit button"),u.form!==this&&o(DOMException,"The specified element is not owned by this form element","NotFoundError"),u.click()):(u=document.createElement("input"),u.type="submit",u.hidden=!0,this.appendChild(u),u.click(),this.removeChild(u));function o(a,s,c){throw new a(`Failed to execute 'requestSubmit' on 'HTMLFormElement': ${s}.`,c)}});function df(u,o){var a=Object.keys(u);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(u);o&&(s=s.filter(function(c){return Object.getOwnPropertyDescriptor(u,c).enumerable})),a.push.apply(a,s)}return a}function tn(u){for(var o=1;o=0)&&(a[c]=u[c]);return a}function Nh(u,o){if(u==null)return{};var a=Ah(u,o),s,c;if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(u);for(c=0;c=0)&&Object.prototype.propertyIsEnumerable.call(u,s)&&(a[s]=u[s])}return a}var Oh="1.15.1";function fn(u){if(typeof window!="undefined"&&window.navigator)return!!navigator.userAgent.match(u)}var dn=fn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),xi=fn(/Edge/i),hf=fn(/firefox/i),pi=fn(/safari/i)&&!fn(/chrome/i)&&!fn(/android/i),wf=fn(/iP(ad|od|hone)/i),Sf=fn(/chrome/i)&&fn(/android/i),kf={capture:!1,passive:!1};function Le(u,o,a){u.addEventListener(o,a,!dn&&kf)}function Ce(u,o,a){u.removeEventListener(o,a,!dn&&kf)}function Do(u,o){if(o){if(o[0]===">"&&(o=o.substring(1)),u)try{if(u.matches)return u.matches(o);if(u.msMatchesSelector)return u.msMatchesSelector(o);if(u.webkitMatchesSelector)return u.webkitMatchesSelector(o)}catch(a){return!1}return!1}}function Ih(u){return u.host&&u!==document&&u.host.nodeType?u.host:u.parentNode}function Vt(u,o,a,s){if(u){a=a||document;do{if(o!=null&&(o[0]===">"?u.parentNode===a&&Do(u,o):Do(u,o))||s&&u===a)return u;if(u===a)break}while(u=Ih(u))}return null}var pf=/\s+/g;function Ft(u,o,a){if(u&&o)if(u.classList)u.classList[a?"add":"remove"](o);else{var s=(" "+u.className+" ").replace(pf," ").replace(" "+o+" "," ");u.className=(s+(a?" "+o:"")).replace(pf," ")}}function fe(u,o,a){var s=u&&u.style;if(s){if(a===void 0)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(u,""):u.currentStyle&&(a=u.currentStyle),o===void 0?a:a[o];!(o in s)&&o.indexOf("webkit")===-1&&(o="-webkit-"+o),s[o]=a+(typeof a=="string"?"":"px")}}function kr(u,o){var a="";if(typeof u=="string")a=u;else do{var s=fe(u,"transform");s&&s!=="none"&&(a=s+" "+a)}while(!o&&(u=u.parentNode));var c=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return c&&new c(a)}function Cf(u,o,a){if(u){var s=u.getElementsByTagName(o),c=0,p=s.length;if(a)for(;c=p:g=c<=p,!g)return s;if(s===en())break;s=Dn(s,!1)}return!1}function Cr(u,o,a,s){for(var c=0,p=0,g=u.children;p2&&arguments[2]!==void 0?arguments[2]:{},c=s.evt,p=Nh(s,_h);bi.pluginEvent.bind(de)(o,a,tn({dragEl:$,parentEl:Ye,ghostEl:ve,rootEl:Re,nextEl:jn,lastDownEl:ko,cloneEl:Ge,cloneHidden:Ln,dragStarted:ci,putSortable:ct,activeSortable:de.active,originalEvent:c,oldIndex:Sr,oldDraggableIndex:mi,newIndex:Ht,newDraggableIndex:En,hideGhostForTarget:Of,unhideGhostForTarget:If,cloneNowHidden:function(){Ln=!0},cloneNowShown:function(){Ln=!1},dispatchSortableEvent:function(v){Ct({sortable:a,name:v,originalEvent:c})}},p))};function Ct(u){zh(tn({putSortable:ct,cloneEl:Ge,targetEl:$,rootEl:Re,oldIndex:Sr,oldDraggableIndex:mi,newIndex:Ht,newDraggableIndex:En},u))}var $,Ye,ve,Re,jn,ko,Ge,Ln,Sr,Ht,mi,En,yo,ct,wr=!1,To=!1,Mo=[],qn,Xt,Sl,kl,vf,yf,ci,br,vi,yi=!1,xo=!1,Co,gt,Cl=[],Ml=!1,Ao=[],Oo=typeof document!="undefined",bo=wf,xf=xi||dn?"cssFloat":"float",Gh=Oo&&!Sf&&!wf&&"draggable"in document.createElement("div"),Mf=function(){if(Oo){if(dn)return!1;var u=document.createElement("x");return u.style.cssText="pointer-events:auto",u.style.pointerEvents==="auto"}}(),Af=function(o,a){var s=fe(o),c=parseInt(s.width)-parseInt(s.paddingLeft)-parseInt(s.paddingRight)-parseInt(s.borderLeftWidth)-parseInt(s.borderRightWidth),p=Cr(o,0,a),g=Cr(o,1,a),v=p&&fe(p),b=g&&fe(g),w=v&&parseInt(v.marginLeft)+parseInt(v.marginRight)+Ze(p).width,L=b&&parseInt(b.marginLeft)+parseInt(b.marginRight)+Ze(g).width;if(s.display==="flex")return s.flexDirection==="column"||s.flexDirection==="column-reverse"?"vertical":"horizontal";if(s.display==="grid")return s.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(p&&v.float&&v.float!=="none"){var N=v.float==="left"?"left":"right";return g&&(b.clear==="both"||b.clear===N)?"vertical":"horizontal"}return p&&(v.display==="block"||v.display==="flex"||v.display==="table"||v.display==="grid"||w>=c&&s[xf]==="none"||g&&s[xf]==="none"&&w+L>c)?"vertical":"horizontal"},Uh=function(o,a,s){var c=s?o.left:o.top,p=s?o.right:o.bottom,g=s?o.width:o.height,v=s?a.left:a.top,b=s?a.right:a.bottom,w=s?a.width:a.height;return c===v||p===b||c+g/2===v+w/2},qh=function(o,a){var s;return Mo.some(function(c){var p=c[Pt].options.emptyInsertThreshold;if(!(!p||Il(c))){var g=Ze(c),v=o>=g.left-p&&o<=g.right+p,b=a>=g.top-p&&a<=g.bottom+p;if(v&&b)return s=c}}),s},Nf=function(o){function a(p,g){return function(v,b,w,L){var N=v.options.group.name&&b.options.group.name&&v.options.group.name===b.options.group.name;if(p==null&&(g||N))return!0;if(p==null||p===!1)return!1;if(g&&p==="clone")return p;if(typeof p=="function")return a(p(v,b,w,L),g)(v,b,w,L);var A=(g?v:b).options.group.name;return p===!0||typeof p=="string"&&p===A||p.join&&p.indexOf(A)>-1}}var s={},c=o.group;(!c||So(c)!="object")&&(c={name:c}),s.name=c.name,s.checkPull=a(c.pull,!0),s.checkPut=a(c.put),s.revertClone=c.revertClone,o.group=s},Of=function(){!Mf&&ve&&fe(ve,"display","none")},If=function(){!Mf&&ve&&fe(ve,"display","")};Oo&&!Sf&&document.addEventListener("click",function(u){if(To)return u.preventDefault(),u.stopPropagation&&u.stopPropagation(),u.stopImmediatePropagation&&u.stopImmediatePropagation(),To=!1,!1},!0);var Yn=function(o){if($){o=o.touches?o.touches[0]:o;var a=qh(o.clientX,o.clientY);if(a){var s={};for(var c in o)o.hasOwnProperty(c)&&(s[c]=o[c]);s.target=s.rootEl=a,s.preventDefault=void 0,s.stopPropagation=void 0,a[Pt]._onDragOver(s)}}},Yh=function(o){$&&$.parentNode[Pt]._isOutsideThisEl(o.target)};function de(u,o){if(!(u&&u.nodeType&&u.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(u));this.el=u,this.options=o=cn({},o),u[Pt]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(u.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Af(u,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(g,v){g.setData("Text",v.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:de.supportPointer!==!1&&"PointerEvent"in window&&!pi,emptyInsertThreshold:5};bi.initializePlugins(this,u,a);for(var s in a)!(s in o)&&(o[s]=a[s]);Nf(o);for(var c in this)c.charAt(0)==="_"&&typeof this[c]=="function"&&(this[c]=this[c].bind(this));this.nativeDraggable=o.forceFallback?!1:Gh,this.nativeDraggable&&(this.options.touchStartThreshold=1),o.supportPointer?Le(u,"pointerdown",this._onTapStart):(Le(u,"mousedown",this._onTapStart),Le(u,"touchstart",this._onTapStart)),this.nativeDraggable&&(Le(u,"dragover",this),Le(u,"dragenter",this)),Mo.push(this.el),o.store&&o.store.get&&this.sort(o.store.get(this)||[]),cn(this,Bh())}de.prototype={constructor:de,_isOutsideThisEl:function(o){!this.el.contains(o)&&o!==this.el&&(br=null)},_getDirection:function(o,a){return typeof this.options.direction=="function"?this.options.direction.call(this,o,a,$):this.options.direction},_onTapStart:function(o){if(o.cancelable){var a=this,s=this.el,c=this.options,p=c.preventOnFilter,g=o.type,v=o.touches&&o.touches[0]||o.pointerType&&o.pointerType==="touch"&&o,b=(v||o).target,w=o.target.shadowRoot&&(o.path&&o.path[0]||o.composedPath&&o.composedPath()[0])||b,L=c.filter;if(Vh(s),!$&&!(/mousedown|pointerdown/.test(g)&&o.button!==0||c.disabled)&&!w.isContentEditable&&!(!this.nativeDraggable&&pi&&b&&b.tagName.toUpperCase()==="SELECT")&&(b=Vt(b,c.draggable,s,!1),!(b&&b.animated)&&ko!==b)){if(Sr=Rt(b),mi=Rt(b,c.draggable),typeof L=="function"){if(L.call(this,o,b,this)){Ct({sortable:a,rootEl:w,name:"filter",targetEl:b,toEl:s,fromEl:s}),At("filter",a,{evt:o}),p&&o.cancelable&&o.preventDefault();return}}else if(L&&(L=L.split(",").some(function(N){if(N=Vt(w,N.trim(),s,!1),N)return Ct({sortable:a,rootEl:N,name:"filter",targetEl:b,fromEl:s,toEl:s}),At("filter",a,{evt:o}),!0}),L)){p&&o.cancelable&&o.preventDefault();return}c.handle&&!Vt(w,c.handle,s,!1)||this._prepareDragStart(o,v,b)}}},_prepareDragStart:function(o,a,s){var c=this,p=c.el,g=c.options,v=p.ownerDocument,b;if(s&&!$&&s.parentNode===p){var w=Ze(s);if(Re=p,$=s,Ye=$.parentNode,jn=$.nextSibling,ko=s,yo=g.group,de.dragged=$,qn={target:$,clientX:(a||o).clientX,clientY:(a||o).clientY},vf=qn.clientX-w.left,yf=qn.clientY-w.top,this._lastX=(a||o).clientX,this._lastY=(a||o).clientY,$.style["will-change"]="all",b=function(){if(At("delayEnded",c,{evt:o}),de.eventCanceled){c._onDrop();return}c._disableDelayedDragEvents(),!hf&&c.nativeDraggable&&($.draggable=!0),c._triggerDragStart(o,a),Ct({sortable:c,name:"choose",originalEvent:o}),Ft($,g.chosenClass,!0)},g.ignore.split(",").forEach(function(L){Cf($,L.trim(),El)}),Le(v,"dragover",Yn),Le(v,"mousemove",Yn),Le(v,"touchmove",Yn),Le(v,"mouseup",c._onDrop),Le(v,"touchend",c._onDrop),Le(v,"touchcancel",c._onDrop),hf&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$.draggable=!0),At("delayStart",this,{evt:o}),g.delay&&(!g.delayOnTouchOnly||a)&&(!this.nativeDraggable||!(xi||dn))){if(de.eventCanceled){this._onDrop();return}Le(v,"mouseup",c._disableDelayedDrag),Le(v,"touchend",c._disableDelayedDrag),Le(v,"touchcancel",c._disableDelayedDrag),Le(v,"mousemove",c._delayedDragTouchMoveHandler),Le(v,"touchmove",c._delayedDragTouchMoveHandler),g.supportPointer&&Le(v,"pointermove",c._delayedDragTouchMoveHandler),c._dragStartTimer=setTimeout(b,g.delay)}else b()}},_delayedDragTouchMoveHandler:function(o){var a=o.touches?o.touches[0]:o;Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$&&El($),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var o=this.el.ownerDocument;Ce(o,"mouseup",this._disableDelayedDrag),Ce(o,"touchend",this._disableDelayedDrag),Ce(o,"touchcancel",this._disableDelayedDrag),Ce(o,"mousemove",this._delayedDragTouchMoveHandler),Ce(o,"touchmove",this._delayedDragTouchMoveHandler),Ce(o,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(o,a){a=a||o.pointerType=="touch"&&o,!this.nativeDraggable||a?this.options.supportPointer?Le(document,"pointermove",this._onTouchMove):a?Le(document,"touchmove",this._onTouchMove):Le(document,"mousemove",this._onTouchMove):(Le($,"dragend",this),Le(Re,"dragstart",this._onDragStart));try{document.selection?Eo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(s){}},_dragStarted:function(o,a){if(wr=!1,Re&&$){At("dragStarted",this,{evt:a}),this.nativeDraggable&&Le(document,"dragover",Yh);var s=this.options;!o&&Ft($,s.dragClass,!1),Ft($,s.ghostClass,!0),de.active=this,o&&this._appendGhost(),Ct({sortable:this,name:"start",originalEvent:a})}else this._nulling()},_emulateDragOver:function(){if(Xt){this._lastX=Xt.clientX,this._lastY=Xt.clientY,Of();for(var o=document.elementFromPoint(Xt.clientX,Xt.clientY),a=o;o&&o.shadowRoot&&(o=o.shadowRoot.elementFromPoint(Xt.clientX,Xt.clientY),o!==a);)a=o;if($.parentNode[Pt]._isOutsideThisEl(o),a)do{if(a[Pt]){var s=void 0;if(s=a[Pt]._onDragOver({clientX:Xt.clientX,clientY:Xt.clientY,target:o,rootEl:a}),s&&!this.options.dragoverBubble)break}o=a}while(a=a.parentNode);If()}},_onTouchMove:function(o){if(qn){var a=this.options,s=a.fallbackTolerance,c=a.fallbackOffset,p=o.touches?o.touches[0]:o,g=ve&&kr(ve,!0),v=ve&&g&&g.a,b=ve&&g&&g.d,w=bo&>&&mf(gt),L=(p.clientX-qn.clientX+c.x)/(v||1)+(w?w[0]-Cl[0]:0)/(v||1),N=(p.clientY-qn.clientY+c.y)/(b||1)+(w?w[1]-Cl[1]:0)/(b||1);if(!de.active&&!wr){if(s&&Math.max(Math.abs(p.clientX-this._lastX),Math.abs(p.clientY-this._lastY))=0&&(Ct({rootEl:Ye,name:"add",toEl:Ye,fromEl:Re,originalEvent:o}),Ct({sortable:this,name:"remove",toEl:Ye,originalEvent:o}),Ct({rootEl:Ye,name:"sort",toEl:Ye,fromEl:Re,originalEvent:o}),Ct({sortable:this,name:"sort",toEl:Ye,originalEvent:o})),ct&&ct.save()):Ht!==Sr&&Ht>=0&&(Ct({sortable:this,name:"update",toEl:Ye,originalEvent:o}),Ct({sortable:this,name:"sort",toEl:Ye,originalEvent:o})),de.active&&((Ht==null||Ht===-1)&&(Ht=Sr,En=mi),Ct({sortable:this,name:"end",toEl:Ye,originalEvent:o}),this.save()))),this._nulling()},_nulling:function(){At("nulling",this),Re=$=Ye=ve=jn=Ge=ko=Ln=qn=Xt=ci=Ht=En=Sr=mi=br=vi=ct=yo=de.dragged=de.ghost=de.clone=de.active=null,Ao.forEach(function(o){o.checked=!0}),Ao.length=Sl=kl=0},handleEvent:function(o){switch(o.type){case"drop":case"dragend":this._onDrop(o);break;case"dragenter":case"dragover":$&&(this._onDragOver(o),jh(o));break;case"selectstart":o.preventDefault();break}},toArray:function(){for(var o=[],a,s=this.el.children,c=0,p=s.length,g=this.options;cc.right+p||u.clientY>s.bottom&&u.clientX>s.left:u.clientY>c.bottom+p||u.clientX>s.right&&u.clientY>s.top}function Qh(u,o,a,s,c,p,g,v){var b=s?u.clientY:u.clientX,w=s?a.height:a.width,L=s?a.top:a.left,N=s?a.bottom:a.right,A=!1;if(!g){if(v&&CoL+w*p/2:bN-Co)return-vi}else if(b>L+w*(1-c)/2&&bN-w*p/2)?b>L+w/2?1:-1:0}function Zh(u){return Rt($)b(w)),Hf.create(o,{handle:".sort-handle",forceFallback:!0});function c(w){let L=w.cloneNode(!0);g(L),b(L),w.nextSibling?w.parentNode.insertBefore(L,w.nextSibling):w.parentNode.appendChild(L)}function p(w){te(".input-array-row",w.parentNode).length>1?w.parentNode.removeChild(w):g(w)}function g(w){if(a){let N=M(".input-array-key",w);N.value="",N.removeAttribute("value")}let L=M(".input-array-value",w);L.value="",L.removeAttribute("value"),L.name=`${s}[]`}function v(w){let L=M(".input-array-key",w),N=M(".input-array-value",w);N.name=`${s}[${L.value.trim()}]`}function b(w){let L=M(".input-array-add",w),N=M(".input-array-remove",w);if(L.addEventListener("click",c.bind(L,w)),N.addEventListener("click",p.bind(N,w)),a){let A=M(".input-array-key",w),I=M(".input-array-value",w);A.addEventListener("keyup",v.bind(A,w)),I.addEventListener("keyup",v.bind(I,w))}}}};var Pl=new Map;function wi(u,o){if(Pl.has(u)){o(Pl.get(u));return}let a=new XMLHttpRequest;a.onload=function(){let s=this.status===200?this.response:"";s!==""&&Pl.set(u,s),o(s)},a.open("GET",`${Ne.config.baseUri}assets/icons/svg/${u}.svg`),a.send()}function dt(u,o,a="afterBegin"){wi(u,s=>o.insertAdjacentHTML(a,s))}var Er={};function Lr(u,o,a,s){let c;function p(){clearTimeout(c)}u.addEventListener("mousedown",function(g){let v=this;g.button!==0?p():(o.call(v,g),c=setTimeout(()=>c=setInterval(o.bind(v,g),s),a))}),u.addEventListener("mouseout",p),window.addEventListener("mouseup",p)}var Fo=class{constructor(o,a){a=Object.assign({},{weekStarts:0,format:"YYYY-MM-DD",time:!1,labels:{today:"Today",weekdays:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},months:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}}},a),Er[o.id]=new Date;let c=new v(M(".calendar"),Er[o.id]);a.onChange=O=>{let q=g();q!==null&&(Er[q.id]=O,q.value=Z(O))},p();function p(){let O=o.value;o.readOnly=!0,o.size=a.format.length,N(O)&&(Er[o.id]=new Date(O),o.value=Z(Er[o.id])),o.addEventListener("focus",()=>{c.gotoDate(Er[o.id]),c.show()}),o.addEventListener("blur",()=>{c.hide()}),o.addEventListener("keydown",q=>{switch(q.key){case"Backspace":o.value="",o.blur();break;case"Escape":o.blur();break;case"Tab":o.blur();return}q.preventDefault()})}function g(){let O=document.activeElement;return O.matches(".input-date")?O:null}function v(O,q){let re,B,H,V,P,oe;O=O||ua(),ce(q);function ce(xe){re=xe.getFullYear(),B=xe.getMonth(),H=xe.getDate(),V=xe.getHours(),P=xe.getMinutes(),oe=xe.getSeconds()}function j(xe){ce(xe),Pe()}function S(){return new Date(re,B,H,V,P,oe)}function R(){return O}function _(){ce(new Date)}function ne(){_(),Pe()}function be(){re--}function Ie(){be(),Pe()}function mt(){re++}function C(){mt(),Pe()}function y(){H=I(B,re)}function ie(){y(),Pe()}function we(){B=w(B-1,12),B===11&&be(),H>I(B,re)&&y()}function ge(){we(),Pe()}function Je(){B=w(B+1,12),B===0&&mt(),H>I(B,re)&&y()}function st(){Je(),Pe()}function Ue(){H-=7,H<1&&(we(),H+=I(B,re))}function Ve(){Ue(),Pe()}function Oe(){H+=7,H>I(B,re)&&(H-=I(B,re),Je())}function Fe(){Oe(),Pe()}function ze(){H--,H<1&&(we(),y())}function at(){ze(),Pe()}function hn(){H++,H>I(B,re)&&(Je(),H=1)}function Nt(){hn(),Pe()}function Ot(){V=w(V+1,24),V===0&&hn()}function Lt(){Ot(),Pe()}function _t(){V=w(V-1,24),V===23&&ze()}function ye(){_t(),Pe()}function Dt(){P=w(P+1,60),P===0&&Ot()}function Gt(){Dt(),Pe()}function Mn(){P=w(P-1,60),P===59&&_t()}function Or(){Mn(),Pe()}function la(){oe=w(oe+1,60),oe===0&&Dt()}function Ir(){la(),Pe()}function $n(){oe=w(oe-1,60),oe===59&&Mn()}function Ti(){$n(),Pe()}function sa(){O.style.display="block",b()}function An(){O.style.display="none"}function Fr(){return getComputedStyle(O).display!=="none"}function Pe(){M(".calendar-table",O).innerHTML=xe(),Se(),a.time&&fa();function xe(){let vt=new Date(re,B,1).getDay(),pn=w(vt-a.weekStarts,7),ue=I(B,re),nn=1,ke="";ke+='',ke+=`${a.labels.months.long[B]} ${re}`,ke+="",ke+="";for(let Me=0;Me<7;Me++)ke+='',ke+=a.labels.weekdays.short[w(Me+a.weekStarts,7)],ke+="";ke+="";for(let Me=0;Me<6;Me++){for(let Be=0;Be<7;Be++)nn<=ue&&(Me>0||Be>=pn)?(nn===H?ke+='':ke+='',ke+=nn++):nn===1?(ke+='',ke+=I(w(B-1,12),re)-pn+Be+1):(ke+='',ke+=nn++-ue),ke+="";ke+=""}return ke+="",ke}function Se(){te(".calendar-day",O).forEach(vt=>{vt.addEventListener("mousedown",pn=>{pn.stopPropagation(),pn.preventDefault()}),vt.addEventListener("click",()=>{H=parseInt(vt.textContent),Pe(),a.onChange(S())})})}function fa(){M(".calendar-hours",O).innerHTML=L(J(a.format)?w(V,12)||12:V,2),M(".calendar-minutes",O).innerHTML=L(P,2),M(".calendar-meridiem",O).innerHTML=J(a.format)?V<12?"AM":"PM":""}}function ua(){let xe=document.createElement("div");return xe.className="calendar",xe.innerHTML=`
`,a.time&&(xe.innerHTML+='
:
',dt("chevron-down",M(".prevHour",xe)),dt("chevron-up",M(".nextHour",xe)),dt("chevron-down",M(".prevMinute",xe)),dt("chevron-up",M(".nextMinute",xe))),dt("calendar-clock",M(".currentMonth",xe)),dt("chevron-left",M(".prevMonth",xe)),dt("chevron-right",M(".nextMonth",xe)),M(".currentMonth",xe).addEventListener("mousedown",Se=>{ne(),a.onChange(S()),Se.preventDefault()}),Lr(M(".prevMonth",xe),Se=>{ge(),a.onChange(S()),Se.preventDefault()},750,500),Lr(M(".nextMonth",xe),Se=>{st(),a.onChange(S()),Se.preventDefault()},750,500),a.time&&(Lr(M(".nextHour",xe),Se=>{Lt(),a.onChange(S()),Se.preventDefault()},750,250),Lr(M(".prevHour",xe),Se=>{ye(),a.onChange(S()),Se.preventDefault()},750,250),Lr(M(".nextMinute",xe),Se=>{Gt(),a.onChange(S()),Se.preventDefault()},750,250),Lr(M(".prevMinute",xe),Se=>{Or(),a.onChange(S()),Se.preventDefault()},750,250)),window.addEventListener("resize",go(b,100)),window.addEventListener("mousedown",Se=>{xe.style.display!=="none"&&Se.target.closest(".calendar")&&Se.preventDefault()}),window.addEventListener("keydown",Se=>{if(Fr()){switch(Se.key){case"Enter":M(".calendar-day.selected",xe).click(),An();break;case"Backspace":case"Escape":case"Tab":An();break;case"ArrowLeft":Se.ctrlKey||Se.metaKey?Se.shiftKey?Ie():ge():at(),a.onChange(S());break;case"ArrowUp":Ve(),a.onChange(S());break;case"ArrowRight":Se.ctrlKey||Se.metaKey?Se.shiftKey?C():st():Nt(),a.onChange(S());break;case"ArrowDown":Fe(),a.onChange(S());break;case"0":(Se.ctrlKey||Se.metaKey)&&ne(),a.onChange(S());break;default:return}Se.preventDefault()}}),document.body.appendChild(xe),xe}return{setDate:ce,gotoDate:j,getDate:S,getElement:R,now:ne,prevYear:Ie,nextYear:C,lastDayOfMonth:ie,prevMonth:ge,nextMonth:st,prevWeek:Ve,nextWeek:Fe,prevDay:at,nextDay:Nt,nextHour:Lt,prevHour:ye,nextMinute:Gt,prevMinute:Or,nextSecond:Ir,prevSecond:Ti,show:sa,hide:An,isVisible:Fr}}function b(){let O=g();if(!O||!c.isVisible())return;let q=O.getBoundingClientRect(),re=q.top+window.scrollY,B=q.left+window.scrollX,H=c.getElement();H.style.top=`${re+O.offsetHeight}px`,H.style.left=`${B+O.offsetLeft}px`;let V=H.getBoundingClientRect(),P=V.top+window.scrollY,oe=V.left+window.scrollX,ce=ho(H),j=po(H),S=document.documentElement.clientWidth,R=document.documentElement.clientHeight;oe+ce>S&&(H.style.left=`${S-ce}px`),(P=B.getTime()?q+1:O.getTime()>=re.getTime()?q:q-1}function Y(O){let q=q(O),re=B(new Date(q,0,4),1),B=B(O,1);return Math.round((B.getTime()-re.getTime())/6048e5)+1}function J(O){let q=O.match(/\[([^\]]*)\]|H{1,2}/);return q!==null&&q[0][0]==="H"}function Z(O,q=a.format){let re=/\[([^\]]*)\]|[YR]{4}|uuu|[YR]{2}|[MD]{1,4}|[WHhms]{1,2}|[AaZz]/g;function B(H){let V=H>0?"-":"+",P=Math.floor(Math.abs(H)/60),oe=Math.abs(H)%60;return[V+L(P,2),L(oe,2)]}return q.replace(re,(H,V)=>{switch(H){case"YY":return O.getFullYear().toString().substr(-2);case"YYYY":return O.getFullYear();case"M":return O.getMonth()+1;case"MM":return L(O.getMonth()+1,2);case"MMM":return a.labels.months.short[O.getMonth()];case"MMMM":return a.labels.months.long[O.getMonth()];case"D":return O.getDate();case"DD":return L(O.getDate(),2);case"DDD":return a.labels.weekdays.short[w(O.getDay()+a.weekStarts,7)];case"DDDD":return a.labels.weekdays.long[w(O.getDay()+a.weekStarts,7)];case"W":return Y(O);case"WW":return L(Y(O),2);case"RR":return z(O).toString().substr(-2);case"RRRR":return z(O);case"H":return w(O.getHours(),12)||12;case"HH":return L(w(O.getHours(),12)||12,2);case"h":return O.getHours();case"hh":return L(O.getHours(),2);case"m":return O.getMinutes();case"mm":return L(O.getMinutes(),2);case"s":return O.getSeconds();case"ss":return L(O.getSeconds(),2);case"uuu":return L(O.getMilliseconds(),3);case"A":return O.getHours()<12?"AM":"PM";case"a":return O.getHours()<12?"am":"pm";case"Z":return B(O.getTimezoneOffset()).join(":");case"z":return B(O.getTimezoneOffset()).join("");default:return V||H}})}}};function Pf(u){let o=Number.MAX_SAFE_INTEGER,a=-o;return u>o?o:u1&&(O.step=Z[q]),o.disabled&&(O.disabled=!0),v[q]=O,O.addEventListener("input",function(){for(;this.value.charAt(0)==="0"&&this.value.length>1&&!this.value.charAt(1).match(/[.,]/);)this.value=this.value.slice(1);for(;this.value>Number.MAX_SAFE_INTEGER;)this.value=this.value.slice(0,-1);I(),N(),E()}),O.addEventListener("blur",()=>{N(),A(),I(),E()}),O.addEventListener("focus",()=>p.classList.add("focused")),O.addEventListener("blur",()=>p.classList.remove("focused")),re.addEventListener("mousedown",function(H){let V=M("input",this);V&&H.target!==V&&(V.focus(),H.preventDefault())});let B=document.createElement("label");B.innerHTML=a.labels[q][parseInt(O.value)===1?0:1],b[q]=B,re.appendChild(O),re.appendChild(B),p.appendChild(re)}return p.addEventListener("mousedown",function(q){q.target===this&&(O.focus(),q.preventDefault())}),p}function Y(){g=document.createElement("input"),g.className="input-duration-hidden",g.name=o.name,g.id=o.id,g.type="text",g.value=o.value,g.readOnly=!0,g.hidden=!0,o.min&&(g.min=o.min),o.max&&(g.max=o.max),o.step&&(g.step=o.step),o.required&&(g.required=!0),o.disabled&&(g.disabled=!0),"intervals"in o.dataset&&(a.intervals=o.dataset.intervals.split(", ")),"unit"in o.dataset&&(a.unit=o.dataset.unit);let J=o.value*c[a.unit],Z=o.step*c[a.unit],O=z(w(J||0),w(Z||1));o.parentNode.replaceChild(O,o),O.appendChild(g)}}};var Vf=uo(Xn(),1);function Bf(u,o){if(u.length!==o.length)return!1;for(let a=0;a({extend:!1,addNew:!1})}),c=M(`.editor-toolbar[data-for=${o.id}]`),p=o.parentNode.classList.contains("editor-wrap")?o.parentNode:null,g=[];s.getWrapperElement().style.height=`${a}px`,M("[data-command=bold]",c).addEventListener("click",()=>{L("**")}),M("[data-command=italic]",c).addEventListener("click",()=>{L("_")}),M("[data-command=ul]",c).addEventListener("click",()=>{L(`${w()}- `,"")}),M("[data-command=ol]",c).addEventListener("click",()=>{let E=/^\d+\./.exec(v(s.getValue()));L(E?` +${parseInt(E)+1}. `:`${w()}1. `,"")}),M("[data-command=quote]",c).addEventListener("click",()=>{L(`${w()}> `,"")}),M("[data-command=link]",c).addEventListener("click",()=>{let E=s.getSelection();/^(https?:\/\/|mailto:)/i.test(E)?L("[",`](${E})`,!0):E!==""?L(`[${E}](http://`,")",!0):L("[","](http://)")}),M("[data-command=image]",c).addEventListener("click",()=>{Ne.modals.imagesModal.show(null,E=>{let z=M(".image-picker-thumbnail.selected",E.element);z&&z.classList.remove("selected");function Y(){if(z){let J=z.dataset.filename;L(`${w()}![`,`](${J})`)}E.hide(),this.removeEventListener("click",Y)}M(".image-picker-confirm",E.element).addEventListener("click",Y)})}),M("[data-command=undo]",c).addEventListener("click",()=>{s.undo(),s.focus()}),M("[data-command=redo]",c).addEventListener("click",()=>{s.redo(),s.focus()}),s.on("changes",Cn(()=>{o.value=s.getValue(),s.historySize().undo<1?M("[data-command=undo]").disabled=!0:M("[data-command=undo]").disabled=!1,s.historySize().redo<1?M("[data-command=redo]").disabled=!0:M("[data-command=redo]").disabled=!1},500)),s.on("beforeSelectionChange",(E,z)=>{let Y=N(z.ranges);E.operation(()=>{Bf(Y,g)||(A(E,g),I(E,Y),g=Y)}),E.refresh()}),s.on("focus",()=>{p!==null&&p.classList.add("focused")}),s.on("blur",E=>{p!==null&&p.classList.remove("focused"),A(E,g),g=[]}),document.addEventListener("keydown",E=>{if(!E.altKey&&(E.ctrlKey||E.metaKey))switch(E.key){case"b":M("[data-command=bold]",c).click(),E.preventDefault();break;case"i":M("[data-command=italic]",c).click(),E.preventDefault();break;case"k":M("[data-command=link]",c).click(),E.preventDefault();break}});function v(E){let z=E.lastIndexOf(` `);return z===-1?E:E.substring(z+1)}function b(){let E=s.getLine(s.getCursor().line);return E.length===0?void 0:E.slice(-1)}function w(){switch(b()){case void 0:return"";case` `:return` `;default:return` -`}}function L(E,z,Y){z===void 0&&(z=E);let V=Y===!0?"":s.getSelection(),J=s.getCursor(),O=E.split(` -`).length-1;s.replaceSelection(E+V+z),s.setCursor(J.line+O,J.ch+E.length-O),s.focus()}function N(E){let z=[];for(let Y of E)z.push(Y.head.line);return z}function A(E,z){for(let Y of z)E.removeLineClass(Y,"wrap","CodeMirror-activeline")}function I(E,z){for(let Y of z)E.addLineClass(Y,"wrap","CodeMirror-activeline")}}};var Bo=class{constructor(o){let a=M(`label[for="${o.id}"]`),s=M("span",a),c=!1;o.dataset.label=M(`label[for="${o.id}"] span`).innerHTML,o.addEventListener("change",p),o.addEventListener("input",p),o.form.addEventListener("submit",()=>{o.files.length>0&&(s.innerHTML+=' '),c=!0}),a.addEventListener("drag",g),a.addEventListener("dragstart",g),a.addEventListener("dragend",g),a.addEventListener("dragover",v),a.addEventListener("dragenter",v),a.addEventListener("dragleave",b),a.addEventListener("drop",w=>{w.preventDefault(),!c&&(o.files=w.dataTransfer.files,o.dispatchEvent(new Event("change")))}),a.addEventListener("click",w=>{c&&w.preventDefault()});function p(){if(this.files.length>0){let w=[];for(let L of this.files)w.push(L.name);s.innerHTML=w.join(", ")}else s.innerHTML=this.dataset.label}function g(w){w.preventDefault()}function v(w){this.classList.add("drag"),w.preventDefault()}function b(w){this.classList.remove("drag"),w.preventDefault()}}};var Wo=class{constructor(o){o.addEventListener("click",()=>{Ne.modals.imagesModal.show(null,a=>{let s=M(".image-picker-thumbnail.selected",a.element);if(s&&s.classList.remove("selected"),o.value){let c=M(`.image-picker-thumbnail[data-filename="${o.value}"]`,a.element);c&&c.classList.add("selected")}M(".image-picker-confirm",a.element).dataset.target=o.id,M(".image-picker-confirm",a.element).addEventListener("click",()=>a.hide())})})}};var Ro=class{constructor(o){let a=te("option",o),s=M(".image-picker-confirm",o.parentNode.parentNode),c=M("[data-command=upload]",o.parentNode.parentNode);if(o.hidden=!0,a.length>0){let v=document.createElement("div");v.className="image-picker-thumbnails";for(let b of a){let w=document.createElement("div");w.className="image-picker-thumbnail",w.style.backgroundImage=`url(${b.value})`,w.dataset.uri=b.value,w.dataset.filename=b.text,w.addEventListener("click",p),w.addEventListener("dblclick",g),v.appendChild(w)}o.parentNode.insertBefore(v,o),M(".image-picker-empty-state").style.display="none"}s.addEventListener("click",function(){let v=M(".image-picker-thumbnail.selected"),b=document.getElementById(this.dataset.target);v&&b&&(b.value=v.dataset.filename)}),c.addEventListener("click",function(){document.getElementById(this.dataset.uploadTarget).click()});function p(){let v=document.getElementById(M(".image-picker-confirm").dataset.target);v&&(v.value=this.dataset.filename),te(".image-picker-thumbnail").forEach(b=>{b.classList.remove("selected")}),this.classList.add("selected")}function g(){this.click(),M(".image-picker-confirm").click()}}};var zo=class{constructor(o){if(o.addEventListener("change",a),o.addEventListener("input",a),a.call(o),"ticks"in o.dataset){let c=o.dataset.ticks;switch(c){case 0:break;case"true":case"":s((o.max-o.min)/(o.step||1)+1);break;default:s(parseInt(c)+1);break}}function a(){this.style.setProperty("--progress",`${Math.round(this.value/(this.max-this.min)*100)}%`),M(`output[for="${this.id}"]`).innerHTML=this.value}function s(c){let p=document.createElement("div");p.className="input-range-ticks",p.dataset.for=o.id,o.parentElement.insertBefore(p,o.nextSibling);for(let g=0;g":"","?":"","@":"","[":"","]":"","^":"","`":"","{":"","|":"","}":"","\xA1":"","\xA3":"","\xA4":"","\xA5":"","\xA6":"","\xA7":"","\xAB":"","\xB0":"","\xBB":"","\u2018":"","\u2019":"","\u201C":"","\u201D":"","\n":"-"," ":"-","-":"-","\u2013":"-","\u2014":"-","/":"-","\\":"-",_:"-","~":"-",\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00C6:"Ae",\u00C7:"C",\u00D0:"D",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u0152:"Oe",\u0160:"S",\u00DE:"Th",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00DD:"Y",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"ae",\u00E5:"a",\u00E6:"ae","\xA2":"c",\u00E7:"c",\u00F0:"d",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"oe",\u00F8:"o",\u0153:"oe",\u0161:"s",\u00DF:"ss",\u00FE:"th",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"ue",\u00FD:"y",\u00FF:"y",\u0178:"y"};u=u.toLowerCase();for(let a in o)u=u.split(a).join(o[a]);return u.replace(/[^a-z0-9-]/g,"").replace(/^-+|-+$/g,"").replace(/-+/g,"-")}function zl(u){return u.toLowerCase().replace(" ","-").replace(/[^a-z0-9-]/g,"")}var _o=class{constructor(o,a){a=Object.assign({},{labels:{empty:"No matching options"}},a);let c,p=document.createElement("input"),g=document.createElement("div");v();function v(){let P=document.createElement("div");P.className="input-wrap",o.hidden=!0,p.type="text",p.classList.add("select"),p.dataset.for=o.id,o.hasAttribute("disabled")&&(p.disabled=!0);for(let $ in o.dataset)p.dataset[$]=o.dataset[$];let H=[];te("option",o).forEach($=>{let B={};for(let oe in $.dataset)B[oe]=$.dataset[oe];H.push({label:$.innerText,value:$.value,selected:$.selected,disabled:$.disabled,dataset:B}),$.selected&&(p.value=$.innerText)}),o.parentNode.insertBefore(P,o.nextSibling),P.appendChild(o),P.appendChild(p),b(H,P)}function b(P,H){c=document.createElement("div"),c.className="dropdown-list",c.dataset.for=o.id,g.className="dropdown-empty",g.style.display="none",g.innerText=a.labels.empty,c.appendChild(g);for(let B of P){let oe=document.createElement("div");oe.className="dropdown-item",oe.innerText=B.label,oe.dataset.value=B.value,B.selected&&oe.classList.add("selected"),B.disabled&&oe.classList.add("disabled");for(let de in B.dataset)oe.dataset[de]=B.dataset[de];oe.addEventListener("mousedown",de=>{oe.classList.contains("disabled")?de.preventDefault():(A(oe),V(oe)),de.stopPropagation()}),c.appendChild(oe)}H.appendChild(c);let $=!1;p.addEventListener("focus",()=>{q(),p.setSelectionRange(0,0),$=!1}),p.addEventListener("mousedown",B=>{p.focus(),B.preventDefault()}),p.addEventListener("blur",()=>{re(p.value)||(p.value=O()),c.style.display="none"}),p.addEventListener("keydown",B=>{let oe=M(".dropdown-item.selected",c);switch(B.key){case"Backspace":w();break;case"ArrowUp":getComputedStyle(c).display!=="none"?z():q(),B.preventDefault();break;case"ArrowDown":getComputedStyle(c).display!=="none"?Y():q(),B.preventDefault();break;case"Enter":oe&&getComputedStyle(oe).display!=="none"&&V(oe),p.blur(),B.preventDefault();break;case"Escape":case"ArrowLeft":case"ArrowRight":break;default:$||(p.value="",$=!0);break}}),p.addEventListener("keyup",B=>{let oe=p.value.trim();switch(B.key){case"Escape":p.blur(),B.stopPropagation();break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Tab":case"Enter":return!0;default:c.style.display="block",L(oe),oe.length>0&&I()}})}function w(){let P=0;te(".dropdown-item",c).forEach(H=>{getComputedStyle(H).display!=="none"&&P++,H.classList.remove("selected")}),P>0?g.style.display="none":g.style.display="block"}function L(P){let H=B=>{let oe=B.textContent;return new RegExp(Tr(Dr(P)),"i").test(oe)},$=0;te(".dropdown-item",c).forEach(B=>{P===null||H(B)?(B.style.display="block",$++):B.style.display="none"}),$>0?g.style.display="none":g.style.display="block"}function N(P){let H=c.scrollTop,$=c.clientHeight,B=H+$,oe=getComputedStyle(c),de=parseInt(oe.paddingTop),j=parseInt(oe.paddingBottom),S=P.offsetTop,R=P.clientHeight,_=S+R;SB&&(c.scrollTop=_-$+j)}function A(P){let H=M(".dropdown-item.selected",c);H&&H.classList.remove("selected"),P&&(P.classList.contains("disabled")||(P.classList.add("selected"),N(P)))}function I(){let P=te(".dropdown-item",c);for(let H=0;H=0;H--)if(getComputedStyle(P[H]).display!=="none"){A(P[H]);return}}function z(){let P=M(".dropdown-item.selected",c);if(P){let H=P.previousSibling;for(;H&&(H.style.display==="none"||H.classList.contains("disabled"));)H=H.previousSibling;if(H)return A(H);A(P.previousSibling)}E()}function Y(){let P=M(".dropdown-item.selected",c);if(P){let H=P.nextSibling;for(;H&&(H.style.display==="none"||H.classList.contains("disabled"));)H=H.nextSibling;if(H)return A(H)}I()}function V(P){o.value=P.dataset.value,p.value=P.innerText,o.dispatchEvent(new Event("change"))}function J(){return M(`[data-value="${o.value}"]`,c)}function O(){return J().innerText}function q(){getComputedStyle(c).display==="none"&&(L(null),w(),A(J()),c.style.display="block",N(J()))}function re(P){let H=te(".dropdown-item",c);for(let $=0;${R=R.trim(),s[_]=R,z(R)})),v.placeholder?(c=v.placeholder,I()):c="",g.addEventListener("mousedown",R=>{v.focus(),R.preventDefault()})}function L(){if("options"in o.dataset){let j=JSON.parse(o.dataset.options);p=document.createElement("div"),p.className="dropdown-list";for(let S in j){let R=document.createElement("div");R.className="dropdown-item",R.innerHTML=j[S],R.dataset.value=S,R.addEventListener("click",function(){Y(this.dataset.value)}),p.appendChild(R)}g.appendChild(p),v.addEventListener("focus",()=>{getComputedStyle(p).display==="none"&&(O(),p.scrollTop=0,p.style.display="block")}),v.addEventListener("blur",()=>{getComputedStyle(p).display!=="none"&&(O(),p.style.display="none")}),v.addEventListener("keydown",S=>{switch(S.key){case"Backspace":O();break;case"Enter":getComputedStyle(p).display!=="none"&&(P(),S.preventDefault());break;case"ArrowUp":getComputedStyle(p).display!=="none"&&(oe(),S.preventDefault());break;case"ArrowDown":getComputedStyle(p).display!=="none"&&(de(),S.preventDefault());break;default:a.addKeyCodes.includes(S.key)&&(P(),S.preventDefault())}}),v.addEventListener("keyup",Cn(S=>{let R=v.value.trim();switch(S.key){case"Escape":p.style.display="none";break;case"ArrowUp":case"ArrowDown":return!0;default:p.style.display="block",q(R),R.length>0&&$()}},100))}}function N(){v.addEventListener("focus",()=>g.classList.add("focused")),v.addEventListener("blur",()=>{let j=v.value.trim();j!==""&&Y(j),g.classList.remove("focused")}),v.addEventListener("keydown",j=>{let S=v.value.trim();switch(j.key){case"Backspace":S===""?(V(s[s.length-1]),v.previousSibling&&v.parentNode.removeChild(v.previousSibling),j.preventDefault()):v.size=Math.max(v.value.length,v.placeholder.length,1);break;case"Enter":case"Comma":S!==""&&Y(S),j.preventDefault();break;case"Escape":J(),v.blur(),j.preventDefault();break;default:if(S!==""&&a.addKeyCodes.includes(j.key)){Y(S),j.preventDefault();break}S.length>0&&(v.size=v.value.length+2);break}})}function A(){b.value=s.join(", "),I()}function I(){c.length>0&&(s.length===0?(v.placeholder=c,v.size=c.length):(v.placeholder="",v.size=1))}function E(j){return s.includes(j)?!1:p?M(`[data-value="${j}"]`,p)!==null:!0}function z(j){let S=document.createElement("span"),R=document.createElement("i");S.className="tag",S.innerHTML=j,S.style.marginRight=".25rem",v.parentNode.insertBefore(S,v),R.className="tag-remove",R.setAttribute("role","button"),R.addEventListener("mousedown",_=>{V(j),S.parentNode.removeChild(S),_.preventDefault()}),S.appendChild(R)}function Y(j){E(j)?(s.push(j),z(j),A()):I(),v.value="",p&&O()}function V(j){let S=s.indexOf(j);S>-1&&(s.splice(S,1),A()),p&&O()}function J(){v.value="",I()}function O(){let j=0;te(".dropdown-item",p).forEach(S=>{getComputedStyle(S).display!=="none"&&j++,s.includes(S.dataset.value)?S.style.display="none":S.style.display="block",S.classList.remove("selected")}),j>0?p.style.display="block":p.style.display="none"}function q(j){let S=0;p.style.display="block",te(".dropdown-item",p).forEach(R=>{let _=R.textContent,ne=new RegExp(Tr(Dr(j)),"i");_.match(ne)!==null&&R.style.display!=="none"?(R.style.display="block",S++):R.style.display="none"}),S>0?p.style.display="block":p.style.display="none"}function re(j){let S=p.scrollTop,R=p.clientHeight,_=S+R,ne=getComputedStyle(p),be=parseInt(ne.paddingTop),Ie=parseInt(ne.paddingBottom),mt=j.offsetTop,C=j.clientHeight,y=mt+C;mt_&&(p.scrollTop=y-R+Ie)}function P(){let j=M(".dropdown-item.selected",p);getComputedStyle(j).display!=="none"&&(v.value=j.dataset.value)}function H(j){let S=M(".dropdown-item.selected",p);S&&S.classList.remove("selected"),j&&(j.classList.add("selected"),re(j))}function $(){let j=te(".dropdown-item",p);for(let S=0;S=0;S--)if(getComputedStyle(j[S]).display!=="none"){H(j[S]);return}}function oe(){let j=M(".dropdown-item.selected",p);if(j){let S=j.previousSibling;for(;S&&S.style.display==="none";)S=S.previousSibling;if(S)return H(S);H(j.previousSibling)}B()}function de(){let j=M(".dropdown-item.selected",p);if(j){let S=j.nextSibling;for(;S&&S.style.display==="none";)S=S.nextSibling;if(S)return H(S)}$()}}};var Mr=class{constructor(o){te(".input-date",o).forEach(a=>this[a.name]=new Fo(a,Ne.config.DateInput)),te(".input-image",o).forEach(a=>this[a.name]=new Wo(a)),te(".image-picker",o).forEach(a=>this[a.name]=new Ro(a)),te(".editor-textarea",o).forEach(a=>this[a.name]=new Po(a)),te("input[type=file]",o).forEach(a=>this[a.name]=new Bo(a)),te("input[data-field=tags]",o).forEach(a=>this[a.name]=new Go(a)),te("input[data-field=duration]",o).forEach(a=>this[a.name]=new Ho(a,Ne.config.DurationInput)),te("input[type=range]",o).forEach(a=>this[a.name]=new zo(a)),te(".input-array",o).forEach(a=>this[a.name]=new Io(a)),te("select:not([hidden])",o).forEach(a=>this[a.name]=new _o(a,Ne.config.SelectInput)),te(".input-reset",o).forEach(a=>{a.addEventListener("click",()=>{let s=document.getElementById(a.dataset.reset);s.value="",s.dispatchEvent(new Event("change"))})}),te("input[data-enable]",o).forEach(a=>{a.addEventListener("change",()=>{let s=a.dataset.enable.split(",");for(let c of s){let p=M(`input[name="${c}"]`);a.checked?p.disabled=!1:p.disabled=!0}})})}};function ec(u){let o=[];for(let a in u)o.push(`${encodeURIComponent(a)}=${encodeURIComponent(u[a])}`);return o.join("&")}function _l(u){let o=[];for(let a of u.elements)if(a.name&&!a.disabled&&a.dataset.formIgnore!=="true"&&a.type!=="file"&&a.type!=="reset"&&a.type!=="submit"&&a.type!=="button")if(a.type==="select-multiple")for(let s of a.options)s.selected&&o.push(`${encodeURIComponent(a.name)}=${encodeURIComponent(s.value)}`);else(a.type!=="checkbox"&&a.type!=="radio"||a.checked)&&o.push(`${encodeURIComponent(a.name)}=${encodeURIComponent(a.value)}`);return o.join("&")}function Uo(u,o){let a=document.createElement("form");a.action=u,a.method="post";let s=document.createElement("input");s.type="hidden",s.name="csrf-token",s.value=o,a.appendChild(s),document.body.appendChild(a),a.submit(),document.body.removeChild(a)}var qo=class{constructor(o){this.inputs=new Mr(o),this.originalData=_l(o),window.addEventListener("beforeunload",s),o.addEventListener("submit",c);let a=(g=!0)=>{let v=te("input[type=file]",o);if(g===!0&&v.length>0){for(let b of v)if(b.files.length>0)return!0}return _l(o)!==this.originalData};te('a[href]:not([href^="#"]):not([target="_blank"]):not([target^="formwork-"])').forEach(g=>{g.addEventListener("click",v=>{a()&&(v.preventDefault(),Ne.modals.changesModal.show(null,b=>{M("[data-command=continue]",b.element).dataset.href=g.href}))})}),te("input[type=file][data-auto-upload]",o).forEach(g=>{g.addEventListener("change",()=>{a(!1)||o.requestSubmit(M("[type=submit]",o))})}),p();function s(g){a()&&(g.preventDefault(),g.returnValue="")}function c(){window.removeEventListener("beforeunload",s)}function p(){let g=document.getElementById("changesModal"),v=document.getElementById("deletePageModal"),b=document.getElementById("deleteUserModal");g&&M("[data-command=continue]",g).addEventListener("click",function(){c(),window.location.href=this.dataset.href}),v&&M("[data-command=delete]",v).addEventListener("click",c),b&&M("[data-command=delete]",b).addEventListener("click",c)}}};var Yo=class{constructor(){te("[data-form]").forEach(o=>this[o.dataset.form]=new qo(o))}};function tc(u=document.body){return u.querySelector("button, .button, input:not([type=hidden]), select, textarea")||u}var jo=class{constructor(o){this.element=o,document.addEventListener("keyup",s=>{s.key==="Escape"&&this.hide()}),window.addEventListener("focus",()=>tc(this.element).focus()),this.inputs=new Mr(this.element),M("[data-dismiss]",o).addEventListener("click",()=>this.hide());let a=!1;o.addEventListener("mousedown",()=>a=!0),o.addEventListener("click",s=>{a&&s.target===o&&this.hide(),a=!1}),document.addEventListener("click",s=>{let c=s.target.closest("[data-modal]");if(c&&c.dataset.modal===o.id){let p=c.dataset.modalAction;p?this.show(p):this.show()}})}show(o,a){let s=this.element;s.classList.add("show"),o&&(M("form",s).action=o),document.activeElement.blur(),M("[autofocus]",s)?M("[autofocus]",s).focus():tc(s).focus(),typeof a=="function"&&a(this),te(".tooltip").forEach(c=>c.parentNode.removeChild(c)),this.createBackdrop()}hide(){this.element.classList.remove("show"),this.removeBackdrop()}createBackdrop(){if(!M(".modal-backdrop")){let o=document.createElement("div");o.className="modal-backdrop",document.body.appendChild(o)}}removeBackdrop(){let o=M(".modal-backdrop");o&&o.parentNode.removeChild(o)}};var Xo=class{constructor(){te(".modal").forEach(o=>this[o.id]=new jo(o))}};var Ko=class{constructor(){M(".toggle-navigation")&&M(".toggle-navigation").addEventListener("click",()=>M(".sidebar").classList.toggle("show")),M("[data-command=save]")&&document.addEventListener("keydown",o=>{!o.altKey&&(o.ctrlKey||o.metaKey)&&o.key==="s"&&(M("[data-command=save]").click(),o.preventDefault())})}};var Bt=class{constructor(o,a,s){let c={interval:5e3,icon:null,newestOnTop:!0,fadeOutDelay:300,mouseleaveDelay:1e3};this.text=o,this.type=a,this.options=Object.assign({},c,s),this.containerElement=M(".notification-container")}show(){let o=(a,s,c)=>{this.containerElement||(this.containerElement=document.createElement("div"),this.containerElement.className="notification-container",document.body.appendChild(this.containerElement));let p=document.createElement("div");p.className=`notification notification-${s}`,p.innerHTML=a,this.options.newestOnTop&&this.containerElement.childNodes.length>0?this.containerElement.insertBefore(p,this.containerElement.childNodes[0]):this.containerElement.appendChild(p);let g=setTimeout(()=>this.remove(),c);return p.addEventListener("click",()=>this.remove()),p.addEventListener("mouseenter",()=>clearTimeout(g)),p.addEventListener("mouseleave",()=>(g=setTimeout(()=>this.remove()),this.options.mouseleaveDelay)),p};this.options.icon!==null?wi(this.options.icon,a=>{this.notificationElement=o(this.text,this.type,this.options.interval),this.notificationElement.insertAdjacentHTML("afterBegin",a)}):this.notificationElement=o(this.text,this.type,this.options.interval)}remove(){this.notificationElement.classList.add("fadeout"),setTimeout(()=>{this.notificationElement&&this.notificationElement.parentNode&&this.containerElement.removeChild(this.notificationElement),this.containerElement&&this.containerElement.childNodes.length<1&&(this.containerElement.parentNode&&document.body.removeChild(this.containerElement),this.containerElement=null)},this.options.fadeOutDelay)}};var $o=class{constructor(){let o=0;te("meta[name=notification]").forEach(a=>{setTimeout(()=>{let s=JSON.parse(a.content);new Bt(s.text,s.type,{interval:s.interval,icon:s.icon}).show()},o),o+=500,a.parentNode.removeChild(a)})}};var Qo=class{constructor(){te(".collapsible .section-header").forEach(o=>{o.addEventListener("click",()=>{o.parentNode.classList.toggle("collapsed")})})}};var Tn=class{constructor(o,a){let s={container:document.body,referenceElement:document.body,position:"top",offset:{x:0,y:0},delay:500,timeout:null,removeOnMouseout:!0,removeOnClick:!1};this.text=o,this.options=Object.assign({},s,a)}show(){let o=this.options,a=o.container;this.delayTimer=setTimeout(()=>{let c=document.createElement("div");c.className="tooltip",c.setAttribute("role","tooltip"),c.style.display="block",c.innerHTML=this.text;let p=v=>{let b=o.referenceElement,w=o.offset,L=b.getBoundingClientRect(),N=L.top+window.scrollY,A=L.left+window.scrollX,I=(L.width-v.offsetWidth)/2,E=(L.height-v.offsetHeight)/2;switch(o.position){case"top":return{top:Math.round(N-v.offsetHeight+w.y),left:Math.round(A+I+w.x)};case"right":return{top:Math.round(N+E+w.y),left:Math.round(A+b.offsetWidth+w.x)};case"bottom":return{top:Math.round(N+b.offsetHeight+w.y),left:Math.round(A+I+w.x)};case"left":return{top:Math.round(N+E+w.y),left:Math.round(A-v.offsetWidth+w.x)};case"center":return{top:Math.round(N+E+w.y),left:Math.round(A+I+w.x)}}};a.appendChild(c);let g=p(c);c.style.top=`${g.top}px`,c.style.left=`${g.left}px`,o.timeout!==null&&(this.timeoutTimer=setTimeout(()=>this.remove(),o.timeout)),this.tooltipElement=c},o.delay);let s=o.referenceElement;(s.tagName.toLowerCase()==="button"||s.classList.contains("button"))&&(s.addEventListener("click",()=>this.remove()),s.addEventListener("blur",()=>this.remove())),o.removeOnMouseout&&s.addEventListener("mouseout",()=>this.remove()),o.removeOnClick&&s.addEventListener("click",()=>this.remove())}remove(){clearTimeout(this.delayTimer),clearTimeout(this.timeoutTimer);let o=this.tooltipElement,a=this.options.container;o!==void 0&&a.contains(o)&&a.removeChild(o)}};var Zo=class{constructor(){te("[title]",document.body).forEach(o=>{o.dataset.tooltip=o.title,o.title=""}),te("[data-tooltip]").forEach(o=>{o.addEventListener("mouseover",()=>{new Tn(o.dataset.tooltip,{referenceElement:o,position:"bottom",offset:{x:0,y:4}}).show()}),(o.tagName.toLowerCase()==="button"||o.classList.contains("button"))&&o.addEventListener("focus",()=>{new Tn(o.dataset.tooltip,{referenceElement:o,position:"bottom",offset:{x:0,y:4},delay:0}).show()})}),document.addEventListener("mouseover",Cn(o=>{let a=o.target.closest(".truncate");a&&a.offsetWidth{let p=JSON.parse(s.response),g=p.code||s.status;parseInt(g)===400?location.reload():a(p,s)};s.onload=c,s.onerror=c}return s}};var Jo=class{constructor(){let o=M("[data-view=backups] [data-command=make-backup]");o&&o.addEventListener("click",function(){let a=this,c=(()=>{let p=M(".spinner");return p||(p=document.createElement("div"),a.insertAdjacentElement("afterend",p)),p.className="spinner",p.innerHTML="",p})();a.disabled=!0,new zt({method:"POST",url:`${Ne.config.baseUri}backup/make/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},p=>{if(p.status==="success"){a.disabled=!1,c.classList.add("spinner-success"),dt("check",c);let v=M("#backups-row");if(v){let b=M("#backups-table"),w=v.content.cloneNode(!0);M(".backup-uri",w).href=p.data.uri,M(".backup-uri",w).innerHTML=p.data.filename,M(".backup-date",w).innerHTML=p.data.date,M(".backup-size",w).innerHTML=p.data.size,M(".backup-delete",w).dataset.modalAction=p.data.deleteUri,M(".backup-last-time").innerHTML=Ne.config.Backups.labels.now,M("tbody",b).prepend(w);let L=p.data.maxFiles;te("tr",b).forEach((N,A)=>{A+1>L&&N.remove()})}}p.status==="error"&&(c.classList.add("spinner-error"),dt("exclamation",c),a.disabled=!1),new Bt(p.message,p.status,{icon:"check-circle"}).show(),p.status==="success"&&setTimeout(()=>{Uo(p.data.uri,M("meta[name=csrf-token]").content)},1e3)})})}};var Ci={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},tp=8,nc={"&":"&","<":"<",">":">",'"':""","'":"'"};function rc(u,o){return typeof u=="number"?u+o:u}function Yl(u){if(typeof u=="string"){let o=/^(\d+)\s*(.*)$/g.exec(u);return{value:o?+o[1]:0,unit:(o==null?void 0:o[2])||void 0}}return{value:Number(u)}}function np(u){return String.fromCharCode(97+u%26)}var Gl=2221e-19;function rp(u){return Math.floor(Math.log(Math.abs(u))/Math.LN10)}function Si(u,o,a){return o/a.range*u}function ip(u,o){let a=Math.pow(10,o||tp);return Math.round(u*a)/a}function op(u){if(u===1)return u;function o(g,v){return g%v===0?v:o(v,g%v)}function a(g){return g*g+1}let s=2,c=2,p;if(u%2===0)return 2;do s=a(s)%u,c=a(a(c))%u,p=o(Math.abs(s-c),u);while(p===1);return p}function ap(u,o,a){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,c={high:o.high,low:o.low,valueRange:0,oom:0,step:0,min:0,max:0,range:0,numberOfSteps:0,values:[]};c.valueRange=c.high-c.low,c.oom=rp(c.valueRange),c.step=Math.pow(10,c.oom),c.min=Math.floor(c.low/c.step)*c.step,c.max=Math.ceil(c.high/c.step)*c.step,c.range=c.max-c.min,c.numberOfSteps=Math.round(c.range/c.step);let g=Si(u,c.step,c)=a)c.step=1;else if(s&&v=a)c.step=v;else{let A=0;for(;;){if(g&&Si(u,c.step,c)<=a)c.step*=2;else if(!g&&Si(u,c.step/2,c)>=a){if(c.step/=2,s&&c.step%1!==0){c.step*=2;break}}else break;if(A++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}}c.step=Math.max(c.step,Gl);function b(A,I){return A===(A+=I)&&(A*=1+(I>0?Gl:-Gl)),A}let w=c.min,L=c.max;for(;w+c.step<=c.low;)w=b(w,c.step);for(;L-c.step>=c.high;)L=b(L,-c.step);c.min=w,c.max=L,c.range=c.max-c.min;let N=[];for(let A=c.min;A<=c.max;A=b(A,c.step)){let I=ip(A);I!==N[N.length-1]&&N.push(I)}return c.values=N,c}function Ei(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;su;function oc(u,o){return Array.from({length:u},o?(a,s)=>o(s):()=>{})}function Et(u,o){return u!==null&&typeof u=="object"&&Reflect.has(u,o)}function ea(u){return u!==null&&isFinite(u)}function lp(u){return!u&&u!==0}function Ar(u){return ea(u)?Number(u):void 0}function sp(u){return Array.isArray(u)?u.every(Array.isArray):!1}function up(u,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=0;u[a?"reduceRight":"reduce"]((c,p,g)=>o(p,s++,g),void 0)}function fp(u,o){let a=Array.isArray(u)?u[o]:Et(u,"data")?u.data[o]:null;return Et(a,"meta")?a.meta:void 0}function cc(u){return u==null||typeof u=="number"&&isNaN(u)}function cp(u){return Array.isArray(u)&&u.every(o=>Array.isArray(o)||Et(o,"data"))}function dp(u){return typeof u=="object"&&u!==null&&(Reflect.has(u,"x")||Reflect.has(u,"y"))}function es(u){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y";return dp(u)&&Et(u,o)?Ar(u[o]):Ar(u)}function hp(u,o,a){o=ot(ot({},o),a?a==="x"?o.axisX:o.axisY:{});let s={high:o.high===void 0?-Number.MAX_VALUE:+o.high,low:o.low===void 0?Number.MAX_VALUE:+o.low},c=o.high===void 0,p=o.low===void 0;function g(v){if(!cc(v))if(Array.isArray(v))for(let b=0;bs.high&&(s.high=b),p&&b0||(s.high=1),s.low=0)),s}function pp(u){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,c,p={labels:(u.labels||[]).slice(),series:vp(u.series,a,s)},g=p.labels.length;return sp(p.series)?(c=Math.max(g,...p.series.map(v=>v.length)),p.series.forEach(v=>{v.push(...oc(Math.max(0,c-v.length)))})):c=p.series.length,p.labels.push(...oc(Math.max(0,c-g),()=>"")),o&&gp(p),p}function gp(u){var o;(o=u.labels)===null||o===void 0||o.reverse(),u.series.reverse();for(let a of u.series)Et(a,"data")?a.data.reverse():Array.isArray(a)&&a.reverse()}function mp(u,o){let a,s;if(typeof u!="object"){let c=Ar(u);o==="x"?a=c:s=c}else Et(u,"x")&&(a=Ar(u.x)),Et(u,"y")&&(s=Ar(u.y));if(!(a===void 0&&s===void 0))return{x:a,y:s}}function ac(u,o){if(!cc(u))return o?mp(u,o):Ar(u)}function jl(u,o){return Array.isArray(u)?u.map(a=>Et(a,"value")?ac(a.value,o):ac(a,o)):jl(u.data,o)}function vp(u,o,a){if(cp(u))return u.map(c=>jl(c,o));let s=jl(u,o);return a?s.map(c=>[c]):s}function yp(u,o,a){let s=ot({increasingX:!1,fillHoles:!1},a),c=[],p=!0;for(let g=0;g=2&&u[g]<=u[g-2]&&(p=!0),p&&(c.push({pathCoordinates:[],valueData:[]}),p=!1),c[c.length-1].pathCoordinates.push(u[g],u[g+1]),c[c.length-1].valueData.push(o[g/2]));return c}function lc(u){let o="";return u==null?u:(typeof u=="number"?o=""+u:typeof u=="object"?o=JSON.stringify({data:u}):o=String(u),Object.keys(nc).reduce((a,s)=>a.replaceAll(s,nc[s]),o))}var Xl=class{call(o,a){return this.svgElements.forEach(s=>Reflect.apply(s[o],s,a)),this}attr(){for(var o=arguments.length,a=new Array(o),s=0;s3&&arguments[3]!==void 0?arguments[3]:!1,c=arguments.length>4?arguments[4]:void 0,A=a,{easing:p}=A,g=lf(A,["easing"]),v={},b,w;p&&(b=Array.isArray(p)?p:dc[p]),g.begin=rc(g.begin,"ms"),g.dur=rc(g.dur,"ms"),b&&(g.calcMode="spline",g.keySplines=b.join(" "),g.keyTimes="0;1"),s&&(g.fill="freeze",v[o]=g.from,u.attr(v),w=Yl(g.begin||0).value,g.begin="indefinite");let L=u.elem("animate",ot({attributeName:o},g));s&&setTimeout(()=>{try{L._node.beginElement()}catch(I){v[o]=g.to,u.attr(v),L.remove()}},w);let N=L.getNode();c&&N.addEventListener("beginEvent",()=>c.emit("animationBegin",{element:u,animate:N,params:a})),N.addEventListener("endEvent",()=>{c&&c.emit("animationEnd",{element:u,animate:N,params:a}),s&&(v[o]=g.to,u.attr(v),L.remove())})}var Li=class u{attr(o,a){return typeof o=="string"?a?this._node.getAttributeNS(a,o):this._node.getAttribute(o):(Object.keys(o).forEach(s=>{if(o[s]!==void 0)if(s.indexOf(":")!==-1){let c=s.split(":");this._node.setAttributeNS(Ci[c[0]],s,String(o[s]))}else this._node.setAttribute(s,String(o[s]))}),this)}elem(o,a,s){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return new u(o,a,s,this,c)}parent(){return this._node.parentNode instanceof SVGElement?new u(this._node.parentNode):null}root(){let o=this._node;for(;o.nodeName!=="svg"&&o.parentElement;)o=o.parentElement;return new u(o)}querySelector(o){let a=this._node.querySelector(o);return a?new u(a):null}querySelectorAll(o){let a=this._node.querySelectorAll(o);return new Xl(a)}getNode(){return this._node}foreignObject(o,a,s){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,p;if(typeof o=="string"){let v=document.createElement("div");v.innerHTML=o,p=v.firstChild}else p=o;p instanceof Element&&p.setAttribute("xmlns",Ci.xmlns);let g=this.elem("foreignObject",a,s,c);return g._node.appendChild(p),g}text(o){return this._node.appendChild(document.createTextNode(o)),this}empty(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}remove(){var o;return(o=this._node.parentNode)===null||o===void 0||o.removeChild(this._node),this.parent()}replace(o){var a;return(a=this._node.parentNode)===null||a===void 0||a.replaceChild(o._node,this._node),o}append(o){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)&&this._node.firstChild?this._node.insertBefore(o._node,this._node.firstChild):this._node.appendChild(o._node),this}classes(){let o=this._node.getAttribute("class");return o?o.trim().split(/\s+/):[]}addClass(o){return this._node.setAttribute("class",this.classes().concat(o.trim().split(/\s+/)).filter(function(a,s,c){return c.indexOf(a)===s}).join(" ")),this}removeClass(o){let a=o.trim().split(/\s+/);return this._node.setAttribute("class",this.classes().filter(s=>a.indexOf(s)===-1).join(" ")),this}removeAllClasses(){return this._node.setAttribute("class",""),this}height(){return this._node.getBoundingClientRect().height}width(){return this._node.getBoundingClientRect().width}animate(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2?arguments[2]:void 0;return Object.keys(o).forEach(c=>{let p=o[c];Array.isArray(p)?p.forEach(g=>sc(this,c,g,!1,s)):sc(this,c,p,a,s)}),this}constructor(o,a,s,c,p=!1){o instanceof Element?this._node=o:(this._node=document.createElementNS(Ci.svg,o),o==="svg"&&this.attr({"xmlns:ct":Ci.ct})),a&&this.attr(a),s&&this.addClass(s),c&&(p&&c._node.firstChild?c._node.insertBefore(this._node,c._node.firstChild):c._node.appendChild(this._node))}};Li.Easing=dc;function xp(u){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"100%",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"100%",s=arguments.length>3?arguments[3]:void 0;Array.from(u.querySelectorAll("svg")).filter(p=>p.getAttributeNS(Ci.xmlns,"ct")).forEach(p=>u.removeChild(p));let c=new Li("svg").attr({width:o,height:a}).attr({style:"width: ".concat(o,"; height: ").concat(a,";")});return s&&c.addClass(s),u.appendChild(c.getNode()),c}function bp(u){return typeof u=="number"?{top:u,right:u,bottom:u,left:u}:u===void 0?{top:0,right:0,bottom:0,left:0}:{top:typeof u.top=="number"?u.top:0,right:typeof u.right=="number"?u.right:0,bottom:typeof u.bottom=="number"?u.bottom:0,left:typeof u.left=="number"?u.left:0}}function wp(u,o){var a,s,c,p;let g=!!(o.axisX||o.axisY),v=((a=o.axisY)===null||a===void 0?void 0:a.offset)||0,b=((s=o.axisX)===null||s===void 0?void 0:s.offset)||0,w=(c=o.axisY)===null||c===void 0?void 0:c.position,L=(p=o.axisX)===null||p===void 0?void 0:p.position,N=u.width()||Yl(o.width).value||0,A=u.height()||Yl(o.height).value||0,I=bp(o.chartPadding);N=Math.max(N,v+I.left+I.right),A=Math.max(A,b+I.top+I.bottom);let E={x1:0,x2:0,y1:0,y2:0,padding:I,width(){return this.x2-this.x1},height(){return this.y1-this.y2}};return g?(L==="start"?(E.y2=I.top+b,E.y1=Math.max(A-I.bottom,E.y2+1)):(E.y2=I.top,E.y1=Math.max(A-I.bottom-b,E.y2+1)),w==="start"?(E.x1=I.left+v,E.x2=Math.max(N-I.right,E.x1+1)):(E.x1=I.left,E.x2=Math.max(N-I.right-v,E.x1+1))):(E.x1=I.left,E.x2=Math.max(N-I.right,E.x1+1),E.y2=I.top,E.y1=Math.max(A-I.bottom,E.y2+1)),E}function Sp(u,o,a,s,c,p,g,v){let b={["".concat(a.units.pos,"1")]:u,["".concat(a.units.pos,"2")]:u,["".concat(a.counterUnits.pos,"1")]:s,["".concat(a.counterUnits.pos,"2")]:s+c},w=p.elem("line",b,g.join(" "));v.emit("draw",ot({type:"grid",axis:a,index:o,group:p,element:w},b))}function kp(u,o,a,s){let c=u.elem("rect",{x:o.x1,y:o.y2,width:o.width(),height:o.height()},a,!0);s.emit("draw",{type:"gridBackground",group:u,element:c})}function Cp(u,o,a,s,c,p,g,v,b,w){let L={[c.units.pos]:u+g[c.units.pos],[c.counterUnits.pos]:g[c.counterUnits.pos],[c.units.len]:o,[c.counterUnits.len]:Math.max(0,p-10)},N=Math.round(L[c.units.len]),A=Math.round(L[c.counterUnits.len]),I=document.createElement("span");I.className=b.join(" "),I.style[c.units.len]=N+"px",I.style[c.counterUnits.len]=A+"px",I.textContent=String(s);let E=v.foreignObject(I,ot({style:"overflow: visible;"},L));w.emit("draw",ot({type:"label",axis:c,index:a,group:v,element:E,text:s},L))}function uc(u,o,a){let s,c=[];function p(v){let b=s;s=Ei({},u),o&&o.forEach(w=>{window.matchMedia(w[0]).matches&&(s=Ei(s,w[1]))}),a&&v&&a.emit("optionsChanged",{previousOptions:b,currentOptions:s})}function g(){c.forEach(v=>v.removeEventListener("change",p))}if(window.matchMedia)o&&o.forEach(v=>{let b=window.matchMedia(v[0]);b.addEventListener("change",p),c.push(b)});else throw new Error("window.matchMedia not found! Make sure you're using a polyfill.");return p(),{removeMediaQueryListeners:g,getCurrentOptions(){return s}}}var Kl={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},Ep={accuracy:3};function Vo(u,o,a,s,c,p){let g=ot(ot({command:c?u.toLowerCase():u.toUpperCase()},o),p?{data:p}:{});a.splice(s,0,g)}function Ul(u,o){u.forEach((a,s)=>{Kl[a.command.toLowerCase()].forEach((c,p)=>{o(a,c,s,p,u)})})}var Di=class u{static join(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2?arguments[2]:void 0,c=new u(a,s);for(let p=0;p2&&arguments[2]!==void 0?arguments[2]:!1,c=arguments.length>3?arguments[3]:void 0;return Vo("M",{x:+o,y:+a},this.pathElements,this.pos++,s,c),this}line(o,a){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=arguments.length>3?arguments[3]:void 0;return Vo("L",{x:+o,y:+a},this.pathElements,this.pos++,s,c),this}curve(o,a,s,c,p,g){let v=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,b=arguments.length>7?arguments[7]:void 0;return Vo("C",{x1:+o,y1:+a,x2:+s,y2:+c,x:+p,y:+g},this.pathElements,this.pos++,v,b),this}arc(o,a,s,c,p,g,v){let b=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,w=arguments.length>8?arguments[8]:void 0;return Vo("A",{rx:o,ry:a,xAr:s,lAf:c,sf:p,x:g,y:v},this.pathElements,this.pos++,b,w),this}parse(o){let a=o.replace(/([A-Za-z])(-?[0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce((c,p)=>(p.match(/[A-Za-z]/)&&c.push([]),c[c.length-1].push(p),c),[]);a[a.length-1][0].toUpperCase()==="Z"&&a.pop();let s=a.map(c=>{let p=c.shift(),g=Kl[p.toLowerCase()];return ot({command:p},g.reduce((v,b,w)=>(v[b]=+c[w],v),{}))});return this.pathElements.splice(this.pos,0,...s),this.pos+=s.length,this}stringify(){let o=Math.pow(10,this.options.accuracy);return this.pathElements.reduce((a,s)=>{let c=Kl[s.command.toLowerCase()].map(p=>{let g=s[p];return this.options.accuracy?Math.round(g*o)/o:g});return a+s.command+c.join(",")},"")+(this.close?"Z":"")}scale(o,a){return Ul(this.pathElements,(s,c)=>{s[c]*=c[0]==="x"?o:a}),this}translate(o,a){return Ul(this.pathElements,(s,c)=>{s[c]+=c[0]==="x"?o:a}),this}transform(o){return Ul(this.pathElements,(a,s,c,p,g)=>{let v=o(a,s,c,p,g);(v||v===0)&&(a[s]=v)}),this}clone(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=new u(o||this.close);return a.pos=this.pos,a.pathElements=this.pathElements.slice().map(s=>ot({},s)),a.options=ot({},this.options),a}splitByCommand(o){let a=[new u];return this.pathElements.forEach(s=>{s.command===o.toUpperCase()&&a[a.length-1].pathElements.length!==0&&a.push(new u),a[a.length-1].pathElements.push(s)}),a}constructor(o=!1,a){this.close=o,this.pathElements=[],this.pos=0,this.options=ot(ot({},Ep),a)}};function $l(u){let o=ot({fillHoles:!1},u);return function(s,c){let p=new Di,g=!0;for(let v=0;v1)return Di.join(p.map(g=>a(g.pathCoordinates,g.valueData)));{if(s=p[0].pathCoordinates,c=p[0].valueData,s.length<=4)return $l()(s,c);let g=[],v=[],b=s.length/2,w=[],L=[],N=[],A=[];for(let E=0;E0!=L[E]>0?w[E]=0:(w[E]=3*(A[E-1]+A[E])/((2*A[E]+A[E-1])/L[E-1]+(A[E]+2*A[E-1])/L[E]),isFinite(w[E])||(w[E]=0));let I=new Di().move(g[0],v[0],!1,c[0]);for(let E=0;Ep(a)),s.forEach(p=>p(o,a))}constructor(){this.listeners=new Map,this.allListeners=new Set}},ql=new WeakMap,Zl=class{update(o,a){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(o&&(this.data=o||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),a&&(this.options=Ei({},s?this.options:this.defaultOptions,a),!this.initializeTimeoutId)){var c;(c=this.optionsProvider)===null||c===void 0||c.removeMediaQueryListeners(),this.optionsProvider=uc(this.options,this.responsiveOptions,this.eventEmitter)}return!this.initializeTimeoutId&&this.optionsProvider&&this.createChart(this.optionsProvider.getCurrentOptions()),this}detach(){if(this.initializeTimeoutId)window.clearTimeout(this.initializeTimeoutId);else{var o;window.removeEventListener("resize",this.resizeListener),(o=this.optionsProvider)===null||o===void 0||o.removeMediaQueryListeners()}return ql.delete(this.container),this}on(o,a){return this.eventEmitter.on(o,a),this}off(o,a){return this.eventEmitter.off(o,a),this}initialize(){window.addEventListener("resize",this.resizeListener),this.optionsProvider=uc(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.on("optionsChanged",()=>this.update()),this.options.plugins&&this.options.plugins.forEach(o=>{Array.isArray(o)?o[0](this,o[1]):o(this)}),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=null}constructor(o,a,s,c,p){this.data=a,this.defaultOptions=s,this.options=c,this.responsiveOptions=p,this.eventEmitter=new Ql,this.resizeListener=()=>this.update(),this.initializeTimeoutId=setTimeout(()=>this.initialize(),0);let g=typeof o=="string"?document.querySelector(o):o;if(!g)throw new Error("Target element is not found");this.container=g;let v=ql.get(g);v&&v.detach(),ql.set(g,this)}},Kn={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}},ta=class{createGridAndLabels(o,a,s,c){let p=this.units.pos==="x"?s.axisX:s.axisY,g=this.ticks.map((b,w)=>this.projectValue(b,w)),v=this.ticks.map(p.labelInterpolationFnc);g.forEach((b,w)=>{let L=v[w],N={x:0,y:0},A;g[w+1]?A=g[w+1]-b:A=Math.max(this.axisLength-b,this.axisLength/this.ticks.length),!(L!==""&&lp(L))&&(this.units.pos==="x"?(b=this.chartRect.x1+b,N.x=s.axisX.labelOffset.x,s.axisX.position==="start"?N.y=this.chartRect.padding.top+s.axisX.labelOffset.y+5:N.y=this.chartRect.y1+s.axisX.labelOffset.y+5):(b=this.chartRect.y1-b,N.y=s.axisY.labelOffset.y-A,s.axisY.position==="start"?N.x=this.chartRect.padding.left+s.axisY.labelOffset.x:N.x=this.chartRect.x2+s.axisY.labelOffset.x+10),p.showGrid&&Sp(b,w,this,this.gridOffset,this.chartRect[this.counterUnits.len](),o,[s.classNames.grid,s.classNames[this.units.dir]],c),p.showLabel&&Cp(b,A,w,L,this,p.offset,N,a,[s.classNames.label,s.classNames[this.units.dir],p.position==="start"?s.classNames[p.position]:s.classNames.end],c))})}constructor(o,a,s){this.units=o,this.chartRect=a,this.ticks=s,this.counterUnits=o===Kn.x?Kn.y:Kn.x,this.axisLength=a[this.units.rectEnd]-a[this.units.rectStart],this.gridOffset=a[this.units.rectOffset]}},Jl=class extends ta{projectValue(o){let a=Number(es(o,this.units.pos));return this.axisLength*(a-this.bounds.min)/this.bounds.range}constructor(o,a,s,c){let p=c.highLow||hp(a,c,o.pos),g=ap(s[o.rectEnd]-s[o.rectStart],p,c.scaleMinSpace||20,c.onlyInteger),v={min:g.min,max:g.max};super(o,s,g.values),this.bounds=g,this.range=v}};var Vl=class extends ta{projectValue(o,a){return this.stepLength*a}constructor(o,a,s,c){let p=c.ticks||[];super(o,s,p);let g=Math.max(1,p.length-(c.stretch?1:0));this.stepLength=this.axisLength/g,this.stretch=!!c.stretch}};function ki(u,o,a){var s;if(Et(u,"name")&&u.name&&(!((s=o.series)===null||s===void 0)&&s[u.name])){let p=(o==null?void 0:o.series[u.name])[a];return p===void 0?o[a]:p}else return o[a]}var fc={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:ic,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:ic,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}},na=class extends Zl{createChart(o){let{data:a}=this,s=pp(a,o.reverseData,!0),c=xp(this.container,o.width,o.height,o.classNames.chart);this.svg=c;let p=c.elem("g").addClass(o.classNames.gridGroup),g=c.elem("g"),v=c.elem("g").addClass(o.classNames.labelGroup),b=wp(c,o),w,L;o.axisX.type===void 0?w=new Vl(Kn.x,s.series,b,xl(ot({},o.axisX),{ticks:s.labels,stretch:o.fullWidth})):w=new o.axisX.type(Kn.x,s.series,b,o.axisX),o.axisY.type===void 0?L=new Jl(Kn.y,s.series,b,xl(ot({},o.axisY),{high:ea(o.high)?o.high:o.axisY.high,low:ea(o.low)?o.low:o.axisY.low})):L=new o.axisY.type(Kn.y,s.series,b,o.axisY),w.createGridAndLabels(p,v,o,this.eventEmitter),L.createGridAndLabels(p,v,o,this.eventEmitter),o.showGridBackground&&kp(p,b,o.classNames.gridBackground,this.eventEmitter),up(a.series,(N,A)=>{let I=g.elem("g"),E=Et(N,"name")&&N.name,z=Et(N,"className")&&N.className,Y=Et(N,"meta")?N.meta:void 0;E&&I.attr({"ct:series-name":E}),Y&&I.attr({"ct:meta":lc(Y)}),I.addClass([o.classNames.series,z||"".concat(o.classNames.series,"-").concat(np(A))].join(" "));let V=[],J=[];s.series[A].forEach((P,H)=>{let $={x:b.x1+w.projectValue(P,H,s.series[A]),y:b.y1-L.projectValue(P,H,s.series[A])};V.push($.x,$.y),J.push({value:P,valueIndex:H,meta:fp(N,H)})});let O={lineSmooth:ki(N,o,"lineSmooth"),showPoint:ki(N,o,"showPoint"),showLine:ki(N,o,"showLine"),showArea:ki(N,o,"showArea"),areaBase:ki(N,o,"areaBase")},q;typeof O.lineSmooth=="function"?q=O.lineSmooth:q=O.lineSmooth?Lp():$l();let re=q(V,J);if(O.showPoint&&re.pathElements.forEach(P=>{let{data:H}=P,$=I.elem("line",{x1:P.x,y1:P.y,x2:P.x+.01,y2:P.y},o.classNames.point);if(H){let B,oe;Et(H.value,"x")&&(B=H.value.x),Et(H.value,"y")&&(oe=H.value.y),$.attr({"ct:value":[B,oe].filter(ea).join(","),"ct:meta":lc(H.meta)})}this.eventEmitter.emit("draw",{type:"point",value:H==null?void 0:H.value,index:(H==null?void 0:H.valueIndex)||0,meta:H==null?void 0:H.meta,series:N,seriesIndex:A,axisX:w,axisY:L,group:I,element:$,x:P.x,y:P.y,chartRect:b})}),O.showLine){let P=I.elem("path",{d:re.stringify()},o.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:s.series[A],path:re.clone(),chartRect:b,index:A,series:N,seriesIndex:A,meta:Y,axisX:w,axisY:L,group:I,element:P})}if(O.showArea&&L.range){let P=Math.max(Math.min(O.areaBase,L.range.max),L.range.min),H=b.y1-L.projectValue(P);re.splitByCommand("M").filter($=>$.pathElements.length>1).map($=>{let B=$.pathElements[0],oe=$.pathElements[$.pathElements.length-1];return $.clone(!0).position(0).remove(1).move(B.x,H).line(B.x,B.y).position($.pathElements.length+1).line(oe.x,H)}).forEach($=>{let B=I.elem("path",{d:$.stringify()},o.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:s.series[A],path:$.clone(),series:N,seriesIndex:A,axisX:w,axisY:L,chartRect:b,index:A,group:I,element:B,meta:Y})})}},o.reverseData),this.eventEmitter.emit("created",{chartRect:b,axisX:w,axisY:L,svg:c,options:o})}constructor(o,a,s,c){super(o,a,fc,Ei({},fc,s),c),this.data=a}};var Nr=class{constructor(o,a){let c={showArea:!0,fullWidth:!0,scaleMinSpace:20,divisor:5,chartPadding:20,lineSmooth:!1,low:0,axisX:{showGrid:!1,labelOffset:{x:0,y:10},labelInterpolationFnc:(g,v,b)=>v%Math.floor(b.length/(o.clientWidth/100))?null:g},axisY:{onlyInteger:!0,offset:15,labelOffset:{x:0,y:5}}},p=new na(o,a,c);p.on("draw",g=>{g.type==="point"&&g.element.attr({"ct:index":g.index})}),p.container.addEventListener("mouseover",g=>{if(g.target.getAttribute("class")==="ct-point"){let v=parseFloat(getComputedStyle(g.target)["stroke-width"]),b=g.target.getAttribute("ct:index");wi("circle-small-fill",w=>{let L=`${a.labels[b]}
${w} ${a.series[0][b]} ${w}${a.series[1][b]}`;new Tn(L,{referenceElement:g.target,offset:{x:0,y:-v}}).show()})}})}};var ra=class{constructor(){let o=M("[data-view=dashboard] [data-command=clear-cache]"),a=M("[data-view=dashboard] [data-command=make-backup]"),s=M(".dashboard-chart");o&&o.addEventListener("click",()=>{new zt({method:"POST",url:`${Ne.config.baseUri}cache/clear/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},c=>{new Bt(c.message,c.status,{icon:"check-circle"}).show()})}),a&&a.addEventListener("click",function(){let c=this;c.disabled=!0,new zt({method:"POST",url:`${Ne.config.baseUri}backup/make/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},p=>{new Bt(p.message,p.status,{icon:"check-circle"}).show(),p.status==="success"&&setTimeout(()=>{c.disabled=!1,Uo(p.data.uri,M("meta[name=csrf-token]").content)},1e3),p.status==="error"&&(c.disabled=!1)})}),s&&new Nr(s,JSON.parse(s.dataset.chartData))}};var ia=class{constructor(){let o=M("[data-command=expand-all-pages]"),a=M("[data-command=collapse-all-pages]"),s=M("[data-command=reorder-pages]"),c=M("[data-command=change-slug]"),p=M(".page-search"),g=document.getElementById("newPageModal"),v=document.getElementById("slugModal");if(te(".pages-list").forEach(A=>{A.dataset.orderableChildren==="true"&&N(A)}),te(".page-details").forEach(A=>{M(".page-children-toggle",A)&&A.addEventListener("click",I=>{L(A),I.stopPropagation()})}),te(".page-details a").forEach(A=>{A.addEventListener("click",I=>{I.stopPropagation()})}),te(".pages-list .sort-handle").forEach(A=>{A.addEventListener("click",I=>{I.stopPropagation()})}),o&&o.addEventListener("click",()=>{b(),o.blur()}),a&&a.addEventListener("click",()=>{w(),a.blur()}),s&&s.addEventListener("click",()=>{s.classList.toggle("active"),M(".pages-list").classList.toggle("is-reordering"),s.blur()}),p){p.addEventListener("focus",()=>{te(".pages-item").forEach(I=>{I.dataset.expanded=I.classList.contains("expanded")?"true":"false"})});let A=I=>{let E=I.target.value;if(E.length===0)M(".pages-list-root").classList.remove("is-filtered"),te(".pages-item").forEach(z=>{let Y=M(".page-title a",z);Y.innerHTML=Y.textContent,M(".pages-item-row",z).style.display="",z.classList.toggle("is-expanded",z.dataset.expanded==="true")});else{M(".pages-list-root").classList.add("is-filtered");let z=new RegExp(Tr(Dr(E)),"gi");te(".pages-item").forEach(Y=>{let V=M(".page-title a",Y),J=V.textContent,O=M(".pages-item-row",Y);J.match(z)!==null?(V.innerHTML=J.replace(z,"$&"),O.style.display=""):O.style.display="none",Y.classList.add("is-expanded")})}};p.addEventListener("keyup",Cn(A,100)),p.addEventListener("search",A),document.addEventListener("keydown",I=>{(I.ctrlKey||I.metaKey)&&I.key==="f"&&document.activeElement!==p&&(p.focus(),I.preventDefault())})}if(g){M("#page-title",g).addEventListener("keyup",I=>{M("#page-slug",g).value=Rl(I.target.value)});let A=I=>{I.target.value=zl(I.target.value)};M("#page-slug",g).addEventListener("keyup",A),M("#page-slug",g).addEventListener("blur",A),M("#page-parent",g).addEventListener("change",()=>{let I=M('.dropdown-list[data-for="page-parent"] .selected');if(!I)return;let E=I.dataset.allowedTemplates,z=M("#page-template",g);E?(E=E.split(", "),z.dataset.previousValue=z.value,z.value=E[0],M('.select[data-for="page-template"').value=M(`.dropdown-list[data-for="page-template"] .dropdown-item[data-value="${z.value}"]`).innerText,te('.dropdown-list[data-for="page-template"] .dropdown-item').forEach(Y=>{E.includes(Y.dataset.value)||Y.classList.add("disabled")})):("previousValue"in z.dataset&&(z.value=z.dataset.previousValue,delete z.dataset.previousValue,M('.select[data-for="page-template"').value=M(`.dropdown-list[data-for="page-template"] .dropdown-item[data-value="${z.value}"]`).innerText),te('.dropdown-list[data-for="page-template"] .dropdown-item').forEach(Y=>{Y.classList.remove("disabled")}))})}if(v&&c){c.addEventListener("click",()=>{Ne.modals.slugModal.show(null,I=>{let E=document.getElementById("slug").value,z=M("#page-slug",I.element);z.value=E,z.placeholder=E})}),M("#page-slug",v).addEventListener("keydown",I=>{I.key==="Enter"&&M("[data-command=continue]",v).click()});let A=I=>{I.target.value=zl(I.target.value)};M("#page-slug",v).addEventListener("keyup",A),M("#page-slug",v).addEventListener("blur",A),M("[data-command=generate-slug]",v).addEventListener("click",()=>{let I=Rl(document.getElementById("title").value);M("#page-slug",v).value=I,M("#page-slug",v).focus()}),M("[data-command=continue]",v).addEventListener("click",()=>{let I=M("#page-slug",v).value.replace(/^-+|-+$/,"");if(I.length>0){let E=M(".page-route-inner").innerHTML;te("#page-slug, #slug").forEach(z=>{z.value=I}),M("#page-slug",v).value=I,document.getElementById("slug").value=I,M(".page-route-inner").innerHTML=E.replace(/\/[a-z0-9-]+\/$/,`/${I}/`)}Ne.modals.slugModal.hide()})}te(["[data-modal=renameFileModal]"]).forEach(A=>{A.addEventListener("click",()=>{let I=document.getElementById("renameFileModal"),E=M("#file-name",I);E.value=A.dataset.filename,E.setSelectionRange(0,E.value.lastIndexOf("."))})});function b(){te(".pages-item").forEach(A=>{A.classList.add("is-expanded")})}function w(){te(".pages-item").forEach(A=>{A.classList.remove("is-expanded")})}function L(A){A.closest(".pages-item").classList.toggle("is-expanded")}function N(A){let I=[],E=ce.create(A,{handle:".sort-handle",filter:".is-not-orderable",forceFallback:!0,swapThreshold:.75,invertSwap:!0,animation:150,onChoose(){let z=document.body.offsetHeight;document.body.style.height=`${z}px`;let Y=window.addEventListener("scroll",()=>{window.document.body.style.height="",window.removeEventListener("scroll",Y)})},onStart(){A.classList.add("is-dragging")},onMove(z){if(z.related.classList.contains("is-not-orderable"))return!1},onEnd(z){if(A.classList.remove("is-dragging"),document.body.style.height="",z.newIndex===z.oldIndex)return;E.option("disabled",!0);let Y={"csrf-token":M("meta[name=csrf-token]").content,page:A.children[z.newIndex].dataset.route,before:A.children[z.oldIndex].dataset.route,parent:A.dataset.parent};new zt({method:"POST",url:`${Ne.config.baseUri}pages/reorder/`,data:Y},V=>{V.status&&new Bt(V.message,V.status,{icon:"check-circle"}).show(),(!V.status||V.status==="error")&&E.sort(I),E.option("disabled",!1),I=E.toArray()})}});I=E.toArray()}}};var oa=class{constructor(){let o=M(".statistics-chart");o&&new Nr(o,JSON.parse(o.dataset.chartData))}};var aa=class{constructor(){if(document.getElementById("updater-component")){let a=M(".update-status"),s=M(".spinner"),c=M(".current-version"),p=M(".current-version-name"),g=M(".new-version"),v=M(".new-version-name"),b=N=>{s.classList.add("spinner-info"),dt("info",s),v.innerHTML=N,g.style.display="block"},w=()=>{s.classList.add("spinner-success"),dt("check",s),c.style.display="block"},L=()=>{s.classList.add("spinner-success"),dt("check",s),p.innerHTML=v.innerHTML,c.style.display="block"};setTimeout(()=>{let N={"csrf-token":M("meta[name=csrf-token]").content};new zt({method:"POST",url:`${Ne.config.baseUri}updates/check/`,data:N},A=>{a.innerHTML=A.message,A.status==="success"?A.data.uptodate===!1?b(A.data.release.name):w():(s.classList.add("spinner-error"),dt("exclamation",s))})},1e3),M("[data-command=install-updates]").addEventListener("click",()=>{g.style.display="none",s.classList.remove("spinner-info"),a.innerHTML=a.dataset.installingText,new zt({method:"POST",url:`${Ne.config.baseUri}updates/update/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},N=>{new Bt(N.message,N.status,{icon:"check-circle"}).show(),a.innerHTML=N.data.status,N.status==="success"?L():(s.classList.add("spinner-error"),dt("exclamation",s))})})}}};var ts=class{constructor(){fo(this,"config",{});fo(this,"modals",{});fo(this,"forms",{})}load(o){this.loadConfig(o),this.loadComponent(Xo,{globalAlias:"modals"}),this.loadComponent(Yo,{globalAlias:"forms"}),this.loadComponent(mo),this.loadComponent(Zo),this.loadComponent(Ko),this.loadComponent(co),this.loadComponent($o),this.loadComponent(Qo),this.loadComponent(vo),this.loadComponent(ra),this.loadComponent(ia),this.loadComponent(oa),this.loadComponent(Jo),this.loadComponent(aa)}loadConfig(o){Object.assign(this.config,o)}loadComponent(o,a={globalAlias:null}){let s=new o(this),{globalAlias:c}=a;c&&(this[c]=s)}},Ne=new ts;return Th(Dp);})(); +`}}function L(E,z,Y){z===void 0&&(z=E);let J=Y===!0?"":s.getSelection(),Z=s.getCursor(),O=E.split(` +`).length-1;s.replaceSelection(E+J+z),s.setCursor(Z.line+O,Z.ch+E.length-O),s.focus()}function N(E){let z=[];for(let Y of E)z.push(Y.head.line);return z}function A(E,z){for(let Y of z)E.removeLineClass(Y,"wrap","CodeMirror-activeline")}function I(E,z){for(let Y of z)E.addLineClass(Y,"wrap","CodeMirror-activeline")}}};var Bo=class{constructor(o){let a=M(`label[for="${o.id}"]`),s=M("span",a),c=!1;o.dataset.label=M(`label[for="${o.id}"] span`).innerHTML,o.addEventListener("change",p),o.addEventListener("input",p),o.form.addEventListener("submit",()=>{o.files.length>0&&(s.innerHTML+=' '),c=!0}),a.addEventListener("drag",g),a.addEventListener("dragstart",g),a.addEventListener("dragend",g),a.addEventListener("dragover",v),a.addEventListener("dragenter",v),a.addEventListener("dragleave",b),a.addEventListener("drop",w=>{w.preventDefault(),!c&&(o.files=w.dataTransfer.files,o.dispatchEvent(new Event("change")))}),a.addEventListener("click",w=>{c&&w.preventDefault()});function p(){if(this.files.length>0){let w=[];for(let L of this.files)w.push(L.name);s.innerHTML=w.join(", ")}else s.innerHTML=this.dataset.label}function g(w){w.preventDefault()}function v(w){this.classList.add("drag"),w.preventDefault()}function b(w){this.classList.remove("drag"),w.preventDefault()}}};var Wo=class{constructor(o){o.addEventListener("click",()=>{Ne.modals.imagesModal.show(null,a=>{let s=M(".image-picker-thumbnail.selected",a.element);if(s&&s.classList.remove("selected"),o.value){let c=M(`.image-picker-thumbnail[data-filename="${o.value}"]`,a.element);c&&c.classList.add("selected")}M(".image-picker-confirm",a.element).dataset.target=o.id,M(".image-picker-confirm",a.element).addEventListener("click",()=>a.hide())})})}};var Ro=class{constructor(o){let a=te("option",o),s=M(".image-picker-confirm",o.parentNode.parentNode),c=M("[data-command=upload]",o.parentNode.parentNode);if(o.hidden=!0,a.length>0){let v=document.createElement("div");v.className="image-picker-thumbnails";for(let b of a){let w=document.createElement("div");w.className="image-picker-thumbnail",w.style.backgroundImage=`url(${b.value})`,w.dataset.uri=b.value,w.dataset.filename=b.text,w.addEventListener("click",p),w.addEventListener("dblclick",g),v.appendChild(w)}o.parentNode.insertBefore(v,o),M(".image-picker-empty-state").style.display="none"}s.addEventListener("click",function(){let v=M(".image-picker-thumbnail.selected"),b=document.getElementById(this.dataset.target);v&&b&&(b.value=v.dataset.filename)}),c.addEventListener("click",function(){document.getElementById(this.dataset.uploadTarget).click()});function p(){let v=document.getElementById(M(".image-picker-confirm").dataset.target);v&&(v.value=this.dataset.filename),te(".image-picker-thumbnail").forEach(b=>{b.classList.remove("selected")}),this.classList.add("selected")}function g(){this.click(),M(".image-picker-confirm").click()}}};var zo=class{constructor(o){if(o.addEventListener("change",a),o.addEventListener("input",a),a.call(o),"ticks"in o.dataset){let c=o.dataset.ticks;switch(c){case 0:break;case"true":case"":s((o.max-o.min)/(o.step||1)+1);break;default:s(parseInt(c)+1);break}}function a(){this.style.setProperty("--progress",`${Math.round(this.value/(this.max-this.min)*100)}%`),M(`output[for="${this.id}"]`).innerHTML=this.value}function s(c){let p=document.createElement("div");p.className="input-range-ticks",p.dataset.for=o.id,o.parentElement.insertBefore(p,o.nextSibling);for(let g=0;g":"","?":"","@":"","[":"","]":"","^":"","`":"","{":"","|":"","}":"","\xA1":"","\xA3":"","\xA4":"","\xA5":"","\xA6":"","\xA7":"","\xAB":"","\xB0":"","\xBB":"","\u2018":"","\u2019":"","\u201C":"","\u201D":"","\n":"-"," ":"-","-":"-","\u2013":"-","\u2014":"-","/":"-","\\":"-",_:"-","~":"-",\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00C6:"Ae",\u00C7:"C",\u00D0:"D",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00D1:"N",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u0152:"Oe",\u0160:"S",\u00DE:"Th",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00DD:"Y",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"ae",\u00E5:"a",\u00E6:"ae","\xA2":"c",\u00E7:"c",\u00F0:"d",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00F1:"n",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"oe",\u00F8:"o",\u0153:"oe",\u0161:"s",\u00DF:"ss",\u00FE:"th",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"ue",\u00FD:"y",\u00FF:"y",\u0178:"y"};u=u.toLowerCase();for(let a in o)u=u.split(a).join(o[a]);return u.replace(/[^a-z0-9-]/g,"").replace(/^-+|-+$/g,"").replace(/-+/g,"-")}function zl(u){return u.toLowerCase().replace(" ","-").replace(/[^a-z0-9-]/g,"")}var _o=class{constructor(o,a){a=Object.assign({},{labels:{empty:"No matching options"}},a);let c,p=document.createElement("input"),g=document.createElement("div");v();function v(){let B=document.createElement("div");B.className="input-wrap",o.hidden=!0,p.type="text",p.classList.add("select"),p.dataset.for=o.id;let H=M('label[for="'+o.id+'"]');H&&p.setAttribute("aria-label",H.innerText),o.hasAttribute("disabled")&&(p.disabled=!0);for(let P in o.dataset)p.dataset[P]=o.dataset[P];let V=[];te("option",o).forEach(P=>{let oe={};for(let ce in P.dataset)oe[ce]=P.dataset[ce];V.push({label:P.innerText,value:P.value,selected:P.selected,disabled:P.disabled,dataset:oe}),P.selected&&(p.value=P.innerText)}),o.parentNode.insertBefore(B,o.nextSibling),B.appendChild(o),B.appendChild(p),b(V,B)}function b(B,H){c=document.createElement("div"),c.className="dropdown-list",c.dataset.for=o.id,g.className="dropdown-empty",g.style.display="none",g.innerText=a.labels.empty,c.appendChild(g);for(let P of B){let oe=document.createElement("div");oe.className="dropdown-item",oe.innerText=P.label,oe.dataset.value=P.value,P.selected&&oe.classList.add("selected"),P.disabled&&oe.classList.add("disabled");for(let ce in P.dataset)oe.dataset[ce]=P.dataset[ce];oe.addEventListener("mousedown",ce=>{oe.classList.contains("disabled")?ce.preventDefault():(A(oe),J(oe)),ce.stopPropagation()}),c.appendChild(oe)}H.appendChild(c);let V=!1;p.addEventListener("focus",()=>{q(),p.setSelectionRange(0,0),V=!1}),p.addEventListener("mousedown",P=>{p.focus(),P.preventDefault()}),p.addEventListener("blur",()=>{re(p.value)||(p.value=O()),c.style.display="none"}),p.addEventListener("keydown",P=>{let oe=M(".dropdown-item.selected",c);switch(P.key){case"Backspace":w();break;case"ArrowUp":getComputedStyle(c).display!=="none"?z():q(),P.preventDefault();break;case"ArrowDown":getComputedStyle(c).display!=="none"?Y():q(),P.preventDefault();break;case"Enter":oe&&getComputedStyle(oe).display!=="none"&&J(oe),p.blur(),P.preventDefault();break;case"Escape":case"ArrowLeft":case"ArrowRight":break;default:V||(p.value="",V=!0);break}}),p.addEventListener("keyup",P=>{let oe=p.value.trim();switch(P.key){case"Escape":p.blur(),P.stopPropagation();break;case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"Tab":case"Enter":return!0;default:c.style.display="block",L(oe),oe.length>0&&I()}})}function w(){let B=0;te(".dropdown-item",c).forEach(H=>{getComputedStyle(H).display!=="none"&&B++,H.classList.remove("selected")}),B>0?g.style.display="none":g.style.display="block"}function L(B){let H=P=>{let oe=P.textContent;return new RegExp(Tr(Dr(B)),"i").test(oe)},V=0;te(".dropdown-item",c).forEach(P=>{B===null||H(P)?(P.style.display="block",V++):P.style.display="none"}),V>0?g.style.display="none":g.style.display="block"}function N(B){let H=c.scrollTop,V=c.clientHeight,P=H+V,oe=getComputedStyle(c),ce=parseInt(oe.paddingTop),j=parseInt(oe.paddingBottom),S=B.offsetTop,R=B.clientHeight,_=S+R;SP&&(c.scrollTop=_-V+j)}function A(B){let H=M(".dropdown-item.selected",c);H&&H.classList.remove("selected"),B&&(B.classList.contains("disabled")||(B.classList.add("selected"),N(B)))}function I(){let B=te(".dropdown-item",c);for(let H=0;H=0;H--)if(getComputedStyle(B[H]).display!=="none"){A(B[H]);return}}function z(){let B=M(".dropdown-item.selected",c);if(B){let H=B.previousSibling;for(;H&&(H.style.display==="none"||H.classList.contains("disabled"));)H=H.previousSibling;if(H)return A(H);A(B.previousSibling)}E()}function Y(){let B=M(".dropdown-item.selected",c);if(B){let H=B.nextSibling;for(;H&&(H.style.display==="none"||H.classList.contains("disabled"));)H=H.nextSibling;if(H)return A(H)}I()}function J(B){o.value=B.dataset.value,p.value=B.innerText,o.dispatchEvent(new Event("change"))}function Z(){return M(`[data-value="${o.value}"]`,c)}function O(){return Z().innerText}function q(){getComputedStyle(c).display==="none"&&(L(null),w(),A(Z()),c.style.display="block",N(Z()))}function re(B){let H=te(".dropdown-item",c);for(let V=0;V{R=R.trim(),s[_]=R,z(R)})),v.placeholder?(c=v.placeholder,I()):c="",g.addEventListener("mousedown",R=>{v.focus(),R.preventDefault()})}function L(){if("options"in o.dataset){let j=JSON.parse(o.dataset.options);p=document.createElement("div"),p.className="dropdown-list";for(let S in j){let R=document.createElement("div");R.className="dropdown-item",R.innerHTML=j[S],R.dataset.value=S,R.addEventListener("click",function(){Y(this.dataset.value)}),p.appendChild(R)}g.appendChild(p),v.addEventListener("focus",()=>{getComputedStyle(p).display==="none"&&(O(),p.scrollTop=0,p.style.display="block")}),v.addEventListener("blur",()=>{getComputedStyle(p).display!=="none"&&(O(),p.style.display="none")}),v.addEventListener("keydown",S=>{switch(S.key){case"Backspace":O();break;case"Enter":getComputedStyle(p).display!=="none"&&(B(),S.preventDefault());break;case"ArrowUp":getComputedStyle(p).display!=="none"&&(oe(),S.preventDefault());break;case"ArrowDown":getComputedStyle(p).display!=="none"&&(ce(),S.preventDefault());break;default:a.addKeyCodes.includes(S.key)&&(B(),S.preventDefault())}}),v.addEventListener("keyup",Cn(S=>{let R=v.value.trim();switch(S.key){case"Escape":p.style.display="none";break;case"ArrowUp":case"ArrowDown":return!0;default:p.style.display="block",q(R),R.length>0&&V()}},100))}}function N(){v.addEventListener("focus",()=>g.classList.add("focused")),v.addEventListener("blur",()=>{let j=v.value.trim();j!==""&&Y(j),g.classList.remove("focused")}),v.addEventListener("keydown",j=>{let S=v.value.trim();switch(j.key){case"Backspace":S===""?(J(s[s.length-1]),v.previousSibling&&v.parentNode.removeChild(v.previousSibling),j.preventDefault()):v.size=Math.max(v.value.length,v.placeholder.length,1);break;case"Enter":case"Comma":S!==""&&Y(S),j.preventDefault();break;case"Escape":Z(),v.blur(),j.preventDefault();break;default:if(S!==""&&a.addKeyCodes.includes(j.key)){Y(S),j.preventDefault();break}S.length>0&&(v.size=v.value.length+2);break}})}function A(){b.value=s.join(", "),I()}function I(){c.length>0&&(s.length===0?(v.placeholder=c,v.size=c.length):(v.placeholder="",v.size=1))}function E(j){return s.includes(j)?!1:p?M(`[data-value="${j}"]`,p)!==null:!0}function z(j){let S=document.createElement("span"),R=document.createElement("i");S.className="tag",S.innerHTML=j,S.style.marginRight=".25rem",v.parentNode.insertBefore(S,v),R.className="tag-remove",R.setAttribute("role","button"),R.addEventListener("mousedown",_=>{J(j),S.parentNode.removeChild(S),_.preventDefault()}),S.appendChild(R)}function Y(j){E(j)?(s.push(j),z(j),A()):I(),v.value="",p&&O()}function J(j){let S=s.indexOf(j);S>-1&&(s.splice(S,1),A()),p&&O()}function Z(){v.value="",I()}function O(){let j=0;te(".dropdown-item",p).forEach(S=>{getComputedStyle(S).display!=="none"&&j++,s.includes(S.dataset.value)?S.style.display="none":S.style.display="block",S.classList.remove("selected")}),j>0?p.style.display="block":p.style.display="none"}function q(j){let S=0;p.style.display="block",te(".dropdown-item",p).forEach(R=>{let _=R.textContent,ne=new RegExp(Tr(Dr(j)),"i");_.match(ne)!==null&&R.style.display!=="none"?(R.style.display="block",S++):R.style.display="none"}),S>0?p.style.display="block":p.style.display="none"}function re(j){let S=p.scrollTop,R=p.clientHeight,_=S+R,ne=getComputedStyle(p),be=parseInt(ne.paddingTop),Ie=parseInt(ne.paddingBottom),mt=j.offsetTop,C=j.clientHeight,y=mt+C;mt_&&(p.scrollTop=y-R+Ie)}function B(){let j=M(".dropdown-item.selected",p);getComputedStyle(j).display!=="none"&&(v.value=j.dataset.value)}function H(j){let S=M(".dropdown-item.selected",p);S&&S.classList.remove("selected"),j&&(j.classList.add("selected"),re(j))}function V(){let j=te(".dropdown-item",p);for(let S=0;S=0;S--)if(getComputedStyle(j[S]).display!=="none"){H(j[S]);return}}function oe(){let j=M(".dropdown-item.selected",p);if(j){let S=j.previousSibling;for(;S&&S.style.display==="none";)S=S.previousSibling;if(S)return H(S);H(j.previousSibling)}P()}function ce(){let j=M(".dropdown-item.selected",p);if(j){let S=j.nextSibling;for(;S&&S.style.display==="none";)S=S.nextSibling;if(S)return H(S)}V()}}};var Mr=class{constructor(o){te(".input-date",o).forEach(a=>this[a.name]=new Fo(a,Ne.config.DateInput)),te(".input-image",o).forEach(a=>this[a.name]=new Wo(a)),te(".image-picker",o).forEach(a=>this[a.name]=new Ro(a)),te(".editor-textarea",o).forEach(a=>this[a.name]=new Po(a)),te("input[type=file]",o).forEach(a=>this[a.name]=new Bo(a)),te("input[data-field=tags]",o).forEach(a=>this[a.name]=new Go(a)),te("input[data-field=duration]",o).forEach(a=>this[a.name]=new Ho(a,Ne.config.DurationInput)),te("input[type=range]",o).forEach(a=>this[a.name]=new zo(a)),te(".input-array",o).forEach(a=>this[a.name]=new Io(a)),te("select:not([hidden])",o).forEach(a=>this[a.name]=new _o(a,Ne.config.SelectInput)),te(".input-reset",o).forEach(a=>{a.addEventListener("click",()=>{let s=document.getElementById(a.dataset.reset);s.value="",s.dispatchEvent(new Event("change"))})}),te("input[data-enable]",o).forEach(a=>{a.addEventListener("change",()=>{let s=a.dataset.enable.split(",");for(let c of s){let p=M(`input[name="${c}"]`);a.checked?p.disabled=!1:p.disabled=!0}})})}};function ec(u){let o=[];for(let a in u)o.push(`${encodeURIComponent(a)}=${encodeURIComponent(u[a])}`);return o.join("&")}function _l(u){let o=[];for(let a of u.elements)if(a.name&&!a.disabled&&a.dataset.formIgnore!=="true"&&a.type!=="file"&&a.type!=="reset"&&a.type!=="submit"&&a.type!=="button")if(a.type==="select-multiple")for(let s of a.options)s.selected&&o.push(`${encodeURIComponent(a.name)}=${encodeURIComponent(s.value)}`);else(a.type!=="checkbox"&&a.type!=="radio"||a.checked)&&o.push(`${encodeURIComponent(a.name)}=${encodeURIComponent(a.value)}`);return o.join("&")}function Uo(u,o){let a=document.createElement("form");a.action=u,a.method="post";let s=document.createElement("input");s.type="hidden",s.name="csrf-token",s.value=o,a.appendChild(s),document.body.appendChild(a),a.submit(),document.body.removeChild(a)}var qo=class{constructor(o){this.inputs=new Mr(o),this.originalData=_l(o),window.addEventListener("beforeunload",s),o.addEventListener("submit",c);let a=(g=!0)=>{let v=te("input[type=file]",o);if(g===!0&&v.length>0){for(let b of v)if(b.files.length>0)return!0}return _l(o)!==this.originalData};te('a[href]:not([href^="#"]):not([target="_blank"]):not([target^="formwork-"])').forEach(g=>{g.addEventListener("click",v=>{a()&&(v.preventDefault(),Ne.modals.changesModal.show(null,b=>{M("[data-command=continue]",b.element).dataset.href=g.href}))})}),te("input[type=file][data-auto-upload]",o).forEach(g=>{g.addEventListener("change",()=>{a(!1)||o.requestSubmit(M("[type=submit]",o))})}),p();function s(g){a()&&(g.preventDefault(),g.returnValue="")}function c(){window.removeEventListener("beforeunload",s)}function p(){let g=document.getElementById("changesModal"),v=document.getElementById("deletePageModal"),b=document.getElementById("deleteUserModal");g&&M("[data-command=continue]",g).addEventListener("click",function(){c(),window.location.href=this.dataset.href}),v&&M("[data-command=delete]",v).addEventListener("click",c),b&&M("[data-command=delete]",b).addEventListener("click",c)}}};var Yo=class{constructor(){te("[data-form]").forEach(o=>this[o.dataset.form]=new qo(o))}};function tc(u=document.body){return u.querySelector("button, .button, input:not([type=hidden]), select, textarea")||u}var jo=class{constructor(o){this.element=o,document.addEventListener("keyup",s=>{s.key==="Escape"&&this.hide()}),window.addEventListener("focus",()=>tc(this.element).focus()),this.inputs=new Mr(this.element),M("[data-dismiss]",o).addEventListener("click",()=>this.hide());let a=!1;o.addEventListener("mousedown",()=>a=!0),o.addEventListener("click",s=>{a&&s.target===o&&this.hide(),a=!1}),document.addEventListener("click",s=>{let c=s.target.closest("[data-modal]");if(c&&c.dataset.modal===o.id){let p=c.dataset.modalAction;p?this.show(p):this.show()}})}show(o,a){let s=this.element;s.setAttribute("role","dialog"),s.setAttribute("aria-modal","true"),s.classList.add("show"),o&&(M("form",s).action=o),document.activeElement.blur(),M("[autofocus]",s)?M("[autofocus]",s).focus():tc(s).focus(),typeof a=="function"&&a(this),te(".tooltip").forEach(c=>c.parentNode.removeChild(c)),this.createBackdrop()}hide(){let o=this.element;o.classList.remove("show"),o.removeAttribute("role"),o.removeAttribute("aria-modal"),this.removeBackdrop()}createBackdrop(){if(!M(".modal-backdrop")){let o=document.createElement("div");o.className="modal-backdrop",document.body.appendChild(o)}}removeBackdrop(){let o=M(".modal-backdrop");o&&o.parentNode.removeChild(o)}};var Xo=class{constructor(){te(".modal").forEach(o=>this[o.id]=new jo(o))}};var Ko=class{constructor(){M(".toggle-navigation")&&M(".toggle-navigation").addEventListener("click",()=>M(".sidebar").classList.toggle("show")),M("[data-command=save]")&&document.addEventListener("keydown",o=>{!o.altKey&&(o.ctrlKey||o.metaKey)&&o.key==="s"&&(M("[data-command=save]").click(),o.preventDefault())})}};var Bt=class{constructor(o,a,s){let c={interval:5e3,icon:null,newestOnTop:!0,fadeOutDelay:300,mouseleaveDelay:1e3};this.text=o,this.type=a,this.options=Object.assign({},c,s),this.containerElement=M(".notification-container")}show(){let o=(a,s,c)=>{this.containerElement||(this.containerElement=document.createElement("div"),this.containerElement.className="notification-container",document.body.appendChild(this.containerElement));let p=document.createElement("div");p.className=`notification notification-${s}`,p.innerHTML=a,this.options.newestOnTop&&this.containerElement.childNodes.length>0?this.containerElement.insertBefore(p,this.containerElement.childNodes[0]):this.containerElement.appendChild(p);let g=setTimeout(()=>this.remove(),c);return p.addEventListener("click",()=>this.remove()),p.addEventListener("mouseenter",()=>clearTimeout(g)),p.addEventListener("mouseleave",()=>(g=setTimeout(()=>this.remove()),this.options.mouseleaveDelay)),p};this.options.icon!==null?wi(this.options.icon,a=>{this.notificationElement=o(this.text,this.type,this.options.interval),this.notificationElement.insertAdjacentHTML("afterBegin",a)}):this.notificationElement=o(this.text,this.type,this.options.interval)}remove(){this.notificationElement.classList.add("fadeout"),setTimeout(()=>{this.notificationElement&&this.notificationElement.parentNode&&this.containerElement.removeChild(this.notificationElement),this.containerElement&&this.containerElement.childNodes.length<1&&(this.containerElement.parentNode&&document.body.removeChild(this.containerElement),this.containerElement=null)},this.options.fadeOutDelay)}};var $o=class{constructor(){let o=0;te("meta[name=notification]").forEach(a=>{setTimeout(()=>{let s=JSON.parse(a.content);new Bt(s.text,s.type,{interval:s.interval,icon:s.icon}).show()},o),o+=500,a.parentNode.removeChild(a)})}};var Qo=class{constructor(){te(".collapsible .section-header").forEach(o=>{o.addEventListener("click",()=>{o.parentNode.classList.toggle("collapsed")})})}};var Tn=class{constructor(o,a){let s={container:document.body,referenceElement:document.body,position:"top",offset:{x:0,y:0},delay:500,timeout:null,removeOnMouseout:!0,removeOnClick:!1};this.text=o,this.options=Object.assign({},s,a)}show(){let o=this.options,a=o.container;this.delayTimer=setTimeout(()=>{let c=document.createElement("div");c.className="tooltip",c.setAttribute("role","tooltip"),c.style.display="block",c.innerHTML=this.text;let p=v=>{let b=o.referenceElement,w=o.offset,L=b.getBoundingClientRect(),N=L.top+window.scrollY,A=L.left+window.scrollX,I=(L.width-v.offsetWidth)/2,E=(L.height-v.offsetHeight)/2;switch(o.position){case"top":return{top:Math.round(N-v.offsetHeight+w.y),left:Math.round(A+I+w.x)};case"right":return{top:Math.round(N+E+w.y),left:Math.round(A+b.offsetWidth+w.x)};case"bottom":return{top:Math.round(N+b.offsetHeight+w.y),left:Math.round(A+I+w.x)};case"left":return{top:Math.round(N+E+w.y),left:Math.round(A-v.offsetWidth+w.x)};case"center":return{top:Math.round(N+E+w.y),left:Math.round(A+I+w.x)}}};a.appendChild(c);let g=p(c);c.style.top=`${g.top}px`,c.style.left=`${g.left}px`,o.timeout!==null&&(this.timeoutTimer=setTimeout(()=>this.remove(),o.timeout)),this.tooltipElement=c},o.delay);let s=o.referenceElement;(s.tagName.toLowerCase()==="button"||s.classList.contains("button"))&&(s.addEventListener("click",()=>this.remove()),s.addEventListener("blur",()=>this.remove())),o.removeOnMouseout&&s.addEventListener("mouseout",()=>this.remove()),o.removeOnClick&&s.addEventListener("click",()=>this.remove())}remove(){clearTimeout(this.delayTimer),clearTimeout(this.timeoutTimer);let o=this.tooltipElement,a=this.options.container;o!==void 0&&a.contains(o)&&a.removeChild(o)}};var Zo=class{constructor(){te("[title]",document.body).forEach(o=>{o.dataset.tooltip=o.title,o.removeAttribute("title")}),te("[data-tooltip]").forEach(o=>{o.addEventListener("mouseover",()=>{new Tn(o.dataset.tooltip,{referenceElement:o,position:"bottom",offset:{x:0,y:4}}).show()}),(o.tagName.toLowerCase()==="button"||o.classList.contains("button"))&&o.addEventListener("focus",()=>{new Tn(o.dataset.tooltip,{referenceElement:o,position:"bottom",offset:{x:0,y:4},delay:0}).show()})}),document.addEventListener("mouseover",Cn(o=>{let a=o.target.closest(".truncate");a&&a.offsetWidth{let p=JSON.parse(s.response),g=p.code||s.status;parseInt(g)===400?location.reload():a(p,s)};s.onload=c,s.onerror=c}return s}};var Jo=class{constructor(){let o=M("[data-view=backups] [data-command=make-backup]");o&&o.addEventListener("click",function(){let a=this,c=(()=>{let p=M(".spinner");return p||(p=document.createElement("div"),a.insertAdjacentElement("afterend",p)),p.className="spinner",p.innerHTML="",p})();a.disabled=!0,new zt({method:"POST",url:`${Ne.config.baseUri}backup/make/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},p=>{if(p.status==="success"){a.disabled=!1,c.classList.add("spinner-success"),dt("check",c);let v=M("#backups-row");if(v){let b=M("#backups-table"),w=v.content.cloneNode(!0);M(".backup-uri",w).href=p.data.uri,M(".backup-uri",w).innerHTML=p.data.filename,M(".backup-date",w).innerHTML=p.data.date,M(".backup-size",w).innerHTML=p.data.size,M(".backup-delete",w).dataset.modalAction=p.data.deleteUri,M(".backup-last-time").innerHTML=Ne.config.Backups.labels.now,M("tbody",b).prepend(w);let L=p.data.maxFiles;te("tr",b).forEach((N,A)=>{A+1>L&&N.remove()})}}p.status==="error"&&(c.classList.add("spinner-error"),dt("exclamation",c),a.disabled=!1),new Bt(p.message,p.status,{icon:"check-circle"}).show(),p.status==="success"&&setTimeout(()=>{Uo(p.data.uri,M("meta[name=csrf-token]").content)},1e3)})})}};var Ci={svg:"http://www.w3.org/2000/svg",xmlns:"http://www.w3.org/2000/xmlns/",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",ct:"http://gionkunz.github.com/chartist-js/ct"},tp=8,nc={"&":"&","<":"<",">":">",'"':""","'":"'"};function rc(u,o){return typeof u=="number"?u+o:u}function Yl(u){if(typeof u=="string"){let o=/^(\d+)\s*(.*)$/g.exec(u);return{value:o?+o[1]:0,unit:(o==null?void 0:o[2])||void 0}}return{value:Number(u)}}function np(u){return String.fromCharCode(97+u%26)}var Gl=2221e-19;function rp(u){return Math.floor(Math.log(Math.abs(u))/Math.LN10)}function Si(u,o,a){return o/a.range*u}function ip(u,o){let a=Math.pow(10,o||tp);return Math.round(u*a)/a}function op(u){if(u===1)return u;function o(g,v){return g%v===0?v:o(v,g%v)}function a(g){return g*g+1}let s=2,c=2,p;if(u%2===0)return 2;do s=a(s)%u,c=a(a(c))%u,p=o(Math.abs(s-c),u);while(p===1);return p}function ap(u,o,a){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,c={high:o.high,low:o.low,valueRange:0,oom:0,step:0,min:0,max:0,range:0,numberOfSteps:0,values:[]};c.valueRange=c.high-c.low,c.oom=rp(c.valueRange),c.step=Math.pow(10,c.oom),c.min=Math.floor(c.low/c.step)*c.step,c.max=Math.ceil(c.high/c.step)*c.step,c.range=c.max-c.min,c.numberOfSteps=Math.round(c.range/c.step);let g=Si(u,c.step,c)=a)c.step=1;else if(s&&v=a)c.step=v;else{let A=0;for(;;){if(g&&Si(u,c.step,c)<=a)c.step*=2;else if(!g&&Si(u,c.step/2,c)>=a){if(c.step/=2,s&&c.step%1!==0){c.step*=2;break}}else break;if(A++>1e3)throw new Error("Exceeded maximum number of iterations while optimizing scale step!")}}c.step=Math.max(c.step,Gl);function b(A,I){return A===(A+=I)&&(A*=1+(I>0?Gl:-Gl)),A}let w=c.min,L=c.max;for(;w+c.step<=c.low;)w=b(w,c.step);for(;L-c.step>=c.high;)L=b(L,-c.step);c.min=w,c.max=L,c.range=c.max-c.min;let N=[];for(let A=c.min;A<=c.max;A=b(A,c.step)){let I=ip(A);I!==N[N.length-1]&&N.push(I)}return c.values=N,c}function Ei(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};for(var o=arguments.length,a=new Array(o>1?o-1:0),s=1;su;function oc(u,o){return Array.from({length:u},o?(a,s)=>o(s):()=>{})}function Et(u,o){return u!==null&&typeof u=="object"&&Reflect.has(u,o)}function ea(u){return u!==null&&isFinite(u)}function lp(u){return!u&&u!==0}function Ar(u){return ea(u)?Number(u):void 0}function sp(u){return Array.isArray(u)?u.every(Array.isArray):!1}function up(u,o){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,s=0;u[a?"reduceRight":"reduce"]((c,p,g)=>o(p,s++,g),void 0)}function fp(u,o){let a=Array.isArray(u)?u[o]:Et(u,"data")?u.data[o]:null;return Et(a,"meta")?a.meta:void 0}function cc(u){return u==null||typeof u=="number"&&isNaN(u)}function cp(u){return Array.isArray(u)&&u.every(o=>Array.isArray(o)||Et(o,"data"))}function dp(u){return typeof u=="object"&&u!==null&&(Reflect.has(u,"x")||Reflect.has(u,"y"))}function es(u){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"y";return dp(u)&&Et(u,o)?Ar(u[o]):Ar(u)}function hp(u,o,a){o=ot(ot({},o),a?a==="x"?o.axisX:o.axisY:{});let s={high:o.high===void 0?-Number.MAX_VALUE:+o.high,low:o.low===void 0?Number.MAX_VALUE:+o.low},c=o.high===void 0,p=o.low===void 0;function g(v){if(!cc(v))if(Array.isArray(v))for(let b=0;bs.high&&(s.high=b),p&&b0||(s.high=1),s.low=0)),s}function pp(u){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,a=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,c,p={labels:(u.labels||[]).slice(),series:vp(u.series,a,s)},g=p.labels.length;return sp(p.series)?(c=Math.max(g,...p.series.map(v=>v.length)),p.series.forEach(v=>{v.push(...oc(Math.max(0,c-v.length)))})):c=p.series.length,p.labels.push(...oc(Math.max(0,c-g),()=>"")),o&&gp(p),p}function gp(u){var o;(o=u.labels)===null||o===void 0||o.reverse(),u.series.reverse();for(let a of u.series)Et(a,"data")?a.data.reverse():Array.isArray(a)&&a.reverse()}function mp(u,o){let a,s;if(typeof u!="object"){let c=Ar(u);o==="x"?a=c:s=c}else Et(u,"x")&&(a=Ar(u.x)),Et(u,"y")&&(s=Ar(u.y));if(!(a===void 0&&s===void 0))return{x:a,y:s}}function ac(u,o){if(!cc(u))return o?mp(u,o):Ar(u)}function jl(u,o){return Array.isArray(u)?u.map(a=>Et(a,"value")?ac(a.value,o):ac(a,o)):jl(u.data,o)}function vp(u,o,a){if(cp(u))return u.map(c=>jl(c,o));let s=jl(u,o);return a?s.map(c=>[c]):s}function yp(u,o,a){let s=ot({increasingX:!1,fillHoles:!1},a),c=[],p=!0;for(let g=0;g=2&&u[g]<=u[g-2]&&(p=!0),p&&(c.push({pathCoordinates:[],valueData:[]}),p=!1),c[c.length-1].pathCoordinates.push(u[g],u[g+1]),c[c.length-1].valueData.push(o[g/2]));return c}function lc(u){let o="";return u==null?u:(typeof u=="number"?o=""+u:typeof u=="object"?o=JSON.stringify({data:u}):o=String(u),Object.keys(nc).reduce((a,s)=>a.replaceAll(s,nc[s]),o))}var Xl=class{call(o,a){return this.svgElements.forEach(s=>Reflect.apply(s[o],s,a)),this}attr(){for(var o=arguments.length,a=new Array(o),s=0;s3&&arguments[3]!==void 0?arguments[3]:!1,c=arguments.length>4?arguments[4]:void 0,A=a,{easing:p}=A,g=lf(A,["easing"]),v={},b,w;p&&(b=Array.isArray(p)?p:dc[p]),g.begin=rc(g.begin,"ms"),g.dur=rc(g.dur,"ms"),b&&(g.calcMode="spline",g.keySplines=b.join(" "),g.keyTimes="0;1"),s&&(g.fill="freeze",v[o]=g.from,u.attr(v),w=Yl(g.begin||0).value,g.begin="indefinite");let L=u.elem("animate",ot({attributeName:o},g));s&&setTimeout(()=>{try{L._node.beginElement()}catch(I){v[o]=g.to,u.attr(v),L.remove()}},w);let N=L.getNode();c&&N.addEventListener("beginEvent",()=>c.emit("animationBegin",{element:u,animate:N,params:a})),N.addEventListener("endEvent",()=>{c&&c.emit("animationEnd",{element:u,animate:N,params:a}),s&&(v[o]=g.to,u.attr(v),L.remove())})}var Li=class u{attr(o,a){return typeof o=="string"?a?this._node.getAttributeNS(a,o):this._node.getAttribute(o):(Object.keys(o).forEach(s=>{if(o[s]!==void 0)if(s.indexOf(":")!==-1){let c=s.split(":");this._node.setAttributeNS(Ci[c[0]],s,String(o[s]))}else this._node.setAttribute(s,String(o[s]))}),this)}elem(o,a,s){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return new u(o,a,s,this,c)}parent(){return this._node.parentNode instanceof SVGElement?new u(this._node.parentNode):null}root(){let o=this._node;for(;o.nodeName!=="svg"&&o.parentElement;)o=o.parentElement;return new u(o)}querySelector(o){let a=this._node.querySelector(o);return a?new u(a):null}querySelectorAll(o){let a=this._node.querySelectorAll(o);return new Xl(a)}getNode(){return this._node}foreignObject(o,a,s){let c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,p;if(typeof o=="string"){let v=document.createElement("div");v.innerHTML=o,p=v.firstChild}else p=o;p instanceof Element&&p.setAttribute("xmlns",Ci.xmlns);let g=this.elem("foreignObject",a,s,c);return g._node.appendChild(p),g}text(o){return this._node.appendChild(document.createTextNode(o)),this}empty(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}remove(){var o;return(o=this._node.parentNode)===null||o===void 0||o.removeChild(this._node),this.parent()}replace(o){var a;return(a=this._node.parentNode)===null||a===void 0||a.replaceChild(o._node,this._node),o}append(o){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1)&&this._node.firstChild?this._node.insertBefore(o._node,this._node.firstChild):this._node.appendChild(o._node),this}classes(){let o=this._node.getAttribute("class");return o?o.trim().split(/\s+/):[]}addClass(o){return this._node.setAttribute("class",this.classes().concat(o.trim().split(/\s+/)).filter(function(a,s,c){return c.indexOf(a)===s}).join(" ")),this}removeClass(o){let a=o.trim().split(/\s+/);return this._node.setAttribute("class",this.classes().filter(s=>a.indexOf(s)===-1).join(" ")),this}removeAllClasses(){return this._node.setAttribute("class",""),this}height(){return this._node.getBoundingClientRect().height}width(){return this._node.getBoundingClientRect().width}animate(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,s=arguments.length>2?arguments[2]:void 0;return Object.keys(o).forEach(c=>{let p=o[c];Array.isArray(p)?p.forEach(g=>sc(this,c,g,!1,s)):sc(this,c,p,a,s)}),this}constructor(o,a,s,c,p=!1){o instanceof Element?this._node=o:(this._node=document.createElementNS(Ci.svg,o),o==="svg"&&this.attr({"xmlns:ct":Ci.ct})),a&&this.attr(a),s&&this.addClass(s),c&&(p&&c._node.firstChild?c._node.insertBefore(this._node,c._node.firstChild):c._node.appendChild(this._node))}};Li.Easing=dc;function xp(u){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"100%",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"100%",s=arguments.length>3?arguments[3]:void 0;Array.from(u.querySelectorAll("svg")).filter(p=>p.getAttributeNS(Ci.xmlns,"ct")).forEach(p=>u.removeChild(p));let c=new Li("svg").attr({width:o,height:a}).attr({style:"width: ".concat(o,"; height: ").concat(a,";")});return s&&c.addClass(s),u.appendChild(c.getNode()),c}function bp(u){return typeof u=="number"?{top:u,right:u,bottom:u,left:u}:u===void 0?{top:0,right:0,bottom:0,left:0}:{top:typeof u.top=="number"?u.top:0,right:typeof u.right=="number"?u.right:0,bottom:typeof u.bottom=="number"?u.bottom:0,left:typeof u.left=="number"?u.left:0}}function wp(u,o){var a,s,c,p;let g=!!(o.axisX||o.axisY),v=((a=o.axisY)===null||a===void 0?void 0:a.offset)||0,b=((s=o.axisX)===null||s===void 0?void 0:s.offset)||0,w=(c=o.axisY)===null||c===void 0?void 0:c.position,L=(p=o.axisX)===null||p===void 0?void 0:p.position,N=u.width()||Yl(o.width).value||0,A=u.height()||Yl(o.height).value||0,I=bp(o.chartPadding);N=Math.max(N,v+I.left+I.right),A=Math.max(A,b+I.top+I.bottom);let E={x1:0,x2:0,y1:0,y2:0,padding:I,width(){return this.x2-this.x1},height(){return this.y1-this.y2}};return g?(L==="start"?(E.y2=I.top+b,E.y1=Math.max(A-I.bottom,E.y2+1)):(E.y2=I.top,E.y1=Math.max(A-I.bottom-b,E.y2+1)),w==="start"?(E.x1=I.left+v,E.x2=Math.max(N-I.right,E.x1+1)):(E.x1=I.left,E.x2=Math.max(N-I.right-v,E.x1+1))):(E.x1=I.left,E.x2=Math.max(N-I.right,E.x1+1),E.y2=I.top,E.y1=Math.max(A-I.bottom,E.y2+1)),E}function Sp(u,o,a,s,c,p,g,v){let b={["".concat(a.units.pos,"1")]:u,["".concat(a.units.pos,"2")]:u,["".concat(a.counterUnits.pos,"1")]:s,["".concat(a.counterUnits.pos,"2")]:s+c},w=p.elem("line",b,g.join(" "));v.emit("draw",ot({type:"grid",axis:a,index:o,group:p,element:w},b))}function kp(u,o,a,s){let c=u.elem("rect",{x:o.x1,y:o.y2,width:o.width(),height:o.height()},a,!0);s.emit("draw",{type:"gridBackground",group:u,element:c})}function Cp(u,o,a,s,c,p,g,v,b,w){let L={[c.units.pos]:u+g[c.units.pos],[c.counterUnits.pos]:g[c.counterUnits.pos],[c.units.len]:o,[c.counterUnits.len]:Math.max(0,p-10)},N=Math.round(L[c.units.len]),A=Math.round(L[c.counterUnits.len]),I=document.createElement("span");I.className=b.join(" "),I.style[c.units.len]=N+"px",I.style[c.counterUnits.len]=A+"px",I.textContent=String(s);let E=v.foreignObject(I,ot({style:"overflow: visible;"},L));w.emit("draw",ot({type:"label",axis:c,index:a,group:v,element:E,text:s},L))}function uc(u,o,a){let s,c=[];function p(v){let b=s;s=Ei({},u),o&&o.forEach(w=>{window.matchMedia(w[0]).matches&&(s=Ei(s,w[1]))}),a&&v&&a.emit("optionsChanged",{previousOptions:b,currentOptions:s})}function g(){c.forEach(v=>v.removeEventListener("change",p))}if(window.matchMedia)o&&o.forEach(v=>{let b=window.matchMedia(v[0]);b.addEventListener("change",p),c.push(b)});else throw new Error("window.matchMedia not found! Make sure you're using a polyfill.");return p(),{removeMediaQueryListeners:g,getCurrentOptions(){return s}}}var Kl={m:["x","y"],l:["x","y"],c:["x1","y1","x2","y2","x","y"],a:["rx","ry","xAr","lAf","sf","x","y"]},Ep={accuracy:3};function Vo(u,o,a,s,c,p){let g=ot(ot({command:c?u.toLowerCase():u.toUpperCase()},o),p?{data:p}:{});a.splice(s,0,g)}function Ul(u,o){u.forEach((a,s)=>{Kl[a.command.toLowerCase()].forEach((c,p)=>{o(a,c,s,p,u)})})}var Di=class u{static join(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,s=arguments.length>2?arguments[2]:void 0,c=new u(a,s);for(let p=0;p2&&arguments[2]!==void 0?arguments[2]:!1,c=arguments.length>3?arguments[3]:void 0;return Vo("M",{x:+o,y:+a},this.pathElements,this.pos++,s,c),this}line(o,a){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,c=arguments.length>3?arguments[3]:void 0;return Vo("L",{x:+o,y:+a},this.pathElements,this.pos++,s,c),this}curve(o,a,s,c,p,g){let v=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,b=arguments.length>7?arguments[7]:void 0;return Vo("C",{x1:+o,y1:+a,x2:+s,y2:+c,x:+p,y:+g},this.pathElements,this.pos++,v,b),this}arc(o,a,s,c,p,g,v){let b=arguments.length>7&&arguments[7]!==void 0?arguments[7]:!1,w=arguments.length>8?arguments[8]:void 0;return Vo("A",{rx:o,ry:a,xAr:s,lAf:c,sf:p,x:g,y:v},this.pathElements,this.pos++,b,w),this}parse(o){let a=o.replace(/([A-Za-z])(-?[0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").split(/[\s,]+/).reduce((c,p)=>(p.match(/[A-Za-z]/)&&c.push([]),c[c.length-1].push(p),c),[]);a[a.length-1][0].toUpperCase()==="Z"&&a.pop();let s=a.map(c=>{let p=c.shift(),g=Kl[p.toLowerCase()];return ot({command:p},g.reduce((v,b,w)=>(v[b]=+c[w],v),{}))});return this.pathElements.splice(this.pos,0,...s),this.pos+=s.length,this}stringify(){let o=Math.pow(10,this.options.accuracy);return this.pathElements.reduce((a,s)=>{let c=Kl[s.command.toLowerCase()].map(p=>{let g=s[p];return this.options.accuracy?Math.round(g*o)/o:g});return a+s.command+c.join(",")},"")+(this.close?"Z":"")}scale(o,a){return Ul(this.pathElements,(s,c)=>{s[c]*=c[0]==="x"?o:a}),this}translate(o,a){return Ul(this.pathElements,(s,c)=>{s[c]+=c[0]==="x"?o:a}),this}transform(o){return Ul(this.pathElements,(a,s,c,p,g)=>{let v=o(a,s,c,p,g);(v||v===0)&&(a[s]=v)}),this}clone(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,a=new u(o||this.close);return a.pos=this.pos,a.pathElements=this.pathElements.slice().map(s=>ot({},s)),a.options=ot({},this.options),a}splitByCommand(o){let a=[new u];return this.pathElements.forEach(s=>{s.command===o.toUpperCase()&&a[a.length-1].pathElements.length!==0&&a.push(new u),a[a.length-1].pathElements.push(s)}),a}constructor(o=!1,a){this.close=o,this.pathElements=[],this.pos=0,this.options=ot(ot({},Ep),a)}};function $l(u){let o=ot({fillHoles:!1},u);return function(s,c){let p=new Di,g=!0;for(let v=0;v1)return Di.join(p.map(g=>a(g.pathCoordinates,g.valueData)));{if(s=p[0].pathCoordinates,c=p[0].valueData,s.length<=4)return $l()(s,c);let g=[],v=[],b=s.length/2,w=[],L=[],N=[],A=[];for(let E=0;E0!=L[E]>0?w[E]=0:(w[E]=3*(A[E-1]+A[E])/((2*A[E]+A[E-1])/L[E-1]+(A[E]+2*A[E-1])/L[E]),isFinite(w[E])||(w[E]=0));let I=new Di().move(g[0],v[0],!1,c[0]);for(let E=0;Ep(a)),s.forEach(p=>p(o,a))}constructor(){this.listeners=new Map,this.allListeners=new Set}},ql=new WeakMap,Zl=class{update(o,a){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(o&&(this.data=o||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit("data",{type:"update",data:this.data})),a&&(this.options=Ei({},s?this.options:this.defaultOptions,a),!this.initializeTimeoutId)){var c;(c=this.optionsProvider)===null||c===void 0||c.removeMediaQueryListeners(),this.optionsProvider=uc(this.options,this.responsiveOptions,this.eventEmitter)}return!this.initializeTimeoutId&&this.optionsProvider&&this.createChart(this.optionsProvider.getCurrentOptions()),this}detach(){if(this.initializeTimeoutId)window.clearTimeout(this.initializeTimeoutId);else{var o;window.removeEventListener("resize",this.resizeListener),(o=this.optionsProvider)===null||o===void 0||o.removeMediaQueryListeners()}return ql.delete(this.container),this}on(o,a){return this.eventEmitter.on(o,a),this}off(o,a){return this.eventEmitter.off(o,a),this}initialize(){window.addEventListener("resize",this.resizeListener),this.optionsProvider=uc(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.on("optionsChanged",()=>this.update()),this.options.plugins&&this.options.plugins.forEach(o=>{Array.isArray(o)?o[0](this,o[1]):o(this)}),this.eventEmitter.emit("data",{type:"initial",data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=null}constructor(o,a,s,c,p){this.data=a,this.defaultOptions=s,this.options=c,this.responsiveOptions=p,this.eventEmitter=new Ql,this.resizeListener=()=>this.update(),this.initializeTimeoutId=setTimeout(()=>this.initialize(),0);let g=typeof o=="string"?document.querySelector(o):o;if(!g)throw new Error("Target element is not found");this.container=g;let v=ql.get(g);v&&v.detach(),ql.set(g,this)}},Kn={x:{pos:"x",len:"width",dir:"horizontal",rectStart:"x1",rectEnd:"x2",rectOffset:"y2"},y:{pos:"y",len:"height",dir:"vertical",rectStart:"y2",rectEnd:"y1",rectOffset:"x1"}},ta=class{createGridAndLabels(o,a,s,c){let p=this.units.pos==="x"?s.axisX:s.axisY,g=this.ticks.map((b,w)=>this.projectValue(b,w)),v=this.ticks.map(p.labelInterpolationFnc);g.forEach((b,w)=>{let L=v[w],N={x:0,y:0},A;g[w+1]?A=g[w+1]-b:A=Math.max(this.axisLength-b,this.axisLength/this.ticks.length),!(L!==""&&lp(L))&&(this.units.pos==="x"?(b=this.chartRect.x1+b,N.x=s.axisX.labelOffset.x,s.axisX.position==="start"?N.y=this.chartRect.padding.top+s.axisX.labelOffset.y+5:N.y=this.chartRect.y1+s.axisX.labelOffset.y+5):(b=this.chartRect.y1-b,N.y=s.axisY.labelOffset.y-A,s.axisY.position==="start"?N.x=this.chartRect.padding.left+s.axisY.labelOffset.x:N.x=this.chartRect.x2+s.axisY.labelOffset.x+10),p.showGrid&&Sp(b,w,this,this.gridOffset,this.chartRect[this.counterUnits.len](),o,[s.classNames.grid,s.classNames[this.units.dir]],c),p.showLabel&&Cp(b,A,w,L,this,p.offset,N,a,[s.classNames.label,s.classNames[this.units.dir],p.position==="start"?s.classNames[p.position]:s.classNames.end],c))})}constructor(o,a,s){this.units=o,this.chartRect=a,this.ticks=s,this.counterUnits=o===Kn.x?Kn.y:Kn.x,this.axisLength=a[this.units.rectEnd]-a[this.units.rectStart],this.gridOffset=a[this.units.rectOffset]}},Jl=class extends ta{projectValue(o){let a=Number(es(o,this.units.pos));return this.axisLength*(a-this.bounds.min)/this.bounds.range}constructor(o,a,s,c){let p=c.highLow||hp(a,c,o.pos),g=ap(s[o.rectEnd]-s[o.rectStart],p,c.scaleMinSpace||20,c.onlyInteger),v={min:g.min,max:g.max};super(o,s,g.values),this.bounds=g,this.range=v}};var Vl=class extends ta{projectValue(o,a){return this.stepLength*a}constructor(o,a,s,c){let p=c.ticks||[];super(o,s,p);let g=Math.max(1,p.length-(c.stretch?1:0));this.stepLength=this.axisLength/g,this.stretch=!!c.stretch}};function ki(u,o,a){var s;if(Et(u,"name")&&u.name&&(!((s=o.series)===null||s===void 0)&&s[u.name])){let p=(o==null?void 0:o.series[u.name])[a];return p===void 0?o[a]:p}else return o[a]}var fc={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:ic,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:ic,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",label:"ct-label",labelGroup:"ct-labels",series:"ct-series",line:"ct-line",point:"ct-point",area:"ct-area",grid:"ct-grid",gridGroup:"ct-grids",gridBackground:"ct-grid-background",vertical:"ct-vertical",horizontal:"ct-horizontal",start:"ct-start",end:"ct-end"}},na=class extends Zl{createChart(o){let{data:a}=this,s=pp(a,o.reverseData,!0),c=xp(this.container,o.width,o.height,o.classNames.chart);this.svg=c;let p=c.elem("g").addClass(o.classNames.gridGroup),g=c.elem("g"),v=c.elem("g").addClass(o.classNames.labelGroup),b=wp(c,o),w,L;o.axisX.type===void 0?w=new Vl(Kn.x,s.series,b,xl(ot({},o.axisX),{ticks:s.labels,stretch:o.fullWidth})):w=new o.axisX.type(Kn.x,s.series,b,o.axisX),o.axisY.type===void 0?L=new Jl(Kn.y,s.series,b,xl(ot({},o.axisY),{high:ea(o.high)?o.high:o.axisY.high,low:ea(o.low)?o.low:o.axisY.low})):L=new o.axisY.type(Kn.y,s.series,b,o.axisY),w.createGridAndLabels(p,v,o,this.eventEmitter),L.createGridAndLabels(p,v,o,this.eventEmitter),o.showGridBackground&&kp(p,b,o.classNames.gridBackground,this.eventEmitter),up(a.series,(N,A)=>{let I=g.elem("g"),E=Et(N,"name")&&N.name,z=Et(N,"className")&&N.className,Y=Et(N,"meta")?N.meta:void 0;E&&I.attr({"ct:series-name":E}),Y&&I.attr({"ct:meta":lc(Y)}),I.addClass([o.classNames.series,z||"".concat(o.classNames.series,"-").concat(np(A))].join(" "));let J=[],Z=[];s.series[A].forEach((B,H)=>{let V={x:b.x1+w.projectValue(B,H,s.series[A]),y:b.y1-L.projectValue(B,H,s.series[A])};J.push(V.x,V.y),Z.push({value:B,valueIndex:H,meta:fp(N,H)})});let O={lineSmooth:ki(N,o,"lineSmooth"),showPoint:ki(N,o,"showPoint"),showLine:ki(N,o,"showLine"),showArea:ki(N,o,"showArea"),areaBase:ki(N,o,"areaBase")},q;typeof O.lineSmooth=="function"?q=O.lineSmooth:q=O.lineSmooth?Lp():$l();let re=q(J,Z);if(O.showPoint&&re.pathElements.forEach(B=>{let{data:H}=B,V=I.elem("line",{x1:B.x,y1:B.y,x2:B.x+.01,y2:B.y},o.classNames.point);if(H){let P,oe;Et(H.value,"x")&&(P=H.value.x),Et(H.value,"y")&&(oe=H.value.y),V.attr({"ct:value":[P,oe].filter(ea).join(","),"ct:meta":lc(H.meta)})}this.eventEmitter.emit("draw",{type:"point",value:H==null?void 0:H.value,index:(H==null?void 0:H.valueIndex)||0,meta:H==null?void 0:H.meta,series:N,seriesIndex:A,axisX:w,axisY:L,group:I,element:V,x:B.x,y:B.y,chartRect:b})}),O.showLine){let B=I.elem("path",{d:re.stringify()},o.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:s.series[A],path:re.clone(),chartRect:b,index:A,series:N,seriesIndex:A,meta:Y,axisX:w,axisY:L,group:I,element:B})}if(O.showArea&&L.range){let B=Math.max(Math.min(O.areaBase,L.range.max),L.range.min),H=b.y1-L.projectValue(B);re.splitByCommand("M").filter(V=>V.pathElements.length>1).map(V=>{let P=V.pathElements[0],oe=V.pathElements[V.pathElements.length-1];return V.clone(!0).position(0).remove(1).move(P.x,H).line(P.x,P.y).position(V.pathElements.length+1).line(oe.x,H)}).forEach(V=>{let P=I.elem("path",{d:V.stringify()},o.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:s.series[A],path:V.clone(),series:N,seriesIndex:A,axisX:w,axisY:L,chartRect:b,index:A,group:I,element:P,meta:Y})})}},o.reverseData),this.eventEmitter.emit("created",{chartRect:b,axisX:w,axisY:L,svg:c,options:o})}constructor(o,a,s,c){super(o,a,fc,Ei({},fc,s),c),this.data=a}};var Nr=class{constructor(o,a){let c={showArea:!0,fullWidth:!0,scaleMinSpace:20,divisor:5,chartPadding:20,lineSmooth:!1,low:0,axisX:{showGrid:!1,labelOffset:{x:0,y:10},labelInterpolationFnc:(g,v,b)=>v%Math.floor(b.length/(o.clientWidth/100))?null:g},axisY:{onlyInteger:!0,offset:15,labelOffset:{x:0,y:5}}},p=new na(o,a,c);p.on("draw",g=>{g.type==="point"&&g.element.attr({"ct:index":g.index})}),p.container.addEventListener("mouseover",g=>{if(g.target.getAttribute("class")==="ct-point"){let v=parseFloat(getComputedStyle(g.target)["stroke-width"]),b=g.target.getAttribute("ct:index");wi("circle-small-fill",w=>{let L=`${a.labels[b]}
${w} ${a.series[0][b]} ${w}${a.series[1][b]}`;new Tn(L,{referenceElement:g.target,offset:{x:0,y:-v}}).show()})}})}};var ra=class{constructor(){let o=M("[data-view=dashboard] [data-command=clear-cache]"),a=M("[data-view=dashboard] [data-command=make-backup]"),s=M(".dashboard-chart");o&&o.addEventListener("click",()=>{new zt({method:"POST",url:`${Ne.config.baseUri}cache/clear/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},c=>{new Bt(c.message,c.status,{icon:"check-circle"}).show()})}),a&&a.addEventListener("click",function(){let c=this;c.disabled=!0,new zt({method:"POST",url:`${Ne.config.baseUri}backup/make/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},p=>{new Bt(p.message,p.status,{icon:"check-circle"}).show(),p.status==="success"&&setTimeout(()=>{c.disabled=!1,Uo(p.data.uri,M("meta[name=csrf-token]").content)},1e3),p.status==="error"&&(c.disabled=!1)})}),s&&new Nr(s,JSON.parse(s.dataset.chartData))}};var ia=class{constructor(){let o=M("[data-command=expand-all-pages]"),a=M("[data-command=collapse-all-pages]"),s=M("[data-command=reorder-pages]"),c=M("[data-command=change-slug]"),p=M(".page-search"),g=document.getElementById("newPageModal"),v=document.getElementById("slugModal");if(te(".pages-list").forEach(A=>{A.dataset.orderableChildren==="true"&&N(A)}),te(".page-details").forEach(A=>{M(".page-children-toggle",A)&&A.addEventListener("click",I=>{L(A),I.stopPropagation()})}),te(".page-details a").forEach(A=>{A.addEventListener("click",I=>{I.stopPropagation()})}),te(".pages-list .sort-handle").forEach(A=>{A.addEventListener("click",I=>{I.stopPropagation()})}),o&&o.addEventListener("click",()=>{b(),o.blur()}),a&&a.addEventListener("click",()=>{w(),a.blur()}),s&&s.addEventListener("click",()=>{s.classList.toggle("active"),M(".pages-list").classList.toggle("is-reordering"),s.blur()}),p){p.addEventListener("focus",()=>{te(".pages-item").forEach(I=>{I.dataset.expanded=I.classList.contains("expanded")?"true":"false"})});let A=I=>{let E=I.target.value;if(E.length===0)M(".pages-list-root").classList.remove("is-filtered"),te(".pages-item").forEach(z=>{let Y=M(".page-title a",z);Y.innerHTML=Y.textContent,M(".pages-item-row",z).style.display="",z.classList.toggle("is-expanded",z.dataset.expanded==="true")});else{M(".pages-list-root").classList.add("is-filtered");let z=new RegExp(Tr(Dr(E)),"gi");te(".pages-item").forEach(Y=>{let J=M(".page-title a",Y),Z=J.textContent,O=M(".pages-item-row",Y);Z.match(z)!==null?(J.innerHTML=Z.replace(z,"$&"),O.style.display=""):O.style.display="none",Y.classList.add("is-expanded")})}};p.addEventListener("keyup",Cn(A,100)),p.addEventListener("search",A),document.addEventListener("keydown",I=>{(I.ctrlKey||I.metaKey)&&I.key==="f"&&document.activeElement!==p&&(p.focus(),I.preventDefault())})}if(g){M("#page-title",g).addEventListener("keyup",I=>{M("#page-slug",g).value=Rl(I.target.value)});let A=I=>{I.target.value=zl(I.target.value)};M("#page-slug",g).addEventListener("keyup",A),M("#page-slug",g).addEventListener("blur",A),M("#page-parent",g).addEventListener("change",()=>{let I=M('.dropdown-list[data-for="page-parent"] .selected');if(!I)return;let E=I.dataset.allowedTemplates,z=M("#page-template",g);E?(E=E.split(", "),z.dataset.previousValue=z.value,z.value=E[0],M('.select[data-for="page-template"').value=M(`.dropdown-list[data-for="page-template"] .dropdown-item[data-value="${z.value}"]`).innerText,te('.dropdown-list[data-for="page-template"] .dropdown-item').forEach(Y=>{E.includes(Y.dataset.value)||Y.classList.add("disabled")})):("previousValue"in z.dataset&&(z.value=z.dataset.previousValue,delete z.dataset.previousValue,M('.select[data-for="page-template"').value=M(`.dropdown-list[data-for="page-template"] .dropdown-item[data-value="${z.value}"]`).innerText),te('.dropdown-list[data-for="page-template"] .dropdown-item').forEach(Y=>{Y.classList.remove("disabled")}))})}if(v&&c){c.addEventListener("click",()=>{Ne.modals.slugModal.show(null,I=>{let E=document.getElementById("slug").value,z=M("#page-slug",I.element);z.value=E,z.placeholder=E})}),M("#page-slug",v).addEventListener("keydown",I=>{I.key==="Enter"&&M("[data-command=continue]",v).click()});let A=I=>{I.target.value=zl(I.target.value)};M("#page-slug",v).addEventListener("keyup",A),M("#page-slug",v).addEventListener("blur",A),M("[data-command=generate-slug]",v).addEventListener("click",()=>{let I=Rl(document.getElementById("title").value);M("#page-slug",v).value=I,M("#page-slug",v).focus()}),M("[data-command=continue]",v).addEventListener("click",()=>{let I=M("#page-slug",v).value.replace(/^-+|-+$/,"");if(I.length>0){let E=M(".page-route-inner").innerHTML;te("#page-slug, #slug").forEach(z=>{z.value=I}),M("#page-slug",v).value=I,document.getElementById("slug").value=I,M(".page-route-inner").innerHTML=E.replace(/\/[a-z0-9-]+\/$/,`/${I}/`)}Ne.modals.slugModal.hide()})}te(["[data-modal=renameFileModal]"]).forEach(A=>{A.addEventListener("click",()=>{let I=document.getElementById("renameFileModal"),E=M("#file-name",I);E.value=A.dataset.filename,E.setSelectionRange(0,E.value.lastIndexOf("."))})});function b(){te(".pages-item").forEach(A=>{A.classList.add("is-expanded")})}function w(){te(".pages-item").forEach(A=>{A.classList.remove("is-expanded")})}function L(A){A.closest(".pages-item").classList.toggle("is-expanded")}function N(A){let I=[],E=de.create(A,{handle:".sort-handle",filter:".is-not-orderable",forceFallback:!0,swapThreshold:.75,invertSwap:!0,animation:150,onChoose(){let z=document.body.offsetHeight;document.body.style.height=`${z}px`;let Y=window.addEventListener("scroll",()=>{window.document.body.style.height="",window.removeEventListener("scroll",Y)})},onStart(){A.classList.add("is-dragging")},onMove(z){if(z.related.classList.contains("is-not-orderable"))return!1},onEnd(z){if(A.classList.remove("is-dragging"),document.body.style.height="",z.newIndex===z.oldIndex)return;E.option("disabled",!0);let Y={"csrf-token":M("meta[name=csrf-token]").content,page:A.children[z.newIndex].dataset.route,before:A.children[z.oldIndex].dataset.route,parent:A.dataset.parent};new zt({method:"POST",url:`${Ne.config.baseUri}pages/reorder/`,data:Y},J=>{J.status&&new Bt(J.message,J.status,{icon:"check-circle"}).show(),(!J.status||J.status==="error")&&E.sort(I),E.option("disabled",!1),I=E.toArray()})}});I=E.toArray()}}};var oa=class{constructor(){let o=M(".statistics-chart");o&&new Nr(o,JSON.parse(o.dataset.chartData))}};var aa=class{constructor(){if(document.getElementById("updater-component")){let a=M(".update-status"),s=M(".spinner"),c=M(".current-version"),p=M(".current-version-name"),g=M(".new-version"),v=M(".new-version-name"),b=N=>{s.classList.add("spinner-info"),dt("info",s),v.innerHTML=N,g.style.display="block"},w=()=>{s.classList.add("spinner-success"),dt("check",s),c.style.display="block"},L=()=>{s.classList.add("spinner-success"),dt("check",s),p.innerHTML=v.innerHTML,c.style.display="block"};setTimeout(()=>{let N={"csrf-token":M("meta[name=csrf-token]").content};new zt({method:"POST",url:`${Ne.config.baseUri}updates/check/`,data:N},A=>{a.innerHTML=A.message,A.status==="success"?A.data.uptodate===!1?b(A.data.release.name):w():(s.classList.add("spinner-error"),dt("exclamation",s))})},1e3),M("[data-command=install-updates]").addEventListener("click",()=>{g.style.display="none",s.classList.remove("spinner-info"),a.innerHTML=a.dataset.installingText,new zt({method:"POST",url:`${Ne.config.baseUri}updates/update/`,data:{"csrf-token":M("meta[name=csrf-token]").content}},N=>{new Bt(N.message,N.status,{icon:"check-circle"}).show(),a.innerHTML=N.data.status,N.status==="success"?L():(s.classList.add("spinner-error"),dt("exclamation",s))})})}}};var ts=class{constructor(){fo(this,"config",{});fo(this,"modals",{});fo(this,"forms",{})}load(o){this.loadConfig(o),this.loadComponent(Xo,{globalAlias:"modals"}),this.loadComponent(Yo,{globalAlias:"forms"}),this.loadComponent(mo),this.loadComponent(Zo),this.loadComponent(Ko),this.loadComponent(co),this.loadComponent($o),this.loadComponent(Qo),this.loadComponent(vo),this.loadComponent(ra),this.loadComponent(ia),this.loadComponent(oa),this.loadComponent(Jo),this.loadComponent(aa)}loadConfig(o){Object.assign(this.config,o)}loadComponent(o,a={globalAlias:null}){let s=new o(this),{globalAlias:c}=a;c&&(this[c]=s)}},Ne=new ts;return Th(Dp);})(); /*! Bundled license information: sortablejs/modular/sortable.esm.js: diff --git a/panel/src/js/components/inputs/select-input.js b/panel/src/js/components/inputs/select-input.js index f2939e32..585ea321 100644 --- a/panel/src/js/components/inputs/select-input.js +++ b/panel/src/js/components/inputs/select-input.js @@ -26,6 +26,12 @@ export class SelectInput { labelInput.classList.add("select"); labelInput.dataset.for = select.id; + const selectLabel = $('label[for="' + select.id + '"]'); + + if (selectLabel) { + labelInput.setAttribute("aria-label", selectLabel.innerText); + } + if (select.hasAttribute("disabled")) { labelInput.disabled = true; } diff --git a/panel/src/js/components/modal.js b/panel/src/js/components/modal.js index dee6ad88..6207f334 100644 --- a/panel/src/js/components/modal.js +++ b/panel/src/js/components/modal.js @@ -45,6 +45,8 @@ export class Modal { show(action, callback) { const modal = this.element; + modal.setAttribute("role", "dialog"); + modal.setAttribute("aria-modal", "true"); modal.classList.add("show"); if (action) { $("form", modal).action = action; @@ -63,7 +65,10 @@ export class Modal { } hide() { - this.element.classList.remove("show"); + const modal = this.element; + modal.classList.remove("show"); + modal.removeAttribute("role"); + modal.removeAttribute("aria-modal"); this.removeBackdrop(); } diff --git a/panel/src/js/components/tooltips.js b/panel/src/js/components/tooltips.js index 2d90a187..6544cf68 100644 --- a/panel/src/js/components/tooltips.js +++ b/panel/src/js/components/tooltips.js @@ -6,7 +6,7 @@ export class Tooltips { constructor() { $$("[title]", document.body).forEach((element) => { element.dataset.tooltip = element.title; - element.title = ""; + element.removeAttribute("title"); }); $$("[data-tooltip]").forEach((element) => { diff --git a/panel/translations/en.yaml b/panel/translations/en.yaml index 2de7e4ce..5921b128 100644 --- a/panel/translations/en.yaml +++ b/panel/translations/en.yaml @@ -48,6 +48,7 @@ panel.modal.action.uploadFile: Upload a File panel.modal.images.noImages: There are no images here panel.modal.images.noImages.upload: Please upload some images panel.modal.images.title: Select an Image +panel.navigation.toggle: Toggle navigation panel.options.info: Info panel.options.options: Options panel.options.site: Site diff --git a/panel/translations/fr.yaml b/panel/translations/fr.yaml index 1cdcf14d..bbf798fe 100644 --- a/panel/translations/fr.yaml +++ b/panel/translations/fr.yaml @@ -48,6 +48,7 @@ panel.modal.action.uploadFile: Parcourir… panel.modal.images.noImages: Aucun fichier média n’a été trouvé. panel.modal.images.noImages.upload: Sélectionnez vos fichiers à téléverser. panel.modal.images.title: Bibliothèque de médias +panel.navigation.toggle: Afficher/Masquer la navigation panel.options.info: Information panel.options.options: Paramètres panel.options.site: Site diff --git a/panel/translations/it.yaml b/panel/translations/it.yaml index 76247668..f6546b4c 100644 --- a/panel/translations/it.yaml +++ b/panel/translations/it.yaml @@ -48,6 +48,7 @@ panel.modal.action.uploadFile: Carica file panel.modal.images.noImages: Qui non ci sono immagini panel.modal.images.noImages.upload: Carica qualche immagine panel.modal.images.title: Seleziona immagine +panel.navigation.toggle: Mostra/nascondi menu panel.options.info: Informazioni panel.options.options: Impostazioni panel.options.site: Sito diff --git a/panel/translations/pt.yaml b/panel/translations/pt.yaml index 8f349452..7c08ec04 100644 --- a/panel/translations/pt.yaml +++ b/panel/translations/pt.yaml @@ -48,6 +48,7 @@ panel.modal.action.uploadFile: Enviar um ficheiro panel.modal.images.noImages: Não há imagens aqui panel.modal.images.noImages.upload: Por favor carregue algumas imagens panel.modal.images.title: Escolha uma Imagem +panel.navigation.toggle: Alternar Navegação panel.options.info: Informações panel.options.options: Opções panel.options.site: Site diff --git a/panel/translations/ru.yaml b/panel/translations/ru.yaml index 86efab9c..58b4e9aa 100644 --- a/panel/translations/ru.yaml +++ b/panel/translations/ru.yaml @@ -48,6 +48,7 @@ panel.modal.action.uploadFile: Загрузить файл panel.modal.images.noImages: Там нет изображений здесь panel.modal.images.noImages.upload: Пожалуйста, загрузите некоторые изображения panel.modal.images.title: Выберите изображение +panel.navigation.toggle: Переключить навигацию panel.options.info: Информация panel.options.options: Параметры panel.options.site: Сайт diff --git a/panel/views/fields/layout/sections.php b/panel/views/fields/layout/sections.php index ceee631c..c0c6f936 100644 --- a/panel/views/fields/layout/sections.php +++ b/panel/views/fields/layout/sections.php @@ -3,7 +3,7 @@
attr(['class' => ['section', $section->is('collapsible') ? 'collapsible' : '', $section->is('collapsed') ? 'collapsed' : '']]) ?>>
is('collapsible')): ?> - + label() ?>
diff --git a/panel/views/modals/changes.php b/panel/views/modals/changes.php index 1431df05..22db7eed 100644 --- a/panel/views/modals/changes.php +++ b/panel/views/modals/changes.php @@ -1,7 +1,7 @@ -