MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/public_html/wp-content/plugins/essential-grid/admin/assets/js/plugins/utils.min.js
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.ESGMirror=t()}(this,function(){"use strict";var e=navigator.userAgent,t=navigator.platform,r=/gecko\/\d/i.test(e),i=/MSIE \d/.test(e),n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=i||n||o,s=a&&(i?document.documentMode||6:+(o||n)[1]),l=!o&&/WebKit\//.test(e),c=l&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\//.test(e),d=/Opera\//.test(e),p=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),f=/PhantomJS/.test(e),g=!o&&/AppleWebKit/.test(e)&&/Mobile\/\w+/.test(e),m=/Android/.test(e),v=g||m||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=g||/Mac/.test(t),y=/\bCrOS\b/.test(e),w=/win/i.test(t),k=d&&e.match(/Version\/(\d*\.\d*)/);(k=k&&Number(k[1]))&&15<=k&&(l=!(d=!1));var x=b&&(c||d&&(null==k||k<12.11)),S=r||a&&9<=s;function C(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var E,L=function(e,t){var r,i=e.className,n=C(t).exec(i);n&&(r=i.slice(n.index+n[0].length),e.className=i.slice(0,n.index)+(r?n[1]+r:""))};function G(e){for(var t=e.childNodes.length;0<t;--t)e.removeChild(e.firstChild);return e}function T(e,t){return G(e).appendChild(t)}function M(e,t,r,i){var n=document.createElement(e);if(r&&(n.className=r),i&&(n.style.cssText=i),"string"==typeof t)n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function A(e,t,r,i){var n=M(e,t,r,i);return n.setAttribute("role","presentation"),n}function _(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do{if(11==t.nodeType&&(t=t.host),t==e)return!0}while(t=t.parentNode)}function O(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function N(e,t){var r=e.className;C(t).test(r)||(e.className+=(r?" ":"")+t)}function D(e,t){for(var r=e.split(" "),i=0;i<r.length;i++)r[i]&&!C(r[i]).test(t)&&(t+=" "+r[i]);return t}E=document.createRange?function(e,t,r,i){var n=document.createRange();return n.setEnd(i||e,r),n.setStart(e,t),n}:function(e,t,r){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(e){return i}return i.collapse(!0),i.moveEnd("character",r),i.moveStart("character",t),i};var I=function(e){e.select()};function $(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function P(e,t,r){for(var i in t=t||{},e)!e.hasOwnProperty(i)||!1===r&&t.hasOwnProperty(i)||(t[i]=e[i]);return t}function z(e,t,r,i,n){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);for(var o=i||0,a=n||0;;){var s=e.indexOf("\t",o);if(s<0||t<=s)return a+(t-o);a+=s-o,a+=r-a%r,o=s+1}}g?I=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(I=function(e){try{e.select()}catch(e){}});var H=function(){this.id=null,this.f=null,this.time=0,this.handler=$(this.onTimeout,this)};function R(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}H.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-new Date)},H.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};var W=50,F={toString:function(){return"ESGMirror.Pass"}},j={scroll:!1},B={origin:"*mouse"},q={origin:"+move"};function U(e,t,r){for(var i=0,n=0;;){var o=e.indexOf("\t",i);-1==o&&(o=e.length);var a=o-i;if(o==e.length||t<=n+a)return i+Math.min(a,t-n);if(n+=o-i,i=o+1,t<=(n+=r-n%r))return i}}var V=[""];function K(e){for(;V.length<=e;)V.push(Y(V)+" ");return V[e]}function Y(e){return e[e.length-1]}function X(e,t){for(var r=[],i=0;i<e.length;i++)r[i]=t(e[i],i);return r}function Q(){}function Z(e,t){var r=Object.create?Object.create(e):(Q.prototype=e,new Q);return t&&P(t,r),r}var J=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ee(e){return/\w/.test(e)||"€"<e&&(e.toUpperCase()!=e.toLowerCase()||J.test(e))}function te(e,t){return t?!!(-1<t.source.indexOf("\\w")&&ee(e))||t.test(e):ee(e)}function re(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return;return 1}var ie=/[\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 ne(e){return 768<=e.charCodeAt(0)&&ie.test(e)}function oe(e,t,r){for(;(r<0?0<t:t<e.length)&&ne(e.charAt(t));)t+=r;return t}function ae(e,t,r){for(var i=r<t?-1:1;;){if(t==r)return t;var n=(t+r)/2,o=i<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+i}}var se=null;function le(e,t,r){var i;se=null;for(var n=0;n<e.length;++n){var o=e[n];if(o.from<t&&o.to>t)return n;o.to==t&&(o.from!=o.to&&"before"==r?i=n:se=n),o.from==t&&(o.from!=o.to&&"before"!=r?i=n:se=n)}return null!=i?i:se}var ce,ue,de,pe,he,fe=("bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN","nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",ce=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,ue=/[stwN]/,de=/[LRr]/,pe=/[Lb1n]/,he=/[1n]/,function(e,t){var r="ltr"==t?"L":"R";if(0==e.length||"ltr"==t&&!ce.test(e))return!1;for(var i,n=e.length,o=[],a=0;a<n;++a)o.push((i=e.charCodeAt(a))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(i):1424<=i&&i<=1524?"R":1536<=i&&i<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(i-1536):1774<=i&&i<=2220?"r":8192<=i&&i<=8203?"w":8204==i?"b":"L");for(var s=0,l=r;s<n;++s){var c=o[s];"m"==c?o[s]=l:l=c}for(var u=0,d=r;u<n;++u){var p=o[u];"1"==p&&"r"==d?o[u]="n":de.test(p)&&"r"==(d=p)&&(o[u]="R")}for(var h=1,f=o[0];h<n-1;++h){var g=o[h];"+"==g&&"1"==f&&"1"==o[h+1]?o[h]="1":","!=g||f!=o[h+1]||"1"!=f&&"n"!=f||(o[h]=f),f=g}for(var m=0;m<n;++m){var v=o[m];if(","==v)o[m]="N";else if("%"==v){var b=void 0;for(b=m+1;b<n&&"%"==o[b];++b);for(var y=m&&"!"==o[m-1]||b<n&&"1"==o[b]?"1":"N",w=m;w<b;++w)o[w]=y;m=b-1}}for(var k=0,x=r;k<n;++k){var S=o[k];"L"==x&&"1"==S?o[k]="L":de.test(S)&&(x=S)}for(var C=0;C<n;++C)if(ue.test(o[C])){var E=void 0;for(E=C+1;E<n&&ue.test(o[E]);++E);for(var L="L"==(C?o[C-1]:r),G=L==("L"==(E<n?o[E]:r))?L?"L":"R":r,T=C;T<E;++T)o[T]=G;C=E-1}for(var M,A=[],_=0;_<n;)if(pe.test(o[_])){var O=_;for(++_;_<n&&pe.test(o[_]);++_);A.push(new ge(0,O,_))}else{var N=_,D=A.length,I="rtl"==t?1:0;for(++_;_<n&&"L"!=o[_];++_);for(var $=N;$<_;)if(he.test(o[$])){N<$&&(A.splice(D,0,new ge(1,N,$)),D+=I);var P=$;for(++$;$<_&&he.test(o[$]);++$);A.splice(D,0,new ge(2,P,$)),D+=I,N=$}else++$;N<_&&A.splice(D,0,new ge(1,N,_))}return"ltr"==t&&(1==A[0].level&&(M=e.match(/^\s+/))&&(A[0].from=M[0].length,A.unshift(new ge(0,0,M[0].length))),1==Y(A).level&&(M=e.match(/\s+$/))&&(Y(A).to-=M[0].length,A.push(new ge(0,n-M[0].length,n)))),"rtl"==t?A.reverse():A});function ge(e,t,r){this.level=e,this.from=t,this.to=r}function me(e,t){var r=e.order;return null==r&&(r=e.order=fe(e.text,t)),r}var ve=[],be=function(e,t,r){var i;e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent?e.attachEvent("on"+t,r):(i=e._handlers||(e._handlers={}))[t]=(i[t]||ve).concat(r)};function ye(e,t){return e._handlers&&e._handlers[t]||ve}function we(e,t,r){var i,n,o;e.removeEventListener?e.removeEventListener(t,r,!1):e.detachEvent?e.detachEvent("on"+t,r):!(n=(i=e._handlers)&&i[t])||-1<(o=R(n,r))&&(i[t]=n.slice(0,o).concat(n.slice(o+1)))}function ke(e,t){var r=ye(e,t);if(r.length)for(var i=Array.prototype.slice.call(arguments,2),n=0;n<r.length;++n)r[n].apply(null,i)}function xe(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,r||t.type,e,t),Te(t)||t.esgmirrorIgnore}function Se(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<t.length;++i)-1==R(r,t[i])&&r.push(t[i])}function Ce(e,t){return 0<ye(e,t).length}function Ee(e){e.prototype.on=function(e,t){be(this,e,t)},e.prototype.off=function(e,t){we(this,e,t)}}function Le(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ge(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Te(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function Me(e){Le(e),Ge(e)}function Ae(e){return e.target||e.srcElement}function _e(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Oe,Ne,De=function(){if(a&&s<9)return!1;var e=M("div");return"draggable"in e||"dragDrop"in e}();function Ie(e){var t;null==Oe&&(t=M("span","​"),T(e,M("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Oe=t.offsetWidth<=1&&2<t.offsetHeight&&!(a&&s<8)));var r=Oe?M("span","​"):M("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function $e(e){if(null!=Ne)return Ne;var t=T(e,document.createTextNode("AخA")),r=E(t,0,1).getBoundingClientRect(),i=E(t,1,2).getBoundingClientRect();return G(e),r&&r.left!=r.right&&(Ne=i.right-r.right<3)}var Pe,ze=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,r=[],i=e.length;t<=i;){var n=e.indexOf("\n",t);-1==n&&(n=e.length);var o=e.slice(t,"\r"==e.charAt(n-1)?n-1:n),a=o.indexOf("\r");-1!=a?(r.push(o.slice(0,a)),t+=a+1):(r.push(o),t=n+1)}return r}:function(e){return e.split(/\r\n?|\n/)},He=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Re="oncopy"in(Pe=M("div"))||(Pe.setAttribute("oncopy","return;"),"function"==typeof Pe.oncopy),We=null,Fe={},je={};function Be(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=Z(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Be("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Be("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function qe(e,t){t=Be(t);var r=Fe[t.name];if(!r)return qe(e,"text/plain");var i=r(e,t);if(Ue.hasOwnProperty(t.name)){var n=Ue[t.name];for(var o in n)n.hasOwnProperty(o)&&(i.hasOwnProperty(o)&&(i["_"+o]=i[o]),i[o]=n[o])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)i[a]=t.modeProps[a];return i}var Ue={};function Ve(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var r={};for(var i in t){var n=t[i];n instanceof Array&&(n=n.concat([])),r[i]=n}return r}function Ke(e,t){for(var r;e.innerMode&&(r=e.innerMode(t))&&r.mode!=e;)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ye(e,t,r){return!e.startState||e.startState(t,r)}var Xe=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};function Qe(e,t){if((t-=e.first)<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 i=0;;++i){var n=r.children[i],o=n.chunkSize();if(t<o){r=n;break}t-=o}return r.lines[t]}function Ze(e,t,r){var i=[],n=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;n==r.line&&(o=o.slice(0,r.ch)),n==t.line&&(o=o.slice(t.ch)),i.push(o),++n}),i}function Je(e,t,r){var i=[];return e.iter(t,r,function(e){i.push(e.text)}),i}function et(e,t){var r=t-e.height;if(r)for(var i=e;i;i=i.parent)i.height+=r}function tt(e){if(null==e.parent)return null;for(var t=e.parent,r=R(t.lines,e),i=t.parent;i;i=(t=i).parent)for(var n=0;i.children[n]!=t;++n)r+=i.children[n].chunkSize();return r+t.first}function rt(e,t){var r=e.first;e:do{for(var i=0;i<e.children.length;++i){var n=e.children[i],o=n.height;if(t<o){e=n;continue e}t-=o,r+=n.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var s=e.lines[a].height;if(t<s)break;t-=s}return r+a}function it(e,t){return t>=e.first&&t<e.first+e.size}function nt(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function ot(e,t,r){if(void 0===r&&(r=null),!(this instanceof ot))return new ot(e,t,r);this.line=e,this.ch=t,this.sticky=r}function at(e,t){return e.line-t.line||e.ch-t.ch}function st(e,t){return e.sticky==t.sticky&&0==at(e,t)}function lt(e){return ot(e.line,e.ch)}function ct(e,t){return at(e,t)<0?t:e}function ut(e,t){return at(e,t)<0?e:t}function dt(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function pt(e,t){if(t.line<e.first)return ot(e.first,0);var r,i,n,o=e.first+e.size-1;return t.line>o?ot(o,Qe(e,o).text.length):(i=Qe(e,(r=t).line).text.length,null==(n=r.ch)||i<n?ot(r.line,i):n<0?ot(r.line,0):r)}function ht(e,t){for(var r=[],i=0;i<t.length;i++)r[i]=pt(e,t[i]);return r}Xe.prototype.eol=function(){return this.pos>=this.string.length},Xe.prototype.sol=function(){return this.pos==this.lineStart},Xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Xe.prototype.eat=function(e){var t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e.test?e.test(t):e(t)))return++this.pos,t},Xe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},Xe.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Xe.prototype.skipToEnd=function(){this.pos=this.string.length},Xe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(-1<t)return this.pos=t,!0},Xe.prototype.backUp=function(e){this.pos-=e},Xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=z(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.indentation=function(){return z(this.string,null,this.tabSize)-(this.lineStart?z(this.string,this.lineStart,this.tabSize):0)},Xe.prototype.match=function(e,t,r){if("string"!=typeof e){var i=this.string.slice(this.pos).match(e);return i&&0<i.index?null:(i&&!1!==t&&(this.pos+=i[0].length),i)}function n(e){return r?e.toLowerCase():e}if(n(this.string.substr(this.pos,e.length))==n(e))return!1!==t&&(this.pos+=e.length),!0},Xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},Xe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},Xe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},Xe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ft=function(e,t){this.state=e,this.lookAhead=t},gt=function(e,t,r,i){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};function mt(e,t,r,i){var n=[e.state.modeGen],o={};Et(e,t.text,e.doc.mode,r,function(e,t){return n.push(e,t)},o,i);for(var a=r.state,s=function(i){r.baseTokens=n;var s=e.state.overlays[i],l=1,c=0;r.state=!0,Et(e,t.text,s.mode,r,function(e,t){for(var r=l;c<e;){var i=n[l];e<i&&n.splice(l,1,e,n[l+1],i),l+=2,c=Math.min(e,i)}if(t)if(s.opaque)n.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;r<l;r+=2){var o=n[r+1];n[r+1]=(o?o+" ":"")+"overlay "+t}},o),r.state=a,r.baseTokens=null,r.baseTokenPos=1},l=0;l<e.state.overlays.length;++l)s(l);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function vt(e,t,r){var i,n,o;return t.styles&&t.styles[0]==e.state.modeGen||(i=bt(e,tt(t)),n=t.text.length>e.options.maxHighlightLength&&Ve(e.doc.mode,i.state),o=mt(e,t,i),n&&(i.state=n),t.stateAfter=i.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))),t.styles}function bt(e,t,r){var i=e.doc,n=e.display;if(!i.mode.startState)return new gt(i,!0,t);var o=function(e,t,r){for(var i,n,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;a<s;--s){if(s<=o.first)return o.first;var l=Qe(o,s-1),c=l.stateAfter;if(c&&(!r||s+(c instanceof ft?c.lookAhead:0)<=o.modeFrontier))return s;var u=z(l.text,null,e.options.tabSize);(null==n||u<i)&&(n=s-1,i=u)}return n}(e,t,r),a=o>i.first&&Qe(i,o-1).stateAfter,s=a?gt.fromSaved(i,a,o):new gt(i,Ye(i.mode),o);return i.iter(o,t,function(r){yt(e,r.text,s);var i=s.line;r.stateAfter=i==t-1||i%5==0||i>=n.viewFrom&&i<n.viewTo?s.save():null,s.nextLine()}),r&&(i.modeFrontier=s.line),s}function yt(e,t,r,i){var n=e.doc.mode,o=new Xe(t,e.options.tabSize,r);for(o.start=o.pos=i||0,""==t&&wt(n,r.state);!o.eol();)kt(n,o,r.state),o.start=o.pos}function wt(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=Ke(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function kt(e,t,r,i){for(var n=0;n<10;n++){i&&(i[0]=Ke(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}gt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},gt.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}},gt.prototype.nextLine=function(){this.line++,0<this.maxLookAhead&&this.maxLookAhead--},gt.fromSaved=function(e,t,r){return t instanceof ft?new gt(e,Ve(e.mode,t.state),r,t.lookAhead):new gt(e,Ve(e.mode,t),r)},gt.prototype.save=function(e){var t=!1!==e?Ve(this.doc.mode,this.state):this.state;return 0<this.maxLookAhead?new ft(t,this.maxLookAhead):t};var xt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function St(e,t,r,i){var n,o,a=e.doc,s=a.mode,l=Qe(a,(t=pt(a,t)).line),c=bt(e,t.line,r),u=new Xe(l.text,e.options.tabSize,c);for(i&&(o=[]);(i||u.pos<t.ch)&&!u.eol();)u.start=u.pos,n=kt(s,u,c.state),i&&o.push(new xt(u,n,Ve(a.mode,c.state)));return i?o:new xt(u,n,c.state)}function Ct(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var i=r[1]?"bgClass":"textClass";null==t[i]?t[i]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[i])||(t[i]+=" "+r[2])}return e}function Et(e,t,r,i,n,o,a){var s=r.flattenSpans;null==s&&(s=e.options.flattenSpans);var l=0,c=null,u=new Xe(t,e.options.tabSize,i),d=e.options.addModeClass&&[null];for(""==t&&Ct(wt(r,i.state),o);!u.eol();){var p,h=u.pos>e.options.maxHighlightLength?(s=!1,a&&yt(e,t,i,u.pos),u.pos=t.length,null):Ct(kt(r,u,i.state,d),o);if(!d||(p=d[0].name)&&(h="m-"+(h?p+" "+h:p)),!s||c!=h){for(;l<u.start;)n(l=Math.min(u.start,l+5e3),c);c=h}u.start=u.pos}for(;l<u.pos;){var f=Math.min(u.pos,l+5e3);n(f,c),l=f}}var Lt=!1,Gt=!1;function Tt(e,t,r){this.marker=e,this.from=t,this.to=r}function Mt(e,t){if(e)for(var r=0;r<e.length;++r){var i=e[r];if(i.marker==t)return i}}function At(e,t){for(var r,i=0;i<e.length;++i)e[i]!=t&&(r=r||[]).push(e[i]);return r}function _t(e,t){if(t.full)return null;var r=it(e,t.from.line)&&Qe(e,t.from.line).markedSpans,i=it(e,t.to.line)&&Qe(e,t.to.line).markedSpans;if(!r&&!i)return null;var n=t.from.ch,o=t.to.ch,a=0==at(t.from,t.to),s=function(e,t,r){var i;if(e)for(var n=0;n<e.length;++n){var o,a=e[n],s=a.marker;null!=a.from&&!(s.inclusiveLeft?a.from<=t:a.from<t)&&(a.from!=t||"bookmark"!=s.type||r&&a.marker.insertLeft)||(o=null==a.to||(s.inclusiveRight?a.to>=t:a.to>t),(i=i||[]).push(new Tt(s,a.from,o?null:a.to)))}return i}(r,n,a),l=function(e,t,r){var i;if(e)for(var n=0;n<e.length;++n){var o,a=e[n],s=a.marker;null!=a.to&&!(s.inclusiveRight?a.to>=t:a.to>t)&&(a.from!=t||"bookmark"!=s.type||r&&!a.marker.insertLeft)||(o=null==a.from||(s.inclusiveLeft?a.from<=t:a.from<t),(i=i||[]).push(new Tt(s,o?null:a.from-t,null==a.to?null:a.to-t)))}return i}(i,o,a),c=1==t.text.length,u=Y(t.text).length+(c?n:0);if(s)for(var d=0;d<s.length;++d){var p,h=s[d];null==h.to&&((p=Mt(l,h.marker))?c&&(h.to=null==p.to?null:p.to+u):h.to=n)}if(l)for(var f=0;f<l.length;++f){var g=l[f];null!=g.to&&(g.to+=u),null==g.from?Mt(s,g.marker)||(g.from=u,c&&(s=s||[]).push(g)):(g.from+=u,c&&(s=s||[]).push(g))}s=s&&Ot(s),l&&l!=s&&(l=Ot(l));var m=[s];if(!c){var v,b=t.text.length-2;if(0<b&&s)for(var y=0;y<s.length;++y)null==s[y].to&&(v=v||[]).push(new Tt(s[y].marker,null,null));for(var w=0;w<b;++w)m.push(v);m.push(l)}return m}function Ot(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&!1!==r.marker.clearWhenEmpty&&e.splice(t--,1)}return e.length?e:null}function Nt(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Dt(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function It(e){return e.inclusiveLeft?-1:0}function $t(e){return e.inclusiveRight?1:0}function Pt(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var i=e.find(),n=t.find(),o=at(i.from,n.from)||It(e)-It(t);return o?-o:at(i.to,n.to)||$t(e)-$t(t)||t.id-e.id}function zt(e,t){var r,i=Gt&&e.markedSpans;if(i)for(var n=void 0,o=0;o<i.length;++o)(n=i[o]).marker.collapsed&&null==(t?n.from:n.to)&&(!r||Pt(r,n.marker)<0)&&(r=n.marker);return r}function Ht(e){return zt(e,!0)}function Rt(e){return zt(e,!1)}function Wt(e,t){var r,i=Gt&&e.markedSpans;if(i)for(var n=0;n<i.length;++n){var o=i[n];o.marker.collapsed&&(null==o.from||o.from<t)&&(null==o.to||o.to>t)&&(!r||Pt(r,o.marker)<0)&&(r=o.marker)}return r}function Ft(e,t,r,i,n){var o=Qe(e,t),a=Gt&&o.markedSpans;if(a)for(var s=0;s<a.length;++s){var l=a[s];if(l.marker.collapsed){var c=l.marker.find(0),u=at(c.from,r)||It(l.marker)-It(n),d=at(c.to,i)||$t(l.marker)-$t(n);if(!(0<=u&&d<=0||u<=0&&0<=d)&&(u<=0&&(l.marker.inclusiveRight&&n.inclusiveLeft?0<=at(c.to,r):0<at(c.to,r))||0<=u&&(l.marker.inclusiveRight&&n.inclusiveLeft?at(c.from,i)<=0:at(c.from,i)<0)))return 1}}}function jt(e){for(var t;t=Ht(e);)e=t.find(-1,!0).line;return e}function Bt(e,t){var r=Qe(e,t),i=jt(r);return r==i?t:tt(i)}function qt(e,t){if(t>e.lastLine())return t;var r,i=Qe(e,t);if(!Ut(e,i))return t;for(;r=Rt(i);)i=r.find(1,!0).line;return tt(i)+1}function Ut(e,t){var r=Gt&&t.markedSpans;if(r)for(var i=void 0,n=0;n<r.length;++n)if((i=r[n]).marker.collapsed){if(null==i.from)return!0;if(!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&Vt(e,t,i))return!0}}function Vt(e,t,r){if(null==r.to){var i=r.marker.find(1,!0);return Vt(e,i.line,Mt(i.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var n=void 0,o=0;o<t.markedSpans.length;++o)if((n=t.markedSpans[o]).marker.collapsed&&!n.marker.widgetNode&&n.from==r.to&&(null==n.to||n.to!=r.from)&&(n.marker.inclusiveLeft||r.marker.inclusiveRight)&&Vt(e,t,n))return!0}function Kt(e){for(var t=0,r=(e=jt(e)).parent,i=0;i<r.lines.length;++i){var n=r.lines[i];if(n==e)break;t+=n.height}for(var o=r.parent;o;o=(r=o).parent)for(var a=0;a<o.children.length;++a){var s=o.children[a];if(s==r)break;t+=s.height}return t}function Yt(e){if(0==e.height)return 0;for(var t,r=e.text.length,i=e;t=Ht(i);){var n=t.find(0,!0);i=n.from.line;r+=n.from.ch-n.to.ch}for(i=e;t=Rt(i);){var o=t.find(0,!0);r-=i.text.length-o.from.ch,r+=(i=o.to.line).text.length-o.to.ch}return r}function Xt(e){var t=e.display,r=e.doc;t.maxLine=Qe(r,r.first),t.maxLineLength=Yt(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=Yt(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}var Qt=function(e,t,r){this.text=e,Dt(this,t),this.height=r?r(this):1};Qt.prototype.lineNo=function(){return tt(this)},Ee(Qt);var Zt={},Jt={};function er(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?Jt:Zt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function tr(e,t){var r=A("span",null,null,l?"padding-right: .1px":null),i={pre:A("pre",[r],"ESGMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n,o=0;o<=(t.rest?t.rest.length:0);o++){var a=o?t.rest[o-1]:t.line,s=void 0;i.pos=0,i.addToken=rr,$e(e.display.measure)&&(s=me(a,e.doc.direction))&&(i.addToken=ir(i.addToken,s)),i.map=[],or(a,i,vt(e,a,t!=e.display.externalMeasured&&tt(a))),a.styleClasses&&(a.styleClasses.bgClass&&(i.bgClass=D(a.styleClasses.bgClass,i.bgClass||"")),a.styleClasses.textClass&&(i.textClass=D(a.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(Ie(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return l&&(n=i.content.lastChild,(/\bcm-tab\b/.test(n.className)||n.querySelector&&n.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")),ke(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=D(i.pre.className,i.textClass||"")),i}function rr(e,t,r,i,n,o,l){if(t){var c,u=e.splitSpaces?function(e,t){if(1<e.length&&!/  /.test(e))return e;for(var r=t,i="",n=0;n<e.length;n++){var o=e.charAt(n);" "!=o||!r||n!=e.length-1&&32!=e.charCodeAt(n+1)||(o=" "),i+=o,r=" "==o}return i}(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var h=0;;){d.lastIndex=h;var f,g=d.exec(t),m=g?g.index-h:t.length-h;if(m&&(f=document.createTextNode(u.slice(h,h+m)),a&&s<9?c.appendChild(M("span",[f])):c.appendChild(f),e.map.push(e.pos,e.pos+m,f),e.col+=m,e.pos+=m),!g)break;h+=1+m;var v,b,y=void 0;"\t"==g[0]?(b=(v=e.cm.options.tabSize)-e.col%v,(y=c.appendChild(M("span",K(b),"cm-tab"))).setAttribute("role","presentation"),y.setAttribute("cm-text","\t"),e.col+=b):("\r"==g[0]||"\n"==g[0]?(y=c.appendChild(M("span","\r"==g[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",g[0]):((y=e.cm.options.specialCharPlaceholder(g[0])).setAttribute("cm-text",g[0]),a&&s<9?c.appendChild(M("span",[y])):c.appendChild(y)),e.col+=1),e.map.push(e.pos,e.pos+1,y),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&s<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||i||n||p||o){var w=r||"";i&&(w+=i),n&&(w+=n);var k=M("span",[c],w,o);if(l)for(var x in l)l.hasOwnProperty(x)&&"style"!=x&&"class"!=x&&k.setAttribute(x,l[x]);return e.content.appendChild(k)}e.content.appendChild(c)}}function ir(e,t){return function(r,i,n,o,a,s,l){n=n?n+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+i.length;;){for(var d=void 0,p=0;p<t.length&&!((d=t[p]).to>c&&d.from<=c);p++);if(d.to>=u)return e(r,i,n,o,a,s,l);e(r,i.slice(0,d.to-c),n,o,null,s,l),o=null,i=i.slice(d.to-c),c=d.to}}}function nr(e,t,r,i){var n=!i&&r.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!i&&e.cm.display.input.needsContentAttribute&&(n=n||e.content.appendChild(document.createElement("span"))).setAttribute("cm-marker",r.id),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function or(e,t,r){var i=e.markedSpans,n=e.text,o=0;if(i)for(var a,s,l,c,u,d,p,h=n.length,f=0,g=1,m="",v=0;;){if(v==f){l=c=u=s="",d=p=null,v=1/0;for(var b=[],y=void 0,w=0;w<i.length;++w){var k=i[w],x=k.marker;if("bookmark"==x.type&&k.from==f&&x.widgetNode)b.push(x);else if(k.from<=f&&(null==k.to||k.to>f||x.collapsed&&k.to==f&&k.from==f)){if(null!=k.to&&k.to!=f&&v>k.to&&(v=k.to,c=""),x.className&&(l+=" "+x.className),x.css&&(s=(s?s+";":"")+x.css),x.startStyle&&k.from==f&&(u+=" "+x.startStyle),x.endStyle&&k.to==v&&(y=y||[]).push(x.endStyle,k.to),x.title&&((p=p||{}).title=x.title),x.attributes)for(var S in x.attributes)(p=p||{})[S]=x.attributes[S];x.collapsed&&(!d||Pt(d.marker,x)<0)&&(d=k)}else k.from>f&&v>k.from&&(v=k.from)}if(y)for(var C=0;C<y.length;C+=2)y[C+1]==v&&(c+=" "+y[C]);if(!d||d.from==f)for(var E=0;E<b.length;++E)nr(t,0,b[E]);if(d&&(d.from||0)==f){if(nr(t,(null==d.to?h+1:d.to)-f,d.marker,null==d.from),null==d.to)return;d.to==f&&(d=!1)}}if(h<=f)break;for(var L=Math.min(h,v);;){if(m){var G,T=f+m.length;if(d||(G=L<T?m.slice(0,L-f):m,t.addToken(t,G,a?a+l:l,u,f+G.length==v?c:"",s,p)),L<=T){m=m.slice(L-f),f=L;break}f=T,u=""}m=n.slice(o,o=r[g++]),a=er(r[g++],t.cm.options)}}else for(var M=1;M<r.length;M+=2)t.addToken(t,n.slice(o,o=r[M]),er(r[M+1],t.cm.options))}function ar(e,t,r){this.line=t,this.rest=function(e){for(var t,r;t=Rt(e);)e=t.find(1,!0).line,(r=r||[]).push(e);return r}(t),this.size=this.rest?tt(Y(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ut(e,t)}function sr(e,t,r){for(var i=[],n=t;n<r;n=a){var o=new ar(e.doc,Qe(e.doc,n),n),a=n+o.size;i.push(o)}return i}var lr=null;var cr=null;function ur(e,t){var r=ye(e,t);if(r.length){var i,n=Array.prototype.slice.call(arguments,2);lr?i=lr.delayedCallbacks:cr?i=cr:(i=cr=[],setTimeout(dr,0));for(var o=function(e){i.push(function(){return r[e].apply(null,n)})},a=0;a<r.length;++a)o(a)}}function dr(){var e=cr;cr=null;for(var t=0;t<e.length;++t)e[t]()}function pr(e,t,r,i){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];"text"==o?gr(e,t):"gutter"==o?vr(e,t,r,i):"class"==o?mr(e,t):"widget"==o&&br(e,t,i)}t.changes=null}function hr(e){return e.node==e.text&&(e.node=M("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&s<8&&(e.node.style.zIndex=2)),e.node}function fr(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):tr(e,t)}function gr(e,t){var r=t.text.className,i=fr(e,t);t.text==t.node&&(t.node=i.pre),t.text.parentNode.replaceChild(i.pre,t.text),t.text=i.pre,i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,mr(e,t)):r&&(t.text.className=r)}function mr(e,t){var r,i,n,o;r=e,(o=(i=t).bgClass?i.bgClass+" "+(i.line.bgClass||""):i.line.bgClass)&&(o+=" ESGMirror-linebackground"),i.background?o?i.background.className=o:(i.background.parentNode.removeChild(i.background),i.background=null):o&&(n=hr(i),i.background=n.insertBefore(M("div",null,o),n.firstChild),r.display.input.setUneditable(i.background)),t.line.wrapClass?hr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var a=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=a||""}function vr(e,t,r,i){var n;t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass&&(n=hr(t),t.gutterBackground=M("div",null,"ESGMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text));var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=hr(t),s=t.gutter=M("div",null,"ESGMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(s),a.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["ESGMirror-linenumbers"]||(t.lineNumber=s.appendChild(M("div",nt(e.options,r),"ESGMirror-linenumber ESGMirror-gutter-elt","left: "+i.gutterLeft["ESGMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var l=0;l<e.display.gutterSpecs.length;++l){var c=e.display.gutterSpecs[l].className,u=o.hasOwnProperty(c)&&o[c];u&&s.appendChild(M("div",[u],"ESGMirror-gutter-elt","left: "+i.gutterLeft[c]+"px; width: "+i.gutterWidth[c]+"px"))}}}function br(e,t,r){t.alignable&&(t.alignable=null);for(var i=C("ESGMirror-linewidget"),n=t.node.firstChild,o=void 0;n;n=o)o=n.nextSibling,i.test(n.className)&&t.node.removeChild(n);yr(e,t,r)}function yr(e,t,r){if(wr(e,t.line,t,r,!0),t.rest)for(var i=0;i<t.rest.length;i++)wr(e,t.rest[i],t,r,!1)}function wr(e,t,r,i,n){if(t.widgets)for(var o=hr(r),a=0,s=t.widgets;a<s.length;++a){var l=s[a],c=M("div",[l.node],"ESGMirror-linewidget"+(l.className?" "+l.className:""));l.handleMouseEvents||c.setAttribute("cm-ignore-events","true"),kr(l,c,r,i),e.display.input.setUneditable(c),n&&l.above?o.insertBefore(c,r.gutter||r.text):o.appendChild(c),ur(l,"redraw")}}function kr(e,t,r,i){var n;e.noHScroll&&((r.alignable||(r.alignable=[])).push(t),n=i.wrapperWidth,t.style.left=i.fixedPos+"px",e.coverGutter||(n-=i.gutterTotalWidth,t.style.paddingLeft=i.gutterTotalWidth+"px"),t.style.width=n+"px"),e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-i.gutterTotalWidth+"px"))}function xr(e){if(null!=e.height)return e.height;var t,r=e.doc.cm;return r?(_(document.body,e.node)||(t="position: relative;",e.coverGutter&&(t+="margin-left: -"+r.display.gutters.offsetWidth+"px;"),e.noHScroll&&(t+="width: "+r.display.wrapper.clientWidth+"px;"),T(r.display.measure,M("div",[e.node],null,t))),e.height=e.node.parentNode.offsetHeight):0}function Sr(e,t){for(var r=Ae(t);r!=e.wrapper;r=r.parentNode)if(!r||1==r.nodeType&&"true"==r.getAttribute("cm-ignore-events")||r.parentNode==e.sizer&&r!=e.mover)return 1}function Cr(e){return e.lineSpace.offsetTop}function Er(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Lr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=T(e.measure,M("pre","x","ESGMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,i={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return isNaN(i.left)||isNaN(i.right)||(e.cachedPaddingH=i),i}function Gr(e){return W-e.display.nativeBarWidth}function Tr(e){return e.display.scroller.clientWidth-Gr(e)-e.display.barWidth}function Mr(e){return e.display.scroller.clientHeight-Gr(e)-e.display.barHeight}function Ar(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==t)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var n=0;n<e.rest.length;n++)if(tt(e.rest[n])>r)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}function _r(e,t,r,i){return Dr(e,Nr(e,t),r,i)}function Or(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[ci(e,t)];var r=e.display.externalMeasured;return r&&t>=r.lineN&&t<r.lineN+r.size?r:void 0}function Nr(e,t){var r=tt(t),i=Or(e,r);i&&!i.text?i=null:i&&i.changes&&(pr(e,i,r,ni(e)),e.curOp.forceUpdate=!0);var n=Ar(i=i||function(e,t){var r=tt(t=jt(t)),i=e.display.externalMeasured=new ar(e.doc,t,r);i.lineN=r;var n=i.built=tr(e,i);return i.text=n.pre,T(e.display.lineMeasure,n.pre),i}(e,t),t,r);return{line:t,view:i,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Dr(e,t,r,i,n){t.before&&(r=-1);var o,l=r+(i||"");return t.cache.hasOwnProperty(l)?o=t.cache[l]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(e,t,r){var i=e.options.lineWrapping,n=i&&Tr(e);if(!t.measure.heights||i&&t.measure.width!=n){var o=t.measure.heights=[];if(i){t.measure.width=n;for(var a=t.text.firstChild.getClientRects(),s=0;s<a.length-1;s++){var l=a[s],c=a[s+1];2<Math.abs(l.bottom-c.bottom)&&o.push((l.bottom+c.top)/2-r.top)}}o.push(r.bottom-r.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,r,i){var n,o,l,c=Pr(t.map,r,i),u=c.node,d=c.start,p=c.end,h=c.collapse;if(3==u.nodeType){for(var f=0;f<4;f++){for(;d&&ne(t.line.text.charAt(c.coverStart+d));)--d;for(;c.coverStart+p<c.coverEnd&&ne(t.line.text.charAt(c.coverStart+p));)++p;if((n=a&&s<9&&0==d&&p==c.coverEnd-c.coverStart?u.parentNode.getBoundingClientRect():zr(E(u,d,p).getClientRects(),i)).left||n.right||0==d)break;p=d,--d,h="right"}a&&s<11&&(n=function(e,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(e){if(null!=We)return We;var t=T(e,M("span","x")),r=t.getBoundingClientRect(),i=E(t,0,1).getBoundingClientRect();return We=1<Math.abs(r.left-i.left)}(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*i,bottom:t.bottom*i}}(e.display.measure,n))}else 0<d&&(h=i="right"),n=e.options.lineWrapping&&1<(o=u.getClientRects()).length?o["right"==i?o.length-1:0]:u.getBoundingClientRect();!(a&&s<9)||d||n&&(n.left||n.right)||(n=(l=u.parentNode.getClientRects()[0])?{left:l.left,right:l.left+ii(e.display),top:l.top,bottom:l.bottom}:$r);for(var g=n.top-t.rect.top,m=n.bottom-t.rect.top,v=(g+m)/2,b=t.view.measure.heights,y=0;y<b.length-1&&!(v<b[y]);y++);var w=y?b[y-1]:0,k=b[y],x={left:("right"==h?n.right:n.left)-t.rect.left,right:("left"==h?n.left:n.right)-t.rect.left,top:w,bottom:k};return n.left||n.right||(x.bogus=!0),e.options.singleCursorHeightPerLine||(x.rtop=g,x.rbottom=m),x}(e,t,r,i)).bogus||(t.cache[l]=o)),{left:o.left,right:o.right,top:n?o.rtop:o.top,bottom:n?o.rbottom:o.bottom}}var Ir,$r={left:0,right:0,top:0,bottom:0};function Pr(e,t,r){for(var i,n,o,a,s,l,c=0;c<e.length;c+=3)if(s=e[c],l=e[c+1],t<s?(n=0,o=1,a="left"):t<l?o=1+(n=t-s):(c==e.length-3||t==l&&e[c+3]>t)&&(n=(o=l-s)-1,l<=t&&(a="right")),null!=n){if(i=e[c+2],s==l&&r==(i.insertLeft?"left":"right")&&(a=r),"left"==r&&0==n)for(;c&&e[c-2]==e[c-3]&&e[c-1].insertLeft;)i=e[2+(c-=3)],a="left";if("right"==r&&n==l-s)for(;c<e.length-3&&e[c+3]==e[c+4]&&!e[c+5].insertLeft;)i=e[(c+=3)+2],a="right";break}return{node:i,start:n,end:o,collapse:a,coverStart:s,coverEnd:l}}function zr(e,t){var r=$r;if("left"==t)for(var i=0;i<e.length&&(r=e[i]).left==r.right;i++);else for(var n=e.length-1;0<=n&&(r=e[n]).left==r.right;n--);return r}function Hr(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function Rr(e){e.display.externalMeasure=null,G(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Hr(e.display.view[t])}function Wr(e){Rr(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Fr(){return u&&m?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function jr(){return u&&m?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Br(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=xr(e.widgets[r]));return t}function qr(e,t,r,i,n){var o;if(n||(o=Br(t),r.top+=o,r.bottom+=o),"line"==i)return r;i=i||"local";var a,s,l=Kt(t);return"local"==i?l+=Cr(e.display):l-=e.display.viewOffset,"page"!=i&&"window"!=i||(l+=(a=e.display.lineSpace.getBoundingClientRect()).top+("window"==i?0:jr()),s=a.left+("window"==i?0:Fr()),r.left+=s,r.right+=s),r.top+=l,r.bottom+=l,r}function Ur(e,t,r){if("div"==r)return t;var i,n=t.left,o=t.top;"page"==r?(n-=Fr(),o-=jr()):"local"!=r&&r||(n+=(i=e.display.sizer.getBoundingClientRect()).left,o+=i.top);var a=e.display.lineSpace.getBoundingClientRect();return{left:n-a.left,top:o-a.top}}function Vr(e,t,r,i,n){return qr(e,i=i||Qe(e.doc,t.line),_r(e,i,t.ch,n),r)}function Kr(e,t,r,i,n,o){function a(t,a){var s=Dr(e,n,t,a?"right":"left",o);return a?s.left=s.right:s.right=s.left,qr(e,i,s,r)}i=i||Qe(e.doc,t.line),n=n||Nr(e,i);var s=me(i,e.doc.direction),l=t.ch,c=t.sticky;if(l>=i.text.length?(l=i.text.length,c="before"):l<=0&&(l=0,c="after"),!s)return a("before"==c?l-1:l,"before"==c);function u(e,t,r){return a(r?e-1:e,1==s[t].level!=r)}var d=le(s,l,c),p=se,h=u(l,d,"before"==c);return null!=p&&(h.other=u(l,p,"before"!=c)),h}function Yr(e,t){var r=0;t=pt(e.doc,t),e.options.lineWrapping||(r=ii(e.display)*t.ch);var i=Qe(e.doc,t.line),n=Kt(i)+Cr(e.display);return{left:r,right:r,top:n,bottom:n+i.height}}function Xr(e,t,r,i,n){var o=ot(e,t,r);return o.xRel=n,i&&(o.outside=i),o}function Qr(e,t,r){var i=e.doc;if((r+=e.display.viewOffset)<0)return Xr(i.first,0,null,-1,-1);var n=rt(i,r),o=i.first+i.size-1;if(o<n)return Xr(i.first+i.size-1,Qe(i,o).text.length,null,1,1);t<0&&(t=0);for(var a=Qe(i,n);;){var s=ti(e,a,n,t,r),l=Wt(a,s.ch+(0<s.xRel||0<s.outside?1:0));if(!l)return s;var c=l.find(1);if(c.line==n)return c;a=Qe(i,n=c.line)}}function Zr(e,t,r,i){i-=Br(t);var n=t.text.length,o=ae(function(t){return Dr(e,r,t-1).bottom<=i},n,0);return{begin:o,end:n=ae(function(t){return Dr(e,r,t).top>i},o,n)}}function Jr(e,t,r,i){return Zr(e,t,r=r||Nr(e,t),qr(e,t,Dr(e,r,i),"line").top)}function ei(e,t,r,i){return!(e.bottom<=r)&&(e.top>r||(i?e.left:e.right)>t)}function ti(e,t,r,i,n){n-=Kt(t);var o,a=Nr(e,t),s=Br(t),l=0,c=t.text.length,u=!0,d=me(t,e.doc.direction);d&&(l=(u=1!=(o=(e.options.lineWrapping?function(e,t,r,i,n,o,a){var s=Zr(e,t,i,a),l=s.begin,c=s.end;/\s/.test(t.text.charAt(c-1))&&c--;for(var u=null,d=null,p=0;p<n.length;p++){var h,f,g=n[p];g.from>=c||g.to<=l||(f=(h=Dr(e,i,1!=g.level?Math.min(c,g.to)-1:Math.max(l,g.from)).right)<o?o-h+1e9:h-o,(!u||f<d)&&(u=g,d=f))}return(u=u||n[n.length-1]).from<l&&(u={from:l,to:u.to,level:u.level}),u.to>c&&(u={from:u.from,to:c,level:u.level}),u}:function(e,t,r,i,n,o,a){var s,l,c=ae(function(s){var l=n[s],c=1!=l.level;return ei(Kr(e,ot(r,c?l.to:l.from,c?"before":"after"),"line",t,i),o,a,!0)},0,n.length-1),u=n[c];return 0<c&&(s=1!=u.level,ei(l=Kr(e,ot(r,s?u.from:u.to,s?"after":"before"),"line",t,i),o,a,!0)&&l.top>a&&(u=n[c-1])),u})(e,t,r,a,d,i,n)).level)?o.from:o.to-1,c=u?o.to:o.from-1);var p,h,f,g,m,v=null,b=null,y=ae(function(t){var r=Dr(e,a,t);return r.top+=s,r.bottom+=s,ei(r,i,n,!1)&&(r.top<=n&&r.left<=i&&(v=t,b=r),1)},l,c),w=!1;return b?(p=i-b.left<b.right-i,y=v+((h=p==u)?0:1),f=h?"after":"before",g=p?b.left:b.right):(u||y!=c&&y!=l||y++,f=0==y||y!=t.text.length&&Dr(e,a,y-(u?1:0)).bottom+s<=n==u?"after":"before",g=(m=Kr(e,ot(r,y,f),"line",t,a)).left,w=n<m.top?-1:n>=m.bottom?1:0),Xr(r,y=oe(t.text,y,1),f,w,i-g)}function ri(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ir){Ir=M("pre",null,"ESGMirror-line-like");for(var t=0;t<49;++t)Ir.appendChild(document.createTextNode("x")),Ir.appendChild(M("br"));Ir.appendChild(document.createTextNode("x"))}T(e.measure,Ir);var r=Ir.offsetHeight/50;return 3<r&&(e.cachedTextHeight=r),G(e.measure),r||1}function ii(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=M("span","xxxxxxxxxx"),r=M("pre",[t],"ESGMirror-line-like");T(e.measure,r);var i=t.getBoundingClientRect(),n=(i.right-i.left)/10;return 2<n&&(e.cachedCharWidth=n),n||10}function ni(e){for(var t=e.display,r={},i={},n=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;r[s]=o.offsetLeft+o.clientLeft+n,i[s]=o.clientWidth}return{fixedPos:oi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:i,wrapperWidth:t.wrapper.clientWidth}}function oi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ai(e){var t=ri(e.display),r=e.options.lineWrapping,i=r&&Math.max(5,e.display.scroller.clientWidth/ii(e.display)-3);return function(n){if(Ut(e.doc,n))return 0;var o=0;if(n.widgets)for(var a=0;a<n.widgets.length;a++)n.widgets[a].height&&(o+=n.widgets[a].height);return r?o+(Math.ceil(n.text.length/i)||1)*t:o+t}}function si(e){var t=e.doc,r=ai(e);t.iter(function(e){var t=r(e);t!=e.height&&et(e,t)})}function li(e,t,r,i){var n=e.display;if(!r&&"true"==Ae(t).getAttribute("cm-not-content"))return null;var o,a,s=n.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c,u=Qr(e,o,a);return i&&0<u.xRel&&(l=Qe(e.doc,u.line).text).length==u.ch&&(c=z(l,l.length,e.options.tabSize)-l.length,u=ot(u.line,Math.max(0,Math.round((o-Lr(e.display).left)/ii(e.display))-c))),u}function ci(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var r=e.display.view,i=0;i<r.length;i++)if((t-=r[i].size)<0)return i}function ui(e,t,r,i){null==t&&(t=e.doc.first),null==r&&(r=e.doc.first+e.doc.size),i=i||0;var n,o,a,s,l=e.display;i&&r<l.viewTo&&(null==l.updateLineNumbers||l.updateLineNumbers>t)&&(l.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=l.viewTo?Gt&&Bt(e.doc,t)<l.viewTo&&pi(e):r<=l.viewFrom?Gt&&qt(e.doc,r+i)>l.viewFrom?pi(e):(l.viewFrom+=i,l.viewTo+=i):t<=l.viewFrom&&r>=l.viewTo?pi(e):t<=l.viewFrom?(n=hi(e,r,r+i,1))?(l.view=l.view.slice(n.index),l.viewFrom=n.lineN,l.viewTo+=i):pi(e):r>=l.viewTo?(o=hi(e,t,t,-1))?(l.view=l.view.slice(0,o.index),l.viewTo=o.lineN):pi(e):(a=hi(e,t,t,-1),s=hi(e,r,r+i,1),a&&s?(l.view=l.view.slice(0,a.index).concat(sr(e,a.lineN,s.lineN)).concat(l.view.slice(s.index)),l.viewTo+=i):pi(e));var c=l.externalMeasured;c&&(r<c.lineN?c.lineN+=i:t<c.lineN+c.size&&(l.externalMeasured=null))}function di(e,t,r){e.curOp.viewChanged=!0;var i,n,o=e.display,a=e.display.externalMeasured;a&&t>=a.lineN&&t<a.lineN+a.size&&(o.externalMeasured=null),t<o.viewFrom||t>=o.viewTo||null==(i=o.view[ci(e,t)]).node||-1==R(n=i.changes||(i.changes=[]),r)&&n.push(r)}function pi(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function hi(e,t,r,i){var n,o=ci(e,t),a=e.display.view;if(!Gt||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var s=e.display.viewFrom,l=0;l<o;l++)s+=a[l].size;if(s!=t){if(0<i){if(o==a.length-1)return null;n=s+a[o].size-t,o++}else n=s-t;t+=n,r+=n}for(;Bt(e.doc,r)!=r;){if(o==(i<0?0:a.length-1))return null;r+=i*a[o-(i<0?1:0)].size,o+=i}return{index:o,lineN:r}}function fi(e){for(var t=e.display.view,r=0,i=0;i<t.length;i++){var n=t[i];n.hidden||n.node&&!n.changes||++r}return r}function gi(e){e.display.input.showSelection(e.display.input.prepareSelection())}function mi(e,t){void 0===t&&(t=!0);for(var r,i,n=e.doc,o={},a=o.cursors=document.createDocumentFragment(),s=o.selection=document.createDocumentFragment(),l=0;l<n.sel.ranges.length;l++)!t&&l==n.sel.primIndex||(r=n.sel.ranges[l]).from().line>=e.display.viewTo||r.to().line<e.display.viewFrom||(((i=r.empty())||e.options.showCursorWhenSelecting)&&vi(e,r.head,a),i||yi(e,r,s));return o}function vi(e,t,r){var i,n=Kr(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),o=r.appendChild(M("div"," ","ESGMirror-cursor"));o.style.left=n.left+"px",o.style.top=n.top+"px",o.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other&&((i=r.appendChild(M("div"," ","ESGMirror-cursor ESGMirror-secondarycursor"))).style.display="",i.style.left=n.other.left+"px",i.style.top=n.other.top+"px",i.style.height=.85*(n.other.bottom-n.other.top)+"px")}function bi(e,t){return e.top-t.top||e.left-t.left}function yi(e,t,r){var i=e.display,n=e.doc,o=document.createDocumentFragment(),a=Lr(e.display),s=a.left,l=Math.max(i.sizerWidth,Tr(e)-i.sizer.offsetLeft)-a.right,c="ltr"==n.direction;function u(e,t,r,i){t<0&&(t=0),t=Math.round(t),i=Math.round(i),o.appendChild(M("div",null,"ESGMirror-selected","position: absolute; left: "+e+"px;\n                             top: "+t+"px; width: "+(null==r?l-e:r)+"px;\n                             height: "+(i-t)+"px"))}function d(t,r,i){var o,a,d=Qe(n,t),p=d.text.length;function h(r,i){return Vr(e,ot(t,r),"div",d,i)}function f(t,r,i){var n=Jr(e,d,null,t),o="ltr"==r==("after"==i)?"left":"right";return h("after"==i?n.begin:n.end-(/\s/.test(d.text.charAt(n.end-1))?2:1),o)[o]}var g=me(d,n.direction);return function(e,t,r,i){if(!e)return i(t,r,"ltr",0);for(var n=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(i(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr",o),n=!0)}n||i(t,r,"ltr")}(g,r||0,null==i?p:i,function(e,t,n,d){var m,v,b,y,w,k,x,S="ltr"==n,C=h(e,S?"left":"right"),E=h(t-1,S?"right":"left"),L=null==r&&0==e,G=null==i&&t==p,T=0==d,M=!g||d==g.length-1;E.top-C.top<=3?(m=(c?G:L)&&M,v=(c?L:G)&&T?s:(S?C:E).left,b=m?l:(S?E:C).right,u(v,C.top,b-v,C.bottom)):(x=S?(y=c&&L&&T?s:C.left,w=c?l:f(e,n,"before"),k=c?s:f(t,n,"after"),c&&G&&M?l:E.right):(y=c?f(e,n,"before"):s,w=!c&&L&&T?l:C.right,k=!c&&G&&M?s:E.left,c?f(t,n,"after"):l),u(y,C.top,w-y,C.bottom),C.bottom<E.top&&u(s,C.bottom,null,E.top),u(k,E.top,x-k,E.bottom)),(!o||bi(C,o)<0)&&(o=C),bi(E,o)<0&&(o=E),(!a||bi(C,a)<0)&&(a=C),bi(E,a)<0&&(a=E)}),{start:o,end:a}}var p,h,f,g,m,v=t.from(),b=t.to();v.line==b.line?d(v.line,v.ch,b.ch):(p=Qe(n,v.line),h=Qe(n,b.line),f=jt(p)==jt(h),g=d(v.line,v.ch,f?p.text.length+1:null).end,m=d(b.line,f?0:null,b.ch).start,f&&(g.top<m.top-2?(u(g.right,g.top,null,g.bottom),u(s,m.top,m.left,m.bottom)):u(g.right,g.top,m.left-g.right,g.bottom)),g.bottom<m.top&&u(s,g.bottom,null,m.top)),r.appendChild(o)}function wi(e){var t,r;e.state.focused&&(t=e.display,clearInterval(t.blinker),r=!0,t.cursorDiv.style.visibility="",0<e.options.cursorBlinkRate?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function ki(e){e.state.focused||(e.display.input.focus(),Si(e))}function xi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Ci(e))},100)}function Si(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,N(e.display.wrapper,"ESGMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),l&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),wi(e))}function Ci(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,L(e.display.wrapper,"ESGMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Ei(e){for(var t=e.display,r=t.lineDiv.offsetTop,i=0;i<t.view.length;i++){var n,o,l=t.view[i],c=e.options.lineWrapping,u=void 0,d=0;if(!l.hidden){a&&s<8?(u=(n=l.node.offsetTop+l.node.offsetHeight)-r,r=n):(u=(o=l.node.getBoundingClientRect()).bottom-o.top,!c&&l.text.firstChild&&(d=l.text.firstChild.getBoundingClientRect().right-o.left-1));var p,h=l.line.height-u;if((.005<h||h<-.005)&&(et(l.line,u),Li(l.line),l.rest))for(var f=0;f<l.rest.length;f++)Li(l.rest[f]);d>e.display.sizerWidth&&(p=Math.ceil(d/ii(e.display)))>e.display.maxLineLength&&(e.display.maxLineLength=p,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}function Li(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],i=r.node.parentNode;i&&(r.height=i.offsetHeight)}}function Gi(e,t,r){var i,n,o=r&&null!=r.top?Math.max(0,r.top):e.scroller.scrollTop,a=(o=Math.floor(o-Cr(e)),r&&null!=r.bottom?r.bottom:o+e.wrapper.clientHeight),s=rt(t,o),l=rt(t,a);return r&&r.ensure&&(i=r.ensure.from.line,n=r.ensure.to.line,i<s?l=rt(t,Kt(Qe(t,s=i))+e.wrapper.clientHeight):Math.min(n,t.lastLine())>=l&&(s=rt(t,Kt(Qe(t,n))-e.wrapper.clientHeight),l=n)),{from:s,to:Math.max(l,s+1)}}function Ti(e,t){var r=e.display,i=ri(e.display);t.top<0&&(t.top=0);var n=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:r.scroller.scrollTop,o=Mr(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s,l=e.doc.height+Er(r),c=t.top<i,u=t.bottom>l-i;t.top<n?a.scrollTop=c?0:t.top:t.bottom>n+o&&(s=Math.min(t.top,(u?l:t.bottom)-o))!=n&&(a.scrollTop=s);var d=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:r.scroller.scrollLeft,p=Tr(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),h=t.right-t.left>p;return h&&(t.right=t.left+p),t.left<10?a.scrollLeft=0:t.left<d?a.scrollLeft=Math.max(0,t.left-(h?0:10)):t.right>p+d-3&&(a.scrollLeft=t.right+(h?0:10)-p),a}function Mi(e,t){null!=t&&(Oi(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ai(e){Oi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _i(e,t,r){null==t&&null==r||Oi(e),null!=t&&(e.curOp.scrollLeft=t),null!=r&&(e.curOp.scrollTop=r)}function Oi(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Ni(e,Yr(e,t.from),Yr(e,t.to),t.margin))}function Ni(e,t,r,i){var n=Ti(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-i,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+i});_i(e,n.scrollLeft,n.scrollTop)}function Di(e,t){Math.abs(e.doc.scrollTop-t)<2||(r||sn(e,{top:t}),Ii(e,t,!0),r&&sn(e),tn(e,100))}function Ii(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 $i(e,t,r,i){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)&&!i||(e.doc.scrollLeft=t,un(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Pi(e){var t=e.display,r=t.gutters.offsetWidth,i=Math.round(e.doc.height+Er(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:i,scrollHeight:i+Gr(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}function zi(e,t,r){this.cm=r;var i=this.vert=M("div",[M("div",null,null,"min-width: 1px")],"ESGMirror-vscrollbar"),n=this.horiz=M("div",[M("div",null,null,"height: 100%; min-height: 1px")],"ESGMirror-hscrollbar");i.tabIndex=n.tabIndex=-1,e(i),e(n),be(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical")}),be(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function Hi(){}function Ri(e,t){t=t||Pi(e);var r=e.display.barWidth,i=e.display.barHeight;Wi(e,t);for(var n=0;n<4&&r!=e.display.barWidth||i!=e.display.barHeight;n++)r!=e.display.barWidth&&e.options.lineWrapping&&Ei(e),Wi(e,Pi(e)),r=e.display.barWidth,i=e.display.barHeight}function Wi(e,t){var r=e.display,i=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=i.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=i.bottom)+"px",r.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=i.bottom+"px",r.scrollbarFiller.style.width=i.right+"px"):r.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=i.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}zi.prototype.update=function(e){var t,r,i=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,o=e.nativeBarWidth;return n?(this.vert.style.display="block",this.vert.style.bottom=i?o+"px":"0",t=e.viewHeight-(i?o:0),this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+t)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),i?(this.horiz.style.display="block",this.horiz.style.right=n?o+"px":"0",this.horiz.style.left=e.barLeft+"px",r=e.viewWidth-e.barLeft-(n?o:0),this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+r)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&0<e.clientHeight&&(0==o&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?o:0,bottom:i?o:0}},zi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zi.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new H,this.disableVert=new H},zi.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto",t.set(1e3,function i(){var n=e.getBoundingClientRect();("vert"==r?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1))!=e?e.style.pointerEvents="none":t.set(1e3,i)})},zi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)},Hi.prototype.update=function(){return{bottom:0,right:0}},Hi.prototype.setScrollLeft=function(){},Hi.prototype.setScrollTop=function(){},Hi.prototype.clear=function(){};var Fi={native:zi,null:Hi};function ji(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&L(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Fi[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),be(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){("horizontal"==r?$i:Di)(e,t)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var Bi=0;function qi(e){var t;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:++Bi},t=e.curOp,lr?lr.ops.push(t):t.ownsGroup=lr={ops:[t],delayedCallbacks:[]}}function Ui(e){var t=e.curOp;t&&function(e,t){var r=e.ownsGroup;if(r)try{!function(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var i=0;i<e.ops.length;i++){var n=e.ops[i];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(r<t.length)}(r)}finally{lr=null,t(r)}}(t,function(e){for(var t=0;t<e.ops.length;t++)e.ops[t].cm.curOp=null;!function(e){for(var t=e.ops,r=0;r<t.length;r++)Vi(t[r]);for(var i=0;i<t.length;i++)(n=t[i]).updatedDisplay=n.mustUpdate&&on(n.cm,n.update);for(var n,o=0;o<t.length;o++)Ki(t[o]);for(var a=0;a<t.length;a++)Yi(t[a]);for(var s=0;s<t.length;s++)Xi(t[s])}(e)})}function Vi(e){var t,r,i=e.cm,n=i.display;!(r=(t=i).display).scrollbarsClipped&&r.scroller.offsetWidth&&(r.nativeBarWidth=r.scroller.offsetWidth-r.scroller.clientWidth,r.heightForcer.style.height=Gr(t)+"px",r.sizer.style.marginBottom=-r.nativeBarWidth+"px",r.sizer.style.borderRightWidth=Gr(t)+"px",r.scrollbarsClipped=!0),e.updateMaxLine&&Xt(i),e.mustUpdate=e.viewChanged||e.forceUpdate||null!=e.scrollTop||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&i.options.lineWrapping,e.update=e.mustUpdate&&new nn(i,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ki(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ei(t),e.barMeasure=Pi(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_r(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+Gr(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Tr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Yi(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&$i(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==O();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),!e.updatedDisplay&&e.startHeight==t.doc.height||Ri(t,e.barMeasure),e.updatedDisplay&&cn(t,e.barMeasure),e.selectionChanged&&wi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&ki(e.cm)}function Xi(e){var t,r,i,n,o,a,s,l=e.cm,c=l.display,u=l.doc;e.updatedDisplay&&an(l,e.update),null==c.wheelStartX||null==e.scrollTop&&null==e.scrollLeft&&!e.scrollToPos||(c.wheelStartX=c.wheelStartY=null),null!=e.scrollTop&&Ii(l,e.scrollTop,e.forceScroll),null!=e.scrollLeft&&$i(l,e.scrollLeft,!0,!0),e.scrollToPos&&(t=function(e,t,r,i){null==i&&(i=0),e.options.lineWrapping||t!=r||(r="before"==(t=t.ch?ot(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t).sticky?ot(t.line,t.ch+1,"before"):t);for(var n=0;n<5;n++){var o,a=!1,s=Kr(e,t),l=r&&r!=t?Kr(e,r):s,c=Ti(e,o={left:Math.min(s.left,l.left),top:Math.min(s.top,l.top)-i,right:Math.max(s.left,l.left),bottom:Math.max(s.bottom,l.bottom)+i}),u=e.doc.scrollTop,d=e.doc.scrollLeft;if(null!=c.scrollTop&&(Di(e,c.scrollTop),1<Math.abs(e.doc.scrollTop-u)&&(a=!0)),null!=c.scrollLeft&&($i(e,c.scrollLeft),1<Math.abs(e.doc.scrollLeft-d)&&(a=!0)),!a)break}return o}(l,pt(u,e.scrollToPos.from),pt(u,e.scrollToPos.to),e.scrollToPos.margin),i=t,xe(r=l,"scrollCursorIntoView")||(o=(n=r.display).sizer.getBoundingClientRect(),a=null,i.top+o.top<0?a=!0:i.bottom+o.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),null==a||f||(s=M("div","​",null,"position: absolute;\n                         top: "+(i.top-n.viewOffset-Cr(r.display))+"px;\n                         height: "+(i.bottom-i.top+Gr(r)+n.barHeight)+"px;\n                         left: "+i.left+"px; width: "+Math.max(2,i.right-i.left)+"px;"),r.display.lineSpace.appendChild(s),s.scrollIntoView(a),r.display.lineSpace.removeChild(s))));var d=e.maybeHiddenMarkers,p=e.maybeUnhiddenMarkers;if(d)for(var h=0;h<d.length;++h)d[h].lines.length||ke(d[h],"hide");if(p)for(var g=0;g<p.length;++g)p[g].lines.length&&ke(p[g],"unhide");c.wrapper.offsetHeight&&(u.scrollTop=l.display.scroller.scrollTop),e.changeObjs&&ke(l,"changes",l,e.changeObjs),e.update&&e.update.finish()}function Qi(e,t){if(e.curOp)return t();qi(e);try{return t()}finally{Ui(e)}}function Zi(e,t){return function(){if(e.curOp)return t.apply(e,arguments);qi(e);try{return t.apply(e,arguments)}finally{Ui(e)}}}function Ji(e){return function(){if(this.curOp)return e.apply(this,arguments);qi(this);try{return e.apply(this,arguments)}finally{Ui(this)}}}function en(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);qi(t);try{return e.apply(this,arguments)}finally{Ui(t)}}}function tn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,$(rn,e))}function rn(e){var t,r,i,n=e.doc;n.highlightFrontier>=e.display.viewTo||(t=+new Date+e.options.workTime,r=bt(e,n.highlightFrontier),i=[],n.iter(r.line,Math.min(n.first+n.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ve(n.mode,r.state):null,l=mt(e,o,r,!0);s&&(r.state=s),o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var d=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),p=0;!d&&p<a.length;++p)d=a[p]!=o.styles[p];d&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&yt(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>t)return tn(e,e.options.workDelay),!0}),n.highlightFrontier=r.line,n.modeFrontier=Math.max(n.modeFrontier,r.line),i.length&&Qi(e,function(){for(var t=0;t<i.length;t++)di(e,i[t],"text")}))}var nn=function(e,t,r){var i=e.display;this.viewport=t,this.visible=Gi(i,e.doc,t),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=Tr(e),this.force=r,this.dims=ni(e),this.events=[]};function on(e,t){var r=e.display,i=e.doc;if(t.editorIsHidden)return pi(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==fi(e))return!1;dn(e)&&(pi(e),t.dims=ni(e));var n=i.first+i.size,o=Math.max(t.visible.from-e.options.viewportMargin,i.first),a=Math.min(n,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(i.first,r.viewFrom)),r.viewTo>a&&r.viewTo-a<20&&(a=Math.min(n,r.viewTo)),Gt&&(o=Bt(e.doc,o),a=qt(e.doc,a));var s,c,u,d,p=o!=r.viewFrom||a!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;c=o,u=a,0==(d=(s=e).display).view.length||c>=d.viewTo||u<=d.viewFrom?(d.view=sr(s,c,u),d.viewFrom=c):(d.viewFrom>c?d.view=sr(s,c,d.viewFrom).concat(d.view):d.viewFrom<c&&(d.view=d.view.slice(ci(s,c))),d.viewFrom=c,d.viewTo<u?d.view=d.view.concat(sr(s,d.viewTo,u)):d.viewTo>u&&(d.view=d.view.slice(0,ci(s,u)))),d.viewTo=u,r.viewOffset=Kt(Qe(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var h=fi(e);if(!p&&0==h&&!t.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))return!1;var f,g,m,v=function(e){if(e.hasFocus())return null;var t=O();if(!t||!_(e.display.lineDiv,t))return null;var r,i={activeElt:t};return!window.getSelection||(r=window.getSelection()).anchorNode&&r.extend&&_(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset),i}(e);return 4<h&&(r.lineDiv.style.display="none"),function(e,t,r){var i,n,o,a,s,c=e.display,u=e.options.lineNumbers,d=c.lineDiv,p=d.firstChild;function h(t){var r=t.nextSibling;return l&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var f=c.view,g=c.viewFrom,m=0;m<f.length;m++){var v=f[m];if(!v.hidden)if(v.node&&v.node.parentNode==d){for(;p!=v.node;)p=h(p);var y=u&&null!=t&&t<=g&&v.lineNumber;v.changes&&(-1<R(v.changes,"gutter")&&(y=!1),pr(e,v,g,r)),y&&(G(v.lineNumber),v.lineNumber.appendChild(document.createTextNode(nt(e.options,g)))),p=v.node.nextSibling}else{var w=(o=g,a=r,s=fr(i=e,n=v),n.text=n.node=s.pre,s.bgClass&&(n.bgClass=s.bgClass),s.textClass&&(n.textClass=s.textClass),mr(i,n),vr(i,n,o,a),yr(i,n,a),n.node);d.insertBefore(w,p)}g+=v.size}for(;p;)p=h(p)}(e,r.updateLineNumbers,t.dims),4<h&&(r.lineDiv.style.display=""),r.renderedView=r.view,(f=v)&&f.activeElt&&f.activeElt!=O()&&(f.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(f.activeElt.nodeName)&&f.anchorNode&&_(document.body,f.anchorNode)&&_(document.body,f.focusNode)&&(g=window.getSelection(),(m=document.createRange()).setEnd(f.anchorNode,f.anchorOffset),m.collapse(!1),g.removeAllRanges(),g.addRange(m),g.extend(f.focusNode,f.focusOffset))),G(r.cursorDiv),G(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,p&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,tn(e,400)),!(r.updateLineNumbers=null)}function an(e,t){for(var r=t.viewport,i=!0;;i=!1){if(i&&e.options.lineWrapping&&t.oldDisplayWidth!=Tr(e))i&&(t.visible=Gi(e.display,e.doc,r));else if(r&&null!=r.top&&(r={top:Math.min(e.doc.height+Er(e.display)-Mr(e),r.top)}),t.visible=Gi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!on(e,t))break;Ei(e);var n=Pi(e);gi(e),Ri(e,n),cn(e,n),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 sn(e,t){var r,i=new nn(e,t);on(e,i)&&(Ei(e),an(e,i),r=Pi(e),gi(e),Ri(e,r),cn(e,r),i.finish())}function ln(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function cn(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+Gr(e)+"px"}function un(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var i=oi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=i+"px",a=0;a<r.length;a++)if(!r[a].hidden){e.options.fixedGutter&&(r[a].gutter&&(r[a].gutter.style.left=o),r[a].gutterBackground&&(r[a].gutterBackground.style.left=o));var s=r[a].alignable;if(s)for(var l=0;l<s.length;l++)s[l].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=i+n+"px")}}function dn(e){if(e.options.lineNumbers){var t=e.doc,r=nt(e.options,t.first+t.size-1),i=e.display;if(r.length!=i.lineNumChars){var n=i.measure.appendChild(M("div",[M("div",r)],"ESGMirror-linenumber ESGMirror-gutter-elt")),o=n.firstChild.offsetWidth,a=n.offsetWidth-o;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(o,i.lineGutter.offsetWidth-a)+1,i.lineNumWidth=i.lineNumInnerWidth+a,i.lineNumChars=i.lineNumInnerWidth?r.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",ln(e.display),1}}}function pn(e,t){for(var r=[],i=!1,n=0;n<e.length;n++){var o=e[n],a=null;if("string"!=typeof o&&(a=o.style,o=o.className),"ESGMirror-linenumbers"==o){if(!t)continue;i=!0}r.push({className:o,style:a})}return t&&!i&&r.push({className:"ESGMirror-linenumbers",style:null}),r}function hn(e){var t=e.gutters,r=e.gutterSpecs;G(t),e.lineGutter=null;for(var i=0;i<r.length;++i){var n=r[i],o=n.className,a=n.style,s=t.appendChild(M("div",null,"ESGMirror-gutter "+o));a&&(s.style.cssText=a),"ESGMirror-linenumbers"==o&&((e.lineGutter=s).style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",ln(e)}function fn(e){hn(e.display),ui(e),un(e)}function gn(e,t,i,n){var o=this;this.input=i,o.scrollbarFiller=M("div",null,"ESGMirror-scrollbar-filler"),o.scrollbarFiller.setAttribute("cm-not-content","true"),o.gutterFiller=M("div",null,"ESGMirror-gutter-filler"),o.gutterFiller.setAttribute("cm-not-content","true"),o.lineDiv=A("div",null,"ESGMirror-code"),o.selectionDiv=M("div",null,null,"position: relative; z-index: 1"),o.cursorDiv=M("div",null,"ESGMirror-cursors"),o.measure=M("div",null,"ESGMirror-measure"),o.lineMeasure=M("div",null,"ESGMirror-measure"),o.lineSpace=A("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var c=A("div",[o.lineSpace],"ESGMirror-lines");o.mover=M("div",[c],null,"position: relative"),o.sizer=M("div",[o.mover],"ESGMirror-sizer"),o.sizerWidth=null,o.heightForcer=M("div",null,null,"position: absolute; height: "+W+"px; width: 1px;"),o.gutters=M("div",null,"ESGMirror-gutters"),o.lineGutter=null,o.scroller=M("div",[o.sizer,o.heightForcer,o.gutters],"ESGMirror-scroll"),o.scroller.setAttribute("tabIndex","-1"),o.wrapper=M("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"ESGMirror"),a&&s<8&&(o.gutters.style.zIndex=-1,o.scroller.style.paddingRight=0),l||r&&v||(o.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(o.wrapper):e(o.wrapper)),o.viewFrom=o.viewTo=t.first,o.reportedViewFrom=o.reportedViewTo=t.first,o.view=[],o.renderedView=null,o.externalMeasured=null,o.viewOffset=0,o.lastWrapHeight=o.lastWrapWidth=0,o.updateLineNumbers=null,o.nativeBarWidth=o.barHeight=o.barWidth=0,o.scrollbarsClipped=!1,o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null,o.alignWidgets=!1,o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null,o.maxLine=null,o.maxLineLength=0,o.maxLineChanged=!1,o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null,o.shift=!1,o.selForContextMenu=null,o.activeTouch=null,o.gutterSpecs=pn(n.gutters,n.lineNumbers),hn(o),i.init(o)}nn.prototype.signal=function(e,t){Ce(e,t)&&this.events.push(arguments)},nn.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};var mn=0,vn=null;function bn(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function yn(e,t){var i,n,o,a=bn(t),s=a.x,c=a.y,u=e.display,p=u.scroller,h=p.scrollWidth>p.clientWidth,f=p.scrollHeight>p.clientHeight;if(s&&h||c&&f){if(c&&b&&l)e:for(var g=t.target,m=u.view;g!=p;g=g.parentNode)for(var v=0;v<m.length;v++)if(m[v].node==g){e.display.currentWheelTarget=g;break e}if(s&&!r&&!d&&null!=vn)return c&&f&&Di(e,Math.max(0,p.scrollTop+c*vn)),$i(e,Math.max(0,p.scrollLeft+s*vn)),(!c||c&&f)&&Le(t),void(u.wheelStartX=null);c&&null!=vn&&(i=c*vn,o=(n=e.doc.scrollTop)+u.wrapper.clientHeight,i<0?n=Math.max(0,n+i-50):o=Math.min(e.doc.height,o+i+50),sn(e,{top:n,bottom:o})),mn<20&&(null==u.wheelStartX?(u.wheelStartX=p.scrollLeft,u.wheelStartY=p.scrollTop,u.wheelDX=s,u.wheelDY=c,setTimeout(function(){var e,t,r;null!=u.wheelStartX&&(e=p.scrollLeft-u.wheelStartX,r=(t=p.scrollTop-u.wheelStartY)&&u.wheelDY&&t/u.wheelDY||e&&u.wheelDX&&e/u.wheelDX,u.wheelStartX=u.wheelStartY=null,r&&(vn=(vn*mn+r)/(mn+1),++mn))},200)):(u.wheelDX+=s,u.wheelDY+=c))}}a?vn=-.53:r?vn=15:u?vn=-.7:p&&(vn=-1/3);var wn=function(e,t){this.ranges=e,this.primIndex=t};wn.prototype.primary=function(){return this.ranges[this.primIndex]},wn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],i=e.ranges[t];if(!st(r.anchor,i.anchor)||!st(r.head,i.head))return!1}return!0},wn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new kn(lt(this.ranges[t].anchor),lt(this.ranges[t].head));return new wn(e,this.primIndex)},wn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},wn.prototype.contains=function(e,t){t=t||e;for(var r=0;r<this.ranges.length;r++){var i=this.ranges[r];if(0<=at(t,i.from())&&at(e,i.to())<=0)return r}return-1};var kn=function(e,t){this.anchor=e,this.head=t};function xn(e,t,r){var i=e&&e.options.selectionsMayTouch,n=t[r];t.sort(function(e,t){return at(e.from(),t.from())}),r=R(t,n);for(var o=1;o<t.length;o++){var a,s,l,c=t[o],u=t[o-1],d=at(u.to(),c.from());(i&&!c.empty()?0<d:0<=d)&&(a=ut(u.from(),c.from()),s=ct(u.to(),c.to()),l=u.empty()?c.from()==c.head:u.from()==u.head,o<=r&&--r,t.splice(--o,2,new kn(l?s:a,l?a:s)))}return new wn(t,r)}function Sn(e,t){return new wn([new kn(e,t||e)],0)}function Cn(e){return e.text?ot(e.from.line+e.text.length-1,Y(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function En(e,t){if(at(e,t.from)<0)return e;if(at(e,t.to)<=0)return Cn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,i=e.ch;return e.line==t.to.line&&(i+=Cn(t).ch-t.to.ch),ot(r,i)}function Ln(e,t){for(var r=[],i=0;i<e.sel.ranges.length;i++){var n=e.sel.ranges[i];r.push(new kn(En(n.anchor,t),En(n.head,t)))}return xn(e.cm,r,e.sel.primIndex)}function Gn(e,t,r){return e.line==t.line?ot(r.line,e.ch-t.ch+r.ch):ot(r.line+(e.line-t.line),e.ch)}function Tn(e){e.doc.mode=qe(e.options,e.doc.modeOption),Mn(e)}function Mn(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,tn(e,100),e.state.modeGen++,e.curOp&&ui(e)}function An(e,t){return 0==t.from.ch&&0==t.to.ch&&""==Y(t.text)&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function _n(e,t,r,i){function n(e){return r?r[e]:null}function o(e,r,n){!function(e,t,r,i){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Nt(e),Dt(e,r);var n=i?i(e):1;n!=e.height&&et(e,n)}(e,r,n,i),ur(e,"change",e,t)}function a(e,t){for(var r=[],o=e;o<t;++o)r.push(new Qt(p[o],n(o),i));return r}var s,l,c,u=t.from,d=t.to,p=t.text,h=Qe(e,u.line),f=Qe(e,d.line),g=Y(p),m=n(p.length-1),v=d.line-u.line;t.full?(e.insert(0,a(0,p.length)),e.remove(p.length,e.size-p.length)):An(e,t)?(s=a(0,p.length-1),o(f,f.text,m),v&&e.remove(u.line,v),s.length&&e.insert(u.line,s)):h==f?1==p.length?o(h,h.text.slice(0,u.ch)+g+h.text.slice(d.ch),m):((l=a(1,p.length-1)).push(new Qt(g+h.text.slice(d.ch),m,i)),o(h,h.text.slice(0,u.ch)+p[0],n(0)),e.insert(u.line+1,l)):1==p.length?(o(h,h.text.slice(0,u.ch)+p[0]+f.text.slice(d.ch),n(0)),e.remove(u.line+1,v)):(o(h,h.text.slice(0,u.ch)+p[0],n(0)),o(f,g+f.text.slice(d.ch),m),c=a(1,p.length-1),1<v&&e.remove(u.line+1,v-1),e.insert(u.line+1,c)),ur(e,"change",e,t)}function On(e,t,r){!function e(i,n,o){if(i.linked)for(var a=0;a<i.linked.length;++a){var s,l=i.linked[a];l.doc!=n&&(s=o&&l.sharedHist,r&&!s||(t(l.doc,s),e(l.doc,i,s)))}}(e,null,!0)}function Nn(e,t){if(t.cm)throw new Error("This document is already in use.");si((e.doc=t).cm=e),Tn(e),Dn(e),e.options.lineWrapping||Xt(e),e.options.mode=t.modeOption,ui(e)}function Dn(e){("rtl"==e.doc.direction?N:L)(e.display.lineDiv,"ESGMirror-rtl")}function In(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function $n(e,t){var r={from:lt(t.from),to:Cn(t),text:Ze(e,t.from,t.to)};return Rn(e,r,t.from.line,t.to.line+1),On(e,function(e){return Rn(e,r,t.from.line,t.to.line+1)},!0),r}function Pn(e){for(;e.length&&Y(e).ranges;)e.pop()}function zn(e,t,r,i){var n=e.history;n.undone.length=0;var o,a,s,l=+new Date;if((n.lastOp==i||n.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&n.lastModTime>l-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=(s=n).lastOp==i?(Pn(s.done),Y(s.done)):s.done.length&&!Y(s.done).ranges?Y(s.done):1<s.done.length&&!s.done[s.done.length-2].ranges?(s.done.pop(),Y(s.done)):void 0))a=Y(o.changes),0==at(t.from,t.to)&&0==at(t.from,a.to)?a.to=Cn(t):o.changes.push($n(e,t));else{var c=Y(n.done);for(c&&c.ranges||Hn(e.sel,n.done),o={changes:[$n(e,t)],generation:n.generation},n.done.push(o);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(r),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=l,n.lastOp=n.lastSelOp=i,n.lastOrigin=n.lastSelOrigin=t.origin,a||ke(e,"historyAdded")}function Hn(e,t){var r=Y(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Rn(e,t,r,i){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,i),function(r){r.markedSpans&&((n=n||(t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function Wn(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t=t||e.slice(0,r):t&&t.push(e[r]);return t?t.length?t:null:e}function Fn(e,t){var r=function(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var i=[],n=0;n<t.text.length;++n)i.push(Wn(r[n]));return i}(e,t),i=_t(e,t);if(!r)return i;if(!i)return r;for(var n=0;n<r.length;++n){var o=r[n],a=i[n];if(o&&a)e:for(var s=0;s<a.length;++s){for(var l=a[s],c=0;c<o.length;++c)if(o[c].marker==l.marker)continue e;o.push(l)}else a&&(r[n]=a)}return r}function jn(e,t,r){for(var i=[],n=0;n<e.length;++n){var o=e[n];if(o.ranges)i.push(r?wn.prototype.deepCopy.call(o):o);else{var a=o.changes,s=[];i.push({changes:s});for(var l=0;l<a.length;++l){var c=a[l],u=void 0;if(s.push({from:c.from,to:c.to,text:c.text}),t)for(var d in c)(u=d.match(/^spans_(\d+)$/))&&-1<R(t,Number(u[1]))&&(Y(s)[d]=c[d],delete c[d])}}}return i}function Bn(e,t,r,i){if(i){var n,o=e.anchor;return r&&((n=at(t,o)<0)!=at(r,o)<0?(o=t,t=r):n!=at(t,r)<0&&(t=r)),new kn(o,t)}return new kn(r||t,t)}function qn(e,t,r,i,n){null==n&&(n=e.cm&&(e.cm.display.shift||e.extend)),Xn(e,new wn([Bn(e.sel.primary(),t,r,n)],0),i)}function Un(e,t,r){for(var i=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)i[o]=Bn(e.sel.ranges[o],t[o],null,n);Xn(e,xn(e.cm,i,e.sel.primIndex),r)}function Vn(e,t,r,i){var n=e.sel.ranges.slice(0);n[t]=r,Xn(e,xn(e.cm,n,e.sel.primIndex),i)}function Kn(e,t,r,i){Xn(e,Sn(t,r),i)}function Yn(e,t,r){var i=e.history.done,n=Y(i);n&&n.ranges?Qn(e,i[i.length-1]=t,r):Xn(e,t,r)}function Xn(e,t,r){Qn(e,t,r),function(e,t,r,i){var n,o,a,s,l,c=e.history,u=i&&i.origin;r==c.lastSelOp||u&&c.lastSelOrigin==u&&(c.lastModTime==c.lastSelTime&&c.lastOrigin==u||(n=e,o=u,a=Y(c.done),s=t,"*"==(l=o.charAt(0))||"+"==l&&a.ranges.length==s.ranges.length&&a.somethingSelected()==s.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)))?c.done[c.done.length-1]=t:Hn(t,c.done),c.lastSelTime=+new Date,c.lastSelOrigin=u,c.lastSelOp=r,i&&!1!==i.clearRedo&&Pn(c.undone)}(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Qn(e,t,r){var i,n,o,a;(Ce(e,"beforeSelectionChange")||e.cm&&Ce(e.cm,"beforeSelectionChange"))&&(i=e,o=r,a={ranges:(n=t).ranges,update:function(e){this.ranges=[];for(var t=0;t<e.length;t++)this.ranges[t]=new kn(pt(i,e[t].anchor),pt(i,e[t].head))},origin:o&&o.origin},ke(i,"beforeSelectionChange",i,a),i.cm&&ke(i.cm,"beforeSelectionChange",i.cm,a),t=a.ranges!=n.ranges?xn(i.cm,a.ranges,a.ranges.length-1):n);var s=r&&r.bias||(at(t.primary().head,e.sel.primary().head)<0?-1:1);Zn(e,eo(e,t,s,!0)),r&&!1===r.scroll||!e.cm||Ai(e.cm)}function Zn(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Se(e.cm)),ur(e,"cursorActivity",e))}function Jn(e){Zn(e,eo(e,e.sel,null,!1))}function eo(e,t,r,i){for(var n,o=0;o<t.ranges.length;o++){var a=t.ranges[o],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],l=ro(e,a.anchor,s&&s.anchor,r,i),c=ro(e,a.head,s&&s.head,r,i);!n&&l==a.anchor&&c==a.head||((n=n||t.ranges.slice(0,o))[o]=new kn(l,c))}return n?xn(e.cm,n,t.primIndex):t}function to(e,t,r,i,n){var o=Qe(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var s=o.markedSpans[a],l=s.marker,c="selectLeft"in l?!l.selectLeft:l.inclusiveLeft,u="selectRight"in l?!l.selectRight:l.inclusiveRight;if((null==s.from||(c?s.from<=t.ch:s.from<t.ch))&&(null==s.to||(u?s.to>=t.ch:s.to>t.ch))){if(n&&(ke(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(r){var d=l.find(i<0?1:-1),p=void 0;if((i<0?u:c)&&(d=io(e,d,-i,d&&d.line==t.line?o:null)),d&&d.line==t.line&&(p=at(d,r))&&(i<0?p<0:0<p))return to(e,d,t,i,n)}var h=l.find(i<0?-1:1);return(i<0?c:u)&&(h=io(e,h,i,h.line==t.line?o:null)),h?to(e,h,t,i,n):null}}return t}function ro(e,t,r,i,n){var o=i||1;return to(e,t,r,o,n)||!n&&to(e,t,r,o,!0)||to(e,t,r,-o,n)||!n&&to(e,t,r,-o,!0)||(e.cantEdit=!0,ot(e.first,0))}function io(e,t,r,i){return r<0&&0==t.ch?t.line>e.first?pt(e,ot(t.line-1)):null:0<r&&t.ch==(i||Qe(e,t.line)).text.length?t.line<e.first+e.size-1?ot(t.line+1,0):null:new ot(t.line,t.ch+r)}function no(e){e.setSelection(ot(e.firstLine(),0),ot(e.lastLine()),j)}function oo(e,t,r){var i={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return i.canceled=!0}};return r&&(i.update=function(t,r,n,o){t&&(i.from=pt(e,t)),r&&(i.to=pt(e,r)),n&&(i.text=n),void 0!==o&&(i.origin=o)}),ke(e,"beforeChange",e,i),e.cm&&ke(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function ao(e,t,r){if(e.cm){if(!e.cm.curOp)return Zi(e.cm,ao)(e,t,r);if(e.cm.state.suppressEdits)return}if(!(Ce(e,"beforeChange")||e.cm&&Ce(e.cm,"beforeChange"))||(t=oo(e,t,!0))){var i=Lt&&!r&&function(e,t,r){var i=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||i&&-1!=R(i,r)||(i=i||[]).push(r)}}),!i)return null;for(var n=[{from:t,to:r}],o=0;o<i.length;++o)for(var a=i[o],s=a.find(0),l=0;l<n.length;++l){var c,u,d,p=n[l];at(p.to,s.from)<0||0<at(p.from,s.to)||(c=[l,1],u=at(p.from,s.from),d=at(p.to,s.to),(u<0||!a.inclusiveLeft&&!u)&&c.push({from:p.from,to:s.from}),(0<d||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:p.to}),n.splice.apply(n,c),l+=c.length-3)}return n}(e,t.from,t.to);if(i)for(var n=i.length-1;0<=n;--n)so(e,{from:i[n].from,to:i[n].to,text:n?[""]:t.text,origin:t.origin});else so(e,t)}}function so(e,t){var r,i;1==t.text.length&&""==t.text[0]&&0==at(t.from,t.to)||(r=Ln(e,t),zn(e,t,r,e.cm?e.cm.curOp.id:NaN),uo(e,t,r,_t(e,t)),i=[],On(e,function(e,r){r||-1!=R(i,e.history)||(go(e.history,t),i.push(e.history)),uo(e,t,null,_t(e,t))}))}function lo(e,t,r){var i=e.cm&&e.cm.state.suppressEdits;if(!i||r){for(var n,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,l="undo"==t?o.undone:o.done,c=0;c<s.length&&(n=s[c],r?!n.ranges||n.equals(e.sel):n.ranges);c++);if(c!=s.length){for(o.lastOrigin=o.lastSelOrigin=null;;){if(!(n=s.pop()).ranges){if(i)return void s.push(n);break}if(Hn(n,l),r&&!n.equals(e.sel))return void Xn(e,n,{clearRedo:!1});a=n}var u=[];Hn(a,l),l.push({changes:u,generation:o.generation}),o.generation=n.generation||++o.maxGeneration;for(var d=Ce(e,"beforeChange")||e.cm&&Ce(e.cm,"beforeChange"),p=function(r){var i=n.changes[r];if(i.origin=t,d&&!oo(e,i,!1))return s.length=0,{};u.push($n(e,i));var o=r?Ln(e,i):Y(s);uo(e,i,o,Fn(e,i)),!r&&e.cm&&e.cm.scrollIntoView({from:i.from,to:Cn(i)});var a=[];On(e,function(e,t){t||-1!=R(a,e.history)||(go(e.history,i),a.push(e.history)),uo(e,i,null,Fn(e,i))})},h=n.changes.length-1;0<=h;--h){var f=p(h);if(f)return f.v}}}}function co(e,t){if(0!=t&&(e.first+=t,e.sel=new wn(X(e.sel.ranges,function(e){return new kn(ot(e.anchor.line+t,e.anchor.ch),ot(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){ui(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,i=r.viewFrom;i<r.viewTo;i++)di(e.cm,i,"gutter")}}function uo(e,t,r,i){if(e.cm&&!e.cm.curOp)return Zi(e.cm,uo)(e,t,r,i);var n,o;t.to.line<e.first?co(e,t.text.length-1-(t.to.line-t.from.line)):t.from.line>e.lastLine()||(t.from.line<e.first&&(co(e,n=t.text.length-1-(e.first-t.from.line)),t={from:ot(e.first,0),to:ot(t.to.line+n,t.to.ch),text:[Y(t.text)],origin:t.origin}),o=e.lastLine(),t.to.line>o&&(t={from:t.from,to:ot(o,Qe(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ze(e,t.from,t.to),r=r||Ln(e,t),e.cm?function(e,t,r){var i=e.doc,n=e.display,o=t.from,a=t.to,s=!1,l=o.line;e.options.lineWrapping||(l=tt(jt(Qe(i,o.line))),i.iter(l,a.line+1,function(e){if(e==n.maxLine)return s=!0})),-1<i.sel.contains(t.from,t.to)&&Se(e),_n(i,t,r,ai(e)),e.options.lineWrapping||(i.iter(l,o.line+t.text.length,function(e){var t=Yt(e);t>n.maxLineLength&&(n.maxLine=e,n.maxLineLength=t,n.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,i=t-1;r<i;i--){var n=Qe(e,i).stateAfter;if(n&&(!(n instanceof ft)||i+n.lookAhead<t)){r=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}(i,o.line),tn(e,400);var c=t.text.length-(a.line-o.line)-1;t.full?ui(e):o.line!=a.line||1!=t.text.length||An(e.doc,t)?ui(e,o.line,a.line+1,c):di(e,o.line,"text");var u,d=Ce(e,"changes"),p=Ce(e,"change");(p||d)&&(u={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin},p&&ur(e,"change",e,u),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(u)),e.display.selForContextMenu=null}(e.cm,t,i):_n(e,t,i),Qn(e,r,j),e.cantEdit&&ro(e,ot(e.firstLine(),0))&&(e.cantEdit=!1))}function po(e,t,r,i,n){var o;at(i=i||r,r)<0&&(r=(o=[i,r])[0],i=o[1]),"string"==typeof t&&(t=e.splitLines(t)),ao(e,{from:r,to:i,text:t,origin:n})}function ho(e,t,r,i){r<e.line?e.line+=i:t<e.line&&(e.line=t,e.ch=0)}function fo(e,t,r,i){for(var n=0;n<e.length;++n){var o=e[n],a=!0;if(o.ranges){o.copied||((o=e[n]=o.deepCopy()).copied=!0);for(var s=0;s<o.ranges.length;s++)ho(o.ranges[s].anchor,t,r,i),ho(o.ranges[s].head,t,r,i)}else{for(var l=0;l<o.changes.length;++l){var c=o.changes[l];if(r<c.from.line)c.from=ot(c.from.line+i,c.from.ch),c.to=ot(c.to.line+i,c.to.ch);else if(t<=c.to.line){a=!1;break}}a||(e.splice(0,n+1),n=0)}}}function go(e,t){var r=t.from.line,i=t.to.line,n=t.text.length-(i-r)-1;fo(e.done,r,i,n),fo(e.undone,r,i,n)}function mo(e,t,r,i){var n=t,o=t;return"number"==typeof t?o=Qe(e,dt(e,t)):n=tt(t),null==n?null:(i(o,n)&&e.cm&&di(e.cm,n,r),o)}function vo(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}function bo(e){this.children=e;for(var t=0,r=0,i=0;i<e.length;++i){var n=e[i];t+=n.chunkSize(),r+=n.height,n.parent=this}this.size=t,this.height=r,this.parent=null}function yo(e,t,r){if(r)for(var i in r)r.hasOwnProperty(i)&&(this[i]=r[i]);this.doc=e,this.node=t}function wo(e,t,r){Kt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Mi(e,r)}kn.prototype.from=function(){return ut(this.anchor,this.head)},kn.prototype.to=function(){return ct(this.anchor,this.head)},kn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},vo.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r,i=e,n=e+t;i<n;++i){var o=this.lines[i];this.height-=o.height,(r=o).parent=null,Nt(r),ur(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=this},iterN:function(e,t,r){for(var i=e+t;e<i;++e)if(r(this.lines[e]))return!0}},bo.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r,i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<o){var a=Math.min(t,o-e),s=n.height;if(n.removeInner(e,a),this.height-=s-n.height,o==a&&(this.children.splice(i--,1),n.parent=null),0==(t-=a))break;e=0}else e-=o}this.size-t<25&&(1<this.children.length||!(this.children[0]instanceof vo))&&(r=[],this.collapse(r),this.children=[new vo(r)],this.children[0].parent=this)},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<=o){if(n.insertInner(e,t,r),n.lines&&50<n.lines.length){for(var a=n.lines.length%25+25,s=a;s<n.lines.length;){var l=new vo(n.lines.slice(s,s+=25));n.height-=l.height,this.children.splice(++i,0,l),l.parent=this}n.lines=n.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t,r,i=new bo(e.children.splice(e.children.length-5,5));e.parent?(e.size-=i.size,e.height-=i.height,t=R(e.parent.children,e),e.parent.children.splice(t+1,0,i)):(((r=new bo(e.children)).parent=e).children=[r,i],e=r),i.parent=e.parent}while(10<e.children.length);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var i=0;i<this.children.length;++i){var n=this.children[i],o=n.chunkSize();if(e<o){var a=Math.min(t,o-e);if(n.iterN(e,a,r))return!0;if(0==(t-=a))break;e=0}else e-=o}}},yo.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,i=tt(r);if(null!=i&&t){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(r.widgets=null);var o=xr(this);et(r,Math.max(0,r.height-o)),e&&(Qi(e,function(){wo(e,r,-o),di(e,i,"widget")}),ur(e,"lineWidgetCleared",e,this,i))}},yo.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,i=this.line;this.height=null;var n=xr(this)-t;n&&(Ut(this.doc,i)||et(i,i.height+n),r&&Qi(r,function(){r.curOp.forceUpdate=!0,wo(r,i,n),ur(r,"lineWidgetChanged",r,e,tt(i))}))},Ee(yo);var ko=0,xo=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ko};function So(e,t,r,i,n){if(i&&i.shared)return function(e,t,r,i,n){(i=P(i)).shared=!1;var o=[So(e,t,r,i,n)],a=o[0],s=i.widgetNode;return On(e,function(e){s&&(i.widgetNode=s.cloneNode(!0)),o.push(So(e,pt(e,t),pt(e,r),i,n));for(var l=0;l<e.linked.length;++l)if(e.linked[l].isParent)return;a=Y(o)}),new Co(o,a)}(e,t,r,i,n);if(e.cm&&!e.cm.curOp)return Zi(e.cm,So)(e,t,r,i,n);var o=new xo(e,n),a=at(t,r);if(i&&P(i,o,!1),0<a||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=A("span",[o.replacedWith],"ESGMirror-widget"),i.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ft(e,t.line,t,r,o)||t.line!=r.line&&Ft(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Gt=!0}o.addToHistory&&zn(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,r.line+1,function(e){var i,n;c&&o.collapsed&&!c.options.lineWrapping&&jt(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&et(e,0),i=e,n=new Tt(o,l==t.line?t.ch:null,l==r.line?r.ch:null),i.markedSpans=i.markedSpans?i.markedSpans.concat([n]):[n],n.marker.attachLine(i),++l}),o.collapsed&&e.iter(t.line,r.line+1,function(t){Ut(e,t)&&et(t,0)}),o.clearOnEnter&&be(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Lt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ko,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)ui(c,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=r.line;u++)di(c,u,"text");o.atomic&&Jn(c.doc),ur(c,"markerAdded",c,o)}return o}xo.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t,r=this.doc.cm,i=r&&!r.curOp;i&&qi(r),!Ce(this,"clear")||(t=this.find())&&ur(this,"clear",t.from,t.to);for(var n=null,o=null,a=0;a<this.lines.length;++a){var s=e.lines[a],l=Mt(s.markedSpans,e);r&&!e.collapsed?di(r,tt(s),"text"):r&&(null!=l.to&&(o=tt(s)),null!=l.from&&(n=tt(s))),s.markedSpans=At(s.markedSpans,l),null==l.from&&e.collapsed&&!Ut(e.doc,s)&&r&&et(s,ri(r.display))}if(r&&this.collapsed&&!r.options.lineWrapping)for(var c=0;c<this.lines.length;++c){var u=jt(e.lines[c]),d=Yt(u);d>r.display.maxLineLength&&(r.display.maxLine=u,r.display.maxLineLength=d,r.display.maxLineChanged=!0)}null!=n&&r&&this.collapsed&&ui(r,n,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,r&&Jn(r.doc)),r&&ur(r,"markerCleared",r,this,n,o),i&&Ui(r),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var r,i;null==e&&"bookmark"==this.type&&(e=1);for(var n=0;n<this.lines.length;++n){var o=this.lines[n],a=Mt(o.markedSpans,this);if(null!=a.from&&(r=ot(t?o:tt(o),a.from),-1==e))return r;if(null!=a.to&&(i=ot(t?o:tt(o),a.to),1==e))return i}return r&&{from:r,to:i}},xo.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,i=this.doc.cm;t&&i&&Qi(i,function(){var n,o,a=t.line,s=tt(t.line),l=Or(i,s);l&&(Hr(l),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,Ut(r.doc,a)||null==r.height||(n=r.height,r.height=null,(o=xr(r)-n)&&et(a,a.height+o)),ur(i,"markerChanged",i,e)})},xo.prototype.attachLine=function(e){var t;!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers&&-1!=R(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)),this.lines.push(e)},xo.prototype.detachLine=function(e){var t;this.lines.splice(R(this.lines,e),1),!this.lines.length&&this.doc.cm&&((t=this.doc.cm.curOp).maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)},Ee(xo);var Co=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};function Eo(e){return e.findMarks(ot(e.first,0),e.clipPos(ot(e.lastLine())),function(e){return e.parent})}function Lo(e){for(var t=function(t){var r=e[t],i=[r.primary.doc];On(r.primary.doc,function(e){return i.push(e)});for(var n=0;n<r.markers.length;n++){var o=r.markers[n];-1==R(i,o.doc)&&(o.parent=null,r.markers.splice(n--,1))}},r=0;r<e.length;r++)t(r)}Co.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();ur(this,"clear")}},Co.prototype.find=function(e,t){return this.primary.find(e,t)},Ee(Co);var Go=0,To=function(e,t,r,i,n){if(!(this instanceof To))return new To(e,t,r,i,n);null==r&&(r=0),bo.call(this,[new vo([new Qt("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=ot(r,0);this.sel=Sn(o),this.history=new In(null),this.id=++Go,this.modeOption=t,this.lineSep=i,this.direction="rtl"==n?"rtl":"ltr",this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),_n(this,{from:o,to:o,text:e}),Xn(this,Sn(o),j)};To.prototype=Z(bo.prototype,{constructor:To,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Je(this,this.first,this.first+this.size);return!1===e?t:t.join(e||this.lineSeparator())},setValue:en(function(e){var t=ot(this.first,0),r=this.first+this.size-1;ao(this,{from:t,to:ot(r,Qe(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&_i(this.cm,0,0),Xn(this,Sn(t),j)}),replaceRange:function(e,t,r,i){po(this,e,t=pt(this,t),r=r?pt(this,r):t,i)},getRange:function(e,t,r){var i=Ze(this,pt(this,e),pt(this,t));return!1===r?i:i.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(it(this,e))return Qe(this,e)},getLineNumber:tt,getLineHandleVisualStart:function(e){return"number"==typeof e&&(e=Qe(this,e)),jt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return pt(this,e)},getCursor:function(e){var t=this.sel.primary();return null==e||"head"==e?t.head:"anchor"==e?t.anchor:"end"==e||"to"==e||!1===e?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:en(function(e,t,r){Kn(this,pt(this,"number"==typeof e?ot(e,t||0):e),null,r)}),setSelection:en(function(e,t,r){Kn(this,pt(this,e),pt(this,t||e),r)}),extendSelection:en(function(e,t,r){qn(this,pt(this,e),t&&pt(this,t),r)}),extendSelections:en(function(e,t){Un(this,ht(this,e),t)}),extendSelectionsBy:en(function(e,t){Un(this,ht(this,X(this.sel.ranges,e)),t)}),setSelections:en(function(e,t,r){if(e.length){for(var i=[],n=0;n<e.length;n++)i[n]=new kn(pt(this,e[n].anchor),pt(this,e[n].head));null==t&&(t=Math.min(e.length-1,this.sel.primIndex)),Xn(this,xn(this.cm,i,t),r)}}),addSelection:en(function(e,t,r){var i=this.sel.ranges.slice(0);i.push(new kn(pt(this,e),pt(this,t||e))),Xn(this,xn(this.cm,i,i.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r=0;r<t.length;r++)var i=Ze(this,t[r].from(),t[r].to()),n=n?n.concat(i):i;return!1===e?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,i=0;i<r.length;i++){var n=Ze(this,r[i].from(),r[i].to());!1!==e&&(n=n.join(e||this.lineSeparator())),t[i]=n}return t},replaceSelection:function(e,t,r){for(var i=[],n=0;n<this.sel.ranges.length;n++)i[n]=e;this.replaceSelections(i,t,r||"+input")},replaceSelections:en(function(e,t,r){for(var i=[],n=this.sel,o=0;o<n.ranges.length;o++){var a=n.ranges[o];i[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:r}}for(var s=t&&"end"!=t&&function(e,t,r){for(var i=[],n=d=ot(e.first,0),o=0;o<t.length;o++){var a,s,l=t[o],c=Gn(l.from,d,n),u=Gn(Cn(l),d,n),d=l.to;n=u;"around"==r?(s=at((a=e.sel.ranges[o]).head,a.anchor)<0,i[o]=new kn(s?u:c,s?c:u)):i[o]=new kn(c,c)}return new wn(i,e.sel.primIndex)}(this,i,t),l=i.length-1;0<=l;l--)ao(this,i[l]);s?Yn(this,s):this.cm&&Ai(this.cm)}),undo:en(function(){lo(this,"undo")}),redo:en(function(){lo(this,"redo")}),undoSelection:en(function(){lo(this,"undo",!0)}),redoSelection:en(function(){lo(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,i=0;i<e.done.length;i++)e.done[i].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new In(this.history.maxGeneration),On(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:jn(this.history.done),undone:jn(this.history.undone)}},setHistory:function(e){var t=this.history=new In(this.history.maxGeneration);t.done=jn(e.done.slice(0),null,!0),t.undone=jn(e.undone.slice(0),null,!0)},setGutterMarker:en(function(e,t,r){return mo(this,e,"gutter",function(e){var i=e.gutterMarkers||(e.gutterMarkers={});return!(i[t]=r)&&re(i)&&(e.gutterMarkers=null),1})}),clearGutter:en(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&mo(t,r,"gutter",function(){return r.gutterMarkers[e]=null,re(r.gutterMarkers)&&(r.gutterMarkers=null),1})})}),lineInfo:function(e){var t;if("number"==typeof e){if(!it(this,e))return null;if(!(e=Qe(this,t=e)))return null}else if(null==(t=tt(e)))return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:en(function(e,t,r){return mo(this,e,"gutter"==t?"gutter":"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(e[i]){if(C(r).test(e[i]))return;e[i]+=" "+r}else e[i]=r;return 1})}),removeLineClass:en(function(e,t,r){return mo(this,e,"gutter"==t?"gutter":"class",function(e){var i="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",n=e[i];if(n){if(null==r)e[i]=null;else{var o=n.match(C(r));if(!o)return;var a=o.index+o[0].length;e[i]=n.slice(0,o.index)+(o.index&&a!=n.length?" ":"")+n.slice(a)||null}return 1}})}),addLineWidget:en(function(e,t,r){return n=e,o=new yo(i=this,t,r),(a=i.cm)&&o.noHScroll&&(a.display.alignWidgets=!0),mo(i,n,"widget",function(e){var t,r=e.widgets||(e.widgets=[]);return null==o.insertAt?r.push(o):r.splice(Math.min(r.length-1,Math.max(0,o.insertAt)),0,o),o.line=e,a&&!Ut(i,e)&&(t=Kt(e)<i.scrollTop,et(e,e.height+xr(o)),t&&Mi(a,o.height),a.curOp.forceUpdate=!0),1}),a&&ur(a,"lineWidgetAdded",a,o,"number"==typeof n?n:tt(n)),o;var i,n,o,a}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return So(this,pt(this,e),pt(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return So(this,e=pt(this,e),e,r,"bookmark")},findMarksAt:function(e){var t=[],r=Qe(this,(e=pt(this,e)).line).markedSpans;if(r)for(var i=0;i<r.length;++i){var n=r[i];(null==n.from||n.from<=e.ch)&&(null==n.to||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,r){e=pt(this,e),t=pt(this,t);var i=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s<a.length;s++){var l=a[s];null!=l.to&&n==e.line&&e.ch>=l.to||null==l.from&&n!=e.line||null!=l.from&&n==t.line&&l.from>=t.ch||r&&!r(l.marker)||i.push(l.marker.parent||l.marker)}++n}),i},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var i=0;i<r.length;++i)null!=r[i].from&&e.push(r[i].marker)}),e},posFromIndex:function(e){var t,r=this.first,i=this.lineSeparator().length;return this.iter(function(n){var o=n.text.length+i;if(e<o)return t=e,!0;e-=o,++r}),pt(this,ot(r,t))},indexFromPos:function(e){var t=(e=pt(this,e)).ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(e){t+=e.text.length+r}),t},copy:function(e){var t=new To(Je(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e=e||{};var t=this.first,r=this.first+this.size;null!=e.from&&e.from>t&&(t=e.from),null!=e.to&&e.to<r&&(r=e.to);var i=new To(Je(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],function(e,t){for(var r=0;r<t.length;r++){var i,n=t[r],o=n.find(),a=e.clipPos(o.from),s=e.clipPos(o.to);at(a,s)&&(i=So(e,a,s,n.primary,n.primary.type),n.markers.push(i),i.parent=n)}}(i,Eo(this)),i},unlinkDoc:function(e){var t;if(e instanceof wa&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r)if(this.linked[r].doc==e){this.linked.splice(r,1),e.unlinkDoc(this),Lo(Eo(this));break}e.history==this.history&&(t=[e.id],On(e,function(e){return t.push(e.id)},!0),e.history=new In(null),e.history.done=jn(this.history.done,t),e.history.undone=jn(this.history.undone,t))},iterLinkedDocs:function(e){On(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ze(e)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:en(function(e){var t;"rtl"!=e&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(e){return e.order=null}),this.cm&&Qi(t=this.cm,function(){Dn(t),ui(t)}))})}),To.prototype.eachLine=To.prototype.iter;var Mo=0;function Ao(e){var t=this;if(_o(t),!xe(t,e)&&!Sr(t.display,e)){Le(e),a&&(Mo=+new Date);var r=li(t,e,!0),i=e.dataTransfer.files;if(r&&!t.isReadOnly())if(i&&i.length&&window.FileReader&&window.File)for(var n=i.length,o=Array(n),s=0,l=function(){++s==n&&Zi(t,function(){var e={from:r=pt(t.doc,r),to:r,text:t.doc.splitLines(o.filter(function(e){return null!=e}).join(t.doc.lineSeparator())),origin:"paste"};ao(t.doc,e),Yn(t.doc,Sn(pt(t.doc,r),pt(t.doc,Cn(e))))})()},c=function(e,r){var i;t.options.allowDropFileTypes&&-1==R(t.options.allowDropFileTypes,e.type)?l():((i=new FileReader).onerror=l,i.onload=function(){var e=i.result;/[\x00-\x08\x0e-\x1f]{2}/.test(e)||(o[r]=e),l()},i.readAsText(e))},u=0;u<i.length;u++)c(i[u],u);else{if(t.state.draggingText&&-1<t.doc.sel.contains(r))return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var d,p=e.dataTransfer.getData("Text");if(p){if(t.state.draggingText&&!t.state.draggingText.copy&&(d=t.listSelections()),Qn(t.doc,Sn(r,r)),d)for(var h=0;h<d.length;++h)po(t.doc,"",d[h].anchor,d[h].head,"drag");t.replaceSelection(p,"around","paste"),t.display.input.focus()}}catch(e){}}}}function _o(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Oo(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("ESGMirror"),r=[],i=0;i<t.length;i++){var n=t[i].ESGMirror;n&&r.push(n)}r.length&&r[0].operation(function(){for(var t=0;t<r.length;t++)e(r[t])})}}var No=!1;function Do(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Io={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},$o=0;$o<10;$o++)Io[$o+48]=Io[$o+96]=String($o);for(var Po=65;Po<=90;Po++)Io[Po]=String.fromCharCode(Po);for(var zo=1;zo<=12;zo++)Io[zo+111]=Io[zo+63235]="F"+zo;var Ho={};function Ro(e){var t,r,i,n,o=e.split(/-(?!$)/);e=o[o.length-1];for(var a=0;a<o.length-1;a++){var s=o[a];if(/^(cmd|meta|m)$/i.test(s))n=!0;else if(/^a(lt)?$/i.test(s))t=!0;else if(/^(c|ctrl|control)$/i.test(s))r=!0;else{if(!/^s(hift)?$/i.test(s))throw new Error("Unrecognized modifier name: "+s);i=!0}}return t&&(e="Alt-"+e),r&&(e="Ctrl-"+e),n&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Wo(e,t,r,i){var n=(t=qo(t)).call?t.call(e,i):t[e];if(!1===n)return"nothing";if("..."===n)return"multi";if(null!=n&&r(n))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return Wo(e,t.fallthrough,r,i);for(var o=0;o<t.fallthrough.length;o++){var a=Wo(e,t.fallthrough[o],r,i);if(a)return a}}}function Fo(e){var t="string"==typeof e?e:Io[e.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function jo(e,t,r){var i=e;return t.altKey&&"Alt"!=i&&(e="Alt-"+e),(x?t.metaKey:t.ctrlKey)&&"Ctrl"!=i&&(e="Ctrl-"+e),(x?t.ctrlKey:t.metaKey)&&"Cmd"!=i&&(e="Cmd-"+e),!r&&t.shiftKey&&"Shift"!=i&&(e="Shift-"+e),e}function Bo(e,t){if(d&&34==e.keyCode&&e.char)return!1;var r=Io[e.keyCode];return null!=r&&!e.altGraphKey&&(3==e.keyCode&&e.code&&(r=e.code),jo(r,e,t))}function qo(e){return"string"==typeof e?Ho[e]:e}function Uo(e,t){for(var r=e.doc.sel.ranges,i=[],n=0;n<r.length;n++){for(var o=t(r[n]);i.length&&at(o.from,Y(i).to)<=0;){var a=i.pop();if(at(a.from,o.from)<0){o.from=a.from;break}}i.push(o)}Qi(e,function(){for(var t=i.length-1;0<=t;t--)po(e.doc,"",i[t].from,i[t].to,"+delete");Ai(e)})}function Vo(e,t,r){var i=oe(e.text,t+r,r);return i<0||i>e.text.length?null:i}function Ko(e,t,r){var i=Vo(e,t.ch,r);return null==i?null:new ot(t.line,i,r<0?"after":"before")}function Yo(e,t,r,i,n){if(e){"rtl"==t.doc.direction&&(n=-n);var o=me(r,t.doc.direction);if(o){var a,s,l,c=n<0?Y(o):o[0],u=n<0==(1==c.level)?"after":"before";return 0<c.level||"rtl"==t.doc.direction?(a=Nr(t,r),s=n<0?r.text.length-1:0,l=Dr(t,a,s).top,s=ae(function(e){return Dr(t,a,e).top==l},n<0==(1==c.level)?c.from:c.to-1,s),"before"==u&&(s=Vo(r,s,1))):s=n<0?c.to:c.from,new ot(i,s,u)}}return new ot(i,n<0?r.text.length:0,n<0?"before":"after")}Ho.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ho.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ho.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ho.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ho.default=b?Ho.macDefault:Ho.pcDefault;var Xo={selectAll:no,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),j)},killLine:function(e){return Uo(e,function(t){if(t.empty()){var r=Qe(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:ot(t.head.line+1,0)}:{from:t.head,to:ot(t.head.line,r)}}return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Uo(e,function(t){return{from:ot(t.from().line,0),to:pt(e.doc,ot(t.to().line+1,0))}})},delLineLeft:function(e){return Uo(e,function(e){return{from:ot(e.from().line,0),to:e.from()}})},delWrappedLineLeft:function(e){return Uo(e,function(t){var r=e.charCoords(t.head,"div").top+5;return{from:e.coordsChar({left:0,top:r},"div"),to:t.from()}})},delWrappedLineRight:function(e){return Uo(e,function(t){var r=e.charCoords(t.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:i}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(ot(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(ot(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Qo(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Zo(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return function(e,t){var r=Qe(e.doc,t),i=function(e){for(var t;t=Rt(e);)e=t.find(1,!0).line;return e}(r);return i!=r&&(t=tt(i)),Yo(!0,e,r,t,-1)}(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},q)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},q)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,i=e.coordsChar({left:0,top:r},"div");return i.ch<e.getLine(i.line).search(/\S/)?Zo(e,t.head):i},q)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection("\t")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),i=e.options.tabSize,n=0;n<r.length;n++){var o=r[n].from(),a=z(e.getLine(o.line),o.ch,i);t.push(K(i-a%i))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Qi(e,function(){for(var t,r,i,n=e.listSelections(),o=[],a=0;a<n.length;a++)n[a].empty()&&(t=n[a].head,(r=Qe(e.doc,t.line).text)&&(t.ch==r.length&&(t=new ot(t.line,t.ch-1)),0<t.ch?(t=new ot(t.line,t.ch+1),e.replaceRange(r.charAt(t.ch-1)+r.charAt(t.ch-2),ot(t.line,t.ch-2),t,"+transpose")):t.line>e.doc.first&&(i=Qe(e.doc,t.line-1).text)&&(t=new ot(t.line,1),e.replaceRange(r.charAt(0)+e.doc.lineSeparator()+i.charAt(i.length-1),ot(t.line-1,i.length-1),t,"+transpose"))),o.push(new kn(t,t)));e.setSelections(o)})},newlineAndIndent:function(e){return Qi(e,function(){for(var t=e.listSelections(),r=t.length-1;0<=r;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var i=0;i<t.length;i++)e.indentLine(t[i].from().line,null,!0);Ai(e)})},openLine:function(e){return e.replaceSelection("\n","start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Qo(e,t){var r=Qe(e.doc,t),i=jt(r);return i!=r&&(t=tt(i)),Yo(!0,e,i,t,1)}function Zo(e,t){var r=Qo(e,t.line),i=Qe(e.doc,r.line),n=me(i,e.doc.direction);if(n&&0!=n[0].level)return r;var o=Math.max(r.ch,i.text.search(/\S/)),a=t.line==r.line&&t.ch<=o&&t.ch;return ot(r.line,a?0:o,r.sticky)}function Jo(e,t,r){if("string"==typeof t&&!(t=Xo[t]))return!1;e.display.input.ensurePolled();var i=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),n=t(e)!=F}finally{e.display.shift=i,e.state.suppressEdits=!1}return n}var ea=new H;function ta(e,t,r,i){var n=e.state.keySeq;if(n){if(Fo(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:ea.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),ra(e,n+" "+t,r,i))return!0}return ra(e,t,r,i)}function ra(e,t,r,i){var n=function(e,t,r){for(var i=0;i<e.state.keyMaps.length;i++){var n=Wo(t,e.state.keyMaps[i],r,e);if(n)return n}return e.options.extraKeys&&Wo(t,e.options.extraKeys,r,e)||Wo(t,e.options.keyMap,r,e)}(e,t,i);return"multi"==n&&(e.state.keySeq=t),"handled"==n&&ur(e,"keyHandled",e,t,r),"handled"!=n&&"multi"!=n||(Le(r),wi(e)),!!n}function ia(e,t){var r=Bo(t,!0);return!!r&&(t.shiftKey&&!e.state.keySeq?ta(e,"Shift-"+r,t,function(t){return Jo(e,t,!0)})||ta(e,r,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return Jo(e,t)}):ta(e,r,t,function(t){return Jo(e,t)}))}var na=null;function oa(e){var t,i,n,o=this;function l(e){18!=e.keyCode&&e.altKey||(L(n,"ESGMirror-crosshair"),we(document,"keyup",l),we(document,"mouseover",l))}e.target&&e.target!=o.display.input.getField()||(o.curOp.focus=O(),xe(o,e)||(a&&s<11&&27==e.keyCode&&(e.returnValue=!1),t=e.keyCode,o.display.shift=16==t||e.shiftKey,i=ia(o,e),d&&(na=i?t:null,!i&&88==t&&!Re&&(b?e.metaKey:e.ctrlKey)&&o.replaceSelection("",null,"cut")),r&&!b&&!i&&46==t&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=t||/\bESGMirror-crosshair\b/.test(o.display.lineDiv.className)||(N(n=o.display.lineDiv,"ESGMirror-crosshair"),be(document,"keyup",l),be(document,"mouseover",l))))}function aa(e){16==e.keyCode&&(this.doc.sel.shift=!1),xe(this,e)}function sa(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField()||Sr(t.display,e)||xe(t,e)||e.ctrlKey&&!e.altKey||b&&e.metaKey)){var r,i,n=e.keyCode,o=e.charCode;if(d&&n==na)return na=null,void Le(e);d&&(!e.which||e.which<10)&&ia(t,e)||"\b"!=(r=String.fromCharCode(null==o?n:o))&&(ta(i=t,"'"+r+"'",e,function(e){return Jo(i,e,!0)})||t.display.input.onKeyPress(e))}}var la,ca,ua=function(e,t,r){this.time=e,this.pos=t,this.button=r};function da(e){var t,r,i,n,o,c,u=this,d=u.display;xe(u,e)||d.activeTouch&&d.input.supportsTouch()||(d.input.ensurePolled(),d.shift=e.shiftKey,Sr(d,e)?l||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100)):fa(u,e)||(t=li(u,e),r=_e(e),i=t?(n=t,o=r,c=+new Date,ca&&ca.compare(c,n,o)?(la=ca=null,"triple"):la&&la.compare(c,n,o)?(ca=new ua(c,n,o),la=null,"double"):(la=new ua(c,n,o),ca=null,"single")):"single",window.focus(),1==r&&u.state.selectingText&&u.state.selectingText(e),t&&function(e,t,r,i,n){var o="Click";return"double"==i?o="Double"+o:"triple"==i&&(o="Triple"+o),ta(e,jo(o=(1==t?"Left":2==t?"Middle":"Right")+o,n),n,function(t){if("string"==typeof t&&(t=Xo[t]),!t)return!1;var i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i=t(e,r)!=F}finally{e.state.suppressEdits=!1}return i})}(u,r,t,i,e)||(1==r?t?function(e,t,r,i){a?setTimeout($(ki,e),0):e.curOp.focus=O();var n,o=function(e,t,r){var i,n=e.getOption("configureMouse"),o=n?n(e,t,r):{};return null==o.unit&&(i=y?r.shiftKey&&r.metaKey:r.altKey,o.unit=i?"rectangle":"single"==t?"char":"double"==t?"word":"line"),null!=o.extend&&!e.doc.extend||(o.extend=e.doc.extend||r.shiftKey),null==o.addNew&&(o.addNew=b?r.metaKey:r.ctrlKey),null==o.moveOnDrag&&(o.moveOnDrag=!(b?r.altKey:r.ctrlKey)),o}(e,r,i),c=e.doc.sel;(e.options.dragDrop&&De&&!e.isReadOnly()&&"single"==r&&-1<(n=c.contains(t))&&(at((n=c.ranges[n]).from(),t)<0||0<t.xRel)&&(0<at(n.to(),t)||t.xRel<0)?function(e,t,r,i){var n=e.display,o=!1,c=Zi(e,function(t){l&&(n.scroller.draggable=!1),e.state.draggingText=!1,we(n.wrapper.ownerDocument,"mouseup",c),we(n.wrapper.ownerDocument,"mousemove",u),we(n.scroller,"dragstart",d),we(n.scroller,"drop",c),o||(Le(t),i.addNew||qn(e.doc,r,null,null,i.extend),l&&!p||a&&9==s?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),u=function(e){o=o||10<=Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)},d=function(){return o=!0};l&&(n.scroller.draggable=!0),(e.state.draggingText=c).copy=!i.moveOnDrag,n.scroller.dragDrop&&n.scroller.dragDrop(),be(n.wrapper.ownerDocument,"mouseup",c),be(n.wrapper.ownerDocument,"mousemove",u),be(n.scroller,"dragstart",d),be(n.scroller,"drop",c),xi(e),setTimeout(function(){return n.input.focus()},20)}:function(e,t,r,i){var n=e.display,o=e.doc;Le(t);var a,s,l,c=o.sel,u=c.ranges;i.addNew&&!i.extend?(s=o.sel.contains(r),a=-1<s?u[s]:new kn(r,r)):(a=o.sel.primary(),s=o.sel.primIndex),"rectangle"==i.unit?(i.addNew||(a=new kn(r,r)),r=li(e,t,!0,!0),s=-1):(l=pa(e,r,i.unit),a=i.extend?Bn(a,l.anchor,l.head,i.extend):l),i.addNew?-1==s?(s=u.length,Xn(o,xn(e,u.concat([a]),s),{scroll:!1,origin:"*mouse"})):1<u.length&&u[s].empty()&&"char"==i.unit&&!i.extend?(Xn(o,xn(e,u.slice(0,s).concat(u.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),c=o.sel):Vn(o,s,a,B):(Xn(o,new wn([a],s=0),B),c=o.sel);var d=r;var p=n.wrapper.getBoundingClientRect(),h=0;function f(t){e.state.selectingText=!1,h=1/0,t&&(Le(t),n.input.focus()),we(n.wrapper.ownerDocument,"mousemove",g),we(n.wrapper.ownerDocument,"mouseup",m),o.history.lastSelOrigin=null}var g=Zi(e,function(t){(0!==t.buttons&&_e(t)?function t(l){var u,f,g=++h,m=li(e,l,!0,"rectangle"==i.unit);m&&(0!=at(m,d)?(e.curOp.focus=O(),function(t){if(0!=at(d,t))if(d=t,"rectangle"==i.unit){for(var n=[],l=e.options.tabSize,u=z(Qe(o,r.line).text,r.ch,l),p=z(Qe(o,t.line).text,t.ch,l),h=Math.min(u,p),f=Math.max(u,p),g=Math.min(r.line,t.line),m=Math.min(e.lastLine(),Math.max(r.line,t.line));g<=m;g++){var v=Qe(o,g).text,b=U(v,h,l);h==f?n.push(new kn(ot(g,b),ot(g,b))):v.length>b&&n.push(new kn(ot(g,b),ot(g,U(v,f,l))))}n.length||n.push(new kn(r,r)),Xn(o,xn(e,c.ranges.slice(0,s).concat(n),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var y,w=a,k=pa(e,t,i.unit),x=w.anchor,S=(x=0<at(k.anchor,x)?(y=k.head,ut(w.from(),k.anchor)):(y=k.anchor,ct(w.to(),k.head)),c.ranges.slice(0));S[s]=function(e,t){var r=t.anchor,i=t.head,n=Qe(e.doc,r.line);if(0==at(r,i)&&r.sticky==i.sticky)return t;var o=me(n);if(!o)return t;var a=le(o,r.ch,r.sticky),s=o[a];if(s.from!=r.ch&&s.to!=r.ch)return t;var l,c,u,d=a+(s.from==r.ch==(1!=s.level)?0:1);if(0==d||d==o.length)return t;var p=o[d+((l=i.line!=r.line?0<(i.line-r.line)*("ltr"==e.doc.direction?1:-1):(u=(c=le(o,i.ch,i.sticky))-a||(i.ch-r.ch)*(1==s.level?-1:1),c==d-1||c==d?u<0:0<u))?-1:0)],h=l==(1==p.level),f=h?p.from:p.to,g=h?"after":"before";return r.ch==f&&r.sticky==g?t:new kn(new ot(r.line,f,g),i)}(e,new kn(pt(o,x),y)),Xn(o,xn(e,S,s),B)}}(m),u=Gi(n,o),(m.line>=u.to||m.line<u.from)&&setTimeout(Zi(e,function(){h==g&&t(l)}),150)):(f=l.clientY<p.top?-20:l.clientY>p.bottom?20:0)&&setTimeout(Zi(e,function(){h==g&&(n.scroller.scrollTop+=f,t(l))}),50))}:f)(t)}),m=Zi(e,f);e.state.selectingText=m,be(n.wrapper.ownerDocument,"mousemove",g),be(n.wrapper.ownerDocument,"mouseup",m)})(e,i,t,o)}(u,t,i,e):Ae(e)==d.scroller&&Le(e):2==r?(t&&qn(u.doc,t),setTimeout(function(){return d.input.focus()},20)):3==r&&(S?u.display.input.onContextMenu(e):xi(u)))))}function pa(e,t,r){if("char"==r)return new kn(t,t);if("word"==r)return e.findWordAt(t);if("line"==r)return new kn(ot(t.line,0),pt(e.doc,ot(t.line+1,0)));var i=r(e,t);return new kn(i.from,i.to)}function ha(e,t,r,i){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch(t){return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&Le(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ce(e,r))return Te(t);o-=s.top-a.viewOffset;for(var l=0;l<e.display.gutterSpecs.length;++l){var c=a.gutters.childNodes[l];if(c&&c.getBoundingClientRect().right>=n)return ke(e,r,e,rt(e.doc,o),e.display.gutterSpecs[l].className,t),Te(t)}}function fa(e,t){return ha(e,t,"gutterClick",!0)}function ga(e,t){var r,i;Sr(e.display,t)||(i=t,Ce(r=e,"gutterContextMenu")&&ha(r,i,"gutterContextMenu",!1))||xe(e,t,"contextmenu")||S||e.display.input.onContextMenu(t)}function ma(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Wr(e)}ua.prototype.compare=function(e,t,r){return this.time+400>e&&0==at(t,this.pos)&&r==this.button};var va={toString:function(){return"ESGMirror.Init"}},ba={},ya={};function wa(e,t){var r=this;if(!(this instanceof wa))return new wa(e,t);this.options=t=t?P(t):{},P(ba,t,!1);var i=t.value;"string"==typeof i?i=new To(i,t.mode,null,t.lineSeparator,t.direction):t.mode&&(i.modeOption=t.mode),this.doc=i;var n=new wa.inputStyles[t.inputStyle](this),o=this.display=new gn(e,i,n,t);for(var c in ma(o.wrapper.ESGMirror=this),t.lineWrapping&&(this.display.wrapper.className+=" ESGMirror-wrap"),ji(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 H,keySeq:null,specialChars:null},t.autofocus&&!v&&o.input.focus(),a&&s<11&&setTimeout(function(){return r.display.input.reset(!0)},20),function(e){var t=e.display;be(t.scroller,"mousedown",Zi(e,da)),be(t.scroller,"dblclick",a&&s<11?Zi(e,function(t){var r,i;xe(e,t)||!(r=li(e,t))||fa(e,t)||Sr(e.display,t)||(Le(t),i=e.findWordAt(r),qn(e.doc,i.anchor,i.head))}):function(t){return xe(e,t)||Le(t)}),be(t.scroller,"contextmenu",function(t){return ga(e,t)}),be(t.input.getField(),"contextmenu",function(r){t.scroller.contains(r.target)||ga(e,r)});var r,i={end:0};function n(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),(i=t.activeTouch).end=+new Date)}function o(e,t){if(null==t.left)return 1;var r=t.left-e.left,i=t.top-e.top;return 400<r*r+i*i}be(t.scroller,"touchstart",function(n){var o;xe(e,n)||function(e){if(1==e.touches.length){var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}}(n)||fa(e,n)||(t.input.ensurePolled(),clearTimeout(r),o=+new Date,t.activeTouch={start:o,moved:!1,prev:o-i.end<=300?i:null},1==n.touches.length&&(t.activeTouch.left=n.touches[0].pageX,t.activeTouch.top=n.touches[0].pageY))}),be(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),be(t.scroller,"touchend",function(r){var i,a,s=t.activeTouch;s&&!Sr(t,r)&&null!=s.left&&!s.moved&&new Date-s.start<300&&(i=e.coordsChar(t.activeTouch,"page"),a=!s.prev||o(s,s.prev)?new kn(i,i):!s.prev.prev||o(s,s.prev.prev)?e.findWordAt(i):new kn(ot(i.line,0),pt(e.doc,ot(i.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Le(r)),n()}),be(t.scroller,"touchcancel",n),be(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Di(e,t.scroller.scrollTop),$i(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),be(t.scroller,"mousewheel",function(t){return yn(e,t)}),be(t.scroller,"DOMMouseScroll",function(t){return yn(e,t)}),be(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(t){xe(e,t)||Me(t)},over:function(t){var r,i,n;xe(e,t)||((n=li(r=e,t))&&(vi(r,n,i=document.createDocumentFragment()),r.display.dragCursor||(r.display.dragCursor=M("div",null,"ESGMirror-cursors ESGMirror-dragcursors"),r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)),T(r.display.dragCursor,i)),Me(t))},start:function(t){return r=e,i=t,void(a&&(!r.state.draggingText||new Date-Mo<100)?Me(i):xe(r,i)||Sr(r.display,i)||(i.dataTransfer.setData("Text",r.getSelection()),i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setDragImage&&!p&&((n=M("img",null,null,"position: fixed; left: 0; top: 0;")).src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d&&(n.width=n.height=1,r.display.wrapper.appendChild(n),n._top=n.offsetTop),i.dataTransfer.setDragImage(n,0,0),d&&n.parentNode.removeChild(n))));var r,i,n},drop:Zi(e,Ao),leave:function(t){xe(e,t)||_o(e)}};var l=t.input.getField();be(l,"keyup",function(t){return aa.call(e,t)}),be(l,"keydown",Zi(e,oa)),be(l,"keypress",Zi(e,sa)),be(l,"focus",function(t){return Si(e,t)}),be(l,"blur",function(t){return Ci(e,t)})}(this),function(){var e;No||(be(window,"resize",function(){null==e&&(e=setTimeout(function(){e=null,Oo(Do)},100))}),be(window,"blur",function(){return Oo(Ci)}),No=!0)}(),qi(this),this.curOp.forceUpdate=!0,Nn(this,i),t.autofocus&&!v||this.hasFocus()?setTimeout($(Si,this),20):Ci(this),ya)ya.hasOwnProperty(c)&&ya[c](r,t[c],va);dn(this),t.finishInit&&t.finishInit(this);for(var u=0;u<ka.length;++u)ka[u](r);Ui(this),l&&t.lineWrapping&&"optimizelegibility"==getComputedStyle(o.lineDiv).textRendering&&(o.lineDiv.style.textRendering="auto")}wa.defaults=ba,wa.optionHandlers=ya;var ka=[];function xa(e,t,r,i){var n,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?n=bt(e,t).state:r="prev");var a=e.options.tabSize,s=Qe(o,t),l=z(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(i||/\S/.test(s.text)){if("smart"==r&&((c=o.mode.indent(n,s.text.slice(u.length),s.text))==F||150<c)){if(!i)return;r="prev"}}else c=0,r="not";"prev"==r?c=t>o.first?z(Qe(o,t-1).text,null,a):0:"add"==r?c=l+e.options.indentUnit:"subtract"==r?c=l-e.options.indentUnit:"number"==typeof r&&(c=l+r),c=Math.max(0,c);var d="",p=0;if(e.options.indentWithTabs)for(var h=Math.floor(c/a);h;--h)p+=a,d+="\t";if(p<c&&(d+=K(c-p)),d!=u)return po(o,d,ot(t,0),ot(t,u.length),"+input"),!(s.stateAfter=null);for(var f=0;f<o.sel.ranges.length;f++){var g=o.sel.ranges[f];if(g.head.line==t&&g.head.ch<u.length){var m=ot(t,u.length);Vn(o,f,new kn(m,m));break}}}wa.defineInitHook=function(e){return ka.push(e)};var Sa,Ca,Ea,La,Ga,Ta=null;function Ma(e){Ta=e}function Aa(e,t,r,i,n){var o=e.doc;e.display.shift=!1,i=i||o.sel;var a=new Date-200,s="paste"==n||e.state.pasteIncoming>a,l=ze(t),c=null;if(s&&1<i.ranges.length)if(Ta&&Ta.text.join("\n")==t){if(i.ranges.length%Ta.text.length==0){c=[];for(var u=0;u<Ta.text.length;u++)c.push(o.splitLines(Ta.text[u]))}}else l.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(c=X(l,function(e){return[e]}));for(var d=e.curOp.updateInput,p=i.ranges.length-1;0<=p;p--){var h=i.ranges[p],f=h.from(),g=h.to();h.empty()&&(r&&0<r?f=ot(f.line,f.ch-r):e.state.overwrite&&!s?g=ot(g.line,Math.min(Qe(o,g.line).text.length,g.ch+Y(l).length)):s&&Ta&&Ta.lineWise&&Ta.text.join("\n")==t&&(f=g=ot(f.line,0)));var m={from:f,to:g,text:c?c[p%c.length]:l,origin:n||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};ao(e.doc,m),ur(e,"inputRead",e,m)}t&&!s&&Oa(e,t),Ai(e),e.curOp.updateInput<2&&(e.curOp.updateInput=d),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function _a(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");return r&&(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Qi(t,function(){return Aa(t,r,0,null,"paste")}),1)}function Oa(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,i=r.ranges.length-1;0<=i;i--){var n=r.ranges[i];if(!(100<n.head.ch||i&&r.ranges[i-1].head.line==n.head.line)){var o=e.getModeAt(n.head),a=!1;if(o.electricChars){for(var s=0;s<o.electricChars.length;s++)if(-1<t.indexOf(o.electricChars.charAt(s))){a=xa(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qe(e.doc,n.head.line).text.slice(0,n.head.ch))&&(a=xa(e,n.head.line,"smart"));a&&ur(e,"electricInput",e,n.head.line)}}}function Na(e){for(var t=[],r=[],i=0;i<e.doc.sel.ranges.length;i++){var n=e.doc.sel.ranges[i].head.line,o={anchor:ot(n,0),head:ot(n+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Da(e,t,r,i){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!t)}function Ia(){var e=M("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=M("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return l?e.style.width="1000px":e.setAttribute("wrap","off"),g&&(e.style.border="1px solid black"),Da(e),t}function $a(e,t,r,i,n){var o=t,a=r,s=Qe(e,t.line),l=n&&"rtl"==e.direction?-r:r;function c(i){var o,a=n?function(e,t,r,i){var n=me(t,e.doc.direction);if(!n)return Ko(t,r,i);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=le(n,r.ch,r.sticky),a=n[o];if("ltr"==e.doc.direction&&a.level%2==0&&(0<i?a.to>r.ch:a.from<r.ch))return Ko(t,r,i);function s(e,r){return Vo(t,e instanceof ot?e.ch:e,r)}function l(r){return e.options.lineWrapping?(c=c||Nr(e,t),Jr(e,t,c,r)):{begin:0,end:t.text.length}}var c,u=l("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==i<0,p=s(r,d?1:-1);if(null!=p&&(d?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var h=d?"before":"after";return new ot(r.line,p,h)}}function f(e,t,i){for(var o=function(e,t){return t?new ot(r.line,s(e,1),"before"):new ot(r.line,e,"after")};0<=e&&e<n.length;e+=t){var a=n[e],l=0<t==(1!=a.level),c=l?i.begin:s(i.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),i.begin<=c&&c<i.end)return o(c,l)}}var g=f(o+i,i,u);if(g)return g;var m=0<i?u.end:s(u.begin,-1);return null==m||0<i&&m==t.text.length||!(g=f(0<i?0:n.length-1,i,l(m)))?null:g}(e.cm,s,t,r):Ko(s,t,r);if(null==a){if(i||(o=t.line+l)<e.first||o>=e.first+e.size||(t=new ot(o,t.ch,t.sticky),!(s=Qe(e,o))))return;t=Yo(n,e.cm,s,t.line,l)}else t=a;return 1}if("char"==i)c();else if("column"==i)c(!0);else if("word"==i||"group"==i)for(var u=null,d="group"==i,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(r<0)||c(!h);h=!1){var f=s.text.charAt(t.ch)||"\n",g=te(f,p)?"w":d&&"\n"==f?"n":!d||/\s/.test(f)?null:"p";if(!d||h||g||(g="s"),u&&u!=g){r<0&&(r=1,c(),t.sticky="after");break}if(g&&(u=g),0<r&&!c(!h))break}var m=ro(e,t,o,a,!0);return st(o,m)&&(m.hitSide=!0),m}function Pa(e,t,r,i){var n,o,a,s,l=e.doc,c=t.left;for("page"==i?(n=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),o=Math.max(n-.5*ri(e.display),3),a=(0<r?t.bottom:t.top)+r*o):"line"==i&&(a=0<r?t.bottom+3:t.top-3);(s=Qr(e,c,a)).outside;){if(r<0?a<=0:a>=l.height){s.hitSide=!0;break}a+=5*r}return s}function za(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new H,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null}function Ha(e,t){var r=Or(e,t.line);if(!r||r.hidden)return null;var i=Qe(e.doc,t.line),n=Ar(r,i,t.line),o=me(i,e.doc.direction),a="left";o&&(a=le(o,t.ch)%2?"right":"left");var s=Pr(n.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ra(e,t){return t&&(e.bad=!0),e}function Wa(e,t,r){var i;if(t==e.display.lineDiv){if(!(i=e.display.lineDiv.childNodes[r]))return Ra(e.clipPos(ot(e.display.viewTo-1)),!0);t=null,r=0}else for(i=t;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var o=e.display.view[n];if(o.node==i)return Fa(o,t,r)}}function Fa(e,t,r){var i=e.text.firstChild,n=!1;if(!t||!_(i,t))return Ra(ot(tt(e.line),0),!0);if(t==i&&(n=!0,t=i.childNodes[r],r=0,!t)){var o=e.rest?Y(e.rest):e.line;return Ra(ot(tt(o),o.text.length),n)}var a=3==t.nodeType?t:null,s=t;for(a||1!=t.childNodes.length||3!=t.firstChild.nodeType||(a=t.firstChild,r=r&&a.nodeValue.length);s.parentNode!=i;)s=s.parentNode;var l=e.measure,c=l.maps;function u(t,r,i){for(var n=-1;n<(c?c.length:0);n++)for(var o=n<0?l.map:c[n],a=0;a<o.length;a+=3){var s=o[a+2];if(s==t||s==r){var u=tt(n<0?e.line:e.rest[n]),d=o[a]+i;return(i<0||s!=t)&&(d=o[a+(i?1:0)]),ot(u,d)}}}var d=u(a,s,r);if(d)return Ra(d,n);for(var p=s.nextSibling,h=a?a.nodeValue.length-r:0;p;p=p.nextSibling){if(d=u(p,p.firstChild,0))return Ra(ot(d.line,d.ch-h),n);h+=p.textContent.length}for(var f=s.previousSibling,g=r;f;f=f.previousSibling){if(d=u(f,f.firstChild,-1))return Ra(ot(d.line,d.ch+g),n);g+=f.textContent.length}}function ja(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new H,this.hasSelection=!1,this.composing=null}function Ba(e,t,r,i){Sa.defaults[e]=t,r&&(Ca[e]=i?function(e,t,i){i!=va&&r(e,t,i)}:r)}za.prototype.init=function(e){var t=this,r=this,i=r.cm,n=r.div=e.lineDiv;function o(e){for(var t=e.target;t;t=t.parentNode){if(t==n)return 1;if(/\bESGMirror-(?:line)?widget\b/.test(t.className))break}}function a(e){if(o(e)&&!xe(i,e)){if(i.somethingSelected())Ma({lineWise:!1,text:i.getSelections()}),"cut"==e.type&&i.replaceSelection("",null,"cut");else{if(!i.options.lineWiseCopyCut)return;var t=Na(i);Ma({lineWise:!0,text:t.text}),"cut"==e.type&&i.operation(function(){i.setSelections(t.ranges,0,j),i.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var a=Ta.text.join("\n");if(e.clipboardData.setData("Text",a),e.clipboardData.getData("Text")==a)return void e.preventDefault()}var s=Ia(),l=s.firstChild;i.display.lineSpace.insertBefore(s,i.display.lineSpace.firstChild),l.value=Ta.text.join("\n");var c=document.activeElement;I(l),setTimeout(function(){i.display.lineSpace.removeChild(s),c.focus(),c==n&&r.showPrimarySelection()},50)}}Da(n,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize),be(n,"paste",function(e){!o(e)||xe(i,e)||_a(e,i)||s<=11&&setTimeout(Zi(i,function(){return t.updateFromDOM()}),20)}),be(n,"compositionstart",function(e){t.composing={data:e.data,done:!1}}),be(n,"compositionupdate",function(e){t.composing||(t.composing={data:e.data,done:!1})}),be(n,"compositionend",function(e){t.composing&&(e.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),be(n,"touchstart",function(){return r.forceCompositionEnd()}),be(n,"input",function(){t.composing||t.readFromDOMSoon()}),be(n,"copy",a),be(n,"cut",a)},za.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},za.prototype.prepareSelection=function(){var e=mi(this.cm,!1);return e.focus=document.activeElement==this.div,e},za.prototype.showSelection=function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},za.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},za.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),n=i.from(),o=i.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom)e.removeAllRanges();else{var a=Wa(t,e.anchorNode,e.anchorOffset),s=Wa(t,e.focusNode,e.focusOffset);if(!a||a.bad||!s||s.bad||0!=at(ut(a,s),n)||0!=at(ct(a,s),o)){var l,c,u=t.display.view,d=n.line>=t.display.viewFrom&&Ha(t,n)||{node:u[0].measure.map[2],offset:0},p=o.line<t.display.viewTo&&Ha(t,o);if(p||(p={node:(c=(l=u[u.length-1].measure).maps?l.maps[l.maps.length-1]:l.map)[c.length-1],offset:c[c.length-2]-c[c.length-3]}),d&&p){var h,f=e.rangeCount&&e.getRangeAt(0);try{h=E(d.node,d.offset,p.offset,p.node)}catch(e){}h&&(!r&&t.state.focused?(e.collapse(d.node,d.offset),h.collapsed||(e.removeAllRanges(),e.addRange(h))):(e.removeAllRanges(),e.addRange(h)),f&&null==e.anchorNode?e.addRange(f):r&&this.startGracePeriod()),this.rememberSelection()}else e.removeAllRanges()}}},za.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},za.prototype.showMultipleSelections=function(e){T(this.cm.display.cursorDiv,e.cursors),T(this.cm.display.selectionDiv,e.selection)},za.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},za.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return _(this.div,t)},za.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&document.activeElement==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())},za.prototype.blur=function(){this.div.blur()},za.prototype.getField=function(){return this.div},za.prototype.supportsTouch=function(){return!0},za.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Qi(this.cm,function(){return e.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))})},za.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},za.prototype.pollSelection=function(){if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){var e,t,r=this.getSelection(),i=this.cm;if(m&&u&&this.cm.display.gutterSpecs.length&&function(e){for(var t=r.anchorNode;t;t=t.parentNode)if(/ESGMirror-gutter-wrapper/.test(t.className))return 1}())return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();this.composing||(this.rememberSelection(),e=Wa(i,r.anchorNode,r.anchorOffset),t=Wa(i,r.focusNode,r.focusOffset),e&&t&&Qi(i,function(){Xn(i.doc,Sn(e,t),j),(e.bad||t.bad)&&(i.curOp.selectionChanged=!0)}))}},za.prototype.pollContent=function(){null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e,t,r,i=this.cm,n=i.display,o=i.doc.sel.primary(),a=o.from(),s=o.to();if(0==a.ch&&a.line>i.firstLine()&&(a=ot(a.line-1,Qe(i.doc,a.line-1).length)),s.ch==Qe(i.doc,s.line).text.length&&s.line<i.lastLine()&&(s=ot(s.line+1,0)),a.line<n.viewFrom||s.line>n.viewTo-1)return!1;r=a.line==n.viewFrom||0==(e=ci(i,a.line))?(t=tt(n.view[0].line),n.view[0].node):(t=tt(n.view[e].line),n.view[e-1].node.nextSibling);var l,c=ci(i,s.line),u=c==n.view.length-1?(l=n.viewTo-1,n.lineDiv.lastChild):(l=tt(n.view[c+1].line)-1,n.view[c+1].node.previousSibling);if(!r)return!1;for(var d=i.doc.splitLines(function(e,t,r,i,n){var o="",a=!1,s=e.doc.lineSeparator(),l=!1;function c(){a&&(o+=s,l&&(o+=s),a=l=!1)}function u(e){e&&(c(),o+=e)}function d(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(r)return void u(r);var o,p=t.getAttribute("cm-marker");if(p){var h=e.findMarks(ot(i,0),ot(n+1,0),(m=+p,function(e){return e.id==m}));return void(h.length&&(o=h[0].find(0))&&u(Ze(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var f=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;f&&c();for(var g=0;g<t.childNodes.length;g++)d(t.childNodes[g]);/^(pre|p)$/i.test(t.nodeName)&&(l=!0),f&&(a=!0)}else 3==t.nodeType&&u(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "));var m}for(;d(t),t!=r;)t=t.nextSibling,l=!1;return o}(i,r,u,t,l)),p=Ze(i.doc,ot(t,0),ot(l,Qe(i.doc,l).text.length));1<d.length&&1<p.length;)if(Y(d)==Y(p))d.pop(),p.pop(),l--;else{if(d[0]!=p[0])break;d.shift(),p.shift(),t++}for(var h=0,f=0,g=d[0],m=p[0],v=Math.min(g.length,m.length);h<v&&g.charCodeAt(h)==m.charCodeAt(h);)++h;for(var b=Y(d),y=Y(p),w=Math.min(b.length-(1==d.length?h:0),y.length-(1==p.length?h:0));f<w&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)++f;if(1==d.length&&1==p.length&&t==a.line)for(;h&&h>a.ch&&b.charCodeAt(b.length-f-1)==y.charCodeAt(y.length-f-1);)h--,f++;d[d.length-1]=b.slice(0,b.length-f).replace(/^\u200b+/,""),d[0]=d[0].slice(h).replace(/\u200b+$/,"");var k=ot(t,h),x=ot(l,p.length?Y(p).length-f:0);return 1<d.length||d[0]||at(k,x)?(po(i.doc,d,k,x,"+input"),!0):void 0},za.prototype.ensurePolled=function(){this.forceCompositionEnd()},za.prototype.reset=function(){this.forceCompositionEnd()},za.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},za.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()},80))},za.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||Qi(this.cm,function(){return ui(e.cm)})},za.prototype.setUneditable=function(e){e.contentEditable="false"},za.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Zi(this.cm,Aa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},za.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},za.prototype.onContextMenu=function(){},za.prototype.resetPosition=function(){},za.prototype.needsContentAttribute=!0,ja.prototype.init=function(e){var t=this,r=this,i=this.cm;this.createField(e);var n=this.textarea;function o(e){if(!xe(i,e)){if(i.somethingSelected())Ma({lineWise:!1,text:i.getSelections()});else{if(!i.options.lineWiseCopyCut)return;var t=Na(i);Ma({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,j):(r.prevInput="",n.value=t.text.join("\n"),I(n))}"cut"==e.type&&(i.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),g&&(n.style.width="0px"),be(n,"input",function(){a&&9<=s&&t.hasSelection&&(t.hasSelection=null),r.poll()}),be(n,"paste",function(e){xe(i,e)||_a(e,i)||(i.state.pasteIncoming=+new Date,r.fastPoll())}),be(n,"cut",o),be(n,"copy",o),be(e.scroller,"paste",function(t){if(!Sr(e,t)&&!xe(i,t)){if(!n.dispatchEvent)return i.state.pasteIncoming=+new Date,void r.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,n.dispatchEvent(o)}}),be(e.lineSpace,"selectstart",function(t){Sr(e,t)||Le(t)}),be(n,"compositionstart",function(){var e=i.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"ESGMirror-composing"})}}),be(n,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},ja.prototype.createField=function(e){this.wrapper=Ia(),this.textarea=this.wrapper.firstChild},ja.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ja.prototype.prepareSelection=function(){var e,t,r,i=this.cm,n=i.display,o=i.doc,a=mi(i);return i.options.moveInputWithCursor&&(e=Kr(i,o.sel.primary().head,"div"),t=n.wrapper.getBoundingClientRect(),r=n.lineDiv.getBoundingClientRect(),a.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,e.top+r.top-t.top)),a.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,e.left+r.left-t.left))),a},ja.prototype.showSelection=function(e){var t=this.cm.display;T(t.cursorDiv,e.cursors),T(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ja.prototype.reset=function(e){var t,r;this.contextMenuPending||this.composing||((t=this.cm).somethingSelected()?(this.prevInput="",r=t.getSelection(),this.textarea.value=r,t.state.focused&&I(this.textarea),a&&9<=s&&(this.hasSelection=r)):e||(this.prevInput=this.textarea.value="",a&&9<=s&&(this.hasSelection=null)))},ja.prototype.getField=function(){return this.textarea},ja.prototype.supportsTouch=function(){return!1},ja.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!v||O()!=this.textarea))try{this.textarea.focus()}catch(e){}},ja.prototype.blur=function(){this.textarea.blur()},ja.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ja.prototype.receivedFocus=function(){this.slowPoll()},ja.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},ja.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,function r(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,r))})},ja.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,i=this.prevInput;if(this.contextMenuPending||!t.state.focused||He(r)&&!i&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=r.value;if(n==i&&!t.somethingSelected())return!1;if(a&&9<=s&&this.hasSelection===n||b&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(8203!=o||i||(i="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,c=Math.min(i.length,n.length);l<c&&i.charCodeAt(l)==n.charCodeAt(l);)++l;return Qi(t,function(){Aa(t,n.slice(l),i.length-l,null,e.composing?"*compose":null),1e3<n.length||-1<n.indexOf("\n")?r.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"ESGMirror-composing"}))}),!0},ja.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ja.prototype.onKeyPress=function(){a&&9<=s&&(this.hasSelection=null),this.fastPoll()},ja.prototype.onContextMenu=function(e){var t=this,r=t.cm,i=r.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o,c,u,p,h,f=li(r,e),g=i.scroller.scrollTop;function m(){var e,o;null!=n.selectionStart&&(o="​"+((e=r.somethingSelected())?n.value:""),n.value="⇚",n.value=o,t.prevInput=e?"":"​",n.selectionStart=1,n.selectionEnd=o.length,i.selForContextMenu=r.doc.sel)}function v(){var e,l;t.contextMenuPending==v&&(t.contextMenuPending=!1,t.wrapper.style.cssText=c,n.style.cssText=o,a&&s<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=g),null!=n.selectionStart&&((!a||a&&s<9)&&m(),e=0,l=function(){i.selForContextMenu==r.doc.sel&&0==n.selectionStart&&0<n.selectionEnd&&"​"==t.prevInput?Zi(r,no)(r):e++<10?i.detectingSelectAll=setTimeout(l,500):(i.selForContextMenu=null,i.input.reset())},i.detectingSelectAll=setTimeout(l,200)))}f&&!d&&(r.options.resetSelectionOnContextMenu&&-1==r.doc.sel.contains(f)&&Zi(r,Xn)(r.doc,Sn(f),j),o=n.style.cssText,c=t.wrapper.style.cssText,u=t.wrapper.offsetParent.getBoundingClientRect(),t.wrapper.style.cssText="position: static",n.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(e.clientY-u.top-5)+"px; left: "+(e.clientX-u.left-5)+"px;\n      z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",l&&(p=window.scrollY),i.input.focus(),l&&window.scrollTo(null,p),i.input.reset(),r.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=v,i.selForContextMenu=r.doc.sel,clearTimeout(i.detectingSelectAll),a&&9<=s&&m(),S?(Me(e),h=function(){we(window,"mouseup",h),setTimeout(v,20)},be(window,"mouseup",h)):setTimeout(v,50))},ja.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e},ja.prototype.setUneditable=function(){},ja.prototype.needsContentAttribute=!1,Ca=(Sa=wa).optionHandlers,Sa.defineOption=Ba,Sa.Init=va,Ba("value","",function(e,t){return e.setValue(t)},!0),Ba("mode",null,function(e,t){e.doc.modeOption=t,Tn(e)},!0),Ba("indentUnit",2,Tn,!0),Ba("indentWithTabs",!1),Ba("smartIndent",!0),Ba("tabSize",4,function(e){Mn(e),Wr(e),ui(e)},!0),Ba("lineSeparator",null,function(e,t){if(e.doc.lineSep=t){var r=[],i=e.doc.first;e.doc.iter(function(e){for(var n=0;;){var o=e.text.indexOf(t,n);if(-1==o)break;n=o+t.length,r.push(ot(i,o))}i++});for(var n=r.length-1;0<=n;n--)po(e.doc,t,r[n],ot(r[n].line,r[n].ch+t.length))}}),Ba("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=va&&e.refresh()}),Ba("specialCharPlaceholder",function(e){var t=M("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t},function(e){return e.refresh()},!0),Ba("electricChars",!0),Ba("inputStyle",v?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Ba("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),Ba("autocorrect",!1,function(e,t){return e.getInputField().autocorrect=t},!0),Ba("autocapitalize",!1,function(e,t){return e.getInputField().autocapitalize=t},!0),Ba("rtlMoveVisually",!w),Ba("wholeLineUpdateBefore",!0),Ba("theme","default",function(e){ma(e),fn(e)},!0),Ba("keyMap","default",function(e,t,r){var i=qo(t),n=r!=va&&qo(r);n&&n.detach&&n.detach(e,i),i.attach&&i.attach(e,n||null)}),Ba("extraKeys",null),Ba("configureMouse",null),Ba("lineWrapping",!1,function(e){e.options.lineWrapping?(N(e.display.wrapper,"ESGMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(L(e.display.wrapper,"ESGMirror-wrap"),Xt(e)),si(e),ui(e),Wr(e),setTimeout(function(){return Ri(e)},100)},!0),Ba("gutters",[],function(e,t){e.display.gutterSpecs=pn(t,e.options.lineNumbers),fn(e)},!0),Ba("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?oi(e.display)+"px":"0",e.refresh()},!0),Ba("coverGutterNextToScrollbar",!1,function(e){return Ri(e)},!0),Ba("scrollbarStyle","native",function(e){ji(e),Ri(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Ba("lineNumbers",!1,function(e,t){e.display.gutterSpecs=pn(e.options.gutters,t),fn(e)},!0),Ba("firstLineNumber",1,fn,!0),Ba("lineNumberFormatter",function(e){return e},fn,!0),Ba("showCursorWhenSelecting",!1,gi,!0),Ba("resetSelectionOnContextMenu",!0),Ba("lineWiseCopyCut",!0),Ba("pasteLinesPerSelection",!0),Ba("selectionsMayTouch",!1),Ba("readOnly",!1,function(e,t){"nocursor"==t&&(Ci(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)}),Ba("screenReaderLabel",null,function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)}),Ba("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Ba("dragDrop",!0,function(e,t,r){var i,n;!t!=!(r&&r!=va)&&(i=e.display.dragFunctions,(n=t?be:we)(e.display.scroller,"dragstart",i.start),n(e.display.scroller,"dragenter",i.enter),n(e.display.scroller,"dragover",i.over),n(e.display.scroller,"dragleave",i.leave),n(e.display.scroller,"drop",i.drop))}),Ba("allowDropFileTypes",null),Ba("cursorBlinkRate",530),Ba("cursorScrollMargin",0),Ba("cursorHeight",1,gi,!0),Ba("singleCursorHeightPerLine",!0,gi,!0),Ba("workTime",100),Ba("workDelay",100),Ba("flattenSpans",!0,Mn,!0),Ba("addModeClass",!1,Mn,!0),Ba("pollInterval",100),Ba("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),Ba("historyEventDelay",1250),Ba("viewportMargin",10,function(e){return e.refresh()},!0),Ba("maxHighlightLength",1e4,Mn,!0),Ba("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Ba("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),Ba("autofocus",null),Ba("direction","ltr",function(e,t){return e.doc.setDirection(t)},!0),Ba("phrases",null),La=(Ea=wa).optionHandlers,Ga=Ea.helpers={},Ea.prototype={constructor:Ea,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var r=this.options,i=r[e];r[e]==t&&"mode"!=e||(r[e]=t,La.hasOwnProperty(e)&&Zi(this,La[e])(this,t,i),ke(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](qo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,r=0;r<t.length;++r)if(t[r]==e||t[r].name==e)return t.splice(r,1),!0},addOverlay:Ji(function(e,t){var r=e.token?e:Ea.getMode(this.options,e);if(r.startState)throw new Error("Overlays may not be stateful.");!function(e,t,r){for(var i=0,n=r(t);i<e.length&&r(e[i])<=n;)i++;e.splice(i,0,t)}(this.state.overlays,{mode:r,modeSpec:e,opaque:t&&t.opaque,priority:t&&t.priority||0},function(e){return e.priority}),this.state.modeGen++,ui(this)}),removeOverlay:Ji(function(e){for(var t=this.state.overlays,r=0;r<t.length;++r){var i=t[r].modeSpec;if(i==e||"string"==typeof e&&i.name==e)return t.splice(r,1),this.state.modeGen++,void ui(this)}}),indentLine:Ji(function(e,t,r){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract"),it(this.doc,e)&&xa(this,e,t,r)}),indentSelection:Ji(function(e){for(var t=this,r=this.doc.sel.ranges,i=-1,n=0;n<r.length;n++){var o=r[n];if(o.empty())o.head.line>i&&(xa(t,o.head.line,e,!0),i=o.head.line,n==t.doc.sel.primIndex&&Ai(t));else{for(var a=o.from(),s=o.to(),l=Math.max(i,a.line),c=(i=Math.min(t.lastLine(),s.line-(s.ch?0:1))+1,l);c<i;++c)xa(t,c,e);var u=t.doc.sel.ranges;0==a.ch&&r.length==u.length&&0<u[n].from().ch&&Vn(t.doc,n,new kn(a,u[n].to()),j)}}}),getTokenAt:function(e,t){return St(this,e,t)},getLineTokens:function(e,t){return St(this,ot(e),t,!0)},getTokenTypeAt:function(e){e=pt(this.doc,e);var t,r=vt(this,Qe(this.doc,e.line)),i=0,n=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var a=i+n>>1;if((a?r[2*a-1]:0)>=o)n=a;else{if(!(r[2*a+1]<o)){t=r[2*a+2];break}i=1+a}}var s=t?t.indexOf("overlay "):-1;return s<0?t:0==s?null:t.slice(0,s-1)},getModeAt:function(e){var t=this.doc.mode;return t.innerMode?Ea.innerMode(t,this.getTokenAt(e).state).mode:t},getHelper:function(e,t){return this.getHelpers(e,t)[0]},getHelpers:function(e,t){var r=[];if(!Ga.hasOwnProperty(t))return r;var i=Ga[t],n=this.getModeAt(e);if("string"==typeof n[t])i[n[t]]&&r.push(i[n[t]]);else if(n[t])for(var o=0;o<n[t].length;o++){var a=i[n[t][o]];a&&r.push(a)}else n.helperType&&i[n.helperType]?r.push(i[n.helperType]):i[n.name]&&r.push(i[n.name]);for(var s=0;s<i._global.length;s++){var l=i._global[s];l.pred(n,this)&&-1==R(r,l.val)&&r.push(l.val)}return r},getStateAfter:function(e,t){var r=this.doc;return bt(this,(e=dt(r,null==e?r.first+r.size-1:e))+1,t).state},cursorCoords:function(e,t){var r=this.doc.sel.primary();return Kr(this,null==e?r.head:"object"==typeof e?pt(this.doc,e):e?r.from():r.to(),t||"page")},charCoords:function(e,t){return Vr(this,pt(this.doc,e),t||"page")},coordsChar:function(e,t){return Qr(this,(e=Ur(this,e,t||"page")).left,e.top)},lineAtHeight:function(e,t){return e=Ur(this,{top:e,left:0},t||"page").top,rt(this.doc,e+this.display.viewOffset)},heightAtLine:function(e,t,r){var i,n=!1,o="number"==typeof e?(i=this.doc.first+this.doc.size-1,e<this.doc.first?e=this.doc.first:i<e&&(e=i,n=!0),Qe(this.doc,e)):e;return qr(this,o,{top:0,left:0},t||"page",r||n).top+(n?this.doc.height-Kt(o):0)},defaultTextHeight:function(){return ri(this.display)},defaultCharWidth:function(){return ii(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,i,n){var o,a,s,l,c=this.display,u=(e=Kr(this,pt(this.doc,e))).bottom,d=e.left;t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),c.sizer.appendChild(t),"over"==i?u=e.top:"above"!=i&&"near"!=i||(o=Math.max(c.wrapper.clientHeight,this.doc.height),a=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth),("above"==i||e.bottom+t.offsetHeight>o)&&e.top>t.offsetHeight?u=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=o&&(u=e.bottom),d+t.offsetWidth>a&&(d=a-t.offsetWidth)),t.style.top=u+"px",t.style.left=t.style.right="","right"==n?(d=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==n?d=0:"middle"==n&&(d=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=d+"px"),r&&(null!=(l=Ti(s=this,{left:d,top:u,right:d+t.offsetWidth,bottom:u+t.offsetHeight})).scrollTop&&Di(s,l.scrollTop),null!=l.scrollLeft&&$i(s,l.scrollLeft))},triggerOnKeyDown:Ji(oa),triggerOnKeyPress:Ji(sa),triggerOnKeyUp:aa,triggerOnMouseDown:Ji(da),execCommand:function(e){if(Xo.hasOwnProperty(e))return Xo[e].call(null,this)},triggerElectric:Ji(function(e){Oa(this,e)}),findPosH:function(e,t,r,i){var n=1;t<0&&(n=-1,t=-t);for(var o=pt(this.doc,e),a=0;a<t&&!(o=$a(this.doc,o,n,r,i)).hitSide;++a);return o},moveH:Ji(function(e,t){var r=this;this.extendSelectionsBy(function(i){return r.display.shift||r.doc.extend||i.empty()?$a(r.doc,i.head,e,t,r.options.rtlMoveVisually):e<0?i.from():i.to()},q)}),deleteH:Ji(function(e,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):Uo(this,function(r){var n=$a(i,r.head,e,t,!1);return e<0?{from:n,to:r.head}:{from:r.head,to:n}})}),findPosV:function(e,t,r,i){var n=1,o=i;t<0&&(n=-1,t=-t);for(var a=pt(this.doc,e),s=0;s<t;++s){var l=Kr(this,a,"div");if(null==o?o=l.left:l.left=o,(a=Pa(this,l,n,r)).hitSide)break}return a},moveV:Ji(function(e,t){var r=this,i=this.doc,n=[],o=!this.display.shift&&!i.extend&&i.sel.somethingSelected();if(i.extendSelectionsBy(function(a){if(o)return e<0?a.from():a.to();var s=Kr(r,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),n.push(s.left);var l=Pa(r,s,e,t);return"page"==t&&a==i.sel.primary()&&Mi(r,Vr(r,l,"div").top-s.top),l},q),n.length)for(var a=0;a<i.sel.ranges.length;a++)i.sel.ranges[a].goalColumn=n[a]}),findWordAt:function(e){var t=Qe(this.doc,e.line).text,r=e.ch,i=e.ch;if(t){var n=this.getHelper(e,"wordChars");"before"!=e.sticky&&i!=t.length||!r?++i:--r;for(var o=t.charAt(r),a=te(o,n)?function(e){return te(e,n)}:/\s/.test(o)?function(e){return/\s/.test(e)}:function(e){return!/\s/.test(e)&&!te(e)};0<r&&a(t.charAt(r-1));)--r;for(;i<t.length&&a(t.charAt(i));)++i}return new kn(ot(e.line,r),ot(e.line,i))},toggleOverwrite:function(e){null!=e&&e==this.state.overwrite||(((this.state.overwrite=!this.state.overwrite)?N:L)(this.display.cursorDiv,"ESGMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==O()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:Ji(function(e,t){_i(this,e,t)}),getScrollInfo:function(){var e=this.display.scroller;return{left:e.scrollLeft,top:e.scrollTop,height:e.scrollHeight-Gr(this)-this.display.barHeight,width:e.scrollWidth-Gr(this)-this.display.barWidth,clientHeight:Mr(this),clientWidth:Tr(this)}},scrollIntoView:Ji(function(e,t){var r;null==e?(e={from:this.doc.sel.primary().head,to:null},null==t&&(t=this.options.cursorScrollMargin)):"number"==typeof e?e={from:ot(e,0),to:null}:null==e.from&&(e={from:e,to:null}),e.to||(e.to=e.from),e.margin=t||0,null!=e.from.line?(r=e,Oi(this),this.curOp.scrollToPos=r):Ni(this,e.from,e.to,e.margin)}),setSize:Ji(function(e,t){function r(e){return"number"==typeof e||/^\d+$/.test(String(e))?e+"px":e}var i=this;null!=e&&(this.display.wrapper.style.width=r(e)),null!=t&&(this.display.wrapper.style.height=r(t)),this.options.lineWrapping&&Rr(this);var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,function(e){if(e.widgets)for(var t=0;t<e.widgets.length;t++)if(e.widgets[t].noHScroll){di(i,n,"widget");break}++n}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(e){return Qi(this,e)},startOperation:function(){return qi(this)},endOperation:function(){return Ui(this)},refresh:Ji(function(){var e=this.display.cachedTextHeight;ui(this),this.curOp.forceUpdate=!0,Wr(this),_i(this,this.doc.scrollLeft,this.doc.scrollTop),ln(this.display),(null==e||.5<Math.abs(e-ri(this.display))||this.options.lineWrapping)&&si(this),ke(this,"refresh",this)}),swapDoc:Ji(function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),Nn(this,e),Wr(this),this.display.input.reset(),_i(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ur(this,"swapDoc",this,t),t}),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},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}},Ee(Ea),Ea.registerHelper=function(e,t,r){Ga.hasOwnProperty(e)||(Ga[e]=Ea[e]={_global:[]}),Ga[e][t]=r},Ea.registerGlobalHelper=function(e,t,r,i){Ea.registerHelper(e,t,i),Ga[e]._global.push({pred:r,val:i})};var qa,Ua="iter insert remove copy getEditor constructor".split(" ");for(var Va in To.prototype)To.prototype.hasOwnProperty(Va)&&R(Ua,Va)<0&&(wa.prototype[Va]=function(e){return function(){return e.apply(this.doc,arguments)}}(To.prototype[Va]));return Ee(To),wa.inputStyles={textarea:ja,contenteditable:za},wa.defineMode=function(e){wa.defaults.mode||"null"==e||(wa.defaults.mode=e),function(e,t){2<arguments.length&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fe[e]=t}.apply(this,arguments)},wa.defineMIME=function(e,t){je[e]=t},wa.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),wa.defineMIME("text/plain","null"),wa.defineExtension=function(e,t){wa.prototype[e]=t},wa.defineDocExtension=function(e,t){To.prototype[e]=t},wa.fromTextArea=function(e,t){var r;function i(){e.value=s.getValue()}if((t=t?P(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus&&(r=O(),t.autofocus=r==e||null!=e.getAttribute("autofocus")&&r==document.body),e.form&&(be(e.form,"submit",i),!t.leaveSubmitMethodAlone)){var n=e.form,o=n.submit;try{var a=n.submit=function(){i(),n.submit=o,n.submit(),n.submit=a}}catch(r){}}t.finishInit=function(r){r.save=i,r.getTextArea=function(){return e},r.toTextArea=function(){r.toTextArea=isNaN,i(),e.parentNode.removeChild(r.getWrapperElement()),e.style.display="",e.form&&(we(e.form,"submit",i),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=o))}},e.style.display="none";var s=wa(function(t){return e.parentNode.insertBefore(t,e.nextSibling)},t);return s},(qa=wa).off=we,qa.on=be,qa.wheelEventPixels=function(e){var t=bn(e);return t.x*=vn,t.y*=vn,t},qa.Doc=To,qa.splitLines=ze,qa.countColumn=z,qa.findColumn=U,qa.isWordChar=ee,qa.Pass=F,qa.signal=ke,qa.Line=Qt,qa.changeEnd=Cn,qa.scrollbarModel=Fi,qa.Pos=ot,qa.cmpPos=at,qa.modes=Fe,qa.mimeModes=je,qa.resolveMode=Be,qa.getMode=qe,qa.modeExtensions=Ue,qa.extendMode=function(e,t){P(t,Ue.hasOwnProperty(e)?Ue[e]:Ue[e]={})},qa.copyState=Ve,qa.startState=Ye,qa.innerMode=Ke,qa.commands=Xo,qa.keyMap=Ho,qa.keyName=Bo,qa.isModifierKey=Fo,qa.lookupKey=Wo,qa.normalizeKeyMap=function(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if("..."==i){delete e[r];continue}for(var n=X(r.split(" "),Ro),o=0;o<n.length;o++){var a=void 0,s=o==n.length-1?(a=n.join(" "),i):(a=n.slice(0,o+1).join(" "),"..."),l=t[a];if(l){if(l!=s)throw new Error("Inconsistent bindings for "+a)}else t[a]=s}delete e[r]}for(var c in t)e[c]=t[c];return e},qa.StringStream=Xe,qa.SharedTextMarker=Co,qa.TextMarker=xo,qa.LineWidget=yo,qa.e_preventDefault=Le,qa.e_stopPropagation=Ge,qa.e_stop=Me,qa.addClass=N,qa.contains=_,qa.rmClass=L,qa.keyNames=Io,wa.version="5.54.0",wa}),ESGMirror.defineMode("css",function(e,t){"use strict";t.propertyKeywords||(t=ESGMirror.resolveMode("text/css"));var r,i,n=e.indentUnit,o=t.tokenHooks,a=t.mediaTypes||{},s=t.mediaFeatures||{},l=t.propertyKeywords||{},c=t.colorKeywords||{},u=t.valueKeywords||{},d=t.fontProperties||{},p=t.allowNested;function h(e,t){return r=t,e}function f(e){return function(t,i){for(var n,o=!1;null!=(n=t.next());){if(n==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==n}return n!=e&&(o||")"==e)||(i.tokenize=null),r="string"}}function g(e,t){return e.next(),e.match(/\s*[\"\']/,!1)?t.tokenize=null:t.tokenize=f(")"),r="(",null}function m(e,t,r){this.type=e,this.indent=t,this.prev=r}function v(e,t,r){return e.context=new m(r,t.indentation()+n,e.context),r}function b(e){return e.context=e.context.prev,e.context.type}function y(e,t,r){return x[r.context.type](e,t,r)}function w(e,t,r,i){for(var n=i||1;0<n;n--)r.context=r.context.prev;return y(e,t,r)}function k(e){var t=e.current().toLowerCase();i=u.hasOwnProperty(t)?"atom":c.hasOwnProperty(t)?"keyword":"variable"}var x={top:function(e,t,r){if("{"==e)return v(r,t,"block");if("}"==e&&r.context.prev)return b(r);if("@media"==e)return v(r,t,"media");if("@font-face"==e)return"font_face_before";if(e&&"@"==e.charAt(0))return v(r,t,"at");if("hash"==e)i="builtin";else if("word"==e)i="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return v(r,t,"interpolation");if(":"==e)return"pseudo";if(p&&"("==e)return v(r,t,"params")}return r.context.type},block:function(e,t,r){return"word"==e?l.hasOwnProperty(t.current().toLowerCase())?(i="property","maybeprop"):p?(i=t.match(/^\s*:/,!1)?"property":"tag","block"):(i+=" error","maybeprop"):"meta"==e?"block":p||"hash"!=e&&"qualifier"!=e?x.top(e,t,r):(i="error","block")},maybeprop:function(e,t,r){return":"==e?v(r,t,"prop"):y(e,t,r)},prop:function(e,t,r){if(";"==e)return b(r);if("{"==e&&p)return v(r,t,"propBlock");if("}"==e||"{"==e)return w(e,t,r);if("("==e)return v(r,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(t.current())){if("word"==e)k(t);else if("interpolation"==e)return v(r,t,"interpolation")}else i+=" error";return"prop"},propBlock:function(e,t,r){return"}"==e?b(r):"word"==e?(i="property","maybeprop"):r.context.type},parens:function(e,t,r){return"{"==e||"}"==e?w(e,t,r):")"==e?b(r):"parens"},pseudo:function(e,t,r){return"word"==e?(i="variable-3",r.context.type):y(e,t,r)},media:function(e,t,r){return"("==e?v(r,t,"media_parens"):"}"==e?w(e,t,r):"{"==e?b(r)&&v(r,t,p?"block":"top"):("word"==e&&(n=t.current().toLowerCase(),i="only"==n||"not"==n||"and"==n?"keyword":a.hasOwnProperty(n)?"attribute":s.hasOwnProperty(n)?"property":"error"),r.context.type);var n},media_parens:function(e,t,r){return")"==e?b(r):"{"==e||"}"==e?w(e,t,r,2):x.media(e,t,r)},font_face_before:function(e,t,r){return"{"==e?v(r,t,"font_face"):y(e,t,r)},font_face:function(e,t,r){return"}"==e?b(r):"word"==e?(i=d.hasOwnProperty(t.current().toLowerCase())?"property":"error","maybeprop"):"font_face"},at:function(e,t,r){return";"==e?b(r):"{"==e||"}"==e?w(e,t,r):("word"==e?i="tag":"hash"==e&&(i="builtin"),"at")},interpolation:function(e,t,r){return"}"==e?b(r):"{"==e||";"==e?w(e,t,r):("variable"!=e&&(i="error"),"interpolation")},params:function(e,t,r){return")"==e?b(r):"{"==e||"}"==e?w(e,t,r):("word"==e&&k(t),"params")}};return{startState:function(e){return{tokenize:null,state:"top",context:new m("top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||function(e,t){var i=e.next();if(o[i]){var n=o[i](e,t);if(!1!==n)return n}return"@"==i?(e.eatWhile(/[\w\\\-]/),h("def",e.current())):"="==i||("~"==i||"|"==i)&&e.eat("=")?(r="compare",null):'"'==i||"'"==i?(t.tokenize=f(i),t.tokenize(e,t)):"#"==i?(e.eatWhile(/[\w\\\-]/),r="hash","atom"):"!"==i?(e.match(/^\s*\w*/),r="important","keyword"):/\d/.test(i)||"."==i&&e.eat(/\d/)?(e.eatWhile(/[\w.%]/),r="unit","number"):"-"!==i?/[,+>*\/]/.test(i)?(r="select-op",null):"."==i&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r="qualifier":/[:;{}\[\]\(\)]/.test(i)?h(null,i):"u"==i&&e.match("rl(")?(e.backUp(1),t.tokenize=g,r="word","property"):/[\w\\\-]/.test(i)?(e.eatWhile(/[\w\\\-]/),r="word","property"):r=null:/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r="unit","number"):e.match(/^[^-]+-/)?r="meta":void 0})(e,t);return n&&"object"==typeof n&&(r=n[1],n=n[0]),i=n,t.state=x[t.state](r,e,t),i},indent:function(e,t){var r=e.context,i=t&&t.charAt(0),o=r.indent;return!r.prev||("}"!=i||"block"!=r.type&&"top"!=r.type&&"interpolation"!=r.type&&"font_face"!=r.type)&&(")"!=i||"parens"!=r.type&&"params"!=r.type&&"media_parens"!=r.type)&&("{"!=i||"at"!=r.type&&"media"!=r.type)||(o=r.indent-n,r=r.prev),o},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}}),function(){function e(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=!0;return t}var t=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],r=e(t),i=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid"],n=e(i),o=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid-cell","grid-column","grid-column-align","grid-column-sizing","grid-column-span","grid-columns","grid-flow","grid-row","grid-row-align","grid-row-sizing","grid-row-span","grid-rows","grid-template","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-inside","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","zoom","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-profile","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","kerning","text-anchor","writing-mode"],a=e(o),s=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],l=e(s),c=["above","absolute","activeborder","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","column","compact","condensed","contain","content","content-box","context-menu","continuous","copy","cover","crop","cross","crosshair","currentcolor","cursive","dashed","decimal","decimal-leading-zero","default","default-button","destination-atop","destination-in","destination-out","destination-over","devanagari","disc","discard","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ew-resize","expanded","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","footnotes","forwards","from","geometricPrecision","georgian","graytext","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-table","inset","inside","intrinsic","invert","italic","justify","kannada","katakana","katakana-iroha","keep-all","khmer","landscape","lao","large","larger","left","level","lighter","line-through","linear","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","malayalam","match","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","round","row-resize","rtl","run-in","running","s-resize","sans-serif","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","single","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","solid","somali","source-atop","source-in","source-out","source-over","space","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","x-large","x-small","xor","xx-large","xx-small"],u=e(c),d=e(["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"]),p=t.concat(i).concat(o).concat(s).concat(c);function h(e,t){for(var r,i=!1;null!=(r=e.next());){if(i&&"/"==r){t.tokenize=null;break}i="*"==r}return["comment","comment"]}function f(e,t){return e.skipTo("--\x3e")?(e.match("--\x3e"),t.tokenize=null):e.skipToEnd(),["comment","comment"]}ESGMirror.registerHelper("hintWords","css",p),ESGMirror.defineMIME("text/css",{mediaTypes:r,mediaFeatures:n,propertyKeywords:a,colorKeywords:l,valueKeywords:u,fontProperties:d,tokenHooks:{"<":function(e,t){return!!e.match("!--")&&(t.tokenize=f)(e,t)},"/":function(e,t){return!!e.eat("*")&&(t.tokenize=h)(e,t)}},name:"css"}),ESGMirror.defineMIME("text/x-scss",{mediaTypes:r,mediaFeatures:n,propertyKeywords:a,colorKeywords:l,valueKeywords:u,fontProperties:d,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=h)(e,t):["operator","operator"]},":":function(e){return!!e.match(/\s*{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),ESGMirror.defineMIME("text/x-less",{mediaTypes:r,mediaFeatures:n,propertyKeywords:a,colorKeywords:l,valueKeywords:u,fontProperties:d,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=h)(e,t):["operator","operator"]},"@":function(e){return!e.match(/^(charset|document|font-face|import|keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"})}(),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/esgmirror")):"function"==typeof define&&define.amd?define(["../../lib/esgmirror"],e):e(ESGMirror)}(function(e){"use strict";e.defineMode("javascript",function(t,r){var i,n,o=t.indentUnit,a=r.statementIndent,s=r.jsonld,l=r.json||s,c=r.typescript,u=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),i=e("keyword c"),n=e("operator"),o={type:"atom",style:"atom"},a={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:i,break:i,continue:i,new:i,delete:i,throw:i,debugger:i,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:n,typeof:n,instanceof:n,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),module:e("module"),class:e("class"),super:e("atom"),yield:i,export:e("export"),import:e("import"),extends:i};if(c){var s={type:"variable",style:"variable-3"},l={interface:e("interface"),extends:e("extends"),constructor:e("constructor"),public:e("public"),private:e("private"),protected:e("protected"),static:e("static"),string:s,number:s,bool:s,any:s};for(var u in l)a[u]=l[u]}return a}(),d=/[+\-*&%=<>!?|~^]/,p=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(e,t,r){return i=e,n=r,t}function f(e,t){var r=e.next();if('"'==r||"'"==r)return t.tokenize=(i=r,function(e,t){var r,n=!1;if(s&&"@"==e.peek()&&e.match(p))return t.tokenize=f,h("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=i||n);)n=!n&&"\\"==r;return n||(t.tokenize=f),h("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return h("number","number");if("."==r&&e.match(".."))return h("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return h(r);if("="==r&&e.eat(">"))return h("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),h("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),h("number","number");if("/"==r)return e.eat("*")?(t.tokenize=g)(e,t):e.eat("/")?(e.skipToEnd(),h("comment","comment")):"operator"==t.lastType||"keyword c"==t.lastType||"sof"==t.lastType||/^[\[{}\(,;:]$/.test(t.lastType)?(function(e){for(var t,r=!1,i=!1;null!=(t=e.next());){if(!r){if("/"==t&&!i)return;"["==t?i=!0:i&&"]"==t&&(i=!1)}r=!r&&"\\"==t}}(e),e.eatWhile(/[gimy]/),h("regexp","string-2")):(e.eatWhile(d),h("operator","operator",e.current()));if("`"==r)return(t.tokenize=m)(e,t);if("#"==r)return e.skipToEnd(),h("error","error");if(d.test(r))return e.eatWhile(d),h("operator","operator",e.current());e.eatWhile(/[\w\$_]/);var i,n=e.current(),o=u.propertyIsEnumerable(n)&&u[n];return o&&"."!=t.lastType?h(o.type,o.style,n):h("variable","variable",n)}function g(e,t){for(var r,i=!1;r=e.next();){if("/"==r&&i){t.tokenize=f;break}i="*"==r}return h("comment","comment")}function m(e,t){for(var r,i=!1;null!=(r=e.next());){if(!i&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=f;break}i=!i&&"\\"==r}return h("quasi","string-2",e.current())}var v="([{}])";function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){for(var i=0,n=!1,o=r-1;0<=o;--o){var a=e.string.charAt(o),s=v.indexOf(a);if(0<=s&&s<3){if(!i){++o;break}if(0==--i)break}else if(3<=s&&s<6)++i;else if(/[$\w]/.test(a))n=!0;else if(n&&!i){++o;break}}n&&!i&&(t.fatArrowAt=o)}}var y={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function w(e,t,r,i,n,o){this.indented=e,this.column=t,this.type=r,this.prev=n,this.info=o,null!=i&&(this.align=i)}var k={state:null,column:null,marked:null,cc:null};function x(){for(var e=arguments.length-1;0<=e;e--)k.cc.push(arguments[e])}function S(){return x.apply(null,arguments),!0}function C(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return 1}var i=k.state;if(i.context){if(k.marked="def",t(i.localVars))return;i.localVars={name:e,next:i.localVars}}else{if(t(i.globalVars))return;r.globalVars&&(i.globalVars={name:e,next:i.globalVars})}}var E={name:"this",next:{name:"arguments"}};function L(){k.state.context={prev:k.state.context,vars:k.state.localVars},k.state.localVars=E}function G(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function T(e,t){function r(){var r=k.state,i=r.indented;"stat"==r.lexical.type&&(i=r.lexical.indented),r.lexical=new w(i,k.stream.column(),e,null,r.lexical,t)}return r.lex=!0,r}function M(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function A(e){return function t(r){return r==e?S():";"==e?x():S(t)}}function _(e,t){return"var"==e?S(T("vardef",t.length),J,A(";"),M):"keyword a"==e?S(T("form"),O,_,M):"keyword b"==e?S(T("form"),_,M):"{"==e?S(T("}"),X,M):";"==e?S():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==M&&k.state.cc.pop()(),S(T("form"),O,_,M,ne)):"function"==e?S(ue):"for"==e?S(T("form"),oe,_,M):"variable"==e?S(T("stat"),j):"switch"==e?S(T("form"),O,T("}","switch"),A("{"),X,M,M):"case"==e?S(O,A(":")):"default"==e?S(A(":")):"catch"==e?S(T("form"),L,A("("),de,A(")"),_,M,G):"module"==e?S(T("form"),L,ge,G,M):"class"==e?S(T("form"),pe,fe,M):"export"==e?S(T("form"),me,M):"import"==e?S(T("form"),ve,M):x(T("stat"),O,A(";"),M)}function O(e){return D(e,!1)}function N(e){return D(e,!0)}function D(e,t){if(k.state.fatArrowAt==k.stream.start){var r=t?F:W;if("("==e)return S(L,T(")"),K(ee,")"),M,A("=>"),r,G);if("variable"==e)return x(L,ee,A("=>"),r,G)}var i=t?z:P;return y.hasOwnProperty(e)?S(i):"function"==e?S(ue,i):"keyword c"==e?S(t?$:I):"("==e?S(T(")"),I,xe,A(")"),M,i):"operator"==e||"spread"==e?S(t?N:O):"["==e?S(T("]"),we,M,i):"{"==e?Y(q,"}",null,i):"quasi"==e?x(H,i):S()}function I(e){return e.match(/[;\}\)\],]/)?x():x(O)}function $(e){return e.match(/[;\}\)\],]/)?x():x(N)}function P(e,t){return","==e?S(O):z(e,t,!1)}function z(e,t,r){var i=0==r?P:z,n=0==r?O:N;return"=>"==t?S(L,r?F:W,G):"operator"==e?/\+\+|--/.test(t)?S(i):"?"==t?S(O,A(":"),n):S(n):"quasi"==e?x(H,i):";"!=e?"("==e?Y(N,")","call",i):"."==e?S(B,i):"["==e?S(T("]"),I,A("]"),M,i):void 0:void 0}function H(e,t){return"quasi"!=e?x():"${"!=t.slice(t.length-2)?S(H):S(O,R)}function R(e){if("}"==e)return k.marked="string-2",k.state.tokenize=m,S(H)}function W(e){return b(k.stream,k.state),x("{"==e?_:O)}function F(e){return b(k.stream,k.state),x("{"==e?_:N)}function j(e){return":"==e?S(M,_):x(P,A(";"),M)}function B(e){if("variable"==e)return k.marked="property",S()}function q(e,t){if("variable"==e){if(k.marked="property","get"==t||"set"==t)return S(U)}else if("number"==e||"string"==e)k.marked=s?"property":e+" property";else if("["==e)return S(O,A("]"),V);if(y.hasOwnProperty(e))return S(V)}function U(e){return"variable"!=e?x(V):(k.marked="property",S(ue))}function V(e){return":"==e?S(N):"("==e?x(ue):void 0}function K(e,t){function r(i){if(","!=i)return i==t?S():S(A(t));var n=k.state.lexical;return"call"==n.info&&(n.pos=(n.pos||0)+1),S(e,r)}return function(i){return i==t?S():x(e,r)}}function Y(e,t,r){for(var i=3;i<arguments.length;i++)k.cc.push(arguments[i]);return S(T(t,r),K(e,t),M)}function X(e){return"}"==e?S():x(_,X)}function Q(e){if(c&&":"==e)return S(Z)}function Z(e){if("variable"==e)return k.marked="variable-3",S()}function J(){return x(ee,Q,re,ie)}function ee(e,t){return"variable"==e?(C(t),S()):"["==e?Y(ee,"]"):"{"==e?Y(te,"}"):void 0}function te(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),S(A(":"),ee,re)):(C(t),S(re))}function re(e,t){if("="==t)return S(N)}function ie(e){if(","==e)return S(J)}function ne(e,t){if("keyword b"==e&&"else"==t)return S(T("form","else"),_,M)}function oe(e){if("("==e)return S(T(")"),ae,A(")"),M)}function ae(e){return"var"==e?S(J,A(";"),le):";"==e?S(le):"variable"==e?S(se):x(O,A(";"),le)}function se(e,t){return"in"==t||"of"==t?(k.marked="keyword",S(O)):S(P,le)}function le(e,t){return";"==e?S(ce):"in"==t||"of"==t?(k.marked="keyword",S(O)):x(O,A(";"),ce)}function ce(e){")"!=e&&S(O)}function ue(e,t){return"*"==t?(k.marked="keyword",S(ue)):"variable"==e?(C(t),S(ue)):"("==e?S(L,T(")"),K(de,")"),M,_,G):void 0}function de(e){return"spread"==e?S(de):x(ee,Q)}function pe(e,t){if("variable"==e)return C(t),S(he)}function he(e,t){if("extends"==t)return S(O)}function fe(e){if("{"==e)return Y(q,"}")}function ge(e,t){return"string"==e?S(_):"variable"==e?(C(t),S(ye)):void 0}function me(e,t){return"*"==t?(k.marked="keyword",S(ye,A(";"))):"default"==t?(k.marked="keyword",S(O,A(";"))):x(_)}function ve(e){return"string"==e?S():x(be,ye)}function be(e,t){return"{"==e?Y(be,"}"):("variable"==e&&C(t),S())}function ye(e,t){if("from"==t)return k.marked="keyword",S(O)}function we(e){return"]"==e?S():x(N,ke)}function ke(e){return"for"==e?x(xe,A("]")):(","==e?S:x)(K(N,"]"))}function xe(e){return"for"==e?S(oe,xe):"if"==e?S(O,xe):void 0}return M.lex=!0,{startState:function(e){var t={tokenize:f,lastType:"sof",cc:[],lexical:new w((e||0)-o,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=g&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==i?r:(t.lastType="operator"!=i||"++"!=n&&"--"!=n?i:"incdec",function(e,t,r,i,n){var o=e.cc;for(k.state=e,k.stream=n,k.marked=null,k.cc=o,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():l?O:_)(r,i)){for(;o.length&&o[o.length-1].lex;)o.pop()();return k.marked?k.marked:"variable"==r&&function(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return 1;for(var i=e.context;i;i=i.prev)for(r=i.vars;r;r=r.next)if(r.name==t)return 1}(e,i)?"variable-2":t}}(t,r,i,n,e))},indent:function(t,i){if(t.tokenize==g)return e.Pass;if(t.tokenize!=f)return 0;var n=i&&i.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(i))for(var l=t.cc.length-1;0<=l;--l){var c=t.cc[l];if(c==M)s=s.prev;else if(c!=ne)break}"stat"==s.type&&"}"==n&&(s=s.prev),a&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var u=s.type,d=n==u;return"vardef"==u?s.indented+("operator"==t.lastType||","==t.lastType?s.info+1:0):"form"==u&&"{"==n?s.indented:"form"==u?s.indented+o:"stat"==u?s.indented+("operator"==t.lastType||","==t.lastType?a||o:0):"switch"!=s.info||d||0==r.doubleIndentSwitch?s.align?s.column+(d?0:1):s.indented+(d?0:o):s.indented+(/^(?:case|default)\b/.test(i)?o:2*o)},electricChars:":{}",blockCommentStart:l?null:"/*",blockCommentEnd:l?null:"*/",lineComment:l?null:"//",fold:"brace",helperType:l?"json":"javascript",jsonldMode:s,jsonMode:l}}),e.registerHelper("wordChars","javascript",/[\\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),
/*!
 * tp-color-picker.js - Color Picker Plugin for Revolution Slider
 * @version: 2.0 (16.01.2018)
 * @author ThemePunch
*/
window.ESG=void 0===window.ESG?{}:window.ESG,ESG.F=void 0===ESG.F?{}:ESG.F,ESG.ENV=void 0===ESG.ENV?{}:ESG.ENV,ESG.V=void 0===ESG.V?{}:ESG.V,ESG.S=void 0===ESG.S?{}:ESG.S,ESG.SC=void 0===ESG.SC?{}:ESG.SC,ESG.C=void 0===ESG.C?{}:ESG.C,ESG.LIB=void 0===ESG.LIB?{nav_skins:[],item_skins:{},nav_originals:{}}:ESG.LIB,ESG.CM=void 0===ESG.CM?{apiJS:null,ajaxCSS:null,navCSS:null}:ESG.CM,ESG.WIN=void 0===ESG.WIN?jQuery(window):ESG.WIN,ESG.DOC=void 0===ESG.DOC?jQuery(document):ESG.DOC,window.ESGColor={defaultValue:"#ffffff",isColor:/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i,get:function(e){return e?ESGColor.process(e,!0)[0]:"transparent"},parse:function(e,t,r){e=ESGColor.process(e,!0);var i=[];return i[0]=t?t+": "+e[0]+";":e[0],r&&(i[1]=e[1]),i},convert:function(e,t){if(!e||"string"!=typeof e)return ESGColor.defaultValue;if("transparent"===e)return e;if(-1!==e.search(/\[\{/)||-1!==e.search("gradient"))return ESGColor.process(e,!0)[0];if(void 0===t||isNaN(t))return ESGColor.process(e,!0)[0];if((t=parseFloat(t))<=1&&(t*=100),0===(t=Math.max(Math.min(parseInt(t,10),100),0)))return"transparent";try{return-1!==e.search("#")||e.length<8?(ESGColor.isColor.test(e)||(e=e.replace(/[^A-Za-z0-9#]/g,"")),ESGColor.processRgba(ESGColor.sanitizeHex(e),t)):(e=ESGColor.rgbValues(e,3),ESGColor.rgbaString(e[0],e[1],e[2],.01*t))}catch(e){return ESGColor.defaultValue}},process:function(e,t){if("string"!=typeof e)return t&&ESGColor.sanitizeGradient(e),[ESGColor.processGradient(e),"gradient",e];if("transparent"===e.trim())return["transparent","transparent"];if(-1===e.search(/\[\{/))return-1!==e.search("-gradient")?[e,"gradient_css",ESGColor.reverseGradient(e)]:-1!==e.search("#")?[ESGColor.sanitizeHex(e),"hex"]:-1!==e.search("rgba")?(-1!==(e=e.replace(/\s/g,"")).search(/,\)/)&&(e=e.split(",)")[0]+",1)"),[e,"rgba"]):[e.replace(/\s/g,""),"rgb"];try{return e=JSON.parse(e.replace(/\&/g,'"')),t&&ESGColor.sanitizeGradient(e),[ESGColor.processGradient(e),"gradient",e]}catch(e){return console.log("ESGColor.process() failed to parse JSON string"),["linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%)","gradient",{type:"linear",angle:"0",colors:[{r:"255",g:"255",b:"255",a:"1",position:"0",align:"bottom"},{r:"0",g:"0",b:"0",a:"1",position:"100",align:"bottom"}]}]}},transparentRgba:function(e,t){if(!t&&"rgba"!==ESGColor.process(e)[1])return!1;return"0"===ESGColor.rgbValues(e,4)[3]},rgbValues:function(e,t){3===(e=e.substring(e.indexOf("(")+1,e.lastIndexOf(")")).split(",")).length&&4===t&&(e[3]="1");for(var r=0;r<t;r++)void 0!==e[r]&&(e[r]=e[r].trim());return e},rgbString:function(e,t,r){return"rgb("+e+", "+t+", "+r+")"},rgbaString:function(e,t,r,i){return"rgba("+e+", "+t+", "+r+", "+i+")"},rgbToHex:function(e){var t=ESGColor.rgbValues(e,3);return ESGColor.getRgbToHex(t[0],t[1],t[2])},rgbaToHex:function(e){var t=ESGColor.rgbValues(e,4);return[ESGColor.getRgbToHex(t[0],t[1],t[2]),t[3]]},getOpacity:function(e){return parseInt(100*ESGColor.rgbValues(e,4)[3],10)+"%"},getRgbToHex:function(e,t,r){return"#"+("0"+parseInt(e,10).toString(16)).slice(-2)+("0"+parseInt(t,10).toString(16)).slice(-2)+("0"+parseInt(r,10).toString(16)).slice(-2)},sanitizeAlpha:function(e){return parseFloat(Math.max(Math.min(parseFloat(e),1),0).toFixed(2).replace(/\.?0*$/,""))},joinToRgba:function(e){return e=e.split("||"),ESGColor.convert(e[0],e[1])},processRgba:function(e,t){e=e.replace("#","");var r=void 0!==t,i=(r?"rgba":"rgb")+"("+parseInt(e.substring(0,2),16)+", "+parseInt(e.substring(2,4),16)+", "+parseInt(e.substring(4,6),16);return i+=r?", "+(.01*parseInt(t,10)).toFixed(2).replace(/\.?0*$/,"")+")":")"},hexToRGB:function(e){return e=e.replace("#",""),[parseInt(e.substring(0,2),16),parseInt(e.substring(2,4),16),parseInt(e.substring(4,6),16)]},processGradient:function(e,t,r){t&&ESGColor.sanitizeGradient(e),!r&&e.easing&&"none"!==e.easing&&("undefined"!=typeof jQuery&&(e=jQuery.extend(!0,{},e)),ESGColor.easeGradient(e));var i,n,o=e.type,a=o+"-gradient(";n="linear"===o?180!==(i=parseInt(e.angle,10))?i+"deg, ":"":"ellipse at center, ";for(var s,l=e.colors,c=l.length,u="",d=0;d<c;d++)d>0&&(u+=", "),u+="rgba("+(s=l[d]).r+", "+s.g+", "+s.b+", "+s.a+") "+s.position+"%";return a+n+u+")"},sanitizeHex:function(e){if(3===(e=e.replace("#","").trim()).length){var t=e.charAt(0),r=e.charAt(1),i=e.charAt(2);e=t+t+r+r+i+i}return"#"+e},sortPoints:function(e,t){return e.hasOwnProperty("x")?e.x<t.x?-1:e.x>t.x?1:0:e.position<t.position?-1:e.position>t.position?1:0},distColor:function(e,t,r,i,n){return Math.max(Math.min(Math.round(Math.abs((e-t)/(r-t)*(n-i)+i)),255),0)},distAlpha:function(e,t,r,i,n){return Math.max(Math.min(Math.abs(parseFloat(((e-t)/(r-t)*(n-i)).toFixed(2))+parseFloat(i)),1),0)},sanitizeGradient:function(e){var t,r=e.colors,i=r.length,n=[];r.sort(ESGColor.sortPoints);for(var o=0;o<i;o++){var a=r[o];delete a.align,a.a=ESGColor.sanitizeAlpha(a.a),a.r=parseInt(a.r,10),a.g=parseInt(a.g,10),a.b=parseInt(a.b,10),a.position=parseInt(a.position,10),t?JSON.stringify(a)!==JSON.stringify(t)&&(n[n.length]=a):n[n.length]=a,t=a}return e.colors=n,e},reverseGradient:function(e){if(-1!==e.search("hsl"))return e;var t=(e=e.replace(/\-moz\-|\-webkit\-/,"").replace("to left","90deg").replace("to bottom","180deg").replace("to top","0deg").replace("to right","270deg").replace(";","")).split("-gradient(");if(t.length<2)return e;var r="0",i=t[1].trim();-1===i.search("ellipse at center")?-1!==i.search("deg")&&(r=(i=i.split("deg"))[0].trim(),i=i[1].trim()):i=i.replace("ellipse at center",""),","===i.charAt(0)&&(i=i.slice(1)),","===i.charAt(i.length-1)&&(i=i.slice(0,i.length-1));var n,o,a,s,l,c=i.split("%"),u=[],d=0;c.pop(),l=c.length;for(var p=0;p<l;p++){if(a=(s=c[p].trim()).length,n="",","===s.charAt(0)&&(s=s.slice(1)),-1===s.search(" "))return e;for(n=s.split(" "),n=parseInt(n[n.length-1],10);a--&&(d=a," "!==s[a]););s=-1!==(s=s.substring(0,d)).search(/\)/)?s.split(")")[0].trim()+")":s.split(" ")[0].trim(),"hex"===ESGColor.process(s)[1]&&(s=ESGColor.sanitizeHex(s),s=ESGColor.processRgba(s)),o&&o===s||(o=s,s=ESGColor.rgbValues(s,4),u[u.length]={r:s[0],g:s[1],b:s[2],a:s[3],position:n,align:"top"},u[u.length]={r:s[0],g:s[1],b:s[2],a:1,position:n,align:"bottom"})}return JSON.stringify({type:t[0].trim(),angle:r,colors:u})},insertPoints:function(e,t,r,i,n){var o=e.position,a=t.position;if(!(o>a)){for(var s,l,c,u=[],d=0;d<n;d++)(l=parseFloat(i(d,0,1,n).toFixed(2))*(a-o)+o)>o&&l<a&&(u[u.length]=l);var p,h,f=u.length,g=parseFloat(((a-o)/(f+1)).toFixed(2)),m=parseFloat(g+o);for(d=0;d<f;d++)(c=u[d])!==e.position&&(p=ESGColor.sanitizeAlpha(e.a),h=ESGColor.sanitizeAlpha(t.a),s={position:m,r:e.r!==t.r?Math.round(ESGColor.distColor(c,o,a,e.r,t.r)):e.r,g:e.g!==t.g?Math.round(ESGColor.distColor(c,o,a,e.g,t.g)):e.g,b:e.b!==t.b?Math.round(ESGColor.distColor(c,o,a,e.b,t.b)):e.b,a:p!==h?ESGColor.sanitizeAlpha(ESGColor.distAlpha(c,o,a,e.a,t.a)):p},m+=g,m=parseFloat(m.toFixed(2)),r[r.length]=s)}},easeGradient:function(e){var t=.01*parseInt(e.strength,10)*15,r=e.colors,i=e.easing,n=r.length-1,o=[];r.sort(ESGColor.sortPoints),i=i.split("."),i=ESGColor.easing[i[0]][i[1]];for(var a=0;a<n;a++)o[o.length]=r[a],ESGColor.insertPoints(r[a],r[a+1],o,i,t);o[o.length]=r[n],e.colors=o},easing:{quint:{easeout:function(e,t,r,i){return r*((e=e/i-1)*e*e*e*e+1)+t},easein:function(e,t,r,i){return r*(e/=i)*e*e*e*e+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e*e*e*e+t:r/2*((e-=2)*e*e*e*e+2)+t}},quad:{easein:function(e,t,r,i){return r*(e/=i)*e+t},easeout:function(e,t,r,i){return-r*(e/=i)*(e-2)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e+t:-r/2*(--e*(e-2)-1)+t}},quart:{easein:function(e,t,r,i){return r*(e/=i)*e*e*e+t},easeout:function(e,t,r,i){return-r*((e=e/i-1)*e*e*e-1)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e*e*e+t:-r/2*((e-=2)*e*e*e-2)+t}},cubic:{easein:function(e,t,r,i){return r*(e/=i)*e*e+t},easeout:function(e,t,r,i){return r*((e=e/i-1)*e*e+1)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}},circ:{easein:function(e,t,r,i){return-r*(Math.sqrt(1-(e/=i)*e)-1)+t},easeout:function(e,t,r,i){return r*Math.sqrt(1-(e=e/i-1)*e)+t},easeinout:function(e,t,r,i){return(e/=i/2)<1?-r/2*(Math.sqrt(1-e*e)-1)+t:r/2*(Math.sqrt(1-(e-=2)*e)+1)+t}},sine:{easein:function(e,t,r,i){return-r*Math.cos(e/i*(Math.PI/2))+r+t},easeout:function(e,t,r,i){return r*Math.sin(e/i*(Math.PI/2))+t},easeinout:function(e,t,r,i){return-r/2*(Math.cos(Math.PI*e/i)-1)+t}},expo:{easein:function(e,t,r,i){return 0===e?t:r*Math.pow(2,10*(e/i-1))+t},easeout:function(e,t,r,i){return e===i?t+r:r*(1-Math.pow(2,-10*e/i))+t},easeinout:function(e,t,r,i){return 0===e?t:e===i?t+r:(e/=i/2)<1?r/2*Math.pow(2,10*(e-1))+t:r/2*(2-Math.pow(2,-10*--e))+t}},bounce:{easeout:function(e,t,r,i){return(e/=i)<1/2.75?r*(7.5625*e*e)+t:e<2/2.75?r*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?r*(7.5625*(e-=2.25/2.75)*e+.9375)+t:r*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easein:function(e,t,r,i){return r-ESGColor.easing.bounce.easeout(i-e,0,r,i)+t},easeinout:function(e,t,r,i){return e<i/2?.5*ESGColor.easing.bounce.easein(2*e,0,r,i)+t:.5*ESGColor.easing.bounce.easeout(2*e-i,0,r,i)+.5*r+t}}}},function(e){ESG.DOC=void 0===ESG.DOC?jQuery(document):ESG.DOC;var t,r,i,n,o,a,s,l,c,u,d,p,h,f,g,m,v,b,y,w,k,x,S,C,E,L,G,T,M,A,_,O,N,D,I,$,P,z,H,R,W,F,j,B,q,U,V,K,Y,X,Q,Z,J,ee,te,re,ie,ne,oe,ae,se,le,ce,ue,de,pe,he,fe,ge,me,ve,be,ye,we,ke,xe,Se,Ce,Ee,Le,Ge,Te,Me,Ae,_e,Oe,Ne,De,Ie,$e,Pe,ze,He,Re,We,Fe,je,Be,qe={},Ue=236,Ve=20,Ke=25,Ye=3,Xe=4,Qe=10,Ze=15,Je=150,et=10,tt="full",rt={axis:"x",containment:"#esgbuilder-cpicker-point-wrap"},it={color:"Color",solid_color:"Solid",gradient_color:"Gradient",gradient_easing:"Gradient Easing",easing_strength:"Easing/Strength",currently_editing:"Currently Editing",core_presets:"Core Presets",custom_presets:"Custom Presets",enter_a_name:"Enter a Name",save_a_new_preset:"Save a new Preset",save:"Save Preset",color_hex_value:"Hex",opacity:"Opacity",clear:"Clear Color",location:"Location",delete:"Delete Marker",horizontal:"Horizontal",vertical:"Vertical",radial:"Radial",enter_angle:"Enter Angle",reverse_gradient:"Reverse Gradient",delete_confirm:"Remove/Delete this custom preset color?",naming_error:"Please enter a unique name for the new color preset",preset_collection:"Preset Collection",color_type:"Color Type",close:"Close",save_exit:"Save",apply:"Apply",rgb:"RGB",preset_group:"Preset Group",save_preset:"Save Preset",pos_opacity:"Pos / Opacity"},nt=["#FFFFFF","#000000","#FF3A2D","#007AFF","#4CD964","#FFCC00","#C7C7CC","#8E8E93","#FFD3E0","#34AADC","#E0F8D8","#5AC8FA","#5856D6","#FF69B4","#800000","#009933"],ot=[{0:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:247,&g&:247,&b&:247,&a&:&1&,&position&:0,&align&:&top&},{&r&:247,&g&:247,&b&:247,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:215,&g&:215,&b&:215,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:215,&g&:215,&b&:215,&a&:&1&,&position&:100,&align&:&top&}]}"},{1:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:74,&g&:74,&b&:74,&a&:&1&,&position&:0,&align&:&top&},{&r&:74,&g&:74,&b&:74,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:43,&g&:43,&b&:43,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:43,&g&:43,&b&:43,&a&:&1&,&position&:100,&align&:&top&}]}"},{2:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:219,&g&:221,&b&:222,&a&:&1&,&position&:0,&align&:&top&},{&r&:219,&g&:221,&b&:222,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:137,&g&:140,&b&:144,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:137,&g&:140,&b&:144,&a&:&1&,&position&:100,&align&:&top&}]}"},{3:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:26,&g&:214,&b&:253,&a&:&1&,&position&:0,&align&:&top&},{&r&:26,&g&:214,&b&:253,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:29,&g&:98,&b&:240,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:29,&g&:98,&b&:240,&a&:&1&,&position&:100,&align&:&top&}]}"},{4:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:198,&g&:68,&b&:252,&a&:&1&,&position&:0,&align&:&top&},{&r&:198,&g&:68,&b&:252,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:88,&g&:86,&b&:214,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:88,&g&:86,&b&:214,&a&:&1&,&position&:100,&align&:&top&}]}"},{5:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:42,&b&:104,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:42,&b&:104,&a&:&1&,&position&:100,&align&:&top&}]}"},{6:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:228,&g&:221,&b&:202,&a&:&1&,&position&:0,&align&:&top&},{&r&:228,&g&:221,&b&:202,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:214,&g&:206,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:214,&g&:206,&b&:195,&a&:&1&,&position&:100,&align&:&top&}]}"},{7:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:219,&b&:76,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:219,&b&:76,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:205,&b&:2,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:205,&b&:2,&a&:&1&,&position&:100,&align&:&top&}]}"},{8:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:255,&g&:149,&b&:0,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:149,&b&:0,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:94,&b&:58,&a&:&1&,&position&:100,&align&:&top&}]}"},{9:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:82,&g&:237,&b&:199,&a&:&1&,&position&:0,&align&:&top&},{&r&:82,&g&:237,&b&:199,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:90,&g&:200,&b&:251,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:90,&g&:200,&b&:251,&a&:&1&,&position&:100,&align&:&top&}]}"},{10:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:228,&g&:183,&b&:240,&a&:&1&,&position&:0,&align&:&top&},{&r&:228,&g&:183,&b&:240,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:200,&g&:110,&b&:223,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:200,&g&:110,&b&:223,&a&:&1&,&position&:100,&align&:&top&}]}"},{11:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:135,&g&:252,&b&:112,&a&:&1&,&position&:0,&align&:&top&},{&r&:135,&g&:252,&b&:112,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:11,&g&:211,&b&:24,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:11,&g&:211,&b&:24,&a&:&1&,&position&:100,&align&:&top&}]}"},{12:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:61,&g&:78,&b&:129,&a&:&1&,&position&:0,&align&:&top&},{&r&:61,&g&:78,&b&:129,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:87,&g&:83,&b&:201,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:110,&g&:127,&b&:243,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:110,&g&:127,&b&:243,&a&:&1&,&position&:100,&align&:&top&}]}"},{13:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:35,&g&:21,&b&:87,&a&:&1&,&position&:0,&align&:&top&},{&r&:35,&g&:21,&b&:87,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:68,&g&:16,&b&:122,&a&:&1&,&position&:29,&align&:&bottom&},{&r&:255,&g&:19,&b&:97,&a&:&1&,&position&:67,&align&:&bottom&},{&r&:255,&g&:248,&b&:0,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:248,&b&:0,&a&:&1&,&position&:100,&align&:&top&}]}"},{14:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:105,&g&:234,&b&:203,&a&:&1&,&position&:0,&align&:&top&},{&r&:105,&g&:234,&b&:203,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:234,&g&:204,&b&:248,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:102,&g&:84,&b&:241,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:102,&g&:84,&b&:241,&a&:&1&,&position&:100,&align&:&top&}]}"},{15:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:124,&g&:100,&b&:213,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:76,&g&:195,&b&:255,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:76,&g&:195,&b&:255,&a&:&1&,&position&:100,&align&:&top&}]}"},{16:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&top&},{&r&:255,&g&:5,&b&:124,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:141,&g&:11,&b&:147,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:50,&g&:21,&b&:117,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:50,&g&:21,&b&:117,&a&:&1&,&position&:100,&align&:&top&}]}"},{17:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:164,&g&:69,&b&:178,&a&:&1&,&position&:0,&align&:&top&},{&r&:164,&g&:69,&b&:178,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:212,&g&:24,&b&:114,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:255,&g&:0,&b&:102,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:0,&b&:102,&a&:&1&,&position&:100,&align&:&top&}]}"},{18:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:158,&g&:251,&b&:211,&a&:&1&,&position&:0,&align&:&top&},{&r&:158,&g&:251,&b&:211,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:87,&g&:233,&b&:242,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:69,&g&:212,&b&:251,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:69,&g&:212,&b&:251,&a&:&1&,&position&:100,&align&:&top&}]}"},{19:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:172,&g&:50,&b&:228,&a&:&1&,&position&:0,&align&:&top&},{&r&:172,&g&:50,&b&:228,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:121,&g&:24,&b&:242,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:72,&g&:1,&b&:255,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:72,&g&:1,&b&:255,&a&:&1&,&position&:100,&align&:&top&}]}"},{20:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:112,&g&:133,&b&:182,&a&:&1&,&position&:0,&align&:&top&},{&r&:112,&g&:133,&b&:182,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:135,&g&:167,&b&:217,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:222,&g&:243,&b&:248,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:222,&g&:243,&b&:248,&a&:&1&,&position&:100,&align&:&top&}]}"},{21:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:34,&g&:225,&b&:255,&a&:&1&,&position&:0,&align&:&top&},{&r&:34,&g&:225,&b&:255,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:29,&g&:143,&b&:225,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:98,&g&:94,&b&:177,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:98,&g&:94,&b&:177,&a&:&1&,&position&:100,&align&:&top&}]}"},{22:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&top&},{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:107,&g&:141,&b&:214,&a&:&1&,&position&:50,&align&:&bottom&},{&r&:142,&g&:55,&b&:215,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:142,&g&:55,&b&:215,&a&:&1&,&position&:100,&align&:&top&}]}"},{23:"{&type&:&linear&,&angle&:&160&,&colors&:[{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&top&},{&r&:44,&g&:216,&b&:213,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:197,&g&:193,&b&:255,&a&:&1&,&position&:56,&align&:&bottom&},{&r&:255,&g&:186,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:186,&b&:195,&a&:&1&,&position&:100,&align&:&top&}]}"},{24:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:191,&g&:217,&b&:254,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:191,&g&:217,&b&:254,&a&:&1&,&position&:0,&align&:&top&},{&r&:223,&g&:137,&b&:181,&a&:&1&,&position&:100,&align&:&top&},{&r&:223,&g&:137,&b&:181,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{25:"{&type&:&linear&,&angle&:&340&,&colors&:[{&r&:97,&g&:97,&b&:97,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:97,&g&:97,&b&:97,&a&:&1&,&position&:0,&align&:&top&},{&r&:155,&g&:197,&b&:195,&a&:&1&,&position&:100,&align&:&top&},{&r&:155,&g&:197,&b&:195,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{26:"{&type&:&linear&,&angle&:&90&,&colors&:[{&r&:36,&g&:57,&b&:73,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:36,&g&:57,&b&:73,&a&:&1&,&position&:0,&align&:&top&},{&r&:81,&g&:127,&b&:164,&a&:&1&,&position&:100,&align&:&top&},{&r&:81,&g&:127,&b&:164,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{27:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:234,&g&:205,&b&:163,&a&:&1&,&position&:0,&align&:&top&},{&r&:234,&g&:205,&b&:163,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:230,&g&:185,&b&:128,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:230,&g&:185,&b&:128,&a&:&1&,&position&:100,&align&:&top&}]}"},{28:"{&type&:&linear&,&angle&:&45&,&colors&:[{&r&:238,&g&:156,&b&:167,&a&:&1&,&position&:0,&align&:&top&},{&r&:238,&g&:156,&b&:167,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:255,&g&:221,&b&:225,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:255,&g&:221,&b&:225,&a&:&1&,&position&:100,&align&:&top&}]}"},{29:"{&type&:&linear&,&angle&:&340&,&colors&:[{&r&:247,&g&:148,&b&:164,&a&:&1&,&position&:0,&align&:&top&},{&r&:247,&g&:148,&b&:164,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:253,&g&:214,&b&:189,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:253,&g&:214,&b&:189,&a&:&1&,&position&:100,&align&:&top&}]}"},{30:"{&type&:&linear&,&angle&:&45&,&colors&:[{&r&:135,&g&:77,&b&:162,&a&:&1&,&position&:0,&align&:&top&},{&r&:135,&g&:77,&b&:162,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:196,&g&:58,&b&:48,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:196,&g&:58,&b&:48,&a&:&1&,&position&:100,&align&:&top&}]}"},{31:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:243,&g&:231,&b&:233,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:243,&g&:231,&b&:233,&a&:&1&,&position&:0,&align&:&top&},{&r&:218,&g&:212,&b&:236,&a&:&1&,&position&:100,&align&:&top&},{&r&:218,&g&:212,&b&:236,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{32:"{&type&:&linear&,&angle&:&320&,&colors&:[{&r&:43,&g&:88,&b&:118,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:43,&g&:88,&b&:118,&a&:&1&,&position&:0,&align&:&top&},{&r&:78,&g&:67,&b&:118,&a&:&1&,&position&:100,&align&:&top&},{&r&:78,&g&:67,&b&:118,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{33:"{&type&:&linear&,&angle&:&60&,&colors&:[{&r&:41,&g&:50,&b&:60,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:41,&g&:50,&b&:60,&a&:&1&,&position&:0,&align&:&top&},{&r&:72,&g&:85,&b&:99,&a&:&1&,&position&:100,&align&:&top&},{&r&:72,&g&:85,&b&:99,&a&:&1&,&position&:100,&align&:&bottom&}]}"},{34:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:233,&g&:233,&b&:231,&a&:&1&,&position&:0,&align&:&top&},{&r&:233,&g&:233,&b&:231,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:239,&g&:238,&b&:236,&a&:&1&,&position&:25,&align&:&bottom&},{&r&:238,&g&:238,&b&:238,&a&:&1&,&position&:70,&align&:&bottom&},{&r&:213,&g&:212,&b&:208,&a&:&1&,&position&:100,&align&:&bottom&},{&r&:213,&g&:212,&b&:208,&a&:&1&,&position&:100,&align&:&top&}]}"},{35:"{&type&:&linear&,&angle&:&180&,&colors&:[{&r&:251,&g&:200,&b&:212,&a&:&1&,&position&:0,&align&:&bottom&},{&r&:251,&g&:200,&b&:212,&a&:&1&,&position&:0,&align&:&top&},{&r&:151,&g&:149,&b&:240,&a&:&1&,&position&:100,&align&:&top&},{&r&:151,&g&:149,&b&:240,&a&:&1&,&position&:100,&align&:&bottom&}]}"}],at='<div id="esgbuilder-cpicker-back" class="esgbuilder-cpicker-close"></div><div id="esgbuilder-cpicker"><div id="esgbuilder-cpicker-container"><div id="esgbuilder-cpicker-left" class="esgbuilder-cpicker-column"><div id="esgbuilder-cpicker-head"><div id="esgbuilder-cpicker-drag" class="esgbuilder-cpicker-draggable"></div><div id="esgbuilder-cpicker-type-wrap" class="esgbuilder-cpicker-side esgbuilder-cpicker-left esgbuilder-cpicker-candrag"><span data-text="color_type" class="esgbuilder-cpicker-candrag esgbuilder-cpicker-title"></span><div id="esgbuilder-cpicker-btn-wrap"><span id="esgbuilder-cpicker-color-btn" class="esgbuilder-cpicker-main-btn"><i class="material-icons">invert_colors</i></span><span id="esgbuilder-cpicker-gradient-btn" class="esgbuilder-cpicker-main-btn"><i class="material-icons">gradient</i></span></div></div><div id="esgbuilder-cpicker-editing" class="esgbuilder-cpicker-candrag"><span id="esgbuilder-cpicker-edit-title" data-text="currently_editing"></span><span id="esgbuilder-cpicker-current-edit" class="esgbuilder-cpicker-txt-space-left esgbuilder-cpicker-bright"></span></div></div><div id="esgbuilder-cpicker-base"><div id="esgbuilder-cpicker-colors"><div><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="color" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><span id="esgbuilder-cpicker-preview-color" class="esgbuilder-cpicker-preview"></span><input type="text" id="esgbuilder-cpicker-color-hex" class="esgbuilder-cpicker-input esgbuilder-cpicker-hex" value="#ffffff" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="rgb" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small first"><input type="text" id="esgbuilder-cpicker-r" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small"><input type="text" id="esgbuilder-cpicker-g" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small"><input type="text" id="esgbuilder-cpicker-b" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="opacity" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" id="esgbuilder-cpicker-color-opacity" class="esgbuilder-cpicker-input esgbuilder-cpicker-opacity-input" value="100%" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span id="esgbuilder-cpciker-clear-hex" class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover"><i class="material-icons">delete</i><span data-text="clear"></span></span></div></div><div class="esgbuilder-cpicker-side"><div class="esgbuilder-cpicker-iris"><input id="esgbuilder-cpicker-iris-color" class="esgbuilder-cpicker-iris-input" /><div id="esgbuilder-cpicker-scroller" class="iris-slider iris-strip"><div id="esgbuilder-cpicker-scroll-bg"></div><div id="esgbuilder-cpicker-scroll" class="iris-slider-offset"></div></div></div></div></div><div id="esgbuilder-cpicker-color-presets" class="esgbuilder-cpicker-presets"><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="preset_group" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-preset-colors" class="esgbuilder-cpicker-dropdown esgbuilder-cpicker-preset-selector"><option value="core">Defaults</option><option value="custom">Custom</option></select></div></div><div class="esgbuilder-cpicker-row"><span data-text="save_preset" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" class="esgbuilder-cpicker-input esgbuilder-cpicker-preset-save" data-placeholder="enter_a_name" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-save-preset-btn" data-alert="naming_error" data-message="Please enter a unique name for the new color preset"><i class="material-icons">save</i><span data-text="save"></span></span></div></div><div class="esgbuilder-cpicker-side"><div id="esgbuilder-cpicker-colors-core" class="esgbuilder-cpicker-presets-group ps-container"></div><div id="esgbuilder-cpicker-colors-custom" class="esgbuilder-cpicker-presets-group ps-container esgbuilder-cpicker-presets-custom"></div></div></div></div><div id="esgbuilder-cpicker-gradients"><div><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left esgbuilder-cpicker-supress"><div class="esgbuilder-cpicker-row first"><div class="esgbuilder-cpicker-gradient-block"><div id="esgbuilder-cpicker-gradient-input" class="esgbuilder-cpicker-gradient-builder"><span id="esgbuilder-cpicker-hit-top" class="esgbuilder-cpicker-builder-hit"></span><div id="esgbuilder-cpicker-point-wrap"><div id="esgbuilder-cpciker-point-container"></div></div><span id="esgbuilder-cpicker-hit-bottom" class="esgbuilder-cpicker-builder-hit"></span></div></div></div><div class="esgbuilder-cpicker-row"><span data-text="pos_opacity" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress first disabled"><input type="text" id="esgbuilder-cpicker-color-location" class="esgbuilder-cpicker-input" value="100%" maxlength="4" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress disabled"><input type="text" id="esgbuilder-cpicker-grad-opacity" class="esgbuilder-cpicker-input esgbuilder-cpicker-opacity-input" value="100%" maxlength="4" /></div><span id="esgbuilder-cpicker-color-delete" class="esgbuilder-cpicker-btn esgbuilder-cpicker-btn-small esgbuilder-cpicker-hover esgbuilder-cpicker-point-delete esgbuilder-cpicker-supress"><i class="material-icons">delete</i></span><div class="clearfix"></div></div><div id="revpicker-easing-row" class="esgbuilder-cpicker-row"><span id="esgbuilder-cpicker-easing-title" data-text="gradient_easing" class="esgbuilder-cpicker-title"></span><span id="esgbuilder-cpicker-strength-title" data-text="easing_strength" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-easing" class="esgbuilder-cpicker-dropdown"><option value="none">None</option><option value="sine.easeout">sine.out</option><option value="sine.easein">sine.in</option><option value="sine.easeinout">sine.inOut</option><option value="quad.easeout">Quad.easeOut</option><option value="quad.easein">Quad.easeIn</option><option value="quad.easeinout">Quad.easeInOut</option><option value="cubic.easeout">Cubic.easeOut</option><option value="cubic.easein">Cubic.easeIn</option><option value="cubic.easeinout">Cubic.easeInOut</option><option value="circ.easeout">circ.out</option><option value="circ.easein">circ.in</option><option value="circ.easeinout">circ.inOut</option><option value="quart.easeout">Quart.easeOut</option><option value="quart.easein">Quart.easeIn</option><option value="quart.easeinout">Quart.easeInOut</option><option value="quint.easeout">Quint.easeOut</option><option value="quint.easein">Quint.easeIn</option><option value="quint.easeinout">Quint.easeInOut</option><option value="expo.easeout">expo.out</option><option value="expo.easein">expo.in</option><option value="expo.easeinout">expo.inOut</option><option value="bounce.easeout">bounce.out</option><option value="bounce.easein">bounce.in</option><option value="bounce.easeinout">bounce.inOut</option></select></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-basic esgbuilder-cpicker-supress esgbuilder-cpicker-easing-strength"><input type="text" id="esgbuilder-cpicker-strength" class="esgbuilder-cpicker-input" value="100%" maxlength="5" /></div></div><div class="esgbuilder-cpicker-hideable"><div class="esgbuilder-cpicker-row extended"><span data-text="color" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-supress"><span id="esgbuilder-cpicker-preview-gradient" class="esgbuilder-cpicker-preview"></span><input type="text" id="esgbuilder-cpicker-gradient-hex" class="esgbuilder-cpicker-input esgbuilder-cpicker-hex" value="#ffffff" /></div></div><div class="esgbuilder-cpicker-row"><span data-text="rgb" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress first"><input type="text" id="esgbuilder-cpicker-r2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" id="esgbuilder-cpicker-g2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" id="esgbuilder-cpicker-b2" class="esgbuilder-cpicker-input esgbuilder-cpicker-rgb" value="255" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span id="esgbuilder-cpciker-clear-gradient" class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-supress"><i class="material-icons">delete</i><span data-text="clear"></span></span></div></div></div><div class="esgbuilder-cpicker-side"><div class="esgbuilder-cpicker-row first"><div class="esgbuilder-cpicker-gradient-block"><div id="esgbuilder-cpicker-gradient-output" class="esgbuilder-cpicker-gradient-builder"></div></div></div><div class="esgbuilder-cpicker-row"><span id="esgbuilder-cpicker-orientation-horizontal" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress selected" data-direction="90"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-horizontal" class="esgbuilder-cpicker-preset-bg"></span></span><span id="esgbuilder-cpicker-orientation-vertical" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress" data-direction="180"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-vertical" class="esgbuilder-cpicker-preset-bg"></span></span><span id="esgbuilder-cpicker-orientation-radial" class="esgbuilder-cpicker-direction esgbuilder-cpicker-orientation esgbuilder-cpicker-supress" data-direction="radial"><span class="esgbuilder-cpicker-preset-tile"></span><span id="esgbuilder-cpicker-direction-radial" class="esgbuilder-cpicker-preset-bg"></span></span><div id="esgbuilder-cpicker-wheel" class="esgbuilder-cpicker-supress"><div id="esgbuilder-cpicker-wheel-inner"><span id="esgbuilder-cpicker-wheel-point"></span></div></div><div id="esgbuilder-cpicker-radial-wrap" class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover esgbuilder-cpicker-input-small esgbuilder-cpicker-supress"><input type="text" class="esgbuilder-cpicker-input" id="esgbuilder-cpicker-meta-angle" maxlength="4"></div></div><div class="esgbuilder-cpicker-row esgbuilder-cpicker-no-margin"><span data-text="reverse_gradient" class="esgbuilder-cpicker-title esgbuilder-cpicker-label"></span><div id="esgbuilder-cpicker-meta-reverse" class="esgbuilder-cpicker-onoff-wrap esgbuilder-cpicker-supress"><div class="esgbuilder-cpicker-onoff-inner"><div class="esgbuilder-cpicker-onoff esgbuilder-cpicker-off"><span>OFF</span></div><div class="esgbuilder-cpicker-onoff esgbuilder-cpicker-on"><span>ON</span></div></div></div></div><div class="esgbuilder-cpicker-hideable"><div class="esgbuilder-cpicker-row"><div class="esgbuilder-cpicker-iris esgbuilder-cpicker-supress"><input id="esgbuilder-cpicker-iris-gradient" class="esgbuilder-cpicker-iris-input" /></div></div></div></div></div><div id="esgbuilder-cpicker-gradient-presets" class="esgbuilder-cpicker-presets"><div class="esgbuilder-cpicker-side esgbuilder-cpicker-left"><div class="esgbuilder-cpicker-row first"><span data-text="preset_group" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><select id="esgbuilder-cpicker-preset-gradients" class="esgbuilder-cpicker-dropdown esgbuilder-cpicker-preset-selector"><option value="core">Defaults</option><option value="custom">Custom</option></select></div></div><div class="esgbuilder-cpicker-row"><span data-text="save_preset" class="esgbuilder-cpicker-title"></span><div class="esgbuilder-cpicker-input-wrap esgbuilder-cpicker-hover"><input type="text" class="esgbuilder-cpicker-input esgbuilder-cpicker-preset-save" data-placeholder="enter_a_name" /></div></div><div class="esgbuilder-cpicker-row"><span class="esgbuilder-cpicker-spacer"></span><span class="esgbuilder-cpicker-btn esgbuilder-cpicker-hover esgbuilder-cpicker-save-preset-btn" data-alert="naming_error" data-message="Please enter a unique name for the new color preset"><i class="material-icons">save</i><span data-text="save"></span></span></div></div><div class="esgbuilder-cpicker-side"><div id="esgbuilder-cpicker-gradients-core" class="esgbuilder-cpicker-presets-group ps-container"></div><div id="esgbuilder-cpicker-gradients-custom" class="esgbuilder-cpicker-presets-group ps-container esgbuilder-cpicker-presets-custom"></div></div></div></div></div></div><div id="esgbuilder-cpicker-right" class="esgbuilder-cpicker-column"><div id="esgbuilder-cpicker-exit" class="esgbuilder-cpicker-close esgbuilder-cpicker-btn-large esgbuilder-cpicker-hover"><i class="material-icons esgbuilder-cpicker-hover">close</i></div><div id="esgbuilder-cpicker-toggle"><div id="esgbuilder-cpicker-palette" class="esgbuilder-cpicker-btn-large esgbuilder-cpicker-hover"><i class="material-icons esgbuilder-cpicker-hover esgbuilder-cpicker-palette-closed">palette</i><i class="material-icons esgbuilder-cpicker-hover esgbuilder-cpicker-palette-open">keyboard_arrow_up</i></div><div id="esgbuilder-cpicker-check" class="esgbuilder-cpicker-btn-large"><i class="material-icons esgbuilder-cpicker-hover">check</i></div></div></div></div><span id="esgbuilder-cpicker-remove-delete" data-text="delete_confirm"></span></div>';function st(){this.innerHTML=ge[ut(this,"data-text")]}function lt(){this.setAttribute("placeholder",ge[ut(this,"data-placeholder")])}function ct(){this.setAttribute("data-message",ge[ut(this,"data-alert")])}function ut(e,t){return e.getAttribute(t)||""}function dt(t){t||(t={}),"string"==typeof t&&(t=JSON.parse(t.replace(/\&/g,'"'))),ge=e.extend({},it,t),q=ge.color,b.find("*[data-placeholder]").each(lt),b.find("*[data-alert]").each(ct),b.find("*[data-text]").each(st)}function pt(t,r,i,n){var o,a,s,l,c;if(e.isPlainObject(t))for(var u in t)t.hasOwnProperty(u)&&("string"==typeof(t=t[u])?"gradient"===(t=ESGColor.process(t))[1]?(l=(a=t[2]).angle,c=a.type,t=ESGColor.processGradient(e.extend(!0,{},a),!0)):t=t[0]:(l=t.angle,c=t.type),o=isNaN(u)?u.replace(/_/g," ").replace(/\b\w/g,function(e){return e.toUpperCase()}):"radial"!==c?l+"&deg;":"radial");else o=t;if("blank"!==t){e.isPlainObject(t)&&(a=t,"",t=n||ESGColor.processGradient(e.extend(!0,{},t),!0));var d='<span class="esgbuilder-cpicker-color tptip'+i+'" data-title="'+o+'" data-color="'+t+'"><span class="esgbuilder-cpicker-preset-tile"></span><span class="esgbuilder-cpicker-preset-bg" style="background: '+t+'"></span>';return r||(d+='<span class="esgbuilder-cpicker-delete"><i class="material-icons">clear</i></span>'),s=e(d+="</span>"),a&&s.data("gradient",a),s[0]}return(s=document.createElement("span")).className="esgbuilder-cpicker-color blank",s}function ht(){var t=ut(this,"data-color").toLowerCase(),r=!De&&t===Ae.toLowerCase();if(t===be||r){var i=e(this);return i.closest(".esgbuilder-cpicker-presets-group").find(".esgbuilder-cpicker-color.selected").removeClass("selected"),He=i,De&&!Y&&mt(He.data("gradient"),!0),i.addClass("selected"),!1}}function ft(e,t){for(var r=document.createDocumentFragment(),i=-1!==e.search("core"),n=i?"":" esgbuilder-picker-color-custom",o=t.length,a=Math.max(Math.ceil(o/Xe),Ye),s=0;s<a;s++)for(;t.length<(s+1)*Xe;)t[t.length]="blank";for(o=t.length,s=0;s<o;s++)r.appendChild(pt(t[s],i,n));return["esgbuilder-cpicker-"+e,r]}function gt(e,t,r){if(Oe){if(!e){var i=t||T.val(),n=void 0!==r?r:Te.val();t="transparent"===i?"transparent":"100%"===n?ESGColor.sanitizeHex(i):ESGColor.processRgba(i,n)}var o="transparent"===t,a=o?"":t;e?k.data("state",t):G.data("state",t),o?(Oe.css("background",a),Ee.css("background",a)):(Oe[0].style.background=a,Ee.css("background",a)),c&&c(Le,t,ye,ke),ESG.DOC.trigger("revcolorpickerupdate",[Le,t])}}function mt(r,i){var o=ESGColor.process(r),a=o[1],l=o[0];if(n&&w.removeClass("checked"),"gradient"!==a&&"gradient_css"!==a){switch(a){case"hex":r=ESGColor.sanitizeHex(l),Te.val("100%"),Ht(100);break;case"rgba":var c=ESGColor.rgbaToHex(l),u=parseInt(100*c[1],10);r=c[0],Te.val(u+"%"),Ht(u);break;case"rgb":r=ESGColor.rgbToHex(l),Te.val("100%"),Ht(100);break;default:ne.click(),G.click()}B.val(r).change(),i||G.click()}else n?("gradient_css"===a&&(o[2]=JSON.parse(o[2])),function(r){var i=r.angle,n=r.easing?r.easing:"none",o=r.hasOwnProperty("strength")?r.strength:"100";"radial"===r.type&&(i="radial");oe.removeClass("selected"),e('.esgbuilder-cpicker-orientation[data-direction="'+i+'"]').addClass("selected"),jt(n),s.val(n).trigger("change.select2ESG"),L.val(o+"%"),t.val(St(i)),jt(),Dt(i),function(e){for(var t,r,i=document.createDocumentFragment(),n=e.length,o=0;o<n;o++)r=e[o],t=r.align,i.appendChild(xt(t,r.position,wt(r),yt(r,t)));de&&de.draggable("destroy");pe.empty().append(i),de=pe.children().draggable(rt)}(r.colors)}(o[2]),Gt(),i||(ce=!0,k.click())):(B.val(ESGColor.defaultValue).change(),G.click());return[l,a]}function vt(t,r){var i=function(e,t){var r,i=o.slice(),n=i.length;for(i.sort(ESGColor.sortPoints);n--;)if((r=i[n]).align===e&&r.x<t)return r;n=i.length;for(var a=0;a<n;a++)if((r=i[a]).align===e&&r.x>t)return r}(t,r).color,n=yt(i,t,!0),a=xt(t,r,wt(i,!0),n);_&&_.removeClass("active"),_=e(a).addClass("active").appendTo(pe).draggable(rt),F=_.children(".esgbuilder-cpicker-point-square")[0],j=_.children(".esgbuilder-cpicker-point-triangle")[0],de=pe.children();var s=bt(r);Gt(a),"bottom"===t&&A.val(s[1]).change()}function bt(e){void 0===e&&(e=o[ae].x);var t=_.attr("data-color"),r=_.hasClass("esgbuilder-cpicker-point-bottom");if(r)he.hasClass("active")&&he.removeClass("active"),t=ESGColor.rgbaToHex(t)[0],Be.css("background",t),b.find(".esgbuilder-cpicker-point-bottom").length>2&&he.addClass("active"),ue.parent().addClass("disabled"),b.addClass("open");else{he.hasClass("active")&&(Be.css("background",""),he.removeClass("active"));var i=ESGColor.getOpacity(t);ue.attr("data-opacity",i).val(i).parent().removeClass("disabled"),b.find(".esgbuilder-cpicker-point-top").length>2&&he.addClass("active"),b.removeClass("open")}return M.val(e+"%").parent().removeClass("disabled"),[r,t]}function yt(e,t,r){return"bottom"===t?"rgb("+e.r+","+e.g+","+e.b+")":"rgba(0, 0, 0, "+(r?"1":e.a)+")"}function wt(e,t){var r=t?"1":e.a;return"rgba("+e.r+","+e.g+","+e.b+","+r+")"}function kt(e,t){var r=ESGColor.hexToRGB(e);t?(x.val(e),g.value=r[0],m.value=r[1],v.value=r[2]):(T.val(e),p.value=r[0],h.value=r[1],f.value=r[2],"0%"===Te[0].value&&Te.val("100%").trigger("focusout")),T.esgColorPicker("refresh")}function xt(t,r,i,n){var o=document.createElement("span");return o.className="esgbuilder-cpicker-point esgbuilder-cpicker-point-"+t,"string"==typeof i?o.setAttribute("data-color",i):e(o).data("gradient",i),o.setAttribute("data-location",r),o.style.left=r+"%",o.innerHTML="bottom"===t?'<span class="esgbuilder-cpicker-point-triangle" style="border-bottom-color: '+n+'"></span><span class="esgbuilder-cpicker-point-square" style="background: '+n+'"></span>':'<span class="esgbuilder-cpicker-point-square" style="background: '+n+'"></span><span class="esgbuilder-cpicker-point-triangle" style="border-top-color: '+n+'"></span>',o}function St(e){return W||(W=document.createElement("textarea")),e&&"radial"!==e||(e="0"),W.innerHTML=e+"&deg;",W.value}function Ct(){_&&(_.removeClass("active"),_=!1),M.parent().addClass("disabled"),ue.parent().addClass("disabled"),he.removeClass("active"),he.removeClass("active"),Be.css("background",""),b.removeClass("open")}function Et(e,t){b.removeClass("active is-basic").hide(),i.removeClass("esgbuilder-colorpicker-open"),ze.css({left:"",top:""}),O&&(O.remove(),O=!1),He?(He.hasClass("selected")?(t&&Le.data("hex",He.attr("data-color").toLowerCase()),He.removeClass("selected")):Le.removeData("hex"),He=!1):Le.removeData("hex"),t||(D&&D(Le,le,se,ye,ke),Me&&"transparent"!==Me?(Oe[0].style.background=Me,Ee.css("background",Me)):(Oe.css("background",""),Ee.css("background","")),ESG.DOC.trigger("revcolorpickercancel",[Le,le,se])),l=null,a=null,p=null,h=null,f=null,g=null,m=null,v=null,x=null,N=null,T=null,Z=null,R=null,X=null,Q=null,J=null,U=null,W=null,ie=null,re=null,pe=null,Ee=null,Te=null,Oe=null,Le=null}function Lt(t){var r=e.extend(!0,{},qe);return ESGColor.processGradient(r,!0,t)}function Gt(r,i,n,l){V=i,Ot(),V=!1;for(var c,u,d,p,h=[],f=o.length,g=0;g<f;g++)u=(d=o[g]).color,h[g]=u,(c=d.el).setAttribute("data-color",ESGColor.rgbaString(u.r,u.g,u.b,u.a)),c.setAttribute("data-opacity",100*u.a),r&&r===c&&(ae=g);a.hasClass("selected")?(qe.type="radial",qe.angle="0"):(qe.type="linear",qe.angle=parseInt(t.val(),10).toString()),qe.colors=h,qe.easing=s.val(),qe.strength=parseInt(L.val(),10),He&&!Ie&&He.removeClass("selected"),l||(p=e.extend(!0,{},qe),gt(!0,ESGColor.processGradient(p,!0))),n||(X||(X=document.getElementById("esgbuilder-cpicker-direction-horizontal")),Q||(Q=document.getElementById("esgbuilder-cpicker-direction-vertical")),J||(J=document.getElementById("esgbuilder-cpicker-direction-radial")),U||(U=document.getElementById("esgbuilder-cpicker-gradient-input")),p=Lt(!0),U.style.background=function(e,t){var r;-1===e.search("deg")&&(r=(e=e.split("("))[0],e.shift(),e=r+"(180deg, "+e.join("(")),r=(e=e.split("("))[0],e.shift();var i=e.join("(").split(",");return i.shift(),r+"("+(t=void 0!==t?t+"deg,":"ellipse at center,")+i.join(",")}(p.replace("radial-","linear-").replace("ellipse at center,",""),"90"),"none"!==qe.easing&&(p=Lt()),ie.style.background=p,qe.type="linear",qe.angle="90",X.style.background=Lt(),qe.angle="180",Q.style.background=Lt(),qe.type="radial",qe.angle="0",J.style.background=Lt())}function Tt(e,t){if(0===e)return!1;for(var r;e--;)if((r=o[e]).align!==t)return r;return!1}function Mt(e,t,r){if(e===r)return!1;for(var i;e++<r;)if((i=o[e]).align!==t)return i;return!1}function At(e,t,r){var i,n=t.alpha,o=r.alpha;i=n!==o?ESGColor.distAlpha(e.x,t.x,r.x,n,o).toFixed(2):n,i=ESGColor.sanitizeAlpha(i),e.alpha=i,e.color.a=i}function _t(e,t,r){var i=e.color,n=t.color,o=r.color;if(t!==r){var a=e.x,s=t.x,l=r.x;i.r=ESGColor.distColor(a,s,l,n.r,o.r),i.g=ESGColor.distColor(a,s,l,n.g,o.g),i.b=ESGColor.distColor(a,s,l,n.b,o.b)}else i.r=n.r,i.g=n.g,i.b=n.b}function Ot(){o=[],z=[],H=[],de.each(Nt),o.sort(ESGColor.sortPoints);for(var e,t,r,i,n=o.length,a=n-1,s=0;s<n;s++)!1===(t=Tt(s,r=(e=o[s]).align))&&(t=Mt(s,r,a)),!1===(i=Mt(s,r,a))&&(i=Tt(s,r)),"bottom"===r?At(e,t,i):_t(e,t,i);o.sort(ESGColor.sortPoints)}function Nt(e){var t=ESGColor.rgbValues(ut(this,"data-color"),4),r=-1!==this.className.search("bottom")?"bottom":"top",i=t[3].replace(/\.?0*$/,"")||0,n=this.style.left;-1!==n.search("px")?(n=parseInt(n,10),n=parseInt(100*(Math.round(n)/(Ue-2)).toFixed(2),10)):n=parseInt(n,10),V&&(n<50?n+=2*(50-n):n-=2*(n-50)),this.style.left=n+"%",this.setAttribute("data-location",n),i=ESGColor.sanitizeAlpha(i),o[e]={el:this,x:n,alpha:i,align:r,color:{r:parseInt(t[0],10),g:parseInt(t[1],10),b:parseInt(t[2],10),a:i,position:n,align:r}},_&&_[0]!==this&&("bottom"===r?H[H.length]=n:z[z.length]=n)}function Dt(e){re||(re=document.getElementById("esgbuilder-cpicker-wheel-point")),e=void 0!==e?e:parseInt(t.val(),10),re.style.transform="rotate("+e+"deg)"}function It(r,i,n){var o,a,s=void 0!==n,l=s?n:parseInt(t.val(),10);if(r&&"keyup"===r.type)o=!isNaN(l)&&l>=-360&&l<=360,a=l;else{var c=parseInt(t.data("orig-value"),10);l||(l="0"),(isNaN(l)||l<-360||l>360)&&(l=a=c,t.val(St(l)),o=!0),l!==c&&(a=l,o=!0,t.val(St(l)),s||(l=i||l,oe.removeClass("selected"),e('.esgbuilder-cpicker-orientation[data-direction="'+l+'"]').addClass("selected")))}(o||i)&&(a&&Dt(a),Gt())}function $t(e,t){var r=parseInt(100*(Math.round(t.position.left)/(Ue-2)).toFixed(2),10);M.val(r+"%").trigger("keyup")}function Pt(){var t=e(this);t.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t.click()}function zt(){M.trigger("focusout")}function Ht(e){We=!0,Re.slider("value",Math.round(.01*e*Je)),We=!1}function Rt(e){var t=te.offset(),r=e.pageX-t.left,i=e.pageY-t.top;if(!isNaN(r)&&!isNaN(i)){var n=Math.atan2(i-Ke,r-Ke)*(180/Math.PI)+90;n<0&&(n+=360),n=Math.max(0,Math.min(360,Math.round(n))),n=5*Math.round(n/5),!0,It(!1,!1,n),!1}}function Wt(e){e.stopImmediatePropagation()}function Ft(t){t||(t=Ge),t.each(function(){var t=e(this).find(".esgbuilder-cpicker-color").css("margin-bottom",0),r=t.length;t.each(function(e){e<r-4&&(this.style.marginBottom=et+"px")})}).ESGScroll("update")}function jt(t){Z||(Z=e("#revpicker-easing-row")),t||(t=s.val()),Z["none"===t?"removeClass":"addClass"]("active")}function Bt(){y||function(){i||(i=e("body"),b=e('<div class="esgbuilder-cpicker-wrap _TPRB_ color-view palette-open">'+at+"</div>").appendTo(i));Se.core&&(Se.core.colors&&(nt=Se.core.colors),Se.core.gradients&&(ot=Se.core.gradients));Ut(Se),dt(Se.language||it),y=!0}(),Be=e("#esgbuilder-cpicker-preview-gradient"),he=e("#esgbuilder-cpicker-color-delete"),ue=e("#esgbuilder-cpicker-grad-opacity"),M=e("#esgbuilder-cpicker-color-location"),oe=e(".esgbuilder-cpicker-orientation"),A=e("#esgbuilder-cpicker-iris-gradient"),B=e("#esgbuilder-cpicker-iris-color"),k=e("#esgbuilder-cpicker-gradient-btn"),ne=e("#esgbuilder-cpciker-clear-hex"),w=e("#esgbuilder-cpicker-meta-reverse"),Re=e("#esgbuilder-cpicker-scroll"),G=e("#esgbuilder-cpicker-color-btn"),L=e("#esgbuilder-cpicker-strength"),t=e("#esgbuilder-cpicker-meta-angle"),te=e("#esgbuilder-cpicker-wheel"),ze=e("#esgbuilder-cpicker"),s=e("#esgbuilder-cpicker-easing"),rt.drag=$t,rt.stop=zt,rt.start=Pt,G.data("state",e("#esgbuilder-cpicker-colors").find(".esgbuilder-cpicker-color").eq(0).attr("data-color")||"#ffffff"),k.data("state",e("#esgbuilder-cpicker-gradients").find(".esgbuilder-cpicker-color").eq(0).attr("data-color")||"linear-gradient(0deg, rgba(255, 255, 255, 1) 0%, rgba(0, 0, 0, 1) 100%)"),ze.draggable({containment:"window",handle:".esgbuilder-cpicker-draggable",stop:function(){ze.css("height","auto")}}),Ge=e(".esgbuilder-cpicker-presets-group").ESGScroll({wheelPropagation:!1,suppressScrollX:!0}),te.on("mousedown.esgcpicker",function(e){oe.removeClass("selected"),K=!0,Rt(e)}).on("mousemove.esgcpicker",function(e){K&&Rt(e)}).on("mouseleave.esgcpicker mouseup.esgcpicker",function(){K=!1}),e(".esgbuilder-cpicker-main-btn").on("click.esgcpicker",function(){var t;if(Y=-1===this.id.search("gradient"),Oe&&(t=e(this).data("state")),Y?(Oe&&(be=T.val()),b.removeClass("gradient-view").addClass("color-view")):(Oe&&(be=t),b.removeClass("color-view").addClass("gradient-view"),ce||(N.children(".esgbuilder-cpicker-color").not(".blank").eq(0).click(),ce=!0)),t){var r="transparent"===t?"":t;Oe.css("background",r),Ee.css("background",r),De=!0,e(".esgbuilder-cpicker-color").not(".blank").each(ht),De=!1,ESG.DOC.trigger("revcolorpickerupdate",[Le,t])}Y||(Ie=!0,e(".esgbuilder-cpicker-point-bottom").first().click(),Ie=!1)}),e("#esgbuilder-cpicker-palette").on("click",function(){b.hasClass("palette-open")?b.removeClass("palette-open"):(b.addClass("palette-open"),Ft())}),e("#esgbuilder-cpicker-check").on("click.revcipicker",function(){var t,r,i,n;if(b.hasClass("color-view")){var o=T.val(),a=Te.val();i="transparent"===o?"transparent":"100%"===a?ESGColor.sanitizeHex(o):ESGColor.processRgba(o,a),t=[Le,i,!1],r=i}else{Ct(),Gt(!1,!1,!0,!0);var s=JSON.stringify(qe).replace(/\"/g,"&");r=ESGColor.processGradient(e.extend(!0,{},qe),!0),t=[Le,r,s]}!0!==(n=t[1]!==Me)&&!0!==fe||(Le.attr("data-color",t[1]),ESG.DOC.trigger("revcolorpickerchanged",t),je&&je(t[0],t[1],t[2],ye,ke)),Et(0,!0===n||!0===fe)}),b.on("click.esgcpicker",function(t){e(t.target).closest("#esgbuilder-cpicker").length||Ct()}),e(".esgbuilder-cpicker-close").on("click.esgcpicker",Et),B.wpColorPicker({palettes:!1,width:190,border:!1,hide:!1,change:function(e,t){var r=t.color.toString();if(this.value=r,kt(r),!Ne){var i=Te.val();0===parseInt(i,10)&&(r="transparent"),gt(!1,r,i),He&&(He.removeClass("selected"),He=!1)}}}),A.wpColorPicker({palettes:!1,height:190,border:!1,hide:!1,change:function(e,t){var r=t.color.toString();this.value=r,kt(r,!0),Be.css("background",r),F.style.backgroundColor=r,j.style.borderBottomColor=r;var i=ESGColor.processRgba(r,100),n=ESGColor.rgbValues(i,4),o=qe.colors[ae];o.r=n[0],o.g=n[1],o.b=n[2],o.a=ESGColor.sanitizeAlpha(n[3]),_&&_.attr("data-color",i),Gt()}}),Re.slider({orientation:"vertical",max:Je,value:Je,start:function(){Pe="transparent"===T.val()},slide:function(e,t){if(!We){var r,i=parseInt(100*(t.value/Je).toFixed(2),10);Pe&&(r=i?"#ffffff":"transparent",T.val(r)),0===i&&(r="transparent"),gt(!1,r,i||"transparent"),Te.val(i+"%")}}}),e("body").on("click.esgcpicker",".esgbuilder-cpicker-point",function(){pe.find(".esgbuilder-cpicker-point.active").removeClass("active"),_=e(this).addClass("active"),F=_.children(".esgbuilder-cpicker-point-square")[0],j=_.children(".esgbuilder-cpicker-point-triangle")[0],Gt(this);var t=bt();t[0]&&A.val(t[1]).change()}).on("mousedown.esgcpicker",".esgbuilder-cpicker-point",function(t){_=e(this).data("mousestart",t.pageY)}).on("mousemove.esgcpicker",function(e){if(_&&_.data("mousestart")){var t=_.data("mousestart"),r=e.pageY;_.hasClass("esgbuilder-cpicker-point-bottom")?r>t&&r-t>Ze&&he.hasClass("active")?_.addClass("warning"):_.removeClass("warning"):t>r&&t-r>Ze&&he.hasClass("active")?_.addClass("warning"):_.removeClass("warning")}}).on("mouseup.esgcpicker",function(e){if(_&&_.data("mousestart")){var t=_.data("mousestart"),r=e.pageY;_.removeData("mousestart"),_.hasClass("esgbuilder-cpicker-point-bottom")?r>t&&r-t>Qe&&he.hasClass("active")?he.click():_.removeClass("warning"):t>r&&t-r>Qe&&he.hasClass("active")?he.click():_.removeClass("warning")}}).on("keypress.esgcpicker",function(e){if(b.hasClass("active")){var t=e.which;27==t?Et():13==t&&S&&S.blur()}}).on("click.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",function(){if(He){if(He[0]===this&&He.hasClass("selected"))return;He.removeClass("selected")}if(He=e(this),b.hasClass("color-view")){var t,r=He.attr("data-color"),i=ESGColor.process(r);"rgba"===i[1]?(r=ESGColor.rgbaToHex(i[0]),t=100*parseFloat(r[1]),Te.val(t+"%").trigger("keyup"),r=r[0]):"transparent"!==i[1]&&"transparent"!==r?Te.val("100%").trigger("keyup"):(Ne=!0,ne.click()),Ne=!0,B.val(r).change(),"transparent"===T.val()&&T.val(r.toLowerCase()),Ne=!1;var n=Te.val();0===parseInt(n,10)&&(r="transparent"),gt(!1,r,n),He.addClass("selected")}else l.removeClass("full"),R.removeClass("full"),mt(He.data("gradient"),!0),w.removeClass("checked"),N.find(".esgbuilder-cpicker-color.selected").removeClass("selected"),e(".esgbuilder-cpicker-point-bottom").first().click(),He.addClass("selected")}).on("mouseover.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",function(){$e&&(ie.style.background=ut(this,"data-color"))}).on("mouseout.esgcpicker",".esgbuilder-cpicker-color:not(.blank)",function(){$e&&Gt()}).on("click.esgcpicker",".esgbuilder-cpicker-delete",function(){if(d){if(window.confirm(document.getElementById("esgbuilder-cpicker-remove-delete").innerHTML)){b.addClass("onajax onajaxdelete");var t=e(this),r=t.parent(),i=r.attr("data-title")||"";if(!i)return void console.log("Preset does not have a name/title");var n=-1!==t.closest(".esgbuilder-cpicker-presets-group")[0].id.search("colors")?"colors":"gradients";ESG.DOC.off("esgcpicker_onajax_delete.esgcpicker").on("esgcpicker_onajax_delete.esgcpicker",function(i,n){n&&console.log(n);var o=t.closest(".esgbuilder-cpicker-presets-group"),a=o.find(".rs__scrollbar-x-rail");r.remove(),e('<span id="hello" class="esgbuilder-cpicker-color blank"></span>').insertBefore(a),Ft(o),b.removeClass("onajax onajaxdelete")}),i=e.trim(i.replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase(),d("delete",i,n,"esgcpicker_onajax_delete",Le)}return!1}console.log("Ajax callback not defined")}),e(".esgbuilder-cpicker-save-preset-btn").on("click.esgcpicker",function(){if(d){var t,r,i=e(this),n=i.closest(".esgbuilder-cpicker-presets").find(".esgbuilder-cpicker-preset-save").val();if(n&&isNaN(n)){if(t=b.hasClass("color-view")?"colors":"gradients",n=e.trim(n.replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase(),e("#esgbuilder-cpicker-"+t+"-custom").find(".esgbuilder-cpicker-color").not(".blank").each(function(){if(e.trim(ut(this,"data-title").replace(/\W+/g,"_")).replace(/^\_|\_$/g,"").toLowerCase()===n)return alert(i.attr("data-message")),r=!0,!1}),!r){b.addClass("onajax onajaxsave");var o,a,s={};if("colors"===t){var l=T.val(),c=Te.val();o="transparent"===l?"transparent":"100%"===c?ESGColor.sanitizeHex(l):ESGColor.processRgba(l,c)}else a=ie.style.background,Gt(!1,!1,!0),o=e.extend({},qe);s[n]=o,ESG.DOC.off("esgcpicker_onajax_save.esgcpicker").on("esgcpicker_onajax_save.esgcpicker",function(r,n){if(n)return b.removeClass("onajax onajaxsave"),void alert(i.attr("data-message"));var o=e(pt(s,!1," esgbuilder-picker-color-custom",a)),l=e("#esgbuilder-cpicker-"+t+"-custom"),c=l.find(".rs__scrollbar-x-rail"),u=l.find(".esgbuilder-cpicker-color.blank");if(u.length)u=u.eq(0),o.insertBefore(u),u.remove();else{o.insertBefore(c);for(var d=l.children(".esgbuilder-cpicker-color").length,p=Math.max(Math.ceil(d/Xe),Ye)*Xe;d++<p;)e('<span class="esgbuilder-cpicker-color blank"></span>').insertBefore(c)}e("#esgbuilder-cpicker-preset-"+t).val("custom").trigger("change"),Ft(l),o.click(),e(".esgbuilder-cpicker-preset-save").val(""),b.removeClass("onajax onajaxsave")}),d("save",s,t,"esgcpicker_onajax_save",Le)}}else alert(i.attr("data-message"))}else console.log("Ajax callback not defined")}),ne.on("click.esgcpicker",function(){Ht(0),B.val(ESGColor.defaultValue).change(),T.val("transparent"),gt(!1,"transparent"),clearTimeout(Ce),Ce=setTimeout(qt,100)}),b.find('input[type="text"]').on("focusin.esgcpicker",function(){S=this}).on("focusout.esgcpicker",function(){S=!1}),e(".esgbuilder-cpicker-input").on("focusin.esgcpicker",function(){var t=e(this);t.data("orig-value",t.val()).parent().addClass("focus")}).on("focusout.esgcpicker",function(){e(this).parent().removeClass("focus")}),e(".esgbuilder-cpicker-rgb").on("focusin.esgcpicker",function(){e(this).data("prev",this.value)}).on("focusout.esgcpicker keyup.esgcpicker",function(){var t=this.value;isNaN(t)||t<0||t>255?this.value=e(this).data("prev"):b.hasClass("color-view")?T.val(ESGColor.rgbToHex("rgb("+p.value+","+h.value+","+f.value+")")).trigger("focusout"):x.val(ESGColor.rgbToHex("rgb("+g.value+","+m.value+","+v.value+")")).trigger("focusout")}),e(".esgbuilder-cpicker-hex").on("focusout.esgcpicker",function(){var t,r;if("esgbuilder-cpicker-color-hex"===this.id){if(!(r=T.val()))return void ne.click();if(r=ESGColor.sanitizeHex(r),ESGColor.isColor.test(r))kt(r);else{if(!(t=e(this).data("orig-value")))return void ne.click();if("transparent"===(r=t))return void ne.click();kt(r)}B.val(r).change()}else r=x.val()||ESGColor.defaultValue,r=ESGColor.sanitizeHex(r),ESGColor.isColor.test(r)||(r=(t=e(this).data("orig-value"))||ESGColor.defaultValue),x.val(r),A.val(r).change()}).on("focusin.esgcpicker",Wt),M.on("keyup.esgcpicker focusout.esgcpicker",function(e){if(_){var t,r="bottom"===(_.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top")?H:z,i=M.val().replace("%","")||"0",n=e.type;for(isNaN(i)&&(i="keyup"===n?"0":_.attr("data-location")),t=(i=Math.max(0,Math.min(100,parseInt(i,10))))<50?1:-1;-1!==r.indexOf(i);)i+=t;"focusout"===n&&(M.val(i+"%"),_.attr("data-location",i)),_.css("left",i+"%"),Gt()}}).on("focusin.esgcpicker",Wt),e("#esgbuilder-cpciker-clear-gradient").on("click.esgcpicker",function(){A.val(ESGColor.defaultValue).change()}),t.on("keyup.esgcpicker focusout.esgcpicker",It).on("focusin.esgcpicker",Wt),oe.on("click.esgcpicker",function(){var r=e(this),i=r.attr("data-direction");oe.removeClass("selected"),r.addClass("selected"),"radial"!==i?t.val(St(i)):t.val(0),It(!1,i)}),e(".esgbuilder-cpicker-point-delete").on("click.esgcpicker",function(){if(-1!==this.className.search("active")){var e=_.hasClass("esgbuilder-cpicker-point-bottom")?"bottom":"top",t=b.find(".esgbuilder-cpicker-point-"+e).length;t>2&&(_.draggable("destroy").remove(),de=pe.children(),b.click(),Gt()),t<=Ve&&("bottom"===e?R.removeClass("full"):l.removeClass("full"))}}),e(".esgbuilder-cpicker-preset-save").on("focusin.esgcpicker",Wt),e(".esgbuilder-cpicker-opacity-input").on("keyup.esgcpicker focusout.esgcpicker",function(t){var r,i=-1===this.id.search("grad"),n=i?Te:ue,o=n.val().replace("%",""),a=t.type;if(isNaN(o)&&(o="keyup"===a?"0":e(this).data("orig-value").replace("%","")),o=Math.max(0,Math.min(100,o)),"focusout"===a&&(n.val(o+"%"),i||_.attr("data-opacity",o)),i){gt(!1,0===parseInt(o,10)&&"transparent",o),Ht(o)}else{var s=ESGColor.rgbValues(_.attr("data-color"),3),l=qe.colors[ae];o=ESGColor.sanitizeAlpha(.01*parseInt(o,10)),l.r=s[0],l.g=s[1],l.b=s[2],l.a=o,r=ESGColor.rgbaString(l.r,l.g,l.b,o),_.attr("data-color",r),Gt(),r="rgba(0, 0, 0, "+o+")",F.style.backgroundColor=r,j.style.borderTopColor=r}}).on("focusin.esgcpicker",Wt),e(".esgbuilder-cpicker-builder-hit").on("click.esgcpicker",function(e){o||Ot();for(var t=parseInt(100*((e.pageX-l.offset().left)/Ue).toFixed(2),10),r=-1!==this.id.search("bottom")?"bottom":"top",i="bottom"===r?H:z,n=t<50?1:-1;-1!==i.indexOf(t);)t+=n;"bottom"===r?b.find(".esgbuilder-cpicker-point-bottom").length<Ve?(vt(r,t),He=!1):R.addClass("full"):b.find(".esgbuilder-cpicker-point-top").length<Ve?(vt(r,t),He=!1):l.addClass("full")}),w.on("click.esgcpicker",function(){!w.hasClass("checked")?w.addClass("checked"):w.removeClass("checked"),Gt(!1,!0)}),s.on("change.esgcpicker",function(){Gt(),jt(this.value)}),L.on("keyup.esgcpicker focusout.esgcpicker",function(e){var t=L.val().replace("%",""),r=e.type;isNaN(t)&&(t="keyup"===r?"0":L.data("orig-value").replace("%","")),t=Math.max(10,Math.min(1e3,t)),"focusout"===r&&L.val(t+"%"),Gt()}).on("focusin.esgcpicker",Wt);var n=e(".esgbuilder-cpicker-preset-selector").on("change.esgcpicker",function(){var e=this.value,t="core"===e?"custom":"core",r=-1!==this.id.search("colors")?"colors":"gradients";document.getElementById("esgbuilder-cpicker-"+r+"-"+t).style.display="none",document.getElementById("esgbuilder-cpicker-"+r+"-"+e).style.display="block",Ft()});e.fn.select2ESG&&(n.select2ESG({minimumResultsForSearch:-1}),s.select2ESG({minimumResultsForSearch:-1})),r=!0}function qt(){Te.val("0%")}function Ut(t){var r,i,n,o,a,s=e.extend({},t),l=s.core||{},c=s.custom;!me||c?(o=4,c=(me=c)||{colors:[],gradients:[]}):o=2,l.colors||(l.colors=nt),l.gradients||(l.gradients=ot);for(var u=0;u<o;u++){switch(u){case 0:r="colors-core",n=l.colors;break;case 1:r="gradients-core",n=l.gradients;break;case 2:r="colors-custom",n=c.colors;break;case 3:r="gradients-custom",n=c.gradients}i=ft(r,n.slice()||[]),(a=e("#"+i[0])).find(".esgbuilder-cpicker-color").remove(),a.prepend(i[1])}}function Vt(e,t,r){return jQuery.grep(e,function(e){return e[r]!=t[r]})}function Kt(e,t,r){var i=-1;for(var n in t)void 0!==t[n][r]&&t[n][r]===e[r]&&(i=n);return i}function Yt(e){return e.id?jQuery('<span><span class="skin_mini_color" style="background:'+ye[e.element.value].v+'"></span>'+e.text+"</span>"):e.text}function Xt(e){for(var t in void 0!==ye[e]&&mt(ye[e].v,!1),xe)for(var r in ye)ye.hasOwnProperty(r)&&(r!==e&&void 0!==ye[r].ref&&0!==ye[r].ref.length&&(ye[r].ref=Vt(ye[r].ref,xe[t],"r")),r===e&&(ye[r].ref=void 0===ye[r].ref?[]:ye[r].ref,-1==Kt(xe[t],ye[r].ref,"r")&&ye[r].ref.push(xe[t])))}e.esgColorPickerApi={setValue:function(e,t){mt(e,t)},setGlobalColors:function(e){ye=jQuery.extend(!0,{},e)},setGlobalCandidates:function(e){xe=e},getGlobalColors:function(){return ye},closeColorPicker:function(){Et()},showGlobal:function(e,t,r){ye=jQuery.extend(!0,{},t),xe=r,we=e.mode;var i,n;e.currentInput[0].dataset;for(var o in currentEditing=document.getElementById("esgbuilder-cpicker-current-edit"),editTitle=document.getElementById("esgbuilder-cpicker-edit-title"),widgetId=Le.attr("data-widget-id"),html=Le.attr("data-appended-html"),editing=Le.attr("data-editing"),i='<div id="esgbuilder-cpicker-globals"><div id="esgbuilder-cpicker-gactive">'+eg_lang.globalcoloractive+"</div>",i+='<input id="enadisaGlobalSkin" type="checkbox">',i+='<div id="inp_SkinPicker">',i+='<div style="margin-left:25px;margin-right:20px;" class="esgbuilder-cpicker-input-wrap"><select id="gc_skinPicker">',ye)ye.hasOwnProperty(o)&&(i+='<option value="'+o+'" '+(ye[o].v.indexOf("gradient")>=0&&("single"===e.mode||"basic"===e.mode)?' disabled="true" ':"")+">"+ye[o].alias+"</option>");i+="</select></div>",i+='<div id="edit_skin_colors" class="basic_action_button layerinput autosize"><i class="material-icons">color_lens</i>'+eg_lang.editskins+"</div></div>",i+="</div>",b.find("#esgbuilder-cpicker").append(i=jQuery(i)),n=i.find("#gc_skinPicker");var a=function(){var e=[];for(var t in xe)for(var r in e[t]=-1,ye)ye.hasOwnProperty(r)&&void 0!==ye[r].ref&&0!==ye[r].ref.length&&-1===e[t]&&(e[t]=-1!==Kt(xe[t],ye[r].ref,"r")?r:-1);var i=-1;for(var r in e)i=-1===i&&-1!==e[r]?e[r]:-1!==e[r]&&-1!==i[r]?-999:i;return i}();-1===a||-999===a?(ke=!1,document.getElementById("inp_SkinPicker").style.display="none",jQuery("#enadisaGlobalSkin")[0].checked=!1):(ke=a,n[0].value=a,document.getElementById("inp_SkinPicker").style.display="inline-block",jQuery("#enadisaGlobalSkin")[0].checked=!0,currentEditing.innerHTML=ye[a].alias+" Skin"),void 0!==ESG&&void 0!==ESG.F&&void 0!==ESG.F.initOnOff&&(ESG.F.initOnOff(i),ESG.F.turnOnOff(i,!1)),n.select2ESG({tags:!1,templateResult:Yt,minimumResultsForSearch:"Infinity"}),jQuery("#enadisaGlobalSkin").on("change",function(){fe=!0,!0===this.checked?(document.getElementById("inp_SkinPicker").style.display="inline-block",n.trigger("change.select2")):(ke=!1,Xt(-1),document.getElementById("inp_SkinPicker").style.display="none",mt(Me,!1),currentEditing.innerHTML=editing)}),n.on("change.select2",function(){fe=!0,ye=jQuery.extend(!0,{},t),-1!==ke&&-999!==ke&&void 0!==t[ke]&&mt(t[ke].v,!1),ke=this.value,Xt(this.value),function(e,t){var r="single"===t||"basic"===t;if(!r)for(var i in ye[e].ref)ye[e].ref.hasOwnProperty(i)&&(r=!0===r||ESG.F.noGradient(ye[e].ref[i].r));r?jQuery("#esgbuilder-cpicker-gradient-btn").hide():jQuery("#esgbuilder-cpicker-gradient-btn").show()}(this.value,we),currentEditing.innerHTML=ye[this.value].alias+" Skin"})},hideGlobal:function(){jQuery("#esgbuilder-cpicker-globals").remove(),ye=void 0,ke=void 0}},e.esgColorPicker=function(t){Se=e.extend(!0,Se||{},t),t.mode&&(tt=t.mode),t.init&&(u=t.init),t.onAjax&&(E=t.onAjax),t.onEdit&&(C=t.onEdit),t.change&&(P=t.change),t.cancel&&($=t.cancel),t.title&&(I=t.title),t.language&&t.language,t.widgetId&&(ve=t.widgetId),t.defaultValue&&(ESGColor.defaultValue=t.defaultValue),t.wrapClasses&&(Fe=t.wrapClasses),t.appendedHtml&&(_e=t.appendedHtml),t.onRefresh&&(ee=t.defRefresh),y&&(Ft(),t.language&&dt(t.language))};var Qt={refresh:function(){var t=e(this),r=[t];if(t.hasClass("esgbuilder-cpicker-component")){var i=t.data("revcp")||{},n=t.val()||i.defaultValue||ESGColor.defaultValue,o=i.onRefresh||ee,a=ESGColor.process(n);n=a[0],a="rgba"===a[1]&&ESGColor.transparentRgba(n,!0)?"":n,"transparent"!==n?(t.data("tpcp")[0].style.background=a,Ee&&Ee.css("background",a)):(t.data("tpcp").css("background",""),Ee&&Ee.css("background","")),t.attr("data-color",n).data("hex",n),r[1]=n,o&&o(r[0],n)}else r[1]=!1,r[2]="Color Picker not inited for this input field yet";ESG.DOC.trigger("revcolorpickerrefresh",r)},destroy:function(){e(this).removeData().closest(".esgbuilder-cpicker-master-wrap").removeData().remove()}};function Zt(){void 0!==ESG.LIB.COLOR_PRESETS&&ESG.LIB.COLOR_PRESETS||(ESG.LIB.COLOR_PRESETS={colors:[],gradients:[]}),ESG.LIB.COLOR_PRESETS.colors||(ESG.LIB.COLOR_PRESETS.colors=[]),ESG.LIB.COLOR_PRESETS.gradients||(ESG.LIB.COLOR_PRESETS.gradients=[]),e.esgColorPicker({custom:ESG.LIB.COLOR_PRESETS,onAjax:function(e,t,r,i,n){var o=!1,a=ESG.LIB.COLOR_PRESETS[r];switch(e){case"save":a[a.length]=t,o=!0;break;case"delete":var s=a.length;e:for(var l=0;l<s;l++)for(var c in a[l])if(c===t){a.splice(l,1),o=!0;break e}}o&&"undefined"!=typeof ESG&&void 0!==ESG.F&&ESG.F.ajaxRequest("save_color_preset",{presets:jQuery.extend(!0,{},ESG.LIB.COLOR_PRESETS)},function(e){var t=e.error||!1;ESG.DOC.trigger(i,[t]);try{jQuery.rsColorPicker&&jQuery.rsColorPicker({custom:ESG.LIB.COLOR_PRESETS})}catch(t){}AdminEssentials.showWaitAMinute({fadeOut:300})})}})}e.fn.esgColorPicker=function(t){return t&&"string"==typeof t?this.each(Qt[t]):this.each(function(){var r=e(this);if(r.hasClass("esgbuilder-cpicker-component"))r.esgColorPicker("refresh");else{var i,n,o=e('<span class="esgbuilder-colorpicker"></span>').data("revcolorinput",r),a=e('<span class="esgbuilder-colorbox" />'),s=e('<span class="esgbuilder-colorbtn" />'),l=r.attr("data-wrap-classes"),c=r.attr("data-wrapper"),d=r.attr("data-wrap-id"),p=r.attr("data-title"),h=r.val(),f=1==r.data("visible")?"visible-cp-input":"";if(o.insertBefore(r).append([a,s,r]),t&&e.isPlainObject(t)){c||(c=t.wrapper),l||(l=t.wrapClasses),d||(d=t.wrapId),p||(p=t.title),n=t.defaultValue;var g=r.data("revcp");g&&(t=e.extend({},g,t)),r.data("revcp",t)}l||(l=Fe),l&&o.addClass(l),d&&o.attr("id",d),h||(h=n||ESGColor.defaultValue,r.val(h)),h=(i=ESGColor.process(h))[0],"transparent"!==(i="rgba"===i[1]&&ESGColor.transparentRgba(h,!0)?"":h)&&(a[0].style.background=i),s[0].innerHTML=p||I||q||it.color,r.attr("data-color",h).data("tpcp",a).addClass("esgbuilder-cpicker-component"),c?(c=e(c).addClass("esgbuilder-cpicker-master-wrap").addClass(f),o.wrap(c)):o.addClass("esgbuilder-cpicker-master-wrap").addClass(f);var m=!!t&&(t.init||u),v=Se?e.extend(!0,Se,t||{}):t||!1;m&&m(o,r,h,v),ESG.DOC.trigger("revcolorpickerinit",[o,r,h,v])}})},e(function(){e("body").on("click.esgcpicker",".esgbuilder-colorpicker",function(){r||Bt(),ie=document.getElementById("esgbuilder-cpicker-gradient-output"),g=document.getElementById("esgbuilder-cpicker-r2"),m=document.getElementById("esgbuilder-cpicker-g2"),v=document.getElementById("esgbuilder-cpicker-b2"),p=document.getElementById("esgbuilder-cpicker-r"),h=document.getElementById("esgbuilder-cpicker-g"),f=document.getElementById("esgbuilder-cpicker-b"),pe=e("#esgbuilder-cpciker-point-container"),Ee=e("#esgbuilder-cpicker-preview-color"),Te=e("#esgbuilder-cpicker-color-opacity"),a=e("#esgbuilder-cpicker-orientation-radial"),N=e("#esgbuilder-cpicker-gradients-core"),x=e("#esgbuilder-cpicker-gradient-hex"),R=e("#esgbuilder-cpicker-hit-bottom"),T=e("#esgbuilder-cpicker-color-hex"),l=e("#esgbuilder-cpicker-hit-top"),Le=e(this).data("revcolorinput");var t,o,s,u,y,w,S,L,M,A,_,I,z,H=document.getElementById("esgbuilder-cpicker-current-edit"),W=document.getElementById("esgbuilder-cpicker-edit-title"),F=Le.attr("data-widget-id"),j=Le.attr("data-appended-html"),B=Le.attr("data-editing"),q=Le.attr("data-colors"),U=Le.attr("data-mode"),V=Le.data("revcp"),K=Le.attr("data-lang");if(q&&((q=JSON.parse(q.replace(/\&/g,'"'))).colors&&(w=q.colors),q.gradients&&(u=q.gradients)),V){var Y=V.colors;Y&&(Y.core&&(s=Y.core.colors,t=Y.core.gradients),Y.custom&&(y=Y.custom.colors,o=Y.custom.gradients)),_=V.onEdit,I=V.onAjax,L=V.change,M=V.cancel,K||(K=V.lang),U||(U=V.mode),j||(j=V.appendedHtml),B||(B=V.editing),F||(F=V.widgetId)}(t||s||o||y||u||w)&&(S={},(t||s||u||w)&&(S.core={colors:w||s||nt,gradients:u||t||ot}),(o||y)&&(S.custom={colors:y||nt,gradients:o||ot}),Ut(S)),F||(F=ve),F&&(b[0].id=F),j||(j=_e),j&&(O=e(j).appendTo(ze)),K&&dt(K),U||(U=tt),B?W.style.visibility="visible":(B="",W.style.visibility="hidden"),H.innerHTML=B,"single"===U||"basic"===U?(n=!1,k.hide(),G.show(),"basic"===U&&b.addClass("is-basic")):(n=!0,k.show(),G.show()),function(e){return"string"==typeof e&&"transparent"!==e.trim()&&-1===e.search(/\[\{/)&&-1!==e.search("-gradient")}(z=Le.val()||ESGColor.defaultValue)&&(z=ESGColor.reverseGradient(z)),z.split("||").length>1&&(z=ESGColor.joinToRgba(z),Le.val(z)),A=mt(z),Me=A[0],le=Me,se=Le.val(),c=_||C,d=I||E,D=M||$,je=L||P,"gradient"!==A[1]?G.data("state",Me):k.data("state",Me),i.addClass("esgbuilder-colorpicker-open"),Oe=Le.data("tpcp"),b.data("esgcpickerinput",Le).addClass("active").show(),Ft(),Ae=Le.attr("data-color");var X=ESGColor.process(z);"rgba"===X[1]?0==(X=ESGColor.rgbValues(X[0],4))[3]?Ee.css("background",""):Ee.css("background",Ae):"transparent"===X[1]?Ee.css("background",""):Ee.css("background",Ae),be=Le.data("hex"),e(".esgbuilder-cpicker-color").not(".blank").each(ht),ze.css({marginLeft:-.5*ze.width(),marginTop:-.5*ze.height()}),ESG.DOC.trigger("ESGCOLOR.OPEN",{openingValue:A[0],mode:U,currentInput:Le})})});var Jt=!1;"loading"===document.readyState?document.addEventListener("readystatechange",function(){"interactive"!==document.readyState&&"complete"!==document.readyState||Jt||(Jt=!0,Zt())}):(Jt=!0,Zt())}("undefined"!==jQuery&&jQuery),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&module.exports?module.exports=function(t,r){return void 0===r&&(r="undefined"!=typeof window?require("jquery"):require("jquery")(t)),e(r),r}:e(jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.select2ESG&&e.fn.select2ESG.amd)var t=e.fn.select2ESG.amd;var r,i,n,o;return t&&t.requirejs||(t?i=t:t={},function(e){var t,o,a,s,l={},c={},u={},d={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function m(e,t){var r,i,n,o,a,s,l,c,d,p,h,g=t&&t.split("/"),m=u.map,v=m&&m["*"]||{};if(e){for(a=(e=e.split("/")).length-1,u.nodeIdCompat&&f.test(e[a])&&(e[a]=e[a].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),d=0;d<e.length;d++)if("."===(h=e[d]))e.splice(d,1),d-=1;else if(".."===h){if(0===d||1===d&&".."===e[2]||".."===e[d-1])continue;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}if((g||v)&&m){for(d=(r=e.split("/")).length;d>0;d-=1){if(i=r.slice(0,d).join("/"),g)for(p=g.length;p>0;p-=1)if((n=m[g.slice(0,p).join("/")])&&(n=n[i])){o=n,s=d;break}if(o)break;!l&&v&&v[i]&&(l=v[i],c=d)}!o&&l&&(o=l,s=c),o&&(r.splice(0,s,o),e=r.join("/"))}return e}function v(t,r){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),o.apply(e,i.concat([t,r]))}}function b(e){return function(t){l[e]=t}}function y(r){if(g(c,r)){var i=c[r];delete c[r],d[r]=!0,t.apply(e,i)}if(!g(l,r)&&!g(d,r))throw new Error("No "+r);return l[r]}function w(e){var t,r=e?e.indexOf("!"):-1;return r>-1&&(t=e.substring(0,r),e=e.substring(r+1,e.length)),[t,e]}function k(e){return e?w(e):[]}function x(e){return function(){return u&&u.config&&u.config[e]||{}}}a=function(e,t){var r,i,n=w(e),o=n[0],a=t[1];return e=n[1],o&&(r=y(o=m(o,a))),o?e=r&&r.normalize?r.normalize(e,(i=a,function(e){return m(e,i)})):m(e,a):(o=(n=w(e=m(e,a)))[0],e=n[1],o&&(r=y(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:r}},s={require:function(e){return v(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:x(e)}}},t=function(t,r,i,n){var o,u,p,h,f,m,w,x=[],S=typeof i;if(m=k(n=n||t),"undefined"===S||"function"===S){for(r=!r.length&&i.length?["require","exports","module"]:r,f=0;f<r.length;f+=1)if("require"===(u=(h=a(r[f],m)).f))x[f]=s.require(t);else if("exports"===u)x[f]=s.exports(t),w=!0;else if("module"===u)o=x[f]=s.module(t);else if(g(l,u)||g(c,u)||g(d,u))x[f]=y(u);else{if(!h.p)throw new Error(t+" missing "+u);h.p.load(h.n,v(n,!0),b(u),{}),x[f]=l[u]}p=i?i.apply(l[t],x):void 0,t&&(o&&o.exports!==e&&o.exports!==l[t]?l[t]=o.exports:p===e&&w||(l[t]=p))}else t&&(l[t]=i)},r=i=o=function(r,i,n,l,c){if("string"==typeof r)return s[r]?s[r](i):y(a(r,k(i)).f);if(!r.splice){if((u=r).deps&&o(u.deps,u.callback),!i)return;i.splice?(r=i,i=n,n=null):r=e}return i=i||function(){},"function"==typeof n&&(n=l,l=c),l?t(e,r,i,n):setTimeout(function(){t(e,r,i,n)},4),o},o.config=function(e){return o(e)},r._defined=l,(n=function(e,t,r){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(r=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,r])}).amd={jQuery:!0}}(),t.requirejs=r,t.require=i,t.define=n),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t}),t.define("select2ESG/utils",["jquery"],function(e){var t={};function r(e){var t=e.prototype,r=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&r.push(i))}return r}t.Extend=function(e,t){var r={}.hasOwnProperty;function i(){this.constructor=e}for(var n in t)r.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=r(t),n=r(e);function o(){var r=Array.prototype.unshift,i=t.prototype.constructor.length,n=e.prototype.constructor;i>0&&(r.call(arguments,e.prototype.constructor),n=t.prototype.constructor),n.apply(this,arguments)}t.displayName=e.displayName,o.prototype=new function(){this.constructor=o};for(var a=0;a<n.length;a++){var s=n[a];o.prototype[s]=e.prototype[s]}for(var l=function(e){var r=function(){};e in o.prototype&&(r=o.prototype[e]);var i=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,r),i.apply(this,arguments)}},c=0;c<i.length;c++){var u=i[c];o.prototype[u]=l(u)}return o};var i=function(){this.listeners={}};i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,r=t.call(arguments,1);this.listeners=this.listeners||{},null==r&&(r=[]),0===r.length&&r.push({}),r[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var r=0,i=e.length;r<i;r++)e[r].apply(this,t)},t.Observable=i,t.generateChars=function(e){for(var t="",r=0;r<e;r++){t+=Math.floor(36*Math.random()).toString(36)}return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var r=t.split("-"),i=e;if(1!==r.length){for(var n=0;n<r.length;n++){var o=r[n];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),n==r.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},t.hasScroll=function(t,r){var i=e(r),n=r.style.overflowX,o=r.style.overflowY;return(n!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===n||"scroll"===o||(i.innerHeight()<r.scrollHeight||i.innerWidth()<r.scrollWidth))},t.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},t.appendMany=function(t,r){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(r,function(e){i=i.add(e)}),r=i}t.append(r)},t.__cache={};var n=0;return t.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2ESG-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2ESG-id",t)):(e.setAttribute("data-select2ESG-id",++n),t=n.toString())),t},t.StoreData=function(e,r,i){var n=t.GetUniqueElementId(e);t.__cache[n]||(t.__cache[n]={}),t.__cache[n][r]=i},t.GetData=function(r,i){var n=t.GetUniqueElementId(r);return i?t.__cache[n]&&null!=t.__cache[n][i]?t.__cache[n][i]:e(r).data(i):t.__cache[n]},t.RemoveData=function(e){var r=t.GetUniqueElementId(e);null!=t.__cache[r]&&delete t.__cache[r],e.removeAttribute("data-select2ESG-id")},t}),t.define("select2ESG/results",["jquery","./utils"],function(e,t){function r(e,t,i){this.$element=e,this.data=i,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,t.Observable),r.prototype.render=function(){var t=e('<ul class="select2ESG-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},r.prototype.clear=function(){this.$results.empty()},r.prototype.displayMessage=function(t){var r=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="alert" aria-live="assertive" class="select2ESG-results__option"></li>'),n=this.options.get("translations").get(t.message);i.append(r(n(t.args))),i[0].className+=" select2ESG-results__message",this.$results.append(i)},r.prototype.hideMessages=function(){this.$results.find(".select2ESG-results__message").remove()},r.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var r=0;r<e.results.length;r++){var i=e.results[r],n=this.option(i);t.push(n)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},r.prototype.position=function(e,t){t.find(".select2ESG-results").append(e)},r.prototype.sort=function(e){return this.options.get("sorter")(e)},r.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2ESG-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},r.prototype.setClasses=function(){var r=this;this.data.current(function(i){var n=e.map(i,function(e){return e.id.toString()});r.$results.find(".select2ESG-results__option[aria-selected]").each(function(){var r=e(this),i=t.GetData(this,"data"),o=""+i.id;null!=i.element&&i.element.selected||null==i.element&&e.inArray(o,n)>-1?r.attr("aria-selected","true"):r.attr("aria-selected","false")})})},r.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},r=this.option(t);r.className+=" loading-results",this.$results.prepend(r)},r.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},r.prototype.option=function(r){var i=document.createElement("li");i.className="select2ESG-results__option";var n={role:"option","aria-selected":"false"},o=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var a in(null!=r.element&&o.call(r.element,":disabled")||null==r.element&&r.disabled)&&(delete n["aria-selected"],n["aria-disabled"]="true"),null==r.id&&delete n["aria-selected"],null!=r._resultId&&(i.id=r._resultId),r.title&&(i.title=r.title),r.children&&(n.role="group",n["aria-label"]=r.text,delete n["aria-selected"]),n){var s=n[a];i.setAttribute(a,s)}if(r.children){var l=e(i),c=document.createElement("strong");c.className="select2ESG-results__group";e(c);this.template(r,c);for(var u=[],d=0;d<r.children.length;d++){var p=r.children[d],h=this.option(p);u.push(h)}var f=e("<ul></ul>",{class:"select2ESG-results__options select2ESG-results__options--nested"});f.append(u),l.append(c),l.append(f)}else this.template(r,i);return t.StoreData(i,"data",r),i},r.prototype.bind=function(r,i){var n=this,o=r.id+"-results";this.$results.attr("id",o),r.on("results:all",function(e){n.clear(),n.append(e.data),r.isOpen()&&(n.setClasses(),n.highlightFirstItem())}),r.on("results:append",function(e){n.append(e.data),r.isOpen()&&n.setClasses()}),r.on("query",function(e){n.hideMessages(),n.showLoading(e)}),r.on("select",function(){r.isOpen()&&(n.setClasses(),n.options.get("scrollAfterSelect")&&n.highlightFirstItem())}),r.on("unselect",function(){r.isOpen()&&(n.setClasses(),n.options.get("scrollAfterSelect")&&n.highlightFirstItem())}),r.on("open",function(){n.$results.attr("aria-expanded","true"),n.$results.attr("aria-hidden","false"),n.setClasses(),n.ensureHighlightVisible()}),r.on("close",function(){n.$results.attr("aria-expanded","false"),n.$results.attr("aria-hidden","true"),n.$results.removeAttr("aria-activedescendant")}),r.on("results:toggle",function(){var e=n.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),r.on("results:select",function(){var e=n.getHighlightedResults();if(0!==e.length){var r=t.GetData(e[0],"data");"true"==e.attr("aria-selected")?n.trigger("close",{}):n.trigger("select",{data:r})}}),r.on("results:previous",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),r=t.index(e);if(!(r<=0)){var i=r-1;0===e.length&&(i=0);var o=t.eq(i);o.trigger("mouseenter");var a=n.$results.offset().top,s=o.offset().top,l=n.$results.scrollTop()+(s-a);0===i?n.$results.scrollTop(0):s-a<0&&n.$results.scrollTop(l)}}),r.on("results:next",function(){var e=n.getHighlightedResults(),t=n.$results.find("[aria-selected]"),r=t.index(e)+1;if(!(r>=t.length)){var i=t.eq(r);i.trigger("mouseenter");var o=n.$results.offset().top+n.$results.outerHeight(!1),a=i.offset().top+i.outerHeight(!1),s=n.$results.scrollTop()+a-o;0===r?n.$results.scrollTop(0):a>o&&n.$results.scrollTop(s)}}),r.on("results:focus",function(e){e.element.addClass("select2ESG-results__option--highlighted")}),r.on("results:message",function(e){n.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=n.$results.scrollTop(),r=n.$results.get(0).scrollHeight-t+e.deltaY,i=e.deltaY>0&&t-e.deltaY<=0,o=e.deltaY<0&&r<=n.$results.height();i?(n.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(n.$results.scrollTop(n.$results.get(0).scrollHeight-n.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2ESG-results__option[aria-selected]",function(r){var i=e(this),o=t.GetData(this,"data");"true"!==i.attr("aria-selected")?n.trigger("select",{originalEvent:r,data:o}):n.options.get("multiple")?n.trigger("unselect",{originalEvent:r,data:o}):n.trigger("close",{})}),this.$results.on("mouseenter",".select2ESG-results__option[aria-selected]",function(r){var i=t.GetData(this,"data");n.getHighlightedResults().removeClass("select2ESG-results__option--highlighted"),n.trigger("results:focus",{data:i,element:e(this)})})},r.prototype.getHighlightedResults=function(){return this.$results.find(".select2ESG-results__option--highlighted")},r.prototype.destroy=function(){this.$results.remove()},r.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),r=this.$results.offset().top,i=e.offset().top,n=this.$results.scrollTop()+(i-r),o=i-r;n-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(n)}},r.prototype.template=function(t,r){var i=this.options.get("templateResult"),n=this.options.get("escapeMarkup"),o=i(t,r);null==o?r.style.display="none":"string"==typeof o?r.innerHTML=n(o):e(r).append(o)},r}),t.define("select2ESG/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),t.define("select2ESG/selection/base",["jquery","../utils","../keys"],function(e,t,r){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var r=e('<span class="select2ESG-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=t.GetData(this.$element[0],"old-tabindex")?this._tabindex=t.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),r.attr("title",this.$element.attr("title")),r.attr("tabindex",this._tabindex),r.attr("aria-disabled","false"),this.$selection=r,r},i.prototype.bind=function(e,t){var i=this,n=e.id+"-results";this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",n),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.trigger("focus"),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex),i.$selection.attr("aria-disabled","false")}),e.on("disable",function(){i.$selection.attr("tabindex","-1"),i.$selection.attr("aria-disabled","true")})},i.prototype._handleBlur=function(t){var r=this;window.setTimeout(function(){document.activeElement==r.$selection[0]||e.contains(r.$selection[0],document.activeElement)||r.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(r){e(document.body).on("mousedown.select2ESG."+r.id,function(r){var i=e(r.target).closest(".select2ESG");e(".select2ESG.select2ESG-container--open").each(function(){this!=i[0]&&t.GetData(this,"element").select2ESG("close")})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2ESG."+t.id)},i.prototype.position=function(e,t){t.find(".selection").append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("select2ESG/selection/single",["jquery","./base","../utils","../keys"],function(e,t,r,i){function n(){n.__super__.constructor.apply(this,arguments)}return r.Extend(n,t),n.prototype.render=function(){var e=n.__super__.render.call(this);return e.addClass("select2ESG-selection--single"),e.html('<span class="select2ESG-selection__rendered"></span><span class="select2ESG-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},n.prototype.bind=function(e,t){var r=this;n.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".select2ESG-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&r.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("focus",function(t){e.isOpen()||r.$selection.trigger("focus")})},n.prototype.clear=function(){var e=this.$selection.find(".select2ESG-selection__rendered");e.empty(),e.removeAttr("title")},n.prototype.display=function(e,t){var r=this.options.get("templateSelection");return this.options.get("escapeMarkup")(r(e,t))},n.prototype.selectionContainer=function(){return e("<span></span>")},n.prototype.update=function(e){if(0!==e.length){var t=e[0],r=this.$selection.find(".select2ESG-selection__rendered"),i=this.display(t,r);r.empty().append(i);var n=t.title||t.text;n?r.attr("title",n):r.removeAttr("title")}else this.clear()},n}),t.define("select2ESG/selection/multiple",["jquery","./base","../utils"],function(e,t,r){function i(e,t){i.__super__.constructor.apply(this,arguments)}return r.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2ESG-selection--multiple"),e.html('<ul class="select2ESG-selection__rendered"></ul>'),e},i.prototype.bind=function(t,n){var o=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){o.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2ESG-selection__choice__remove",function(t){if(!o.options.get("disabled")){var i=e(this).parent(),n=r.GetData(i[0],"data");o.trigger("unselect",{originalEvent:t,data:n})}})},i.prototype.clear=function(){var e=this.$selection.find(".select2ESG-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var r=this.options.get("templateSelection");return this.options.get("escapeMarkup")(r(e,t))},i.prototype.selectionContainer=function(){return e('<li class="select2ESG-selection__choice"><span class="select2ESG-selection__choice__remove" role="presentation">&times;</span></li>')},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var n=e[i],o=this.selectionContainer(),a=this.display(n,o);o.append(a);var s=n.title||n.text;s&&o.attr("title",s),r.StoreData(o[0],"data",n),t.push(o)}var l=this.$selection.find(".select2ESG-selection__rendered");r.appendMany(l,t)}},i}),t.define("select2ESG/selection/placeholder",["../utils"],function(e){function t(e,t,r){this.placeholder=this.normalizePlaceholder(r.get("placeholder")),e.call(this,t,r)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var r=this.selectionContainer();return r.html(this.display(t)),r.addClass("select2ESG-selection__placeholder").removeClass("select2ESG-selection__choice"),r},t.prototype.update=function(e,t){var r=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||r)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2ESG-selection__rendered").append(i)},t}),t.define("select2ESG/selection/allowClear",["jquery","../keys","../utils"],function(e,t,r){function i(){}return i.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2ESG-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},i.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var i=this.$selection.find(".select2ESG-selection__clear");if(0!==i.length){t.stopPropagation();var n=r.GetData(i[0],"data"),o=this.$element.val();this.$element.val(this.placeholder.id);var a={data:n};if(this.trigger("clear",a),a.prevented)this.$element.val(o);else{for(var s=0;s<n.length;s++)if(a={data:n[s]},this.trigger("unselect",a),a.prevented)return void this.$element.val(o);this.$element.trigger("change"),this.trigger("toggle",{})}}}},i.prototype._handleKeyboardClear=function(e,r,i){i.isOpen()||r.which!=t.DELETE&&r.which!=t.BACKSPACE||this._handleClear(r)},i.prototype.update=function(t,i){if(t.call(this,i),!(this.$selection.find(".select2ESG-selection__placeholder").length>0||0===i.length)){var n=this.options.get("translations").get("removeAllItems"),o=e('<span class="select2ESG-selection__clear" title="'+n()+'">&times;</span>');r.StoreData(o[0],"data",i),this.$selection.find(".select2ESG-selection__rendered").prepend(o)}},i}),t.define("select2ESG/selection/search",["jquery","../utils","../keys"],function(e,t,r){function i(e,t,r){e.call(this,t,r)}return i.prototype.render=function(t){var r=e('<li class="select2ESG-search select2ESG-search--inline"><input class="select2ESG-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=r,this.$search=r.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,i,n){var o=this,a=i.id+"-results";e.call(this,i,n),i.on("open",function(){o.$search.attr("aria-controls",a),o.$search.trigger("focus")}),i.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.trigger("focus")}),i.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),i.on("disable",function(){o.$search.prop("disabled",!0)}),i.on("focus",function(e){o.$search.trigger("focus")}),i.on("results:focus",function(e){e.data._resultId?o.$search.attr("aria-activedescendant",e.data._resultId):o.$search.removeAttr("aria-activedescendant")}),this.$selection.on("focusin",".select2ESG-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2ESG-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".select2ESG-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===r.BACKSPACE&&""===o.$search.val()){var i=o.$searchContainer.prev(".select2ESG-selection__choice");if(i.length>0){var n=t.GetData(i[0],"data");o.searchRemoveChoice(n),e.preventDefault()}}}),this.$selection.on("click",".select2ESG-search--inline",function(e){o.$search.val()&&e.stopPropagation()});var s=document.documentMode,l=s&&s<=11;this.$selection.on("input.searchcheck",".select2ESG-search--inline",function(e){l?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2ESG-search--inline",function(e){if(l&&"input"===e.type)o.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=r.SHIFT&&t!=r.CTRL&&t!=r.ALT&&t!=r.TAB&&o.handleSearch(e)}})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var r=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2ESG-selection__rendered").append(this.$searchContainer),this.resizeSearch(),r&&this.$search.trigger("focus")},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2ESG-selection__rendered").width():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},i}),t.define("select2ESG/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,r,i){var n=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],a=["opening","closing","selecting","unselecting","clearing"];t.call(this,r,i),r.on("*",function(t,r){if(-1!==e.inArray(t,o)){r=r||{};var i=e.Event("select2ESG:"+t,{params:r});n.$element.trigger(i),-1!==e.inArray(t,a)&&(r.prevented=i.isDefaultPrevented())}})},t}),t.define("select2ESG/translation",["jquery","require"],function(e,t){function r(e){this.dict=e||{}}return r.prototype.all=function(){return this.dict},r.prototype.get=function(e){return this.dict[e]},r.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},r._cache={},r.loadPath=function(e){if(!(e in r._cache)){var i=t(e);r._cache[e]=i}return new r(r._cache[e])},r}),t.define("select2ESG/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}}),t.define("select2ESG/data/base",["../utils"],function(e){function t(e,r){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,r){var i=t.id+"-result-";return i+=e.generateChars(4),null!=r.id?i+="-"+r.id.toString():i+="-"+e.generateChars(4),i},t}),t.define("select2ESG/data/select",["./base","../utils","jquery"],function(e,t,r){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=r(this),n=i.item(e);t.push(n)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,r(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var n=[];(e=[e]).push.apply(e,i);for(var o=0;o<e.length;o++){var a=e[o].id;-1===r.inArray(a,n)&&n.push(a)}t.$element.val(n),t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,r(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("change");this.current(function(i){for(var n=[],o=0;o<i.length;o++){var a=i[o].id;a!==e.id&&-1===r.inArray(a,n)&&n.push(a)}t.$element.val(n),t.$element.trigger("change")})}},i.prototype.bind=function(e,t){var r=this;this.container=e,e.on("select",function(e){r.select(e.data)}),e.on("unselect",function(e){r.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){t.RemoveData(this)})},i.prototype.query=function(e,t){var i=[],n=this;this.$element.children().each(function(){var t=r(this);if(t.is("option")||t.is("optgroup")){var o=n.item(t),a=n.matches(e,o);null!==a&&i.push(a)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var i;e.children?(i=document.createElement("optgroup")).label=e.text:void 0!==(i=document.createElement("option")).textContent?i.textContent=e.text:i.innerText=e.text,void 0!==e.id&&(i.value=e.id),e.disabled&&(i.disabled=!0),e.selected&&(i.selected=!0),e.title&&(i.title=e.title);var n=r(i),o=this._normalizeItem(e);return o.element=i,t.StoreData(i,"data",o),n},i.prototype.item=function(e){var i={};if(null!=(i=t.GetData(e[0],"data")))return i;if(e.is("option"))i={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){i={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),o=[],a=0;a<n.length;a++){var s=r(n[a]),l=this.item(s);o.push(l)}i.children=o}return(i=this._normalizeItem(i)).element=e[0],t.StoreData(e[0],"data",i),i},i.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=r.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),r.extend({},{selected:!1,disabled:!1},e)},i.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},i}),t.define("select2ESG/data/array",["./select","../utils","jquery"],function(e,t,r){function i(e,t){this._dataToConvert=t.get("data")||[],i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype.bind=function(e,t){i.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,r){return r.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){var i=this,n=this.$element.find("option"),o=n.map(function(){return i.item(r(this)).id}).get(),a=[];function s(e){return function(){return r(this).val()==e.id}}for(var l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(r.inArray(c.id,o)>=0){var u=n.filter(s(c)),d=this.item(u),p=r.extend(!0,{},c,d),h=this.option(p);u.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}a.push(f)}}return a},i}),t.define("select2ESG/data/ajax",["./array","../utils","jquery"],function(e,t,r){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return r.extend({},e,{q:e.term})},transport:function(e,t,i){var n=r.ajax(e);return n.then(t),n.fail(i),n}};return r.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){var i=this;null!=this._request&&(r.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var n=r.extend({type:"GET"},this.ajaxOptions);function o(){var o=n.transport(n,function(n){var o=i.processResults(n,e);i.options.get("debug")&&window.console&&console.error&&(o&&o.results&&r.isArray(o.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(o)},function(){"status"in o&&(0===o.status||"0"===o.status)||i.trigger("results:message",{message:"errorLoading"})});i._request=o}"function"==typeof n.url&&(n.url=n.url.call(this.$element,e)),"function"==typeof n.data&&(n.data=n.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(o,this.ajaxOptions.delay)):o()},i}),t.define("select2ESG/data/tags",["jquery"],function(e){function t(t,r,i){var n=i.get("tags"),o=i.get("createTag");void 0!==o&&(this.createTag=o);var a=i.get("insertTag");if(void 0!==a&&(this.insertTag=a),t.call(this,r,i),e.isArray(n))for(var s=0;s<n.length;s++){var l=n[s],c=this._normalizeItem(l),u=this.option(c);this.$element.append(u)}}return t.prototype.query=function(e,t,r){var i=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,function e(n,o){for(var a=n.results,s=0;s<a.length;s++){var l=a[s],c=null!=l.children&&!e({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!o&&(n.data=a,void r(n))}if(o)return!0;var u=i.createTag(t);if(null!=u){var d=i.option(u);d.attr("data-select2ESG-tag",!0),i.addOptions([d]),i.insertTag(a,u)}n.results=a,r(n)}):e.call(this,t,r)},t.prototype.createTag=function(t,r){var i=e.trim(r.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,r){t.unshift(r)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2ESG-tag]").each(function(){this.selected||e(this).remove()})},t}),t.define("select2ESG/data/tokenizer",["jquery"],function(e){function t(e,t,r){var i=r.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,r)}return t.prototype.bind=function(e,t,r){e.call(this,t,r),this.$search=t.dropdown.$search||t.selection.$search||r.find(".select2ESG-search__field")},t.prototype.query=function(t,r,i){var n=this;r.term=r.term||"";var o=this.tokenizer(r,this.options,function(t){var r=n._normalizeItem(t);if(!n.$element.find("option").filter(function(){return e(this).val()===r.id}).length){var i=n.option(r);i.attr("data-select2ESG-tag",!0),n._removeOldTags(),n.addOptions([i])}!function(e){n.trigger("select",{data:e})}(r)});o.term!==r.term&&(this.$search.length&&(this.$search.val(o.term),this.$search.trigger("focus")),r.term=o.term),t.call(this,r,i)},t.prototype.tokenizer=function(t,r,i,n){for(var o=i.get("tokenSeparators")||[],a=r.term,s=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};s<a.length;){var c=a[s];if(-1!==e.inArray(c,o)){var u=a.substr(0,s),d=l(e.extend({},r,{term:u}));null!=d?(n(d),a=a.substr(s+1)||"",s=0):s++}else s++}return{term:a}},t}),t.define("select2ESG/data/minimumInputLength",[],function(){function e(e,t,r){this.minimumInputLength=r.get("minimumInputLength"),e.call(this,t,r)}return e.prototype.query=function(e,t,r){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,r)},e}),t.define("select2ESG/data/maximumInputLength",[],function(){function e(e,t,r){this.maximumInputLength=r.get("maximumInputLength"),e.call(this,t,r)}return e.prototype.query=function(e,t,r){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,r)},e}),t.define("select2ESG/data/maximumSelectionLength",[],function(){function e(e,t,r){this.maximumSelectionLength=r.get("maximumSelectionLength"),e.call(this,t,r)}return e.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),t.on("select",function(){i._checkIfMaximumSelected()})},e.prototype.query=function(e,t,r){var i=this;this._checkIfMaximumSelected(function(){e.call(i,t,r)})},e.prototype._checkIfMaximumSelected=function(e,t){var r=this;this.current(function(e){var i=null!=e?e.length:0;r.maximumSelectionLength>0&&i>=r.maximumSelectionLength?r.trigger("results:message",{message:"maximumSelected",args:{maximum:r.maximumSelectionLength}}):t&&t()})},e}),t.define("select2ESG/dropdown",["jquery","./utils"],function(e,t){function r(e,t){this.$element=e,this.options=t,r.__super__.constructor.call(this)}return t.Extend(r,t.Observable),r.prototype.render=function(){var t=e('<span class="select2ESG-dropdown"><span class="select2ESG-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},r.prototype.bind=function(){},r.prototype.position=function(e,t){},r.prototype.destroy=function(){this.$dropdown.remove()},r}),t.define("select2ESG/dropdown/search",["jquery","../utils"],function(e,t){function r(){}return r.prototype.render=function(t){var r=t.call(this),i=e('<span class="select2ESG-search select2ESG-search--dropdown"><input class="select2ESG-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),r.prepend(i),r},r.prototype.bind=function(t,r,i){var n=this,o=r.id+"-results";t.call(this,r,i),this.$search.on("keydown",function(e){n.trigger("keypress",e),n._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){n.handleSearch(e)}),r.on("open",function(){n.$search.attr("tabindex",0),n.$search.attr("aria-controls",o),n.$search.trigger("focus"),window.setTimeout(function(){n.$search.trigger("focus")},0)}),r.on("close",function(){n.$search.attr("tabindex",-1),n.$search.removeAttr("aria-controls"),n.$search.removeAttr("aria-activedescendant"),n.$search.val(""),n.$search.trigger("blur")}),r.on("focus",function(){r.isOpen()||n.$search.trigger("focus")}),r.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(n.showSearch(e)?n.$searchContainer.removeClass("select2ESG-search--hide"):n.$searchContainer.addClass("select2ESG-search--hide"))}),r.on("results:focus",function(e){e.data._resultId?n.$search.attr("aria-activedescendant",e.data._resultId):n.$search.removeAttr("aria-activedescendant")})},r.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},r.prototype.showSearch=function(e,t){return!0},r}),t.define("select2ESG/dropdown/hidePlaceholder",[],function(){function e(e,t,r,i){this.placeholder=this.normalizePlaceholder(r.get("placeholder")),e.call(this,t,r,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var r=t.slice(0),i=t.length-1;i>=0;i--){var n=t[i];this.placeholder.id===n.id&&r.splice(i,1)}return r},e}),t.define("select2ESG/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,r,i){this.lastParams={},e.call(this,t,r,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&(this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore())},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2ESG-results__option select2ESG-results__option--load-more"role="option" aria-disabled="true"></li>'),r=this.options.get("translations").get("loadingMore");return t.html(r(this.lastParams)),t},t}),t.define("select2ESG/dropdown/attachBody",["jquery","../utils"],function(e,t){function r(t,r,i){this.$dropdownParent=e(i.get("dropdownParent")||document.body),t.call(this,r,i)}return r.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},r.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},r.prototype.position=function(e,t,r){t.attr("class",r.attr("class")),t.removeClass("select2ESG"),t.addClass("select2ESG-container--open"),t.css({position:"absolute",top:-999999}),this.$container=r},r.prototype.render=function(t){var r=e("<span></span>"),i=t.call(this);return r.append(i),this.$dropdownContainer=r,r},r.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},r.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var r=this;t.on("results:all",function(){r._positionDropdown(),r._resizeDropdown()}),t.on("results:append",function(){r._positionDropdown(),r._resizeDropdown()}),t.on("results:message",function(){r._positionDropdown(),r._resizeDropdown()}),t.on("select",function(){r._positionDropdown(),r._resizeDropdown()}),t.on("unselect",function(){r._positionDropdown(),r._resizeDropdown()}),this._containerResultsHandlersBound=!0}},r.prototype._attachPositioningHandler=function(r,i){var n=this,o="scroll.select2ESG."+i.id,a="resize.select2ESG."+i.id,s="orientationchange.select2ESG."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){t.StoreData(this,"select2ESG-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(o,function(e){}),e(window).on(o+" "+a+" "+s,function(e){n._positionDropdown(),n._resizeDropdown()})},r.prototype._detachPositioningHandler=function(r,i){var n="scroll.select2ESG."+i.id,o="resize.select2ESG."+i.id,a="orientationchange.select2ESG."+i.id;this.$container.parents().filter(t.hasScroll).off(n),e(window).off(n+" "+o+" "+a)},r.prototype._positionDropdown=function(){var t=e(window),r=this.$dropdown.hasClass("select2ESG-dropdown--above"),i=this.$dropdown.hasClass("select2ESG-dropdown--below"),n=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var a={height:this.$container.outerHeight(!1)};a.top=o.top,a.bottom=o.top+a.height;var s=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),u=l<o.top-s,d=c>o.bottom+s,p={left:o.left,top:a.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var f={top:0,left:0};(e.contains(document.body,h[0])||h[0].isConnected)&&(f=h.offset()),p.top-=f.top,p.left-=f.left,r||i||(n="below"),d||!u||r?!u&&d&&r&&(n="below"):n="above",("above"==n||r&&"below"!==n)&&(p.top=a.top-f.top-s),null!=n&&(this.$dropdown.removeClass("select2ESG-dropdown--below select2ESG-dropdown--above").addClass("select2ESG-dropdown--"+n),this.$container.removeClass("select2ESG-container--below select2ESG-container--above").addClass("select2ESG-container--"+n)),this.$dropdownContainer.css(p)},r.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},r.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},r}),t.define("select2ESG/dropdown/minimumResultsForSearch",[],function(){function e(e,t,r,i){this.minimumResultsForSearch=r.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,r,i)}return e.prototype.showSearch=function(e,t){return!(function e(t){for(var r=0,i=0;i<t.length;i++){var n=t[i];n.children?r+=e(n.children):r++}return r}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),t.define("select2ESG/dropdown/selectOnClose",["../utils"],function(e){function t(){}return t.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),t.on("close",function(e){i._handleSelectOnClose(e)})},t.prototype._handleSelectOnClose=function(t,r){if(r&&null!=r.originalSelect2Event){var i=r.originalSelect2Event;if("select"===i._type||"unselect"===i._type)return}var n=this.getHighlightedResults();if(!(n.length<1)){var o=e.GetData(n[0],"data");null!=o.element&&o.element.selected||null==o.element&&o.selected||this.trigger("select",{data:o})}},t}),t.define("select2ESG/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,r){var i=this;e.call(this,t,r),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var r=t.originalEvent;r&&(r.ctrlKey||r.metaKey)||this.trigger("close",{originalEvent:r,originalSelect2Event:t})},e}),t.define("select2ESG/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,r="Please delete "+t+" character";return 1!=t&&(r+="s"),r},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),t.define("select2ESG/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(e,t,r,i,n,o,a,s,l,c,u,d,p,h,f,g,m,v,b,y,w,k,x,S,C,E,L,G,T){function M(){this.reset()}return M.prototype.apply=function(u){if(null==(u=e.extend(!0,{},this.defaults,u)).dataAdapter){if(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=p,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,b)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null!=u.query){var d=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,d)}if(null!=u.initSelection){var T=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,T)}}if(null==u.resultsAdapter&&(u.resultsAdapter=r,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,S)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,x)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,L))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=w;else{var M=c.Decorate(w,k);u.dropdownAdapter=M}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,E)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,G)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var A=t(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,A)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,C)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=n:u.selectionAdapter=i,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,o)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var _=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,_)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}u.language=this._resolveLanguage(u.language),u.language.push("en");for(var O=[],N=0;N<u.language.length;N++){var D=u.language[N];-1===O.indexOf(D)&&O.push(D)}return u.language=O,u.translations=this._processTranslations(u.language,u.debug),u},M.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,function(e){return d[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:{},matcher:function r(i,n){if(""===e.trim(i.term))return n;if(n.children&&n.children.length>0){for(var o=e.extend(!0,{},n),a=n.children.length-1;a>=0;a--)null==r(i,n.children[a])&&o.children.splice(a,1);return o.children.length>0?o:r(i,o)}var s=t(n.text).toUpperCase(),l=t(i.term).toUpperCase();return s.indexOf(l)>-1?n:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},M.prototype.applyFromElement=function(e,t){var r=e.language,i=this.defaults.language,n=t.prop("lang"),o=t.closest("[lang]").prop("lang"),a=Array.prototype.concat.call(this._resolveLanguage(n),this._resolveLanguage(r),this._resolveLanguage(i),this._resolveLanguage(o));return e.language=a,e},M.prototype._resolveLanguage=function(t){if(!t)return[];if(e.isEmptyObject(t))return[];if(e.isPlainObject(t))return[t];var r;r=e.isArray(t)?t:[t];for(var i=[],n=0;n<r.length;n++)if(i.push(r[n]),"string"==typeof r[n]&&r[n].indexOf("-")>0){var o=r[n].split("-")[0];i.push(o)}return i},M.prototype._processTranslations=function(t,r){for(var i=new u,n=0;n<t.length;n++){var o=new u,a=t[n];if("string"==typeof a)try{o=u.loadPath(a)}catch(e){try{a=this.defaults.amdLanguageBase+a,o=u.loadPath(a)}catch(e){r&&window.console&&console.warn&&console.warn('Select2: The language file for "'+a+'" could not be automatically loaded. A fallback will be used instead.')}}else o=e.isPlainObject(a)?new u(a):a;i.extend(o)}return i},M.prototype.set=function(t,r){var i={};i[e.camelCase(t)]=r;var n=c._convertData(i);e.extend(!0,this.defaults,n)},new M}),t.define("select2ESG/options",["require","jquery","./defaults","./utils"],function(e,t,r,i){function n(t,n){if(this.options=t,null!=n&&this.fromElement(n),null!=n&&(this.options=r.applyFromElement(this.options,n)),this.options=r.apply(this.options),n&&n.is("input")){var o=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,o)}}return n.prototype.fromElement=function(e){var r=["select2ESG"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),i.GetData(e[0],"select2ESGTags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2ESG-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),i.StoreData(e[0],"data",i.GetData(e[0],"select2ESGTags")),i.StoreData(e[0],"tags",!0)),i.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",i.GetData(e[0],"ajaxUrl")),i.StoreData(e[0],"ajax-Url",i.GetData(e[0],"ajaxUrl")));var n={};function o(e,t){return t.toUpperCase()}for(var a=0;a<e[0].attributes.length;a++){var s=e[0].attributes[a].name;if("data-"==s.substr(0,"data-".length)){var l=s.substring("data-".length),c=i.GetData(e[0],l);n[l.replace(/-([a-z])/g,o)]=c}}t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset&&(n=t.extend(!0,{},e[0].dataset,n));var u=t.extend(!0,{},i.GetData(e[0]),n);for(var d in u=i._convertData(u))t.inArray(d,r)>-1||(t.isPlainObject(this.options[d])?t.extend(this.options[d],u[d]):this.options[d]=u[d]);return this},n.prototype.get=function(e){return this.options[e]},n.prototype.set=function(e,t){this.options[e]=t},n}),t.define("select2ESG/core",["jquery","./options","./utils","./keys"],function(e,t,r,i){var n=function(e,i){null!=r.GetData(e[0],"select2ESG")&&r.GetData(e[0],"select2ESG").destroy(),this.$element=e,this.id=this._generateId(e),i=i||{},this.options=new t(i,e),n.__super__.constructor.call(this);var o=e.attr("tabindex")||0;r.StoreData(e[0],"old-tabindex",o),e.attr("tabindex","-1");var a=this.options.get("dataAdapter");this.dataAdapter=new a(e,this.options);var s=this.render();this._placeContainer(s);var l=this.options.get("selectionAdapter");this.selection=new l(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,s);var c=this.options.get("dropdownAdapter");this.dropdown=new c(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,s);var u=this.options.get("resultsAdapter");this.results=new u(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var d=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){d.trigger("selection:update",{data:e})}),e.addClass("select2ESG-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),r.StoreData(e[0],"select2ESG",this),e.data("select2ESG",this)};return r.Extend(n,r.Observable),n.prototype._generateId=function(e){return"select2ESG-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+r.generateChars(2):r.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},n.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},n.prototype._resolveWidth=function(e,t){var r=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var n=e.outerWidth(!1);return n<=0?"auto":n+"px"}if("style"==t){var o=e.attr("style");if("string"!=typeof o)return null;for(var a=o.split(";"),s=0,l=a.length;s<l;s+=1){var c=a[s].replace(/\s/g,"").match(r);if(null!==c&&c.length>=1)return c[1]}return null}return"computedstyle"==t?window.getComputedStyle(e[0]).width:t},n.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},n.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2ESG",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2ESG",function(e){t.trigger("focus",e)}),this._syncA=r.bind(this._syncAttributes,this),this._syncS=r.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(r){e.each(r,t._syncA),e.each(r,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},n.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,r){e.trigger(t,r)})},n.prototype._registerSelectionEvents=function(){var t=this,r=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,n){-1===e.inArray(i,r)&&t.trigger(i,n)})},n.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,r){e.trigger(t,r)})},n.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,r){e.trigger(t,r)})},n.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("select2ESG-container--open")}),this.on("close",function(){e.$container.removeClass("select2ESG-container--open")}),this.on("enable",function(){e.$container.removeClass("select2ESG-container--disabled")}),this.on("disable",function(){e.$container.addClass("select2ESG-container--disabled")}),this.on("blur",function(){e.$container.removeClass("select2ESG-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(r){e.trigger("results:all",{data:r,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(r){e.trigger("results:append",{data:r,query:t})})}),this.on("keypress",function(t){var r=t.which;e.isOpen()?r===i.ESC||r===i.TAB||r===i.UP&&t.altKey?(e.close(),t.preventDefault()):r===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):r===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):r===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):r===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(r===i.ENTER||r===i.SPACE||r===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},n.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},n.prototype._syncSubtree=function(e,t){var r=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&t.addedNodes.length>0)for(var n=0;n<t.addedNodes.length;n++){t.addedNodes[n].selected&&(r=!0)}else t.removedNodes&&t.removedNodes.length>0&&(r=!0);else r=!0;r&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},n.prototype.trigger=function(e,t){var r=n.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in i){var o=i[e],a={prevented:!1,name:e,args:t};if(r.call(this,o,a),a.prevented)return void(t.prevented=!0)}r.call(this,e,t)},n.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},n.prototype.open=function(){this.isOpen()||this.trigger("query",{})},n.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},n.prototype.isOpen=function(){return this.$container.hasClass("select2ESG-container--open")},n.prototype.hasFocus=function(){return this.$container.hasClass("select2ESG-container--focus")},n.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2ESG-container--focus"),this.trigger("focus",{}))},n.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2ESG("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},n.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2ESG("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},n.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2ESG("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var r=t[0];e.isArray(r)&&(r=e.map(r,function(e){return e.toString()})),this.$element.val(r).trigger("change")},n.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2ESG"),this.$element.attr("tabindex",r.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2ESG-hidden-accessible"),this.$element.attr("aria-hidden","false"),r.RemoveData(this.$element[0]),this.$element.removeData("select2ESG"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},n.prototype.render=function(){var t=e('<span class="select2ESG select2ESG-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2ESG-container--"+this.options.get("theme")),r.StoreData(t[0],"element",this.$element),t},n}),t.define("select2ESG/compat/utils",["jquery"],function(e){return{syncCssClasses:function(t,r,i){var n,o,a=[];(n=e.trim(t.attr("class")))&&e((n=""+n).split(/\s+/)).each(function(){0===this.indexOf("select2ESG-")&&a.push(this)}),(n=e.trim(r.attr("class")))&&e((n=""+n).split(/\s+/)).each(function(){0!==this.indexOf("select2ESG-")&&null!=(o=i(this))&&a.push(o)}),t.attr("class",a.join(" "))}}}),t.define("select2ESG/compat/containerCss",["jquery","./utils"],function(e,t){function r(e){return null}function i(){}return i.prototype.render=function(i){var n=i.call(this),o=this.options.get("containerCssClass")||"";e.isFunction(o)&&(o=o(this.$element));var a=this.options.get("adaptContainerCssClass");if(a=a||r,-1!==o.indexOf(":all:")){o=o.replace(":all:","");var s=a;a=function(e){var t=s(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(n,this.$element,a),n.css(l),n.addClass(o),n},i}),t.define("select2ESG/compat/dropdownCss",["jquery","./utils"],function(e,t){function r(e){return null}function i(){}return i.prototype.render=function(i){var n=i.call(this),o=this.options.get("dropdownCssClass")||"";e.isFunction(o)&&(o=o(this.$element));var a=this.options.get("adaptDropdownCssClass");if(a=a||r,-1!==o.indexOf(":all:")){o=o.replace(":all:","");var s=a;a=function(e){var t=s(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(n,this.$element,a),n.css(l),n.addClass(o),n},i}),t.define("select2ESG/compat/initSelection",["jquery"],function(e){function t(e,t,r){r.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=r.get("initSelection"),this._isInitialized=!1,e.call(this,t,r)}return t.prototype.current=function(t,r){var i=this;this._isInitialized?t.call(this,r):this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,e.isArray(t)||(t=[t]),r(t)})},t}),t.define("select2ESG/compat/inputData",["jquery","../utils"],function(e,t){function r(e,t,r){this._currentData=[],this._valueSeparator=r.get("valueSeparator")||",","hidden"===t.prop("type")&&r.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,r)}return r.prototype.current=function(t,r){function i(t,r){var n=[];return t.selected||-1!==e.inArray(t.id,r)?(t.selected=!0,n.push(t)):t.selected=!1,t.children&&n.push.apply(n,i(t.children,r)),n}for(var n=[],o=0;o<this._currentData.length;o++){var a=this._currentData[o];n.push.apply(n,i(a,this.$element.val().split(this._valueSeparator)))}r(n)},r.prototype.select=function(t,r){if(this.options.get("multiple")){var i=this.$element.val();i+=this._valueSeparator+r.id,this.$element.val(i),this.$element.trigger("change")}else this.current(function(t){e.map(t,function(e){e.selected=!1})}),this.$element.val(r.id),this.$element.trigger("change")},r.prototype.unselect=function(e,t){var r=this;t.selected=!1,this.current(function(e){for(var i=[],n=0;n<e.length;n++){var o=e[n];t.id!=o.id&&i.push(o.id)}r.$element.val(i.join(r._valueSeparator)),r.$element.trigger("change")})},r.prototype.query=function(e,t,r){for(var i=[],n=0;n<this._currentData.length;n++){var o=this._currentData[n],a=this.matches(t,o);null!==a&&i.push(a)}r({results:i})},r.prototype.addOptions=function(r,i){var n=e.map(i,function(e){return t.GetData(e[0],"data")});this._currentData.push.apply(this._currentData,n)},r}),t.define("select2ESG/compat/matcher",["jquery"],function(e){return function(t){return function(r,i){var n=e.extend(!0,{},i);if(null==r.term||""===e.trim(r.term))return n;if(i.children){for(var o=i.children.length-1;o>=0;o--){var a=i.children[o];t(r.term,a.text,a)||n.children.splice(o,1)}if(n.children.length>0)return n}return t(r.term,i.text,i)?n:null}}}),t.define("select2ESG/compat/query",[],function(){function e(e,t,r){r.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,r)}return e.prototype.query=function(e,t,r){t.callback=r,this.options.get("query").call(null,t)},e}),t.define("select2ESG/dropdown/attachContainer",[],function(){function e(e,t,r){e.call(this,t,r)}return e.prototype.position=function(e,t,r){r.find(".dropdown-wrapper").append(t),t.addClass("select2ESG-dropdown--below"),r.addClass("select2ESG-container--below")},e}),t.define("select2ESG/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,r){e.call(this,t,r);this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),t.define("select2ESG/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,r){e.call(this,t,r);this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),
/*!
 * jQuery Mousewheel 3.1.13
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license
 * http://jquery.org/license
 */
o=function(e){var t,r,i=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],n="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],o=Array.prototype.slice;if(e.event.fixHooks)for(var a=i.length;a;)e.event.fixHooks[i[--a]]=e.event.mouseHooks;var s=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var t=n.length;t;)this.addEventListener(n[--t],l,!1);else this.onmousewheel=l;e.data(this,"mousewheel-line-height",s.getLineHeight(this)),e.data(this,"mousewheel-page-height",s.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var t=n.length;t;)this.removeEventListener(n[--t],l,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var r=e(t),i=r["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(r.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function l(i){var n,a=i||window.event,l=o.call(arguments,1),d=0,p=0,h=0,f=0,g=0;if((i=e.event.fix(a)).type="mousewheel","detail"in a&&(h=-1*a.detail),"wheelDelta"in a&&(h=a.wheelDelta),"wheelDeltaY"in a&&(h=a.wheelDeltaY),"wheelDeltaX"in a&&(p=-1*a.wheelDeltaX),"axis"in a&&a.axis===a.HORIZONTAL_AXIS&&(p=-1*h,h=0),d=0===h?p:h,"deltaY"in a&&(d=h=-1*a.deltaY),"deltaX"in a&&(p=a.deltaX,0===h&&(d=-1*p)),0!==h||0!==p){if(1===a.deltaMode){var m=e.data(this,"mousewheel-line-height");d*=m,h*=m,p*=m}else if(2===a.deltaMode){var v=e.data(this,"mousewheel-page-height");d*=v,h*=v,p*=v}if(n=Math.max(Math.abs(h),Math.abs(p)),(!r||n<r)&&(r=n,u(a,n)&&(r/=40)),u(a,n)&&(d/=40,p/=40,h/=40),d=Math[d>=1?"floor":"ceil"](d/r),p=Math[p>=1?"floor":"ceil"](p/r),h=Math[h>=1?"floor":"ceil"](h/r),s.settings.normalizeOffset&&this.getBoundingClientRect){var b=this.getBoundingClientRect();f=i.clientX-b.left,g=i.clientY-b.top}return i.deltaX=p,i.deltaY=h,i.deltaFactor=r,i.offsetX=f,i.offsetY=g,i.deltaMode=0,l.unshift(i,d,p,h),t&&clearTimeout(t),t=setTimeout(c,200),(e.event.dispatch||e.event.handle).apply(this,l)}}function c(){r=null}function u(e,t){return s.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],o):"object"==typeof exports?module.exports=o:o(e),t.define("jquery.select2ESG",["jquery","jquery-mousewheel","./select2ESG/core","./select2ESG/defaults","./select2ESG/utils"],function(e,t,r,i,n){if(null==e.fn.select2ESG){var o=["open","close","destroy"];e.fn.select2ESG=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var i=e.extend(!0,{},t);new r(e(this),i)}),this;if("string"==typeof t){var i,a=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=n.GetData(this,"select2ESG");null==e&&window.console&&console.error&&console.error("The select2ESG('"+t+"') method was called on an element that is not using Select2."),i=e[t].apply(e,a)}),e.inArray(t,o)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2ESG.defaults&&(e.fn.select2ESG.defaults=i),r}),{define:t.define,require:t.require}}(),r=t.require("jquery.select2ESG");return e.fn.select2ESG.amd=t,r});